static void IOOUTCALL opn_o18a(UINT port, REG8 dat) { UINT addr; g_opn.data1 = dat; addr = g_opn.addr1l; S98_put(NORMAL2608, addr, dat); g_opn.reg[addr] = dat; if (addr < 0x10) { psggen_setreg(&g_psg1, addr, dat); } else if (addr < 0x100) { if (addr < 0x30) { if (addr == 0x28) { if ((dat & 0x0f) < 3) { opngen_keyon(&g_opngen, dat & 0x0f, dat); } } else { fmtimer_setreg(addr, dat); if (addr == 0x27) { g_opngen.opnch[2].extop = dat & 0xc0; } } } else if (addr < 0xc0) { opngen_setreg(&g_opngen, 0, addr, dat); } } (void)port; }
static void IOOUTCALL opna_o18e(UINT port, REG8 dat) { UINT addr; if (!opn.extend) { return; } addr = opn.addr - 0x100; if (addr >= 0x100) { return; } S98_put(EXTEND2608, addr, dat); opn.reg[addr + 0x100] = dat; if (addr >= 0x30) { opngen_setreg(6, addr, dat); } else { if (addr == 0x10) { if (!(dat & 0x80)) { opn.adpcmmask = ~(dat & 0x1c); } } } (void)port; }
static void IOOUTCALL ymf_o18e(UINT port, REG8 dat) { UINT addr; if (!g_opn.extend) { return; } g_opn.data1 = dat; if (g_opn.addr1h != 1) { return; } addr = g_opn.addr1l; S98_put(EXTEND2608, addr, dat); g_opn.reg[addr + 0x100] = dat; if (addr >= 0x30) { opngen_setreg(&g_opngen, 3, addr, dat); } else { if (addr == 0x10) { if (!(dat & 0x80)) { g_opn.adpcmmask = ~(dat & 0x1c); } } } (void)port; }
/** * Writes extended register * @param[in] opna The instance * @param[in] nAddress The address * @param[in] cData The data */ void opna_writeExtendedRegister(POPNA opna, UINT nAddress, REG8 cData) { opna->s.reg[nAddress + 0x100] = cData; if (opna->s.cCaps & OPNA_S98) { S98_put(EXTEND2608, nAddress, cData); } writeExtendedRegister(opna, nAddress, cData); }
/** * Writes register * @param[in] opna The instance * @param[in] nAddress The address * @param[in] cData The data */ void opna_writeRegister(POPNA opna, UINT nAddress, REG8 cData) { opna->s.reg[nAddress] = cData; if (opna->s.cCaps & OPNA_S98) { S98_put(NORMAL2608, nAddress, cData); } writeRegister(opna, nAddress, cData); }
static void IOOUTCALL opna_o18a(UINT port, REG8 dat) { UINT addr; opn.data = dat; addr = opn.addr; if (addr >= 0x100) { return; } S98_put(NORMAL2608, addr, dat); if (addr < 0x10) { if (addr != 0x0e) { psggen_setreg(&psg2, addr, dat); } } else { if (addr < 0x20) { if (opn.extend) { rhythm_setreg(&rhythm, addr, dat); } } else if (addr < 0x30) { if (addr == 0x28) { if ((dat & 0x0f) < 3) { opngen_keyon((dat & 0x0f) + 3, dat); } else if (((dat & 0x0f) != 3) && ((dat & 0x0f) < 7)) { opngen_keyon((dat & 0x0f) + 2, dat); } } else { fmtimer_setreg(addr, dat); if (addr == 0x27) { opnch[2].extop = dat & 0xc0; } } } else if (addr < 0xc0) { opngen_setreg(3, addr, dat); } opn.reg[addr] = dat; } (void)port; }
static void IOOUTCALL spb_o18e(UINT port, REG8 dat) { UINT addr; opn.data = dat; addr = opn.addr - 0x100; if (addr >= 0x100) { return; } 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; }
static void IOOUTCALL ymf_o18a(UINT port, REG8 dat) { UINT addr; opn.data = 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 { if (addr < 0x20) { rhythm_setreg(&rhythm, addr, dat); } else if (addr < 0x30) { if (addr == 0x28) { if ((dat & 0x0f) < 3) { opngen_keyon(dat & 0x0f, dat); } else if (((dat & 0x0f) != 3) && ((dat & 0x0f) < 7)) { opngen_keyon((dat & 0x07) - 1, dat); } } else { fmtimer_setreg(addr, dat); } } else if (addr < 0xc0) { opngen_setreg(0, addr, dat); } opn.reg[addr] = dat; } (void)port; }
static void IOOUTCALL ymf_o18a(UINT port, REG8 dat) { UINT addr; g_opn.data1 = dat; if (g_opn.addr1h != 0) { return; } addr = g_opn.addr1l; S98_put(NORMAL2608, addr, dat); g_opn.reg[addr] = dat; if (addr < 0x10) { psggen_setreg(&g_psg1, addr, dat); } else { if (addr < 0x20) { rhythm_setreg(&g_rhythm, addr, dat); } else if (addr < 0x30) { if (addr == 0x28) { if ((dat & 0x0f) < 3) { opngen_keyon(&g_opngen, dat & 0x0f, dat); } else if (((dat & 0x0f) != 3) && ((dat & 0x0f) < 7)) { opngen_keyon(&g_opngen, (dat & 0x07) - 1, dat); } } else { fmtimer_setreg(addr, dat); } } else if (addr < 0xc0) { opngen_setreg(&g_opngen, 0, addr, dat); } } (void)port; }