![]() Other than that, some of the code it generates is painfully slow - adding two chars, for instance, causes the compiler to promote both variables to 16 bit, push them onto the stack, and the call an adding function, at least in the version I tested. Alternately you could compile your code to run with an origin of $c000 and use a rom stub to copy the executable into RAM, but you'll run out of RAM real fast that way. Local variables are stack allocated so they are still usable, and I suppose one could depend on them exclusively as a workaround. What tripped me up was that I couldn't convince the compiler to put global variables and arrays in SMS ram - it seems z88dk wasn't written with ROM based z80 machines in mind so global variables are assigned to locations inside the executable, therefore they will be in ROM, not RAM. I've also had a crack at using z88dk for SMS development. Updated "sms.h" (I had sent an older version by mistake) Added support for the VBL/HBL interrupt (doesn't work correctly yet) Added a small utility for padding the ROM to 32k and adding the standard SEGA header to it Added an example for the decompression routine Added support for apLib decompression (based on Maxim's code) Added partial stdio.h support (write-only) This will allow the debuggers built into those emulators to correctly label the subroutines/variables of your program. Created a tool to convert z88dk's map files into Meka/Emukon-compatible symbolic definition files. Now, you have everything you need to make SMS games in C. You can already set the palette, set the tileset, define the bkg map, and position the sprites. Now most of the absolutely necessary functions are implemented. Of course you'll also have to download z88dk in order to compile the source. It still doesn't do much, since I haven't finished the libraries for it yet, but it already runs perfectly on an emulator. The attached file includes both a z88dk runtime library for SMS ROMs and an very simple example project. I've been working on adapting z88dk, a C cross-compiler for Z80 systems, to generate Sega Master System ROMs. Last edited by haroldoop on Tue 2:41 am edited 10 times in total ![]() Developing Sega Master System ROMs in C Posted: Sat 10:13 pm
0 Comments
Leave a Reply. |