| 819 | } |
| 820 | |
| 821 | U16 KMemory::readw(U32 address) { |
| 822 | if ((address & 0xFFF) < 0xFFF) { |
| 823 | int index = address >> 12; |
| 824 | #if !defined(UNALIGNED_MEMORY) |
| 825 | MMU& mmu = data->mmu[index]; |
| 826 | if (mmu.canReadRam) { |
| 827 | return *(U16*)(&(ramPageGet((RamPage)mmu.ramIndex)[address & 0xFFF])); |
| 828 | } |
| 829 | #endif |
| 830 | return data->mmu[index].getPage()->readw(&data->mmu[index], address); |
| 831 | } |
| 832 | return readb(address) | (readb(address + 1) << 8); |
| 833 | } |
| 834 | |
| 835 | U8 KMemory::readb(U32 address) { |
| 836 | int index = address >> 12; |