2 FUJITSU FMR-50 Emulator 'eFMR-50'
3 FUJITSU FMR-60 Emulator 'eFMR-60'
5 Author : Takeda.Toshiya
12 #include "../../fileio.h"
15 #define PHASE_BUSFREE 0
16 #define PHASE_ARBITRATION 1
17 #define PHASE_SELECTION 2
18 #define PHASE_RESELECTION 3
19 #define PHASE_COMMAND 4
20 #define PHASE_EXECUTE 5
21 #define PHASE_MSG_IN 6
22 #define PHASE_MSG_OUT 7
23 #define PHASE_DATA_IN 8
24 #define PHASE_DATA_OUT 9
25 #define PHASE_STATUS 10
29 #define CTRL_IMSK 0x40
32 #define CTRL_DMAE 0x02
40 #define STAT_BUSY 0x08
42 #define STAT_PERR 0x01
44 // DMA: SIG_UPD71071_CH1
45 // IRQ: SIG_I8259_CHIP1 | SIG_I8259_IR0
47 void SCSI::initialize()
49 phase = PHASE_BUSFREE;
50 ctrlreg = datareg = statreg = 0;
53 void SCSI::write_io8(uint32 addr, uint32 data)
55 switch(addr & 0xffff) {
62 if((ctrlreg & CTRL_RST) && ~(data & CTRL_RST)) {
66 if(~(ctrlreg & CTRL_SEL) && (data & CTRL_SEL)) {
76 uint32 SCSI::read_io8(uint32 addr)
80 switch(addr & 0xffff) {
94 void SCSI::write_dma_io8(uint32 addr, uint32 data)
96 write_io8(0xc30, data);
99 uint32 SCSI::read_dma_io8(uint32 addr)
101 return read_io8(0xc30);