Go Back   Project64 Forums > General Discussion > Open Discussion

Reply
 
Thread Tools Display Modes
  #861  
Old 24th June 2014, 11:49 PM
RPGMaster's Avatar
RPGMaster RPGMaster is offline
Alpha Tester
Project Supporter
Super Moderator
 
Join Date: Dec 2013
Posts: 2,008
Default

Lol ya, I did notice that. I take advantage of that too for debugging .
Reply With Quote
  #862  
Old 8th July 2014, 04:50 AM
RPGMaster's Avatar
RPGMaster RPGMaster is offline
Alpha Tester
Project Supporter
Super Moderator
 
Join Date: Dec 2013
Posts: 2,008
Default

Where can I learn a good amount of information about the RSP? I'm interested in working on HLE gfx. At the very least, I'd want to be able to do something like what they did with 1964 Audio. I feel like it would be easier and more fun to do, than writing an RSP recompiler.

I tried working with Ziggy's modified PJ64 RSP, but I have no idea how to improve it, other than micro-optimizations. Some games like F-Zero just don't work. Ironically, z64gl also doesn't work for me with F-Zero lol.
Reply With Quote
  #863  
Old 8th July 2014, 04:56 AM
HatCat's Avatar
HatCat HatCat is offline
Alpha Tester
Project Supporter
Senior Member
 
Join Date: Feb 2007
Location: In my hat.
Posts: 16,236
Default

Try looking up anarko's n64ops archive. It has a little information about the RSP compiled with it, encompassing the fundamentals of what was discovered through the Project Unreality emulator.

You can also find official manuals by MIPS Technologies themselves about the primary, scalar op-codes inherently preserved on the RSP, but you could have found that out already by reading the manual for this plugin (although it didn't occur to me to mention anarko's archive in my documentation).
Reply With Quote
  #864  
Old 8th July 2014, 06:02 AM
RPGMaster's Avatar
RPGMaster RPGMaster is offline
Alpha Tester
Project Supporter
Super Moderator
 
Join Date: Dec 2013
Posts: 2,008
Default

Alright, thanks for the link & suggestion.

I'll read up on that and take a closer look at your source code. Wikipedia is pretty good . I now understand it a little better.

What confuses me is, I looked at 1964 Audio's microcode implementation and tried to see if I could do what they did. Some of the instructions didn't match up. Also when i was debugging the RSP with PJ64 2.1, I noticed there was a whole section of instructions that weren't implemented. I'm guessing the part they skipped was gfx instructions? I'll need to figure out how to differentiate them too.

Hopefully I can figure that out, by the time I get started working on HLE gfx. Maybe it would be easier to analyze RSP data if I looked at the ROM data, instead of RAM, because I can only see 4kb at a time when i'm debugging the RSP.
Reply With Quote
  #865  
Old 8th July 2014, 06:06 PM
HatCat's Avatar
HatCat HatCat is offline
Alpha Tester
Project Supporter
Senior Member
 
Join Date: Feb 2007
Location: In my hat.
Posts: 16,236
Default

Not sure what you're saying
Reply With Quote
  #866  
Old 8th July 2014, 06:35 PM
RPGMaster's Avatar
RPGMaster RPGMaster is offline
Alpha Tester
Project Supporter
Super Moderator
 
Join Date: Dec 2013
Posts: 2,008
Default

Quote:
Originally Posted by HatCat View Post
Not sure what you're saying
I was saying since you can only have 4KB of imem, you only see 1024 instructions at a time, when debugging. When i set a breakpoint, I saw a whole set (1024) instructions that were not implemented into 1964 Audio. I'm guessing these were for graphics.

What really confuses me is the part they did implement. Most of it was identical, but the end was different.

Now I'm even more confused since I'm seeing more of a match between the microcode implementation and the actual RSP instructions for SSB64. I could have sworn that yesterday, a lot of the instructions didn't match 1964's implementation.

Anyway, I'd like to know where the IMEM data is in the rom. I will try hex searching. I'm interested in decompiling RSP for certain games.
Reply With Quote
  #867  
Old 8th July 2014, 07:00 PM
HatCat's Avatar
HatCat HatCat is offline
Alpha Tester
Project Supporter
Senior Member
 
