SNES 65c816 C Compiler

Thanks to Lint i found a C compiler for the SNES. The Sdk is only for windows but i got i working with wine. So i managed to port one of Lint’s c sample code to unix makefile.You can fetch the fully working source:

git://github.com/optixx/snes.git

# SDK Config

SDK=/home/david/.wine/drive_c/65xx_FreeSDK
CC=$(SDK)/bin/WDC816CC.exe
AS=$(SDK)/bin/WDC816AS.exe
LD=$(SDK)/bin/WDCLN.exe

# External Tools

PADBIN=wine tools/padbin.exe
PCX2SNES=wine tools/Pcx2Snes.exe

# Project

LIBS=$(SDK)/lib/cs
OBJS=StartupSnes.obj main.obj pad.obj event.obj myEvents.obj PPU.obj debug.obj ressource.obj
APP=rom.smc
GFX=kungfu debugfont

all:  $(APP)

run: $(APP)
        zsnes $(APP)

kungfu:
        $(PCX2SNES) ressource/kungfu -n -c16 -screen

debugfont:
        $(PCX2SNES) ressource/debugFont -n -c16 -s8 -o1

%.obj: %.asm
        $(AS) -V $?

%.obj: %.c
        $(CC) -wl -wp -sop -MS $?

$(APP): $(GFX) $(OBJS)
        $(LD) -HB -M21 -V -T -Pff \
                -C008000,0000 -U0000,0000 \
                -Avectors=FFE4,7FE4 \
                -Aregistration_data=FFB0,7FB0 \
                -Aressource=18000,8000 \
                -N $(OBJS) -L$(LIBS) -O $@
        $(PADBIN) 0x40000 rom.smc

clean:
        rm -vf $(APP) *.obj

Leave a Reply

Your email address will not be published. Required fields are marked *