2 // PC-6001/6601 disk I/O
3 // This file is based on a disk I/O program in C++
4 // by Mr. Yumitaro and translated into C for Cocoa iP6
5 // by Koichi NISHIDA 2006
9 Skelton for retropc emulator
11 Author : Takeda.Toshiya
28 class PC6031 : public DEVICE
33 // NOISE* d_noise_head_down;
34 // NOISE* d_noise_head_up;
41 int Seek88(int drvno, int trackno, int sectno);
42 unsigned char Getc88(int drvno);
43 int Putc88(int drvno, unsigned char dat);
47 int DAC; // data accepted
48 int RFD; // ready for data
49 int DAV; // data valid
50 int command; // received command
51 int step; // status for waiting parameter
52 int blk; // block number
53 int drv; // drive number - 1
54 int trk; // track number
55 int sct; // sector number
56 int size; // byte number to process
57 unsigned char retdat; // return from port D0H
62 unsigned char io_D2H, old_D2H;
66 unsigned char FddIn60();
67 void FddOut60(unsigned char dat);
68 unsigned char FddCntIn60(void);
69 void FddCntOut60(unsigned char dat);
71 void OutD1H_60(unsigned char data);
72 void OutD2H_60(unsigned char data);
73 void OutD3H_60(unsigned char data);
75 unsigned char InD0H_60();
76 unsigned char InD1H_60();
77 unsigned char InD2H_60();
78 unsigned char InD3H_60();
81 PC6031(VM_TEMPLATE* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu)
84 // d_noise_head_down = NULL;
85 // d_noise_head_up = NULL;
86 set_device_name(_T("Pseudo PC-6031 FDD"));
93 void write_io8(uint32_t addr, uint32_t data);
94 uint32_t read_io8(uint32_t addr);
95 uint32_t read_signal(int ch);
97 bool process_state(FILEIO* state_fio, bool loading);
100 void set_context_noise_seek(NOISE* device)
102 d_noise_seek = device;
104 NOISE* get_context_noise_seek()
108 // void set_context_noise_head_down(NOISE* device)
110 // d_noise_head_down = device;
112 // NOISE* get_context_noise_head_down()
114 // return d_noise_head_down;
116 // void set_context_noise_head_up(NOISE* device)
118 // d_noise_head_up = device;
120 // NOISE* get_context_noise_head_up()
122 // return d_noise_head_up;
124 DISK* get_disk_handler(int drv)
128 void open_disk(int drv, const _TCHAR* file_path, int bank);
129 void close_disk(int drv);
130 bool is_disk_inserted(int drv);
131 bool disk_ejected(int drv);
132 void is_disk_protected(int drv, bool value);
133 bool is_disk_protected(int drv);