mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
MMIO: Fix a megaderp in the UniqueID function causing handlers to be overwritten by other handlers.
This commit is contained in:
@ -32,7 +32,7 @@ const u32 BLOCK_SIZE = 0x10000;
|
|||||||
const u32 NUM_MMIOS = NUM_BLOCKS * BLOCK_SIZE;
|
const u32 NUM_MMIOS = NUM_BLOCKS * BLOCK_SIZE;
|
||||||
|
|
||||||
// Compute the internal unique ID for a given MMIO address. This ID is computed
|
// 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).
|
// The block ID can easily be computed by simply checking bit 24 (CC vs. CD).
|
||||||
inline u32 UniqueID(u32 address)
|
inline u32 UniqueID(u32 address)
|
||||||
@ -42,7 +42,7 @@ inline u32 UniqueID(u32 address)
|
|||||||
((address & 0xFFFF0000) == 0xCD800000),
|
((address & 0xFFFF0000) == 0xCD800000),
|
||||||
"Trying to get the ID of a non-existing MMIO address.");
|
"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.
|
// Some utilities functions to define MMIO mappings.
|
||||||
|
Reference in New Issue
Block a user