Originally posted by: tfinch2
Originally posted by: Schadenfroh
What programming language is that? Looks sorta like assembler..........
It's the instruction set for the 6052 or whatever processor they used.
Atari and NES were both 6502. 8 bit registers, 8 bit data bus, and 16 bit address bus for 64k total memory space to be divided between hardware interface mapping, RAM, and cartridge ROM.
The 6502 CPU has a grand total of 52 instructions.
I've worked on both 6502 and 65816 (pin and code compatible 16 bit upgrade to the 6502 used in the Apple IIgs and the Super Nintendo) so I can follow it pretty well =D.
Main thing with assembler though isn't about following the program, thats easy. The hard part is knowing the hardware memory/IO map and communication protocols for each specific machine inside out so you know what the code is actually doing. On game consoles, alot of the code is interacting with the hardware ASICs to do things automatically in hardware rather than performing the task in code in software on the CPU manually. DMA, graphics chips, etc. For example seeing the code:
lda #$07
sta $2105
means nothing specific other than storing the value 7 at memory address 2105h. However if you know the hardware, this is quite special if you happen to know that $002105 is the address of the graphics chip's screen mode select register on the SNES rather than an arbitrary RAM location... this particular mode happens to be the only planar bitmapped mode on the SNES that stores data in pixels like a PC rather than a character or tile map. It was the only mode if I recall that was tied to the hardware bitplane scaling and rotation functions... and as you can see the numerical designation is 7, hence this mode became known as the famous "mode 7" on the SNES... =D