From 4895cfbf100594d909ace9451872b3d4e83213f8 Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Sun, 3 Aug 2014 11:42:24 -0400 Subject: [PATCH] fix sequencing with memory reads. --- cpu/memory.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cpu/memory.c b/cpu/memory.c index 107c670..45aae5e 100644 --- a/cpu/memory.c +++ b/cpu/memory.c @@ -97,8 +97,8 @@ UWO memoryReadWord(ULO address) if (address & 0x01) memoryOddRead(address); if (address + 1 < MemorySize) - return (Memory[address++] << 8) - | (Memory[address++] << 0); + return (Memory[address + 0] << 8) + | (Memory[address + 1] << 0); return 0; } @@ -112,10 +112,10 @@ ULO memoryReadLong(ULO address) if (address & 0x01) memoryOddRead(address); if (address + 3 < MemorySize) - return (Memory[address++] << 24) - | (Memory[address++] << 16) - | (Memory[address++] << 8) - | (Memory[address++] << 0); + return (Memory[address + 0] << 24) + | (Memory[address + 1] << 16) + | (Memory[address + 2] << 8) + | (Memory[address + 3] << 0); return 0; }