In RSP interpreter, it is DisplayError and I feel like it's an important
message, so it should be DisplayError in RSP recompiler as well, in my
opinion.
the & 0xFFC was missing, which caused it to return true when it should
have returned false. This means that LLE audio should be more optimized
now.
I also made it do delay slot, incase the delay slot instruction writes
to accumulator. Minor optimization here.
As for JAL, I made it do break instead of return FALSE because in Battle
For Naboo, it actually does come back and continue an existing
calculation. I think it is only an issue if you do a separate analysis
for the Low Accumulator and Mid/High Accumulators. It's still better to
be safe, just incase I or someone else actually implement a separate
analysis for the Accumulators later down the road.
Due to the newer spec design in PJ64 2.x, CloseDLL() doesn't get called
as often. So there are instances where it calls AllocateMemory()
multiple times without ever calling FreeMemory().
I previously made a commit to fix a reordering issue, but did not
realize it needed that COPO_MF_Instruction flag for branching. This
should fix the Ogre Battle issue.
Tried my best to make sure I didn't miss any op-codes. (Ctrl+F searching for "!= 0" and "== 0" throught the file shows me that I didn't.) If I did miss any op-codes, it's no bug, just remaining extra unnecessary checking for zero.
In the RSP, MFC0, MFC2, and CFC2 were all susceptible to overwriting $zero. Some of us have tried waiting for some games to use handcoded assembly in an attempt to purposely overwrite $zero in their microcode (to throw off emulators), but so far what few occurrences there have been of this have not included using those 3 opcodes. Since it was decided to centralize the security of register $zero in the main R4300 CPU, it was decided to do so in the RSP as well.
It's supposed to check the next instruction, which is PC, rather than
the current instruction which is CompilePC. This mistake is what caused
graphical errors in RE2.
Instruction Reordering broke Mia Hamm and possibly other games too. The
easiest way to fix the problem was to simply disable reordering for
specific cases that were never accounted for.
Not only were certain instructions missing, but also some were in the
wrong place or had the wrong attributes.
Also VSUB needed to be added to IsNextInstructionMmx.
There were no other members of struct `tagOPCODE` besides one nameless union, so, to fix some nameless union compiler warnings, I deleted struct tagOPCODE and named the nameless union, union tagOPCODE. Since "OpCode.h" is #include'd 9 times across the RSP source, technically this commit fixes 9 warning messages, even though it's really just 1 warning.
It may be true that this SQV edge case only seems to happen when
isRegConst = true, I forgot to account for the possibility that GPR
Constant Analysis could be disabled.
I also just noticed that I goofed with the non-sse shuffling ;/ . The
registers weren't in order.
I totally forgot that LDV handles elements differently than SDV. I added
a fallback to deal with unusual elements and added an alert to notify
that it exists in a particular game. I removed the & 0xF since that's
not needed. My previous change caused Stunt Racer 64 to have audio
issues. It should now be fixed.
I have only seen the edgecase for SQV happen when
IsRegConst(RSPOpC.base) == TRUE. Changing SQV fixed Telefoot / Mia Ham.
I optimized VAND, for games like Kirby64.
The possibility of the RSP instruction at address 0xFFC being JR was
never accounted for. This fixes Wave Race and Star Wars - Shadow of the
Empire.
The accumulator analysis was wrong, which broke games like Mario No
Photopie.
Fixing SW allows a lot more games to work. Fixing LW fixes games like
WDC and improves performance somehow. Fixing VMRG fixes certain bugs,
like Kirby 64's intro.
Set bitmasks for two calculations in RSP_SW_DMEM, to stop errors in Banjo Kazooie when in debug mode for RSP. (Was attempting to cast to a smaller data type, causing a loss of data)