Page 1 of 1

Abusing the Emulator for Fun and Profit

Posted: Sun Aug 23, 2020 11:18 pm
by rje

Just this afternoon, I realized that when I pass “-bas my-file” to the emulator, it is TYPED IN, so to speak.

If I didn’t care about compatibility with the X16, then I could front-load my program with a pile of initializations in “immediate mode” without incurring the penalty of storing lines of BASIC DATA statements.

Useless in the light of wanting to support the X16 as a physical chunk of hardware, so mostly an amusing observation.  Unless I use that in the place of loading data files into the RAM banks perhaps... but I don’t see the benefit there, so.


Abusing the Emulator for Fun and Profit

Posted: Mon Aug 24, 2020 2:53 am
by SlithyMatt

Good observation. This could be used to do script-generated configuration, though only with the emulator. But, that may be useful in determining a fixed configuration to use for production.

Another good use case I can see is programmatically initializing VRAM and/or banked RAM, then NEW-ing it out to load in the program code, which could be in BASIC or machine language. This would really only be useful when the initialization has a randomized element to it, otherwise you could just load pre-initialized binaries. This use case would extend to production, where the initialization program blows itself away with the actual application code once it's done. Developing this construct would be very easy by just loading ASCII BASIC files from the host until the init/launch code is finalized. Cuts down on a lot of the process.


Abusing the Emulator for Fun and Profit

Posted: Fri Aug 28, 2020 2:57 am
by geek504

I came here expecting to see some sort of smashing the stack for fun and profit... the classic buffer-overflow treatsie!


Abusing the Emulator for Fun and Profit

Posted: Fri Aug 28, 2020 2:59 pm
by rje


12 hours ago, geek504 said:




I came here expecting to see some sort of smashing the stack for fun and profit... the classic buffer-overflow treatsie!



That sounds like fun.


Abusing the Emulator for Fun and Profit

Posted: Fri Sep 04, 2020 3:16 am
by rje

I just realized that this is more powerful and useful than I thought:

THE FUZZY PROBLEM

One of the games I'm writing uses data ... this data is already established, so its nature and content are understood.  All I have to do is get it on the SD card in a way that the X16 likes.

I expect to have around 125 subdirectories, each with 16 files give or take.  Each file is smaller than 8K in size.

 

THE IMMEDIATE MODE SOLUTION

"Immediate" mode can be used to create one subdirectory and its 16 files in one shot.

Or maybe more... since this is immediate mode, I can make it a "stream" of small programs, each of which creates a file.

Or, even better, one program that creates a file, and immediate data that loads in the data to write AND run that program, then load in another set of data, run the program, and repeat 2000 times.