Page 1 of 1

RDP commands are 32bits packed

Posted: Thu Oct 22, 2015 12:21 pm
by Narann
Interesting fact: Even if it's stated everywhere RDP commands are 64 bits long, in practice its always organized by dword (32bits), meaning you will never have values stored between the 32th and 33tn bits.

This mean you can parse commands using a simple uint32_t pointer.

I don't know if this choice has been made in order to simplify human work (We are in 1997...) or if hardware can really handle 64bits register in one cycle.

I guess this choice is more user oriented than hardware on. :geek:

Re: RDP commands are 32bits packed

Posted: Thu Oct 22, 2015 9:39 pm
by MarathonMan
Internally, the RCP has a 64-bit wide bus. The bus between the MI (VR4300's external controller) and RCP is 32-bit. But internally, yes, everything is 64-bit, so this is probably why.

Fun fact: RDRAM is 9bit (8+1) @ 500MHz (62.5MHz RCP clock x 8), which is how it delivers up to* (8x8 + 8x1 = 64 + 8 bits of data per RCP clock).

Re: RDP commands are 32bits packed

Posted: Thu Oct 22, 2015 10:42 pm
by Narann
MarathonMan wrote:Fun fact: RDRAM is 9bit (8+1) @ 500MHz (62.5MHz RCP clock x 8), which is how it delivers up to* (8x8 + 8x1 = 64 + 8 bits of data per RCP clock).
Wow! Have you any idea how current emulators emulate this? I mean, when I navigate through the N64 RDRAM (of an emulated N64 of course), I don't deal with this. What does this last byte contain?

Re: RDP commands are 32bits packed

Posted: Fri Oct 23, 2015 11:15 am
by MarathonMan
Narann wrote:
MarathonMan wrote:Fun fact: RDRAM is 9bit (8+1) @ 500MHz (62.5MHz RCP clock x 8), which is how it delivers up to* (8x8 + 8x1 = 64 + 8 bits of data per RCP clock).
Wow! Have you any idea how current emulators emulate this? I mean, when I navigate through the N64 RDRAM (of an emulated N64 of course), I don't deal with this. What does this last byte contain?
The last byte is just another spot for storage. It's just confusing because, effectively, that extra byte is "hidden"... even with respect to addressing. When the RCP wants to access the bytes [8...15] of memory, it doesn't ask for address 9 to compensate for the extra byte in RDRAM, it just asks for 8 (otherwise, address logic would be overly complicated). In turn, the memory controller gives bytes [8...15] + the second "hidden" byte (72 bits total). It was probably designed to hold error-correction codes, but it's not used as such in the N64 anyways.

The RDP uses the extra byte for coverage, I think. (If you look closely, you will see that the N64 really has a 18-bit 5/5/5/3 RGBA and 32-bit 8/8/8/8 mode). For "18-bit" mode, the VI fetches a 64-bit+8-bit block from memory, which conveniently is able to hold 72/18 = 4 pixels.

I think the MI/VR4300 can also access the extra byte. If you notice, the MI has this strange, undocumented "set/clear EBUS test mode". I think what EBUS test mode does is make the MI/VR4300 use the 8-bit data bus instead of the 64-bit data bus...

Re: RDP commands are 32bits packed

Posted: Fri Oct 23, 2015 5:36 pm
by Narann
MarathonMan wrote:If you look closely, you will see that the N64 really has a 18-bit 5/5/5/3 RGBA
Yeah! I notice this "5/5/5/3 16 bits" mode. That was disturbing. So here is the reason! Thanks a lot!
MarathonMan wrote:I think what EBUS test mode does is make the MI/VR4300 use the 8-bit data bus instead of the 64-bit data bus...
Having a such register for debugging coverage would make sense. Did you do any hardware test to confirm this?

Is there any commercial rom changing this register?

Look its n64 thinking about some soldering work... one day... ( - _-)

Re: RDP commands are 32bits packed

Posted: Fri Oct 23, 2015 8:50 pm
by MarathonMan
Nope, haven't tested it. Haven't checked to see if any ROMs are twiddling the bit, either.