From e1a1a04b02616a42a2802f23a99b8262e55ed76f Mon Sep 17 00:00:00 2001 From: iq_132 <1191709+iq132@users.noreply.github.com> Date: Sat, 3 Feb 2018 03:23:41 +0000 Subject: [PATCH] pre90s ay8910 update --- src/burn/drv/pre90s/d_4enraya.cpp | 133 +++++++++---------- src/burn/drv/pre90s/d_aeroboto.cpp | 18 +-- src/burn/drv/pre90s/d_arabian.cpp | 31 ++--- src/burn/drv/pre90s/d_aztarac.cpp | 59 +++------ src/burn/drv/pre90s/d_battlex.cpp | 15 +-- src/burn/drv/pre90s/d_blueprnt.cpp | 200 +++++++++++++---------------- src/burn/drv/pre90s/d_bogeyman.cpp | 18 +-- src/burn/drv/pre90s/d_calorie.cpp | 171 +++++++++++------------- src/burn/drv/pre90s/d_cclimber.cpp | 25 ++-- src/burn/drv/pre90s/d_dacholer.cpp | 22 +--- src/burn/drv/pre90s/d_dogfgt.cpp | 24 ++-- src/burn/drv/pre90s/d_epos.cpp | 60 ++++----- src/burn/drv/pre90s/d_exedexes.cpp | 14 +- src/burn/drv/pre90s/d_funkybee.cpp | 26 +--- src/burn/drv/pre90s/d_jack.cpp | 17 +-- src/burn/drv/pre90s/d_kncljoe.cpp | 26 +--- src/burn/drv/pre90s/d_kyugo.cpp | 68 ++++------ src/burn/drv/pre90s/d_lasso.cpp | 16 +-- src/burn/drv/pre90s/d_mainsnk.cpp | 18 +-- src/burn/drv/pre90s/d_marineb.cpp | 52 +++----- src/burn/drv/pre90s/d_mario.cpp | 13 +- src/burn/drv/pre90s/d_meijinsn.cpp | 19 +-- src/burn/drv/pre90s/d_mirax.cpp | 114 ++++++++-------- src/burn/drv/pre90s/d_mouser.cpp | 27 ++-- src/burn/drv/pre90s/d_munchmo.cpp | 15 +-- src/burn/drv/pre90s/d_pacman.cpp | 11 +- src/burn/drv/pre90s/d_pengadvb.cpp | 52 +++----- src/burn/drv/pre90s/d_pitnrun.cpp | 19 +-- src/burn/drv/pre90s/d_pkunwar.cpp | 45 +++---- src/burn/drv/pre90s/d_route16.cpp | 13 +- src/burn/drv/pre90s/d_scregg.cpp | 28 +--- src/burn/drv/pre90s/d_seicross.cpp | 13 +- src/burn/drv/pre90s/d_skyarmy.cpp | 13 +- src/burn/drv/pre90s/d_snk.cpp | 39 +++--- src/burn/drv/pre90s/d_solomon.cpp | 36 ++---- src/burn/drv/pre90s/d_suna8.cpp | 22 ++-- src/burn/drv/pre90s/d_thepit.cpp | 16 +-- src/burn/drv/pre90s/d_timelimt.cpp | 26 ++-- src/burn/drv/pre90s/d_travrusa.cpp | 19 +-- src/burn/drv/pre90s/d_tsamurai.cpp | 14 +- src/burn/drv/pre90s/d_vastar.cpp | 11 +- src/burn/drv/pre90s/d_vulgus.cpp | 19 +-- src/burn/drv/pre90s/d_wallc.cpp | 36 ++---- src/burn/drv/pre90s/d_wiz.cpp | 21 +-- src/burn/drv/pre90s/d_zodiack.cpp | 39 ++---- 45 files changed, 629 insertions(+), 1064 deletions(-) diff --git a/src/burn/drv/pre90s/d_4enraya.cpp b/src/burn/drv/pre90s/d_4enraya.cpp index 3df7cd9d4..893c2bcb1 100644 --- a/src/burn/drv/pre90s/d_4enraya.cpp +++ b/src/burn/drv/pre90s/d_4enraya.cpp @@ -3,6 +3,7 @@ #include "tiles_generic.h" #include "z80_intf.h" +#include "bitswap.h" #include "driver.h" extern "C" { #include "ay8910.h" @@ -19,20 +20,18 @@ static UINT8 *DrvNVRAM; static UINT8 *DrvVidRAM; static UINT32 *DrvPalette; - -static INT16 *pAY8910Buffer[3]; - static UINT8 DrvRecalc; -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvDips[2]; -static UINT8 DrvInputs[2]; -static UINT8 DrvReset; +static UINT8 soundlatch; +static UINT8 soundcontrol; -static UINT8 *soundlatch; -static UINT8 *soundcontrol; -static UINT32 sound_bit; +static UINT8 DrvJoy1[8]; +static UINT8 DrvJoy2[8]; +static UINT8 DrvDips[2]; +static UINT8 DrvInputs[2]; +static UINT8 DrvReset; + +static UINT8 sound_bit; static struct BurnInputInfo Enraya4InputList[] = { {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 1, "p1 coin" }, @@ -153,7 +152,7 @@ static struct BurnDIPInfo UnkpacgDIPList[]= STDDIPINFO(Unkpacg) -void __fastcall enraya4_write(UINT16 address, UINT8 data) +static void __fastcall enraya4_write(UINT16 address, UINT8 data) { if ((address & 0xf000) == 0xd000 || (address & 0xf000) == 0x7000) { DrvVidRAM[((address & 0x3ff) << 1) + 0] = data; @@ -165,20 +164,20 @@ void __fastcall enraya4_write(UINT16 address, UINT8 data) static void sound_control(UINT8 data) { - if ((*soundcontrol & sound_bit) == sound_bit && (data & sound_bit) == 0) { - AY8910Write(0, ~*soundcontrol & 1, *soundlatch); + if ((soundcontrol & sound_bit) == sound_bit && (data & sound_bit) == 0) { + AY8910Write(0, ~soundcontrol & 1, soundlatch); } - *soundcontrol = data; + soundcontrol = data; } -void __fastcall enraya4_out_port(UINT16 port, UINT8 data) +static void __fastcall enraya4_out_port(UINT16 port, UINT8 data) { switch (port & 0xff) { case 0x20: case 0x23: - *soundlatch = data; + soundlatch = data; break; case 0x30: @@ -188,10 +187,8 @@ void __fastcall enraya4_out_port(UINT16 port, UINT8 data) } } -UINT8 __fastcall enraya4_in_port(UINT16 port) +static UINT8 __fastcall enraya4_in_port(UINT16 port) { - static UINT8 nRet = 0; - switch (port & 0xff) { case 0x00: @@ -204,7 +201,7 @@ UINT8 __fastcall enraya4_in_port(UINT16 port) return DrvInputs[1]; } - return nRet; + return 0; } static INT32 DrvDoReset() @@ -219,6 +216,9 @@ static INT32 DrvDoReset() HiscoreReset(); + soundlatch = 0; + soundcontrol = 0; + return 0; } @@ -239,32 +239,18 @@ static INT32 MemIndex() DrvZ80RAM = Next; Next += 0x001000; DrvVidRAM = Next; Next += 0x000800; - soundlatch = Next; Next += 0x000001; - soundcontrol = Next; Next += 0x000001; - RamEnd = Next; - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - MemEnd = Next; return 0; } -static void DrvPaletteInit() -{ - for (INT32 i = 0; i < 8; i++) { - DrvPalette[i] = BurnHighCol((i & 1) * 0xff, ((i & 2)/2) * 0xff, ((i & 4)/4) * 0xff, 0); - } -} - static INT32 DrvGfxDecode() { INT32 Plane[3] = { 0x10000, 0x20000, 0x00000 }; - INT32 XOffs[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; - INT32 YOffs[8] = { 0, 8, 16, 24, 32, 40, 48, 56 }; + INT32 XOffs[8] = { STEP8(0,1) }; + INT32 YOffs[8] = { STEP8(0,8) }; UINT8 *tmp = (UINT8*)BurnMalloc(0x6000); if (tmp == NULL) { @@ -283,7 +269,7 @@ static INT32 DrvGfxDecode() static void DrvPrgDecode() { for (INT32 i = 0x8000; i < 0xa000; i++) { - DrvZ80ROM[i] = (DrvZ80ROM[i] & 0xfc) | ((DrvZ80ROM[i] & 0x02) >> 1) | ((DrvZ80ROM[i] & 0x01) << 1); + DrvZ80ROM[i] = BITSWAP08(DrvZ80ROM[i], 7,6,5,4,3,2,0,1); } } @@ -297,15 +283,14 @@ static INT32 DrvInit(INT32 game, INT32 sbit) MemIndex(); { - BurnLoadRom(DrvZ80ROM + 0x00000, 0, 1); - BurnLoadRom(DrvZ80ROM + 0x08000, 1, 1); + if (BurnLoadRom(DrvZ80ROM + 0x00000, 0, 1)) return 1; + if (BurnLoadRom(DrvZ80ROM + 0x08000, 1, 1)) return 1; - BurnLoadRom(DrvGfxROM + 0x00000, 2, 1); - BurnLoadRom(DrvGfxROM + 0x02000, 3, 1); - BurnLoadRom(DrvGfxROM + 0x04000, 4, 1); + if (BurnLoadRom(DrvGfxROM + 0x00000, 2, 1)) return 1; + if (BurnLoadRom(DrvGfxROM + 0x02000, 3, 1)) return 1; + if (BurnLoadRom(DrvGfxROM + 0x04000, 4, 1)) return 1; - if (game) DrvPrgDecode(); - DrvPaletteInit(); + if (game) DrvPrgDecode(); // unkpacg DrvGfxDecode(); } @@ -314,23 +299,16 @@ static INT32 DrvInit(INT32 game, INT32 sbit) if (game == 0) // 4enraya { - ZetMapArea(0x0000, 0xbfff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0xbfff, 2, DrvZ80ROM); - ZetMapArea(0xc000, 0xcfff, 0, DrvZ80RAM); - ZetMapArea(0xc000, 0xcfff, 1, DrvZ80RAM); - ZetMapArea(0xc000, 0xcfff, 2, DrvZ80RAM); - // ZetMapArea(0xd000, 0xdfff, 1, DrvVidRAM); + ZetMapMemory(DrvZ80ROM, 0x0000, 0xbfff, MAP_ROM); + ZetMapMemory(DrvZ80RAM, 0xc000, 0xcfff, MAP_RAM); + // ZetMapMemory(DrvVidRAM, 0xd000, 0xdfff, MAP_WRITE); } else // unkpacg { - ZetMapArea(0x0000, 0x1fff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x1fff, 2, DrvZ80ROM); - ZetMapArea(0x6000, 0x6fff, 0, DrvNVRAM); - ZetMapArea(0x6000, 0x6fff, 1, DrvNVRAM); - ZetMapArea(0x6000, 0x6fff, 2, DrvNVRAM); - // ZetMapArea(0xd000, 0xdfff, 1, DrvVidRAM); - ZetMapArea(0x8000, 0x9fff, 0, DrvZ80ROM + 0x8000); - ZetMapArea(0x8000, 0x9fff, 2, DrvZ80ROM + 0x8000); + ZetMapMemory(DrvZ80ROM, 0x0000, 0x1fff, MAP_ROM); + ZetMapMemory(DrvNVRAM, 0x6000, 0x6fff, MAP_RAM); + // ZetMapMemory(DrvVidRAM, 0x7000, 0x7fff, MAP_WRITE); + ZetMapMemory(DrvZ80ROM + 0x8000, 0x8000, 0x9fff, MAP_ROM); } ZetSetOutHandler(enraya4_out_port); @@ -338,7 +316,7 @@ static INT32 DrvInit(INT32 game, INT32 sbit) ZetSetWriteHandler(enraya4_write); ZetClose(); - AY8910Init(0, 2000000, nBurnSoundRate, NULL, NULL, NULL, NULL); + AY8910Init2(0, 2000000, 0); AY8910SetAllRoutes(0, 0.30, BURN_SND_ROUTE_BOTH); sound_bit = sbit; @@ -361,6 +339,26 @@ static INT32 DrvExit() return 0; } +static void DrvPaletteInit() +{ + for (INT32 i = 0; i < 8; i++) { + DrvPalette[i] = BurnHighCol((i&1)?0xff:0, (i&2)?0xff:0, (i&4)?0xff:0, 0); + } +} + +static void draw_layer() +{ + for (INT32 offs = 0x40; offs < 0x3c0; offs++) + { + INT32 sx = (offs & 0x1f) * 8; + INT32 sy = (offs / 0x20) * 8; + + INT32 code = DrvVidRAM[offs * 2] | (DrvVidRAM[offs * 2 + 1] * 256); + + Render8x8Tile(pTransDraw, code, sx, sy - 16, 0, 0, 0, DrvGfxROM); + } +} + static INT32 DrvDraw() { if (DrvRecalc) { @@ -368,14 +366,7 @@ static INT32 DrvDraw() DrvRecalc = 0; } - for (INT32 offs = 0x40; offs < 0x3c0; offs++) { - INT32 sx = (offs & 0x1f) << 3; - INT32 sy = (offs >> 5) << 3; - - INT32 code = DrvVidRAM[(offs << 1) + 0] | (DrvVidRAM[(offs << 1) + 1] << 8); - - Render8x8Tile(pTransDraw, code, sx, sy - 16, 0, 0, 0, DrvGfxROM); - } + draw_layer(); BurnTransferCopy(DrvPalette); @@ -415,7 +406,7 @@ static INT32 DrvFrame() ZetClose(); if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); + AY8910Render2(pBurnSoundOut, nBurnSoundLen); } if (pBurnDraw) { @@ -443,6 +434,10 @@ static INT32 DrvScan(INT32 nAction, INT32 *pnMin) ZetScan(nAction); AY8910Scan(nAction, pnMin); + + + SCAN_VAR(soundlatch); + SCAN_VAR(soundcontrol); } if (nAction & ACB_NVRAM) { diff --git a/src/burn/drv/pre90s/d_aeroboto.cpp b/src/burn/drv/pre90s/d_aeroboto.cpp index faeb60b38..60af2a93e 100644 --- a/src/burn/drv/pre90s/d_aeroboto.cpp +++ b/src/burn/drv/pre90s/d_aeroboto.cpp @@ -28,8 +28,6 @@ static UINT8 *DrvVidRAM; static UINT32 *DrvPalette; static UINT8 DrvRecalc; -static INT16 *pAY8910Buffer[9]; - static UINT8 *soundlatch; static UINT8 counter201; static UINT8 disable_irq; @@ -288,13 +286,6 @@ static INT32 MemIndex() RamEnd = Next; - pAY8910Buffer[0] = (INT16 *)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16 *)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16 *)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[3] = (INT16 *)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[4] = (INT16 *)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[5] = (INT16 *)Next; Next += nBurnSoundLen * sizeof(INT16); - MemEnd = Next; return 0; @@ -383,8 +374,9 @@ static INT32 DrvInit() M6809SetReadHandler(aeroboto_sound_read); M6809Close(); - AY8910Init(0, 1250000, nBurnSoundRate, &aeroboto_AY8910_0_portA, &aeroboto_AY8910_0_portB, NULL, NULL); - AY8910Init(1, 625000, nBurnSoundRate, NULL, NULL, NULL, NULL); + AY8910Init2(0, 1250000, 0); + AY8910Init2(1, 625000, 1); + AY8910SetPorts(0, &aeroboto_AY8910_0_portA, &aeroboto_AY8910_0_portB, NULL, NULL); AY8910SetAllRoutes(0, 0.25, BURN_SND_ROUTE_BOTH); AY8910SetAllRoutes(1, 0.25, BURN_SND_ROUTE_BOTH); @@ -621,7 +613,7 @@ static INT32 DrvFrame() if (pBurnSoundOut) { INT32 nSegmentLength = nBurnSoundLen / nInterleave; INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); + AY8910Render2(pSoundBuf, nSegmentLength); nSoundBufferPos += nSegmentLength; } } @@ -630,7 +622,7 @@ static INT32 DrvFrame() INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); if (nSegmentLength) { - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); + AY8910Render2(pSoundBuf, nSegmentLength); } } diff --git a/src/burn/drv/pre90s/d_arabian.cpp b/src/burn/drv/pre90s/d_arabian.cpp index 12bea5fc6..21491e84f 100644 --- a/src/burn/drv/pre90s/d_arabian.cpp +++ b/src/burn/drv/pre90s/d_arabian.cpp @@ -22,8 +22,6 @@ static UINT8 *DrvTempBmp; static UINT32 *DrvPalette; static UINT8 DrvRecalc; -static INT16 *pAY8910Buffer[3]; - static UINT8 *arabian_color; static UINT8 *flipscreen; @@ -254,7 +252,7 @@ static void arabian_blitter_w(INT32 offset, UINT8 data) } } -void __fastcall arabian_videoram_w(UINT16 offset, UINT8 data) +static void __fastcall arabian_videoram_w(UINT16 offset, UINT8 data) { UINT8 *base; UINT8 x, y; @@ -299,7 +297,7 @@ void __fastcall arabian_videoram_w(UINT16 offset, UINT8 data) } } -void __fastcall arabian_write(UINT16 address, UINT8 data) +static void __fastcall arabian_write(UINT16 address, UINT8 data) { if ((address & 0xc000) == 0x8000) { arabian_videoram_w(address & 0x3fff, data); @@ -312,7 +310,7 @@ void __fastcall arabian_write(UINT16 address, UINT8 data) } } -UINT8 __fastcall arabian_read(UINT16 address) +static UINT8 __fastcall arabian_read(UINT16 address) { if ((address & 0xfe00) == 0xc000) { return DrvInputs[0]; @@ -329,7 +327,7 @@ UINT8 __fastcall arabian_read(UINT16 address) return 0; } -void __fastcall arabian_out(UINT16 port, UINT8 data) +static void __fastcall arabian_out(UINT16 port, UINT8 data) { switch (port) { @@ -343,12 +341,12 @@ void __fastcall arabian_out(UINT16 port, UINT8 data) } } -void ay8910_porta_w(UINT32, UINT32 data) +static void ay8910_porta_w(UINT32, UINT32 data) { *arabian_color = data >> 3; } -void ay8910_portb_w(UINT32, UINT32 data) +static void ay8910_portb_w(UINT32, UINT32 data) { custom_cpu_reset = ~data & 0x10; } @@ -383,10 +381,6 @@ static INT32 MemIndex() DrvPalette = (UINT32*)Next; Next += 0x2000 * sizeof(UINT32); - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - AllRam = Next; DrvZ80RAM = Next; Next += 0x000800; @@ -494,17 +488,16 @@ static INT32 DrvInit() ZetInit(0); ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM); - ZetMapArea(0xd000, 0xd6ff, 0, DrvZ80RAM); - ZetMapArea(0xd000, 0xd7ff, 1, DrvZ80RAM); - ZetMapArea(0xd000, 0xd7ff, 2, DrvZ80RAM); + ZetMapMemory(DrvZ80ROM, 0x0000, 0x7fff, MAP_ROM); + ZetMapMemory(DrvZ80RAM, 0xd000, 0xd7ff, MAP_WRITE); + ZetMapMemory(DrvZ80RAM, 0xd000, 0xd6ff, MAP_ROM); // d700-d7ff read through handler ZetSetWriteHandler(arabian_write); ZetSetReadHandler(arabian_read); ZetSetOutHandler(arabian_out); ZetClose(); - AY8910Init(0, 1500000, nBurnSoundRate, NULL, NULL, ay8910_porta_w, ay8910_portb_w); + AY8910Init2(0, 1500000, 0); + AY8910SetPorts(0, NULL, NULL, ay8910_porta_w, ay8910_portb_w); AY8910SetAllRoutes(0, 0.50, BURN_SND_ROUTE_BOTH); GenericTilesInit(); @@ -597,7 +590,7 @@ static INT32 DrvFrame() ZetClose(); if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); + AY8910Render2(pBurnSoundOut, nBurnSoundLen); } if (pBurnDraw) { diff --git a/src/burn/drv/pre90s/d_aztarac.cpp b/src/burn/drv/pre90s/d_aztarac.cpp index 2bb2e73bc..ed614ee31 100644 --- a/src/burn/drv/pre90s/d_aztarac.cpp +++ b/src/burn/drv/pre90s/d_aztarac.cpp @@ -29,7 +29,6 @@ static INT32 sound_irq_timer; static INT32 sound_status; static INT32 sound_initialized = 0; -static INT16 *pFMBuffer[12]; static INT32 xcenter; static INT32 ycenter; @@ -51,19 +50,18 @@ static UINT8 DialInputs[2]; #define A(a, b, c, d) {a, b, (UINT8*)(c), d} static struct BurnInputInfo AztaracInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 4, "p1 coin" }, + {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 4, "p1 coin" }, {"P1 Start", BIT_DIGITAL, DrvJoy1 + 2, "p1 start" }, {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 1, "p1 fire 1" }, {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 0, "p1 fire 2" }, - A("Left/Right", BIT_ANALOG_REL, &DrvAnalogPort0, "p1 x-axis" ), - A("Up/Down", BIT_ANALOG_REL, &DrvAnalogPort1, "p1 y-axis" ), + A("Left/Right", BIT_ANALOG_REL, &DrvAnalogPort0, "p1 x-axis" ), + A("Up/Down", BIT_ANALOG_REL, &DrvAnalogPort1, "p1 y-axis" ), {"Aim Left", BIT_DIGITAL, DialInputs + 0, "p1 fire 3" }, {"Aim Right", BIT_DIGITAL, DialInputs + 1, "p1 fire 4" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 7, "service" }, + {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, + {"Service", BIT_DIGITAL, DrvJoy1 + 7, "service" }, }; STDINPUTINFO(Aztarac) @@ -139,7 +137,7 @@ static inline void sync_cpu() if (cycles > 0) ZetRun(cycles); } -void __fastcall aztarac_write_word(UINT32 address, UINT16 data) +static void __fastcall aztarac_write_word(UINT32 address, UINT16 data) { if ((address & 0xfffff00) == 0x022000) { *((UINT16*)(DrvNVRAM + (address & 0xfe))) = data | 0xfff0; @@ -152,7 +150,7 @@ void __fastcall aztarac_write_word(UINT32 address, UINT16 data) } } -void __fastcall aztarac_write_byte(UINT32 address, UINT8 data) +static void __fastcall aztarac_write_byte(UINT32 address, UINT8 data) { if (address == 0x027009) { sync_cpu(); @@ -170,7 +168,7 @@ void __fastcall aztarac_write_byte(UINT32 address, UINT8 data) } } -UINT16 __fastcall aztarac_read_word(UINT32 address) +static UINT16 __fastcall aztarac_read_word(UINT32 address) { switch (address) { @@ -185,7 +183,7 @@ UINT16 __fastcall aztarac_read_word(UINT32 address) return 0; } -UINT8 __fastcall aztarac_read_byte(UINT32 address) +static UINT8 __fastcall aztarac_read_byte(UINT32 address) { switch (address) { @@ -209,7 +207,7 @@ UINT8 __fastcall aztarac_read_byte(UINT32 address) return 0; } -void __fastcall aztarac_sound_write(UINT16 address, UINT8 data) +static void __fastcall aztarac_sound_write(UINT16 address, UINT8 data) { switch (address) { @@ -230,7 +228,7 @@ void __fastcall aztarac_sound_write(UINT16 address, UINT8 data) } } -UINT8 __fastcall aztarac_sound_read(UINT16 address) +static UINT8 __fastcall aztarac_sound_read(UINT16 address) { switch (address) { @@ -289,15 +287,6 @@ static INT32 DrvDoReset(INT32 reset_ram) return 0; } -static void sound_init() // Changed refresh rate causes crashes -{ - for (INT32 i = 0; i < 12; i++) { - pFMBuffer[i] = (INT16*)BurnMalloc(nBurnSoundLen * sizeof(INT16)); - } - - sound_initialized = 1; -} - static INT32 MemIndex() { UINT8 *Next; Next = AllMem; @@ -392,19 +381,16 @@ static INT32 DrvInit() ZetInit(0); ZetOpen(0); - ZetMapArea(0x0000, 0x1fff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x1fff, 2, DrvZ80ROM); - ZetMapArea(0x8000, 0x87ff, 0, DrvZ80RAM); - ZetMapArea(0x8000, 0x87ff, 1, DrvZ80RAM); - ZetMapArea(0x8000, 0x87ff, 2, DrvZ80RAM); + ZetMapMemory(DrvZ80ROM, 0x0000, 0x1fff, MAP_ROM); + ZetMapMemory(DrvZ80RAM, 0x8000, 0x87ff, MAP_RAM); ZetSetWriteHandler(aztarac_sound_write); ZetSetReadHandler(aztarac_sound_read); ZetClose(); - AY8910Init(0, 2000000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910Init(1, 2000000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910Init(2, 2000000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910Init(3, 2000000, nBurnSoundRate, NULL, NULL, NULL, NULL); + AY8910Init2(0, 2000000, 0); + AY8910Init2(1, 2000000, 1); + AY8910Init2(2, 2000000, 1); + AY8910Init2(3, 2000000, 1); AY8910SetAllRoutes(0, 0.15, BURN_SND_ROUTE_BOTH); AY8910SetAllRoutes(1, 0.15, BURN_SND_ROUTE_BOTH); AY8910SetAllRoutes(2, 0.15, BURN_SND_ROUTE_BOTH); @@ -439,9 +425,6 @@ static INT32 DrvExit() BurnFree (AllMem); sound_initialized = 0; - for (INT32 i = 0; i < 12; i++) { - BurnFree (pFMBuffer[i]); - } return 0; } @@ -460,12 +443,6 @@ static INT32 DrvDraw() static INT32 DrvFrame() { - if (sound_initialized == 0) { - if (pBurnSoundOut) { - sound_init(); - } - } - if (DrvReset) { DrvDoReset(1); } @@ -524,7 +501,7 @@ static INT32 DrvFrame() ZetClose(); if (pBurnSoundOut) { - AY8910Render(&pFMBuffer[0], pBurnSoundOut, nBurnSoundLen, 0); + AY8910Render2(pBurnSoundOut, nBurnSoundLen); } if (pBurnDraw) { diff --git a/src/burn/drv/pre90s/d_battlex.cpp b/src/burn/drv/pre90s/d_battlex.cpp index 3534ff6f7..0267981cf 100644 --- a/src/burn/drv/pre90s/d_battlex.cpp +++ b/src/burn/drv/pre90s/d_battlex.cpp @@ -31,8 +31,6 @@ static UINT8 *tmpbitmap; static UINT32 *DrvPalette; static UINT8 DrvRecalc; -static INT16 *pAY8910Buffer[6]; - static UINT8 flipscreen; static UINT8 scroll[2]; static UINT8 previous_irq_flip; @@ -314,13 +312,6 @@ static INT32 MemIndex() RamEnd = Next; - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[3] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[4] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[5] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - tmpbitmap = Next; Next += 256 * 224; MemEnd = Next; @@ -453,8 +444,8 @@ static INT32 DrvInit(INT32 select) ZetSetInHandler(battlex_read_port); ZetClose(); - AY8910Init(0, 1250000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910Init(1, 1250000, nBurnSoundRate, NULL, NULL, NULL, NULL); + AY8910Init2(0, 1250000, 0); + AY8910Init2(1, 1250000, 1); AY8910SetAllRoutes(0, 0.15, BURN_SND_ROUTE_BOTH); AY8910SetAllRoutes(1, 0.15, BURN_SND_ROUTE_BOTH); @@ -606,7 +597,7 @@ static INT32 DrvFrame() ZetClose(); if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); + AY8910Render2(pBurnSoundOut, nBurnSoundLen); } if (pBurnDraw) { diff --git a/src/burn/drv/pre90s/d_blueprnt.cpp b/src/burn/drv/pre90s/d_blueprnt.cpp index a9ba6e82d..c643c08f1 100644 --- a/src/burn/drv/pre90s/d_blueprnt.cpp +++ b/src/burn/drv/pre90s/d_blueprnt.cpp @@ -22,8 +22,8 @@ static UINT8 *DrvScrollRAM; static UINT8 *DrvSprRAM; static UINT8 *DrvZ80RAM0; static UINT8 *DrvZ80RAM1; + static UINT32 *DrvPalette; -static INT16 *pAY8910Buffer[6]; static UINT8 *watchdog; static UINT8 *dipsw; @@ -67,6 +67,58 @@ static struct BurnInputInfo BlueprntInputList[] = { STDINPUTINFO(Blueprnt) +static struct BurnInputInfo SaturnInputList[] = { + {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, + {"P1 Start", BIT_DIGITAL, DrvJoy1 + 1, "p1 start" }, + {"P1 Up", BIT_DIGITAL, DrvJoy1 + 6, "p1 up" }, + {"P1 Down", BIT_DIGITAL, DrvJoy1 + 7, "p1 down" }, + {"P1 Left", BIT_DIGITAL, DrvJoy1 + 4, "p1 left" }, + {"P1 Right", BIT_DIGITAL, DrvJoy1 + 5, "p1 right" }, + {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 3, "p1 fire 1" }, + {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 2, "p1 fire 2" }, + + {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 0, "p2 coin" }, + {"P2 Start", BIT_DIGITAL, DrvJoy2 + 1, "p2 start" }, + {"P2 Up", BIT_DIGITAL, DrvJoy2 + 6, "p2 up" }, + {"P2 Down", BIT_DIGITAL, DrvJoy2 + 7, "p2 down" }, + {"P2 Left", BIT_DIGITAL, DrvJoy2 + 4, "p2 left" }, + {"P2 Right", BIT_DIGITAL, DrvJoy2 + 5, "p2 right" }, + {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 3, "p2 fire 1" }, + {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 2, "p2 fire 2" }, + + {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, + {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, + {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, +}; + +STDINPUTINFO(Saturn) + +static struct BurnInputInfo GrasspinInputList[] = { + {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, + {"P1 Start", BIT_DIGITAL, DrvJoy1 + 1, "p1 start" }, + {"P1 Up", BIT_DIGITAL, DrvJoy1 + 6, "p1 up" }, + {"P1 Down", BIT_DIGITAL, DrvJoy1 + 7, "p1 down" }, + {"P1 Left", BIT_DIGITAL, DrvJoy1 + 4, "p1 left" }, + {"P1 Right", BIT_DIGITAL, DrvJoy1 + 5, "p1 right" }, + {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 3, "p1 fire 1" }, + {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 2, "p1 fire 2" }, + + {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 0, "p2 coin" }, + {"P2 Start", BIT_DIGITAL, DrvJoy2 + 1, "p2 start" }, + {"P2 Up", BIT_DIGITAL, DrvJoy2 + 6, "p2 up" }, + {"P2 Down", BIT_DIGITAL, DrvJoy2 + 7, "p2 down" }, + {"P2 Left", BIT_DIGITAL, DrvJoy2 + 4, "p2 left" }, + {"P2 Right", BIT_DIGITAL, DrvJoy2 + 5, "p2 right" }, + {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 3, "p2 fire 1" }, + {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 2, "p2 fire 2" }, + + {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, + {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, + {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, +}; + +STDINPUTINFO(Grasspin) + static struct BurnDIPInfo BlueprntDIPList[]= { {0x11, 0xff, 0xff, 0xc3, NULL }, @@ -113,32 +165,6 @@ static struct BurnDIPInfo BlueprntDIPList[]= STDDIPINFO(Blueprnt) -static struct BurnInputInfo SaturnInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 1, "p1 start" }, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 6, "p1 up" }, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 7, "p1 down" }, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 4, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 5, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 3, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 2, "p1 fire 2" }, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 0, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 1, "p2 start" }, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 6, "p2 up" }, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 7, "p2 down" }, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 4, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 5, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 3, "p2 fire 1" }, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 2, "p2 fire 2" }, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, -}; - -STDINPUTINFO(Saturn) - static struct BurnDIPInfo SaturnDIPList[]= { {0x11, 0xff, 0xff, 0x00, NULL }, @@ -165,66 +191,39 @@ static struct BurnDIPInfo SaturnDIPList[]= STDDIPINFO(Saturn) -static struct BurnInputInfo GrasspinInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 1, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 6, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 7, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 4, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 5, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 3, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 2, "p1 fire 2"}, - - {"P2 Coin", BIT_DIGITAL, DrvJoy2 + 0, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 1, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 6, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 7, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 4, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 5, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 3, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 2, "p2 fire 2"}, - - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, -}; - -STDINPUTINFO(Grasspin) - - static struct BurnDIPInfo GrasspinDIPList[]= { - {0x11, 0xff, 0xff, 0x61, NULL }, - {0x12, 0xff, 0xff, 0x83, NULL }, + {0x11, 0xff, 0xff, 0x61, NULL }, + {0x12, 0xff, 0xff, 0x83, NULL }, {0 , 0xfe, 0 , 4, "Coinage" }, - {0x11, 0x01, 0x60, 0x00, "2 Coins 1 Credits" }, - {0x11, 0x01, 0x60, 0x40, "2 Coins 3 Credits" }, - {0x11, 0x01, 0x60, 0x60, "1 Coin 1 Credits" }, - {0x11, 0x01, 0x60, 0x20, "1 Coin 2 Credits" }, + {0x11, 0x01, 0x60, 0x00, "2 Coins 1 Credits" }, + {0x11, 0x01, 0x60, 0x40, "2 Coins 3 Credits" }, + {0x11, 0x01, 0x60, 0x60, "1 Coin 1 Credits" }, + {0x11, 0x01, 0x60, 0x20, "1 Coin 2 Credits" }, {0 , 0xfe, 0 , 2, "Freeze" }, - {0x11, 0x01, 0x80, 0x00, "Off" }, - {0x11, 0x01, 0x80, 0x80, "On" }, + {0x11, 0x01, 0x80, 0x00, "Off" }, + {0x11, 0x01, 0x80, 0x80, "On" }, {0 , 0xfe, 0 , 4, "Lives" }, - {0x12, 0x01, 0x03, 0x00, "2" }, - {0x12, 0x01, 0x03, 0x03, "3" }, - {0x12, 0x01, 0x03, 0x02, "4" }, - {0x12, 0x01, 0x03, 0x01, "5" }, + {0x12, 0x01, 0x03, 0x00, "2" }, + {0x12, 0x01, 0x03, 0x03, "3" }, + {0x12, 0x01, 0x03, 0x02, "4" }, + {0x12, 0x01, 0x03, 0x01, "5" }, {0 , 0xfe, 0 , 2, "Cabinet" }, {0x12, 0x01, 0x20, 0x00, "Upright" }, {0x12, 0x01, 0x20, 0x20, "Cocktail" }, {0 , 0xfe, 0 , 2, "Freeze" }, - {0x12, 0x01, 0x40, 0x00, "Off" }, - {0x12, 0x01, 0x40, 0x40, "On" }, + {0x12, 0x01, 0x40, 0x00, "Off" }, + {0x12, 0x01, 0x40, 0x40, "On" }, }; STDDIPINFO(Grasspin) -void __fastcall blueprint_write(UINT16 address, UINT8 data) +static void __fastcall blueprint_write(UINT16 address, UINT8 data) { switch (address) { @@ -249,7 +248,7 @@ void __fastcall blueprint_write(UINT16 address, UINT8 data) } } -UINT8 __fastcall blueprint_read(UINT16 address) +static UINT8 __fastcall blueprint_read(UINT16 address) { switch (address) { @@ -268,7 +267,7 @@ UINT8 __fastcall blueprint_read(UINT16 address) return 0; } -void __fastcall blueprint_sound_write(UINT16 address, UINT8 data) +static void __fastcall blueprint_sound_write(UINT16 address, UINT8 data) { switch (address) { @@ -290,7 +289,7 @@ void __fastcall blueprint_sound_write(UINT16 address, UINT8 data) } } -UINT8 __fastcall blueprint_sound_read(UINT16 address) +static UINT8 __fastcall blueprint_sound_read(UINT16 address) { switch (address) { @@ -304,22 +303,22 @@ UINT8 __fastcall blueprint_sound_read(UINT16 address) return 0; } -UINT8 ay8910_0_read_port_1(UINT32) +static UINT8 ay8910_0_read_port_1(UINT32) { return *soundlatch; } -void ay8910_0_write_port_0(UINT32, UINT32 data) +static void ay8910_0_write_port_0(UINT32, UINT32 data) { *dipsw = data & 0xff; } -UINT8 ay8910_1_read_port_0(UINT32) +static UINT8 ay8910_1_read_port_0(UINT32) { return DrvDips[0]; } -UINT8 ay8910_1_read_port_1(UINT32) +static UINT8 ay8910_1_read_port_1(UINT32) { return DrvDips[1]; } @@ -400,13 +399,6 @@ static INT32 MemIndex() DrvPalette = (UINT32*)Next; Next += 0x0208 * sizeof(UINT32); - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[3] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[4] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[5] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - AllRam = Next; DrvColRAM = Next; Next += 0x000400; @@ -468,43 +460,29 @@ static INT32 DrvInit() ZetInit(0); ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM0); - ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM0); - ZetMapArea(0x8000, 0x87ff, 0, DrvZ80RAM0); - ZetMapArea(0x8000, 0x87ff, 1, DrvZ80RAM0); - ZetMapArea(0x8000, 0x87ff, 2, DrvZ80RAM0); - ZetMapArea(0x9000, 0x93ff, 0, DrvVidRAM); - ZetMapArea(0x9000, 0x93ff, 1, DrvVidRAM); - ZetMapArea(0x9000, 0x93ff, 2, DrvVidRAM); - ZetMapArea(0x9400, 0x97ff, 0, DrvVidRAM); - ZetMapArea(0x9400, 0x97ff, 1, DrvVidRAM); - ZetMapArea(0x9400, 0x97ff, 2, DrvVidRAM); - ZetMapArea(0xa000, 0xa0ff, 0, DrvScrollRAM); - ZetMapArea(0xa000, 0xa0ff, 1, DrvScrollRAM); - ZetMapArea(0xa000, 0xa0ff, 2, DrvScrollRAM); - ZetMapArea(0xb000, 0xb0ff, 0, DrvSprRAM); - ZetMapArea(0xb000, 0xb0ff, 1, DrvSprRAM); - ZetMapArea(0xb000, 0xb0ff, 2, DrvSprRAM); - ZetMapArea(0xf000, 0xf3ff, 0, DrvColRAM); - ZetMapArea(0xf000, 0xf3ff, 1, DrvColRAM); - ZetMapArea(0xf000, 0xf3ff, 2, DrvColRAM); + ZetMapMemory(DrvZ80ROM0, 0x0000, 0x7fff, MAP_ROM); + ZetMapMemory(DrvZ80RAM0, 0x8000, 0x87ff, MAP_RAM); + ZetMapMemory(DrvVidRAM, 0x9000, 0x93ff, MAP_RAM); + ZetMapMemory(DrvVidRAM, 0x9400, 0x97ff, MAP_RAM); // mirror + ZetMapMemory(DrvScrollRAM, 0xa000, 0xa0ff, MAP_RAM); + ZetMapMemory(DrvSprRAM, 0xb000, 0xb0ff, MAP_RAM); + ZetMapMemory(DrvColRAM, 0xf000, 0xf3ff, MAP_RAM); ZetSetWriteHandler(blueprint_write); ZetSetReadHandler(blueprint_read); ZetClose(); ZetInit(1); ZetOpen(1); - ZetMapArea(0x0000, 0x2fff, 0, DrvZ80ROM1); - ZetMapArea(0x0000, 0x2fff, 2, DrvZ80ROM1); - ZetMapArea(0x4000, 0x43ff, 0, DrvZ80RAM1); - ZetMapArea(0x4000, 0x43ff, 1, DrvZ80RAM1); - ZetMapArea(0x4000, 0x43ff, 2, DrvZ80RAM1); + ZetMapMemory(DrvZ80ROM1, 0x0000, 0x3fff, MAP_ROM); + ZetMapMemory(DrvZ80RAM1, 0x4000, 0x43ff, MAP_RAM); ZetSetWriteHandler(blueprint_sound_write); ZetSetReadHandler(blueprint_sound_read); ZetClose(); - AY8910Init(0, 1250000, nBurnSoundRate, NULL, &ay8910_0_read_port_1, &ay8910_0_write_port_0, NULL); - AY8910Init(1, 625000, nBurnSoundRate, &ay8910_1_read_port_0, &ay8910_1_read_port_1, NULL, NULL); + AY8910Init2(0, 1250000, 0); + AY8910Init2(1, 625000, 1); + AY8910SetPorts(0, NULL, &ay8910_0_read_port_1, &ay8910_0_write_port_0, NULL); + AY8910SetPorts(1, &ay8910_1_read_port_0, &ay8910_1_read_port_1, NULL, NULL); AY8910SetAllRoutes(0, 0.25, BURN_SND_ROUTE_BOTH); AY8910SetAllRoutes(1, 0.25, BURN_SND_ROUTE_BOTH); @@ -660,7 +638,7 @@ static INT32 DrvFrame() } if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); + AY8910Render2(pBurnSoundOut, nBurnSoundLen); } if (pBurnDraw) { diff --git a/src/burn/drv/pre90s/d_bogeyman.cpp b/src/burn/drv/pre90s/d_bogeyman.cpp index 34846efc6..d8607f235 100644 --- a/src/burn/drv/pre90s/d_bogeyman.cpp +++ b/src/burn/drv/pre90s/d_bogeyman.cpp @@ -26,8 +26,6 @@ static UINT8 *DrvSprRAM; static UINT32 *DrvPalette; static UINT8 DrvRecalc; -static INT16 *pAY8910Buffer[6]; - static UINT8 color_bank; static UINT8 flipscreen; static UINT8 ay8910_last; @@ -217,13 +215,6 @@ static INT32 MemIndex() RamEnd = Next; - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[3] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[4] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[5] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - MemEnd = Next; return 0; @@ -321,8 +312,9 @@ static INT32 DrvInit() M6502SetReadHandler(bogeyman_read); M6502Close(); - AY8910Init(0, 1500000, nBurnSoundRate, NULL, NULL, &color_bank_write, NULL); - AY8910Init(1, 1500000, nBurnSoundRate, NULL, NULL, NULL, NULL); + AY8910Init2(0, 1500000, 0); + AY8910Init2(1, 1500000, 1); + AY8910SetPorts(0, NULL, NULL, &color_bank_write, NULL); AY8910SetAllRoutes(0, 0.20, BURN_SND_ROUTE_BOTH); AY8910SetAllRoutes(1, 0.20, BURN_SND_ROUTE_BOTH); @@ -526,7 +518,7 @@ static INT32 DrvFrame() if (pBurnSoundOut) { INT32 nSegmentLength = nBurnSoundLen / nInterleave; INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); + AY8910Render2(pSoundBuf, nSegmentLength); nSoundBufferPos += nSegmentLength; } } @@ -537,7 +529,7 @@ static INT32 DrvFrame() INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); if (nSegmentLength) { - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); + AY8910Render2(pSoundBuf, nSegmentLength); } } diff --git a/src/burn/drv/pre90s/d_calorie.cpp b/src/burn/drv/pre90s/d_calorie.cpp index cd89603c0..6885a86d0 100644 --- a/src/burn/drv/pre90s/d_calorie.cpp +++ b/src/burn/drv/pre90s/d_calorie.cpp @@ -1,4 +1,5 @@ -// Zodiack emu-layer for FB Alpha by dink/iq_132, based on the MAME driver by David Haywood and Pierpaolo Prazzoli. +// Calorie Kun vs Moguranian emu-layer for FB Alpha by dink/iq_132 +// Based on the MAME driver by David Haywood and Pierpaolo Prazzoli. #include "tiles_generic.h" #include "driver.h" @@ -25,11 +26,10 @@ static UINT8 *DrvZ80RAM1; static UINT8 *DrvPalRAM; static UINT8 *DrvVidRAM; static UINT8 *DrvSprRAM; + static UINT32 *DrvPalette; static UINT8 DrvRecalc; -static INT16 *pAY8910Buffer[6]; - static UINT8 DrvJoy1[8]; static UINT8 DrvJoy2[8]; static UINT8 DrvJoy3[8]; @@ -44,27 +44,27 @@ static UINT8 *calorie_bg; static UINT8 UpdatePal; static struct BurnInputInfo CalorieInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 2, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy3 + 0, "p1 start"}, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, + {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 2, "p1 coin" }, + {"P1 Start", BIT_DIGITAL, DrvJoy3 + 0, "p1 start" }, + {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, + {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, + {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, + {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, + {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, + {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 3, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy3 + 1, "p2 start"}, - {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up"}, - {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down"}, - {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1"}, - {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2"}, + {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 3, "p2 coin" }, + {"P2 Start", BIT_DIGITAL, DrvJoy3 + 1, "p2 start" }, + {"P2 Up", BIT_DIGITAL, DrvJoy2 + 0, "p2 up" }, + {"P2 Down", BIT_DIGITAL, DrvJoy2 + 1, "p2 down" }, + {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left" }, + {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right" }, + {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, + {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" }, - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, - {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip"}, + {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, + {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, + {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, }; STDINPUTINFO(Calorie) @@ -72,62 +72,62 @@ STDINPUTINFO(Calorie) static struct BurnDIPInfo CalorieDIPList[]= { // Default Values - {0x11, 0xff, 0xff, 0x30, NULL }, - {0x12, 0xff, 0xff, 0x40, NULL }, + {0x11, 0xff, 0xff, 0x30, NULL }, + {0x12, 0xff, 0xff, 0x40, NULL }, - {0 , 0xfe, 0 , 4, "Coin A" }, + {0 , 0xfe, 0 , 4, "Coin A" }, {0x11, 0x01, 0x03, 0x00, "1 Coin 1 Credits " }, {0x11, 0x01, 0x03, 0x01, "1 Coin 2 Credits " }, {0x11, 0x01, 0x03, 0x02, "1 Coin 3 Credits " }, {0x11, 0x01, 0x03, 0x03, "1 Coin 6 Credits " }, - {0 , 0xfe, 0 , 4, "Coin B" }, + {0 , 0xfe, 0 , 4, "Coin B" }, {0x11, 0x01, 0x0c, 0x0c, "2 Coins 1 Credits " }, {0x11, 0x01, 0x0c, 0x00, "1 Coin 1 Credits " }, {0x11, 0x01, 0x0c, 0x04, "1 Coin 2 Credits " }, {0x11, 0x01, 0x0c, 0x08, "1 Coin 3 Credits " }, - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x11, 0x01, 0x10, 0x10, "Upright" }, - {0x11, 0x01, 0x10, 0x00, "Cocktail" }, + {0 , 0xfe, 0 , 2, "Cabinet" }, + {0x11, 0x01, 0x10, 0x10, "Upright" }, + {0x11, 0x01, 0x10, 0x00, "Cocktail" }, - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x11, 0x01, 0x20, 0x00, "Off" }, - {0x11, 0x01, 0x20, 0x20, "On" }, + {0 , 0xfe, 0 , 2, "Demo Sounds" }, + {0x11, 0x01, 0x20, 0x00, "Off" }, + {0x11, 0x01, 0x20, 0x20, "On" }, - {0 , 0xfe, 0 , 4, "Lives" }, - {0x11, 0x01, 0xc0, 0xc0, "2" }, - {0x11, 0x01, 0xc0, 0x00, "3" }, - {0x11, 0x01, 0xc0, 0x40, "4" }, - {0x11, 0x01, 0xc0, 0x80, "5" }, + {0 , 0xfe, 0 , 4, "Lives" }, + {0x11, 0x01, 0xc0, 0xc0, "2" }, + {0x11, 0x01, 0xc0, 0x00, "3" }, + {0x11, 0x01, 0xc0, 0x40, "4" }, + {0x11, 0x01, 0xc0, 0x80, "5" }, - {0 , 0xfe, 0 , 3, "Bonus Life" }, - {0x12, 0x01, 0x03, 0x00, "None" }, - {0x12, 0x01, 0x03, 0x01, "20,000 Only" }, + {0 , 0xfe, 0 , 3, "Bonus Life" }, + {0x12, 0x01, 0x03, 0x00, "None" }, + {0x12, 0x01, 0x03, 0x01, "20,000 Only" }, {0x12, 0x01, 0x03, 0x03, "20,000 and 60,000" }, {0 , 0xfe, 0 , 2, "Number of Bombs" }, - {0x12, 0x01, 0x04, 0x00, "3" }, - {0x12, 0x01, 0x04, 0x04, "5" }, + {0x12, 0x01, 0x04, 0x00, "3" }, + {0x12, 0x01, 0x04, 0x04, "5" }, - {0 , 0xfe, 0 , 2, "Difficulty - Mogura Nian" }, - {0x12, 0x01, 0x08, 0x00, "Normal" }, - {0x12, 0x01, 0x08, 0x08, "Hard" }, + {0 , 0xfe, 0 , 2, "Difficulty - Mogura Nian" }, + {0x12, 0x01, 0x08, 0x00, "Normal" }, + {0x12, 0x01, 0x08, 0x08, "Hard" }, - {0 , 0xfe, 0 , 4, "Difficulty - Select of Mogura" }, - {0x12, 0x01, 0x30, 0x00, "Easy" }, - {0x12, 0x01, 0x30, 0x20, "Normal" }, - {0x12, 0x01, 0x30, 0x10, "Hard" }, - {0x12, 0x01, 0x30, 0x30, "Hardest" }, + {0 , 0xfe, 0 , 4, "Difficulty - Select of Mogura"}, + {0x12, 0x01, 0x30, 0x00, "Easy" }, + {0x12, 0x01, 0x30, 0x20, "Normal" }, + {0x12, 0x01, 0x30, 0x10, "Hard" }, + {0x12, 0x01, 0x30, 0x30, "Hardest" }, {0 , 0xfe, 0 , 0, "Infinite Lives" }, - {0x12, 0x01, 0x80, 0x00, "Off" }, - {0x12, 0x01, 0x80, 0x80, "On" }, + {0x12, 0x01, 0x80, 0x00, "Off" }, + {0x12, 0x01, 0x80, 0x80, "On" }, }; STDDIPINFO(Calorie) -void __fastcall calorie_write(UINT16 address, UINT8 data) +static void __fastcall calorie_write(UINT16 address, UINT8 data) { if ((address & 0xff00) == 0xdc00) { DrvPalRAM[address & 0x0ff] = data; @@ -151,7 +151,7 @@ void __fastcall calorie_write(UINT16 address, UINT8 data) } } -UINT8 __fastcall calorie_read(UINT16 address) +static UINT8 __fastcall calorie_read(UINT16 address) { switch (address) { @@ -174,7 +174,7 @@ UINT8 __fastcall calorie_read(UINT16 address) return 0; } -UINT8 __fastcall calorie_sound_read(UINT16 address) +static UINT8 __fastcall calorie_sound_read(UINT16 address) { switch (address) { @@ -187,7 +187,7 @@ UINT8 __fastcall calorie_sound_read(UINT16 address) return 0; } -UINT8 __fastcall calorie_sound_in(UINT16 port) +static UINT8 __fastcall calorie_sound_in(UINT16 port) { switch (port & 0xff) { @@ -201,17 +201,16 @@ UINT8 __fastcall calorie_sound_in(UINT16 port) return 0; } -void __fastcall calorie_sound_out(UINT16 port, UINT8 data) +static void __fastcall calorie_sound_out(UINT16 port, UINT8 data) { - port &= 0xff; - switch (port) + switch (port & 0xff) { case 0x00: case 0x01: case 0x10: case 0x11: - AY8910Write(port >> 4, port & 1, data); - return; + AY8910Write((port >> 4) & 1, port & 1, data); + return; } } @@ -249,13 +248,6 @@ static INT32 MemIndex() DrvPalette = (UINT32*)Next; Next += 0x0200 * sizeof(INT32); - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[3] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[4] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[5] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - AllRam = Next; DrvSprRAM = Next; Next += 0x000400; @@ -281,14 +273,8 @@ static INT32 DrvGfxDecode() INT32 Plane[3] = { RGN_FRAC(0xc000, 0, 3), RGN_FRAC(0xc000, 1, 3), RGN_FRAC(0xc000, 2, 3) }; INT32 Plane6000[3] = { RGN_FRAC(0x6000, 0, 3), RGN_FRAC(0x6000, 1, 3), RGN_FRAC(0x6000, 2, 3) }; - INT32 XOffs[32] = { 0, 1, 2, 3, 4, 5, 6, 7, - 8*8+0, 8*8+1, 8*8+2, 8*8+3, 8*8+4, 8*8+5, 8*8+6, 8*8+7, - 32*8+0, 32*8+1, 32*8+2, 32*8+3, 32*8+4, 32*8+5, 32*8+6, 32*8+7, - 40*8+0, 40*8+1, 40*8+2, 40*8+3, 40*8+4, 40*8+5, 40*8+6, 40*8+7 }; - INT32 YOffs[32] = { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, - 16*8, 17*8, 18*8, 19*8, 20*8, 21*8, 22*8, 23*8, - 64*8, 65*8, 66*8, 67*8, 68*8, 69*8, 70*8, 71*8, - 80*8, 81*8, 82*8, 83*8, 84*8, 85*8, 86*8, 87*8 }; + INT32 XOffs[32] = { STEP8(0,1), STEP8(64,1), STEP8(256,1), STEP8(256+64, 1) }; + INT32 YOffs[32] = { STEP8(0,8), STEP8(128,8), STEP8(512,8), STEP8(640,8) }; UINT8 *tmp = (UINT8*)BurnMalloc(0xc000); if (tmp == NULL) { @@ -352,38 +338,27 @@ static INT32 DrvInit(void (*pInitCallback)()) ZetInit(0); ZetOpen(0); - ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM0); - ZetMapArea(0x0000, 0x7fff, 2, DrvDecROM0, DrvZ80ROM0); - ZetMapArea(0x8000, 0xbfff, 0, DrvZ80ROM0 + 0x8000); - ZetMapArea(0x8000, 0xbfff, 2, DrvZ80ROM0 + 0x8000); - ZetMapArea(0xc000, 0xcfff, 0, DrvZ80RAM0); - ZetMapArea(0xc000, 0xcfff, 1, DrvZ80RAM0); - ZetMapArea(0xc000, 0xcfff, 2, DrvZ80RAM0); - ZetMapArea(0xd000, 0xd7ff, 0, DrvVidRAM); - ZetMapArea(0xd000, 0xd7ff, 1, DrvVidRAM); - ZetMapArea(0xd000, 0xd7ff, 2, DrvVidRAM); - ZetMapArea(0xd800, 0xdbff, 0, DrvSprRAM); - ZetMapArea(0xd800, 0xdbff, 1, DrvSprRAM); - ZetMapArea(0xd800, 0xdbff, 2, DrvSprRAM); + ZetMapMemory(DrvZ80ROM0, 0x0000, 0xbfff, MAP_ROM); + ZetMapMemory(DrvDecROM0, 0x0000, 0x7fff, MAP_FETCHOP); // ? + ZetMapMemory(DrvZ80RAM0, 0xc000, 0xcfff, MAP_RAM); + ZetMapMemory(DrvVidRAM, 0xd000, 0xd7ff, MAP_RAM); + ZetMapMemory(DrvSprRAM, 0xd800, 0xdbff, MAP_RAM); ZetSetWriteHandler(calorie_write); ZetSetReadHandler(calorie_read); ZetClose(); ZetInit(1); ZetOpen(1); - ZetMapArea(0x0000, 0x3fff, 0, DrvZ80ROM1); - ZetMapArea(0x0000, 0x3fff, 2, DrvZ80ROM1); - ZetMapArea(0x8000, 0x87ff, 0, DrvZ80RAM1); - ZetMapArea(0x8000, 0x87ff, 1, DrvZ80RAM1); - ZetMapArea(0x8000, 0x87ff, 2, DrvZ80RAM1); + ZetMapMemory(DrvZ80ROM1, 0x0000, 0x3fff, MAP_ROM); + ZetMapMemory(DrvZ80RAM1, 0x8000, 0x87ff, MAP_RAM); ZetSetReadHandler(calorie_sound_read); ZetSetOutHandler(calorie_sound_out); ZetSetInHandler(calorie_sound_in); ZetClose(); - AY8910Init(0, 1500000, nBurnSoundRate, NULL, NULL, NULL, NULL); + AY8910Init2(0, 1500000, 0); + AY8910Init2(1, 1500000, 1); AY8910SetAllRoutes(0, 0.20, BURN_SND_ROUTE_BOTH); - AY8910Init(1, 1500000, nBurnSoundRate, NULL, NULL, NULL, NULL); AY8910SetAllRoutes(1, 0.20, BURN_SND_ROUTE_BOTH); GenericTilesInit(); @@ -603,7 +578,7 @@ static INT32 DrvFrame() if (pBurnSoundOut) { INT32 nSegmentLength = nBurnSoundLen / nInterleave; INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); + AY8910Render2(pSoundBuf, nSegmentLength); nSoundBufferPos += nSegmentLength; } } @@ -612,7 +587,7 @@ static INT32 DrvFrame() INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); if (nSegmentLength) { - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); + AY8910Render2(pSoundBuf, nSegmentLength); } } diff --git a/src/burn/drv/pre90s/d_cclimber.cpp b/src/burn/drv/pre90s/d_cclimber.cpp index b779b7054..7098dde12 100644 --- a/src/burn/drv/pre90s/d_cclimber.cpp +++ b/src/burn/drv/pre90s/d_cclimber.cpp @@ -32,9 +32,9 @@ static UINT8 *DrvBGSprRAM; static UINT8 *DrvSprRAM; static UINT8 *DrvVidRAM; static UINT8 *DrvColRAM; + static UINT32 *DrvPalette; static UINT8 DrvRecalc; -static INT16 *pAY8910Buffer[6]; static INT32 DrvGfxROM0Len; static INT32 DrvGfxROM1Len; @@ -717,19 +717,12 @@ static INT32 MemIndex() DrvPalette = (UINT32*)Next; Next += 0x0200 * sizeof(UINT32); - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[3] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[4] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[5] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - AllRam = Next; DrvZ80RAM0 = Next; Next += 0x0000c00; DrvZ80RAM1 = Next; Next += 0x0000800; DrvZ80RAM2 = Next; Next += 0x0000800; - DrvZ80RAM1_0 = Next; Next += 0x0001000; + DrvZ80RAM1_0 = Next; Next += 0x0001000; DrvBGSprRAM = Next; Next += 0x0000100; DrvSprRAM = Next; Next += 0x0000400; DrvColRAM = Next; Next += 0x0000400; @@ -745,10 +738,8 @@ static INT32 DrvGfxDecode(UINT8 *gfx_base, UINT8 *gfx_dest, INT32 len, INT32 siz { INT32 Plane[2] = { 0, (len / 2) * 8 }; INT32 PlaneSwimmer[3] = { 0, RGN_FRAC(len, 1, 3), RGN_FRAC(len, 2, 3) }; - INT32 XOffs[16] = { 0, 1, 2, 3, 4, 5, 6, 7, - 8*8+0, 8*8+1, 8*8+2, 8*8+3, 8*8+4, 8*8+5, 8*8+6, 8*8+7 }; - INT32 YOffs[16] = { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, - 16*8, 17*8, 18*8, 19*8, 20*8, 21*8, 22*8, 23*8 }; + INT32 XOffs[16] = { STEP8(0,1), STEP8(64,1) }; + INT32 YOffs[16] = { STEP8(0,8), STEP8(128,8) }; UINT8 *tmp = (UINT8*)BurnMalloc(len); if (tmp == NULL) { @@ -958,7 +949,6 @@ static void SwimmerPaletteInit() swimmer_set_background_pen(); } - static void cclimber_decode(const INT8 convtable[8][16]) { UINT8 *rom = DrvZ80ROM; @@ -1131,9 +1121,10 @@ static INT32 DrvInit() ZetClose(); } - AY8910Init(0, (game_select == 6) ? 2000000 : 1536000, nBurnSoundRate, NULL, NULL, &cclimber_sample_select_w, NULL); + AY8910Init2(0, (game_select == 6) ? 2000000 : 1536000, 0); + AY8910SetPorts(0, NULL, NULL, &cclimber_sample_select_w, NULL); AY8910SetAllRoutes(0, 0.15, BURN_SND_ROUTE_BOTH); - AY8910Init(1, (game_select == 6) ? 2000000 : 1536000, nBurnSoundRate, NULL, NULL, NULL, NULL); + AY8910Init2(1, (game_select == 6) ? 2000000 : 1536000, 1); AY8910SetAllRoutes(1, 0.15, BURN_SND_ROUTE_BOTH); GenericTilesInit(); @@ -1469,7 +1460,7 @@ static INT32 DrvFrame() } if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); + AY8910Render2(pBurnSoundOut, nBurnSoundLen); } if (pBurnDraw) { diff --git a/src/burn/drv/pre90s/d_dacholer.cpp b/src/burn/drv/pre90s/d_dacholer.cpp index a1c763d3b..f07bd635c 100644 --- a/src/burn/drv/pre90s/d_dacholer.cpp +++ b/src/burn/drv/pre90s/d_dacholer.cpp @@ -29,8 +29,6 @@ static UINT8 *DrvSprRAM; static UINT32 *DrvPalette; static UINT8 DrvRecalc; -static INT16 *pAY8910Buffer[9]; - static UINT8 bgbank; static UINT8 flipscreen; static UINT8 soundlatch; @@ -444,16 +442,6 @@ static INT32 MemIndex() RamEnd = Next; - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[3] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[4] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[5] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[6] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[7] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[8] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - MemEnd = Next; return 0; @@ -608,9 +596,9 @@ static INT32 DrvInit(INT32 type) ZetSetInHandler(dacholer_sound_read_port); ZetClose(); - AY8910Init(0, 1248000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910Init(1, 1248000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910Init(2, 1248000, nBurnSoundRate, NULL, NULL, NULL, NULL); + AY8910Init2(0, 1248000, 0); + AY8910Init2(1, 1248000, 1); + AY8910Init2(2, 1248000, 1); AY8910SetAllRoutes(0, 0.10, BURN_SND_ROUTE_BOTH); AY8910SetAllRoutes(1, 0.10, BURN_SND_ROUTE_BOTH); AY8910SetAllRoutes(2, 0.10, BURN_SND_ROUTE_BOTH); @@ -805,7 +793,7 @@ static INT32 DrvFrame() if (pBurnSoundOut) { INT32 nSegmentLength = nBurnSoundLen / nInterleave; INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); + AY8910Render2(pSoundBuf, nSegmentLength); nSoundBufferPos += nSegmentLength; } @@ -816,7 +804,7 @@ static INT32 DrvFrame() INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); if (nSegmentLength) { - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); + AY8910Render2(pSoundBuf, nSegmentLength); } MSM5205Render(0, pBurnSoundOut, nBurnSoundLen); } diff --git a/src/burn/drv/pre90s/d_dogfgt.cpp b/src/burn/drv/pre90s/d_dogfgt.cpp index 172dddb30..d5c1120cb 100644 --- a/src/burn/drv/pre90s/d_dogfgt.cpp +++ b/src/burn/drv/pre90s/d_dogfgt.cpp @@ -26,8 +26,6 @@ static UINT8 *DrvM6502RAM1; static UINT32 *DrvPalette; static UINT8 DrvRecalc; -static INT16 *pAY8910Buffer[6]; - static UINT8 bankdata; static UINT8 flipscreen; static UINT8 pixelcolor; @@ -203,12 +201,13 @@ static UINT8 dogfgt_main_read(UINT16 address) return 0; } -static void dogfgt_sub_write(UINT16 address, UINT8 data) +static void dogfgt_sub_write(UINT16 address, UINT8 /*data*/) { switch (address) { case 0x4000: M6502SetIRQLine(0, CPU_IRQSTATUS_NONE); + return; } } @@ -246,8 +245,8 @@ static INT32 MemIndex() { UINT8 *Next; Next = AllMem; - DrvM6502ROM0 = Next; Next += 0x008000; - DrvM6502ROM1 = Next; Next += 0x008000; + DrvM6502ROM0 = Next; Next += 0x008000; + DrvM6502ROM1 = Next; Next += 0x008000; DrvGfxROM0 = Next; Next += 0x010000; DrvGfxROM1 = Next; Next += 0x030000; @@ -263,17 +262,10 @@ static INT32 MemIndex() DrvSprRAM = Next; Next += 0x000100; DrvBMPRAM = Next; Next += 0x008000; DrvShareRAM = Next; Next += 0x000800; - DrvM6502RAM1 = Next; Next += 0x000800; + DrvM6502RAM1 = Next; Next += 0x000800; RamEnd = Next; - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[3] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[4] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[5] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - MemEnd = Next; return 0; @@ -363,8 +355,8 @@ static INT32 DrvInit() M6502SetWriteHandler(dogfgt_sub_write); M6502Close(); - AY8910Init(0, 1500000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910Init(1, 1500000, nBurnSoundRate, NULL, NULL, NULL, NULL); + AY8910Init2(0, 1500000, 0); + AY8910Init2(1, 1500000, 1); AY8910SetAllRoutes(0, 0.30, BURN_SND_ROUTE_BOTH); AY8910SetAllRoutes(1, 0.30, BURN_SND_ROUTE_BOTH); @@ -561,7 +553,7 @@ static INT32 DrvFrame() } if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); + AY8910Render2(pBurnSoundOut, nBurnSoundLen); } if (pBurnDraw) { diff --git a/src/burn/drv/pre90s/d_epos.cpp b/src/burn/drv/pre90s/d_epos.cpp index 8ea1cdec1..67334a2dc 100644 --- a/src/burn/drv/pre90s/d_epos.cpp +++ b/src/burn/drv/pre90s/d_epos.cpp @@ -21,8 +21,6 @@ static UINT8 *DrvVidRAM; static UINT32 *DrvPalette; -static INT16* pAY8910Buffer[3]; - static UINT8 DrvRecalc; static UINT8 DrvJoy1[8]; @@ -307,7 +305,7 @@ static struct BurnDIPInfo Revngr84DIPList[]= STDDIPINFO(Revngr84) -UINT8 __fastcall epos_read_port(UINT16 port) +static UINT8 __fastcall epos_read_port(UINT16 port) { switch (port & 0xff) { @@ -327,7 +325,7 @@ UINT8 __fastcall epos_read_port(UINT16 port) return 0; } -void __fastcall epos_write_port(UINT16 port, UINT8 data) +static void __fastcall epos_write_port(UINT16 port, UINT8 data) { switch (port & 0xff) { @@ -379,7 +377,7 @@ static void dealer_bankswitch2(INT32 data) ZetMapArea(0x6000, 0x6fff, 2, DrvZ80ROM + nBank); } -UINT8 __fastcall dealer_read_port(UINT16 port) +static UINT8 __fastcall dealer_read_port(UINT16 port) { switch (port & 0xff) { @@ -398,7 +396,7 @@ UINT8 __fastcall dealer_read_port(UINT16 port) static void set_pal(UINT8 offs, UINT8 value); -void __fastcall dealer_write_port(UINT16 port, UINT8 data) +static void __fastcall dealer_write_port(UINT16 port, UINT8 data) { port &= 0xff; @@ -437,7 +435,7 @@ void __fastcall dealer_write_port(UINT16 port, UINT8 data) } } -UINT8 DealerPPIReadA() +static UINT8 DealerPPIReadA() { if (!(*DealerInputMultiplex & 1)) return DrvInputs[1]; @@ -448,7 +446,7 @@ UINT8 DealerPPIReadA() return 0xff; } -void DealerPPIWriteC(UINT8 data) +static void DealerPPIWriteC(UINT8 data) { dealer_bankswitch2(data); *DealerInputMultiplex = (data >> 5) & 3; @@ -524,28 +522,24 @@ static INT32 MemIndex() { UINT8 *Next; Next = AllMem; - DrvZ80ROM = Next; Next += 0x040000; + DrvZ80ROM = Next; Next += 0x040000; - DrvColPROM = Next; Next += 0x000020; + DrvColPROM = Next; Next += 0x000020; - DrvPalette = (UINT32*)Next; Next += 0x0020 * sizeof(UINT32); + DrvPalette = (UINT32*)Next; Next += 0x0020 * sizeof(UINT32); - pAY8910Buffer[0] = (INT16 *)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16 *)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16 *)Next; Next += nBurnSoundLen * sizeof(INT16); + AllRam = Next; - AllRam = Next; + DrvZ80RAM = Next; Next += 0x001000; + DrvVidRAM = Next; Next += 0x008000; - DrvZ80RAM = Next; Next += 0x001000; - DrvVidRAM = Next; Next += 0x008000; + DrvPaletteBank = Next; Next += 0x000001; + DealerZ80Bank = Next; Next += 0x000001; + DealerZ80Bank2 = Next; Next += 0x000001; + DealerInputMultiplex = Next; Next += 0x000001; - DrvPaletteBank = Next; Next += 0x000001; - DealerZ80Bank = Next; Next += 0x000001; - DealerZ80Bank2 = Next; Next += 0x000001; - DealerInputMultiplex = Next; Next += 0x000001; - - RamEnd = Next; - MemEnd = Next; + RamEnd = Next; + MemEnd = Next; return 0; } @@ -575,19 +569,14 @@ static INT32 DrvInit() ZetInit(0); ZetOpen(0); - ZetMapArea(0x0000, 0x77ff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x77ff, 2, DrvZ80ROM); - ZetMapArea(0x7800, 0x7fff, 0, DrvZ80RAM); - ZetMapArea(0x7800, 0x7fff, 1, DrvZ80RAM); - ZetMapArea(0x7800, 0x7fff, 2, DrvZ80RAM); - ZetMapArea(0x8000, 0xffff, 0, DrvVidRAM); - ZetMapArea(0x8000, 0xffff, 1, DrvVidRAM); - ZetMapArea(0x8000, 0xffff, 2, DrvVidRAM); + ZetMapMemory(DrvZ80ROM, 0x0000, 0x77ff, MAP_ROM); + ZetMapMemory(DrvZ80RAM, 0x7800, 0x7fff, MAP_RAM); + ZetMapMemory(DrvVidRAM, 0x8000, 0xffff, MAP_RAM); ZetSetInHandler(epos_read_port); ZetSetOutHandler(epos_write_port); ZetClose(); - AY8910Init(0, 2750000, nBurnSoundRate, NULL, NULL, NULL, NULL); + AY8910Init2(0, 2750000, 0); AY8910SetAllRoutes(0, 0.35, BURN_SND_ROUTE_BOTH); GenericTilesInit(); @@ -632,7 +621,8 @@ static INT32 DealerInit() ZetSetOutHandler(dealer_write_port); ZetClose(); - AY8910Init(0, 2750000, nBurnSoundRate, AY8910_0_portA, NULL, NULL, NULL); + AY8910Init2(0, 2750000, 0); + AY8910SetPorts(0, AY8910_0_portA, NULL, NULL, NULL); AY8910SetAllRoutes(0, 0.25, BURN_SND_ROUTE_BOTH); ppi8255_init(1); @@ -717,7 +707,7 @@ static INT32 DrvFrame() ZetClose(); if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); + AY8910Render2(pBurnSoundOut, nBurnSoundLen); } if (pBurnDraw) { diff --git a/src/burn/drv/pre90s/d_exedexes.cpp b/src/burn/drv/pre90s/d_exedexes.cpp index f1ae90a75..d2d3902b8 100644 --- a/src/burn/drv/pre90s/d_exedexes.cpp +++ b/src/burn/drv/pre90s/d_exedexes.cpp @@ -32,8 +32,6 @@ static UINT8 *DrvTransTable; static UINT32 *DrvPalette; static UINT8 DrvRecalc; -static INT16 *pAY8910Buffer[3]; - static UINT8 soundlatch; static UINT8 txt_enable; static UINT8 bg_enable; @@ -326,10 +324,6 @@ static INT32 MemIndex() RamEnd = Next; - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - MemEnd = Next; return 0; @@ -428,14 +422,14 @@ static INT32 DrvInit() ZetSetReadHandler(exedexes_sound_read); ZetClose(); - AY8910Init(0, 1500000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910SetAllRoutes(0, 0.10, BURN_SND_ROUTE_BOTH); - SN76489Init(0, 3000000, 0); SN76489Init(1, 3000000, 1); SN76496SetRoute(0, 0.36, BURN_SND_ROUTE_BOTH); SN76496SetRoute(1, 0.36, BURN_SND_ROUTE_BOTH); + AY8910Init2(0, 1500000, 1); + AY8910SetAllRoutes(0, 0.10, BURN_SND_ROUTE_BOTH); + GenericTilesInit(); GenericTilemapInit(0, background_map_scan, background_map_callback, 32, 32, 64, 64); GenericTilemapInit(1, foreground_map_scan, foreground_map_callback, 16, 16, 128, 128); @@ -609,7 +603,7 @@ static INT32 DrvFrame() SN76496Update(0, pBurnSoundOut, nBurnSoundLen); SN76496Update(1, pBurnSoundOut, nBurnSoundLen); - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 1); + AY8910Render2(pBurnSoundOut, nBurnSoundLen); } if (pBurnDraw) { diff --git a/src/burn/drv/pre90s/d_funkybee.cpp b/src/burn/drv/pre90s/d_funkybee.cpp index 81a89735d..89b5b9164 100644 --- a/src/burn/drv/pre90s/d_funkybee.cpp +++ b/src/burn/drv/pre90s/d_funkybee.cpp @@ -23,8 +23,6 @@ static UINT8 *DrvColRAM; static UINT32 *DrvPalette; static UINT8 DrvRecalc; -static INT16 *pAY8910Buffer[3]; - static UINT8 *scroll; static UINT8 *flipscreen; static UINT8 *gfx_bank; @@ -370,10 +368,6 @@ static INT32 MemIndex() RamEnd = Next; - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - MemEnd = Next; return 0; @@ -416,24 +410,18 @@ static INT32 DrvInit(INT32 game) ZetInit(0); ZetOpen(0); - ZetMapArea(0x0000, 0x4fff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0x4fff, 2, DrvZ80ROM); - ZetMapArea(0x8000, 0x87ff, 0, DrvZ80RAM); - ZetMapArea(0x8000, 0x87ff, 1, DrvZ80RAM); - ZetMapArea(0x8000, 0x87ff, 2, DrvZ80RAM); - ZetMapArea(0xa000, 0xbfff, 0, DrvVidRAM); - ZetMapArea(0xa000, 0xbfff, 1, DrvVidRAM); - ZetMapArea(0xa000, 0xbfff, 2, DrvVidRAM); - ZetMapArea(0xc000, 0xdfff, 0, DrvColRAM); - ZetMapArea(0xc000, 0xdfff, 1, DrvColRAM); - ZetMapArea(0xc000, 0xdfff, 2, DrvColRAM); + ZetMapMemory(DrvZ80ROM, 0x0000, 0x4fff, MAP_ROM); + ZetMapMemory(DrvZ80RAM, 0x8000, 0x87ff, MAP_RAM); + ZetMapMemory(DrvVidRAM, 0xa000, 0xbfff, MAP_RAM); + ZetMapMemory(DrvColRAM, 0xc000, 0xdfff, MAP_RAM); ZetSetWriteHandler(funkybee_write); ZetSetReadHandler(funkybee_read); ZetSetOutHandler(funkybee_out_port); ZetSetInHandler(funkybee_in_port); ZetClose(); - AY8910Init(0, 1500000, nBurnSoundRate, &funkybee_ay8910_read_A, NULL, NULL, NULL); + AY8910Init2(0, 1500000, 0); + AY8910SetPorts(0, &funkybee_ay8910_read_A, NULL, NULL, NULL); AY8910SetAllRoutes(0, 0.50, BURN_SND_ROUTE_BOTH); GenericTilesInit(); @@ -575,7 +563,7 @@ static INT32 DrvFrame() ZetClose(); if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); + AY8910Render2(pBurnSoundOut, nBurnSoundLen); } if (pBurnDraw) { diff --git a/src/burn/drv/pre90s/d_jack.cpp b/src/burn/drv/pre90s/d_jack.cpp index b5a14b6fe..7f04394c4 100644 --- a/src/burn/drv/pre90s/d_jack.cpp +++ b/src/burn/drv/pre90s/d_jack.cpp @@ -31,8 +31,6 @@ static UINT8 *DrvScroll; static UINT32 *DrvPalette; static UINT8 DrvRecalc; -static INT16 *pAY8910Buffer[3]; - static UINT8 soundlatch; static UINT8 flipscreen; static UINT8 palette_bank; @@ -963,10 +961,6 @@ static INT32 MemIndex() RamEnd = Next; - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - MemEnd = Next; return 0; @@ -1107,7 +1101,8 @@ static INT32 DrvInit(INT32 map_type, INT32 timerrate, INT32 alt_volume) ZetSetInHandler(jack_sound_read_port); ZetClose(); - AY8910Init(0, 1500000, nBurnSoundRate, &AY8910_portA, &AY8910_portB, NULL, NULL); + AY8910Init2(0, 1500000, 0); + AY8910SetPorts(0, &AY8910_portA, &AY8910_portB, NULL, NULL); AY8910SetAllRoutes(0, (alt_volume) ? 0.20 : 1.00, BURN_SND_ROUTE_BOTH); GenericTilesInit(); @@ -1304,7 +1299,7 @@ static INT32 DrvFrame() if (pBurnSoundOut && (i%8) == 7) { INT32 nSegmentLength = nBurnSoundLen / (nInterleave / 8); INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); + AY8910Render2(pSoundBuf, nSegmentLength); nSoundBufferPos += nSegmentLength; } } @@ -1313,7 +1308,7 @@ static INT32 DrvFrame() INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); if (nSegmentLength) { - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); + AY8910Render2(pSoundBuf, nSegmentLength); } } @@ -1370,7 +1365,7 @@ static INT32 JoinemFrame() if (pBurnSoundOut && (i%8) == 7) { INT32 nSegmentLength = nBurnSoundLen / (nInterleave / 8); INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); + AY8910Render2(pSoundBuf, nSegmentLength); nSoundBufferPos += nSegmentLength; } } @@ -1379,7 +1374,7 @@ static INT32 JoinemFrame() INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); if (nSegmentLength) { - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); + AY8910Render2(pSoundBuf, nSegmentLength); } } diff --git a/src/burn/drv/pre90s/d_kncljoe.cpp b/src/burn/drv/pre90s/d_kncljoe.cpp index 863bf1788..8c539f477 100644 --- a/src/burn/drv/pre90s/d_kncljoe.cpp +++ b/src/burn/drv/pre90s/d_kncljoe.cpp @@ -27,8 +27,6 @@ static UINT8 *DrvM6803RAM; static UINT32 *DrvPalette; static UINT8 DrvRecalc; -static INT16 *pAY8910Buffer[3]; - static UINT8 *soundlatch; static UINT8 *flipscreen; static UINT8 *sprite_bank; @@ -384,10 +382,6 @@ static INT32 MemIndex() RamEnd = Next; - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - MemEnd = Next; return 0; @@ -434,17 +428,10 @@ static INT32 DrvInit() ZetInit(0); ZetOpen(0); - ZetMapArea(0x0000, 0xbfff, 0, DrvZ80ROM); - ZetMapArea(0x0000, 0xbfff, 2, DrvZ80ROM); - ZetMapArea(0xc000, 0xcfff, 0, DrvVidRAM); - ZetMapArea(0xc000, 0xcfff, 1, DrvVidRAM); - ZetMapArea(0xc000, 0xcfff, 2, DrvVidRAM); - ZetMapArea(0xe800, 0xefff, 0, DrvSprRAM); - ZetMapArea(0xe800, 0xefff, 1, DrvSprRAM); - ZetMapArea(0xe800, 0xefff, 2, DrvSprRAM); - ZetMapArea(0xf000, 0xffff, 0, DrvZ80RAM); - ZetMapArea(0xf000, 0xffff, 1, DrvZ80RAM); - ZetMapArea(0xf000, 0xffff, 2, DrvZ80RAM); + ZetMapMemory(DrvZ80ROM, 0x0000, 0xbfff, MAP_ROM); + ZetMapMemory(DrvVidRAM, 0xc000, 0xcfff, MAP_RAM); + ZetMapMemory(DrvSprRAM, 0xe800, 0xefff, MAP_RAM); + ZetMapMemory(DrvZ80RAM, 0xf000, 0xffff, MAP_RAM); ZetSetWriteHandler(kncljoe_main_write); ZetSetReadHandler(kncljoe_main_read); ZetClose(); @@ -459,7 +446,8 @@ static INT32 DrvInit() M6803SetReadPortHandler(kncljoe_sound_read_port); // M6803Close(); - AY8910Init(0, 894886, nBurnSoundRate, &ay8910_port_A_read, NULL, NULL, NULL); + AY8910Init2(0, 894886, 0); + AY8910SetPorts(0, &ay8910_port_A_read, NULL, NULL, NULL); AY8910SetAllRoutes(0, 0.30, BURN_SND_ROUTE_BOTH); SN76489Init(0, 3579545, 1); @@ -645,7 +633,7 @@ static INT32 DrvFrame() ZetClose(); if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); + AY8910Render2(pBurnSoundOut, nBurnSoundLen); SN76496Update(0, pBurnSoundOut, nBurnSoundLen); SN76496Update(1, pBurnSoundOut, nBurnSoundLen); } diff --git a/src/burn/drv/pre90s/d_kyugo.cpp b/src/burn/drv/pre90s/d_kyugo.cpp index 055a64a40..33109dfcb 100644 --- a/src/burn/drv/pre90s/d_kyugo.cpp +++ b/src/burn/drv/pre90s/d_kyugo.cpp @@ -3,7 +3,6 @@ #include "tiles_generic.h" #include "z80_intf.h" - #include "driver.h" extern "C" { #include "ay8910.h" @@ -39,7 +38,6 @@ static UINT8 *KyugoSprites = NULL; static UINT8 *KyugoTempRom = NULL; static UINT32 *KyugoPalette = NULL; static INT16* pFMBuffer; -static INT16* pAY8910Buffer[6]; static UINT8 KyugoIRQEnable; static UINT8 KyugoSubCPUEnable; @@ -1250,7 +1248,7 @@ static INT32 KyugoDoReset() return 0; } -UINT8 __fastcall KyugoRead1(UINT16 a) +static UINT8 __fastcall KyugoRead1(UINT16 a) { if (a >= 0x9800 && a <= 0x9fff) { return KyugoSprite2Ram[a - 0x9800] | 0xf0; @@ -1265,7 +1263,7 @@ UINT8 __fastcall KyugoRead1(UINT16 a) return 0; } -void __fastcall KyugoWrite1(UINT16 a, UINT8 d) +static void __fastcall KyugoWrite1(UINT16 a, UINT8 d) { switch (a) { case 0xa800: { @@ -1297,7 +1295,7 @@ void __fastcall KyugoWrite1(UINT16 a, UINT8 d) } } -void __fastcall FlashgalPortWrite1(UINT16 a, UINT8 d) +static void __fastcall FlashgalPortWrite1(UINT16 a, UINT8 d) { a &= 0xff; @@ -1323,7 +1321,7 @@ void __fastcall FlashgalPortWrite1(UINT16 a, UINT8 d) } } -void __fastcall FlashgalaPortWrite1(UINT16 a, UINT8 d) +static void __fastcall FlashgalaPortWrite1(UINT16 a, UINT8 d) { a &= 0xff; @@ -1349,7 +1347,7 @@ void __fastcall FlashgalaPortWrite1(UINT16 a, UINT8 d) } } -void __fastcall GyrodinePortWrite1(UINT16 a, UINT8 d) +static void __fastcall GyrodinePortWrite1(UINT16 a, UINT8 d) { a &= 0xff; @@ -1375,7 +1373,7 @@ void __fastcall GyrodinePortWrite1(UINT16 a, UINT8 d) } } -void __fastcall SrdmissnPortWrite1(UINT16 a, UINT8 d) +static void __fastcall SrdmissnPortWrite1(UINT16 a, UINT8 d) { a &= 0xff; @@ -1401,7 +1399,7 @@ void __fastcall SrdmissnPortWrite1(UINT16 a, UINT8 d) } } -UINT8 __fastcall FlashgalRead2(UINT16 a) +static UINT8 __fastcall FlashgalRead2(UINT16 a) { switch (a) { case 0xc000: { @@ -1424,7 +1422,7 @@ UINT8 __fastcall FlashgalRead2(UINT16 a) return 0; } -UINT8 __fastcall FlashgalaRead2(UINT16 a) +static UINT8 __fastcall FlashgalaRead2(UINT16 a) { switch (a) { case 0xc040: { @@ -1447,7 +1445,7 @@ UINT8 __fastcall FlashgalaRead2(UINT16 a) return 0; } -UINT8 __fastcall GyrodineRead2(UINT16 a) +static UINT8 __fastcall GyrodineRead2(UINT16 a) { switch (a) { case 0x8000: { @@ -1470,7 +1468,7 @@ UINT8 __fastcall GyrodineRead2(UINT16 a) return 0; } -UINT8 __fastcall SrdmissnRead2(UINT16 a) +static UINT8 __fastcall SrdmissnRead2(UINT16 a) { switch (a) { case 0xf400: { @@ -1493,7 +1491,7 @@ UINT8 __fastcall SrdmissnRead2(UINT16 a) return 0; } -UINT8 __fastcall LegendRead2(UINT16 a) +static UINT8 __fastcall LegendRead2(UINT16 a) { switch (a) { case 0xf800: { @@ -1516,7 +1514,7 @@ UINT8 __fastcall LegendRead2(UINT16 a) return 0; } -void __fastcall KyugoWrite2(UINT16 a, UINT8 d) +static void __fastcall KyugoWrite2(UINT16 a, UINT8 d) { switch (a) { default: { @@ -1525,7 +1523,7 @@ void __fastcall KyugoWrite2(UINT16 a, UINT8 d) } } -UINT8 __fastcall KyugoPortRead2(UINT16 a) +static UINT8 __fastcall KyugoPortRead2(UINT16 a) { a &= 0xff; @@ -1542,7 +1540,7 @@ UINT8 __fastcall KyugoPortRead2(UINT16 a) return 0; } -UINT8 __fastcall FlashgalaPortRead2(UINT16 a) +static UINT8 __fastcall FlashgalaPortRead2(UINT16 a) { a &= 0xff; @@ -1559,7 +1557,7 @@ UINT8 __fastcall FlashgalaPortRead2(UINT16 a) return 0; } -UINT8 __fastcall SrdmissnPortRead2(UINT16 a) +static UINT8 __fastcall SrdmissnPortRead2(UINT16 a) { a &= 0xff; @@ -1576,7 +1574,7 @@ UINT8 __fastcall SrdmissnPortRead2(UINT16 a) return 0; } -void __fastcall FlashgalPortWrite2(UINT16 a, UINT8 d) +static void __fastcall FlashgalPortWrite2(UINT16 a, UINT8 d) { a &= 0xff; @@ -1607,7 +1605,7 @@ void __fastcall FlashgalPortWrite2(UINT16 a, UINT8 d) } } -void __fastcall FlashgalaPortWrite2(UINT16 a, UINT8 d) +static void __fastcall FlashgalaPortWrite2(UINT16 a, UINT8 d) { a &= 0xff; @@ -1638,7 +1636,7 @@ void __fastcall FlashgalaPortWrite2(UINT16 a, UINT8 d) } } -void __fastcall GyrodinePortWrite2(UINT16 a, UINT8 d) +static void __fastcall GyrodinePortWrite2(UINT16 a, UINT8 d) { a &= 0xff; @@ -1669,7 +1667,7 @@ void __fastcall GyrodinePortWrite2(UINT16 a, UINT8 d) } } -void __fastcall SrdmissnPortWrite2(UINT16 a, UINT8 d) +static void __fastcall SrdmissnPortWrite2(UINT16 a, UINT8 d) { a &= 0xff; @@ -1985,16 +1983,10 @@ static INT32 KyugoInit() ZetMapArea(0x8800, 0x8fff, 2, KyugoZ80Ram2 ); ZetClose(); } - - pAY8910Buffer[0] = pFMBuffer + nBurnSoundLen * 0; - pAY8910Buffer[1] = pFMBuffer + nBurnSoundLen * 1; - pAY8910Buffer[2] = pFMBuffer + nBurnSoundLen * 2; - pAY8910Buffer[3] = pFMBuffer + nBurnSoundLen * 3; - pAY8910Buffer[4] = pFMBuffer + nBurnSoundLen * 4; - pAY8910Buffer[5] = pFMBuffer + nBurnSoundLen * 5; - AY8910Init(0, 18432000 / 12, nBurnSoundRate, &KyugoDip0Read, &KyugoDip1Read, NULL, NULL); - AY8910Init(1, 18432000 / 12, nBurnSoundRate, NULL, NULL, NULL, NULL); + AY8910Init2(0, 18432000 / 12, 0); + AY8910Init2(1, 18432000 / 12, 1); + AY8910SetPorts(0, &KyugoDip0Read, &KyugoDip1Read, NULL, NULL); AY8910SetAllRoutes(0, 0.30, BURN_SND_ROUTE_BOTH); AY8910SetAllRoutes(1, 0.30, BURN_SND_ROUTE_BOTH); @@ -2112,16 +2104,10 @@ static INT32 Skywolf3Init() ZetMapArea(0x8000, 0x87ff, 1, KyugoSharedZ80Ram ); ZetMapArea(0x8000, 0x87ff, 2, KyugoSharedZ80Ram ); ZetClose(); - - pAY8910Buffer[0] = pFMBuffer + nBurnSoundLen * 0; - pAY8910Buffer[1] = pFMBuffer + nBurnSoundLen * 1; - pAY8910Buffer[2] = pFMBuffer + nBurnSoundLen * 2; - pAY8910Buffer[3] = pFMBuffer + nBurnSoundLen * 3; - pAY8910Buffer[4] = pFMBuffer + nBurnSoundLen * 4; - pAY8910Buffer[5] = pFMBuffer + nBurnSoundLen * 5; - AY8910Init(0, 18432000 / 12, nBurnSoundRate, &KyugoDip0Read, &KyugoDip1Read, NULL, NULL); - AY8910Init(1, 18432000 / 12, nBurnSoundRate, NULL, NULL, NULL, NULL); + AY8910Init2(0, 18432000 / 12, 0); + AY8910Init2(1, 18432000 / 12, 1); + AY8910SetPorts(0, &KyugoDip0Read, &KyugoDip1Read, NULL, NULL); AY8910SetAllRoutes(0, 0.30, BURN_SND_ROUTE_BOTH); AY8910SetAllRoutes(1, 0.30, BURN_SND_ROUTE_BOTH); @@ -2449,7 +2435,7 @@ static INT32 KyugoFrame() if (pBurnSoundOut) { INT32 nSegmentLength = nBurnSoundLen / nInterleave; INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); + AY8910Render2(pSoundBuf, nSegmentLength); nSoundBufferPos += nSegmentLength; } @@ -2460,7 +2446,7 @@ static INT32 KyugoFrame() INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); if (nSegmentLength) { - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); + AY8910Render2(pSoundBuf, nSegmentLength); } } diff --git a/src/burn/drv/pre90s/d_lasso.cpp b/src/burn/drv/pre90s/d_lasso.cpp index afec35476..a3a2251e6 100644 --- a/src/burn/drv/pre90s/d_lasso.cpp +++ b/src/burn/drv/pre90s/d_lasso.cpp @@ -37,8 +37,6 @@ static UINT8 *DrvBitmapRAM; static UINT32 *DrvPalette; static UINT8 DrvRecalc; -static INT16 *pAY8910Buffer[6]; - static UINT8 back_color; static UINT8 soundlatch; static UINT8 chip_data; @@ -463,7 +461,6 @@ static INT32 DrvSyncDAC() return (INT32)(float)(nBurnSoundLen * (M6502TotalCycles() / (6000000.000 / (nBurnFPS / 100.000)))); } - static INT32 LassoDoReset() { memset (AllRam, 0, RamEnd - AllRam); @@ -545,13 +542,6 @@ static INT32 MemIndex() RamEnd = Next; - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[3] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[4] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[5] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - MemEnd = Next; return 0; @@ -952,8 +942,8 @@ static INT32 PinboInit() ZetSetOutHandler(pinbo_sound_write); ZetClose(); - AY8910Init(0, 1500000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910Init(1, 1500000, nBurnSoundRate, NULL, NULL, NULL, NULL); + AY8910Init2(0, 1500000, 0); + AY8910Init2(1, 1500000, 1); AY8910SetAllRoutes(0, 0.30, BURN_SND_ROUTE_BOTH); AY8910SetAllRoutes(1, 0.30, BURN_SND_ROUTE_BOTH); @@ -1371,7 +1361,7 @@ static INT32 PinboFrame() M6502Close(); if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); + AY8910Render2(pBurnSoundOut, nBurnSoundLen); } if (pBurnDraw) { diff --git a/src/burn/drv/pre90s/d_mainsnk.cpp b/src/burn/drv/pre90s/d_mainsnk.cpp index c0d0c82a2..35c11ea4d 100644 --- a/src/burn/drv/pre90s/d_mainsnk.cpp +++ b/src/burn/drv/pre90s/d_mainsnk.cpp @@ -25,8 +25,6 @@ static UINT8 *DrvSprRAM; static UINT32 *DrvPalette; static UINT8 DrvRecalc; -static INT16 *pAY8910Buffer[6]; - static UINT8 DrvJoy1[8]; static UINT8 DrvJoy2[8]; static UINT8 DrvJoy3[8]; @@ -243,8 +241,6 @@ static struct BurnDIPInfo CanvasDIPList[]= STDDIPINFO(Canvas) - - static void __fastcall main_write(UINT16 address, UINT8 data) { switch (address) @@ -370,13 +366,6 @@ static INT32 MemIndex() RamEnd = Next; - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[3] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[4] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[5] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - MemEnd = Next; return 0; @@ -508,8 +497,8 @@ static INT32 DrvInit(INT32 select) ZetSetReadHandler(sound_read); ZetClose(); - AY8910Init(0, 2000000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910Init(1, 2000000, nBurnSoundRate, NULL, NULL, NULL, NULL); + AY8910Init2(0, 2000000, 0); + AY8910Init2(1, 2000000, 1); AY8910SetAllRoutes(0, 0.15, BURN_SND_ROUTE_BOTH); AY8910SetAllRoutes(1, 0.15, BURN_SND_ROUTE_BOTH); @@ -678,7 +667,6 @@ static INT32 DrvFrame() INT32 nCyclesTotal[2] = { 3360000 / 60, 4000000 / 60 }; INT32 nCyclesDone[2] = { 0, 0 }; - for (INT32 i = 0; i < nInterleave; i++) { ZetOpen(0); @@ -693,7 +681,7 @@ static INT32 DrvFrame() } if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); + AY8910Render2(pBurnSoundOut, nBurnSoundLen); } if (pBurnDraw) { diff --git a/src/burn/drv/pre90s/d_marineb.cpp b/src/burn/drv/pre90s/d_marineb.cpp index e48adf294..30dceaca5 100644 --- a/src/burn/drv/pre90s/d_marineb.cpp +++ b/src/burn/drv/pre90s/d_marineb.cpp @@ -3,7 +3,6 @@ #include "tiles_generic.h" #include "z80_intf.h" - #include "driver.h" extern "C" { #include "ay8910.h" @@ -43,9 +42,6 @@ static INT32 DrvInterruptEnable; static UINT8 ActiveLowFlipscreen; static INT32 hardware; -static INT16 *pAY8910Buffer[6]; - - static struct BurnInputInfo MarinebInputList[] = { {"P1 Coin" , BIT_DIGITAL , DrvInputPort2 + 0, "p1 coin" }, @@ -398,27 +394,20 @@ static INT32 MemIndex() { UINT8 *Next; Next = AllMem; - DrvZ80ROM = Next; Next += 0x10000; - DrvColPROM = Next; Next += 0x200; - DrvGfxROM0 = Next; Next += 1024 * 8 * 8; - DrvGfxROM1 = Next; Next += 64*2 * 16 * 16; - DrvGfxROM2 = Next; Next += 64*2 * 32 * 32; + DrvZ80ROM = Next; Next += 0x10000; + DrvColPROM = Next; Next += 0x200; + DrvGfxROM0 = Next; Next += 1024 * 8 * 8; + DrvGfxROM1 = Next; Next += 64*2 * 16 * 16; + DrvGfxROM2 = Next; Next += 64*2 * 32 * 32; - DrvPalette = (UINT32*)Next; Next += 0x100 * sizeof(UINT32); - - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[3] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[4] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[5] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); + DrvPalette = (UINT32*)Next; Next += 0x100 * sizeof(UINT32); RamStart = Next; DrvZ80RAM = Next; Next += 0x800; DrvVidRAM = Next; Next += 0x400; - DrvSprRAM = Next; Next += 0x100; - DrvColRAM = Next; Next += 0x400; + DrvSprRAM = Next; Next += 0x100; + DrvColRAM = Next; Next += 0x400; RamEnd = Next; MemEnd = Next; @@ -441,12 +430,11 @@ static void CleanAndInitStuff() memset(DrvInputPort2, 0, 8); memset(DrvInput, 0, 3); - DrvDip = 0; - DrvReset = 0; + DrvDip = 0; + DrvReset = 0; } - -UINT8 __fastcall marineb_read(UINT16 address) +static UINT8 __fastcall marineb_read(UINT16 address) { switch (address) { case 0xa800: @@ -465,11 +453,10 @@ UINT8 __fastcall marineb_read(UINT16 address) return 0; } - -void __fastcall marineb_write(UINT16 address, UINT8 data) +static void __fastcall marineb_write(UINT16 address, UINT8 data) { - switch (address) { - + switch (address) + { case 0x9800: DrvColumnScroll = data; return; @@ -497,9 +484,10 @@ void __fastcall marineb_write(UINT16 address, UINT8 data) } } -void __fastcall marineb_write_port(UINT16 port, UINT8 data) +static void __fastcall marineb_write_port(UINT16 port, UINT8 data) { - switch (port & 0xFF) { + switch (port & 0xff) + { case 0x00: case 0x01: case 0x08: @@ -865,9 +853,9 @@ static INT32 DrvInit() ZetClose(); - AY8910Init(0, 1500000, nBurnSoundRate, NULL, NULL, NULL, NULL); + AY8910Init2(0, 1500000, 0); + AY8910Init2(1, 1500000, 1); AY8910SetAllRoutes(0, 0.15, BURN_SND_ROUTE_BOTH); - AY8910Init(1, 1500000, nBurnSoundRate, NULL, NULL, NULL, NULL); AY8910SetAllRoutes(1, 0.15, BURN_SND_ROUTE_BOTH); GenericTilesInit(); @@ -1621,7 +1609,7 @@ static INT32 DrvFrame() ZetClose(); if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); + AY8910Render2(pBurnSoundOut, nBurnSoundLen); } if (pBurnDraw) { diff --git a/src/burn/drv/pre90s/d_mario.cpp b/src/burn/drv/pre90s/d_mario.cpp index c14aa31d1..39046726e 100644 --- a/src/burn/drv/pre90s/d_mario.cpp +++ b/src/burn/drv/pre90s/d_mario.cpp @@ -27,8 +27,6 @@ static UINT8 *DrvVidRAM; static UINT8 *DrvSprRAM; static UINT8 *DrvSndRAM; -static INT16 *pAY8910Buffer[3]; - static UINT32 *DrvPalette; static UINT8 DrvRecalc; @@ -347,7 +345,7 @@ static int MemIndex() DrvColPROM = Next; Next += 0x000200; - DrvPalette = (unsigned int*)Next; Next += 0x0200 * sizeof(int); + DrvPalette = (UINT32*)Next; Next += 0x0200 * sizeof(UINT32); AllRam = Next; @@ -368,10 +366,6 @@ static int MemIndex() RamEnd = Next; - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - MemEnd = Next; return 0; @@ -495,7 +489,8 @@ static INT32 DrvInit() ZetSetReadHandler(masao_sound_read); ZetClose(); - AY8910Init(0, 2386333, nBurnSoundRate, &masao_ay8910_read_port_A, NULL, NULL, NULL); + AY8910Init2(0, 2386333, 0); + AY8910SetPorts(0, &masao_ay8910_read_port_A, NULL, NULL, NULL); AY8910SetAllRoutes(0, 0.50, BURN_SND_ROUTE_BOTH); } @@ -673,7 +668,7 @@ static INT32 MasaoFrame() } if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); + AY8910Render2(pBurnSoundOut, nBurnSoundLen); } if (pBurnDraw) { diff --git a/src/burn/drv/pre90s/d_meijinsn.cpp b/src/burn/drv/pre90s/d_meijinsn.cpp index a912313d3..ef16d0c83 100644 --- a/src/burn/drv/pre90s/d_meijinsn.cpp +++ b/src/burn/drv/pre90s/d_meijinsn.cpp @@ -25,8 +25,6 @@ static UINT8 DrvRecalc; static UINT8 *soundlatch; -static INT16 *pAY8910Buffer[3]; - static UINT16 DrvInputs[3]; static UINT8 DrvJoy1[16]; static UINT8 DrvJoy2[16]; @@ -158,7 +156,7 @@ static UINT8 alpha_mcu_r(UINT8 offset) return 0; } -UINT8 __fastcall meijinsn_read_byte(UINT32 address) +static UINT8 __fastcall meijinsn_read_byte(UINT32 address) { if ((address & ~0xff) == 0x080e00) { return alpha_mcu_r(address & 0xfe); @@ -179,7 +177,7 @@ UINT8 __fastcall meijinsn_read_byte(UINT32 address) return 0; } -void __fastcall meijinsn_write_byte(UINT32 address, UINT8 data) +static void __fastcall meijinsn_write_byte(UINT32 address, UINT8 data) { if (address == 0x1a0001) { *soundlatch = data; @@ -187,7 +185,7 @@ void __fastcall meijinsn_write_byte(UINT32 address, UINT8 data) } } -UINT8 __fastcall meijinsn_in_port(UINT16 port) +static UINT8 __fastcall meijinsn_in_port(UINT16 port) { if ((port & 0xff) == 0x01) { return AY8910Read(0); @@ -196,7 +194,7 @@ UINT8 __fastcall meijinsn_in_port(UINT16 port) return 0; } -void __fastcall meijinsn_out_port(UINT16 port, UINT8 data) +static void __fastcall meijinsn_out_port(UINT16 port, UINT8 data) { switch (port & 0xff) { @@ -259,10 +257,6 @@ static INT32 MemIndex() RamEnd = Next; - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - MemEnd = Next; return 0; @@ -359,7 +353,8 @@ static INT32 DrvInit() ZetSetInHandler(meijinsn_in_port); ZetClose(); - AY8910Init(0, 2000000, nBurnSoundRate, &ay8910_port_a_r, NULL, NULL, NULL); + AY8910Init2(0, 2000000, 0); + AY8910SetPorts(0, &ay8910_port_a_r, NULL, NULL, NULL); AY8910SetAllRoutes(0, 0.75, BURN_SND_ROUTE_BOTH); GenericTilesInit(); @@ -463,7 +458,7 @@ static INT32 DrvFrame() SekClose(); if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); + AY8910Render2(pBurnSoundOut, nBurnSoundLen); } if (pBurnDraw) { diff --git a/src/burn/drv/pre90s/d_mirax.cpp b/src/burn/drv/pre90s/d_mirax.cpp index c73033543..f102abb19 100644 --- a/src/burn/drv/pre90s/d_mirax.cpp +++ b/src/burn/drv/pre90s/d_mirax.cpp @@ -4,11 +4,9 @@ #include "driver.h" #include "z80_intf.h" #include "bitswap.h" - extern "C" { #include "ay8910.h" } -static INT16 *pAY8910Buffer[6]; static UINT8 *AllMem; static UINT8 *MemEnd; @@ -42,77 +40,76 @@ static UINT8 DrvReset; static struct BurnInputInfo MiraxInputList[] = { {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 6, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 1, "p1 start" }, + {"P1 Start", BIT_DIGITAL, DrvJoy1 + 1, "p1 start" }, {"P1 Up", BIT_DIGITAL, DrvJoy1 + 5, "p1 up" }, {"P1 Down", BIT_DIGITAL, DrvJoy1 + 0, "p1 down" }, {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, + {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, + {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 7, "p2 coin" }, - {"P2 Start", BIT_DIGITAL, DrvJoy2 + 1, "p2 start" }, + {"P2 Start", BIT_DIGITAL, DrvJoy2 + 1, "p2 start" }, {"P2 Up", BIT_DIGITAL, DrvJoy2 + 5, "p2 up" }, {"P2 Down", BIT_DIGITAL, DrvJoy2 + 0, "p2 down" }, {"P2 Left", BIT_DIGITAL, DrvJoy2 + 2, "p2 left" }, - {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right" }, - {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, + {"P2 Right", BIT_DIGITAL, DrvJoy2 + 3, "p2 right" }, + {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" }, - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip A", BIT_DIPSWITCH, DrvDip + 0, "dip" }, - {"Dip B", BIT_DIPSWITCH, DrvDip + 1, "dip" }, + {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, + {"Dip A", BIT_DIPSWITCH, DrvDip + 0, "dip" }, + {"Dip B", BIT_DIPSWITCH, DrvDip + 1, "dip" }, }; STDINPUTINFO(Mirax) - static struct BurnDIPInfo MiraxDIPList[]= { - {0x0f, 0xff, 0xff, 0x00, NULL }, - {0x10, 0xff, 0xff, 0x0c, NULL }, + {0x0f, 0xff, 0xff, 0x00, NULL }, + {0x10, 0xff, 0xff, 0x0c, NULL }, - {0 , 0xfe, 0 , 4, "Coinage" }, + {0 , 0xfe, 0 , 4, "Coinage" }, {0x0f, 0x01, 0x03, 0x03, "2 Coins 1 Credit" }, {0x0f, 0x01, 0x03, 0x00, "1 Coin 1 Credit" }, {0x0f, 0x01, 0x03, 0x01, "1 Coin 2 Credits" }, {0x0f, 0x01, 0x03, 0x02, "1 Coin 3 Credits" }, - {0 , 0xfe, 0 , 2, "Cabinet" }, - {0x0f, 0x01, 0x04, 0x00, "Upright" }, - {0x0f, 0x01, 0x04, 0x04, "Cocktail" }, + {0 , 0xfe, 0 , 2, "Cabinet" }, + {0x0f, 0x01, 0x04, 0x00, "Upright" }, + {0x0f, 0x01, 0x04, 0x04, "Cocktail" }, - {0 , 0xfe, 0 , 2, "Flip Screen" }, - {0x0f, 0x01, 0x08, 0x00, "Off" }, - {0x0f, 0x01, 0x08, 0x08, "On" }, + {0 , 0xfe, 0 , 2, "Flip Screen" }, + {0x0f, 0x01, 0x08, 0x00, "Off" }, + {0x0f, 0x01, 0x08, 0x08, "On" }, - {0 , 0xfe, 0 , 4, "Lives" }, - {0x0f, 0x01, 0x30, 0x30, "2" }, - {0x0f, 0x01, 0x30, 0x00, "3" }, - {0x0f, 0x01, 0x30, 0x10, "4" }, - {0x0f, 0x01, 0x30, 0x20, "5" }, + {0 , 0xfe, 0 , 4, "Lives" }, + {0x0f, 0x01, 0x30, 0x30, "2" }, + {0x0f, 0x01, 0x30, 0x00, "3" }, + {0x0f, 0x01, 0x30, 0x10, "4" }, + {0x0f, 0x01, 0x30, 0x20, "5" }, - {0 , 0xfe, 0 , 2, "Bonus Life" }, - {0x10, 0x01, 0x01, 0x00, "30k 80k 150k" }, - {0x10, 0x01, 0x01, 0x01, "900k 950k 990k" }, + {0 , 0xfe, 0 , 2, "Bonus Life" }, + {0x10, 0x01, 0x01, 0x00, "30k 80k 150k" }, + {0x10, 0x01, 0x01, 0x01, "900k 950k 990k" }, {0 , 0xfe, 0 , 2, "Flags for Extra Life" }, - {0x10, 0x01, 0x02, 0x00, "5" }, - {0x10, 0x01, 0x02, 0x02, "8" }, + {0x10, 0x01, 0x02, 0x00, "5" }, + {0x10, 0x01, 0x02, 0x02, "8" }, - {0 , 0xfe, 0 , 2, "Demo Sounds" }, - {0x10, 0x01, 0x04, 0x00, "Off" }, - {0x10, 0x01, 0x04, 0x04, "On" }, + {0 , 0xfe, 0 , 2, "Demo Sounds" }, + {0x10, 0x01, 0x04, 0x00, "Off" }, + {0x10, 0x01, 0x04, 0x04, "On" }, - {0 , 0xfe, 0 , 2, "Allow Continue" }, - {0x10, 0x01, 0x08, 0x00, "No" }, - {0x10, 0x01, 0x08, 0x08, "Yes" }, + {0 , 0xfe, 0 , 2, "Allow Continue" }, + {0x10, 0x01, 0x08, 0x00, "No" }, + {0x10, 0x01, 0x08, 0x08, "Yes" }, {0 , 0xfe, 0 , 2, "AutoPlay Mode (Debug)"}, - {0x10, 0x01, 0x10, 0x00, "No" }, - {0x10, 0x01, 0x10, 0x10, "Yes" }, + {0x10, 0x01, 0x10, 0x00, "No" }, + {0x10, 0x01, 0x10, 0x10, "Yes" }, - {0 , 0xfe, 0 , 2, "Difficulty" }, - {0x10, 0x01, 0x20, 0x00, "Easy" }, - {0x10, 0x01, 0x20, 0x20, "Hard" }, + {0 , 0xfe, 0 , 2, "Difficulty" }, + {0x10, 0x01, 0x20, 0x00, "Easy" }, + {0x10, 0x01, 0x20, 0x20, "Hard" }, }; STDDIPINFO(Mirax) @@ -238,9 +235,9 @@ static INT32 MemIndex() DrvZ80ROM1 = Next; Next += 0x10000; DrvPalette = (UINT32*)Next; Next += 0x040 * sizeof(UINT32); - DrvCharGFX = Next; Next += 0x40000; - DrvSpriteGFX = Next; Next += 0x40000; - DrvColorPROM = Next; Next += 0x00400; + DrvCharGFX = Next; Next += 0x40000; + DrvSpriteGFX = Next; Next += 0x40000; + DrvColorPROM = Next; Next += 0x00400; AllRam = Next; @@ -248,23 +245,16 @@ static INT32 MemIndex() DrvZ80RAM1 = Next; Next += 0x01000; DrvVidRAM = Next; Next += 0x00400; DrvColorRAM = Next; Next += 0x00400; - DrvSpriteRAM = Next; Next += 0x00300; + DrvSpriteRAM = Next; Next += 0x00300; - nAyCtrl = Next; Next += 0x00001; - nmi_mask = Next; Next += 0x00001; - flipscreen_x = Next; Next += 0x00001; - flipscreen_y = Next; Next += 0x00001; - soundlatch = Next; Next += 0x00001; + nAyCtrl = Next; Next += 0x00001; + nmi_mask = Next; Next += 0x00001; + flipscreen_x = Next; Next += 0x00001; + flipscreen_y = Next; Next += 0x00001; + soundlatch = Next; Next += 0x00001; RamEnd = Next; - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[3] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[4] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[5] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - MemEnd = Next; return 0; @@ -280,7 +270,6 @@ static INT32 DrvInit() INT32 c16XOffsets[16] = { 0, 1, 2, 3, 4, 5, 6, 7 , 0+8*8, 1+8*8, 2+8*8, 3+8*8, 4+8*8, 5+8*8, 6+8*8, 7+8*8 }; INT32 c16YOffsets[16] = { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 0*8+8*8*2, 1*8+8*8*2, 2*8+8*8*2, 3*8+8*8*2, 4*8+8*8*2, 5*8+8*8*2, 6*8+8*8*2, 7*8+8*8*2 }; - AllMem = NULL; MemIndex(); INT32 nLen = MemEnd - (UINT8 *)0; @@ -353,9 +342,9 @@ static INT32 DrvInit() ZetSetReadHandler(audio_read); ZetClose(); - AY8910Init(0, 3000000, nBurnSoundRate, NULL, NULL, NULL, NULL); + AY8910Init2(0, 3000000, 0); + AY8910Init2(1, 3000000, 1); AY8910SetAllRoutes(0, 0.50, BURN_SND_ROUTE_BOTH); - AY8910Init(1, 3000000, nBurnSoundRate, NULL, NULL, NULL, NULL); AY8910SetAllRoutes(1, 0.50, BURN_SND_ROUTE_BOTH); GenericTilesInit(); @@ -365,7 +354,6 @@ static INT32 DrvInit() return 0; } - static INT32 DrvExit() { GenericTilesExit(); @@ -525,7 +513,7 @@ static INT32 DrvFrame() } if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); + AY8910Render2(pBurnSoundOut, nBurnSoundLen); } if (pBurnDraw) { diff --git a/src/burn/drv/pre90s/d_mouser.cpp b/src/burn/drv/pre90s/d_mouser.cpp index 3a7d76209..dd1b37845 100644 --- a/src/burn/drv/pre90s/d_mouser.cpp +++ b/src/burn/drv/pre90s/d_mouser.cpp @@ -7,7 +7,6 @@ extern "C" { #include "ay8910.h" } -static INT16 *pAY8910Buffer[6]; static UINT8 DrvJoy1[8]; static UINT8 DrvJoy2[8]; @@ -40,20 +39,20 @@ static void DrvPaletteInit(); static struct BurnInputInfo MouserInputList[] = { {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin"}, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 2, "p1 start"}, + {"P1 Start", BIT_DIGITAL, DrvJoy1 + 2, "p1 start"}, {"P1 Up", BIT_DIGITAL, DrvJoy2 + 4, "p1 up"}, {"P1 Down", BIT_DIGITAL, DrvJoy2 + 5, "p1 down"}, {"P1 Left", BIT_DIGITAL, DrvJoy2 + 6, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 7, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 3, "p1 fire 1"}, + {"P1 Right", BIT_DIGITAL, DrvJoy2 + 7, "p1 right"}, + {"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 3, "p1 fire 1"}, {"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin"}, - {"P2 Start", BIT_DIGITAL, DrvJoy1 + 3, "p2 start"}, + {"P2 Start", BIT_DIGITAL, DrvJoy1 + 3, "p2 start"}, {"P2 Up", BIT_DIGITAL, DrvJoy3 + 4, "p2 up"}, {"P2 Down", BIT_DIGITAL, DrvJoy3 + 5, "p2 down"}, {"P2 Left", BIT_DIGITAL, DrvJoy3 + 6, "p2 left"}, - {"P2 Right", BIT_DIGITAL, DrvJoy3 + 7, "p2 right"}, - {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 3, "p2 fire 1"}, + {"P2 Right", BIT_DIGITAL, DrvJoy3 + 7, "p2 right"}, + {"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 3, "p2 fire 1"}, {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, {"Dip A", BIT_DIPSWITCH, DrvJoy1 + 5,"dip"}, @@ -303,13 +302,6 @@ static INT32 MemIndex() RamEnd = Next; - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[3] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[4] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[5] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - MemEnd = Next; return 0; @@ -430,9 +422,8 @@ static INT32 DrvInit() ZetSetOutHandler(mouser_sub_out); ZetClose(); - AY8910Init(0, 2000000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910Init(1, 2000000, nBurnSoundRate, NULL, NULL, NULL, NULL); - + AY8910Init2(0, 2000000, 0); + AY8910Init2(1, 2000000, 1); AY8910SetAllRoutes(0, 0.15, BURN_SND_ROUTE_BOTH); AY8910SetAllRoutes(1, 0.15, BURN_SND_ROUTE_BOTH); @@ -493,7 +484,7 @@ static INT32 DrvFrame() } if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); + AY8910Render2(pBurnSoundOut, nBurnSoundLen); } if (pBurnDraw) { diff --git a/src/burn/drv/pre90s/d_munchmo.cpp b/src/burn/drv/pre90s/d_munchmo.cpp index 23544f325..aa0183a18 100644 --- a/src/burn/drv/pre90s/d_munchmo.cpp +++ b/src/burn/drv/pre90s/d_munchmo.cpp @@ -38,8 +38,6 @@ static UINT16 *DrvBGBitmap; static UINT32 *DrvPalette; static UINT8 DrvRecalc; -static INT16 *pAY8910Buffer[6]; - static UINT8 flipscreen; static UINT8 nmi_enable; static UINT8 soundlatch; @@ -316,13 +314,6 @@ static INT32 MemIndex() RamEnd = Next; - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[3] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[4] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[5] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - MemEnd = Next; return 0; @@ -459,8 +450,8 @@ static INT32 DrvInit() ZetSetReadHandler(mnchmobl_sound_read); ZetClose(); - AY8910Init(0, 1875000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910Init(1, 1875000, nBurnSoundRate, NULL, NULL, NULL, NULL); + AY8910Init2(0, 1875000, 0); + AY8910Init2(1, 1875000, 1); AY8910SetAllRoutes(0, 0.50, BURN_SND_ROUTE_BOTH); AY8910SetAllRoutes(1, 0.50, BURN_SND_ROUTE_BOTH); @@ -627,7 +618,7 @@ static INT32 DrvFrame() } if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); + AY8910Render2(pBurnSoundOut, nBurnSoundLen); } if (pBurnDraw) { diff --git a/src/burn/drv/pre90s/d_pacman.cpp b/src/burn/drv/pre90s/d_pacman.cpp index 53924b92a..a953e8430 100644 --- a/src/burn/drv/pre90s/d_pacman.cpp +++ b/src/burn/drv/pre90s/d_pacman.cpp @@ -28,7 +28,6 @@ static UINT8 *DrvSprRAM2; static UINT8 *DrvColPROM; static UINT8 *DrvTransTable; -static INT16 *pAY8910Buffer[3]; static UINT32 *Palette; static UINT8 DrvRecalc; @@ -2420,10 +2419,6 @@ static INT32 MemIndex() RamEnd = Next; - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - MemEnd = Next; return 0; @@ -2636,7 +2631,7 @@ static INT32 DrvInit(void (*mapCallback)(), void (*pInitCallback)(), INT32 selec mapCallback(); ZetClose(); - AY8910Init(0, 1789750, nBurnSoundRate, NULL, NULL, NULL, NULL); + AY8910Init2(0, 1789750, 0); AY8910SetAllRoutes(0, 0.75, BURN_SND_ROUTE_BOTH); if (game_select == DREMSHPR) AY8910SetAllRoutes(0, 0.50, BURN_SND_ROUTE_BOTH); @@ -2824,7 +2819,7 @@ static INT32 DrvFrame() if (nSegmentLength) { if (game_select == DREMSHPR || game_select == CRUSHS) { - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); + AY8910Render2(pSoundBuf, nSegmentLength); } else { if (game_select == VANVAN) { SN76496Update(0, pSoundBuf, nSegmentLength); @@ -2844,7 +2839,7 @@ static INT32 DrvFrame() if (nSegmentLength) { if (game_select == DREMSHPR || game_select == CRUSHS) { - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); + AY8910Render2(pSoundBuf, nSegmentLength); } else { if (game_select == VANVAN) { SN76496Update(0, pSoundBuf, nSegmentLength); diff --git a/src/burn/drv/pre90s/d_pengadvb.cpp b/src/burn/drv/pre90s/d_pengadvb.cpp index 68c502b75..5a6f7515d 100644 --- a/src/burn/drv/pre90s/d_pengadvb.cpp +++ b/src/burn/drv/pre90s/d_pengadvb.cpp @@ -6,24 +6,21 @@ #include "tms9928a.h" #include "8255ppi.h" #include "bitswap.h" - extern "C" { #include "ay8910.h" } -static INT16 *pAY8910Buffer[6]; static UINT8 *AllMem = NULL; static UINT8 *MemEnd = NULL; static UINT8 *AllRam = NULL; static UINT8 *RamEnd = NULL; static UINT8 *maincpu = NULL; -static UINT8 *game = NULL; +static UINT8 *game = NULL; static UINT8 *main_mem = NULL; static UINT8 DrvInputs[2]; static UINT8 DrvJoy1[8]; static UINT8 DrvJoy2[8]; -static UINT8 DrvDips[1]; static UINT8 DrvReset; static UINT8 DrvNMI; @@ -32,27 +29,19 @@ static UINT8 mem_map = 0; static UINT8 mem_banks[4]; static struct BurnInputInfo PengadvbInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 0, "p1 coin"}, - {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up"}, - {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down"}, - {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1"}, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2"}, + {"P1 Coin", BIT_DIGITAL, DrvJoy2 + 0, "p1 coin" }, + {"P1 Up", BIT_DIGITAL, DrvJoy1 + 0, "p1 up" }, + {"P1 Down", BIT_DIGITAL, DrvJoy1 + 1, "p1 down" }, + {"P1 Left", BIT_DIGITAL, DrvJoy1 + 2, "p1 left" }, + {"P1 Right", BIT_DIGITAL, DrvJoy1 + 3, "p1 right" }, + {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" }, + {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" }, - {"Reset", BIT_DIGITAL, &DrvReset, "reset"}, - {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, + {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, }; STDINPUTINFO(Pengadvb) -static struct BurnDIPInfo PengadvbDIPList[]= -{ - {0x08, 0xff, 0xff, 0x00, NULL }, -}; - -STDDIPINFO(Pengadvb) - static void __fastcall msx_write_port(UINT16 port, UINT8 data) { port &= 0xff; @@ -255,17 +244,13 @@ static INT32 MemIndex() maincpu = Next; Next += 0x020000; game = Next; Next += 0x020000; - AllRam = Next; + AllRam = Next; - main_mem = Next; Next += 0x010400; + main_mem = Next; Next += 0x010400; - RamEnd = Next; + RamEnd = Next; - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - - MemEnd = Next; + MemEnd = Next; return 0; } @@ -358,7 +343,8 @@ static INT32 DrvInit() ZetSetReadHandler(msx_read); ZetClose(); - AY8910Init(0, 3579545/2, nBurnSoundRate, ay8910portAread, NULL, NULL, ay8910portBwrite); + AY8910Init2(0, 3579545/2, 0); + AY8910SetPorts(0, ay8910portAread, NULL, NULL, ay8910portBwrite); AY8910SetAllRoutes(0, 0.50, BURN_SND_ROUTE_BOTH); TMS9928AInit(TMS99x8A, 0x4000, 0, 0, vdp_interrupt); @@ -413,7 +399,7 @@ static INT32 DrvFrame() INT32 nCyclesDone[1] = { 0 }; INT32 nSoundBufferPos = 0; - ZetOpen(0); + ZetOpen(0); if (DrvNMI && !lastnmi) { ZetNmi(); @@ -430,7 +416,7 @@ static INT32 DrvFrame() if (pBurnSoundOut) { INT32 nSegmentLength = nBurnSoundLen / nInterleave; INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); + AY8910Render2(pSoundBuf, nSegmentLength); nSoundBufferPos += nSegmentLength; } } @@ -442,7 +428,7 @@ static INT32 DrvFrame() INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); if (nSegmentLength) { - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); + AY8910Render2(pSoundBuf, nSegmentLength); } } @@ -497,7 +483,7 @@ struct BurnDriver BurnDrvPengadvb = { "Penguin Adventure (bootleg of MSX version)\0", NULL, "bootleg (Screen) / Konami", "Miscellaneous", NULL, NULL, NULL, NULL, BDF_GAME_WORKING, 2, HARDWARE_MISC_PRE90S, GBF_MISC, 0, - NULL, pengadvbRomInfo, pengadvbRomName, NULL, NULL, PengadvbInputInfo, PengadvbDIPInfo, + NULL, pengadvbRomInfo, pengadvbRomName, NULL, NULL, PengadvbInputInfo, NULL, DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE, 272, 216, 4, 3 }; diff --git a/src/burn/drv/pre90s/d_pitnrun.cpp b/src/burn/drv/pre90s/d_pitnrun.cpp index 28b33bf90..03824849e 100644 --- a/src/burn/drv/pre90s/d_pitnrun.cpp +++ b/src/burn/drv/pre90s/d_pitnrun.cpp @@ -34,8 +34,6 @@ static UINT8 *DrvMCURAM; static UINT32 *DrvPalette; static UINT8 DrvRecalc; -static INT16 *pAY8910Buffer[6]; - static UINT8 nmi_enable; static UINT8 color_select; static UINT8 char_bank; @@ -409,13 +407,6 @@ static INT32 MemIndex() RamEnd = Next; - pAY8910Buffer[0] = (INT16 *)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16 *)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16 *)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[3] = (INT16 *)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[4] = (INT16 *)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[5] = (INT16 *)Next; Next += nBurnSoundLen * sizeof(INT16); - MemEnd = Next; return 0; @@ -538,8 +529,10 @@ static INT32 DrvInit(INT32 game) m67805_taito_init(DrvMCUROM, DrvMCURAM, &pitnrun_m68705_interface); - AY8910Init(0, 1536000, nBurnSoundRate, &AY8910_read, &AY8910_read, NULL, NULL); - AY8910Init(1, 1536000, nBurnSoundRate, &AY8910_read, &AY8910_read, NULL, NULL); + AY8910Init2(0, 1536000, 0); + AY8910Init2(1, 1536000, 1); + AY8910SetPorts(0, &AY8910_read, &AY8910_read, NULL, NULL); + AY8910SetPorts(1, &AY8910_read, &AY8910_read, NULL, NULL); AY8910SetAllRoutes(0, 0.15, BURN_SND_ROUTE_BOTH); AY8910SetAllRoutes(1, 0.15, BURN_SND_ROUTE_BOTH); @@ -722,7 +715,7 @@ static INT32 DrvFrame() if (pBurnSoundOut) { INT32 nSegmentLength = nBurnSoundLen / nInterleave; INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); + AY8910Render2(pSoundBuf, nSegmentLength); nSoundBufferPos += nSegmentLength; } @@ -732,7 +725,7 @@ static INT32 DrvFrame() INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); if (nSegmentLength) { - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); + AY8910Render2(pSoundBuf, nSegmentLength); } } diff --git a/src/burn/drv/pre90s/d_pkunwar.cpp b/src/burn/drv/pre90s/d_pkunwar.cpp index 928e450bd..933fa2471 100644 --- a/src/burn/drv/pre90s/d_pkunwar.cpp +++ b/src/burn/drv/pre90s/d_pkunwar.cpp @@ -28,8 +28,6 @@ static UINT8 *DrvSubRAM; static UINT32 *DrvPalette; static UINT8 DrvRecalc; -static INT16 *pAY8910Buffer[6]; - static UINT8 DrvJoy1[8]; static UINT8 DrvJoy2[8]; static UINT8 DrvJoy3[8]; @@ -811,13 +809,6 @@ static INT32 MemIndex() RamEnd = Next; - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[3] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[4] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[5] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - MemEnd = Next; return 0; @@ -917,9 +908,10 @@ static INT32 PkunwarInit() ZetMapMemory(DrvMainROM + 0xe000, 0xe000, 0xffff, MAP_ROM); ZetClose(); - AY8910Init(0, 1500000, nBurnSoundRate, &pkunwar_port_0, &pkunwar_port_1, NULL, NULL); - AY8910Init(1, 1500000, nBurnSoundRate, &pkunwar_port_2, &pkunwar_port_3, NULL, NULL); - + AY8910Init2(0, 1500000, 0); + AY8910Init2(1, 1500000, 1); + AY8910SetPorts(0, &pkunwar_port_0, &pkunwar_port_1, NULL, NULL); + AY8910SetPorts(1, &pkunwar_port_2, &pkunwar_port_3, NULL, NULL); AY8910SetAllRoutes(0, 0.25, BURN_SND_ROUTE_BOTH); AY8910SetAllRoutes(1, 0.25, BURN_SND_ROUTE_BOTH); @@ -971,9 +963,10 @@ static INT32 NovaInit() ZetMapMemory(DrvMainRAM, 0xe000, 0xe7ff, MAP_RAM); ZetClose(); - AY8910Init(0, 2000000, nBurnSoundRate, NULL, NULL, &nova2001_scroll_x_w, &nova2001_scroll_y_w); - AY8910Init(1, 2000000, nBurnSoundRate, &nova2001_port_3, &nova2001_port_4, NULL, NULL); - + AY8910Init2(0, 2000000, 0); + AY8910Init2(1, 2000000, 1); + AY8910SetPorts(0, NULL, NULL, &nova2001_scroll_x_w, &nova2001_scroll_y_w); + AY8910SetPorts(1, &nova2001_port_3, &nova2001_port_4, NULL, NULL); AY8910SetAllRoutes(0, 0.20, BURN_SND_ROUTE_BOTH); AY8910SetAllRoutes(1, 0.20, BURN_SND_ROUTE_BOTH); @@ -1056,9 +1049,10 @@ static INT32 NinjakunInit() ZetMapMemory(DrvMainRAM + 0x0000, 0xe400, 0xe7ff, MAP_RAM); ZetClose(); - AY8910Init(0, 3000000, nBurnSoundRate, &nova2001_port_3, &nova2001_port_4, NULL, NULL); - AY8910Init(1, 3000000, nBurnSoundRate, NULL, NULL, &nova2001_scroll_x_w, &nova2001_scroll_y_w); - + AY8910Init2(0, 3000000, 0); + AY8910Init2(1, 3000000, 1); + AY8910SetPorts(1, NULL, NULL, &nova2001_scroll_x_w, &nova2001_scroll_y_w); + AY8910SetPorts(0, &nova2001_port_3, &nova2001_port_4, NULL, NULL); AY8910SetAllRoutes(0, 0.20, BURN_SND_ROUTE_BOTH); AY8910SetAllRoutes(1, 0.20, BURN_SND_ROUTE_BOTH); @@ -1118,9 +1112,10 @@ static INT32 Raiders5Init() ZetMapMemory(DrvMainRAM + 0x0000, 0xa000, 0xa7ff, MAP_RAM); ZetClose(); - AY8910Init(0, 1500000, nBurnSoundRate, &raiders5_port_0, &pkunwar_port_1, NULL, NULL); - AY8910Init(1, 1500000, nBurnSoundRate, &nova2001_port_3, &nova2001_port_4, NULL, NULL); - + AY8910Init2(0, 1500000, 0); + AY8910Init2(1, 1500000, 1); + AY8910SetPorts(0, &raiders5_port_0, &pkunwar_port_1, NULL, NULL); + AY8910SetPorts(1, &nova2001_port_3, &nova2001_port_4, NULL, NULL); AY8910SetAllRoutes(0, 0.25, BURN_SND_ROUTE_BOTH); AY8910SetAllRoutes(1, 0.25, BURN_SND_ROUTE_BOTH); @@ -1503,7 +1498,7 @@ static INT32 NovaFrame() ZetClose(); if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); + AY8910Render2(pBurnSoundOut, nBurnSoundLen); } if (pBurnDraw) { @@ -1534,7 +1529,7 @@ static INT32 PkunwarFrame() ZetClose(); if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); + AY8910Render2(pBurnSoundOut, nBurnSoundLen); } if (pBurnDraw) { @@ -1582,7 +1577,7 @@ static INT32 Raiders5Frame() } if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); + AY8910Render2(pBurnSoundOut, nBurnSoundLen); } if (pBurnDraw) { @@ -1629,7 +1624,7 @@ static INT32 NinjakunFrame() } if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); + AY8910Render2(pBurnSoundOut, nBurnSoundLen); } if (pBurnDraw) { diff --git a/src/burn/drv/pre90s/d_route16.cpp b/src/burn/drv/pre90s/d_route16.cpp index 4f52c648d..5dc1f8d18 100644 --- a/src/burn/drv/pre90s/d_route16.cpp +++ b/src/burn/drv/pre90s/d_route16.cpp @@ -24,8 +24,6 @@ static UINT8 *DrvVidRAM1; static UINT32 *DrvPalette; static UINT8 DrvRecalc; -static INT16 *pAY8910Buffer[3]; - static UINT8 palette_1; static UINT8 palette_2; static UINT8 flipscreen; @@ -504,10 +502,6 @@ static INT32 MemIndex() RamEnd = Next; - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - MemEnd = Next; return 0; @@ -600,7 +594,8 @@ static INT32 DrvInit() SN76477_set_mastervol(0, 10.00); // weird // call after SN76477! - AY8910Init(0, 1250000, nBurnSoundRate, NULL, NULL, &stratvox_sn76477_write, NULL); + AY8910Init2(0, 1250000, 0); + AY8910SetPorts(0, NULL, NULL, &stratvox_sn76477_write, NULL); AY8910SetAllRoutes(0, 0.50, BURN_SND_ROUTE_BOTH); DACInit(0, 0, 1, DrvDACSync); @@ -775,7 +770,7 @@ static INT32 DrvFrame() if (pBurnSoundOut && (i%8) == 7) { INT32 nSegmentLength = nBurnSoundLen / (nInterleave / 8); INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); + AY8910Render2(pSoundBuf, nSegmentLength); SN76477_sound_update(0, pSoundBuf, nSegmentLength); nSoundBufferPos += nSegmentLength; } @@ -785,7 +780,7 @@ static INT32 DrvFrame() INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); if (nSegmentLength) { - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); + AY8910Render2(pSoundBuf, nSegmentLength); SN76477_sound_update(0, pSoundBuf, nSegmentLength); } diff --git a/src/burn/drv/pre90s/d_scregg.cpp b/src/burn/drv/pre90s/d_scregg.cpp index 59d534a91..f04032635 100644 --- a/src/burn/drv/pre90s/d_scregg.cpp +++ b/src/burn/drv/pre90s/d_scregg.cpp @@ -21,9 +21,6 @@ static UINT8 *DrvVidRAM; static UINT8 *Drv6502RAM; static UINT8 *DrvColRAM; -static INT16 *pAY8910Buffer[6]; -static INT16 *pFMBuffer = NULL; - static UINT32 *DrvPalette; static UINT8 DrvRecalc; @@ -100,22 +97,6 @@ static struct BurnDIPInfo DrvDIPList[]= STDDIPINFO(Drv) -// Delay allocation of buffer. This allows us to use the proper frames/sec frame rate. -static inline void DrvDelayAY8910BufferAllocation() -{ - if (pFMBuffer == NULL && pBurnSoundOut) - { - pFMBuffer = (INT16*)BurnMalloc(nBurnSoundLen * sizeof(INT16) * 6); - - pAY8910Buffer[0] = pFMBuffer + nBurnSoundLen * 0; - pAY8910Buffer[1] = pFMBuffer + nBurnSoundLen * 1; - pAY8910Buffer[2] = pFMBuffer + nBurnSoundLen * 2; - pAY8910Buffer[3] = pFMBuffer + nBurnSoundLen * 3; - pAY8910Buffer[4] = pFMBuffer + nBurnSoundLen * 4; - pAY8910Buffer[5] = pFMBuffer + nBurnSoundLen * 5; - } -} - static inline INT32 calc_mirror_offset(UINT16 address) { return ((address >> 5) & 0x1f) + ((address & 0x1f) << 5); @@ -430,8 +411,8 @@ static INT32 DrvInit(void (*m6502Init)(), INT32 (*pLoadCB)()) BurnSetRefreshRate(57); - AY8910Init(0, 1500000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910Init(1, 1500000, nBurnSoundRate, NULL, NULL, NULL, NULL); + AY8910Init2(0, 1500000, 0); + AY8910Init2(1, 1500000, 1); AY8910SetAllRoutes(0, 0.23, BURN_SND_ROUTE_BOTH); AY8910SetAllRoutes(1, 0.23, BURN_SND_ROUTE_BOTH); @@ -451,7 +432,6 @@ static INT32 DrvExit() AY8910Exit(1); BurnFree (AllMem); - BurnFree (pFMBuffer); return 0; } @@ -529,8 +509,6 @@ static INT32 DrvDraw() static INT32 DrvFrame() { - DrvDelayAY8910BufferAllocation(); - if (DrvReset) { DrvDoReset(); } @@ -562,7 +540,7 @@ static INT32 DrvFrame() M6502Close(); if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); + AY8910Render2(pBurnSoundOut, nBurnSoundLen); } if (pBurnDraw) { diff --git a/src/burn/drv/pre90s/d_seicross.cpp b/src/burn/drv/pre90s/d_seicross.cpp index 3457465b4..414645ce3 100644 --- a/src/burn/drv/pre90s/d_seicross.cpp +++ b/src/burn/drv/pre90s/d_seicross.cpp @@ -31,8 +31,6 @@ static UINT8 *DrvVidRegs; static UINT32 *DrvPalette; static UINT8 DrvRecalc; -static INT16 *pAY8910Buffer[3]; - static UINT8 irq_mask; static UINT8 flipscreen; static UINT8 portb_data; @@ -432,10 +430,6 @@ static INT32 MemIndex() RamEnd = Next; - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - MemEnd = Next; return 0; @@ -524,7 +518,8 @@ static INT32 DrvInit(INT32 select) NSC8105SetWriteHandler(seicross_mcu_write); NSC8105SetReadHandler(seicross_mcu_read); - AY8910Init(0, 1536000, nBurnSoundRate, NULL, &ay8910_read_B, NULL, &ay8910_write_B); + AY8910Init2(0, 1536000, 0); + AY8910SetPorts(0, NULL, &ay8910_read_B, NULL, &ay8910_write_B); AY8910SetAllRoutes(0, 0.25, BURN_SND_ROUTE_BOTH); DACInit(0, 0, 1, syncronize_dac); @@ -738,7 +733,7 @@ static INT32 DrvFrame() if (pBurnSoundOut) { INT32 nSegmentLength = nBurnSoundLen / nInterleave; INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); + AY8910Render2(pSoundBuf, nSegmentLength); nSoundBufferPos += nSegmentLength; } @@ -750,7 +745,7 @@ static INT32 DrvFrame() INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); if (nSegmentLength) { - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); + AY8910Render2(pSoundBuf, nSegmentLength); } DACUpdate(pBurnSoundOut, nBurnSoundLen); } diff --git a/src/burn/drv/pre90s/d_skyarmy.cpp b/src/burn/drv/pre90s/d_skyarmy.cpp index d5a814509..0ec6774bc 100644 --- a/src/burn/drv/pre90s/d_skyarmy.cpp +++ b/src/burn/drv/pre90s/d_skyarmy.cpp @@ -39,8 +39,6 @@ static UINT32 *DrvPalette; static UINT8 DrvRecalc; -static INT16 *pAY8910Buffer[3]; - static UINT8 DrvInputs[3]; static UINT8 DrvDips[1]; static UINT8 DrvJoy1[8]; @@ -359,11 +357,6 @@ static INT32 MemIndex() RamEnd = Next; - pAY8910Buffer[0] = (INT16 *)Next; Next += nBurnSoundLen * sizeof(INT16); // allocate ram for sound output - pAY8910Buffer[1] = (INT16 *)Next; Next += nBurnSoundLen * sizeof(INT16); // only really necessary for ay8910 - pAY8910Buffer[2] = (INT16 *)Next; Next += nBurnSoundLen * sizeof(INT16); - - MemEnd = Next; return 0; @@ -461,7 +454,7 @@ static INT32 DrvInit() ZetClose(); // close cpu to further modifications - AY8910Init(0, 2500000, nBurnSoundRate, NULL, NULL, NULL, NULL); // MDRV_SOUND_ADD("aysnd", AY8910, 2500000) + AY8910Init2(0, 2500000, 0); // MDRV_SOUND_ADD("aysnd", AY8910, 2500000) AY8910SetAllRoutes(0, 0.15, BURN_SND_ROUTE_BOTH); GenericTilesInit(); // this must be called for generic tile handling @@ -626,7 +619,7 @@ static INT32 DrvFrame() if (pBurnSoundOut) { INT32 nSegmentLength = nBurnSoundLen / nInterleave; INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); + AY8910Render2(pSoundBuf, nSegmentLength); nSoundBufferPos += nSegmentLength; } } @@ -641,7 +634,7 @@ static INT32 DrvFrame() INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); if (nSegmentLength) { - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); + AY8910Render2( pSoundBuf, nSegmentLength); } } diff --git a/src/burn/drv/pre90s/d_snk.cpp b/src/burn/drv/pre90s/d_snk.cpp index 274b32b1d..44ab431c6 100644 --- a/src/burn/drv/pre90s/d_snk.cpp +++ b/src/burn/drv/pre90s/d_snk.cpp @@ -39,8 +39,6 @@ static UINT8 *DrvSprRAM; static UINT8 *DrvTxtRAM; static UINT8 *DrvTransTab; -static INT16 *pAY8910Buffer[6]; - static UINT32 *DrvPalette; static UINT8 DrvRecalc; @@ -4044,13 +4042,6 @@ static INT32 MemIndex() RamEnd = Next; - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[3] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[4] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[5] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - MemEnd = Next; return 0; @@ -4693,10 +4684,10 @@ static INT32 MarvinsInit() ZetSetReadHandler(marvins_sound_read); ZetClose(); - AY8910Init(0, 2000000, nBurnSoundRate, NULL, NULL, NULL, NULL); + AY8910Init2(0, 2000000, 0); AY8910SetAllRoutes(0, 0.20, BURN_SND_ROUTE_BOTH); - AY8910Init(1, 2000000, nBurnSoundRate, NULL, NULL, NULL, NULL); + AY8910Init2(1, 2000000, 1); AY8910SetAllRoutes(1, 0.20, BURN_SND_ROUTE_BOTH); snkwave_volume = 0.50; @@ -4756,10 +4747,10 @@ static INT32 MadcrashInit() ZetSetReadHandler(marvins_sound_read); ZetClose(); - AY8910Init(0, 2000000, nBurnSoundRate, NULL, NULL, NULL, NULL); + AY8910Init2(0, 2000000, 0); AY8910SetAllRoutes(0, 0.25, BURN_SND_ROUTE_BOTH); - AY8910Init(1, 2000000, nBurnSoundRate, NULL, NULL, NULL, NULL); + AY8910Init2(1, 2000000, 1); AY8910SetAllRoutes(1, 0.25, BURN_SND_ROUTE_BOTH); snkwave_volume = 0.30; // for vangrd2 @@ -4819,10 +4810,10 @@ static INT32 MadcrushInit() ZetSetReadHandler(marvins_sound_read); ZetClose(); - AY8910Init(0, 2000000, nBurnSoundRate, NULL, NULL, NULL, NULL); + AY8910Init2(0, 2000000, 0); AY8910SetAllRoutes(0, 0.35, BURN_SND_ROUTE_BOTH); - AY8910Init(1, 2000000, nBurnSoundRate, NULL, NULL, NULL, NULL); + AY8910Init2(1, 2000000, 1); AY8910SetAllRoutes(1, 0.35, BURN_SND_ROUTE_BOTH); GenericTilesInit(); @@ -4875,10 +4866,10 @@ static INT32 JcrossInit() ZetSetInHandler(jcross_sound_read_port); ZetClose(); - AY8910Init(0, 2000000, nBurnSoundRate, NULL, NULL, NULL, NULL); + AY8910Init2(0, 2000000, 0); AY8910SetAllRoutes(0, 0.15, BURN_SND_ROUTE_BOTH); - AY8910Init(1, 2000000, nBurnSoundRate, NULL, NULL, NULL, NULL); + AY8910Init2(1, 2000000, 1); AY8910SetAllRoutes(1, 0.15, BURN_SND_ROUTE_BOTH); GenericTilesInit(); @@ -4932,10 +4923,10 @@ static INT32 SgladiatInit() ZetSetInHandler(jcross_sound_read_port); ZetClose(); - AY8910Init(0, 2000000, nBurnSoundRate, NULL, NULL, NULL, NULL); + AY8910Init2(0, 2000000, 0); AY8910SetAllRoutes(0, 0.35, BURN_SND_ROUTE_BOTH); - AY8910Init(1, 2000000, nBurnSoundRate, NULL, NULL, NULL, NULL); + AY8910Init2(1, 2000000, 1); AY8910SetAllRoutes(1, 0.35, BURN_SND_ROUTE_BOTH); GenericTilesInit(); @@ -4988,10 +4979,10 @@ static INT32 Hal21Init() ZetSetReadHandler(jcross_sound_read); ZetClose(); - AY8910Init(0, 2000000, nBurnSoundRate, NULL, NULL, NULL, NULL); + AY8910Init2(0, 2000000, 0); AY8910SetAllRoutes(0, 0.15, BURN_SND_ROUTE_BOTH); - AY8910Init(1, 2000000, nBurnSoundRate, NULL, NULL, NULL, NULL); + AY8910Init2(1, 2000000, 1); AY8910SetAllRoutes(1, 0.15, BURN_SND_ROUTE_BOTH); GenericTilesInit(); @@ -6171,7 +6162,7 @@ static INT32 MarvinsFrame() } if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); + AY8910Render2(pBurnSoundOut, nBurnSoundLen); snkwave_render(pBurnSoundOut, nBurnSoundLen); } @@ -6235,7 +6226,7 @@ static INT32 JcrossFrame() if (pBurnSoundOut && i%8==7) { INT32 nSegmentLength = nBurnSoundLen / 100; //nInterleave; INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); + AY8910Render2(pSoundBuf, nSegmentLength); nSoundBufferPos += nSegmentLength; } } @@ -6245,7 +6236,7 @@ static INT32 JcrossFrame() INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); if (nSegmentLength) { - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); + AY8910Render2(pSoundBuf, nSegmentLength); } } diff --git a/src/burn/drv/pre90s/d_solomon.cpp b/src/burn/drv/pre90s/d_solomon.cpp index b27ec678b..fb883bc31 100644 --- a/src/burn/drv/pre90s/d_solomon.cpp +++ b/src/burn/drv/pre90s/d_solomon.cpp @@ -3,7 +3,6 @@ #include "tiles_generic.h" #include "z80_intf.h" - #include "driver.h" extern "C" { #include "ay8910.h" @@ -41,9 +40,6 @@ static INT32 SolomonIrqFire = 0; static INT32 SolomonFlipScreen = 0; static INT32 SolomonSoundLatch = 0; -static INT16* pFMBuffer; -static INT16* pAY8910Buffer[9]; - static INT32 nCyclesDone[2], nCyclesTotal[2]; static INT32 nCyclesSegment; @@ -208,7 +204,7 @@ static struct BurnRomInfo SolomonjRomDesc[] = { STD_ROM_PICK(Solomonj) STD_ROM_FN(Solomonj) -INT32 SolomonDoReset() +static INT32 SolomonDoReset() { SolomonIrqFire = 0; SolomonFlipScreen = 0; @@ -229,7 +225,7 @@ INT32 SolomonDoReset() return 0; } -UINT8 __fastcall SolomonRead1(UINT16 a) +static UINT8 __fastcall SolomonRead1(UINT16 a) { switch (a) { case 0xe600: { @@ -256,7 +252,7 @@ UINT8 __fastcall SolomonRead1(UINT16 a) return 0; } -void __fastcall SolomonWrite1(UINT16 a, UINT8 d) +static void __fastcall SolomonWrite1(UINT16 a, UINT8 d) { switch (a) { case 0xe600: { @@ -281,7 +277,7 @@ void __fastcall SolomonWrite1(UINT16 a, UINT8 d) } } -UINT8 __fastcall SolomonRead2(UINT16 a) +static UINT8 __fastcall SolomonRead2(UINT16 a) { switch (a) { case 0x8000: { @@ -292,7 +288,7 @@ UINT8 __fastcall SolomonRead2(UINT16 a) return 0; } -void __fastcall SolomonPortWrite2(UINT16 a, UINT8 d) +static void __fastcall SolomonPortWrite2(UINT16 a, UINT8 d) { a &= 0xff; @@ -352,7 +348,7 @@ static INT32 SolomonMemIndex() SolomonBgTiles = Next; Next += 2048 * 8 * 8; SolomonFgTiles = Next; Next += 2048 * 8 * 8; SolomonSprites = Next; Next += 2048 * 8 * 8; - pFMBuffer = (INT16*)Next; Next += nBurnSoundLen * 9 * sizeof(INT16); + SolomonPalette = (UINT32*)Next; Next += 0x00200 * sizeof(UINT32); MemEnd = Next; @@ -459,19 +455,9 @@ INT32 SolomonInit() BurnFree(SolomonTempRom); - pAY8910Buffer[0] = pFMBuffer + nBurnSoundLen * 0; - pAY8910Buffer[1] = pFMBuffer + nBurnSoundLen * 1; - pAY8910Buffer[2] = pFMBuffer + nBurnSoundLen * 2; - pAY8910Buffer[3] = pFMBuffer + nBurnSoundLen * 3; - pAY8910Buffer[4] = pFMBuffer + nBurnSoundLen * 4; - pAY8910Buffer[5] = pFMBuffer + nBurnSoundLen * 5; - pAY8910Buffer[6] = pFMBuffer + nBurnSoundLen * 6; - pAY8910Buffer[7] = pFMBuffer + nBurnSoundLen * 7; - pAY8910Buffer[8] = pFMBuffer + nBurnSoundLen * 8; - - AY8910Init(0, 1500000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910Init(1, 1500000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910Init(2, 1500000, nBurnSoundRate, NULL, NULL, NULL, NULL); + AY8910Init2(0, 1500000, 0); + AY8910Init2(1, 1500000, 1); + AY8910Init2(2, 1500000, 1); AY8910SetAllRoutes(0, 0.12, BURN_SND_ROUTE_BOTH); AY8910SetAllRoutes(1, 0.12, BURN_SND_ROUTE_BOTH); AY8910SetAllRoutes(2, 0.12, BURN_SND_ROUTE_BOTH); @@ -717,7 +703,7 @@ INT32 SolomonFrame() if (pBurnSoundOut) { INT32 nSegmentLength = nBurnSoundLen / nInterleave; INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); + AY8910Render2(pSoundBuf, nSegmentLength); nSoundBufferPos += nSegmentLength; } } @@ -727,7 +713,7 @@ INT32 SolomonFrame() INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); if (nSegmentLength) { - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); + AY8910Render2(pSoundBuf, nSegmentLength); } } diff --git a/src/burn/drv/pre90s/d_suna8.cpp b/src/burn/drv/pre90s/d_suna8.cpp index 8b5904cfe..0738b2db7 100644 --- a/src/burn/drv/pre90s/d_suna8.cpp +++ b/src/burn/drv/pre90s/d_suna8.cpp @@ -44,7 +44,6 @@ static UINT8 *nmi_enable; static UINT8 *mainbank; static INT16 *DrvSamplesExp; -static INT16 *pAY8910Buffer[3]; static UINT32 *DrvPalette; static UINT8 DrvRecalc; @@ -1085,10 +1084,6 @@ static INT32 MemIndex() RamEnd = Next; - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - MemEnd = Next; return 0; @@ -1372,7 +1367,8 @@ static INT32 HardheadInit() BurnTimerAttachZetYM3812(3000000); BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 1.00, BURN_SND_ROUTE_BOTH); - AY8910Init(0, 1500000, nBurnSoundRate, NULL, NULL, &hardhead_ay8910_write_A, &hardhead_ay8910_write_B); + AY8910Init2(0, 1500000, 1); + AY8910SetPorts(0, NULL, NULL, &hardhead_ay8910_write_A, &hardhead_ay8910_write_B); AY8910SetAllRoutes(0, 0.30, BURN_SND_ROUTE_BOTH); GenericTilesInit(); @@ -1455,7 +1451,8 @@ static INT32 SparkmanInit() BurnTimerAttachZetYM3812(6000000); BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 1.00, BURN_SND_ROUTE_BOTH); - AY8910Init(0, 1500000, nBurnSoundRate, NULL, NULL, &hardhead_ay8910_write_A, &hardhead_ay8910_write_B); + AY8910Init2(0, 1500000, 1); + AY8910SetPorts(0, NULL, NULL, &hardhead_ay8910_write_A, &hardhead_ay8910_write_B); AY8910SetAllRoutes(0, 0.30, BURN_SND_ROUTE_BOTH); GenericTilesInit(); @@ -1611,7 +1608,8 @@ static INT32 StarfighInit() BurnTimerAttachZetYM3812(6000000); BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 1.00, BURN_SND_ROUTE_BOTH); - AY8910Init(0, 1500000, nBurnSoundRate, NULL, NULL, &hardhead_ay8910_write_A, &hardhead_ay8910_write_B); + AY8910Init2(0, 1500000, 1); + AY8910SetPorts(0, NULL, NULL, &hardhead_ay8910_write_A, &hardhead_ay8910_write_B); AY8910SetAllRoutes(0, 0.30, BURN_SND_ROUTE_BOTH); GenericTilesInit(); @@ -1812,7 +1810,7 @@ static INT32 Hardhea2Init() BurnTimerAttachZetYM3812(6000000); BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 1.00, BURN_SND_ROUTE_BOTH); - AY8910Init(0, 1500000, nBurnSoundRate, NULL, NULL, NULL, NULL); + AY8910Init2(0, 1500000, 1); AY8910SetAllRoutes(0, 0.33, BURN_SND_ROUTE_BOTH); DACInit(0, 0, 1, DrvSyncDAC); @@ -2174,7 +2172,7 @@ static INT32 HardheadFrame() if (pBurnSoundOut) { BurnYM3812Update(pBurnSoundOut, nBurnSoundLen); - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 1); + AY8910Render2(pBurnSoundOut, nBurnSoundLen); sample_render(pBurnSoundOut, nBurnSoundLen); } ZetClose(); @@ -2300,7 +2298,7 @@ static INT32 Hardhea2Frame() if (pBurnSoundOut) { ZetOpen(1); BurnYM3812Update(pBurnSoundOut, nBurnSoundLen); - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 1); + AY8910Render2(pBurnSoundOut, nBurnSoundLen); ZetClose(); ZetOpen(2); DACUpdate(pBurnSoundOut, nBurnSoundLen); @@ -2367,7 +2365,7 @@ static INT32 SparkmanFrame() // & starfigh if (pBurnSoundOut) { BurnYM3812Update(pBurnSoundOut, nBurnSoundLen); - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 1); + AY8910Render2(pBurnSoundOut, nBurnSoundLen); sample_render(pBurnSoundOut, nBurnSoundLen); } ZetClose(); diff --git a/src/burn/drv/pre90s/d_thepit.cpp b/src/burn/drv/pre90s/d_thepit.cpp index 4f42b4ac6..6e0dbbc81 100644 --- a/src/burn/drv/pre90s/d_thepit.cpp +++ b/src/burn/drv/pre90s/d_thepit.cpp @@ -29,8 +29,6 @@ static UINT8 *DrvSprRAM; static UINT32 *DrvPalette; static UINT8 DrvRecalc; -static INT16 *pAY8910Buffer[6]; - static UINT8 nmi_mask; static UINT8 sound_enable; static UINT8 flipscreen[2]; @@ -634,13 +632,6 @@ static INT32 MemIndex() RamEnd = Next; - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[3] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[4] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[5] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - MemEnd = Next; return 0; @@ -776,8 +767,9 @@ static INT32 DrvInit() BurnWatchdogInit(DrvDoReset, 180); - AY8910Init(0, 1536000, nBurnSoundRate, &AY8910_0_portA, NULL, NULL, NULL); - AY8910Init(1, 1536000, nBurnSoundRate, NULL, NULL, NULL, NULL); + AY8910Init2(0, 1536000, 0); + AY8910Init2(1, 1536000, 1); + AY8910SetPorts(0, &AY8910_0_portA, NULL, NULL, NULL); AY8910SetAllRoutes(0, 0.25, BURN_SND_ROUTE_BOTH); AY8910SetAllRoutes(1, 0.25, BURN_SND_ROUTE_BOTH); @@ -1017,7 +1009,7 @@ static INT32 DrvFrame() if (pBurnSoundOut) { if (sound_enable) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); + AY8910Render2(pBurnSoundOut, nBurnSoundLen); } else { memset (pBurnSoundOut, 0, nBurnSoundLen * 2 * sizeof(INT16)); } diff --git a/src/burn/drv/pre90s/d_timelimt.cpp b/src/burn/drv/pre90s/d_timelimt.cpp index 96d05ed16..8de9e9d65 100644 --- a/src/burn/drv/pre90s/d_timelimt.cpp +++ b/src/burn/drv/pre90s/d_timelimt.cpp @@ -27,13 +27,11 @@ static UINT8 *DrvColPROM; static UINT32 *DrvPalette; static UINT8 DrvRecalc; -static INT16 *pAY8910Buffer[6]; - -static UINT8 DrvJoy1[8]; -static UINT8 DrvJoy2[8]; -static UINT8 DrvDips[1]; -static UINT8 DrvInputs[2]; -static UINT8 DrvReset; +static UINT8 DrvJoy1[8]; +static UINT8 DrvJoy2[8]; +static UINT8 DrvDips[1]; +static UINT8 DrvInputs[2]; +static UINT8 DrvReset; static UINT8 soundlatch; static UINT8 nmi_enable; @@ -285,13 +283,6 @@ static INT32 MemIndex() RamEnd = Next; - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[3] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[4] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[5] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - MemEnd = Next; return 0; @@ -419,10 +410,11 @@ static INT32 DrvInit() ZetSetInHandler(timelimt_sound_read_port); ZetClose(); - AY8910Init(0, 1536000, nBurnSoundRate, NULL, NULL, NULL, NULL); + AY8910Init2(0, 1536000, 0); AY8910SetAllRoutes(0, 0.25, BURN_SND_ROUTE_BOTH); - AY8910Init(1, 1536000, nBurnSoundRate, &timelimt_ay8910_1_portA_read, NULL, NULL, NULL); + AY8910Init2(1, 1536000, 1); + AY8910SetPorts(1, &timelimt_ay8910_1_portA_read, NULL, NULL, NULL); AY8910SetAllRoutes(1, 0.25, BURN_SND_ROUTE_BOTH); GenericTilesInit(); @@ -616,7 +608,7 @@ static INT32 DrvFrame() } if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); + AY8910Render2(pBurnSoundOut, nBurnSoundLen); } if (pBurnDraw) { diff --git a/src/burn/drv/pre90s/d_travrusa.cpp b/src/burn/drv/pre90s/d_travrusa.cpp index a6eaba2cd..e7963d42e 100644 --- a/src/burn/drv/pre90s/d_travrusa.cpp +++ b/src/burn/drv/pre90s/d_travrusa.cpp @@ -29,8 +29,6 @@ static UINT8 *DrvSprRAM; static UINT32 *DrvPalette; static UINT8 DrvRecalc; -static INT16 *pAY8910Buffer[6]; - static UINT8 m6803_port1; static UINT8 m6803_port2; static UINT8 flipscreen; @@ -441,19 +439,12 @@ static INT32 MemIndex() AllRam = Next; DrvZ80RAM = Next; Next += 0x001000; - M62M6803Ram = Next; Next += 0x000100; + M62M6803Ram = Next; Next += 0x000100; DrvVidRAM = Next; Next += 0x001000; DrvSprRAM = Next; Next += 0x000200; RamEnd = Next; - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[3] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[4] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[5] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - MemEnd = Next; return 0; @@ -623,8 +614,10 @@ static INT32 DrvInit(void (*pRomCallback)(), INT32 sndromsmall, INT32 gfxtype) MSM5205Init(0, DrvSynchroniseStream, 384000, adpcm_int, MSM5205_S96_4B, 1); MSM5205SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); - AY8910Init(0, 3579545/4, nBurnSoundRate, &ay8910_0_read_A, NULL, NULL, &ay8910_0_write_B); - AY8910Init(1, 3579545/4, nBurnSoundRate, NULL, NULL, NULL, &ay8910_1_write_B); + AY8910Init2(0, 3579545/4, 0); + AY8910Init2(1, 3579545/4, 1); + AY8910SetPorts(0, &ay8910_0_read_A, NULL, NULL, &ay8910_0_write_B); + AY8910SetPorts(1, NULL, NULL, NULL, &ay8910_1_write_B); AY8910SetAllRoutes(0, 0.15, BURN_SND_ROUTE_BOTH); AY8910SetAllRoutes(1, 0.15, BURN_SND_ROUTE_BOTH); @@ -794,7 +787,7 @@ static INT32 DrvFrame() } if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); + AY8910Render2(pBurnSoundOut, nBurnSoundLen); MSM5205Render(0, pBurnSoundOut, nBurnSoundLen); } diff --git a/src/burn/drv/pre90s/d_tsamurai.cpp b/src/burn/drv/pre90s/d_tsamurai.cpp index 6b70d11c6..bccf8759f 100644 --- a/src/burn/drv/pre90s/d_tsamurai.cpp +++ b/src/burn/drv/pre90s/d_tsamurai.cpp @@ -36,8 +36,6 @@ static UINT8 *DrvSprRAM; static UINT32 *DrvPalette; static UINT8 DrvRecalc; -static INT16 *pAY8910Buffer[3]; - static UINT8 flipscreen; static UINT8 scrollx; static UINT8 scrolly; @@ -778,10 +776,6 @@ static INT32 MemIndex() RamEnd = Next; - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - MemEnd = Next; return 0; @@ -973,7 +967,7 @@ static INT32 DrvInit(INT32 game) ZetSetReadHandler(tsamurai_sound1_read); ZetClose(); - AY8910Init(0, 3000000, nBurnSoundRate, NULL, NULL, NULL, NULL); + AY8910Init2(0, 3000000, 0); AY8910SetAllRoutes(0, 0.10, BURN_SND_ROUTE_BOTH); DACInit(0, 0, 0, DrvSyncDAC); @@ -1098,7 +1092,7 @@ static INT32 m660CommonInit(INT32 game) ZetSetOutHandler(tsamurai_main_out_port); // re-use this since it's the same ZetClose(); - AY8910Init(0, 3000000, nBurnSoundRate, NULL, NULL, NULL, NULL); + AY8910Init2(0, 3000000, 0); AY8910SetAllRoutes(0, 0.10, BURN_SND_ROUTE_BOTH); DACInit(0, 0, 0, DrvSyncDAC); @@ -1190,7 +1184,7 @@ static INT32 VsgongfCommonInit(INT32 game) ZetSetOutHandler(tsamurai_main_out_port); // re-use this since it's the same ZetClose(); - AY8910Init(0, 3000000, nBurnSoundRate, NULL, NULL, NULL, NULL); + AY8910Init2(0, 3000000, 0); AY8910SetAllRoutes(0, 0.10, BURN_SND_ROUTE_BOTH); DACInit(0, 0, 0, DrvSyncDAC); @@ -1395,7 +1389,7 @@ static INT32 DrvFrame() if (pBurnSoundOut) { DACUpdate(pBurnSoundOut, nBurnSoundLen); - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 1); + AY8910Render2(pBurnSoundOut, nBurnSoundLen); } if (pBurnDraw) { diff --git a/src/burn/drv/pre90s/d_vastar.cpp b/src/burn/drv/pre90s/d_vastar.cpp index 018938349..d32d7b00e 100644 --- a/src/burn/drv/pre90s/d_vastar.cpp +++ b/src/burn/drv/pre90s/d_vastar.cpp @@ -27,8 +27,6 @@ static UINT8 *DrvVidRAM2; static UINT32 *DrvPalette; static UINT8 DrvRecalc; -static INT16 *pAY8910Buffer[3]; - static UINT8 DrvJoy1[8]; static UINT8 DrvJoy2[8]; static UINT8 DrvJoy3[8]; @@ -432,10 +430,6 @@ static INT32 MemIndex() RamEnd = Next; - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - MemEnd = Next; return 0; @@ -615,7 +609,8 @@ static INT32 DrvInit(INT32 load_type) ZetSetInHandler(vastar_sound_read_port); ZetClose(); - AY8910Init(0, 1536000, nBurnSoundRate, &vastar_ay8910_read_A, &vastar_ay8910_read_B, NULL, NULL); + AY8910Init2(0, 1536000, 0); + AY8910SetPorts(0, &vastar_ay8910_read_A, &vastar_ay8910_read_B, NULL, NULL); AY8910SetAllRoutes(0, 0.15, BURN_SND_ROUTE_BOTH); GenericTilesInit(); @@ -846,7 +841,7 @@ static INT32 DrvFrame() } if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); + AY8910Render2(pBurnSoundOut, nBurnSoundLen); } if (pBurnDraw) { diff --git a/src/burn/drv/pre90s/d_vulgus.cpp b/src/burn/drv/pre90s/d_vulgus.cpp index 7b3bde41e..ace40e694 100644 --- a/src/burn/drv/pre90s/d_vulgus.cpp +++ b/src/burn/drv/pre90s/d_vulgus.cpp @@ -24,8 +24,6 @@ static UINT8 *DrvFgRAM; static UINT8 *DrvBgRAM; static UINT8 *DrvSprRAM; -static INT16 *pAY8910Buffer[6]; - static UINT32 *DrvPalette; static UINT8 DrvRecalc; @@ -246,13 +244,6 @@ static INT32 MemIndex() RamEnd = Next; - pAY8910Buffer[0] = (INT16*) Next; Next += nBurnSoundLen; - pAY8910Buffer[1] = (INT16*) Next; Next += nBurnSoundLen; - pAY8910Buffer[2] = (INT16*) Next; Next += nBurnSoundLen; - pAY8910Buffer[3] = (INT16*) Next; Next += nBurnSoundLen; - pAY8910Buffer[4] = (INT16*) Next; Next += nBurnSoundLen; - pAY8910Buffer[5] = (INT16*) Next; Next += nBurnSoundLen; - MemEnd = Next; return 0; @@ -353,8 +344,8 @@ static INT32 DrvInit() ZetSetReadHandler(vulgus_read_sound); ZetClose(); - AY8910Init(0, 1500000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910Init(1, 1500000, nBurnSoundRate, NULL, NULL, NULL, NULL); + AY8910Init2(0, 1500000, 0); + AY8910Init2(1, 1500000, 1); AY8910SetAllRoutes(0, 0.25, BURN_SND_ROUTE_BOTH); AY8910SetAllRoutes(1, 0.25, BURN_SND_ROUTE_BOTH); @@ -555,7 +546,7 @@ static INT32 DrvFrame() if (pBurnSoundOut) { INT32 nSegmentLength = nBurnSoundLen / nInterleave; INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); + AY8910Render2(pSoundBuf, nSegmentLength); nSoundBufferPos += nSegmentLength; } } @@ -564,7 +555,7 @@ static INT32 DrvFrame() INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); if (nSegmentLength) { - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); + AY8910Render2(pSoundBuf, nSegmentLength); } } @@ -802,4 +793,4 @@ struct BurnDriver BurnDrvmach9 = { NULL, mach9RomInfo, mach9RomName, NULL, NULL, DrvInputInfo, DrvDIPInfo, DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800, 224, 256, 3, 4 -}; \ No newline at end of file +}; diff --git a/src/burn/drv/pre90s/d_wallc.cpp b/src/burn/drv/pre90s/d_wallc.cpp index 939431807..0746e5349 100644 --- a/src/burn/drv/pre90s/d_wallc.cpp +++ b/src/burn/drv/pre90s/d_wallc.cpp @@ -22,8 +22,6 @@ static UINT8 *DrvVidRAM; static UINT32 *DrvPalette; static UINT8 DrvRecalc; -static INT16 *pAY8910Buffer[3]; - static UINT8 DrvJoy1[8]; static UINT8 DrvJoy2[8]; static UINT8 DrvDips[2]; @@ -33,18 +31,18 @@ static UINT8 DrvReset; static UINT8 Dial1; static struct BurnInputInfo WallcInputList[] = { - {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 4, "p1 coin" }, - {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, + {"P1 Coin", BIT_DIGITAL, DrvJoy1 + 4, "p1 coin" }, + {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" }, - {"P1 Left", BIT_DIGITAL, DrvJoy2 + 0, "p1 left"}, - {"P1 Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right"}, - {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 3, "p1 fire 1" }, - {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 0, "p1 fire 2" }, + {"P1 Left", BIT_DIGITAL, DrvJoy2 + 0, "p1 left" }, + {"P1 Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right" }, + {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 3, "p1 fire 1" }, + {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 0, "p1 fire 2" }, - {"Service", BIT_DIGITAL, DrvJoy1 + 6, "service" }, - {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, - {"Dip 1", BIT_DIPSWITCH, DrvDips + 0, "dip" }, - {"Dip 2", BIT_DIPSWITCH, DrvDips + 1, "dip" }, + {"Service", BIT_DIGITAL, DrvJoy1 + 6, "service" }, + {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, + {"Dip 1", BIT_DIPSWITCH, DrvDips + 0, "dip" }, + {"Dip 2", BIT_DIPSWITCH, DrvDips + 1, "dip" }, }; STDINPUTINFO(Wallc) @@ -89,7 +87,7 @@ static struct BurnDIPInfo WallcDIPList[]= STDDIPINFO(Wallc) -void __fastcall wallc_write(UINT16 address, UINT8 data) +static void __fastcall wallc_write(UINT16 address, UINT8 data) { switch (address) { @@ -103,7 +101,7 @@ void __fastcall wallc_write(UINT16 address, UINT8 data) } } -UINT8 __fastcall wallc_read(UINT16 address) +static UINT8 __fastcall wallc_read(UINT16 address) { switch (address) { @@ -202,10 +200,6 @@ static INT32 MemIndex() RamEnd = Next; - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - MemEnd = Next; return 0; @@ -236,19 +230,17 @@ static INT32 DrvInit(INT32 incr) ZetInit(0); ZetOpen(0); - ZetMapMemory(DrvZ80ROM, 0x0000, 0x7fff, MAP_ROM); ZetMapMemory(DrvVidRAM, 0x8000, 0x83ff, MAP_RAM); ZetMapMemory(DrvVidRAM, 0x8400, 0x87ff, MAP_RAM); ZetMapMemory(DrvVidRAM, 0x8800, 0x8bff, MAP_RAM); ZetMapMemory(DrvVidRAM, 0x8c00, 0x8fff, MAP_RAM); ZetMapMemory(DrvZ80RAM, 0xa000, 0xa3ff, MAP_RAM); - ZetSetWriteHandler(wallc_write); ZetSetReadHandler(wallc_read); ZetClose(); - AY8910Init(0, 1536000, nBurnSoundRate, NULL, NULL, NULL, NULL); + AY8910Init2(0, 1536000, 0); AY8910SetAllRoutes(0, 0.30, BURN_SND_ROUTE_BOTH); GenericTilesInit(); @@ -321,7 +313,7 @@ static INT32 DrvFrame() ZetClose(); if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); + AY8910Render2(pBurnSoundOut, nBurnSoundLen); } if (pBurnDraw) { diff --git a/src/burn/drv/pre90s/d_wiz.cpp b/src/burn/drv/pre90s/d_wiz.cpp index 59cd22918..490d8bf0b 100644 --- a/src/burn/drv/pre90s/d_wiz.cpp +++ b/src/burn/drv/pre90s/d_wiz.cpp @@ -44,8 +44,6 @@ static UINT8 *char_bank_select; static UINT8 *screen_flip; static UINT8 *background_color; -static INT16 *pAY8910Buffer[9]; - static UINT8 DrvInputs[2]; static UINT8 DrvJoy1[8]; static UINT8 DrvJoy2[8]; @@ -712,12 +710,6 @@ static INT32 MemIndex() RamEnd = Next; - { - for (INT32 i = 0; i < 9; i++) { - pAY8910Buffer[i] = (INT16*)Next; Next += nBurnSoundLen * sizeof(UINT16); - } - } - MemEnd = Next; return 0; @@ -877,16 +869,16 @@ static INT32 DrvInit(int (*RomLoadCallback)()) ZetSetReadHandler(wiz_sound_read); ZetClose(); - AY8910Init(0, 1536000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910Init(1, 1536000, nBurnSoundRate, NULL, NULL, NULL, NULL); - AY8910Init(2, 1536000, nBurnSoundRate, NULL, NULL, NULL, NULL); + AY8910Init2(0, 1536000, 0); + AY8910Init2(1, 1536000, 1); + AY8910Init2(2, 1536000, 1); AY8910SetAllRoutes(0, 0.10, BURN_SND_ROUTE_BOTH); AY8910SetAllRoutes(1, 0.10, BURN_SND_ROUTE_BOTH); AY8910SetAllRoutes(2, 0.10, BURN_SND_ROUTE_BOTH); BurnSampleInit(1); BurnSampleSetAllRoutesAllSamples(0.05, BURN_SND_ROUTE_BOTH); - bHasSamples = BurnSampleGetStatus(0) != -1; + bHasSamples = BurnSampleGetStatus(0) != -1; GenericTilesInit(); @@ -915,7 +907,6 @@ static INT32 DrvExit() return 0; } - static void draw_background(INT16 bank, INT16 palbank, INT16 colortype) { for (INT16 offs = 0x3ff; offs >= 0; offs--) @@ -1117,7 +1108,7 @@ static INT32 DrvFrame() if (pBurnSoundOut) { INT32 nSegmentLength = nBurnSoundLen / nInterleave; INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); + AY8910Render2(pSoundBuf, nSegmentLength); if (bHasSamples) BurnSampleRender(pSoundBuf, nSegmentLength); nSoundBufferPos += nSegmentLength; } @@ -1127,7 +1118,7 @@ static INT32 DrvFrame() INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos; INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1); if (nSegmentLength) { - AY8910Render(&pAY8910Buffer[0], pSoundBuf, nSegmentLength, 0); + AY8910Render2(pSoundBuf, nSegmentLength); if (bHasSamples) BurnSampleRender(pSoundBuf, nSegmentLength); } } diff --git a/src/burn/drv/pre90s/d_zodiack.cpp b/src/burn/drv/pre90s/d_zodiack.cpp index 94d30efe0..11e4c2d11 100644 --- a/src/burn/drv/pre90s/d_zodiack.cpp +++ b/src/burn/drv/pre90s/d_zodiack.cpp @@ -4,11 +4,9 @@ #include "driver.h" #include "z80_intf.h" #include "bitswap.h" - extern "C" { #include "ay8910.h" } -static INT16 *pAY8910Buffer[6]; static UINT8 *AllMem; static UINT8 *MemEnd; @@ -589,35 +587,28 @@ static INT32 MemIndex() DrvZ80ROM1 = Next; Next += 0x10000; DrvPalette = (UINT32*)Next; Next += 0x0100 * sizeof(UINT32); - DrvCharGFX = Next; Next += 0x40000; - DrvChar2GFX = Next; Next += 0x40000; - DrvSpriteGFX = Next; Next += 0x40000; - DrvColorPROM = Next; Next += 0x00400; + DrvCharGFX = Next; Next += 0x40000; + DrvChar2GFX = Next; Next += 0x40000; + DrvSpriteGFX = Next; Next += 0x40000; + DrvColorPROM = Next; Next += 0x00400; AllRam = Next; DrvZ80RAM = Next; Next += 0x01000; DrvZ80RAM1 = Next; Next += 0x01000; - DrvAttrRAM = Next; Next += 0x00400; + DrvAttrRAM = Next; Next += 0x00400; DrvVidRAM = Next; Next += 0x00400; DrvVid2RAM = Next; Next += 0x00400; - DrvBulletRAM = Next; Next += 0x00400; - DrvSpriteRAM = Next; Next += 0x00400; - DrvExtraRAM = Next; Next += 0x00400; + DrvBulletRAM = Next; Next += 0x00400; + DrvSpriteRAM = Next; Next += 0x00400; + DrvExtraRAM = Next; Next += 0x00400; - nmi_mask = Next; Next += 0x00001; - sub_nmi_mask = Next; Next += 0x00001; - soundlatch = Next; Next += 0x00001; + nmi_mask = Next; Next += 0x00001; + sub_nmi_mask = Next; Next += 0x00001; + soundlatch = Next; Next += 0x00001; RamEnd = Next; - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[3] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[4] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[5] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - MemEnd = Next; return 0; @@ -695,7 +686,6 @@ static INT32 DrvGfxDecode() return 0; } - static INT32 DrvInit() { AllMem = NULL; @@ -733,9 +723,9 @@ static INT32 DrvInit() ZetSetOutHandler(audio_out); ZetClose(); - AY8910Init(0, 1536000, nBurnSoundRate, NULL, NULL, NULL, NULL); + AY8910Init2(0, 1536000, 0); AY8910SetAllRoutes(0, 0.50, BURN_SND_ROUTE_BOTH); - AY8910Init(1, 1536000, nBurnSoundRate, NULL, NULL, NULL, NULL); + AY8910Init2(1, 1536000, 1); AY8910SetAllRoutes(1, 0.50, BURN_SND_ROUTE_BOTH); GenericTilesInit(); @@ -745,7 +735,6 @@ static INT32 DrvInit() return 0; } - static INT32 DrvExit() { GenericTilesExit(); @@ -964,7 +953,7 @@ static INT32 DrvFrame() } if (pBurnSoundOut) { - AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0); + AY8910Render2(pBurnSoundOut, nBurnSoundLen); } if (pBurnDraw) {