mirror of
https://github.com/libretro/beetle-finalarcade2019.git
synced 2026-11-07 10:15:58 -10:00
mcr3 wip driver-add (work in progress)
This commit is contained in:
1 parent
a519033c67
commit
8a5084705e
9 files changed
+2822
-13
No files matched your search
+3
-3
@@ -58,7 +58,7 @@ drvsrc = d_arcadecl.cpp d_atarig1.cpp d_badlands.cpp d_batman.cpp d_blstroid.cp
|
||||
d_dynduke.o d_efdt.o d_epos.o d_espial.o d_ettrivia.o d_exedexes.o d_fantland.o d_fastfred.o d_firetrap.o d_flipjack.o d_flower.o d_foodf.o \
|
||||
d_freekick.o d_funkybee.o d_galaga.o d_galivan.o d_gaplus.o d_ginganin.o d_gng.o d_goindol.o d_gunsmoke.o d_headonb.o d_higemaru.o \
|
||||
d_himesiki.o d_holeland.o d_hvyunit.o d_invaders.o d_iqblock.o d_jack.o d_jedi.o d_jrpacman.o d_kangaroo.o d_kncljoe.o d_kyugo.o d_ladybug.o d_lasso.o \
|
||||
d_lastduel.o d_lwings.o d_mainsnk.o d_mappy.o d_marineb.o d_mario.o d_madmotor.o d_markham.o d_mastboyo.o d_matmania.o d_mcr.o d_megasys1.o d_meijinsn.o \
|
||||
d_lastduel.o d_lwings.o d_mainsnk.o d_mappy.o d_marineb.o d_mario.o d_madmotor.o d_markham.o d_mastboyo.o d_matmania.o d_mcr.o d_mcr3.o d_megasys1.o d_meijinsn.o \
|
||||
d_metlfrzr.o d_mhavoc.o d_millipede.o d_mirax.o d_mitchell.o d_mole.o d_momoko.o d_mmagic.o d_mouser.o d_mrdo.o d_mrflea.o d_mrjong.o d_munchmo.o \
|
||||
d_mustache.o d_mystston.o d_namcos1.o d_namcos86.o d_ninjakd2.o d_nitedrvr.o d_naughtyb.o d_olibochu.o d_omegrace.o d_pacland.o d_pacman.o \
|
||||
d_pbaction.o d_pac2650.o d_pengadvb.o d_phoenix.o d_pitnrun.o d_pkunwar.o d_popeye.o d_popper.o d_prehisle.o d_psychic5.o d_pturn.o d_punchout.o \
|
||||
@@ -100,8 +100,8 @@ depobj = burn.o burn_bitmap.o burn_gun.o burn_led.o burn_shift.o burn_memory.o
|
||||
load.o tilemap_generic.o tiles_generic.o timer.o vector.o \
|
||||
\
|
||||
6821pia.o 8255ppi.o 8257dma.o c169.o atariic.o atarijsa.o atarimo.o atarirle.o atarivad.o avgdvg.o bsmt2000.o decobsmt.o earom.o eeprom.o \
|
||||
gaelco_crypt.o joyprocess.o nb1414m4.o nb1414m4_8bit.o nmk004.o nmk112.o kaneko_tmap.o mathbox.o mb87078.o mermaid.o midsat.o midssio.o namco_c45.o namcoio.o \
|
||||
pandora.o resnet.o seibusnd.o sknsspr.o slapstic.o st0020.o t5182.o timekpr.o tms34061.o v3021.o vdc.o tms9928a.o watchdog.o x2212.o \
|
||||
gaelco_crypt.o joyprocess.o nb1414m4.o nb1414m4_8bit.o nmk004.o nmk112.o kaneko_tmap.o mathbox.o mb87078.o mermaid.o midcsd.o midsat.o midsg.o midssio.o midtcs.o \
|
||||
namco_c45.o namcoio.o pandora.o resnet.o seibusnd.o sknsspr.o slapstic.o st0020.o t5182.o timekpr.o tms34061.o v3021.o vdc.o tms9928a.o watchdog.o x2212.o \
|
||||
\
|
||||
asteroids.o ay8910.o burn_y8950.o burn_ym2151.o burn_ym2203.o burn_ym2413.o burn_ym2608.o burn_ym2610.o burn_ym2612.o burn_md2612.o \
|
||||
burn_ym3526.o burn_ym3812.o burn_ymf262.o burn_ymf278b.o bzone.o c6280.o dac.o es5506.o es8712.o flower.o flt_rc.o fm.o fmopl.o ym2612.o gaelco.o hc55516.o \
|
||||
|
||||
@@ -0,0 +1,185 @@
|
||||
// Cheap Squeak Deluxe audio module
|
||||
// based on MAME sources by Aaron Giles
|
||||
|
||||
#include "burnint.h"
|
||||
#include "m68000_intf.h"
|
||||
#include "6821pia.h"
|
||||
#include "dac.h"
|
||||
|
||||
static UINT16 dacvalue;
|
||||
static UINT16 csd_status;
|
||||
static INT32 csd_in_reset;
|
||||
static INT32 csd_is_intialized = 0;
|
||||
|
||||
static void csd_porta_w(UINT16, UINT8 data)
|
||||
{
|
||||
dacvalue = (data << 2) | (dacvalue & 3);
|
||||
// if (dacvalue !=0) bprintf(0, _T("%X,"), dacvalue);
|
||||
if (dacvalue == 0x02 || dacvalue == 0x03) dacvalue = 0xFE; // silly hack gets rid of pops in spyhunter when the music starts/stops
|
||||
DACWrite16Signed(0, dacvalue << 6);
|
||||
}
|
||||
|
||||
static void csd_portb_w(UINT16, UINT8 data)
|
||||
{
|
||||
dacvalue = (dacvalue & ~0x3) | (data >> 6);
|
||||
// if (dacvalue !=0) bprintf(0, _T("%X,"), dacvalue);
|
||||
if (dacvalue == 0x02 || dacvalue == 0x03) dacvalue = 0xFE; // see "silly hack", above
|
||||
DACWrite16Signed(0, dacvalue << 6);
|
||||
|
||||
//if (~pia_get_ddr_b(0) & 0x30) csd_status = (data >> 4) & 3;
|
||||
UINT8 z_mask = pia_get_ddr_b(0);
|
||||
if (~z_mask & 0x10) csd_status = (csd_status & ~1) | ((data >> 4) & 1);
|
||||
if (~z_mask & 0x20) csd_status = (csd_status & ~2) | ((data >> 4) & 2);
|
||||
|
||||
}
|
||||
|
||||
static void csd_irq(int state)
|
||||
{
|
||||
SekSetIRQLine(4, state ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE);
|
||||
}
|
||||
|
||||
void csd_reset_write(int state)
|
||||
{
|
||||
if (csd_is_intialized == 0) return;
|
||||
|
||||
csd_in_reset = state;
|
||||
|
||||
if (state) {
|
||||
INT32 cpu_active = SekGetActive();
|
||||
if (cpu_active == -1) SekOpen(0);
|
||||
SekReset();
|
||||
if (cpu_active == -1) SekClose();
|
||||
}
|
||||
}
|
||||
|
||||
static void __fastcall csd_write_word(UINT32 address, UINT16 data)
|
||||
{
|
||||
if ((address & 0x1fff8) == 0x18000) {
|
||||
pia_write(0, (address / 2) & 3, data & 0xff);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
static void __fastcall csd_write_byte(UINT32 address, UINT8 data)
|
||||
{
|
||||
if ((address & 0x1fff8) == 0x18000) {
|
||||
pia_write(0, (address / 2) & 3, data);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
static UINT16 __fastcall csd_read_word(UINT32 address)
|
||||
{
|
||||
if ((address & 0x1fff8) == 0x18000) {
|
||||
UINT8 ret = pia_read(0, (address / 2) & 3);
|
||||
return ret | (ret << 8);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static UINT8 __fastcall csd_read_byte(UINT32 address)
|
||||
{
|
||||
if ((address & 0x1fff8) == 0x18000) {
|
||||
return pia_read(0, (address / 2) & 3);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void csd_data_write(UINT16 data)
|
||||
{
|
||||
if (csd_is_intialized == 0) return;
|
||||
|
||||
pia_set_input_b(0, data & 0x0f);
|
||||
pia_set_input_ca1(0, ~data & 0x10);
|
||||
}
|
||||
|
||||
UINT8 csd_status_read()
|
||||
{
|
||||
if (csd_is_intialized == 0) return 0;
|
||||
|
||||
return csd_status;
|
||||
}
|
||||
|
||||
INT32 csd_reset_status()
|
||||
{
|
||||
if (csd_is_intialized == 0) return 1;
|
||||
|
||||
return csd_in_reset;
|
||||
}
|
||||
|
||||
INT32 csd_initialized()
|
||||
{
|
||||
return csd_is_intialized;
|
||||
}
|
||||
|
||||
void csd_reset()
|
||||
{
|
||||
if (csd_is_intialized == 0) return;
|
||||
|
||||
SekOpen(0);
|
||||
SekReset();
|
||||
DACReset();
|
||||
SekClose();
|
||||
|
||||
pia_reset();
|
||||
|
||||
csd_status = 0;
|
||||
csd_in_reset = 0;
|
||||
dacvalue = 0;
|
||||
}
|
||||
|
||||
static const pia6821_interface pia_intf = {
|
||||
0, 0, 0, 0, 0, 0,
|
||||
csd_porta_w, csd_portb_w, 0, 0,
|
||||
csd_irq, csd_irq
|
||||
};
|
||||
|
||||
void csd_init(UINT8 *rom, UINT8 *ram)
|
||||
{
|
||||
SekInit(0, 0x68000);
|
||||
SekOpen(0);
|
||||
SekMapMemory(rom, 0x000000, 0x007fff, MAP_ROM);
|
||||
SekMapMemory(ram, 0x01c000, 0x01cfff, MAP_RAM);
|
||||
SekSetWriteWordHandler(0, csd_write_word);
|
||||
SekSetWriteByteHandler(0, csd_write_byte);
|
||||
SekSetReadWordHandler(0, csd_read_word);
|
||||
SekSetReadByteHandler(0, csd_read_byte);
|
||||
SekClose();
|
||||
|
||||
pia_init();
|
||||
pia_config(0, PIA_ALTERNATE_ORDERING, &pia_intf);
|
||||
|
||||
DACInit(0, 0, 1, SekTotalCycles, 8000000);
|
||||
DACSetRoute(0, 1.00, BURN_SND_ROUTE_BOTH);
|
||||
DACDCBlock(1);
|
||||
|
||||
csd_is_intialized = 1;
|
||||
}
|
||||
|
||||
void csd_exit()
|
||||
{
|
||||
if (csd_is_intialized == 0) return;
|
||||
|
||||
SekExit();
|
||||
pia_init();
|
||||
DACExit();
|
||||
csd_is_intialized = 0;
|
||||
}
|
||||
|
||||
void csd_scan(INT32 nAction, INT32 *pnMin)
|
||||
{
|
||||
if (csd_is_intialized == 0) return;
|
||||
|
||||
if (nAction & ACB_VOLATILE)
|
||||
{
|
||||
SekScan(nAction);
|
||||
DACScan(nAction, pnMin);
|
||||
pia_scan(nAction, pnMin);
|
||||
|
||||
SCAN_VAR(csd_status);
|
||||
SCAN_VAR(csd_in_reset);
|
||||
SCAN_VAR(dacvalue);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
void csd_data_write(UINT16 data);
|
||||
UINT8 csd_status_read();
|
||||
void csd_reset_write(int state);
|
||||
|
||||
void csd_reset();
|
||||
void csd_init(UINT8 *rom, UINT8 *ram);
|
||||
void csd_exit();
|
||||
void csd_scan(INT32 nAction, INT32 *pnMin);
|
||||
INT32 csd_reset_status();
|
||||
INT32 csd_initialized();
|
||||
@@ -0,0 +1,179 @@
|
||||
// Midway Sounds Good audio module
|
||||
// based on MAME sources by Aaron Giles
|
||||
|
||||
#include "burnint.h"
|
||||
#include "m68000_intf.h"
|
||||
#include "6821pia.h"
|
||||
#include "dac.h"
|
||||
|
||||
static UINT16 dacvalue;
|
||||
static UINT16 soundsgood_status;
|
||||
static INT32 soundsgood_in_reset;
|
||||
static INT32 soundsgood_is_initialized;
|
||||
|
||||
static void soundsgood_porta_w(UINT16, UINT8 data)
|
||||
{
|
||||
dacvalue = (dacvalue & 3) | (data << 2);
|
||||
DACWrite16Signed(0, dacvalue << 6);
|
||||
}
|
||||
|
||||
static void soundsgood_portb_w(UINT16, UINT8 data)
|
||||
{
|
||||
dacvalue = (dacvalue & ~3) | (data >> 6);
|
||||
DACWrite16Signed(0, dacvalue << 6);
|
||||
|
||||
if (pia_get_ddr_b(0) & 0x30) soundsgood_status = (data >> 4) & 3;
|
||||
}
|
||||
|
||||
static void soundsgood_irq(int state)
|
||||
{
|
||||
SekSetIRQLine(4, state ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE);
|
||||
}
|
||||
|
||||
void soundsgood_data_write(UINT16 data)
|
||||
{
|
||||
pia_set_input_b(0, (data >> 1) & 0xf);
|
||||
pia_set_input_ca1(0, ~data & 0x01);
|
||||
}
|
||||
|
||||
UINT8 soundsgood_status_read()
|
||||
{
|
||||
if (soundsgood_is_initialized == 0) return 0;
|
||||
return soundsgood_status;
|
||||
}
|
||||
|
||||
void soundsgood_reset_write(int state)
|
||||
{
|
||||
if (soundsgood_is_initialized == 0) return;
|
||||
|
||||
soundsgood_in_reset = state;
|
||||
|
||||
if (state)
|
||||
{
|
||||
INT32 cpu_active = SekGetActive();
|
||||
if (cpu_active == -1) SekOpen(0);
|
||||
SekReset();
|
||||
if (cpu_active == -1) SekClose();
|
||||
}
|
||||
}
|
||||
|
||||
static void __fastcall soundsgood_write_word(UINT32 address, UINT16 data)
|
||||
{
|
||||
if ((address & 0xffff8) == 0x060000) {
|
||||
// bprintf (0, _T("SGWW: %5.5x, %4.4x\n"), address, data);
|
||||
pia_write(0, (address / 2) & 3, data & 0xff);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
static void __fastcall soundsgood_write_byte(UINT32 address, UINT8 data)
|
||||
{
|
||||
if ((address & 0xffff8) == 0x060000) {
|
||||
// bprintf (0, _T("SGWB: %5.5x, %2.2x\n"), address, data);
|
||||
pia_write(0, (address / 2) & 3, data);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
static UINT16 __fastcall soundsgood_read_word(UINT32 address)
|
||||
{
|
||||
if ((address & 0xffff8) == 0x060000) {
|
||||
// bprintf (0, _T("SGRW: %5.5x\n"), address);
|
||||
UINT8 ret = pia_read(0, (address / 2) & 3);
|
||||
return ret | (ret << 8);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static UINT8 __fastcall soundsgood_read_byte(UINT32 address)
|
||||
{
|
||||
if ((address & 0xffff8) == 0x060000) {
|
||||
// bprintf (0, _T("SGRB: %5.5x\n"), address);
|
||||
return pia_read(0, (address / 2) & 3);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void soundsgood_reset()
|
||||
{
|
||||
if (soundsgood_is_initialized == 0) return;
|
||||
|
||||
SekOpen(0);
|
||||
SekReset();
|
||||
DACReset();
|
||||
SekClose();
|
||||
|
||||
pia_reset();
|
||||
|
||||
soundsgood_status = 0;
|
||||
soundsgood_in_reset = 0;
|
||||
dacvalue = 0;
|
||||
}
|
||||
|
||||
static const pia6821_interface pia_intf = {
|
||||
0, 0, 0, 0, 0, 0,
|
||||
soundsgood_porta_w, soundsgood_portb_w, 0, 0,
|
||||
soundsgood_irq, soundsgood_irq
|
||||
};
|
||||
|
||||
void soundsgood_init(UINT8 *rom, UINT8 *ram)
|
||||
{
|
||||
SekInit(0, 0x68000);
|
||||
SekOpen(0);
|
||||
SekMapMemory(rom, 0x000000, 0x03ffff, MAP_ROM);
|
||||
SekMapMemory(ram, 0x070000, 0x070fff, MAP_RAM);
|
||||
SekSetWriteWordHandler(0, soundsgood_write_word);
|
||||
SekSetWriteByteHandler(0, soundsgood_write_byte);
|
||||
SekSetReadWordHandler(0, soundsgood_read_word);
|
||||
SekSetReadByteHandler(0, soundsgood_read_byte);
|
||||
SekClose();
|
||||
|
||||
pia_init();
|
||||
pia_config(0, PIA_ALTERNATE_ORDERING, &pia_intf);
|
||||
|
||||
DACInit(0, 0, 0, SekTotalCycles, 8000000);
|
||||
DACSetRoute(0, 1.00, BURN_SND_ROUTE_BOTH);
|
||||
DACDCBlock(1);
|
||||
|
||||
soundsgood_is_initialized = 1;
|
||||
}
|
||||
|
||||
void soundsgood_exit()
|
||||
{
|
||||
if (soundsgood_is_initialized == 0) return;
|
||||
|
||||
SekExit();
|
||||
pia_init();
|
||||
DACExit();
|
||||
|
||||
soundsgood_is_initialized = 0;
|
||||
}
|
||||
|
||||
void soundsgood_scan(INT32 nAction, INT32 *pnMin)
|
||||
{
|
||||
if (soundsgood_is_initialized == 0) return;
|
||||
|
||||
if (nAction & ACB_VOLATILE)
|
||||
{
|
||||
SekScan(nAction);
|
||||
DACScan(nAction, pnMin);
|
||||
pia_scan(nAction, pnMin);
|
||||
|
||||
SCAN_VAR(soundsgood_status);
|
||||
SCAN_VAR(soundsgood_in_reset);
|
||||
SCAN_VAR(dacvalue);
|
||||
}
|
||||
}
|
||||
|
||||
INT32 soundsgood_reset_status()
|
||||
{
|
||||
if (soundsgood_is_initialized == 0) return 1;
|
||||
return soundsgood_in_reset;
|
||||
}
|
||||
|
||||
INT32 soundsgood_initialized()
|
||||
{
|
||||
return soundsgood_is_initialized;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
void soundsgood_data_write(UINT16 data);
|
||||
UINT8 soundsgood_status_read();
|
||||
void soundsgood_reset_write(int state);
|
||||
|
||||
void soundsgood_reset();
|
||||
void soundsgood_init(UINT8 *rom, UINT8 *ram); // rom = 0x40000, ram = 0x1000 in size
|
||||
void soundsgood_exit();
|
||||
void soundsgood_scan(INT32 nAction, INT32 *pnMin);
|
||||
INT32 soundsgood_reset_status();
|
||||
INT32 soundsgood_initialized();
|
||||
@@ -0,0 +1,156 @@
|
||||
// Midway Turbo Cheap Squeak audio module
|
||||
// based on MAME sources by Aaron Giles
|
||||
|
||||
#include "burnint.h"
|
||||
#include "m6809_intf.h"
|
||||
#include "dac.h"
|
||||
#include "6821pia.h"
|
||||
|
||||
static UINT16 dacvalue;
|
||||
static INT32 tcs_status;
|
||||
static INT32 tcs_in_reset;
|
||||
static INT32 tcs_is_initialized = 0;
|
||||
|
||||
static void tcs_porta_w(UINT16, UINT8 data)
|
||||
{
|
||||
dacvalue = (dacvalue & 3) | (data << 2);
|
||||
DACWrite16Signed(0, dacvalue << 6);
|
||||
}
|
||||
|
||||
static void tcs_portb_w(UINT16, UINT8 data)
|
||||
{
|
||||
dacvalue = (dacvalue & ~3) | (data >> 6);
|
||||
DACWrite16Signed(0, dacvalue << 6);
|
||||
tcs_status = (data >> 4) & 3;
|
||||
}
|
||||
|
||||
static void tcs_irq(int state)
|
||||
{
|
||||
M6809SetIRQLine(0, state ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE);
|
||||
}
|
||||
|
||||
void tcs_data_write(UINT16 data)
|
||||
{
|
||||
if (tcs_is_initialized == 0) return;
|
||||
|
||||
pia_set_input_b(0, (data >> 1) & 0xf);
|
||||
pia_set_input_ca1(0, ~data & 0x01);
|
||||
}
|
||||
|
||||
UINT8 tcs_status_read()
|
||||
{
|
||||
if (tcs_is_initialized == 0) return 0;
|
||||
return tcs_status;
|
||||
}
|
||||
|
||||
void tcs_reset_write(int state)
|
||||
{
|
||||
if (tcs_is_initialized == 0) return;
|
||||
|
||||
tcs_in_reset = state;
|
||||
|
||||
if (state) {
|
||||
M6809Reset();
|
||||
}
|
||||
}
|
||||
|
||||
static void tcs_write(UINT16 address, UINT8 data)
|
||||
{
|
||||
if ((address & 0xc000) == 0x4000) {
|
||||
pia_write(0, address & 3, data);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
static UINT8 tcs_read(UINT16 address)
|
||||
{
|
||||
if ((address & 0xc000) == 0x4000) {
|
||||
return pia_read(0, address & 3);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void tcs_reset()
|
||||
{
|
||||
if (tcs_is_initialized == 0) return;
|
||||
|
||||
M6809Open(0);
|
||||
M6809Reset();
|
||||
M6809Close();
|
||||
|
||||
pia_reset();
|
||||
|
||||
DACReset();
|
||||
|
||||
tcs_status = 0;
|
||||
tcs_in_reset = 0;
|
||||
dacvalue = 0;
|
||||
}
|
||||
|
||||
static const pia6821_interface pia_intf = {
|
||||
0, 0, 0, 0, 0, 0,
|
||||
tcs_porta_w, tcs_portb_w, 0, 0,
|
||||
tcs_irq, tcs_irq
|
||||
};
|
||||
|
||||
void tcs_init(UINT8 *rom, UINT8 *ram)
|
||||
{
|
||||
M6809Init(0);
|
||||
M6809Open(0);
|
||||
for (INT32 i = 0; i < 0x4000; i+=0x800) {
|
||||
M6809MapMemory(ram, 0x0000 + i, 0x07ff + i, MAP_RAM);
|
||||
}
|
||||
M6809MapMemory(rom + 0x8000, 0x8000, 0xffff, MAP_ROM);
|
||||
M6809SetWriteHandler(tcs_write);
|
||||
M6809SetReadHandler(tcs_read);
|
||||
M6809Close();
|
||||
|
||||
pia_init();
|
||||
pia_config(0, PIA_ALTERNATE_ORDERING, &pia_intf);
|
||||
|
||||
DACInit(0, 0, 0, M6809TotalCycles, 2000000);
|
||||
DACSetRoute(0, 1.00, BURN_SND_ROUTE_BOTH);
|
||||
DACDCBlock(1);
|
||||
|
||||
tcs_is_initialized = 1;
|
||||
}
|
||||
|
||||
void tcs_exit()
|
||||
{
|
||||
if (tcs_is_initialized == 0) return;
|
||||
|
||||
M6809Exit();
|
||||
pia_init();
|
||||
DACExit();
|
||||
tcs_is_initialized = 0;
|
||||
}
|
||||
|
||||
void tcs_scan(INT32 nAction, INT32 *pnMin)
|
||||
{
|
||||
if (tcs_is_initialized == 0) return;
|
||||
|
||||
if (nAction & ACB_VOLATILE)
|
||||
{
|
||||
M6809Scan(nAction);
|
||||
DACScan(nAction, pnMin);
|
||||
pia_scan(nAction, pnMin);
|
||||
|
||||
SCAN_VAR(tcs_status);
|
||||
SCAN_VAR(tcs_in_reset);
|
||||
SCAN_VAR(dacvalue);
|
||||
}
|
||||
}
|
||||
|
||||
INT32 tcs_reset_status()
|
||||
{
|
||||
if (tcs_is_initialized == 0) return 1;
|
||||
|
||||
return tcs_in_reset;
|
||||
}
|
||||
|
||||
INT32 tcs_initialized()
|
||||
{
|
||||
return tcs_is_initialized;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
void tcs_data_write(UINT16 data);
|
||||
UINT8 tcs_status_read();
|
||||
void tcs_reset_write(int state);
|
||||
|
||||
void tcs_reset();
|
||||
void tcs_init(UINT8 *rom, UINT8 *ram); // rom 0x10000, ram 0x800 in size
|
||||
void tcs_exit();
|
||||
void tcs_scan(INT32 nAction, INT32 *pnMin);
|
||||
INT32 tcs_reset_status();
|
||||
INT32 tcs_initialized();
|
||||
@@ -3,15 +3,17 @@
|
||||
|
||||
/*
|
||||
twotigerc - <<-- todo (alt.inpt) (marked not working/BurnDriverD for now)
|
||||
demoderb - <<-- todo sound (turbo cheap squeak)
|
||||
dpoker - don't bother with this (uses light panel/special buttons/etc)
|
||||
nflfoot - don't bother with this (laserdisc)
|
||||
*/
|
||||
|
||||
#include "tiles_generic.h"
|
||||
#include "z80_intf.h"
|
||||
#include "m6809_intf.h"
|
||||
#include "midssio.h"
|
||||
#include "midsat.h" // for dotrone
|
||||
#include "midtcs.h" // demoderb
|
||||
#include "dac.h"
|
||||
#include "ay8910.h"
|
||||
#include "samples.h"
|
||||
#include "watchdog.h"
|
||||
@@ -899,6 +901,7 @@ static INT32 DrvDoReset(INT32 clear_mem)
|
||||
BurnSampleReset();
|
||||
ssio_reset();
|
||||
if (has_squak) midsat_reset();
|
||||
tcs_reset();
|
||||
|
||||
flipscreen = 0;
|
||||
|
||||
@@ -926,7 +929,7 @@ static INT32 MemIndex()
|
||||
|
||||
DrvSprRAM = Next; Next += 0x000200;
|
||||
DrvVidRAM = Next; Next += 0x000800;
|
||||
DrvZ80RAM1 = Next; Next += 0x000400;
|
||||
DrvZ80RAM1 = Next; Next += 0x001000; // 0x400 ssio, 0x1000 tcs
|
||||
DrvPalRAM16 = (UINT16*)Next; Next += 0x40 * sizeof(UINT16);
|
||||
|
||||
RamEnd = Next;
|
||||
@@ -1163,6 +1166,7 @@ static INT32 DrvExit()
|
||||
ssio_exit();
|
||||
|
||||
if (has_squak) midsat_exit();
|
||||
tcs_exit();
|
||||
|
||||
BurnSampleExit();
|
||||
|
||||
@@ -1421,6 +1425,8 @@ static INT32 DrvFrame()
|
||||
|
||||
ZetNewFrame();
|
||||
if (has_squak) midsatNewFrame();
|
||||
INT32 has_tcs = tcs_initialized();
|
||||
if (has_tcs) M6809NewFrame();
|
||||
|
||||
{
|
||||
memset (DrvInputs, 0xff, 6);
|
||||
@@ -1493,7 +1499,7 @@ static INT32 DrvFrame()
|
||||
}
|
||||
}
|
||||
|
||||
INT32 nInterleave = 480;
|
||||
INT32 nInterleave = 480;
|
||||
INT32 nCyclesTotal[3] = { nMainClock / 30, 2000000 / 30, 3579545 / 4 / 30 };
|
||||
INT32 nCyclesDone[3] = { 0, 0, 0 };
|
||||
INT32 nSoundBufferPos = 0;
|
||||
@@ -1519,6 +1525,19 @@ static INT32 DrvFrame()
|
||||
nCyclesDone[2] += midsat_run(((i + 1) * nCyclesTotal[2] / nInterleave) - nCyclesDone[2]);
|
||||
}
|
||||
|
||||
if (has_tcs) {
|
||||
M6809Open(0);
|
||||
if (tcs_reset_status())
|
||||
{
|
||||
nCyclesDone[1] += M6809Idle(((i + 1) * nCyclesTotal[1] / nInterleave) - nCyclesDone[1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
nCyclesDone[1] += M6809Run(((i + 1) * nCyclesTotal[1] / nInterleave) - nCyclesDone[1]);
|
||||
}
|
||||
M6809Close();
|
||||
}
|
||||
|
||||
// Render Sound Segment
|
||||
if (pBurnSoundOut && (i%4)==3) {
|
||||
INT32 nSegmentLength = nBurnSoundLen / (nInterleave/4);
|
||||
@@ -1539,7 +1558,10 @@ static INT32 DrvFrame()
|
||||
if (has_squak) {
|
||||
midsat_update(pBurnSoundOut, nBurnSoundLen);
|
||||
}
|
||||
}
|
||||
if (has_tcs) {
|
||||
DACUpdate(pBurnSoundOut, nBurnSoundLen);
|
||||
}
|
||||
}
|
||||
|
||||
if (pBurnDraw) {
|
||||
BurnDrvRedraw();
|
||||
@@ -1570,6 +1592,7 @@ static INT32 DrvScan(INT32 nAction, INT32 *pnMin)
|
||||
|
||||
ssio_scan(nAction, pnMin);
|
||||
if (has_squak) midsat_scan(nAction, pnMin);
|
||||
if (tcs_initialized()) tcs_scan(nAction, pnMin);
|
||||
|
||||
BurnSampleScan(nAction, pnMin);
|
||||
|
||||
@@ -2993,8 +3016,8 @@ static struct BurnRomInfo demoderbRomDesc[] = {
|
||||
{ "demo_drby_pro_2", 0x4000, 0xfa93b9d9, 1 | BRF_PRG | BRF_ESS }, // 2
|
||||
{ "demo_drby_pro_3", 0x4000, 0x4e964883, 1 | BRF_PRG | BRF_ESS }, // 3
|
||||
|
||||
{ "tcs_u5.bin", 0x2000, 0xeca33b2c, 5 | BRF_PRG | BRF_ESS }, // 4 M6809 Code
|
||||
{ "tcs_u4.bin", 0x2000, 0x3490289a, 5 | BRF_PRG | BRF_ESS }, // 5
|
||||
{ "tcs_u5.bin", 0x2000, 0xeca33b2c, 3 | BRF_PRG | BRF_ESS }, // 4 M6809 Code
|
||||
{ "tcs_u4.bin", 0x2000, 0x3490289a, 3 | BRF_PRG | BRF_ESS }, // 5
|
||||
|
||||
{ "demo_derby_bg_06f.6f", 0x2000, 0xcf80be19, 3 | BRF_GRA }, // 6 Background Tiles
|
||||
{ "demo_derby_bg_15f.5f", 0x2000, 0x4e173e52, 3 | BRF_GRA }, // 7
|
||||
@@ -3017,7 +3040,11 @@ static void demoderb_op4_write(UINT8, UINT8 data)
|
||||
if (data & 0x40) input_playernum = 1;
|
||||
if (data & 0x80) input_playernum = 0;
|
||||
|
||||
//turbo_cheap_squeak(data);
|
||||
INT32 cycles = (ZetTotalCycles() * 2) / 5;
|
||||
M6809Open(0);
|
||||
M6809Run(cycles - M6809TotalCycles());
|
||||
tcs_data_write(data);
|
||||
M6809Close();
|
||||
}
|
||||
|
||||
static UINT8 demoderb_ip1_read(UINT8)
|
||||
@@ -3049,7 +3076,9 @@ static INT32 DemoderbInit()
|
||||
is_demoderb = 1;
|
||||
ssio_set_custom_input(1, 0xff, demoderb_ip1_read);
|
||||
ssio_set_custom_input(2, 0xff, demoderb_ip2_read);
|
||||
ssio_set_custom_output(4, 0xff, demoderb_op4_write);
|
||||
ssio_set_custom_output(4, 0xff, demoderb_op4_write);
|
||||
memmove(DrvTCSROM + 0xc000, DrvTCSROM, 0x4000);
|
||||
tcs_init(DrvTCSROM, DrvZ80RAM1); // actually m6809
|
||||
}
|
||||
|
||||
return nRet;
|
||||
@@ -3073,8 +3102,8 @@ static struct BurnRomInfo demoderbcRomDesc[] = {
|
||||
{ "dd_pro1", 0x4000, 0x4c713bfe, 1 | BRF_PRG | BRF_ESS }, // 1
|
||||
{ "dd_pro2", 0x4000, 0xc2cbd2a4, 1 | BRF_PRG | BRF_ESS }, // 2
|
||||
|
||||
{ "tcs_u5.bin", 0x2000, 0xeca33b2c, 2 | BRF_PRG | BRF_ESS }, // 3 tcs:cpu
|
||||
{ "tcs_u4.bin", 0x2000, 0x3490289a, 2 | BRF_PRG | BRF_ESS }, // 4
|
||||
{ "tcs_u5.bin", 0x2000, 0xeca33b2c, 3 | BRF_PRG | BRF_ESS }, // 3 tcs:cpu
|
||||
{ "tcs_u4.bin", 0x2000, 0x3490289a, 3 | BRF_PRG | BRF_ESS }, // 4
|
||||
|
||||
{ "demo_derby_bg_06f.6f", 0x2000, 0xcf80be19, 3 | BRF_GRA }, // 5 gfx1
|
||||
{ "demo_derby_bg_15f.5f", 0x2000, 0x4e173e52, 3 | BRF_GRA }, // 6
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user