2 TOSHIBA PASOPIA Emulator 'EmuPIA'
4 Author : Takeda.Toshiya
11 #include "../upd765a.h"
13 void FLOPPY::initialize()
18 void FLOPPY::write_io8(uint32_t addr, uint32_t data)
21 // OA-BASIC without floppy drives
28 d_fdc->write_signal(SIG_UPD765A_TC, 0, 1);
32 d_fdc->write_signal(SIG_UPD765A_TC, 1, 1);
36 d_fdc->write_io8(addr, data);
44 d_fdc->write_signal(SIG_UPD765A_MOTOR, data, 0x40);
49 uint32_t FLOPPY::read_io8(uint32_t addr)
52 // OA-BASIC without floppy drives
59 return d_fdc->read_io8(addr);
62 return intr ? 0x80 : 0;
67 void FLOPPY::write_signal(int id, uint32_t data, uint32_t mask)
69 if(id == SIG_FLOPPY_INTR) {
70 intr = ((data & mask) != 0);
74 #define STATE_VERSION 1
76 #include "../../statesub.h"
78 void FLOPPY::decl_state()
80 enter_decl_state(STATE_VERSION);
82 DECL_STATE_ENTRY_BOOL(intr);
83 DECL_STATE_ENTRY_BOOL(supported);
88 void FLOPPY::save_state(FILEIO* state_fio)
90 if(state_entry != NULL) {
91 state_entry->save_state(state_fio);
93 // state_fio->FputUint32(STATE_VERSION);
94 // state_fio->FputInt32(this_device_id);
96 // state_fio->FputBool(intr);
97 // state_fio->FputBool(supported);
100 bool FLOPPY::load_state(FILEIO* state_fio)
103 if(state_entry != NULL) {
104 mb = state_entry->load_state(state_fio);
109 // if(state_fio->FgetUint32() != STATE_VERSION) {
112 // if(state_fio->FgetInt32() != this_device_id) {
115 // intr = state_fio->FgetBool();
116 // supported = state_fio->FgetBool();
120 bool FLOPPY::process_state(FILEIO* state_fio, bool loading)
122 if(!state_fio->StateCheckUint32(STATE_VERSION)) {
125 if(!state_fio->StateCheckInt32(this_device_id)) {
128 state_fio->StateBool(intr);
129 state_fio->StateBool(supported);