2 NEC PC-9801 Emulator 'ePC-9801'
\r
3 NEC PC-9801E/F/M Emulator 'ePC-9801E'
\r
4 NEC PC-98DO Emulator 'ePC-98DO'
\r
6 Author : Takeda.Toshiya
\r
12 #include "fmsound.h"
\r
13 #include "../../fileio.h"
\r
19 void FMSOUND::reset()
\r
25 void FMSOUND::write_io8(uint32 addr, uint32 data)
\r
27 switch(addr & 0xffff) {
\r
29 d_opn->write_io8(0, data);
\r
32 d_opn->write_io8(1, data);
\r
37 d_opn->write_io8(2, data);
\r
42 d_opn->write_io8(3, data);
\r
52 uint32 FMSOUND::read_io8(uint32 addr)
\r
54 switch(addr & 0xffff) {
\r
56 return d_opn->read_io8(0);
\r
58 return d_opn->read_io8(1);
\r
62 return d_opn->read_io8(2);
\r
67 return d_opn->read_io8(3);
\r
71 return BOARD_ID | (mask & 3);
\r
78 #define STATE_VERSION 1
\r
80 void FMSOUND::save_state(FILEIO* state_fio)
\r
82 state_fio->FputUint32(STATE_VERSION);
\r
83 state_fio->FputInt32(this_device_id);
\r
85 state_fio->FputUint8(mask);
\r
88 bool FMSOUND::load_state(FILEIO* state_fio)
\r
90 if(state_fio->FgetUint32() != STATE_VERSION) {
\r
93 if(state_fio->FgetInt32() != this_device_id) {
\r
96 mask = state_fio->FgetUint8();
\r