OSDN Git Service

[General] Convert sourcecode's CRLF format: DOS(WINDOWS) to Unix, to apply patches...
[csp-qt/common_source_project-fm7.git] / source / src / vm / mz2500 / mz1e30.h
1 /*
2         SHARP MZ-2500 Emulator 'EmuZ-2500'
3
4         Author : Takeda.Toshiya
5         Date   : 2004.09.10 -
6
7         [ MZ-1E30 (SASI) ]
8 */
9
10 #ifndef _MZ1E30_H_
11 #define _MZ1E30_H_
12
13 #include "../vm.h"
14 #include "../../emu.h"
15 #include "../device.h"
16
17 class FILEIO;
18
19 class MZ1E30 : public DEVICE
20 {
21 private:
22         // rom file
23         uint8 *rom_buffer;
24         uint32 rom_address, rom_size;
25         
26         // sasi
27         uint8 buffer[256];
28         int phase;
29         int sector;
30         int blocks;
31         uint8 cmd[6];
32         int cmd_ptr;
33         int unit;
34         int buffer_ptr;
35         uint8 status;
36         uint8 status_irq_drq;
37         uint8 error;
38         uint8 status_buf[4];
39         int status_ptr;
40         uint8 datareg;
41         
42         struct {
43                 FILEIO *fio;
44                 bool access;
45         } drive[2];
46         
47         void check_cmd();
48         void set_status(uint8 err);
49         void set_drq(bool val);
50         bool seek(int drv);
51         bool flush(int drv);
52         bool format(int drv);
53         
54 public:
55         MZ1E30(VM* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu) {}
56         ~MZ1E30() {}
57         
58         // common functions
59         void initialize();
60         void release();
61         void write_io8(uint32 addr, uint32 data);
62         uint32 read_io8(uint32 addr);
63         void write_dma_io8(uint32 addr, uint32 data);
64         uint32 read_dma_io8(uint32 addr);
65         uint32 read_signal(int ch);
66         void event_callback(int event_id, int err);
67         void save_state(FILEIO* state_fio);
68         bool load_state(FILEIO* state_fio);
69 };
70
71 #endif
72