| 874 | } |
| 875 | |
| 876 | void KMemory::writew(U32 address, U16 value) { |
| 877 | if ((address & 0xFFF) < 0xFFF) { |
| 878 | int index = address >> 12; |
| 879 | #if !defined(UNALIGNED_MEMORY) |
| 880 | MMU& mmu = data->mmu[index]; |
| 881 | if (mmu.canWriteRam) |
| 882 | *(U16*)(&(ramPageGet((RamPage)mmu.ramIndex)[address & 0xFFF])) = value; |
| 883 | else |
| 884 | #endif |
| 885 | data->mmu[index].getPage()->writew(&data->mmu[index], address, value); |
| 886 | } else { |
| 887 | writeb(address, (U8)value); |
| 888 | writeb(address + 1, (U8)(value >> 8)); |
| 889 | } |
| 890 | } |
| 891 | |
| 892 | void KMemory::writeb(U32 address, U8 value) { |
| 893 | int index = address >> 12; |