mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-25 07:21:14 +01:00
MMIO: Fix a megaderp in the UniqueID function causing handlers to be overwritten by other handlers.
This commit is contained in:
parent
b8582b00a9
commit
c06c8f0ec8
@ -32,7 +32,7 @@ const u32 BLOCK_SIZE = 0x10000;
|
||||
const u32 NUM_MMIOS = NUM_BLOCKS * BLOCK_SIZE;
|
||||
|
||||
// Compute the internal unique ID for a given MMIO address. This ID is computed
|
||||
// from a very simple formula: (1 + block_id) * lower_16_bits(address).
|
||||
// from a very simple formula: (block_id << 16) | lower_16_bits(address).
|
||||
//
|
||||
// The block ID can easily be computed by simply checking bit 24 (CC vs. CD).
|
||||
inline u32 UniqueID(u32 address)
|
||||
@ -42,7 +42,7 @@ inline u32 UniqueID(u32 address)
|
||||
((address & 0xFFFF0000) == 0xCD800000),
|
||||
"Trying to get the ID of a non-existing MMIO address.");
|
||||
|
||||
return (1 + ((address >> 24) & 1)) * (address & 0xFFFF);
|
||||
return (((address >> 24) & 1) << 16) | (address & 0xFFFF);
|
||||
}
|
||||
|
||||
// Some utilities functions to define MMIO mappings.
|
||||
|
Loading…
x
Reference in New Issue
Block a user