From 8d302f35e95ab752037a0b3d051d93d00c9889e6 Mon Sep 17 00:00:00 2001 From: Sean Fausett Date: Mon, 6 Sep 2010 02:32:57 +0000 Subject: [PATCH] Modified memory interaction with NoSlotClock; pass internal ROM addresses $C3XX or $C8XX-$CFXX. --HG-- extra : convert_revision : svn%3Affd33b8c-2492-42e0-bdc5-587b920b7d6d/trunk%4051018 --- Library/CustomDictionary.xml | 2 +- Virtu/CustomDictionary.xml | 2 +- Virtu/Memory.cs | 17 ++++++++++++----- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/Library/CustomDictionary.xml b/Library/CustomDictionary.xml index de0462e..2a83b12 100644 --- a/Library/CustomDictionary.xml +++ b/Library/CustomDictionary.xml @@ -5,4 +5,4 @@ Alloc - \ No newline at end of file + diff --git a/Virtu/CustomDictionary.xml b/Virtu/CustomDictionary.xml index 2691c8d..eba5ec1 100644 --- a/Virtu/CustomDictionary.xml +++ b/Virtu/CustomDictionary.xml @@ -21,4 +21,4 @@ UpRight - \ No newline at end of file + diff --git a/Virtu/Memory.cs b/Virtu/Memory.cs index 9e78321..8417e6a 100644 --- a/Virtu/Memory.cs +++ b/Virtu/Memory.cs @@ -356,7 +356,7 @@ private int ReadIoRegionC3C3(int address) { SetRomC8CF(true); // $C3XX sets IntC8Rom; inhibits I/O Strobe' [5-28, 7-21] } - return _noSlotClock.Read(address, (IsRomC1CFInternal || !IsRomC3C3External) ? _romInternalRegionC1CF[address - 0xC100] : Machine.Slot3.ReadIoRegionC1C7(address)); + return (IsRomC1CFInternal || !IsRomC3C3External) ? _noSlotClock.Read(address, _romInternalRegionC1CF[address - 0xC100]) : Machine.Slot3.ReadIoRegionC1C7(address); } private int ReadIoRegionC8CF(int address) @@ -365,7 +365,7 @@ private int ReadIoRegionC8CF(int address) { SetRomC8CF(false); // $CFFF resets IntC8Rom [5-28, 7-21] } - return (IsRomC1CFInternal || IsRomC8CFInternal) ? _romInternalRegionC1CF[address - 0xC100] : Machine.Slots[_slotRegionC8CF].ReadIoRegionC8CF(address); + return (IsRomC1CFInternal || IsRomC8CFInternal) ? _noSlotClock.Read(address, _romInternalRegionC1CF[address - 0xC100]) : Machine.Slots[_slotRegionC8CF].ReadIoRegionC8CF(address); } [SuppressMessage("Microsoft.Usage", "CA2233:OperationsShouldNotOverflow", MessageId = "address-512")] @@ -548,11 +548,14 @@ private void WriteIoRegionC3C3(int address, byte data) { SetRomC8CF(true); // $C3XX sets IntC8Rom; inhibits I/O Strobe' [5-28, 7-21] } - else if (!IsRomC1CFInternal) + if (IsRomC1CFInternal || !IsRomC3C3External) + { + _noSlotClock.Write(address); + } + else { Machine.Slot3.WriteIoRegionC1C7(address, data); } - _noSlotClock.Write(address); } private void WriteIoRegionC8CF(int address, byte data) @@ -561,7 +564,11 @@ private void WriteIoRegionC8CF(int address, byte data) { SetRomC8CF(false); // $CFFF resets IntC8Rom [5-28, 7-21] } - if (!IsRomC1CFInternal && !IsRomC8CFInternal) + if (IsRomC1CFInternal || IsRomC8CFInternal) + { + _noSlotClock.Write(address); + } + else { Machine.Slots[_slotRegionC8CF].WriteIoRegionC8CF(address, data); }