SNES in C

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
SNES in C
by on (#167746)
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
by on (#167753)
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
by on (#167755)
I haven't used devkitsnes, so ...?
Re: SNES in C
by on (#167784)
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
by on (#167798)
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)