2 TOSHIBA PASOPIA 7 Emulator 'EmuPIA7'
4 Author : Takeda.Toshiya
11 #include "../upd765a.h"
13 void FLOPPY::initialize()
18 void FLOPPY::write_io8(uint32_t addr, uint32_t data)
23 d_fdc->write_signal(SIG_UPD765A_TC, 0, 1);
27 d_fdc->write_signal(SIG_UPD765A_TC, 1, 1);
35 d_fdc->write_signal(SIG_UPD765A_MOTOR, data, 0x40);
40 uint32_t FLOPPY::read_io8(uint32_t addr)
45 return intr ? 0x80 : 0;
50 void FLOPPY::write_signal(int id, uint32_t data, uint32_t mask)
52 if(id == SIG_FLOPPY_INTR) {
53 intr = ((data & mask) != 0);
57 #define STATE_VERSION 1
59 #include "../../statesub.h"
61 void FLOPPY::decl_state()
63 enter_decl_state(STATE_VERSION);
65 DECL_STATE_ENTRY_BOOL(intr);
70 void FLOPPY::save_state(FILEIO* state_fio)
72 if(state_entry != NULL) {
73 state_entry->save_state(state_fio);
75 // state_fio->FputUint32(STATE_VERSION);
76 // state_fio->FputInt32(this_device_id);
78 // state_fio->FputBool(intr);
81 bool FLOPPY::load_state(FILEIO* state_fio)
84 if(state_entry != NULL) {
85 mb = state_entry->load_state(state_fio);
88 // if(state_fio->FgetUint32() != STATE_VERSION) {
91 // if(state_fio->FgetInt32() != this_device_id) {
94 // intr = state_fio->FgetBool();
98 bool FLOPPY::process_state(FILEIO* state_fio, bool loading)
100 if(!state_fio->StateCheckUint32(STATE_VERSION)) {
103 if(!state_fio->StateCheckInt32(this_device_id)) {
106 state_fio->StateBool(intr);