|
|
| version 1.7, 2004/01/23 15:05:05 | version 1.12, 2004/02/18 03:24:48 |
|---|---|
| Line 1 | Line 1 |
| #include "compiler.h" | #include "compiler.h" |
| #include "joymng.h" | #include "joymng.h" |
| #include "soundmng.h" | #include "soundmng.h" |
| // #include "cpucore.h" | |
| #include "pccore.h" | #include "pccore.h" |
| #include "iocore.h" | #include "iocore.h" |
| #include "cbuscore.h" | #include "cbuscore.h" |
| Line 18 | Line 17 |
| #include "fmboard.h" | #include "fmboard.h" |
| #include "beep.h" | #include "beep.h" |
| #include "keydisp.h" | #include "keydisp.h" |
| #include "keystat.h" | |
| UINT32 usesound; | UINT32 usesound; |
| Line 54 REG8 fmboard_getjoy(PSGGEN psg) { | Line 54 REG8 fmboard_getjoy(PSGGEN psg) { |
| if (!(psg->reg.io2 & 0x40)) { | if (!(psg->reg.io2 & 0x40)) { |
| ret &= (joymng_getstat() | (rapids & 0x30)); | ret &= (joymng_getstat() | (rapids & 0x30)); |
| if (np2cfg.KEY_MODE == 1) { | if (np2cfg.KEY_MODE == 1) { |
| ret &= keyext_getjoy(); | ret &= keystat_getjoy(); |
| } | } |
| } | } |
| else { | else { |
| if (np2cfg.KEY_MODE == 2) { | if (np2cfg.KEY_MODE == 2) { |
| ret &= keyext_getjoy(); | ret &= keystat_getjoy(); |
| } | } |
| } | } |
| if (np2cfg.BTN_RAPID) { | if (np2cfg.BTN_RAPID) { |
| Line 100 void fmboard_extenable(REG8 enable) { | Line 100 void fmboard_extenable(REG8 enable) { |
| // ---- | // ---- |
| static void setfmregs(BYTE *reg) { | |
| FillMemory(reg + 0x30, 0x60, 0xff); | |
| FillMemory(reg + 0x90, 0x20, 0x00); | |
| FillMemory(reg + 0xb0, 0x04, 0x00); | |
| FillMemory(reg + 0xb4, 0x04, 0xc0); | |
| } | |
| void fmboard_reset(UINT32 type) { | void fmboard_reset(UINT32 type) { |
| BYTE cross; | BYTE cross; |
| Line 110 void fmboard_reset(UINT32 type) { | Line 118 void fmboard_reset(UINT32 type) { |
| extfn = NULL; | extfn = NULL; |
| ZeroMemory(&opn, sizeof(opn)); | ZeroMemory(&opn, sizeof(opn)); |
| opn.channels = 3; | setfmregs(opn.reg + 0x000); |
| opn.adpcmmask = (BYTE)~(0x1c); | setfmregs(opn.reg + 0x100); |
| setfmregs(opn.reg + 0x200); | |
| setfmregs(opn.reg + 0x300); | |
| opn.reg[0xff] = 0x01; | opn.reg[0xff] = 0x01; |
| opn.channels = 3; | |
| opn.adpcmmask = (UINT8)~(0x1c); | |
| ZeroMemory(&musicgen, sizeof(musicgen)); | ZeroMemory(&musicgen, sizeof(musicgen)); |
| ZeroMemory(&amd98, sizeof(amd98)); | ZeroMemory(&amd98, sizeof(amd98)); |
| Line 127 void fmboard_reset(UINT32 type) { | Line 139 void fmboard_reset(UINT32 type) { |
| pcm86_reset(); | pcm86_reset(); |
| cs4231_reset(); | cs4231_reset(); |
| switch(usesound) { | switch(type) { |
| case 0x01: | case 0x01: |
| board14_reset(); | board14_reset(); |
| break; | break; |
| Line 218 void fmboard_bind(void) { | Line 230 void fmboard_bind(void) { |
| sound_streamregist(&beep, (SOUNDCB)beep_getpcm); | sound_streamregist(&beep, (SOUNDCB)beep_getpcm); |
| } | } |
| // ---- | |
| void fmboard_fmrestore(REG8 chbase, UINT bank) { | |
| REG8 i; | |
| const BYTE *reg; | |
| reg = opn.reg + (bank * 0x100); | |
| for (i=0x30; i<0xa0; i++) { | |
| opngen_setreg(chbase, i, reg[i]); | |
| } | |
| for (i=0xb7; i>=0xa0; i--) { | |
| opngen_setreg(chbase, i, reg[i]); | |
| } | |
| for (i=0; i<3; i++) { | |
| opngen_keyon(chbase + i, opngen.keyreg[chbase + i]); | |
| } | |
| } | |
| void fmboard_rhyrestore(RHYTHM rhy, UINT bank) { | |
| const BYTE *reg; | |
| reg = opn.reg + (bank * 0x100); | |
| rhythm_setreg(rhy, 0x11, reg[0x11]); | |
| rhythm_setreg(rhy, 0x18, reg[0x18]); | |
| rhythm_setreg(rhy, 0x19, reg[0x19]); | |
| rhythm_setreg(rhy, 0x1a, reg[0x1a]); | |
| rhythm_setreg(rhy, 0x1b, reg[0x1b]); | |
| rhythm_setreg(rhy, 0x1c, reg[0x1c]); | |
| rhythm_setreg(rhy, 0x1d, reg[0x1d]); | |
| } | |