| version 1.5, 2003/11/14 05:26:53 | version 1.8, 2004/02/03 08:24:40 | 
| Line 12  static void setamd98event(BOOL absolute) | Line 12  static void setamd98event(BOOL absolute) | 
 | SINT32  cnt; | SINT32  cnt; | 
 |  |  | 
 | if (pit.value[3] > 8) {                                         // º¬µò¤Ê¤· | if (pit.value[3] > 8) {                                         // º¬µò¤Ê¤· | 
| cnt = pc.multiple * pit.value[3]; | cnt = pccore.multiple * pit.value[3]; | 
 | } | } | 
 | else { | else { | 
| cnt = pc.multiple << 16; | cnt = pccore.multiple << 16; | 
 | } | } | 
| if (pc.baseclock == PCBASECLOCK25) { | if (pccore.baseclock == PCBASECLOCK25) { | 
 | cnt = cnt * 16 / 13;                                    // cnt * 2457600 / 1996800 | cnt = cnt * 16 / 13;                                    // cnt * 2457600 / 1996800 | 
 | } | } | 
 | nevent_set(NEVENT_MUSICGEN, cnt, amd98int, absolute); | nevent_set(NEVENT_MUSICGEN, cnt, amd98int, absolute); | 
| Line 38  void amd98int(NEVENTITEM item) { | Line 38  void amd98int(NEVENTITEM item) { | 
 |  |  | 
 | // ---- | // ---- | 
 |  |  | 
| static void IOOUTCALL amd_od8(UINT port, BYTE dat) { | static void IOOUTCALL amd_od8(UINT port, REG8 dat) { | 
 |  |  | 
 | opn.opnreg = dat; | opn.opnreg = dat; | 
 | (void)port; | (void)port; | 
 | } | } | 
 |  |  | 
| static void IOOUTCALL amd_od9(UINT port, BYTE dat) { | static void IOOUTCALL amd_od9(UINT port, REG8 dat) { | 
 |  |  | 
 | opn.extreg = dat; | opn.extreg = dat; | 
 | (void)port; | (void)port; | 
 | } | } | 
 |  |  | 
| static void IOOUTCALL amd_oda(UINT port, BYTE dat) { | static void IOOUTCALL amd_oda(UINT port, REG8 dat) { | 
 |  |  | 
 | if (opn.opnreg < 0x0e) { | if (opn.opnreg < 0x0e) { | 
 | psggen_setreg(&psg1, opn.opnreg, dat); | psggen_setreg(&psg1, opn.opnreg, dat); | 
| Line 61  static void IOOUTCALL amd_oda(UINT port, | Line 61  static void IOOUTCALL amd_oda(UINT port, | 
 | (void)port; | (void)port; | 
 | } | } | 
 |  |  | 
| static void IOOUTCALL amd_odb(UINT port, BYTE dat) { | static void IOOUTCALL amd_odb(UINT port, REG8 dat) { | 
 |  |  | 
 | if (opn.extreg < 0x0e) { | if (opn.extreg < 0x0e) { | 
 | psggen_setreg(&psg2, opn.extreg, dat); | psggen_setreg(&psg2, opn.extreg, dat); | 
 | } | } | 
 | else if (opn.extreg == 0x0f) { | else if (opn.extreg == 0x0f) { | 
| BYTE b; | REG8 b; | 
 | b = psg2.reg.io2; | b = psg2.reg.io2; | 
 | if ((b & 1) > (dat & 1)) { | if ((b & 1) > (dat & 1)) { | 
 | b &= 0xc2; | b &= 0xc2; | 
| Line 81  static void IOOUTCALL amd_odb(UINT port, | Line 81  static void IOOUTCALL amd_odb(UINT port, | 
 | psggen_setreg(&psg3, amd98.psg3reg, | psggen_setreg(&psg3, amd98.psg3reg, | 
 | psg1.reg.io2); | psg1.reg.io2); | 
 | } | } | 
 |  | #if 0 | 
 | else if (amd98.psg3reg == 0x0f) { | else if (amd98.psg3reg == 0x0f) { | 
 | int r; | int r; | 
 | static const BYTE amdr[] = {0x01, 0x08, 0x10, 0x20, 0x06, 0x40}; | static const BYTE amdr[] = {0x01, 0x08, 0x10, 0x20, 0x06, 0x40}; | 
| Line 91  static const BYTE amdr[] = {0x01, 0x08, | Line 92  static const BYTE amdr[] = {0x01, 0x08, | 
 | } | } | 
 | } | } | 
 | } | } | 
 |  | #endif | 
 | } | } | 
 | } | } | 
 | psg2.reg.io2 = dat; | psg2.reg.io2 = dat; | 
| Line 98  static const BYTE amdr[] = {0x01, 0x08, | Line 100  static const BYTE amdr[] = {0x01, 0x08, | 
 | (void)port; | (void)port; | 
 | } | } | 
 |  |  | 
| static void IOOUTCALL amd_odc(UINT port, BYTE dat) { | static void IOOUTCALL amd_odc(UINT port, REG8 dat) { | 
 |  |  | 
| itimer_setcount(3, dat); | pit_setcount(3, dat); | 
 | setamd98event(NEVENT_ABSOLUTE); | setamd98event(NEVENT_ABSOLUTE); | 
 | (void)port; | (void)port; | 
 | } | } | 
 |  |  | 
| static void IOOUTCALL amd_ode(UINT port, BYTE dat) { | static void IOOUTCALL amd_ode(UINT port, REG8 dat) { | 
 |  |  | 
| itimer_setflag(3, dat); | pit_setflag(3, dat); | 
 | (void)port; | (void)port; | 
 | } | } | 
 |  |  | 
| Line 126  void amd98_bind(void) { | Line 128  void amd98_bind(void) { | 
 | psgpanset(&psg1); | psgpanset(&psg1); | 
 | psgpanset(&psg2); | psgpanset(&psg2); | 
 | psgpanset(&psg3); | psgpanset(&psg3); | 
 |  | psggen_restore(&psg1); | 
 |  | psggen_restore(&psg2); | 
 |  | psggen_restore(&psg3); | 
 | sound_streamregist(&psg1, (SOUNDCB)psggen_getpcm); | sound_streamregist(&psg1, (SOUNDCB)psggen_getpcm); | 
 | sound_streamregist(&psg2, (SOUNDCB)psggen_getpcm); | sound_streamregist(&psg2, (SOUNDCB)psggen_getpcm); | 
 | sound_streamregist(&psg3, (SOUNDCB)psggen_getpcm); | sound_streamregist(&psg3, (SOUNDCB)psggen_getpcm); |