4

I've read that the usual way to execute code on the N64 is to use DMA to copy it from ROM into RAM, and then run from RAM.

However, it seems that the contents of the ROM are directly visible to the CPU (e.g. from address 0x9000_0000). Is it possible to run code directly from ROM (as was standard on the NES and Super NES) by jumping into this region of the address space?

If so, why did games generally copy code into RAM before running it?

  • 1
    I'm not sure about the specifics of the N64 architecture, but often RAM is quite a bit faster for the CPU to access than ROM. – Greg Hewgill Oct 30 at 23:24
5

Is it possible to run code directly from ROM [...] by jumping into this region of the address space?

Game Code can of course be run from ROM. And most games will do so.

If so, why did games generally copy code into RAM before running it?

Generally sounds a bit too much here. In fact, as game cartridges range from 4 MiB to 64 MiB (and more), the existing 4.5 MiB RAM couldn't hold not even the smallest games. Even more so as most of the RAM was used for video anyway.

The N64 is very much a streaming architecture with emphasis on continuous high speed access. The MIPS CPU, as well as the video processors, did benefit from the RDRAM feature of fast read for consecutive data (burst access). As a result, RAM was, when it came to continous access about twice as fast as ROM. A peak rate of 562,5 MiB/s could be reached when reading RDRAM while ROM access, due its 'classic' structure, only yielded with 264 MiB/s about half the rate (*1).

Games did foremost copy graphics data (textures etc.) into RAM to allow best possible rendering. After than, time critical routines were as well moved to improve speed - were needed.


*1 - Yes, 264 is half of 562,5, as the RAM was 9 (!) bit wide :))

  • I don't know if this is accurate. Zelda, for example, is known to copy code to RAM before executing it. – user253751 Nov 1 at 12:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.