diff options
Diffstat (limited to 'src/devices/bus/bbc/rom/rom.cpp')
-rw-r--r-- | src/devices/bus/bbc/rom/rom.cpp | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/src/devices/bus/bbc/rom/rom.cpp b/src/devices/bus/bbc/rom/rom.cpp new file mode 100644 index 00000000000..f798de11c6a --- /dev/null +++ b/src/devices/bus/bbc/rom/rom.cpp @@ -0,0 +1,50 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/*************************************************************************** + + BBC Micro Sideways ROM emulation + +***************************************************************************/ + +#include "emu.h" +#include "rom.h" + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +DEFINE_DEVICE_TYPE(BBC_ROM, bbc_rom_device, "bbc_rom", "BBC Micro Sideways ROM") + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// bbc_rom_device - constructor +//------------------------------------------------- + +bbc_rom_device::bbc_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : device_t(mconfig, BBC_ROM, tag, owner, clock) + , device_bbc_rom_interface(mconfig, *this) +{ +} + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void bbc_rom_device::device_start() +{ +} + +//------------------------------------------------- +// read +//------------------------------------------------- + +uint8_t bbc_rom_device::read(offs_t offset) +{ + uint32_t size = std::min((int32_t)get_rom_size(), 0x4000); + + return get_rom_base()[offset & (size - 1)]; +} |