It is currently Wed Oct 18, 2017 6:35 pm

All times are UTC - 7 hours



Forum rules


Related:



Post new topic Reply to topic  [ 38 posts ]  Go to page 1, 2, 3  Next
Author Message
PostPosted: Tue Feb 03, 2015 2:48 am 
Offline

Joined: Tue Feb 03, 2015 2:14 am
Posts: 6
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?


Top
 Profile  
 
PostPosted: Tue Feb 03, 2015 3:14 am 
Offline

Joined: Sun Aug 11, 2013 6:07 am
Posts: 57
Yes, some were written (at least partially) in C, was that all you wanted to know?


Top
 Profile  
 
PostPosted: Tue Feb 03, 2015 3:21 am 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7230
Location: Chexbres, VD, Switzerland
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.


Top
 Profile  
 
PostPosted: Tue Feb 03, 2015 3:34 am 
Offline

Joined: Tue Feb 03, 2015 2:14 am
Posts: 6
ARM9 wrote:
Yes, some were written (at least partially) in C, was that all you wanted to know?

Do you have any examples of games which used C?

Is there a way to know (or to estimate) whether a game made significant use of C, based only on a ROM dump?


Top
 Profile  
 
PostPosted: Tue Feb 03, 2015 6:39 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19098
Location: NE Indiana, USA (NTSC)
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.


Top
 Profile  
 
PostPosted: Tue Feb 03, 2015 8:14 am 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7230
Location: Chexbres, VD, Switzerland
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.

Which of C compilers were popular at that time ?
What was their calling convention ?


Top
 Profile  
 
PostPosted: Tue Feb 03, 2015 8:21 am 
Offline

Joined: Thu Aug 28, 2008 1:17 am
Posts: 591
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.

How does one identify such a string?

_________________
__________________________
http://pcedev.wordpress.com


Top
 Profile  
 
PostPosted: Tue Feb 03, 2015 8:29 am 
Offline

Joined: Sun Aug 11, 2013 6:07 am
Posts: 57
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?

tomaitheous wrote:
tepples wrote:
Possibilities: [list][*]If you see C format strings, then C was likely used. NovaSquirrel found (at least a subset of) C format strings in Koei games.

How does one identify such a string?

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.


Top
 Profile  
 
PostPosted: Tue Feb 03, 2015 9:20 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19098
Location: NE Indiana, USA (NTSC)
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:
  • 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.


Top
 Profile  
 
PostPosted: Tue Feb 03, 2015 11:33 am 
Offline
User avatar

Joined: Mon Sep 15, 2014 4:35 pm
Posts: 3071
Location: Nacogdoches, Texas
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.)


Top
 Profile  
 
PostPosted: Tue Feb 03, 2015 12:08 pm 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7230
Location: Chexbres, VD, Switzerland
Espozo wrote:
I heard Chrono Trigger was written in C, but I don't remember where I heard it and it's probably false.

I do not know the inner working of the game, but this was maybe about the DS or the Playstation version.


Top
 Profile  
 
PostPosted: Tue Feb 03, 2015 2:13 pm 
Offline

Joined: Thu Aug 12, 2010 3:43 am
Posts: 1589
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).


Top
 Profile  
 
PostPosted: Tue Feb 03, 2015 2:51 pm 
Offline
User avatar

Joined: Sun Sep 19, 2004 9:28 pm
Posts: 3192
Location: Mountain View, CA, USA
Bregalad wrote:
Espozo wrote:
I heard Chrono Trigger was written in C, but I don't remember where I heard it and it's probably false.

I do not know the inner working of the game, but this was maybe about the DS or the Playstation version.

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.

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.


Top
 Profile  
 
PostPosted: Fri Feb 06, 2015 11:07 am 
Offline

Joined: Sun Aug 11, 2013 6:07 am
Posts: 57
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.


Top
 Profile  
 
PostPosted: Mon Feb 09, 2015 1:44 am 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7230
Location: Chexbres, VD, Switzerland
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

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.

Quote:
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.

Source, please.

Quote:
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.

This would rather point to hand-optimised assembly, although this is not necessary contradictory with another part of the game being written in C.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 38 posts ]  Go to page 1, 2, 3  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: nicklausw and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group