From 048fbfbb1fd80dbb33e3e4e9dc35811009cfed33 Mon Sep 17 00:00:00 2001 From: "K.Ohta" Date: Fri, 17 May 2019 05:34:32 +0900 Subject: [PATCH] [VM][PC9801][FLOPPY] Improve drive setting via 2DD <-> 2HD. --- source/src/vm/pc9801/floppy.cpp | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/source/src/vm/pc9801/floppy.cpp b/source/src/vm/pc9801/floppy.cpp index 3181eb5a6..258dfa7b0 100644 --- a/source/src/vm/pc9801/floppy.cpp +++ b/source/src/vm/pc9801/floppy.cpp @@ -137,6 +137,10 @@ void FLOPPY::write_io8(uint32_t addr, uint32_t data) d_fdc->set_drive_type(1, DRIVE_TYPE_2DD); } #endif + // ToDo: DMAE (0094h/00CCh bit4) + // ToDo: MOTOR (0094h/00CCh bit3) + // ToDo: TMSK (0094h/00CCh bit2) + //#if !defined(_PC98XA) && !defined(_PC98XL) // if(modereg & 0x04) { // d_fdc->write_signal(SIG_UPD765A_MOTOR, data, 0x08); @@ -154,12 +158,17 @@ void FLOPPY::write_io8(uint32_t addr, uint32_t data) case 0x00bc: // OK? case 0x00be: #if !defined(SUPPORT_HIRESO) - if(!(modereg & 2) && (data & 2)) { - d_fdc->set_drive_type(0, DRIVE_TYPE_2HD); - d_fdc->set_drive_type(1, DRIVE_TYPE_2HD); - } else if((modereg & 2) && !(data & 2)) { - d_fdc->set_drive_type(0, DRIVE_TYPE_2DD); - d_fdc->set_drive_type(1, DRIVE_TYPE_2DD); + if((data & 0xf8) == 0) { + // ToDo: EMTON (bit2) + if(!(modereg & 2) && (data & 2)) { + d_fdc->set_drive_type(0, DRIVE_TYPE_2HD); + d_fdc->set_drive_type(1, DRIVE_TYPE_2HD); + } else if((modereg & 2) && !(data & 2)) { + d_fdc->set_drive_type(0, DRIVE_TYPE_2DD); + d_fdc->set_drive_type(1, DRIVE_TYPE_2DD); + } + // ToDo: PORT EXC (bit0) + // ToDo: Three mode FDD. } #endif modereg = data; @@ -240,6 +249,8 @@ uint32_t FLOPPY::read_io8(uint32_t addr) case 0x00bc: // OK? case 0x00be: //return 0xf8 | (modereg & 3); + // ToDo: DIPSW 3-2 and 3-1 + // ToDo: Three mode FDD. return 0xfc | (modereg & 3); case 0x00cc: case 0x00ce: -- 2.11.0