From 3d9aae8d72388a1ba9583510b793e92ba5d371c0 Mon Sep 17 00:00:00 2001 From: dinkc64 <12570148+dinkc64@users.noreply.github.com> Date: Sat, 11 Aug 2018 23:02:09 +0000 Subject: [PATCH] add device for Atari EA ROM --- makefile.burn_rules | 2 +- src/burn/devices/earom.cpp | 64 ++++++++++++++++++++++++++++++++++++++ src/burn/devices/earom.h | 9 ++++++ 3 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 src/burn/devices/earom.cpp create mode 100644 src/burn/devices/earom.h diff --git a/makefile.burn_rules b/makefile.burn_rules index a1c530334..5ca45bcec 100644 --- a/makefile.burn_rules +++ b/makefile.burn_rules @@ -91,7 +91,7 @@ endif depobj = burn.o burn_gun.o burn_led.o burn_shift.o burn_memory.o burn_pal.o burn_sound.o burn_sound_c.o cheat.o debug_track.o hiscore.o load.o \ tilemap_generic.o tiles_generic.o timer.o vector.o \ \ - 6821pia.o 8255ppi.o 8257dma.o c169.o avgdvg.o bsmt2000.o decobsmt.o eeprom.o gaelco_crypt.o joyprocess.o nb1414m4.o nb1414m4_8bit.o nmk004.o nmk112.o kaneko_tmap.o mathbox.o mb87078.o \ + 6821pia.o 8255ppi.o 8257dma.o c169.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 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 \ \ diff --git a/src/burn/devices/earom.cpp b/src/burn/devices/earom.cpp new file mode 100644 index 000000000..734512022 --- /dev/null +++ b/src/burn/devices/earom.cpp @@ -0,0 +1,64 @@ +// Atari EA-ROM, impl. by dink + +#include "burnint.h" +#include "earom.h" + +#define EAROM_SIZE 0x40 +static UINT8 earom_offset; +static UINT8 earom_data; +static UINT8 earom[EAROM_SIZE]; + +UINT8 earom_read(UINT16 /*address*/) +{ + return (earom_data); +} + +void earom_write(UINT16 offset, UINT8 data) +{ + earom_offset = offset; + earom_data = data; +} + +void earom_ctrl_write(UINT16 /*offset*/, UINT8 data) +{ + if (data & 0x01) + earom_data = earom[earom_offset]; + if ((data & 0x0c) == 0x0c) { + earom[earom_offset] = earom_data; + } +} + +void earom_reset() +{ + earom_offset = 0; + earom_data = 0; +} + +void earom_init() +{ + memset(&earom, 0, sizeof(earom)); + earom_reset(); +} + +void earom_exit() +{ + // N/A +} + +void earom_scan(INT32 nAction, INT32 *pnMin) +{ + if (nAction & ACB_VOLATILE) { + SCAN_VAR(earom_offset); + SCAN_VAR(earom_data); + } + + if (nAction & ACB_NVRAM) { + struct BurnArea ba; + + memset(&ba, 0, sizeof(ba)); + ba.Data = earom; + ba.nLen = sizeof(earom); + ba.szName = "NV RAM"; + BurnAcb(&ba); + } +} diff --git a/src/burn/devices/earom.h b/src/burn/devices/earom.h new file mode 100644 index 000000000..b7e99814c --- /dev/null +++ b/src/burn/devices/earom.h @@ -0,0 +1,9 @@ +// Atari EA-ROM, impl. by dink + +UINT8 earom_read(UINT16 /*address*/); +void earom_write(UINT16 offset, UINT8 data); +void earom_ctrl_write(UINT16 /*offset*/, UINT8 data); +void earom_reset(); +void earom_init(); +void earom_exit(); +void earom_scan(INT32 nAction, INT32 *pnMin);