Page 3 of 3
Re: Were any commercial SNES games written in C?
Posted: Sat Feb 28, 2015 6:58 am
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.
Re: Were any commercial SNES games written in C?
Posted: Sat Feb 28, 2015 8:01 am
by tepples
Unless by "compiler" they
mean "assembler".
Re: Were any commercial SNES games written in C?
Posted: Sat Feb 28, 2015 10:21 am
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.
Re: Were any commercial SNES games written in C?
Posted: Fri Mar 06, 2015 11:33 am
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?
Re: Were any commercial SNES games written in C?
Posted: Fri Mar 06, 2015 5:18 pm
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.
Re: Were any commercial SNES games written in C?
Posted: Wed Sep 07, 2016 4:34 pm
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.
Re: Were any commercial SNES games written in C?
Posted: Wed Sep 07, 2016 5:20 pm
by lidnariq
C on a 486 is a very different beast than C on the 65816...
Re: Were any commercial SNES games written in C?
Posted: Wed Sep 07, 2016 5:22 pm
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.