SNES C compiler?

Discussion in 'Nintendo Game Development' started by cdoty, May 12, 2005.

  1. cdoty

    cdoty Gutsy Member

    Joined:
    Mar 23, 2005
    Messages:
    413
    Likes Received:
    2
    Was a C compiler ever released for the SNES? I've heard iD used one for the Wofenstein. That was something they created, right?
     
  2. krimszon

    krimszon Guest

    I think the processor was a 65C816 made by Western Design. That company still exists and they seem to have some documentation called "W65816 C Compiler". Check it out here:

    http://www.westerndesigncenter.com/wdc/datasheets/816cc.pdf

    ...and here's the first paragraph:

    "The WDC 65816 C Development system provides the tools needed to do effective C and assembly language development for the W65C816S microprocessor. The compiler is built on top of the WDC W65CXX assembly language development system
    which is included in this package. The assembly language development system consists of a full macro assembler, an object file linker and an object file librarian."

    Not sure if this would work for the processor in the SNES, the 'W65816S' might be different. I thought all SNES games were programmed in assembler?
     
  3. WolverineDK

    WolverineDK music lover

    Joined:
    Mar 14, 2004
    Messages:
    5,611
    Likes Received:
    8
    krimszon: of what i have read some of the Chrono Trigger (if not all) is coded in C, since IF snes games were coded in the assembly language , i think there is a way to get the source code (although i know shit about programming) but it IS only a thought, please correct me if i am wrong :)
     
  4. krimszon

    krimszon Guest

    Yes, it is usually possible to obtain assembly code using disassemblers.

    I have no idea which games are programmed in what language. It was my understanding (from various documents on the web) that all/most games for SNES were written in assembly. But I find it difficult to imagine games like Chrono Trigger being programmed that way, C seems more logical to me as well. Not just because of the disassembling 'problem', but because it would be a better/more convenient way to program a game.
     
  5. WolverineDK

    WolverineDK music lover

    Joined:
    Mar 14, 2004
    Messages:
    5,611
    Likes Received:
    8
    of what i have heard ASM is (if you are a good ASM coder)you can make applications alot faster than C programs because ASM is the closest to machine code without going into binary code and how many does read and write binary code ?
     
    Last edited: May 14, 2005
  6. ccovell

    ccovell Resolute Member

    Joined:
    Jan 29, 2005
    Messages:
    954
    Likes Received:
    10
    I read in Super Play Magazine during an article where they interviewed a UK games company (Software Creations) why SNES games slowed down so much, and the guys at SC said, and I quote:

    Dunno if it's true for most SNES games, but there you go.
     
  7. Calpis

    Calpis Champion of the Forum

    Joined:
    Mar 13, 2004
    Messages:
    5,906
    Likes Received:
    21
    WDC's C compiler is called WDC816CC
     
  8. OldProgie

    OldProgie Guest

    In the old days, games were written in assembler because that was all there was. When C compilers first appeared they did not produce very efficient code. Given that these early systems were not particularly complicated, hand coded assembler could easily outperform C generated code.

    Now, with better optimising compilers and more complicated systems, compiled code is often faster, and is much quicker and more reliable than hand coded assembler.
     
  9. krimszon

    krimszon Guest

    But is there anyone coding in C for SNES right now? Or will homebrew SNES always be in assembly?

    I'm just now looking into SNES coding, but assembly is tuff stuff! I'd love to start with a higher level language.
     
  10. Calpis

    Calpis Champion of the Forum

    Joined:
    Mar 13, 2004
    Messages:
    5,906
    Likes Received:
    21
    Homebrew will always be in assembly. Probably, the '816 C compilers were used only to generate object code. Assembly tough? Most people like me get by on little more than load/store, arithmetic and boolean operator instructions, usually other instructions require a bit of ingenuity which I'm lacking. There are many tricks for dead efficient assembly but for a good experience unlike HL languages you don't need to understand much ;)
     
  11. OldProgie

    OldProgie Guest

    That pretty much sums up the whole assembly language. The only thing you need to add is a little flow control, jr jp whatever.

    What other instructions?


    In terms of syntax, no, theres not a lot to understand. The biggest problem for beginners is getting some sort of useful output. It's not as straight forward as
    10 print "Hello"
    20 goto 10
     
  12. Zilog Jones

    Zilog Jones Familiar Face

    Joined:
    Nov 12, 2004
    Messages:
    1,202
    Likes Received:
    0
    Yeah, that's what has confused the hell out of me regarding programming games in assembly - though I've never tried it, the thought of programming any sort of video or audio output sounds beyond complicated. I've done 8051 assembler in college and the only real outputs on those things are 4 8-bit ports - the most sophisticated display system we've used are just 7-segment LEDs!
     
    Last edited: May 16, 2005
  13. kammedo

    kammedo and the lost N64 Hardware Docs

    Joined:
    Sep 24, 2004
    Messages:
    2,138
    Likes Received:
    12
    You would be surprised to see how _easy_ (and frustrating) it is to work with ASM once you know the architecture you are working on....Are you going to programm on the SNES?
     
  14. Zilog Jones

    Zilog Jones Familiar Face

    Joined:
    Nov 12, 2004
    Messages:
    1,202
    Likes Received:
    0
    I dunno. I was thinking about starting off on something simpler like the NES, Game Boy or MSX. But I've pretty much only *thought* about doing any assembler programming - I haven't done anything yet outside college work.
     
  15. kammedo

    kammedo and the lost N64 Hardware Docs

    Joined:
    Sep 24, 2004
    Messages:
    2,138
    Likes Received:
    12
    Afaik nes programming is quite easy...but SOMETHING tells me you'll be better underwy with the Gameboy XD (ZILOG Jones???)
    -> http://www.z80.info/z80cpus.htm
     
  16. OldProgie

    OldProgie Guest

    Another suggestion may be to start off with something on the Spectrum (either a real one, or emulated)



    Apart from a slightly odd bitmapped screen, it's a pretty basic architecture, and something that's a lot easier to get information on, as there were no licensing restrictions. There are people still producing commercial games for it.



    If you do, pick up the book by Rodney Zacks - Programming the Z80 or something like that. Used to be the bible for Spectrum assembly language.
     
  17. kammedo

    kammedo and the lost N64 Hardware Docs

    Joined:
    Sep 24, 2004
    Messages:
    2,138
    Likes Received:
    12
    O_O
     
    Last edited: May 16, 2005
  18. Zilog Jones

    Zilog Jones Familiar Face

    Joined:
    Nov 12, 2004
    Messages:
    1,202
    Likes Received:
    0
    I have one - a 128k +2A - it kinda works, except for the crappy built-in tape deck. Are there assembler compilers you can get for it, or do you have to compile on a PC or something?

    lol, that book's somewhere in the basement in the UL library! There's some books on specifically doing Z80 assembler programming for the Spectrum as well. I took it out before but never actually got around to readin much of it.
     
  19. krimszon

    krimszon Guest

    As for me, I'm gonna have a look at assembly for x86 and get some experience with that. Then I really want to try to get at least a sprite moving on a nice background, on the SNES that is. That should be feasible.
     
  20. krimszon

    krimszon Guest

    And even if there was a C compiler and linker for SNES, where would you be without the libraries?
     
sonicdude10
Draft saved Draft deleted
Insert every image as a...
  1.  0%

Share This Page