mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
GeckoCode: Use named constants in ICache flush hack
Turns out one of the magic numbers was very magic. The gameid is an ad-hoc comm protocol with HLE_Misc to control the number of times the ICache is reset.
This commit is contained in:
@ -33,6 +33,20 @@ public:
|
||||
bool Exist(u32 address, u32 data) const;
|
||||
};
|
||||
|
||||
// Installation address for codehandler.bin in the Game's RAM
|
||||
constexpr u32 INSTALLER_BASE_ADDRESS = 0x80001800;
|
||||
constexpr u32 ENTRY_POINT = 0x800018A8;
|
||||
|
||||
// This forms part of a communication protocol with HLE_Misc::HLEGeckoCodehandler.
|
||||
// Basically, codehandleronly.s doesn't use ICBI like it's supposed to when patching the
|
||||
// game's code. This results in the JIT happily ignoring all code patches for blocks that
|
||||
// are already compiled. The hack for getting around that is that the first 5 frames after
|
||||
// the handler is installed (0xD01F1BAD -> +5 -> 0xD01F1BB2) cause full ICache resets.
|
||||
//
|
||||
// HLEGeckoCodehandler will increment this value 5 times then cease flushing the ICache to
|
||||
// preserve the emulation performance.
|
||||
constexpr u32 MAGIC_GAMEID = 0xD01F1BAD;
|
||||
|
||||
void SetActiveCodes(const std::vector<GeckoCode>& gcodes);
|
||||
void RunCodeHandler();
|
||||
|
||||
|
Reference in New Issue
Block a user