|
|
| version 1.1, 2003/10/16 17:58:00 | version 1.4, 2004/02/18 20:11:36 |
|---|---|
| Line 9 | Line 9 |
| #include "s98.h" | #include "s98.h" |
| static void IOOUTCALL opna_o188(UINT port, BYTE dat) { | static void IOOUTCALL opna_o188(UINT port, REG8 dat) { |
| opn.opnreg = dat; | opn.opnreg = dat; |
| (void)port; | (void)port; |
| } | } |
| static void IOOUTCALL opna_o18a(UINT port, BYTE dat) { | static void IOOUTCALL opna_o18a(UINT port, REG8 dat) { |
| S98_put(NORMAL2608, opn.opnreg, dat); | S98_put(NORMAL2608, opn.opnreg, dat); |
| if (opn.opnreg < 0x10) { | if (opn.opnreg < 0x10) { |
| Line 54 static void IOOUTCALL opna_o18a(UINT por | Line 54 static void IOOUTCALL opna_o18a(UINT por |
| (void)port; | (void)port; |
| } | } |
| static void IOOUTCALL opna_o18c(UINT port, BYTE dat) { | static void IOOUTCALL opna_o18c(UINT port, REG8 dat) { |
| opn.extreg = dat; | opn.extreg = dat; |
| (void)port; | (void)port; |
| } | } |
| static void IOOUTCALL opna_o18e(UINT port, BYTE dat) { | static void IOOUTCALL opna_o18e(UINT port, REG8 dat) { |
| S98_put(EXTEND2608, opn.extreg, dat); | S98_put(EXTEND2608, opn.extreg, dat); |
| opn.reg[opn.extreg + 0x100] = dat; | opn.reg[opn.extreg + 0x100] = dat; |
| Line 77 static void IOOUTCALL opna_o18e(UINT por | Line 77 static void IOOUTCALL opna_o18e(UINT por |
| (void)port; | (void)port; |
| } | } |
| static BYTE IOINPCALL opna_i188(UINT port) { | static REG8 IOINPCALL opna_i188(UINT port) { |
| (void)port; | (void)port; |
| return(fmtimer.status); | return(fmtimer.status); |
| } | } |
| static BYTE IOINPCALL opna_i18a(UINT port) { | static REG8 IOINPCALL opna_i18a(UINT port) { |
| if (opn.opnreg == 0x0e) { | if (opn.opnreg == 0x0e) { |
| return(fmboard_getjoy(&psg1)); | return(fmboard_getjoy(&psg1)); |
| Line 95 static BYTE IOINPCALL opna_i18a(UINT por | Line 95 static BYTE IOINPCALL opna_i18a(UINT por |
| return(opn.reg[opn.opnreg]); | return(opn.reg[opn.opnreg]); |
| } | } |
| static BYTE IOINPCALL opna_i18c(UINT port) { | static REG8 IOINPCALL opna_i18c(UINT port) { |
| if (opn.extend) { | if (opn.extend) { |
| return((fmtimer.status & 3) | (opn.adpcmmask & 8)); | return((fmtimer.status & 3) | (opn.adpcmmask & 8)); |
| Line 104 static BYTE IOINPCALL opna_i18c(UINT por | Line 104 static BYTE IOINPCALL opna_i18c(UINT por |
| return(0xff); | return(0xff); |
| } | } |
| static BYTE IOINPCALL opna_i18e(UINT port) { | static REG8 IOINPCALL opna_i18e(UINT port) { |
| if (opn.extend) { | if (opn.extend) { |
| return(opn.reg[opn.opnreg]); | return(opn.reg[opn.opnreg]); |
| Line 113 static BYTE IOINPCALL opna_i18e(UINT por | Line 113 static BYTE IOINPCALL opna_i18e(UINT por |
| return(0xff); | return(0xff); |
| } | } |
| static void extendchannel(BYTE enable) { | static void extendchannel(REG8 enable) { |
| opn.extend = enable; | opn.extend = enable; |
| if (enable) { | if (enable) { |
| Line 139 static const IOINP opna_i[4] = { | Line 139 static const IOINP opna_i[4] = { |
| void board86_reset(void) { | void board86_reset(void) { |
| fmtimer_reset((BYTE)((np2cfg.snd86opt & 0x10) | | fmtimer_reset((np2cfg.snd86opt & 0x10) | |
| ((np2cfg.snd86opt & 0x4) << 5) | | ((np2cfg.snd86opt & 0x4) << 5) | |
| ((np2cfg.snd86opt & 0x8) << 3))); | ((np2cfg.snd86opt & 0x8) << 3)); |
| opngen_setcfg(3, OPN_STEREO | 0x038); | opngen_setcfg(3, OPN_STEREO | 0x038); |
| if (np2cfg.snd86opt & 2) { | if (np2cfg.snd86opt & 2) { |
| soundrom_load(0xcc000, "86"); | soundrom_load(0xcc000, "86"); |
| Line 152 void board86_reset(void) { | Line 152 void board86_reset(void) { |
| void board86_bind(void) { | void board86_bind(void) { |
| fmboard_fmrestore(0, 0); | |
| fmboard_fmrestore(3, 1); | |
| psggen_restore(&psg1); | |
| fmboard_rhyrestore(&rhythm, 0); | |
| sound_streamregist(&opngen, (SOUNDCB)opngen_getpcm); | sound_streamregist(&opngen, (SOUNDCB)opngen_getpcm); |
| sound_streamregist(&psg1, (SOUNDCB)psggen_getpcm); | sound_streamregist(&psg1, (SOUNDCB)psggen_getpcm); |
| sound_streamregist(&rhythm, (SOUNDCB)rhythm_getpcm); | rhythm_bind(&rhythm); |
| pcm86io_bind(); | pcm86io_bind(); |
| cbuscore_attachsndex(0x188 + opn.base, opna_o, opna_i); | cbuscore_attachsndex(0x188 + opn.base, opna_o, opna_i); |
| } | } |
| Line 162 void board86_bind(void) { | Line 166 void board86_bind(void) { |
| // ---- + chibioto | // ---- + chibioto |
| static void IOOUTCALL opnac_o18e(UINT port, BYTE dat) { | static void IOOUTCALL opnac_o18e(UINT port, REG8 dat) { |
| S98_put(EXTEND2608, opn.extreg, dat); | S98_put(EXTEND2608, opn.extreg, dat); |
| opn.reg[opn.extreg + 0x100] = dat; | opn.reg[opn.extreg + 0x100] = dat; |
| Line 171 static void IOOUTCALL opnac_o18e(UINT po | Line 175 static void IOOUTCALL opnac_o18e(UINT po |
| } | } |
| else { | else { |
| if (opn.extreg < 0x12) { | if (opn.extreg < 0x12) { |
| sound_sync(); | |
| adpcm_setreg(&adpcm, opn.extreg, dat); | adpcm_setreg(&adpcm, opn.extreg, dat); |
| } | } |
| } | } |
| (void)port; | (void)port; |
| } | } |
| static BYTE IOINPCALL opnac_i18c(UINT port) { | static REG8 IOINPCALL opnac_i18c(UINT port) { |
| if (opn.extend) { | if (opn.extend) { |
| return((fmtimer.status & 3) | adpcm_status(&adpcm)); | return((fmtimer.status & 3) | adpcm_status(&adpcm)); |
| Line 188 static BYTE IOINPCALL opnac_i18c(UINT po | Line 191 static BYTE IOINPCALL opnac_i18c(UINT po |
| return(0xff); | return(0xff); |
| } | } |
| static BYTE IOINPCALL opnac_i18e(UINT port) { | static REG8 IOINPCALL opnac_i18e(UINT port) { |
| if (opn.extend) { | if (opn.extend) { |
| if (opn.extreg == 0x08) { | if (opn.extreg == 0x08) { |
| Line 209 static const IOINP opnac_i[4] = { | Line 212 static const IOINP opnac_i[4] = { |
| void board86c_bind(void) { | void board86c_bind(void) { |
| fmboard_fmrestore(0, 0); | |
| fmboard_fmrestore(3, 1); | |
| psggen_restore(&psg1); | |
| fmboard_rhyrestore(&rhythm, 0); | |
| sound_streamregist(&opngen, (SOUNDCB)opngen_getpcm); | sound_streamregist(&opngen, (SOUNDCB)opngen_getpcm); |
| sound_streamregist(&psg1, (SOUNDCB)psggen_getpcm); | sound_streamregist(&psg1, (SOUNDCB)psggen_getpcm); |
| sound_streamregist(&rhythm, (SOUNDCB)rhythm_getpcm); | rhythm_bind(&rhythm); |
| sound_streamregist(&adpcm, (SOUNDCB)adpcm_getpcm); | sound_streamregist(&adpcm, (SOUNDCB)adpcm_getpcm); |
| pcm86io_bind(); | pcm86io_bind(); |
| cbuscore_attachsndex(0x188 + opn.base, opnac_o, opnac_i); | cbuscore_attachsndex(0x188 + opn.base, opnac_o, opnac_i); |