Files
VCCPlusOSS/tests/toolchain/stream-writes/refuse-fat.c
T

20 lines
737 B
C

// SPDX-License-Identifier: GPL-3.0-or-later
// Route every operation through the same ROM routine as decbfile, except for
// one explicitly armed FAT write. This exercises a partial remove on a real
// guest volume without changing either the library or the machine controller.
#define decb_dskcon testROMDiskIO
#include "../../../third_party/cmoc-libraries/decbfile/dskcon.c"
#undef decb_dskcon
byte refuseNextFATWrite;
byte decb_dskcon(byte operation, void *buffer, byte drive, byte track, byte sector)
{
if (refuseNextFATWrite && operation == DECB_DSKCON_WRITE && track == 17 && sector == 2)
{
refuseNextFATWrite = 0;
return FALSE;
}
return testROMDiskIO(operation, buffer, drive, track, sector);
}