diff options
author | 2023-10-27 17:06:55 +0100 | |
---|---|---|
committer | 2023-10-28 03:06:55 +1100 | |
commit | ba621ec24df739b7fc11f8b8a32bda2b7ec653e9 (patch) | |
tree | 2d6d0fa25c256bdceb14b9c60f5627e3b7c3bee8 /src/devices/cpu/arm7 | |
parent | e2eb4551ce5713ba5c7a6d00a591fa4d5dca95ce (diff) |
sega/sega_beena.cpp: Emulated Advanced Pico BEENA and TV Ocha-Ken. (#11213)
Basic functionality is supported, making most games playable.
StoryWare display is not yet implemented.
Game-specific peripherals are not emulated.
There are still some issues with graphics.
emu/ioport.h: Fixed rarely-used PORT_CROSSHAIR_MAPPER and PORT_CROSSHAIR_MAPPER_MEMBER macros.
cpu/arm7: Added AP2010 CPU device.
sound/ap2010pcm.cpp: Added basic AP2010 PCM audio output device.
Systems promoted to working
------------------------
Sega Advanced Pico BEENA
New working systems
------------------------
Sega TV Ocha-Ken
Diffstat (limited to 'src/devices/cpu/arm7')
-rw-r--r-- | src/devices/cpu/arm7/ap2010cpu.cpp | 43 | ||||
-rw-r--r-- | src/devices/cpu/arm7/ap2010cpu.h | 36 |
2 files changed, 79 insertions, 0 deletions
diff --git a/src/devices/cpu/arm7/ap2010cpu.cpp b/src/devices/cpu/arm7/ap2010cpu.cpp new file mode 100644 index 00000000000..19101e80f6b --- /dev/null +++ b/src/devices/cpu/arm7/ap2010cpu.cpp @@ -0,0 +1,43 @@ +// license:BSD-3-Clause +// copyright-holders:QUFB +/*************************************************************************** + + ARM7TDMI CPU component of the AP2010 LSI + +***************************************************************************/ + +#include "emu.h" + +#include "ap2010cpu.h" + +DEFINE_DEVICE_TYPE(AP2010CPU, ap2010cpu_device, "ap2010cpu", "AP2010 CPU") + +ap2010cpu_device::ap2010cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : arm7_cpu_device(mconfig, AP2010CPU, tag, owner, clock, 4, ARCHFLAG_T, ENDIANNESS_BIG) +{ } + +void ap2010cpu_device::add_hotspot(offs_t pc) +{ + if (m_hotspot_select < std::size(m_hotspot)) { + m_hotspot[m_hotspot_select] = pc; + m_hotspot_select++; + } +} + +void ap2010cpu_device::execute_run() +{ + for (size_t i = 0; i < ARM7_MAX_HOTSPOTS; i++) { + if (m_hotspot[i] == 0) { + break; + } + if (m_hotspot[i] == pc()) { + int32_t icount = *m_icountptr; + if (icount > 30) { + eat_cycles(icount - 30); + break; + } + } + } + + arm7_cpu_device::execute_run(); +} diff --git a/src/devices/cpu/arm7/ap2010cpu.h b/src/devices/cpu/arm7/ap2010cpu.h new file mode 100644 index 00000000000..82b908fbf02 --- /dev/null +++ b/src/devices/cpu/arm7/ap2010cpu.h @@ -0,0 +1,36 @@ +// license:BSD-3-Clause +// copyright-holders:QUFB +/*************************************************************************** + + ARM7TDMI CPU component of the AP2010 LSI + +***************************************************************************/ + +#ifndef MAME_CPU_ARM7_AP2010CPU_H +#define MAME_CPU_ARM7_AP2010CPU_H + +#pragma once + +#include "arm7.h" +#include "arm7core.h" + +class ap2010cpu_device : public arm7_cpu_device +{ +public: + ap2010cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); + + void add_hotspot(offs_t pc); + +protected: + // device_execute_interface overrides + virtual void execute_run() override; + +private: + uint32_t m_hotspot_select = 0; + uint32_t m_hotspot[ARM7_MAX_HOTSPOTS]; +}; + +// device type definition +DECLARE_DEVICE_TYPE(AP2010CPU, ap2010cpu_device) + +#endif // MAME_CPU_ARM7_AP2010CPU_H |