Open joncampbell123 opened 5 years ago
According to https://archive.org/details/PC9800TechnicalDataBookBIOS1992/page/n247 the BIOS data area contains status which is updated when a command is completed.
I am not sure about disk change notification, but I remember that a drive indicator behavior is different between IBM PC and PC-98. On IBM PC, the indicator is on while the drive is selected. On PC-98, it is on while the drive is transferring data. While the drive is seeking or no disk is inserted, it is off on PC-98 normally. So some games show notification about changing a disk but keyboard or button input is not requested after changing the disk. I think such games poll the drive, maybe using SENSE command, to detect a new disk is inserted.
The 9801 uses upd765 ready line polling for disk change indication.
Until proper disk change notification is implemented, some games can be tricked into working through the debugger.
"Mad - Paradox" can be tricked into reading INT 1Bh on disk swap by starting the game, and then in the debugger, enter the command "SM 0 56C 08". This sets the "not ready" bit of the second floppy drive (second drive status at byte 0000:056C). The game will loop polling that byte until set and will not call INT 1Bh to read the disk otherwise.
Describe the bug Some PC-98 booter games rely on specific error codes or certain BIOS data area flags to detect disk change. None of these methods work currently in DOSBox-X.
To Reproduce Steps to reproduce the behavior:
Expected behavior Triggering floppy disk swap will eventually give the game the disk it wants.
Disk change notification, and emulation of INT 13h disk change notification in IBM PC/XT/AT mode is already in place.
I am not certain how to implement the same for PC-98 mode (INT 1Bh), but behavior may be similar: First read of the floppy after swapping fails with an error code that tells the game or DOS kernel the disk changed. Game/DOS kernel retries, and read succeeds.
I noticed another PC-98 game reading a bit from the BIOS data area ("not ready" according to undocumented PC-98). Not sure exactly how to implement that yet.