Join Date: Feb 2007
Location: In my hat.
Posts: 16,236
Default

Sounded like you were saying something about unimplemented RSP or "graphics" instructions in the PJ64 2.1 RSP.

Well it's possible you might not be able to find the IMEM code segments just by hex-editing the ROM...remember N64 RDRAM can be at least 4 or 8 MB, but many ROMs aren't even that big.
Reply With Quote
  #868  
Old 8th July 2014, 08:57 PM
RPGMaster's Avatar
RPGMaster RPGMaster is offline
Alpha Tester
Project Supporter
Super Moderator
 
Join Date: Dec 2013
Posts: 2,008
Default

Quote:
Originally Posted by HatCat View Post
Well it's possible you might not be able to find the IMEM code segments just by hex-editing the ROM...remember N64 RDRAM can be at least 4 or 8 MB, but many ROMs aren't even that big.
I see. I'll give it a try anyway .

Well I'm relieved that it appears to just be 1 set of IMEM code for audio. I was confused because I saw there were many functions implemented for 1 game in 1964 Audio, so I assumed there were multiple sets of IMEM data. After carefully reading Super Smash Bros microcode implementation, i saw that all the functions were based off of 1 set of IMEM code.

Maybe it depends on the game, but even so, that's a relief for certain games. I'll probably just continue studying the RSP and analyze a few games. Then later on, once I have a solid understanding, I will attempt to do HLE work.
Reply With Quote
  #869  
Old 8th July 2014, 09:15 PM
HatCat's Avatar
HatCat HatCat is offline
Alpha Tester
Project Supporter
Senior Member
 
Join Date: Feb 2007
Location: In my hat.
Posts: 16,236
Default

You know what dude honestly, if you actually can find RSP instruction memory code segments just by hex-editing any of the ROMs (doubtful as it may be), do let me know if you happen to have any luck. It could be my shot at finally being able to reverse-engineer some extra results of RSP instructions, although indirectly (don't even have a real N64 on me anymore let alone accessories like a GameShark, 64drive etc.).

This way we could learn more about how to make demos, that break emulators and require a real N64. :P
Reply With Quote
  #870  
Old 8th July 2014, 09:57 PM
RPGMaster's Avatar
RPGMaster RPGMaster is offline
Alpha Tester
Project Supporter
Super Moderator
 
Join Date: Dec 2013
Posts: 2,008
Default

Hmm, looks like my hunch was right, that you could find the RSP code inside of the rom. The reason is because I doubted that they would compress RSP instructions. Perhaps, maybe some weird games might, but certainly not all.

Too bad memory search doesn't work for pj64 2.1. What I did was simply look at 1964 Audio's microcode implementation and copy the hex code written in the comments.

I did more checking and it appears to be split up in the rom. For instance in SSB64, the beginning of the RSP for what I assume is for Audio, begins at offset 0xB70 in the rom. Then I checked where the code at address _04001100 in IMEM would be, and found it at offset 0x3A340.

Now that probably explains why they have a function called bootcode in 1964 Audio's microcode implementation. It appears that the bootcode section starts at 0xB70 in the ROM, the the other part starts at 0x3A2C0.

For the time being, I'm relying on 1964 Audio's source, since idk a convenient way to dump the hex code of RSP instructions. I like their formating for generating the RSP code.

I'm starting to see why I got confused. _SmashBrosBootCode has the same exact code for 04001000 through _0400107C as _SmashBrosData. This really confused me. When I searched for the hex code of _04001080 for _SmashBrosData, the offset was 0x3A2C0 in the ROM. When I hex searched the data at _04001A80, i found the result at offset 0x3ACC0 in the ROM. So it looks like it's all there.

Now I'm curious about your goal. How would you know where the RSP data is, if it won't run on emulator? I suppose maybe you could do guess work and hex search common RSP instructions? I'm not sure if LemASM supports RSP instructions. I should go look and see what it looks like .

I'm glad though, because in the near future, I will start debugging the RSP. So you think the best option for debugging is PJ64 2.1? I'll probably write my own tool to hex dump the RSP IMEM.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 05:34 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.