I have modified a version Sozobon C Compiler to work 'somewhat' with the
Sega Genesis.  What do you mean by 'somewhat'?  Well, there are still
some limitiations which the programmer must be aware of.  I have made
two changes to the Linker (ld) which allow the following:

1) All variables will start at $FF0000.
2) A new -g option will pad the output file with $FF on 128K boundaries.

As I mentioned before here is the limitation:

Example 1
---------

long score;

main()
{
    score = 0;

    score += 10;
}

This will work fine, but if you try this...

long score = 0;

main()
{
    score += 10;
}

This will not work because the compiler will use a 'dc.l' instead of a 'ds.l' 
and that would place the varible 'score' in the data section which would be
located in the ROM.  So use the first method!  Unfortunitely, this will
force the programmer to manually initialize variables (example 1).
Note: If you use a develment board which allows you to use the cartridge
area as RAM then this will not be a problem.  However, if you ever
ROM'ed your program then it will not work correctly.

As I get familiar with the compiler I may implement more things.  

I have include some demo C programs which will help you get
familiar with Genesis programming.  Each demo will add alittle
to the previous example.

DEMO1 - demo1.c  = Display some characters on the screen.
        sega.s
        charset.s
        makefile

DEMO2 - demo2.c  = Fade in the characters on the screen.
        sega.s
        charset.s
        makefile

DEMO3 - demo3.c  = Play a digitized sample.
        sega.s
        sound.s
        z80.asm
        makefile

DEMO4 - demo4.c  = Fade in, and play sample.
        sega.s
        sound.s
        makefile

DEMO5 - demo5.c  = Fade in, scroll text, and play sample.
        sega.s
        sound.s
        charset.s
        makefile

DEMO6 - demo6.c  = Display a sprite and use the joypad to
        sega.s     move it around the screen.
        makefile

BIN   - hcc  = sozobon compiler
        jas  =    "    assembler
        top  =    "    optimizer
        ld   =    "    linker
        make = GNU make

Have fun!!!!

- Paul

email: plee1@ect.enron.com

