Use Xcode (best developer environment of all time) with SDCC installed,
http://sdcc.sourceforge.net/
Also, download Daniel Bienvenu's windows C package from this forum, his library files are invaluable even if you don't use them directly and just reference them on how to get a game up and running in C. I couldn't have gotten started without his amazingly helpful work.
Finally, use a makefile like this in Xcode (probably not the most elegant makefile, but it works for me just fine) and you can build just like any other Xcode project-
Quote
#########################################################################################
# Place pre-compiled .rel (object) files into the <object> folder so that they are #
# not removed when calling clean. #
# Place library files in the <lib> folder. #
# FUNCTIONS: build, all, copy, cleanup, clean #
#########################################################################################
# COMPILER VARIABLES #
CC = "/Developer/sdcc/bin/sdcc"
CCASM = "/Developer/sdcc/bin/sdasz80"
# FLAGS FOR COMPILING, LINKING, AND ASSEMBLY COMPILING #
#FLAGSC = -mz80 -c -V --std-c99 --all-callee-saves
FLAGSC = -mz80 -c -V --std-sdcc89 --main-return
FLAGSL = -mz80 --code-loc 0x8021 --data-loc 0x7000 --no-std-crt0
FLAGSA = -o
# LIST .S ASSEMBLY FILES HERE #
OBJLIB1 = crt0.rel decompress.rel
OBJLIB2 = spritesASM.rel soundASM.rel collisionASM.rel pointers.rel enemyAI.rel collisionHandler.rel menu.rel
# LIST .C SOURCE FILES HERE #
OBJ1 = main.rel input.rel graphic_data.rel sound_data.rel
OBJ2 = collision.rel sprites.rel
OBJS1 = screen00.rel
OBJS2 = screen09.rel
# BUILDS THE ROM, THEN CLEANS UP ALL FILES PRODUCED #
build : clean all copy cleanup
# THE TARGET IS RESULT.IHX, WHICH IS THEN COPIED INTO A BINARY #
all : result.ihx
# BUILD INSTRUCTIONS FOR COMPILING THE ROM #
result.ihx : $(OBJLIB1) $(OBJLIB2) $(OBJ1) $(OBJ2) $(OBJS1) $(OBJS2)
$(CC) $(FLAGSL) $(OBJLIB1) $(OBJLIB2) $(OBJ1) $(OBJ2) $(OBJS1) $(OBJS2) -o result.ihx
# SCANS FOR ALL .C SOURCE FILES USING $< OPERATOR #
%.rel : %.c
$(CC) $(FLAGSC) $<
# RULE TO BUILD .S ASSEMBLY FILES
%.rel : %.s
$(CCASM) $(FLAGSA) $<
# CONVERTS INTEL HEX FORMAT TO BINARY USING OBJCOPY AND DUMPS TO RESULT.ROM #
copy : result.ihx
objcopy --input-target=ihex --output-target=binary result.ihx result.rom
# CLEANS UP ALL FILES EXCEPT FOR RESULT.IHX #
.PHONY : cleanup
cleanup :
-rm -f *.rel *.lst *.sym *.lnk *.map *.noi *.asm *.ihx
# REMOVES RESULT.IHX #
.PHONY : removeihx
removeihx :
-rm -f *.ihx
# CLEANS UP EVERY SINGLE FILE IN FOLDER EXCEPT SOURCE FILES #
.PHONY : clean
clean :
-rm -f *.rel *.lst *.sym *.lnk *.map *.noi *.ihx *.asm *.rom
To debug I took the Mac Meka port and made an .app out of it so you don't have to install allegro-
http://www.smspower....pic.php?t=13308 it's around the middle of the posts, the file you want is
MekaOSX.dmg (2.38 MB).
Meka has the best debugger I've ever seen, it'll seriously make your life 100 times easier. You can watch RAM, VRAM, and registers all in real time.
Edited by kingofcrusher, Thu Feb 9, 2012 11:22 AM.