diff options
author | 2014-10-26 12:48:02 +0100 | |
---|---|---|
committer | 2014-10-26 12:48:02 +0100 | |
commit | 218ea906062104d9c339a2591fbf41e75a3cfa3a (patch) | |
tree | f0bba1049213c9b2e7e93e027612d306a579f75e /src/emu/bus/spc1000/vdp.c | |
parent | 7e7b1dc0bb5b9c2acd27fa353dce57e1a985adc9 (diff) |
(MESS) spc1000: converted the expansion bus EXT1 to be a
slot device, moved FDD expansion to be a slot card, added
emulation of the VDP expansion as another slot card. This
makes Gun Fright, TwinBee and Zanac playable if you launch
them with "-ext1 vdp" option. If you want to emulate a
SPC-1000 with floppy drive, you have to add "-ext1 fdd"
instead. [Fabio Priuli]
out of whatsnew: disk emulation still does not work (unless we use
Meeso Kim's patched BIOS), but emulation is now closer to the real
functionality and we needed the changes for the VDP unit emulation.
Diffstat (limited to 'src/emu/bus/spc1000/vdp.c')
-rw-r--r-- | src/emu/bus/spc1000/vdp.c | 104 |
1 files changed, 104 insertions, 0 deletions
diff --git a/src/emu/bus/spc1000/vdp.c b/src/emu/bus/spc1000/vdp.c new file mode 100644 index 00000000000..511a7937bb0 --- /dev/null +++ b/src/emu/bus/spc1000/vdp.c @@ -0,0 +1,104 @@ +/*************************************************************************** + + SPC-1000 VDP expansion unit + +***************************************************************************/ + +#include "emu.h" +#include "vdp.h" + + +/*************************************************************************** + IMPLEMENTATION +***************************************************************************/ + +WRITE_LINE_MEMBER(spc1000_vdp_exp_device::vdp_interrupt) +{ + // nothing here? +} + +static MACHINE_CONFIG_FRAGMENT(scp1000_vdp) + + MCFG_DEVICE_ADD("tms", TMS9928A, XTAL_10_738635MHz / 2) // TODO: which clock? + MCFG_TMS9928A_VRAM_SIZE(0x4000) + MCFG_TMS9928A_OUT_INT_LINE_CB(WRITELINE(spc1000_vdp_exp_device, vdp_interrupt)) + MCFG_TMS9928A_SCREEN_ADD_NTSC("tms_screen") + MCFG_SCREEN_UPDATE_DEVICE("tms", tms9928a_device, screen_update) +MACHINE_CONFIG_END + +//------------------------------------------------- +// device_mconfig_additions +//------------------------------------------------- + +machine_config_constructor spc1000_vdp_exp_device::device_mconfig_additions() const +{ + return MACHINE_CONFIG_NAME( scp1000_vdp ); +} + + +//************************************************************************** +// GLOBAL VARIABLES +//************************************************************************** + +const device_type SPC1000_VDP_EXP = &device_creator<spc1000_vdp_exp_device>; + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// spc1000_vdp_exp_device - constructor +//------------------------------------------------- + +spc1000_vdp_exp_device::spc1000_vdp_exp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : device_t(mconfig, SPC1000_VDP_EXP, "SPC1000 VDP expansion", tag, owner, clock, "spc1000_vdp_exp", __FILE__), + device_spc1000_card_interface(mconfig, *this), + m_vdp(*this, "tms") +{ +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void spc1000_vdp_exp_device::device_start() +{ +} + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void spc1000_vdp_exp_device::device_reset() +{ +} + +/*------------------------------------------------- + read +-------------------------------------------------*/ +READ8_MEMBER(spc1000_vdp_exp_device::read) +{ + if (!(offset & 0x800)) + return 0xff; + + if (offset & 1) + return m_vdp->register_read(space, offset); + else + return m_vdp->vram_read(space, offset); +} + +//------------------------------------------------- +// write +//------------------------------------------------- + +WRITE8_MEMBER(spc1000_vdp_exp_device::write) +{ + if (offset & 0x800) + { + if (offset & 1) + m_vdp->register_write(space, offset, data); + else + m_vdp->vram_write(space, offset, data); + } +} |