diff --git a/scripts/src/bus.lua b/scripts/src/bus.lua index 5105740b63b..4d90a89fdff 100644 --- a/scripts/src/bus.lua +++ b/scripts/src/bus.lua @@ -69,10 +69,11 @@ if (BUSES["ABCBUS"]~=null) then MAME_DIR .. "src/emu/bus/abcbus/lux21056.c", MAME_DIR .. "src/emu/bus/abcbus/lux4105.c", MAME_DIR .. "src/emu/bus/abcbus/memcard.c", - MAME_DIR .. "src/emu/bus/abcbus/uni800.c", + MAME_DIR .. "src/emu/bus/abcbus/ram.c", MAME_DIR .. "src/emu/bus/abcbus/sio.c", MAME_DIR .. "src/emu/bus/abcbus/slutprov.c", MAME_DIR .. "src/emu/bus/abcbus/turbo.c", + MAME_DIR .. "src/emu/bus/abcbus/uni800.c", } end diff --git a/src/emu/bus/abcbus/abc890.c b/src/emu/bus/abcbus/abc890.c index 6fa1171b894..f9347eb6e3f 100644 --- a/src/emu/bus/abcbus/abc890.c +++ b/src/emu/bus/abcbus/abc890.c @@ -61,7 +61,7 @@ static MACHINE_CONFIG_FRAGMENT( abc_expansion_unit ) MCFG_ABCBUS_SLOT_ADD("io3", abc80_cards, NULL) MCFG_ABCBUS_SLOT_ADD("io4", abc80_cards, NULL) MCFG_ABCBUS_SLOT_ADD("mem1", abc80_cards, "memcard") - MCFG_ABCBUS_SLOT_ADD("mem2", abc80_cards, NULL) + MCFG_ABCBUS_SLOT_ADD("mem2", abc80_cards, "16k") MCFG_ABCBUS_SLOT_ADD("mem3", abc80_cards, NULL) MACHINE_CONFIG_END diff --git a/src/emu/bus/abcbus/abcbus.c b/src/emu/bus/abcbus/abcbus.c index 20afdc386e9..925a158ee2f 100644 --- a/src/emu/bus/abcbus/abcbus.c +++ b/src/emu/bus/abcbus/abcbus.c @@ -89,10 +89,11 @@ void abcbus_slot_t::device_start() #include "lux21056.h" #include "lux4105.h" #include "memcard.h" -#include "uni800.h" +#include "ram.h" #include "sio.h" #include "slutprov.h" #include "turbo.h" +#include "uni800.h" @@ -104,6 +105,7 @@ SLOT_INTERFACE_START( abc80_cards ) SLOT_INTERFACE("fd2", ABC_FD2) SLOT_INTERFACE("memcard", ABC_MEMORY_CARD) SLOT_INTERFACE("abcexp", ABC_EXPANSION_UNIT) + SLOT_INTERFACE("16k", ABC80_16KB_RAM_CARD) SLOT_INTERFACE("slow", LUXOR_55_10828) SLOT_INTERFACE_END diff --git a/src/emu/bus/abcbus/ram.c b/src/emu/bus/abcbus/ram.c new file mode 100644 index 00000000000..4d85030b23b --- /dev/null +++ b/src/emu/bus/abcbus/ram.c @@ -0,0 +1,82 @@ +// license:BSD-3-Clause +// copyright-holders:Curt Coder +/********************************************************************** + + ABC 80 16 KB RAM expansion card emulation + + Copyright MESS Team. + Visit http://mamedev.org for licensing and usage restrictions. + +*********************************************************************/ + +#include "ram.h" + + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +const device_type ABC80_16KB_RAM_CARD = &device_creator; + + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// abc80_16kb_ram_card_t - constructor +//------------------------------------------------- + +abc80_16kb_ram_card_t::abc80_16kb_ram_card_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + device_t(mconfig, ABC80_16KB_RAM_CARD, "ABC 80 16KB RAM card", tag, owner, clock, "abc80_16kb", __FILE__), + device_abcbus_card_interface(mconfig, *this), + m_ram(*this, "ram") +{ +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void abc80_16kb_ram_card_t::device_start() +{ + m_ram.allocate(0x4000); +} + + + +//************************************************************************** +// ABC BUS INTERFACE +//************************************************************************** + +//------------------------------------------------- +// abcbus_xmemfl - +//------------------------------------------------- + +UINT8 abc80_16kb_ram_card_t::abcbus_xmemfl(offs_t offset) +{ + UINT8 data = 0xff; + + if (offset >= 0x8000 && offset < 0xc000) + { + data = m_ram[offset & 0x3fff]; + } + + return data; +} + + +//------------------------------------------------- +// abcbus_xmemw - +//------------------------------------------------- + +void abc80_16kb_ram_card_t::abcbus_xmemw(offs_t offset, UINT8 data) +{ + if (offset >= 0x8000 && offset < 0xc000) + { + m_ram[offset & 0x3fff] = data; + } +} diff --git a/src/emu/bus/abcbus/ram.h b/src/emu/bus/abcbus/ram.h new file mode 100644 index 00000000000..3f3a1efda72 --- /dev/null +++ b/src/emu/bus/abcbus/ram.h @@ -0,0 +1,54 @@ +// license:BSD-3-Clause +// copyright-holders:Curt Coder +/********************************************************************** + + ABC 80 16 KB RAM expansion card emulation + + Copyright MESS Team. + Visit http://mamedev.org for licensing and usage restrictions. + +*********************************************************************/ + +#pragma once + +#ifndef __ABC80_16KB_RAM_CARD__ +#define __ABC80_16KB_RAM_CARD__ + +#include "emu.h" +#include "abcbus.h" + + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> abc80_16kb_ram_card_t + +class abc80_16kb_ram_card_t : public device_t, + public device_abcbus_card_interface +{ +public: + // construction/destruction + abc80_16kb_ram_card_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + +protected: + // device-level overrides + virtual void device_start(); + + // device_abcbus_interface overrides + virtual void abcbus_cs(UINT8 data) { }; + virtual UINT8 abcbus_xmemfl(offs_t offset); + virtual void abcbus_xmemw(offs_t offset, UINT8 data); + +private: + optional_shared_ptr m_ram; +}; + + +// device type definition +extern const device_type ABC80_16KB_RAM_CARD; + + + +#endif diff --git a/src/mess/drivers/abc80.c b/src/mess/drivers/abc80.c index b45415ff151..eb35c53b19f 100644 --- a/src/mess/drivers/abc80.c +++ b/src/mess/drivers/abc80.c @@ -65,7 +65,6 @@ Notes: TODO: - - 8KB RAM card - proper keyboard controller emulation - MyAB TKN80 80-column card - GeJo 80-column card @@ -481,7 +480,8 @@ QUICKLOAD_LOAD_MEMBER( abc80_state, bac ) { address_space &space = m_maincpu->space(AS_PROGRAM); - offs_t address = 0xc000; + offs_t address = space.read_byte(BOFA + 1) << 8 | space.read_byte(BOFA); + if (LOG) logerror("BOFA %04x\n",address); dynamic_buffer data; data.resize(quickload_size); @@ -492,10 +492,12 @@ QUICKLOAD_LOAD_MEMBER( abc80_state, bac ) offs_t eofa = address; space.write_byte(EOFA, eofa & 0xff); space.write_byte(EOFA + 1, eofa >> 8); + if (LOG) logerror("EOFA %04x\n",address); offs_t head = address + 1; space.write_byte(HEAD, head & 0xff); space.write_byte(HEAD + 1, head >> 8); + if (LOG) logerror("HEAD %04x\n",address); return IMAGE_INIT_PASS; }