mirror of
https://github.com/holub/mame
synced 2025-07-01 16:19:38 +03:00
(MESS) abc80: Emulated a 16KB RAM card. [Curt Coder]
This commit is contained in:
parent
79ed044ec2
commit
00c8f695de
@ -69,10 +69,11 @@ if (BUSES["ABCBUS"]~=null) then
|
|||||||
MAME_DIR .. "src/emu/bus/abcbus/lux21056.c",
|
MAME_DIR .. "src/emu/bus/abcbus/lux21056.c",
|
||||||
MAME_DIR .. "src/emu/bus/abcbus/lux4105.c",
|
MAME_DIR .. "src/emu/bus/abcbus/lux4105.c",
|
||||||
MAME_DIR .. "src/emu/bus/abcbus/memcard.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/sio.c",
|
||||||
MAME_DIR .. "src/emu/bus/abcbus/slutprov.c",
|
MAME_DIR .. "src/emu/bus/abcbus/slutprov.c",
|
||||||
MAME_DIR .. "src/emu/bus/abcbus/turbo.c",
|
MAME_DIR .. "src/emu/bus/abcbus/turbo.c",
|
||||||
|
MAME_DIR .. "src/emu/bus/abcbus/uni800.c",
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ static MACHINE_CONFIG_FRAGMENT( abc_expansion_unit )
|
|||||||
MCFG_ABCBUS_SLOT_ADD("io3", abc80_cards, NULL)
|
MCFG_ABCBUS_SLOT_ADD("io3", abc80_cards, NULL)
|
||||||
MCFG_ABCBUS_SLOT_ADD("io4", abc80_cards, NULL)
|
MCFG_ABCBUS_SLOT_ADD("io4", abc80_cards, NULL)
|
||||||
MCFG_ABCBUS_SLOT_ADD("mem1", abc80_cards, "memcard")
|
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)
|
MCFG_ABCBUS_SLOT_ADD("mem3", abc80_cards, NULL)
|
||||||
MACHINE_CONFIG_END
|
MACHINE_CONFIG_END
|
||||||
|
|
||||||
|
@ -89,10 +89,11 @@ void abcbus_slot_t::device_start()
|
|||||||
#include "lux21056.h"
|
#include "lux21056.h"
|
||||||
#include "lux4105.h"
|
#include "lux4105.h"
|
||||||
#include "memcard.h"
|
#include "memcard.h"
|
||||||
#include "uni800.h"
|
#include "ram.h"
|
||||||
#include "sio.h"
|
#include "sio.h"
|
||||||
#include "slutprov.h"
|
#include "slutprov.h"
|
||||||
#include "turbo.h"
|
#include "turbo.h"
|
||||||
|
#include "uni800.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -104,6 +105,7 @@ SLOT_INTERFACE_START( abc80_cards )
|
|||||||
SLOT_INTERFACE("fd2", ABC_FD2)
|
SLOT_INTERFACE("fd2", ABC_FD2)
|
||||||
SLOT_INTERFACE("memcard", ABC_MEMORY_CARD)
|
SLOT_INTERFACE("memcard", ABC_MEMORY_CARD)
|
||||||
SLOT_INTERFACE("abcexp", ABC_EXPANSION_UNIT)
|
SLOT_INTERFACE("abcexp", ABC_EXPANSION_UNIT)
|
||||||
|
SLOT_INTERFACE("16k", ABC80_16KB_RAM_CARD)
|
||||||
SLOT_INTERFACE("slow", LUXOR_55_10828)
|
SLOT_INTERFACE("slow", LUXOR_55_10828)
|
||||||
SLOT_INTERFACE_END
|
SLOT_INTERFACE_END
|
||||||
|
|
||||||
|
82
src/emu/bus/abcbus/ram.c
Normal file
82
src/emu/bus/abcbus/ram.c
Normal file
@ -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<abc80_16kb_ram_card_t>;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//**************************************************************************
|
||||||
|
// 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;
|
||||||
|
}
|
||||||
|
}
|
54
src/emu/bus/abcbus/ram.h
Normal file
54
src/emu/bus/abcbus/ram.h
Normal file
@ -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<UINT8> m_ram;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// device type definition
|
||||||
|
extern const device_type ABC80_16KB_RAM_CARD;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
@ -65,7 +65,6 @@ Notes:
|
|||||||
|
|
||||||
TODO:
|
TODO:
|
||||||
|
|
||||||
- 8KB RAM card
|
|
||||||
- proper keyboard controller emulation
|
- proper keyboard controller emulation
|
||||||
- MyAB TKN80 80-column card
|
- MyAB TKN80 80-column card
|
||||||
- GeJo 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);
|
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;
|
dynamic_buffer data;
|
||||||
data.resize(quickload_size);
|
data.resize(quickload_size);
|
||||||
@ -492,10 +492,12 @@ QUICKLOAD_LOAD_MEMBER( abc80_state, bac )
|
|||||||
offs_t eofa = address;
|
offs_t eofa = address;
|
||||||
space.write_byte(EOFA, eofa & 0xff);
|
space.write_byte(EOFA, eofa & 0xff);
|
||||||
space.write_byte(EOFA + 1, eofa >> 8);
|
space.write_byte(EOFA + 1, eofa >> 8);
|
||||||
|
if (LOG) logerror("EOFA %04x\n",address);
|
||||||
|
|
||||||
offs_t head = address + 1;
|
offs_t head = address + 1;
|
||||||
space.write_byte(HEAD, head & 0xff);
|
space.write_byte(HEAD, head & 0xff);
|
||||||
space.write_byte(HEAD + 1, head >> 8);
|
space.write_byte(HEAD + 1, head >> 8);
|
||||||
|
if (LOG) logerror("HEAD %04x\n",address);
|
||||||
|
|
||||||
return IMAGE_INIT_PASS;
|
return IMAGE_INIT_PASS;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user