Were any commercial SNES games written in C?

Discussion of hardware and software development for Super NES and Super Famicom.

Moderator: Moderators

Forum rules
  • For making cartridges of your Super NES games, see Reproduction.
User avatar
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?

Post by Drew Sebastino »

Stef wrote:is there any C compiler for the SuperFX in first place ? I don't think so...
Here's something I found from http://en.wikibooks.org/wiki/Super_NES_ ... X_routines, although I'm not sure how useful it is:
Wikibooks wrote:Whilst SNES assembly language programs can be compiled using a regular 65c816 compiler, the SuperFX assembly language requires a custom compiler. The original compiler used on existing SuperFX games has not been released outside the closed development community. An open source compiler is rumored to be in development as of January 2015 to compile SuperFX programs.
tepples
Posts: 22345
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Were any commercial SNES games written in C?

Post by tepples »

Unless by "compiler" they mean "assembler".
psycopathicteen
Posts: 3001
Joined: Wed May 19, 2010 6:12 pm

Re: Were any commercial SNES games written in C?

Post by psycopathicteen »

Nitroman wrote:Many games actually may be coded in C, I heard japanese devs mostly used C and that even SuperFX-2 title Doom coded in C with no assembly involved what so ever. Makes sense for me, if some game's slowdowns too much.
I would make a whole lot of sense, explaining how programmers were capable of making such a mess, but still were able to somehow finish the game on schedule. That's the thing about programming, if you try to rush through it, you're bound to get stuck later on.
ARM9
Posts: 57
Joined: Sun Aug 11, 2013 6:07 am

Re: Were any commercial SNES games written in C?

Post by ARM9 »

Stef wrote:I'm really septic about the fact that Doom on SNES was coded in C, is there any C compiler for the SuperFX in first place ? I don't think so...
There's no official argonaut or nintendo C compiler for the GSU, but iirc carmack has dabbled in compiler development so it's certainly a possibility.
I might skim through it at some point and see if there's anything indicative of compiler (ab)use.
Wikibooks wrote:An open source compiler is rumored to be in development as of January 2015 to compile SuperFX programs.
Compiler, or assembler? Who wrote this article, are they active on this board?
Optiroc
Posts: 129
Joined: Thu Feb 07, 2013 1:15 am
Location: Sweden

Re: Were any commercial SNES games written in C?

Post by Optiroc »

ARM9 wrote:
Stef wrote:I'm really septic about the fact that Doom on SNES was coded in C, is there any C compiler for the SuperFX in first place ? I don't think so...
There's no official argonaut or nintendo C compiler for the GSU, but iirc carmack has dabbled in compiler development so it's certainly a possibility.
I might skim through it at some point and see if there's anything indicative of compiler (ab)use.
Before QuakeC I don't think Carmack did any compiler development that saw use, and more importantly he was always quite ruthlessly chasing performance rather than some more academic higher level "elegance". Most of the original Doom rendering code is x86 assember.

Also, the SNES port was programmed by Randy Linden of Sculptured Software using their own SFX2+ development system. IIRC there was some C support in their dev kit, but again, using C for the rendering code (or anything in game, really) and get the performance of the SNES Doom port is quite unthinkable.
ARM9 wrote:
Wikibooks wrote:An open source compiler is rumored to be in development as of January 2015 to compile SuperFX programs.
Compiler, or assembler? Who wrote this article, are they active on this board?
I'd be surprised if this was referencing anything but your ca65 SuperFX macros.
cdcdcd
Posts: 2
Joined: Wed Sep 07, 2016 4:27 pm

Re: Were any commercial SNES games written in C?

Post by cdcdcd »

The only part of Doom that used x86 assembly was a small procedure that dealt with ray casting. This could have been implemented in C - why not I don't know? All the rest of the rendering including texturing was written in C. The source code was uploaded over ten years ago and is available on GitHub.
Last edited by cdcdcd on Thu Sep 08, 2016 1:53 pm, edited 1 time in total.
lidnariq
Posts: 10677
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: Were any commercial SNES games written in C?

Post by lidnariq »

C on a 486 is a very different beast than C on the 65816...
Revenant
Posts: 455
Joined: Sat Apr 25, 2015 1:47 pm
Location: FL

Re: Were any commercial SNES games written in C?

Post by Revenant »

The latest SNES game I've personally looked at which was almost definitely written in C (or some other higher-level language) is HAL's mediocre port of SimCity 2000. Take a look and you'll notice the direct page pointer being used as a frame pointer, with functions doing an obscene number of reads/writes to direct page memory to deal with variables in really roundabout ways that feel exactly like the sort of code a (not particularly clever) compiler would generate, being much larger, slower and less idiomatic than anything that tends to be seen in hand-written assembly. There are also some functions that behave basically identically to C standard library functions like strcmp, etc.

Some late-era EA Sports titles are similar, including a stack-based calling convention, even more naive compiler-isms (like explicitly allocating 0 bytes on the stack for functions with no local variables), a stubbed-out version of printf used for debug output, etc.

I haven't looked into the SNES port of Doom as much as some other games, but what I've seen of it looked rather hand-written to me.
Post Reply