pdewacht / oberon-risc-emu

Emulator for the Oberon RISC machine
273 stars 51 forks source link

Configurable Memory in Oberon Emulator #11

Closed charlesap closed 5 years ago

charlesap commented 5 years ago

Here are some changes that allow the user to specify how much memory to give the risc emulator. I modified the -s parameter to optionally allow memory to be specified, for example:

./risc DISK.img -s 8M1280x1024

gives 8 megabytes to the emulator with the top of that memory reserved for a 1280x1024 monochrome display. Specifying '0M' or leaving the M value off gives the original behavior.

I also adapted the Display.Mod code to use a variable for the base of video memory instead of a constant. Display.Mod must be recompiled in the Oberon system before it will properly work in an expanded memory environment, of course.

These changes to oberon-risc-emu also patch the boot loader ROM on the fly with the new memory limit and stack origin parameters so the rest of the Oberon code requires no changes.

I hope you find these changes useful,

Best Regards, Chuck

pdewacht commented 5 years ago

The feature seemed interesting, but I found your code rather messy. I pushed a commit that tries to do it in a cleaner way.

pdewacht commented 5 years ago

I've now also pushed an updated disk image, which includes the required Display module changes as well as the latest source from Wirth.

I should also mention that I've changed how the option works: risc -m 8 -s 1280x1024

Let me know if you have problems, it seems to work well for me.

charlesap commented 5 years ago

Excellent, thanks! Cleaner is better, I appreciate you taking the time to look at the code and to incorporate what you found useful.