Jump to content
  • Advertisement
Sign in to follow this  
GnuVince

What were SNES games programmed in?

This topic is 4918 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Guest Anonymous Poster
Quote:
move_and_draw_player:
ld a,(player_x)
add a,b
ld (player_x),a
ld b,a
ld a,(player_y)
add a,c
ld (player_y),a
call draw_player_sprite ; Assumes routine takes b,a as args
ret


You can cut off this "ret" instruction from this routine and "jmp draw_player_sprite" instead of calling it. You spend 1 byte less and some good 10 cycles less than your usual. (Experience from programming for MSX computers and Sega Master System)

Some guy up there said about how hard is programming for SNES with only 128KB RAM. He would go nuts if he gets to know that NES and SMS had only about 4KB RAM and could address only up to 64KB RAM/ROM (SNES could address up to 4Mbits if I am not mistaken) and had to rely heavily on mapped memory (with some games having more than 16 pages on SMS at least).

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by Anonymous Poster
Some guy up there said about how hard is programming for SNES with only 128KB RAM. He would go nuts if he gets to know that NES and SMS had only about 4KB RAM and could address only up to 64KB RAM/ROM (SNES could address up to 4Mbits if I am not mistaken) and had to rely heavily on mapped memory (with some games having more than 16 pages on SMS at least).


128k is pretty nice, especially considering that code, graphics and other resources could be accessed directly off the rom. The NES had only 2K built in ram, with cartridges containing up to an additional 8K. If the game used battery backed game saves, a portion of this extra ram was reserved for save files as well. Various memory mapping shemes would allow for a maximum of 4 Megabits of data for each of the program and Character rom, IIRC. NES graphics were stored in the Character rom, which was on a seperate bus wired directly to the Graphics unit.

The 65816 used by the SNES supports up to 16 megs of address space directly, although the SNES used a custom version that may have been slightly different, or possibly nintendo decided 4 megs was enough and simply left the upper two address pins unconnected to reduce PCB complexity. I honeslty am not sure of this.

Share this post


Link to post
Share on other sites
The real limitation in coding for a system like the snes (I'm extrapolating from my gb/z80 experience here) is doing anything with 16 bit registers. Floats? forget it, 32 bit fixed point? forget that too. 16 bit fixed point? Try implementing an 8.8 divide. That was the true genius in coding of these systems, IMHO.

Share this post


Link to post
Share on other sites
Agreed. The chip in the SNES doesn't even have any built in multiply functionality what-so-ever. Every multiply or divide on the SNES was a subroutine of some sort, so you would do whatever you could to avoid needing multiplies in the first place. I don't even want to think about trig or sqrt functions on a SNES, Probably where these were needed there was a look up table of some sort, possibly built into the platform's firmware ( I recall reading that at least one system had this). Power-of-2s and incrimental algorithms were very important then (and still in some spaces such as GBA/Cell phone/embedded systems.)

I wish I would have caught that wave. Although, I'm about to start some contract work on some new hardware that has some pretty retro elements to it. Cool stuff to play with.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!