diff options
| author | Pierre Bourdon <delroth@gmail.com> | 2014-02-23 08:34:05 +0100 |
|---|---|---|
| committer | Pierre Bourdon <delroth@gmail.com> | 2014-02-23 08:34:05 +0100 |
| commit | c06c8f0ec82891345b4fa2c309d57d3d8d360745 (patch) | |
| tree | c03ccf9fc97c1d2955ed68f58b2dc3defdb59e5e /Source/Core | |
| parent | b8582b00a9821a86b84611a797167cd9c9cd1f4b (diff) | |
MMIO: Fix a megaderp in the UniqueID function causing handlers to be overwritten by other handlers.
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/Core/HW/MMIO.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/Core/Core/HW/MMIO.h b/Source/Core/Core/HW/MMIO.h index 541d75b271..447ae5285d 100644 --- a/Source/Core/Core/HW/MMIO.h +++ b/Source/Core/Core/HW/MMIO.h @@ -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. |
