Were any commercial SNES games written in C?
Moderator: Moderators
Forum rules
- For making cartridges of your Super NES games, see Reproduction.
-
- Posts: 7
- Joined: Tue Feb 03, 2015 2:14 am
Were any commercial SNES games written in C?
Although many (most?) commercial Sega Genesis games were written in 68000 assembly language, some (including Ecco, The Lion King and Sonic Spinball) were written in C.
Are any commercial SNES games known to have been written in C (or another compiled language), or are they all believed to have used 65816 assembly?
Are any commercial SNES games known to have been written in C (or another compiled language), or are they all believed to have used 65816 assembly?
Re: Were any commercial SNES games written in C?
Yes, some were written (at least partially) in C, was that all you wanted to know?
Re: Were any commercial SNES games written in C?
I was asking myself the exact same question.
What matters to me however is not a yes/no answer, but a clear and accurate reference to : Game X was programmed with language Y.
What matters to me however is not a yes/no answer, but a clear and accurate reference to : Game X was programmed with language Y.
-
- Posts: 7
- Joined: Tue Feb 03, 2015 2:14 am
Re: Were any commercial SNES games written in C?
Do you have any examples of games which used C?ARM9 wrote:Yes, some were written (at least partially) in C, was that all you wanted to know?
Is there a way to know (or to estimate) whether a game made significant use of C, based only on a ROM dump?
Re: Were any commercial SNES games written in C?
Possibilities:
- If you see C format strings, then C was likely used. NovaSquirrel found (at least a subset of) C format strings in Koei games.
- Or if you see the calling conventions of a particular C compiler popular at the time, then C was likely used.
- Or if you see the characteristic unoptimized instruction sequences of a particular C compiler popular at the time, then C was likely used.
Re: Were any commercial SNES games written in C?
Which of C compilers were popular at that time ?tepples wrote:Possibilities:
- Or if you see the calling conventions of a particular C compiler popular at the time, then C was likely used.
- Or if you see the characteristic unoptimized instruction sequences of a particular C compiler popular at the time, then C was likely used.
What was their calling convention ?
-
- Posts: 592
- Joined: Thu Aug 28, 2008 1:17 am
- Contact:
Re: Were any commercial SNES games written in C?
How does one identify such a string?tepples wrote:Possibilities:
- If you see C format strings, then C was likely used. NovaSquirrel found (at least a subset of) C format strings in Koei games.
- Or if you see the calling conventions of a particular C compiler popular at the time, then C was likely used.
- Or if you see the characteristic unoptimized instruction sequences of a particular C compiler popular at the time, then C was likely used.
__________________________
http://pcedev.wordpress.com
http://pcedev.wordpress.com
Re: Were any commercial SNES games written in C?
The only 65816 C compilers I know of from back then was ORCA/c, the zardoz toolchain and TMorita's lcc retarget (which used ORCA/m for the assembly/linker backend).
They (TMorita) supposedly used C for Zombies ate my neighbors. There was also this obscure japanese puzzle platformer that blatantly used the zardoz compiler (bought by wdc, called wdc816cc these days).
I've heard rumors that square used C in some of their later titles, still haven't seen anything that confirms this though.
Ballz 3D might have been written partially in C, it does a lot of things that imply that C was used.
Yes, it's possible, why do you want to know?
They (TMorita) supposedly used C for Zombies ate my neighbors. There was also this obscure japanese puzzle platformer that blatantly used the zardoz compiler (bought by wdc, called wdc816cc these days).
I've heard rumors that square used C in some of their later titles, still haven't seen anything that confirms this though.
Ballz 3D might have been written partially in C, it does a lot of things that imply that C was used.
Yes, it's possible, why do you want to know?
I don't think C strings indicate that C was used, C strings end with $00 and sometimes contain modifiers like %d and %s etc. This is a pretty useful format and I'd think assembly programmers back when used it as well.tomaitheous wrote:How does one identify such a string?tepples wrote:Possibilities:
- If you see C format strings, then C was likely used. NovaSquirrel found (at least a subset of) C format strings in Koei games.
Re: Were any commercial SNES games written in C?
For the avoidance of doubt, by format strings I meant strings with format specifiers like "%d" and "%s" in them. These are what Nova found. True, an assembly language implementation of a subset of sprintf() called by pure assembly language could also use format strings. But Koei was trying to target multiple platforms with different instruction sets.
So let me add a fourth heuristic:
So let me add a fourth heuristic:
- If the game came out on in several instruction sets (68000, 65816, and whatever the F else), and its code isn't tightly optimized, and it doesn't use a bytecode platform such as SCUMM or Z-machine, C was likely used.
- Drew Sebastino
- Formerly Espozo
- Posts: 3496
- Joined: Mon Sep 15, 2014 4:35 pm
- Location: Richmond, Virginia
Re: Were any commercial SNES games written in C?
I heard Chrono Trigger was written in C, but I don't remember where I heard it and it's probably false. If the Lion King on the Genesis was written in C, does anyone know if the SNES version is? (I don't know much about C, but this would probably allow for an easy conversion, if I'm right.)
Re: Were any commercial SNES games written in C?
I do not know the inner working of the game, but this was maybe about the DS or the Playstation version.Espozo wrote:I heard Chrono Trigger was written in C, but I don't remember where I heard it and it's probably false.
Re: Were any commercial SNES games written in C?
Of note that a game programmed in assembly would be more likely to use sentinel values (a non-character value, e.g. 0xFF) than stuff like "%d" in strings, so finding printf-style formatting can hint at it being C (if the program also uses the stack heavily, chances are that's indeed the case). Also having a subset means nothing since games made in C for those consoles usually would have their own implementations of the standard functions and even then only the stuff that was needed (IIRC Sonic Spinball only implemented three format specifiers, for example - yes, I know that isn't SNES but point stands =P).
Re: Were any commercial SNES games written in C?
It was the SNES version I'm fairly sure. Going purely off memory from something discussed like 15 years ago: there are printf()-style strings found within the game code, and some reverse-engineering done by Internet people (whose names I forget) implied a lot of the methodology used looked C-focused, i.e. heavy use of stack-based addressing if I remember right, so that functions/etc. can get called by pushing pointers on the stack + accessing them within the subroutine.Bregalad wrote:I do not know the inner working of the game, but this was maybe about the DS or the Playstation version.Espozo wrote:I heard Chrono Trigger was written in C, but I don't remember where I heard it and it's probably false.
Chrono Trigger is also one of those games where Square did stuff like lda #$2100/tcd just so they could access SNES MMIO registers via DP addressing.
Re: Were any commercial SNES games written in C?
I found out what the game written in C was called, it's Sutte Hakkun. If you don't have wdc816cc and want to see what compiled C code for 65816 might look like, have fun.
Re: Were any commercial SNES games written in C?
Sorry but no, there is no printf()-style strings in the SNES version of CT. The game doesn't even use ASCII to begin with, and a search for %d or similar in the ROM does not reveal anything.koitsu wrote: It was the SNES version I'm fairly sure. Going purely off memory from something discussed like 15 years ago: there are printf()-style strings found within the game code
Source, please.and some reverse-engineering done by Internet people (whose names I forget) implied a lot of the methodology used looked C-focused, i.e. heavy use of stack-based addressing if I remember right, so that functions/etc. can get called by pushing pointers on the stack + accessing them within the subroutine.
This would rather point to hand-optimised assembly, although this is not necessary contradictory with another part of the game being written in C.Chrono Trigger is also one of those games where Square did stuff like lda #$2100/tcd just so they could access SNES MMIO registers via DP addressing.