2 FUJITSU FM16beta Emulator 'eFM16beta'
\r
4 Author : Takeda.Toshiya
\r
13 #include "../memory.h"
\r
15 #define SIG_MAIN_IRQ0_TX 0 // RS-232C
\r
16 #define SIG_MAIN_IRQ0_RX 1 // RS-232C
\r
17 #define SIG_MAIN_IRQ0_SYN 2 // RS-232C
\r
18 #define SIG_MAIN_IRQ1 3 // Keyboard
\r
19 #define SIG_MAIN_IRQ2 4 // Expantion
\r
20 #define SIG_MAIN_IRQ3 5 // DMA Controller
\r
21 #define SIG_MAIN_IRQ4 6 // 320KB Floppy Disk
\r
22 #define SIG_MAIN_IRQ5 7 // 1MB Floppy Disk
\r
23 #define SIG_MAIN_IRQ6 8 // Hard Disk
\r
24 #define SIG_MAIN_IRQ7 9 // Printer
\r
25 #define SIG_MAIN_IRQ8 10 // PTM
\r
26 #define SIG_MAIN_IRQ9 11 // User
\r
27 #define SIG_MAIN_FIRQ0 12 // Sub system attention
\r
28 #define SIG_MAIN_FIRQ1 13 // Break
\r
29 #define SIG_MAIN_FIRQ2 14 // Expantion
\r
30 #define SIG_MAIN_FIRQ3 15 // User
\r
32 #define SIG_MAIN_SUB_BUSY 16
\r
34 #define SIG_MAIN_DRQ_2HD 17
\r
35 #define SIG_MAIN_DRQ_2D 18
\r
37 #define SIG_MAIN_RTC_DATA 19
\r
38 #define SIG_MAIN_RTC_BUSY 20
\r
46 class MAIN : public MEMORY
\r
59 uint8_t ram[0xfc000];
\r
60 uint8_t rom[0x04000];
\r
69 uint8_t sidereg_2hd, drvreg_2hd;
\r
74 uint8_t sidereg_2d, drvreg_2d;
\r
82 uint8_t irq_enb, ext_irq_enb;
\r
83 bool irq0_tx, irq0_rx, irq0_syn, irq1, irq2, irq3, irq4, irq5, irq6, irq7, irq8, irq9;
\r
84 bool firq0, firq1, firq2, firq3;
\r
85 bool int0, int1, int2, int3, int4, int5, int6, int7;
\r
97 MAIN(VM_TEMPLATE* parent_vm, EMU* parent_emu) : MEMORY(parent_vm, parent_emu)
\r
99 set_device_name(_T("Main System"));
\r
103 // common functions
\r
107 void write_io8(uint32_t addr, uint32_t data);
\r
108 uint32_t read_io8(uint32_t addr);
\r
109 void write_signal(int id, uint32_t data, uint32_t mask);
\r
110 bool process_state(FILEIO* state_fio, bool loading);
\r
112 // unique functions
\r
114 void set_context_cpu(I286* device)
\r
119 void set_context_dma(I8237* device)
\r
123 void set_context_fdc_2hd(MB8877* device)
\r
125 d_fdc_2hd = device;
\r
127 void set_context_fdc_2d(MB8877* device)
\r
131 void set_context_pic(DEVICE* device)
\r
135 void set_context_pcm(DEVICE* device)
\r
139 void set_context_rtc(DEVICE* device)
\r
143 void set_context_sub(DEVICE* device)
\r
147 void set_context_keyboard(DEVICE* device)
\r
149 d_keyboard = device;
\r