|
#371
|
||||
|
||||
![]() Quote:
Also, I would recommend taking advantage of format strings; you can fix the length of the number using the format string instead of writing two loops. Last edited by MarathonMan; 27th August 2013 at 10:25 PM. |
#372
|
||||
|
||||
![]() Quote:
![]() Good... I don't feel bad then! XD |
#373
|
||||
|
||||
![]()
By the way, I found a new way to decode RSP instructions. I haven't merged the code into my own RSP decoder yet, but I have made the changes to my VR4300 decoder successfully.
My VR4300 decoder is now completely branchless, and only requires 7 arrays of 64 pointers each (total cache overhead of 3584 bytes on x86_64, or 1792 bytes on IA-32). Moreover, the code is stupid short and is made up of zero macro-ops: Code:
0000000000000000 <VR4300DecodeInstruction>: 0: 89 f8 mov %edi,%eax 2: c1 e8 1a shr $0x1a,%eax 5: 48 c1 e0 04 shl $0x4,%rax 9: 8b 88 00 00 00 00 mov 0x0(%rax),%ecx f: d3 ef shr %cl,%edi 11: 23 b8 00 00 00 00 and 0x0(%rax),%edi 17: 48 8b 80 00 00 00 00 mov 0x0(%rax),%rax 1e: 48 8d 04 f8 lea (%rax,%rdi,8),%rax 22: c3 retq Last edited by MarathonMan; 27th August 2013 at 10:43 PM. |
#374
|
||||
|
||||
![]() Quote:
Also, for some reason, when I added -Wextra, pedantic, and ansi, those warnings went away. ![]() So maybe it's more catchy sometimes when I only use -Wall, without those other three. Anyway yeah, just need to fill in the count register then that's fixed. Quote:
Like, "%(space)2X" or something? printf strings confuse me. Basically I just want it looking like this: Code:
... $v8: $v9: $v10: $v11: ... Quote:
So it really does add 0x008 to the link/return-address register specified (usually $ra) and not 0x004 then? ![]() Because all the manuals say that return_addr = current_PC + 8, not 4. That also was the way zilmar did it in his RSP for which he was reversing.
__________________
http://theoatmeal.com/comics/cat_vs_internet |
#375
|
||||
|
||||
![]() Quote:
So things with structs as parameters kind of make it hard for me to read. It looks about the same basic concept as before so I'm not really sure what's different. Always worth arguing over once I isolate this last bug first though. ![]() I'm running RSP in HLE gfx and LLE audio now, Banjo-Tooie and Zelda/etc. with other RSP LLE types function perfectly and audio is mostly perfect, even more-so in MusyX games like Twine 007 ... damn, what kind of opcode would cause this particularity of audio issues in standard ABI...
__________________
http://theoatmeal.com/comics/cat_vs_internet |
#376
|
||||
|
||||
![]()
HEY, LISTEN. God that got so annoying sometimes.
Quote:
Quote:
![]() Primarily much smaller overhead. I only have 7 arrays. Last edited by MarathonMan; 28th August 2013 at 12:02 AM. |
#377
|
||||
|
||||
![]() ![]() *HEAH!* *HEEAAH!!* *HEEAAAHH!!!* Come on, nao! Who wants to play dat shit? Quote:
AFAIK the '$', 'v', and '9' must all be contiguous. But maybe I could settle for "$v9 :" instead of " $v9:", I don't really care because I'm going to have this code commented out by macros in the stable build anyway. The debug build is just something you have to compile to make it. So I'm not interested in optimizing that so much. I only changed it to shut those warnings up primarily. ![]() Quote:
![]() heh, but seriously that does sound kind of cool, but nothing I need to be too concerned about atm I guess =D Technically I only have one array; it's just too damned big. But there are 8 opcode matrices on the RSP, so idk.
__________________
http://theoatmeal.com/comics/cat_vs_internet |
#378
|
||||
|
||||
![]() Quote:
![]() Imma let you finish, but... Last edited by MarathonMan; 28th August 2013 at 01:26 AM. |
#379
|
||||
|
||||
![]() Quote:
I tried what you said, but the CPU core seems to be behaving even more unpredictably than my RSP emulator its self. (Or at least Project64; I did try to get the messages to pop on MUPEN just as well.) I fwrite the SR and VR register files for every single instruction, to its own file named after the current task number (starting at 0). So "rcp_0000.bin" is the log of all the SR and VR values before the very first BREAK instruction. "rcp_0001.bin" is the log of all the SR and VR values before the next BREAK encounter, etc.. Unfortunately the results seem unpredictable. One time I load on Project64 with a (very much) older, stable version of the RSP emulator (albeit from years back, when it was still mostly zilmar's code), the very first SP task (rcp_xxxx number) to report a mismatch between the register storage results of my current RSP beta, and this older, stable version, kept randomizing between 22, to 24, to 33, to 54 ... ??? register results seemed unreliable and unstable due to possibly CPU intervention. It takes way too long into the RSP emulation thread for a mismatch to pop-up, to know whether or not it is the bug I am trying to find, or some stupid unreliability about the Project64 1.6 CPU interpreter I'm using for Super Mario 64, Resident Evil 2, (Here it starts at SP task #2, #3, or sometimes later, but it is still random and inconsistent.) etc.. If you ask me, it must be some really, really narrow corner case for it to take that long into a commercial game to be exploited. And the more I am thinking about this, the more I'm beginning to wonder if it IS a bug in one of my vector ops, even though I didn't touch them one bit during the 2-D jump table rewrite, except for that ANSI compliance stuff you got me to try.. That's just how desperately I'm starting to think about this because I have looked over all the scalar ops...the ADDs/SUBs, the logical/arithmetic immediates, all the branches and jumps, and the load/store words, like a hundred times over and see nothing wrong XD. This is frustrating.
__________________
http://theoatmeal.com/comics/cat_vs_internet |
#380
|
||||
|
||||
![]()
That is... odd. Obviously, I can't do it anymore with my simulator as the interrupts and firing at different times on the VR4300 and whatnot, but this is the technique I used almost singlehand-idly to bash out any bugs when I was working on the SSE additions to your plugin. And I never had an issue of things being unpredictable like that. If it helps, I was using the latest version of mupen64plus.
Quote:
![]() ![]() Remember that it could also be things like the branch delay slots, too, since you changed the operation of those. Many times in my simulator all my instructions have been flawless, but there's been some corner-case with the control flow logic that was just a little off. |