What were SNES games programmed in?
#1 Members - Reputation: 259
Posted 05 September 2005 - 02:31 PM
#3 Anonymous Poster_Anonymous Poster_* Guests - Reputation:
Posted 05 September 2005 - 02:43 PM
#4 Members - Reputation: 259
Posted 05 September 2005 - 02:52 PM
Quote:
Original post by Anonymous Poster
3.52 MHz and 128kb RAM? That's...incredible! I can't really believe you could run something like Secret of Mana/FFs on that...guess I'm jaded from this age of 2GHz+ processors.
That's why I'm asking, I'm a Ruby programmer mostly, and this machine couldn't even run the simplest Ruby "hello world" program :) Kudos to the guys who knew how to program back then.
#5 Members - Reputation: 851
Posted 05 September 2005 - 04:29 PM
I don't know anything about Forth, but from skimming Wikipedia it seems to be you'd end up with something that resembles a macro assembler. Anyway, I doubt anyone at Nintendo was concerned with such things in 1990.
#6 Anonymous Poster_Anonymous Poster_* Guests - Reputation:
Posted 05 September 2005 - 08:29 PM
The reason why snes could still do so nice graphics, despite the weak cpu, is the sweet 2D graphics chip allowing for a lot of cool effects with clever coding.
#7 Members - Reputation: 259
Posted 05 September 2005 - 11:12 PM
Quote:
Original post by Anonymous Poster
Yup, snes games were coded in pure assembly.
The reason why snes could still do so nice graphics, despite the weak cpu, is the sweet 2D graphics chip allowing for a lot of cool effects with clever coding.
Thank you. Well, I have to raise my hat to the people who wrote all those cool games. I must have been hell to debug!
#8 GDNet+ - Reputation: 1883
Posted 05 September 2005 - 11:58 PM
Quote:Don't forget the awesome mode 7...
Original post by Anonymous Poster
The reason why snes could still do so nice graphics, despite the weak cpu, is the sweet 2D graphics chip allowing for a lot of cool effects with clever coding.
I love oldschool programming - if you look in my journal, you can see I'm currently developing a game for the Sega Game Gear in Z80 assembly.
If you're looking to develop for the SNES, I'd highly reccomend digging out a good debugging emulator (so you can look at the sprite tables/all memory locations/whatever) and a decent assembler (WLA-DX is my weapon of choice).
#10 Members - Reputation: 2908
Posted 06 September 2005 - 03:47 PM
Also, while we tend to think of things like ASM as being instruction-level languages, theres no reason that an assembler can't impliment some higher-level constructs such as functions and loops. These systems are called high-level assemblers(also: Macro Assemblers.)
Probably most SNES games were done much as PC games were when limited capabilities were more of an issue than it is today. That is: speed critical elements were surely ASM, while some of the less critical code was written in an easier-to-maintain language such as C or high-level assembly.
If you'd like to see an excelent example of a high-level assembler, check out bripro.com, a custom HLA development tool by the creator of Grand Theftendo and other neat technical stuff.
#11 Anonymous Poster_Anonymous Poster_* Guests - Reputation:
Posted 06 September 2005 - 04:32 PM
#13 Anonymous Poster_Anonymous Poster_* Guests - Reputation:
Posted 06 September 2005 - 05:28 PM
Quote:
Original post by Anonymous Poster
Yup, snes games were coded in pure assembly.
The reason why snes could still do so nice graphics, despite the weak cpu, is the sweet 2D graphics chip allowing for a lot of cool effects with clever coding.
True dat. Then, of course, there were those enhanced cartridges which granted some games even greater graphics capabilities, such as true 3D.
#14 Members - Reputation: 259
Posted 06 September 2005 - 11:21 PM
Quote:
Original post by Ravyne
Also, while we tend to think of things like ASM as being instruction-level languages, theres no reason that an assembler can't impliment some higher-level constructs such as functions and loops. These systems are called high-level assemblers(also: Macro Assemblers.)
Yeah, you can probably implement those in Assembler, but the logic of the game remains hidden behind all these MOV, ADD, JMP, etc. With a language that's higher level, like C or Forth already mentionned, you can talk about the elements of the games (NPC's, items, enemies, etc.) with words that make sense. That's why I'm so impressed that among all these instructions, the programmers were able to keep track of the game.
#15 GDNet+ - Reputation: 1883
Posted 06 September 2005 - 11:29 PM
move_and_draw_player(3,43);is really any different in terms of "remembering" as
function move_and_draw_player(dx, dy) {
player_x += player_dx;
player_y += player_dy;
draw_player_sprite(player_x, player_y);
}
Just because it's assembly doesn't mean you can't use sensible variable names and routine names! Structured code in ASM is entirely possible, and if anything more important than in other languages where you need to be able to keep track easily.
ld b,3
ld c,43
call move_and_draw_player
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
Unless you mean an object-orientated system, which is easy enough to implement through arrays and such.
#17 Anonymous Poster_Anonymous Poster_* Guests - Reputation:
Posted 07 September 2005 - 05:31 AM
#18 Moderators - Reputation: 1666
Posted 12 September 2005 - 09:21 AM
But anyway. :)
#19 Members - Reputation: 850
Posted 12 September 2005 - 09:43 AM
Quote:Nope, it was 'only' a 3.52 MHz system, though some games with slow rom chips only ran at about 2 MHz instead. The original NES ran at about 1.78 MHz (I should know, I'm currently coding for it).
Original post by Zahlman
I'm pretty sure that spec is for the original Nintendo. Genesis had a combination of a Z-80 and a 68000. A CPU speed of 3.52 MHz suggests likely an Intel 8088 or something along those lines, and the 68000 kicked the ass of that (and Genesis wasn't that much ahead of SNES AFAIK) - ran 7.83 MHz IIRC and was more bang for the buck - er, clock cycle - besides. (I should know, I grew up on the Macs running 68000s :) )
There's a big difference between the RISC-like 6502 (65816 in this case) and a 68000 though. Most 68000 took between 4-20 cycles to execute while the 6502 could handle them in about 2-7 instead.
#20 Members - Reputation: 2908
Posted 12 September 2005 - 03:32 PM
Quote:
Original post by doynax
There's a big difference between the RISC-like 6502 (65816 in this case) and a 68000 though. Most 68000 took between 4-20 cycles to execute while the 6502 could handle them in about 2-7 instead.
I don't know if its accurate to call the 65816 'risc-like' If I remember correctly It supported memory modes not usually associated with a risc system, also it only had a couple general purpose regs. It only really seems to hold the risc ideal in that it basically executed 'simple' instructions quickly. The 68000, on the other hand, has 16 registers and IIRC, was closer to the classic risc load-store ideal. On the other hand, as you stated, cycle times were quite long for a risc system.
In the end its probably a wash as to which system is more or less RISC. Suffice it to say that they were probably equally powerful, give or take. What really set the SNES apart from the Genesis, was the GPU and sound quality of the SNES.






