From 10a58e72aa3f74a821fa9be07ffd3992ffa93600 Mon Sep 17 00:00:00 2001 From: João Silva Date: Sun, 18 Jun 2017 16:14:12 +0100 Subject: BSX fixes. Many BSX games are now playable. --- source/getset.h | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'source/getset.h') diff --git a/source/getset.h b/source/getset.h index 7d28a04..4155f75 100644 --- a/source/getset.h +++ b/source/getset.h @@ -18,7 +18,7 @@ INLINE uint8_t S9xGetByte(uint32_t Address) int32_t block; uint8_t* GetAddress = Memory.Map [block = (Address >> MEMMAP_SHIFT) & MEMMAP_MASK]; - if (!CPU.InDMA) + if ((intptr_t) GetAddress != MAP_CPU || !CPU.InDMA) CPU.Cycles += Memory.MemorySpeed [block]; if (GetAddress >= (uint8_t*) MAP_LAST) @@ -77,7 +77,7 @@ INLINE uint16_t S9xGetWord(uint32_t Address) int32_t block; uint8_t* GetAddress = Memory.Map [block = (Address >> MEMMAP_SHIFT) & MEMMAP_MASK]; - if (!CPU.InDMA) + if ((intptr_t) GetAddress != MAP_CPU || !CPU.InDMA) CPU.Cycles += (Memory.MemorySpeed [block] << 1); if (GetAddress >= (uint8_t*) MAP_LAST) @@ -153,10 +153,9 @@ INLINE void S9xSetByte(uint8_t Byte, uint32_t Address) int32_t block; uint8_t* SetAddress = Memory.WriteMap [block = ((Address >> MEMMAP_SHIFT) & MEMMAP_MASK)]; - if (!CPU.InDMA) + if ((intptr_t) SetAddress != MAP_CPU || !CPU.InDMA) CPU.Cycles += Memory.MemorySpeed [block]; - if (SetAddress >= (uint8_t*) MAP_LAST) { #ifdef CPU_SHUTDOWN @@ -242,10 +241,9 @@ INLINE void S9xSetWord(uint16_t Word, uint32_t Address) int32_t block; uint8_t* SetAddress = Memory.WriteMap [block = ((Address >> MEMMAP_SHIFT) & MEMMAP_MASK)]; - if (!CPU.InDMA) + if ((intptr_t) SetAddress != MAP_CPU || !CPU.InDMA) CPU.Cycles += Memory.MemorySpeed [block] << 1; - if (SetAddress >= (uint8_t*) MAP_LAST) { #ifdef CPU_SHUTDOWN @@ -458,5 +456,4 @@ INLINE void S9xSetPCBase(uint32_t Address) CPU.PC = CPU.PCBase + (Address & 0xffff); } - #endif -- cgit v1.2.3