|
|
| version 1.1.1.1, 2003/10/16 17:58:01 | version 1.7, 2005/02/09 20:11:33 |
|---|---|
| Line 5 | Line 5 |
| #include "boardspb.h" | #include "boardspb.h" |
| #include "sound.h" | #include "sound.h" |
| #include "fmboard.h" | #include "fmboard.h" |
| #include "beep.h" | |
| #include "s98.h" | #include "s98.h" |
| static void IOOUTCALL spb_o188(UINT port, BYTE dat) { | static void IOOUTCALL spb_o188(UINT port, REG8 dat) { |
| opn.opnreg = dat; | opn.opnreg = dat; |
| (void)port; | (void)port; |
| } | } |
| static void IOOUTCALL spb_o18a(UINT port, BYTE dat) { | static void IOOUTCALL spb_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 52 static void IOOUTCALL spb_o18a(UINT port | Line 51 static void IOOUTCALL spb_o18a(UINT port |
| (void)port; | (void)port; |
| } | } |
| static void IOOUTCALL spb_o18c(UINT port, BYTE dat) { | static void IOOUTCALL spb_o18c(UINT port, REG8 dat) { |
| opn.extreg = dat; | opn.extreg = dat; |
| (void)port; | (void)port; |
| } | } |
| static void IOOUTCALL spb_o18e(UINT port, BYTE dat) { | static void IOOUTCALL spb_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 66 static void IOOUTCALL spb_o18e(UINT port | Line 65 static void IOOUTCALL spb_o18e(UINT port |
| opngen_setreg(3, opn.extreg, dat); | opngen_setreg(3, opn.extreg, dat); |
| } | } |
| else if (opn.extreg < 0x12) { | else 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 spb_i188(UINT port) { | static REG8 IOINPCALL spb_i188(UINT port) { |
| (void)port; | (void)port; |
| return((fmtimer.status & 3) | adpcm_status(&adpcm)); | return((fmtimer.status & 3) | adpcm_status(&adpcm)); |
| } | } |
| static BYTE IOINPCALL spb_i18a(UINT port) { | static REG8 IOINPCALL spb_i18a(UINT port) { |
| if (opn.opnreg == 0x0e) { | if (opn.opnreg == 0x0e) { |
| return(fmboard_getjoy(&psg1)); | return(fmboard_getjoy(&psg1)); |
| Line 90 static BYTE IOINPCALL spb_i18a(UINT port | Line 88 static BYTE IOINPCALL spb_i18a(UINT port |
| return(opn.reg[opn.opnreg]); | return(opn.reg[opn.opnreg]); |
| } | } |
| static BYTE IOINPCALL spb_i18e(UINT port) { | static REG8 IOINPCALL spb_i18e(UINT port) { |
| if (opn.extreg == 0x08) { | if (opn.extreg == 0x08) { |
| return(adpcm_readsample(&adpcm)); | return(adpcm_readsample(&adpcm)); |
| Line 102 static BYTE IOINPCALL spb_i18e(UINT port | Line 100 static BYTE IOINPCALL spb_i18e(UINT port |
| // ---- spark board | // ---- spark board |
| static void IOOUTCALL spr_o588(UINT port, BYTE dat) { | static void IOOUTCALL spr_o588(UINT port, REG8 dat) { |
| opn.opn2reg = dat; | opn.opn2reg = dat; |
| (void)port; | (void)port; |
| } | } |
| static void IOOUTCALL spr_o58a(UINT port, BYTE dat) { | static void IOOUTCALL spr_o58a(UINT port, REG8 dat) { |
| if (opn.opn2reg < 0x30) { | if (opn.opn2reg < 0x30) { |
| if (opn.opn2reg == 0x28) { | if (opn.opn2reg == 0x28) { |
| Line 133 static void IOOUTCALL spr_o58a(UINT port | Line 131 static void IOOUTCALL spr_o58a(UINT port |
| (void)port; | (void)port; |
| } | } |
| static void IOOUTCALL spr_o58c(UINT port, BYTE dat) { | static void IOOUTCALL spr_o58c(UINT port, REG8 dat) { |
| opn.ext2reg = dat; | opn.ext2reg = dat; |
| (void)port; | (void)port; |
| } | } |
| static void IOOUTCALL spr_o58e(UINT port, BYTE dat) { | static void IOOUTCALL spr_o58e(UINT port, REG8 dat) { |
| opn.reg[opn.ext2reg + 0x300] = dat; | opn.reg[opn.ext2reg + 0x300] = dat; |
| if (opn.ext2reg >= 0x30) { | if (opn.ext2reg >= 0x30) { |
| sound_sync(); | |
| opngen_setreg(9, opn.ext2reg, dat); | opngen_setreg(9, opn.ext2reg, dat); |
| } | } |
| (void)port; | (void)port; |
| } | } |
| static BYTE IOINPCALL spr_i588(UINT port) { | static REG8 IOINPCALL spr_i588(UINT port) { |
| (void)port; | (void)port; |
| return(fmtimer.status); | return(fmtimer.status); |
| } | } |
| static BYTE IOINPCALL spr_i58a(UINT port) { | static REG8 IOINPCALL spr_i58a(UINT port) { |
| if (opn.opn2reg >= 0x20) { | if (opn.opn2reg >= 0x20) { |
| return(opn.reg[opn.opn2reg + 0x200]); | return(opn.reg[opn.opn2reg + 0x200]); |
| Line 164 static BYTE IOINPCALL spr_i58a(UINT port | Line 161 static BYTE IOINPCALL spr_i58a(UINT port |
| return(0xff); | return(0xff); |
| } | } |
| static BYTE IOINPCALL spr_i58c(UINT port) { | static REG8 IOINPCALL spr_i58c(UINT port) { |
| (void)port; | (void)port; |
| return(fmtimer.status & 3); | return(fmtimer.status & 3); |
| } | } |
| static BYTE IOINPCALL spr_i58e(UINT port) { | static REG8 IOINPCALL spr_i58e(UINT port) { |
| (void)port; | (void)port; |
| return(opn.reg[opn.opn2reg + 0x200]); | return(opn.reg[opn.opn2reg + 0x200]); |
| Line 188 static const IOINP spb_i[4] = { | Line 185 static const IOINP spb_i[4] = { |
| void boardspb_reset(void) { | void boardspb_reset(void) { |
| fmtimer_reset((BYTE)(np2cfg.spbopt & 0xc0)); | fmtimer_reset(np2cfg.spbopt & 0xc0); |
| opn.channels = 6; | opn.channels = 6; |
| opngen_setcfg(6, OPN_STEREO | 0x03f); | opngen_setcfg(6, OPN_STEREO | 0x03f); |
| soundrom_loadex((BYTE)(np2cfg.spbopt & 7), "SPB"); | soundrom_loadex(np2cfg.spbopt & 7, OEMTEXT("SPB")); |
| opn.base = ((np2cfg.spbopt & 0x10)?0x000:0x100); | opn.base = ((np2cfg.spbopt & 0x10)?0x000:0x100); |
| } | } |
| void boardspb_bind(void) { | void boardspb_bind(void) { |
| sound_streamregist(&opngen, (SOUNDCB)opngen_getpcm); | fmboard_fmrestore(0, 0); |
| fmboard_fmrestore(3, 1); | |
| psggen_restore(&psg1); | |
| fmboard_rhyrestore(&rhythm, 0); | |
| sound_streamregist(&opngen, (SOUNDCB)opngen_getpcmvr); | |
| 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); |
| cbuscore_attachsndex(0x188 - opn.base, spb_o, spb_i); | cbuscore_attachsndex(0x188 - opn.base, spb_o, spb_i); |
| } | } |
| Line 216 static const IOINP spr_i[4] = { | Line 217 static const IOINP spr_i[4] = { |
| void boardspr_reset(void) { | void boardspr_reset(void) { |
| fmtimer_reset((BYTE)(np2cfg.spbopt & 0xc0)); | fmtimer_reset(np2cfg.spbopt & 0xc0); |
| opn.reg[0x2ff] = 0; | opn.reg[0x2ff] = 0; |
| opn.channels = 12; | opn.channels = 12; |
| opngen_setcfg(12, OPN_STEREO | 0x03f); | opngen_setcfg(12, OPN_STEREO | 0x03f); |
| soundrom_loadex((BYTE)(np2cfg.spbopt & 7), "SPB"); | soundrom_loadex(np2cfg.spbopt & 7, OEMTEXT("SPB")); |
| opn.base = (np2cfg.spbopt & 0x10)?0x000:0x100; | opn.base = (np2cfg.spbopt & 0x10)?0x000:0x100; |
| } | } |
| void boardspr_bind(void) { | void boardspr_bind(void) { |
| sound_streamregist(&opngen, (SOUNDCB)opngen_getpcm); | fmboard_fmrestore(0, 0); |
| fmboard_fmrestore(3, 1); | |
| fmboard_fmrestore(6, 2); | |
| fmboard_fmrestore(9, 3); | |
| psggen_restore(&psg1); | |
| fmboard_rhyrestore(&rhythm, 0); | |
| sound_streamregist(&opngen, (SOUNDCB)opngen_getpcmvr); | |
| 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); |
| cbuscore_attachsndex(0x188 - opn.base, spb_o, spb_i); | cbuscore_attachsndex(0x188 - opn.base, spb_o, spb_i); |
| cbuscore_attachsndex(0x588 - opn.base, spr_o, spr_i); | cbuscore_attachsndex(0x588 - opn.base, spr_o, spr_i); |