Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to program to old game consoles? [closed]

I want to know how to program to old game consoles for fun.

Can I use a programming language such as C? Will I have to use assembly? I do not know any console compiler, assembler or API. I will need to compile into ROM image and test with emulators, because I do not own any console.

Each console has its interesting features and I would like to play with them.

  • Atari 2600 (only 128 bytes of RAM)
  • NES (only 8-bit)
  • SNES (a good console, 16-bit)
  • PS1 (3D, complex)
  • Game Boy (simple, monochromatic)
like image 729
Squall Avatar asked Jun 30 '11 20:06

Squall


3 Answers

Older systems like the Atari, NES, and GameBoy are typically programmed in Assembly or C. There are a variety of development tools for the GameBoy I've played around with such as:

Rednex Gameboy Development (ASM): http://www.otakunozoku.com/rednex-gameboy-development-system/
GBDK (C): http://gbdk.sourceforge.net/

And while there are a lot of dead links on it, this page has a lot of good information and links on GameBoy development in general: http://www.devrs.com/gb/

For the NES there are two assembly tutorials I know of. The second tutorial is linked to from the first with the claim it is superior but I can't really comment as the second link didn't exist last time I was interested in this topic.
http://www.patater.com/nes-asm-tutorials
http://www.nintendoage.com/forum/messageview.cfm?catid=22&threadid=7155 (this link is no longer valid, use the wayback machine)

If it isn't too new for you the GBA has a lot of great homebrew resources and is typically programmed using C. The wealth of information on the GBA makes it a good place to start:

DevKitPro provides a complete GNU toolchain for GBA development (DevKitARM + libgba): http://www.devkitpro.org/

TONC is a very good guide for the GBA with a lot of detailed explaination: http://www.coranac.com/tonc/text/

Lastly, the indispensible gbatek sheet that details the GBA's hardware. This will tell you what registers on the GBA you have to play with to change graphics modes, sound modes, use interrupts, etc.
http://nocash.emubase.de/gbatek.htm

Programming for these older game systems shares a lot in common with programming microcontrollers. Without some sort of abstraction layer you have to do a lot of bitwise manipulation of registers to do even the most basic things.

Edit: The main issue I came across when doing GBA programming was figuring out how the sound registers work. It was (is?) a real blind spot in terms of tutorials. The best resource at the time was studying the gbatek sheet and these sites:
http://deku.rydia.net/program/sound1.html
http://belogic.com/gba/

like image 54
wollw Avatar answered Oct 21 '22 13:10

wollw


The makers of the consoles provide their own tools/compilers (SDK) for the machine's processor, since they are (most of the time) highly specialized.

But most of the time you will code in C/C++. I am sure you will need more often then not resort to ASM.

Try this link: http://www.emuparadise.me/sdk/index.php

Google keywords: sdk, console, homebrew, indie

like image 38
Vinicius Kamakura Avatar answered Oct 21 '22 11:10

Vinicius Kamakura


There are also a few more "open" homebrew consoles that are designed to work similarly to machines of the past, but with much easier access to information and friendlier tools.

Something like the XGameStation Pico will give you an experience similar to the Atari 2600, and the Micro Edition is significantly more powerful and comes with documentation regarding how consoles similar to it work.

If you're not explicitly looking to develop for large-scale, commercially released consoles these may serve as an excellent alternative, and potentially a much better learning tool for someone new to embedded programming.

like image 1
ravuya Avatar answered Oct 21 '22 12:10

ravuya