Arduino for RCP signal parsing?

Discuss RCP-related matter here.
Post Reply
User avatar
Narann
Posts: 154
Joined: Mon Jun 16, 2014 4:25 pm
Contact:

Arduino for RCP signal parsing?

Post by Narann » Wed Jan 06, 2016 5:01 pm

Hi!

I plan to use arduino with some soldering works to intercept voltage signal send to the RCP...

I want to know how RCP communicate with the rest of the N64 (mainly the CPU). Specially, I want to know which MI registers are modified by RCP before/during/after the RDP process the display list.

I know you MarathonMan did similar works for the r4300.

I'm a low level programming hobbyist but it's the first time I try something like this. Am I going into the wall?

Is arduino ok? Any other stuff to recommend (how to convert voltage signals to instructions for example)?

Any advise is also welcome. :mrgreen:

User avatar
MarathonMan
Site Admin
Posts: 692
Joined: Fri Oct 04, 2013 4:49 pm

Re: Arduino for RCP signal parsing?

Post by MarathonMan » Wed Jan 13, 2016 12:07 am

Arduino is almost certainly too slow to serve as a logic analyzer. The clock rate is 62.5MHz so you'd need to perform *at least* a 32-bit write 62.5 million times per second just to capture the address/data bus -- this doesn't include the pins for interrupts, the SysAD pins that control bus state, etc.

Futhermore, the only pins that are exposed are that which connects the VR4300 and RCP. The MI and it's registers are internal to the RCP (and are not on the VR4300, as one might expect). The traces between the RCP and the VR4300 are the ones I mentioned above -- interrupts, data/address, SysAD pins, power/ground, etc - you can consult the VR4300 datasheet to see what is visible. From what I can tell, the VR4300 is a stock NEC package that you could literally pull off a printer or any other device and shove into the N64. Oddly enough, there are like 4-5 pairs of pins that are switched (on the stock NEC VR4300 package compared to the Nintendo VR4300 package). I'm not sure why this is. Other than those pins being swapped, the NEC CPU seems to be identical to that of the one in the N64.

I think you'd need at least an FPGA if you wanted to cook up a logic analyzer. I've been meaning to do this for quite some time, but I haven't been successful with soldering or other things along the way. It would be cool if someone got it to work.

User avatar
Narann
Posts: 154
Joined: Mon Jun 16, 2014 4:25 pm
Contact:

Re: Arduino for RCP signal parsing?

Post by Narann » Wed Jan 13, 2016 1:11 pm

Thanks for your invaluable feedbacks MarathonMan! :)

So Arduino is not the way to go and even if it was, exposed pins would not help me to get what I want.
I think you'd need at least an FPGA if you wanted to cook up a logic analyzer.
I have zero experience with FPGA (yet). I will have to dig into this at a time but I think I'm not experienced enough yet to start a such big task (I still have long hours of endless tutorial to do before understanding the thing).

The main idea is to simulate the RCP through the FPGA?
Or to "connect" (via soldering) a FPGA to the hardware RCP and try to:
1) Intercept logic
2) Program RCP via FPGA interface

Any FPGA model that could support the whole RCP to recommend? I guess those tiny ones can't. (The more I write, the more I wonder if what I'm saying actually make sense...).

I will read about FPGA more deeply and will stick into angrylion plugin for now.

I'm on TMEM layout for now (and have some headache). I think I will dump TMEM from angrylion plugin after the first LoadBlock command call and write a tiny tmem_dec -addr -pixel_size -width -etc... program to extract image from a TMEM address and tile info, I don't know...

angrylion and MESS are a very helpfull resources but are very hard to read and have too many if statement everywhere. My long term project is to design my RDP code in order to make it easier to implement dynarec in the future (one day...). For now, this mean having one function for each combination of required "parameters" (mostly pixel type in the case of load block command so dynarec is not really useful for this). This mean redundant human written code for now but ensure each function does one specific thing. I have no experience with dynarec yet but from what I know, it would make implementation faster as branching is made "on top".

I don't know if I'm clear.

PS: I say all of this but as a lot of RDP specs are "implicit" (no clear spec documentation), I'm still bangin my head against walls instead of really writing code. :?

User avatar
MarathonMan
Site Admin
Posts: 692
Joined: Fri Oct 04, 2013 4:49 pm

Re: Arduino for RCP signal parsing?

Post by MarathonMan » Thu Jan 14, 2016 12:42 am

For FPGA recommendations, I currently use a DE0-Nano (probably slightly bigger than that starter board you mentioned). It's not nearly big enough to hold the RCP, or probably a VR4300 worth of design logic for that matter, but it's still a good starting board. I would recommend something on the level of a Cyclone V GX starter kit if you want to get dangerous with FPGA design.

Sorry, I'm far from knowledgeable about the RDP in particular, so I can't be of much help there...

User avatar
Narann
Posts: 154
Joined: Mon Jun 16, 2014 4:25 pm
Contact:

Re: Arduino for RCP signal parsing?

Post by Narann » Thu Jan 14, 2016 12:11 pm

Thanks for pointing me the Cyclone V GX Starter Kit, it look great!

If I could dump framebuffer after some RDP command that would be really helpful. Long way to go before this.
MarathonMan wrote:Sorry, I'm far from knowledgeable about the RDP in particular, so I can't be of much help there...
No worry, all what you say is actually very precious to me as I'm still a beginner in hardware dev.

I hope my work could be helpful in the future.

User avatar
MarathonMan
Site Admin
Posts: 692
Joined: Fri Oct 04, 2013 4:49 pm

Re: Arduino for RCP signal parsing?

Post by MarathonMan » Thu Jan 14, 2016 11:38 pm

Narann wrote:If I could dump framebuffer after some RDP command that would be really helpful. Long way to go before this.
You can do the with the 64drive. You basically use some of the 64drive's SDRAM as a buffer.

- Issue an RDP command
- Copy framebuffer to 64drive SDRAM
- Signal to PC that framebuffer is copied
- PC copies framebuffer from 64drive SDRAM
- PC signals that framebuffer is copied
- Repeat as needed

User avatar
Narann
Posts: 154
Joined: Mon Jun 16, 2014 4:25 pm
Contact:

Re: Arduino for RCP signal parsing?

Post by Narann » Fri Jan 15, 2016 1:01 am

MarathonMan wrote:You can do the with the 64drive. You basically use some of the 64drive's SDRAM as a buffer.

- Issue an RDP command
- Copy framebuffer to 64drive SDRAM
- Signal to PC that framebuffer is copied
- PC copies framebuffer from 64drive SDRAM
- PC signals that framebuffer is copied
- Repeat as needed
Wow! You mean I can directly control N64 with a USB plugged 64drive??? O_O

FPGA will maybe wait so... :roll:

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests