|
|
| version 1.4, 2003/12/08 00:55:30 | version 1.8, 2005/05/13 05:47:24 |
|---|---|
| Line 10 | Line 10 |
| static void IOOUTCALL spb_o188(UINT port, REG8 dat) { | static void IOOUTCALL spb_o188(UINT port, REG8 dat) { |
| opn.opnreg = dat; | opn.addr = dat; |
| opn.data = dat; | |
| (void)port; | (void)port; |
| } | } |
| static void IOOUTCALL spb_o18a(UINT port, REG8 dat) { | static void IOOUTCALL spb_o18a(UINT port, REG8 dat) { |
| S98_put(NORMAL2608, opn.opnreg, dat); | UINT addr; |
| if (opn.opnreg < 0x10) { | |
| if (opn.opnreg != 0x0e) { | opn.data = dat; |
| psggen_setreg(&psg1, opn.opnreg, dat); | addr = opn.addr; |
| if (addr >= 0x100) { | |
| return; | |
| } | |
| S98_put(NORMAL2608, addr, dat); | |
| if (addr < 0x10) { | |
| if (addr != 0x0e) { | |
| psggen_setreg(&psg1, addr, dat); | |
| } | } |
| } | } |
| else { | else { |
| if (opn.opnreg < 0x20) { | if (addr < 0x20) { |
| rhythm_setreg(&rhythm, opn.opnreg, dat); | rhythm_setreg(&rhythm, addr, dat); |
| } | } |
| else if (opn.opnreg < 0x30) { | else if (addr < 0x30) { |
| if (opn.opnreg == 0x28) { | if (addr == 0x28) { |
| if ((dat & 0x0f) < 3) { | if ((dat & 0x0f) < 3) { |
| opngen_keyon(dat & 0x0f, dat); | opngen_keyon(dat & 0x0f, dat); |
| } | } |
| Line 37 static void IOOUTCALL spb_o18a(UINT port | Line 45 static void IOOUTCALL spb_o18a(UINT port |
| } | } |
| } | } |
| else { | else { |
| fmtimer_setreg(opn.opnreg, dat); | fmtimer_setreg(addr, dat); |
| if (opn.opnreg == 0x27) { | if (addr == 0x27) { |
| opnch[2].extop = dat & 0xc0; | opnch[2].extop = dat & 0xc0; |
| } | } |
| } | } |
| } | } |
| else if (opn.opnreg < 0xc0) { | else if (addr < 0xc0) { |
| opngen_setreg(0, opn.opnreg, dat); | opngen_setreg(0, addr, dat); |
| } | } |
| opn.reg[opn.opnreg] = dat; | opn.reg[addr] = dat; |
| } | } |
| (void)port; | (void)port; |
| } | } |
| static void IOOUTCALL spb_o18c(UINT port, REG8 dat) { | static void IOOUTCALL spb_o18c(UINT port, REG8 dat) { |
| opn.extreg = dat; | opn.addr = dat + 0x100; |
| opn.data = dat; | |
| (void)port; | (void)port; |
| } | } |
| static void IOOUTCALL spb_o18e(UINT port, REG8 dat) { | static void IOOUTCALL spb_o18e(UINT port, REG8 dat) { |
| S98_put(EXTEND2608, opn.extreg, dat); | UINT addr; |
| opn.reg[opn.extreg + 0x100] = dat; | |
| if (opn.extreg >= 0x30) { | opn.data = dat; |
| opngen_setreg(3, opn.extreg, dat); | addr = opn.addr - 0x100; |
| } | if (addr >= 0x100) { |
| else if (opn.extreg < 0x12) { | return; |
| sound_sync(); | } |
| adpcm_setreg(&adpcm, opn.extreg, dat); | S98_put(EXTEND2608, addr, dat); |
| opn.reg[addr + 0x100] = dat; | |
| if (addr >= 0x30) { | |
| opngen_setreg(3, addr, dat); | |
| } | |
| else if (addr < 0x12) { | |
| adpcm_setreg(&adpcm, addr, dat); | |
| } | } |
| (void)port; | (void)port; |
| } | } |
| Line 79 static REG8 IOINPCALL spb_i188(UINT port | Line 94 static REG8 IOINPCALL spb_i188(UINT port |
| static REG8 IOINPCALL spb_i18a(UINT port) { | static REG8 IOINPCALL spb_i18a(UINT port) { |
| if (opn.opnreg == 0x0e) { | UINT addr; |
| addr = opn.addr; | |
| if (addr == 0x0e) { | |
| return(fmboard_getjoy(&psg1)); | return(fmboard_getjoy(&psg1)); |
| } | } |
| else if (opn.opnreg < 0x10) { | else if (addr < 0x10) { |
| return(psggen_getreg(&psg1, opn.opnreg)); | return(psggen_getreg(&psg1, addr)); |
| } | |
| else if (addr == 0xff) { | |
| return(1); | |
| } | |
| else { | |
| (void)port; | |
| return(opn.data); | |
| } | } |
| (void)port; | |
| return(opn.reg[opn.opnreg]); | |
| } | } |
| static REG8 IOINPCALL spb_i18e(UINT port) { | static REG8 IOINPCALL spb_i18e(UINT port) { |
| if (opn.extreg == 0x08) { | UINT addr; |
| addr = opn.addr - 0x100; | |
| if (addr == 0x08) { | |
| return(adpcm_readsample(&adpcm)); | return(adpcm_readsample(&adpcm)); |
| } | } |
| (void)port; | else if (addr == 0x0f) { |
| return(opn.reg[opn.opnreg]); | return(opn.reg[addr + 0x100]); |
| } | |
| else { | |
| (void)port; | |
| return(opn.data); | |
| } | |
| } | } |
| Line 103 static REG8 IOINPCALL spb_i18e(UINT port | Line 134 static REG8 IOINPCALL spb_i18e(UINT port |
| static void IOOUTCALL spr_o588(UINT port, REG8 dat) { | static void IOOUTCALL spr_o588(UINT port, REG8 dat) { |
| opn.opn2reg = dat; | opn.addr2 = dat; |
| // opn.data2 = dat; | |
| (void)port; | (void)port; |
| } | } |
| static void IOOUTCALL spr_o58a(UINT port, REG8 dat) { | static void IOOUTCALL spr_o58a(UINT port, REG8 dat) { |
| if (opn.opn2reg < 0x30) { | UINT addr; |
| if (opn.opn2reg == 0x28) { | |
| // opn.data2 = dat; | |
| addr = opn.addr2; | |
| if (addr >= 0x100) { | |
| return; | |
| } | |
| if (addr < 0x30) { | |
| if (addr == 0x28) { | |
| if ((dat & 0x0f) < 3) { | if ((dat & 0x0f) < 3) { |
| opngen_keyon((dat & 0x0f) + 6, dat); | opngen_keyon((dat & 0x0f) + 6, dat); |
| } | } |
| Line 120 static void IOOUTCALL spr_o58a(UINT port | Line 159 static void IOOUTCALL spr_o58a(UINT port |
| } | } |
| } | } |
| else { | else { |
| if (opn.opn2reg == 0x27) { | if (addr == 0x27) { |
| opnch[8].extop = dat & 0xc0; | opnch[8].extop = dat & 0xc0; |
| } | } |
| } | } |
| } | } |
| else if (opn.opn2reg < 0xc0) { | else if (addr < 0xc0) { |
| opngen_setreg(6, opn.opn2reg, dat); | opngen_setreg(6, addr, dat); |
| } | } |
| opn.reg[opn.opn2reg + 0x200] = dat; | opn.reg[addr + 0x200] = dat; |
| (void)port; | (void)port; |
| } | } |
| static void IOOUTCALL spr_o58c(UINT port, REG8 dat) { | static void IOOUTCALL spr_o58c(UINT port, REG8 dat) { |
| opn.ext2reg = dat; | opn.addr2 = dat + 0x100; |
| // opn.data2 = dat; | |
| (void)port; | (void)port; |
| } | } |
| static void IOOUTCALL spr_o58e(UINT port, REG8 dat) { | static void IOOUTCALL spr_o58e(UINT port, REG8 dat) { |
| opn.reg[opn.ext2reg + 0x300] = dat; | UINT addr; |
| if (opn.ext2reg >= 0x30) { | |
| sound_sync(); | // opn.data2 = dat; |
| opngen_setreg(9, opn.ext2reg, dat); | addr = opn.addr2 - 0x100; |
| if (addr >= 0x100) { | |
| return; | |
| } | |
| opn.reg[addr + 0x300] = dat; | |
| if (addr >= 0x30) { | |
| opngen_setreg(9, addr, dat); | |
| } | } |
| (void)port; | (void)port; |
| } | } |
| Line 156 static REG8 IOINPCALL spr_i588(UINT port | Line 202 static REG8 IOINPCALL spr_i588(UINT port |
| static REG8 IOINPCALL spr_i58a(UINT port) { | static REG8 IOINPCALL spr_i58a(UINT port) { |
| if (opn.opn2reg >= 0x20) { | UINT addr; |
| return(opn.reg[opn.opn2reg + 0x200]); | |
| addr = opn.addr2; | |
| if ((addr >= 0x20) && (addr < 0xff)) { | |
| return(opn.reg[addr + 0x200]); | |
| } | |
| else if (addr == 0xff) { | |
| return(0); | |
| } | |
| else { | |
| (void)port; | |
| // return(opn.data2); | |
| return(0xff); | |
| } | } |
| (void)port; | |
| return(0xff); | |
| } | } |
| static REG8 IOINPCALL spr_i58c(UINT port) { | static REG8 IOINPCALL spr_i58c(UINT port) { |
| Line 171 static REG8 IOINPCALL spr_i58c(UINT port | Line 226 static REG8 IOINPCALL spr_i58c(UINT port |
| static REG8 IOINPCALL spr_i58e(UINT port) { | static REG8 IOINPCALL spr_i58e(UINT port) { |
| (void)port; | UINT addr; |
| return(opn.reg[opn.opn2reg + 0x200]); | |
| addr = opn.addr2; | |
| if (addr < 0x100) { | |
| return(opn.reg[addr + 0x200]); | |
| } | |
| else { | |
| (void)port; | |
| // return(opn.data2); | |
| return(0xff); | |
| } | |
| } | } |
| Line 190 void boardspb_reset(void) { | Line 254 void boardspb_reset(void) { |
| fmtimer_reset(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(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) { |
| fmboard_fmrestore(0, 0); | |
| fmboard_fmrestore(3, 1); | |
| psggen_restore(&psg1); | |
| fmboard_rhyrestore(&rhythm, 0); | |
| sound_streamregist(&opngen, (SOUNDCB)opngen_getpcmvr); | 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 219 void boardspr_reset(void) { | Line 287 void boardspr_reset(void) { |
| 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(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) { |
| 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(&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); |