|
|
| version 1.10, 2004/02/04 03:42:02 | version 1.14, 2005/05/13 05:47:25 |
|---|---|
| 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 29 | Line 29 |
| _FMTIMER fmtimer; | _FMTIMER fmtimer; |
| _OPNGEN opngen; | _OPNGEN opngen; |
| OPNCH opnch[OPNCH_MAX]; | OPNCH opnch[OPNCH_MAX]; |
| _PSGGEN psg1; | _PSGGEN __psg[3]; |
| _PSGGEN psg2; | |
| _PSGGEN psg3; | |
| _RHYTHM rhythm; | _RHYTHM rhythm; |
| _ADPCM adpcm; | _ADPCM adpcm; |
| _PCM86 pcm86; | _PCM86 pcm86; |
| Line 54 REG8 fmboard_getjoy(PSGGEN psg) { | Line 52 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 70 REG8 fmboard_getjoy(PSGGEN psg) { | Line 68 REG8 fmboard_getjoy(PSGGEN psg) { |
| ret &= ((ret >> 2) | (~0x30)); | ret &= ((ret >> 2) | (~0x30)); |
| if (np2cfg.BTN_MODE) { | if (np2cfg.BTN_MODE) { |
| BYTE bit1 = (ret & 0x20) >> 1; // ver0.28 | UINT8 bit1 = (ret & 0x20) >> 1; // ver0.28 |
| BYTE bit2 = (ret & 0x10) << 1; | UINT8 bit2 = (ret & 0x10) << 1; |
| ret = (ret & (~0x30)) | bit1 | bit2; | ret = (ret & (~0x30)) | bit1 | bit2; |
| } | } |
| Line 100 void fmboard_extenable(REG8 enable) { | Line 98 void fmboard_extenable(REG8 enable) { |
| // ---- | // ---- |
| static void setfmregs(UINT8 *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; | UINT8 cross; |
| soundrom_reset(); | soundrom_reset(); |
| beep_reset(); // ver0.27a | beep_reset(); // ver0.27a |
| Line 110 void fmboard_reset(UINT32 type) { | Line 116 void fmboard_reset(UINT32 type) { |
| extfn = NULL; | extfn = NULL; |
| ZeroMemory(&opn, sizeof(opn)); | ZeroMemory(&opn, sizeof(opn)); |
| setfmregs(opn.reg + 0x000); | |
| setfmregs(opn.reg + 0x100); | |
| setfmregs(opn.reg + 0x200); | |
| setfmregs(opn.reg + 0x300); | |
| opn.reg[0xff] = 0x01; | |
| opn.channels = 3; | opn.channels = 3; |
| opn.adpcmmask = (UINT8)~(0x1c); | opn.adpcmmask = (UINT8)~(0x1c); |
| FillMemory(opn.reg, 0x400, 0xff); | |
| opn.reg[0xff] = 0x01; | |
| ZeroMemory(&musicgen, sizeof(musicgen)); | ZeroMemory(&musicgen, sizeof(musicgen)); |
| ZeroMemory(&amd98, sizeof(amd98)); | ZeroMemory(&amd98, sizeof(amd98)); |
| Line 225 void fmboard_bind(void) { | Line 234 void fmboard_bind(void) { |
| void fmboard_fmrestore(REG8 chbase, UINT bank) { | void fmboard_fmrestore(REG8 chbase, UINT bank) { |
| REG8 i; | REG8 i; |
| const BYTE *reg; | const UINT8 *reg; |
| reg = opn.reg + (bank * 0x100); | reg = opn.reg + (bank * 0x100); |
| for (i=0x30; i<0xa0; i++) { | for (i=0x30; i<0xa0; i++) { |
| Line 241 const BYTE *reg; | Line 250 const BYTE *reg; |
| void fmboard_rhyrestore(RHYTHM rhy, UINT bank) { | void fmboard_rhyrestore(RHYTHM rhy, UINT bank) { |
| const BYTE *reg; | const UINT8 *reg; |
| reg = opn.reg + (bank * 0x100); | reg = opn.reg + (bank * 0x100); |
| rhythm_setreg(rhy, 0x11, reg[0x11]); | rhythm_setreg(rhy, 0x11, reg[0x11]); |