Snes SDK Toolchain

Yesterday i learnt from Lint that there is a new Snes toolchain coming down. The Project can be found herehttp://code.google.com/p/snes-sdk/. Right now i have it running under linux. Just working on a patch for os x. Thumbs up to Ulrich Hecht for his work on this project.

Features:

  • WLA DX Assembler Backend
  • 816-tcc C Compiler
  • 816-opt ASM Source Code optimizer
  • crt0_snes Startup code in asm
  • libc.asm Tiny libc in asm

Project layout

david@slap:[~/Devel/arch...h/snes/snes-sdk]$ ls -l
total 40
drwxr-xr-x  2 david david  4096 2009-04-27 13:52 bin/
drwxr-xr-x  3 david david  4096 2009-04-27 14:04 libs/
-rw-r--r--  1 david david  1387 2009-04-27 13:59 Makefile
drwxr-xr-x 11 david david  4096 2009-04-27 14:01 snes9x/
drwxr-xr-x  3 david david  4096 2009-04-28 09:29 snesc/
drwxr-xr-x  7 david david  4096 2009-04-27 14:14 tcc-65816/
-rw-r--r--  1 david david 11304 2009-04-27 13:24 TODO
drwxr-xr-x 16 david david  4096 2009-04-27 13:59 wla_dx/

Libc

-rw-r--r-- 1 david david  7946 2009-04-27 13:23 crt0_snes.asm
-rw-r--r-- 1 david david  6096 2009-04-27 13:59 crt0_snes.obj
-rw-r--r-- 1 david david  1755 2009-04-27 14:04 hdr.asm
-rw-r--r-- 1 david david  7108 2009-04-27 13:23 libc.asm
-rw-r--r-- 1 david david 12160 2009-04-27 13:59 libc.obj
-rw-r--r-- 1 david david 11087 2009-04-27 13:23 libm.asm
-rw-r--r-- 1 david david 14670 2009-04-27 13:59 libm.obj
-rw-r--r-- 1 david david  6051 2009-04-27 13:23 libtcc.asm
-rw-r--r-- 1 david david 10101 2009-04-27 13:59 libtcc.obj
-rw-r--r-- 1 david david   132 2009-04-27 13:46 Makefile
drwxr-xr-x 6 david david  4096 2009-04-27 13:24 .svn/

Compile run of the demo game

rm -f snesc.smc snesc.sym data.obj graph_asm.obj str.obj 
snesc.obj input.obj init.obj graph.obj *.s
/home/david/Devel/arch/snes/devkit/bin/wla-65816 -io data.asm data.obj
/home/david/Devel/arch/snes/devkit/bin/wla-65816 -io graph_asm.asm graph_asm.obj
/home/david/Devel/arch/snes/devkit/bin/wla-65816 -io str.asm str.obj
/home/david/Devel/arch/snes/devkit/bin/816-tcc -I. -o snesc.s.pre -c snesc.c
/home/david/Devel/arch/snes/devkit/bin/816-opt snesc.s.pre > snesc.s
optimization pass 1: 411 optimizations performed
optimization pass 2: 204 optimizations performed
optimization pass 3: 1 optimizations performed
optimization pass 4: 0 optimizations performed
616 optimizations performed in total
rm snesc.s.pre
/home/david/Devel/arch/snes/devkit/bin/wla-65816 -io snesc.s snesc.obj
/home/david/Devel/arch/snes/devkit/bin/816-tcc -I. -o input.s.pre -c input.c
/home/david/Devel/arch/snes/devkit/bin/816-opt input.s.pre > input.s
optimization pass 1: 5 optimizations performed
optimization pass 2: 2 optimizations performed
optimization pass 3: 0 optimizations performed
7 optimizations performed in total
rm input.s.pre
/home/david/Devel/arch/snes/devkit/bin/wla-65816 -io input.s input.obj
/home/david/Devel/arch/snes/devkit/bin/816-tcc -I. -o init.s.pre -c init.c
/home/david/Devel/arch/snes/devkit/bin/816-opt init.s.pre > init.s
optimization pass 1: 74 optimizations performed
optimization pass 2: 29 optimizations performed
optimization pass 3: 0 optimizations performed
103 optimizations performed in total
rm init.s.pre
/home/david/Devel/arch/snes/devkit/bin/wla-65816 -io init.s init.obj
/home/david/Devel/arch/snes/devkit/bin/816-tcc -I. -o graph.s.pre -c graph.c
/home/david/Devel/arch/snes/devkit/bin/816-opt graph.s.pre > graph.s
optimization pass 1: 7 optimizations performed
optimization pass 2: 4 optimizations performed
optimization pass 3: 0 optimizations performed
11 optimizations performed in total
rm graph.s.pre
/home/david/Devel/arch/snes/devkit/bin/wla-65816 -io graph.s graph.obj
/home/david/Devel/arch/snes/devkit/bin/wlalink -dvSo data.obj graph_asm.obj 
str.obj snesc.obj input.obj init.obj graph.obj snesc.smc
DISCARD: /home/david/Devel/arch/snes/devkit/lib/libc.obj:libc.asm: 
Section ".libc_misc" was discarded.
DISCARD: /home/david/Devel/arch/snes/devkit/lib/libc.obj:libc.asm: 
Section ".libc_cstd" was discarded.
Free space at $6833-$7fb1.
Free space at $7fb6-$7fbf.
Free space at $7fe0-$7fe3.
Free space at $7ff0-$7ff3.
Free space at $8000-$3ffff.
Bank 00 has 06033 bytes (18.41%) free.
Bank 01 has 32768 bytes (100.0%) free.
Bank 02 has 32768 bytes (100.0%) free.
Bank 03 has 32768 bytes (100.0%) free.
Bank 04 has 32768 bytes (100.0%) free.
Bank 05 has 32768 bytes (100.0%) free.
Bank 06 has 32768 bytes (100.0%) free.
Bank 07 has 32768 bytes (100.0%) free.
235409 unused bytes of total 262144.
../../tool/bsnes/bsnes snesc.smc || xset r on
SNES SDK running a demo game

SNES SDK running a demo game

1 comment

  1. So wait, this is a literal SDK for the Super Nintendo? I read that correctly, right? If so, AWESOME! Is this still active? This is something I would love to learn to use in programming.

    But I’m reading that there’s only a Linux version, and a Mac port in progress correct? Is there plans for Windows? Sorry if I overlooked everything, very tired 🙂

Leave a Reply

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