How were games for consoles programmed back then?
I mean, was assembler the only option in the NES/SNES times?
But how game engines worked then? Aren't SNES and Genesis were already complicated enough so you could get lost in assembler code?
Far from it. The snes CPU wasn't well suited to a compiled language like C. Assembly with a good macro assembler was more than good enough since the CPU was simple enough that you could track the state in your head easily. The genesis' 68000 was more suited to C but the slow clock speed meant that everyone still used assembly.
ASM wasn't necessarily your only option, the 8 bit microcomputers ran 6502s like the NES (ish) and Z80s and they ran interpreted BASIC, there were PASCAL compilers and even C. It's just that with such a low clock speed if you were ever going to get anything done in between frames you needed to hand tune everything.
You would also make your own custom languages to make the time consuming bits easier. e.g. RPGs have cut scenes with animations and music cues, etc. That wasn't hand coded in asm, you'd make what's called a domain specific language to describe it that would be compiled to a bytecode you made yourself and then interpreted by an ASM routine you prepared earlier.
C was used more often on 68000s in the arcades and computers like the Amiga/ST/X68000 but there was still more ASM then C in there.
The 32bit generation was when everyone switched to C with additional assembly for the stuff that C didn't do well with since the CPUs and compilers grew up together such that there was far less benefit to hand tuned asm.
>ASM wasn't necessarily your only option, the 8 bit microcomputers ran 6502s like the NES (ish) and Z80s and they ran interpreted BASIC, there were PASCAL compilers and even C.
Good post but wouldn't C be the obvious language for it to use, and then you would say "and even interpreted languages like BASIC".
6502 stuff was pretty much always written in assembly aside from adventure games like Maniac Mansion that used a scripting engine. Z80s were a little better suited to HLLs however assembly was still very common and almost universal for games.
Almost all pre-5th gen console games were written in straight ASM though with C++ becoming the standard afterwards.
When looking at code from back then you can pretty easily tell if it was written in C: excessive stack usage, weirdly unoptimized code, and so on. For anything pre-N64/GBA I wouldn't use C for anything on a console except maybe turn-based games that don't need great performance.
It's not that it can't do C (everything eventually gets compiled down to machine code either way after all), it's that C compilers of the time were less than sophisticated with optimization which made it not the best choice of language for performance-demanding games on old hardware platforms
It was also possible to write games in a mix of multiple languages back then much like we're doing today with C++ plus a scripting language plus whatever else is necessary, back then this meant mixing C code with inline assembly