10-20% overall performance improvement on GCW Zero, depending on game.
Compatiblity maintained with older savestates, no loss in game compatibility.
Added new event/interrupt scheduler queue (psxevents.cpp, psxevents.h) efficiently sorts scheduled events based on their imminency upon insertion.
Queue allows psxBranchTest() to be greatly simplified and centralizes handling of scheduling events from elsewhere in the code
psxRegs.io_cycle_counter now accurately can be used to determine when next call to psxBranchTest() is needed, by seeing if psxRegs.cycle is >= to it. By doing this now, the number of times psxBranchTest() is called per frame is reduced from an average of 15,000 to less than 50, often less, a reduction of over 99%.
New event type PSXINT_RESET_CYCLE_VAL resets psxRegs.cycle to 0 every 2 billion emulated cycles, ensuring it never overflows. At the same time, root counter timestamps are also adjusted accordingly. This ensures comparison between psxRegs.cycle and psxRegs.io_cycle_counter is always accurate.
MIPS dynarec block dispatch/entry/exit code is optimized heavily, factoring out code common to all blocks into main dispatch loop. Dispatch loop itself is optimized/commented and avoids load stalls.
Recompiled MIPS blocks now return new psxRegs.pc value in $v0 and # of cycles ot increment psxRegs.cycle by in $v1. This allows main dispatch loop to handle the usage/updating of values.
Misc dynarec improvements like added missing branch/jump macros, eliminated writing raw opcodes, make use of branch delay slot when calling functions from within recompiled code.
GCW Zero builds are built with options '-mplt -mno-shared', which makes calling functions from within inline MIPS ASM easier/predictable (don't need to worry about assigning/saving $gp reg when calling, also reduces size of overall binary since $25 doesn't need to be set and $28 setup every time function is called). It also keeps GCC from bitching about not using .frame and .cprestore inside an inline ASM block when '.set noreorder' is enabled.
10-20% overall performance improvement on GCW Zero, depending on game.