From 52450aa7f75e201d7bcb06e216b4187d64e0b5d4 Mon Sep 17 00:00:00 2001 From: tomcw Date: Sat, 13 May 2017 22:07:53 +0100 Subject: [PATCH] These 2 combined fix #418: 1) Uthernet card now returns floating bus for slot ROM at $Cs00-CsFF (where s=3). 2) Fixed IoHandlerCardsIn() to not map in the card in slot3's slot ROM when SLOTC3ROM=0. Also: . moved the typedef 'iofunction' from common.h to memory.h --- source/Common.h | 3 -- source/Memory.cpp | 47 +++++++++++++++++++++++++++----- source/Memory.h | 5 ++++ source/Tfe/Tfe.cpp | 31 ++++++++++++++++++--- test/TestCPU6502/TestCPU6502.cpp | 1 + 5 files changed, 73 insertions(+), 14 deletions(-) diff --git a/source/Common.h b/source/Common.h index fbad00b2..bb8215db 100644 --- a/source/Common.h +++ b/source/Common.h @@ -141,9 +141,6 @@ enum AppMode_e #define WM_USER_FULLSCREEN WM_USER+9 #define VK_SNAPSHOT_TEXT WM_USER+10 // PrintScreen+Ctrl -// TODO-TC: Refactor codebase by renaming /nCyclesLeft/ to /uExecutedCycles/ -typedef BYTE (__stdcall *iofunction)(WORD nPC, WORD nAddr, BYTE nWriteFlag, BYTE nWriteValue, ULONG nCyclesLeft); - enum eIRQSRC {IS_6522=0, IS_SPEECH, IS_SSC, IS_MOUSE}; // diff --git a/source/Memory.cpp b/source/Memory.cpp index a316d12f..3632bbe2 100644 --- a/source/Memory.cpp +++ b/source/Memory.cpp @@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Author: Various * - * In comments, UTA2E is an abbreviation for a reference to "Understanding the Apple //e" by James Sather + * In comments, UTAIIe is an abbreviation for a reference to "Understanding the Apple //e" by James Sather */ #include "StdAfx.h" @@ -340,7 +340,7 @@ static BYTE __stdcall IORead_C06x(WORD pc, WORD addr, BYTE bWrite, BYTE d, ULONG { static byte CurrentKestroke = 0; CurrentKestroke = KeybGetKeycode(); - switch (addr & 0x7) // address bit 4 is ignored (UTA2E page 7-5) + switch (addr & 0x7) // address bit 4 is ignored (UTAIIe page 7-5) { //In Pravets8A/C if SETMODE (8bit character encoding) is enabled, bit6 in $C060 is 0; Else it is 1 //If (CAPS lOCK of Pravets8A/C is on or Shift is pressed) and (MODE is enabled), bit7 in $C000 is 1; Else it is 0 @@ -524,6 +524,20 @@ static bool IsCardInSlot(const UINT uSlot); // NB. ProDOS boot sets IO_SELECT=0x04 (its scan for boot devices?), as slot2 contains a card (ie. SSC) with an expansion ROM. +// +// ----------- +// UTAIIe:5-28 +// $C100-C2FF +// INTCXROM(*) SLOTC3ROM $C400-CFFF $C300-C3FF +// 0 0 slot internal +// 0 1 slot slot +// 1 0 internal internal +// 1 1 internal internal +// +// (*) SLOTCXROM' +// ----------- +// + BYTE __stdcall IORead_Cxxx(WORD programcounter, WORD address, BYTE write, BYTE value, ULONG nCyclesLeft) { if (address == 0xCFFF) @@ -731,9 +745,11 @@ void RegisterIoHandler(UINT uSlot, iofunction IOReadC0, iofunction IOWriteC0, io ExpansionRom[uSlot] = pExpansionRom; } -// TODO: Support SW_SLOTC3ROM? +// From UTAIIe:5-28: Since INTCXROM==1 (SLOTCXROM==0) then state of SLOTC3ROM is not important static void IoHandlerCardsOut(void) { + _ASSERT( !SW_SLOTCXROM ); // INTCXROM==1 + for (UINT uSlot=1; uSlot