mirror of
https://github.com/AppleWin/AppleWin.git
synced 2025-01-11 21:29:43 +00:00
Allow disk write protect read with drive off - Fixes #389
- Added comments - Removed mistaken check for writing nibbles < 0x80 - Reset forces all switches off
This commit is contained in:
parent
3d6c10bad9
commit
16b81133e0
@ -789,6 +789,8 @@ static void __stdcall DiskReadWrite(WORD pc, WORD addr, BYTE bWrite, BYTE d, ULO
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Should really test for drive off - after 1 second drive off delay (UTA2E page 9-13)
|
||||||
|
// but Sherwood Forest sets shift mode and reads with the drive off, so don't check for now
|
||||||
if (!floppywritemode)
|
if (!floppywritemode)
|
||||||
{
|
{
|
||||||
floppylatch = *(fptr->trackimage + fptr->byte);
|
floppylatch = *(fptr->trackimage + fptr->byte);
|
||||||
@ -796,7 +798,7 @@ static void __stdcall DiskReadWrite(WORD pc, WORD addr, BYTE bWrite, BYTE d, ULO
|
|||||||
LOG_DISK("read %4X = %2X\r\n", fptr->byte, floppylatch);
|
LOG_DISK("read %4X = %2X\r\n", fptr->byte, floppylatch);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else if ((floppylatch & 0x80) && !fptr->bWriteProtected) // && floppywritemode
|
else if (!fptr->bWriteProtected) // && floppywritemode
|
||||||
{
|
{
|
||||||
*(fptr->trackimage + fptr->byte) = floppylatch;
|
*(fptr->trackimage + fptr->byte) = floppylatch;
|
||||||
fptr->trackimagedirty = 1;
|
fptr->trackimagedirty = 1;
|
||||||
@ -816,7 +818,11 @@ static void __stdcall DiskReadWrite(WORD pc, WORD addr, BYTE bWrite, BYTE d, ULO
|
|||||||
|
|
||||||
void DiskReset(void)
|
void DiskReset(void)
|
||||||
{
|
{
|
||||||
|
// RESET forces all switches off (UTA2E Table 9.1)
|
||||||
|
currdrive = 0;
|
||||||
floppymotoron = 0;
|
floppymotoron = 0;
|
||||||
|
floppyloadmode = 0;
|
||||||
|
floppywritemode = 0;
|
||||||
phases = 0;
|
phases = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -884,9 +890,11 @@ static void __stdcall DiskLoadWriteProtect(WORD, WORD, BYTE write, BYTE value, U
|
|||||||
/* floppyloadmode = 1; */
|
/* floppyloadmode = 1; */
|
||||||
if (!write)
|
if (!write)
|
||||||
{
|
{
|
||||||
if (floppymotoron && !floppywritemode)
|
// Should really test for drive off - after 1 second drive off delay (UTA2E page 9-13)
|
||||||
|
// but Gemstone Warrior sets load mode with the drive off, so don't check for now
|
||||||
|
if (!floppywritemode)
|
||||||
{
|
{
|
||||||
// phase 1 on also forces write protect in the Disk II drive (UTA2E page 9-7) but we don't implement that
|
// Phase 1 on also forces write protect in the Disk II drive (UTA2E page 9-7) but we don't implement that
|
||||||
if (g_aFloppyDisk[currdrive].bWriteProtected)
|
if (g_aFloppyDisk[currdrive].bWriteProtected)
|
||||||
floppylatch |= 0x80;
|
floppylatch |= 0x80;
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user