I've been compiling ZXSimulator on a fast PC running QLAY2 on Windows. Being at the 8-week mark of this project I wanted to be a bit authentic and create an executable that was actually compiled on my QL, close to the way I would have done it with the original interpreter in the 90's. Back in the day I didn't have extra memory but did eventually get a Kempston disk-interface expansion card and a 3.5 inch floppy. I initially developed the interpreter with Digital 'C' SE using MDV drives before I upgraded to the floppy.
Now I don't own a floppy anymore and I wanted to avoid sitting through failed MDV cartridges so I stuck with vDrive which doesn't really add anything else and just emulates MDV's with 128KB of data capacity (so that was pretty close). If I had good MDV cartridges, after a lot of whirring, I'd get to the same place (instead of the soothing whirring I get the beeping of vDrive, which isn't quite the same). I don't think vDrive actually speeds up the data reading/writing part.
My setup had MDV3 holding the source (zx_c) and MDV4 holding Digital 'C' SE containing the following (I don't have vMap so MDV1 and MDV2 aren't available to me for the SD card). Note this only leaves 13K free.
- cc - parser
- cg - code generator
- lg - linker (not needed)
- config - used to configure above three for MDV3/MDV4 -- set to MDV4
- stdio_h - base header file
- std_lib - base library
- mc_obj - base obj fiel
- trap1_c - not sure if needed
- vutil_c - not sure if needed
- arc_exe - my favorite archiver back in the 90's by Ralf Biedermann
So with only 2 MDV's you basically have to move cc from MDV4 to MDV3 to clear out space for the generated object file needed on MDV4. Then you type:
exec mdv3_cc
...and when prompted you enter
-p -m mdv3_zx_c and wait about 23 minutes (it took a while) and voila, it compiled. Ironically, I was watching Babylon 5, a mid 90's scifi show on TV, while doing this (we get about 3 hours a night here on Comet TV).
Then you delete the source off of MDV3 and copy
zx_obj from MDV4 to MDV3 (deleting it off of MDV4 when done) and copy cc from MDV3 back to MDV4 and delete it off of MDV3...so you basically swap the two files. You then type:
exec mdv4_cg
...and when prompted you enter
mdv3_zx mdv3_zx -nc and wait about 6-7 minutes and then you have the executable. BTW, in the 90's I divided my source code up into 4 files but haven't gotten it to work since (haven't tried on the QL so it may be an emulator issue and how it deals with media or maybe MDV vs FLP).
I then used arc_exe to compress it (via Huffman). What's nice with arc_exe is that it creates a text file that can be transported to another machine and when unarchived it keeps the executable information (like zip/unzip) but only takes up 4K of space for the archiver itself (zip can't run on an unexpanded QL).
So attached are two files. The first is zx_arc.zip which contains zx_arc, the archived executable compiled 1990's style (sans vDrive) on my QL. I really wanted to just attach the archive file since it doesn't need to be ZIP compressed but qlforum won't let you so I had to use Window's ZIP. To use it, just grab zx_arc and dump it into a directory on an SD card (if using real hardware) or a WIN directory on an emulator and use qlayt.exe to add it (but no need to worry about data space for executables since it's a data file) and then use arc_exe to expand it.
...and I included my version of arc_exe which is 4 bytes larger than what's on Dilwyn's site. You'll need unzip to expand it into a runnable executable. I got this back in the early 90's and I have no idea how since this was before the worldwide-web and I didn't use bulletin board systems. Maybe a member from our local user's group (NESQLUG) gave it to me along with the text editor (QED) I used to write the original version of the BASIC interpreter. Funny to think back on how information was shared in the 90's.
Enjoy. The ZXSimulator executable isn't really any different form the last version though it has improved syntax error handling (i.e. displaying a more accurate message when BASIC gets into trouble).