2 FUJITSU FM16beta Emulator 'eFM16beta'
4 Author : Takeda.Toshiya
10 #ifndef _EFM16BETA_MAIN_H_
11 #define _EFM16BETA_MAIN_H_
14 #include "../memory.h"
16 #define SIG_MAIN_IRQ0_TX 0 // RS-232C
17 #define SIG_MAIN_IRQ0_RX 1 // RS-232C
18 #define SIG_MAIN_IRQ0_SYN 2 // RS-232C
19 #define SIG_MAIN_IRQ1 3 // Keyboard
20 #define SIG_MAIN_IRQ2 4 // Expantion
21 #define SIG_MAIN_IRQ3 5 // DMA Controller
22 #define SIG_MAIN_IRQ4 6 // 320KB Floppy Disk
23 #define SIG_MAIN_IRQ5 7 // 1MB Floppy Disk
24 #define SIG_MAIN_IRQ6 8 // Hard Disk
25 #define SIG_MAIN_IRQ7 9 // Printer
26 #define SIG_MAIN_IRQ8 10 // PTM
27 #define SIG_MAIN_IRQ9 11 // User
28 #define SIG_MAIN_FIRQ0 12 // Sub system attention
29 #define SIG_MAIN_FIRQ1 13 // Break
30 #define SIG_MAIN_FIRQ2 14 // Expantion
31 #define SIG_MAIN_FIRQ3 15 // User
33 #define SIG_MAIN_SUB_BUSY 16
35 #define SIG_MAIN_DRQ_2HD 17
36 #define SIG_MAIN_DRQ_2D 18
38 #define SIG_MAIN_RTC_DATA 19
39 #define SIG_MAIN_RTC_BUSY 20
51 class MAINBUS : public MEMORY
54 //csp_state_utils *state_entry;
76 uint8_t sidereg_2hd, drvreg_2hd;
81 uint8_t sidereg_2d, drvreg_2d;
89 uint8_t irq_enb, ext_irq_enb;
90 bool irq0_tx, irq0_rx, irq0_syn, irq1, irq2, irq3, irq4, irq5, irq6, irq7, irq8, irq9;
91 bool firq0, firq1, firq2, firq3;
92 bool int0, int1, int2, int3, int4, int5, int6, int7;
104 MAINBUS(VM_TEMPLATE* parent_vm, EMU_TEMPLATE* parent_emu) : MEMORY(parent_vm, parent_emu)
106 set_device_name(_T("Main System"));
114 void __FASTCALL write_io8(uint32_t addr, uint32_t data);
115 uint32_t __FASTCALL read_io8(uint32_t addr);
116 void __FASTCALL write_signal(int id, uint32_t data, uint32_t mask);
117 bool process_state(FILEIO* state_fio, bool loading);
121 void set_context_cpu(I286* device)
126 void set_context_dma(I8237* device)
130 void set_context_fdc_2hd(MB8877* device)
134 void set_context_fdc_2d(MB8877* device)
138 void set_context_pic(DEVICE* device)
142 void set_context_pcm(DEVICE* device)
146 void set_context_rtc(DEVICE* device)
150 void set_context_sub(DEVICE* device)
154 void set_context_keyboard(DEVICE* device)
161 #endif /* _EFM16BETA_MAIN_H_ */