2 Skelton for retropc emulator
\r
5 Author : Takeda.Toshiya
\r
18 #define SIG_MB8877_DRIVEREG 0
\r
19 #define SIG_MB8877_SIDEREG 1
\r
20 #define SIG_MB8877_MOTOR 2
\r
24 class MB8877 : public DEVICE
\r
31 outputs_t outputs_irq;
\r
32 outputs_t outputs_drq;
\r
41 int next_trans_position;
\r
42 int next_sync_position;
\r
45 DISK* disk[MAX_DRIVE];
\r
48 uint8 status, status_tmp;
\r
49 uint8 cmdreg, cmdreg_tmp;
\r
62 bool now_seek, after_seek;
\r
70 uint32 prev_drq_clock;
\r
72 int get_cur_position();
\r
73 double get_usec_to_start_trans();
\r
76 uint8 search_track();
\r
77 uint8 search_sector(int trk, int side, int sct, bool compare);
\r
78 uint8 search_addr();
\r
87 void cmd_readdata();
\r
88 void cmd_writedata();
\r
89 void cmd_readaddr();
\r
90 void cmd_readtrack();
\r
91 void cmd_writetrack();
\r
92 void cmd_forceint();
\r
95 void set_irq(bool val);
\r
96 void set_drq(bool val);
\r
99 MB8877(VM* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu)
\r
101 init_output_signals(&outputs_irq);
\r
102 init_output_signals(&outputs_drq);
\r
107 // common functions
\r
111 void write_io8(uint32 addr, uint32 data);
\r
112 uint32 read_io8(uint32 addr);
\r
113 void write_dma_io8(uint32 addr, uint32 data);
\r
114 uint32 read_dma_io8(uint32 addr);
\r
115 void write_signal(int id, uint32 data, uint32 mask);
\r
116 uint32 read_signal(int ch);
\r
117 void event_callback(int event_id, int err);
\r
118 void update_config();
\r
119 void save_state(FILEIO* state_fio);
\r
120 bool load_state(FILEIO* state_fio);
\r
123 void set_context_irq(DEVICE* device, int id, uint32 mask)
\r
125 register_output_signal(&outputs_irq, device, id, mask);
\r
127 void set_context_drq(DEVICE* device, int id, uint32 mask)
\r
129 register_output_signal(&outputs_drq, device, id, mask);
\r
131 DISK* get_disk_handler(int drv)
\r
135 void open_disk(int drv, _TCHAR path[], int offset);
\r
136 void close_disk(int drv);
\r
137 bool disk_inserted(int drv);
\r
138 void set_drive_type(int drv, uint8 type);
\r
139 uint8 get_drive_type(int drv);
\r
140 void set_drive_rpm(int drv, int rpm);
\r
141 void set_drive_mfm(int drv, bool mfm);
\r
142 uint8 fdc_status();
\r