Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Super Mario Bros. is definitely the most famous videogame created yet, selling a scorching 40.23 million copies. http://en.wikipedia.org/wiki/List_of_best-selling_video_games

What programming language was it written in? Does anyone have some original code reference?

share|improve this question

closed as not constructive by Nicol Bolas, Jonathan Hobbs, Darth Satan, Noctrine Nov 22 '12 at 19:23

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

6  
I get the feeling a lot of the old NES games were written in machine-specific assembly. –  meagar Dec 2 '10 at 15:40
3  
possible duplicate of How were 8-bit and 16-bit games developed? –  user744 Dec 2 '10 at 16:34
6  
Not a duplicate, as this one asks for specific code samples from a specific game. –  AttackingHobo Dec 2 '10 at 20:00
5  
I don't see the value in having many "What language was X written in?" questions, no matter how notable X is, unless it was notable because of the development platform. Also, it's asking for specific code samples of a game still under copyright (and still being sold) with no intentional source availability. –  user744 Dec 2 '10 at 22:11
3  
@Toad: Yes, but you generally don't have the right to post it online, or to download a copy (even if you own the game yourself), or to make derivative works based off your own reading of the code. –  user744 Dec 3 '10 at 9:51

2 Answers 2

6502 Assembler

Here is a forum page about hacking the ROM. http://forums.selectbutton.net/viewtopic.php?t=26956&sid=1a883209e1ba63877bcd58c007bb63ae

It should contain any code references you need as well.

A few posts down there is a link to a zip file that contains these items needed to edit/hack the game.

  • ca65 - a 6502 assembly compiler from http://www.cc65.org/
  • ld65 - a 6502 linker from http://www.cc65.org/
  • smbdis.asm - a comprehensive Super Mario Bros. disassembly
  • smb.chr - Super Mario Bros. graphics (character ROM data)
  • smb.hdr - Super Mario Bros. ROM header (iNES header)
  • MAKESMB.BAT - a batch file I made that automates the compilation process.
  • 6502jsm.doc - a summary of 6502 instructions.
share|improve this answer
6  
Wow, perfect answer! Kudos –  DFectuoso Dec 2 '10 at 19:00
11  
I'm confused by this answer myself. You're basically pointing to an executable (the ROM) and claiming that it was written in assembly... because it was disassembled. It's an executable; of course it can be disassembled. By this logic, every C/C++ program ever written was actually written in assembly. To prove that this was written in assembly, you need to actually show that Nintendo wrote it in assembly, not that you can disassemble the executable binary. –  Nicol Bolas Nov 22 '12 at 20:18

Almost all NES games were hand-written in 6502 assembly, the same as used in the Commodore 64, the Apple ][e, etc. The very few which were written in C had a reputation for being terribly slow because the NES is only 2Mhz and has 2Kb of onboard RAM (with an 8Kb window for the cartridge to patch more in). Careful assembly designed to take full advantage of the NES's peculiar architecture was much more effective.

Stop and think about that... games like Super Mario Bros 3 and Kirby's Adventure ran on 2Mhz. Compare how rich they are to today's games which swallow gigahertz and hundreds of megabytes of RAM...

share|improve this answer
14  
+1 gameplay > everything else –  Lohoris Dec 3 '10 at 13:48
1  
@Lohoris I just logged in to up-vote that comment. And to my surprise, I already did –  NSAddict Nov 19 '13 at 15:43
    
@NSAddict wow, thank you! –  Lohoris Nov 19 '13 at 15:50

Not the answer you're looking for? Browse other questions tagged or ask your own question.