Page 1 of 1

SNES in C

Posted: Tue Apr 05, 2016 3:32 pm
by dougeff
Just as a thought experiment...

I've been trying to think of a useful, practical way to use cc65 to program an SNES game.

I think, the most reasonable solution would be to write a large amount of ASM library functions that you can call from the C code.

My concern is how the C code will work with multiple banks. You would presumably have to compile each bank separately, so you can be sure that the C library is accessible to each bank. Right?

Again, theoretically.

Re: SNES in C

Posted: Tue Apr 05, 2016 4:08 pm
by lidnariq
A few thoughts:

* If you can fit your entire C-language engine into the first bank, you could store data in other banks. Using DMA even lets you leave the 65816 in emulation mode...

* Does cc65 cleverly put data in the RODATA segment and code in the CODE segment? So that K≠B?

* How does cc65's generated code (targeting the 65c02) compare to the results of devkitsnes's tcc+optimore+816opt ?

Re: SNES in C

Posted: Tue Apr 05, 2016 4:44 pm
by dougeff
I haven't used devkitsnes, so ...?

Re: SNES in C

Posted: Wed Apr 06, 2016 11:26 am
by Mills
There is something called pvsneslib, a library to program snes using C. But it looks like it is not being updated any more.

Re: SNES in C

Posted: Wed Apr 06, 2016 5:16 pm
by dougeff
Nevermind. I think I'm going to stick with ASM (ca65)

(And not any time soon, since I've got too many other projects to do first).

(Edited)