views:

201

answers:

1

According to Wikipedia, the N64 only has 4 MB of RDRAM (8 MB with the Expansion Pack), and the other quantities are similarly small (4 KB or so of L1 cache). However, technical documents I have found on Google state that its memory addresses range from $0000:0000 to $FFFF:FFFF -- that's 4 GB! Since existing N64 emulators like Project64 don't use up 4 GB of RAM, how does emulating the memory map work? I have tried looking through various documents and such, and all of them seem to differ at least slightly. Does anybody have some advice on this issue?

Specifically, here's the memory map I found:

0x0000 0000 to 0x03EF FFFF RDRAM Memory
0x03F0 0000 to 0x03FF FFFF RDRAM Registers
0x0400 0000 to 0x040F FFFF SP Registers
0x0410 0000 to 0x041F FFFF DP Command Registers
0x0420 0000 to 0x042F FFFF DP Span Registers
0x0430 0000 to 0x043F FFFF MIPS Interface (MI) Registers
0x0440 0000 to 0x044F FFFF Video Interface (VI) Registers
0x0450 0000 to 0x045F FFFF Audio Interface (AI) Registers
0x0460 0000 to 0x046F FFFF Peripheral Interface (PI) Registers
0x0470 0000 to 0x047F FFFF RDRAM Interface (RI) Registers
0x0480 0000 to 0x048F FFFF Serial Interface (SI) Registers
0x0490 0000 to 0x04FF FFFF Unused
0x0500 0000 to 0x05FF FFFF Cartridge Domain 2 Address 1
0x0600 0000 to 0x07FF FFFF Cartridge Domain 1 Address 1
0x0800 0000 to 0x0FFF FFFF Cartridge Domain 2 Address 2
0x1000 0000 to 0x1FBF FFFF Cartridge Domain 1 Address 2
0x1FC0 0000 to 0x1FC0 07BF PIF Boot ROM
0x1FC0 07C0 to 0x1FC0 07FF PIF RAM
0x1FC0 0800 to 0x1FCF FFFF Reserved
0x1FD0 0000 to 0x7FFF FFFF Cartridge Domain 1 Address 3
0x8000 0000 to 0xFFFF FFFF External SysAD Device
+2  A: 

Regardless of how much memory you're emulating, you don't need that much memory available on the host machine (you don't need 4 GB, and you don't even need 4 MB). Instead, use a data structure where you can access your emulated memory by address value. Only allocate space in your real memory when you need to store something in your emulated memory.

However, it may be trivial to actually allocate the amount of internal memory described above.

Like Simon, I would also first assume the segment:offset theory, but the address ranges you list above seem to entirely contradict that theory. Also, the whole "64"-bit address space thing.

Notice that the majority of the address space is allocated to external interfaces (cartridges, etc), not internal hardware resources.

Dolph
Hm, I suppose that is true. Should have realized that.Thanks!
Seizure