These instructions are all implemented with fastmem support.
Currently loads with update are disabled due to an issue that I've yet to figure out.
I'm sure I'll figure that out later.
Currently supports only integer loadstores. Floating point loadstores will come later.
This system is semi based on the ARMv7 backpatching routine, where we need to initialize our backpatch routine sizes prior to actually using them so
we know we won't be overwriting any memory.
dcbz: just don't use GetPointer, that can't be right anyways
ppcanalyst: don't print "instruction hex 0" messages in MMU mode, where ISIs
are expected.
This hack is there for quite a long time, and lots of games crashes if it's disabled.
But it's still a hack, so it shouldn't be enabled hard coded. This commit create a new
ini option for this hack which is enabled by default.
Maybe some games does still run very fine without this hack.
This is a one instruction optimization for integer loadstores.
Makes sure to enable nop padding in some cases where a fault can still happen and cause us to overwrite other instructions that aren't meant to be.
Align our dispatcher to a page so we can jump to it with a ADRP+BR pair instead of ADRP+ADD+BR.
Also make sure to save /all/ of our callee saved registers that we are supposed to save.
Requires PR #1705 prior to merging.
Adds the ability to flush the cache and maintain state.
Adds the BindToRegister ability.
Sorts register usage as callee saved used first, reduces dumping pressure when jumping to external routines/interpreter.
Adds a function to store a register, for use when flushing a register that won't be used during the rest of a block.
Unfortunately the map files in American Mensa Academy don't correspond to the release version.
But at least now if other games use those map files we will be able to load them.
Fixes#7917
The first memset was clearing the delicate bits of the std::string
in the struct, causing segfaults.
I also removed the rest of the memsets because they were paranoid,
unneeded and waseful. We shouldn't be managing the ssl libraries
structs for it.
I checked and the ssl library's functions were already memsetting
those structs as needed.
Even in games that require MMU mode, loads outside the area specified by
the BAT are rare, so fastmem is a substantial improvement.
All of the interesting changes are in the backpatch handler, to make it
generate DSI exceptions correctly.
Previously the two operand register selection bits were inverted, causing "CMPAR AC1, AX0.H" to be disassembled as "CMPAR AC0, AX1.H".
DSP RE is always fun: on the one hand Nintendo does a lot of stupid shit, so anything weird could be a legitimate bug of the UCode that is not supposed to make any sense. On the other hand, Dolphin *also* does a lot of stupid shit, so there's always that doubt.
Note: completely untested change - done with the GH text editor, just to show you how much I care :) . These operand descriptions are only used for disassembly, so no real behavior change is expected.
The libusb driver must be installed on the adapter (e.g. zadig can be used to install the driver in Windows). GameCube pad controllers are supported and will override the current input device assigned to the port. GameCube controller buttons are auto-configured and cannot be re-assigned. Rumble is supported. Hotplug is supported while playing a game. If a controller is unplugged from the adapter, Dolphin will fallback to using the host input device on that port. If a port on the adapter is unused, Dolphin will use the host input device for that port, allowing a mixture of host input devices and controllers connected to the adapter.
The adapter support can be disabled in the Controllers config if the OS driver is preferred (allowing the pad buttons to be reconfigured).
One adapter per system is supported.
Updated PTE.R bit on Write and Instruction fetch.
Added code to read the PTE from MEM2 if the PTE is stored there.
Refactored the two hash functions to reduce code duplication.
Updated save state version.
We try to keep as many registers as possible in callee saved registers, so if we have guest registers in the correct registers and the interpreter
call we are falling back to doesn't need the registers then we can dump just those ones. Which means we don't have to dump 100% of our register state
when falling to the interpreter.
ComputeRC was a bit unclear by using 64bit registers for setting the immediate and then calling SXTW on a 6b4it register which is just a bit obscure.
When the source register is an immediate in cntlzwx, just use the built in GCC function instead of our own implementing for counting leading zeros.
Before block linking was enabled but it wasn't ever implemented.
Implements link blocks and destroy block functions and moves the downcount check in the WriteExit function so it doesn't get overwritten when linking.
Changes the dispatcher to make sure to we are saving the LR(X30) to the stack. Also makes sure to keep the stack aligned.
AArch64's AAPCS64 mandates the stack to be quad-word aligned.
Fixes the dispatcher from infinite looping due to a downcount check jumping to the dispatcher. This was because checking exceptions and the state
pointer wouldn't reset the global conditional flags. So it would leave the timing/exception, jump to the start of the dispatcher and then jump back
again due to the conditional branch.
Removes the REG_AWAY nonsense I was doing. I've got to get the JIT more up to speed before thinking of insane register cache things.
Also fixes a bug in immediate setting where if the register being set to an immediate already had a host register tied to it then it wouldn't free the
register it had. Resulting in register exhaustion.
lmw/stmw weren't properly setting input and output registers since they use multiple registers.
dcbz was just missing a flag in the instruction tables.
This code was obviously wrong, we were sign extending 8 bit unsigned values and loading from the wrong offset as well.
This fixes a bug in Muramasa where some colours were going insane.
If the inputs are both float singles, and the top half is known to be identical
to the bottom half, we can use packed arithmetic instead of scalar to skip
the movddup.
This is slower on a few rather old CPUs, plus the Atom+Silvermont, so detect
Atom and disable it in that case.
Also avoid PPC_FP on stores if we know that the output came from a float op.
Rather than playing terrible hacks to determine the start of input
frames, just update system input periodically. Specifically, every
60th of a second.
The game can never change these, so there's no reason to make it
dynamic. Just put the constants in the code.
While we're at it, take the time to clean up the code and also
and document several of the hacks we're doing inside to make the code
clearer to understand.