summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Sterophonick <34801996+Sterophonick@users.noreply.github.com>2020-06-20 15:24:04 -0700
committer Sterophonick <34801996+Sterophonick@users.noreply.github.com>2020-06-20 15:24:04 -0700
commit1712ab6b9d058ddfbe6eed95b333f20c437b85c6 (patch)
treec40039ca41d5dd610126622d1cd96fa4457b597d
parentebb7d2faec56808ac210f432c9e176c484b4db52 (diff)
gigatron: fix ROM mask being 15-bit instead of 16-bit
also make the mask a label (nw)
-rw-r--r--src/devices/cpu/gigatron/gigatron.cpp7
-rw-r--r--src/devices/cpu/gigatron/gigatron.h1
2 files changed, 5 insertions, 3 deletions
diff --git a/src/devices/cpu/gigatron/gigatron.cpp b/src/devices/cpu/gigatron/gigatron.cpp
index fa54af7923e..78e3a19afb2 100644
--- a/src/devices/cpu/gigatron/gigatron.cpp
+++ b/src/devices/cpu/gigatron/gigatron.cpp
@@ -52,7 +52,7 @@ void gigatron_cpu_device::execute_run()
opcode = gigatron_readop(m_pc);
m_pc = m_npc;
- m_npc = (m_pc + 1) & 0x7FFF;
+ m_npc = (m_pc + 1) & m_romMask;
uint8_t op = (opcode >> 13) & 0x0007;
uint8_t mode = (opcode >> 10) & 0x0007;
@@ -98,7 +98,7 @@ void gigatron_cpu_device::init()
m_x = 0;
m_y = 0;
m_pc = 0;
- m_npc = (m_pc + 1) & 0x7FFF;
+ m_npc = (m_pc + 1) & m_romMask;
m_ppc = 0;
m_inReg = 0xFF;
@@ -318,7 +318,8 @@ void gigatron_cpu_device::execute_set_input(int irqline, int state)
gigatron_cpu_device::gigatron_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: cpu_device(mconfig, GTRON, tag, owner, clock)
- , m_ramMask(0x7fff)
+ , m_ramMask(0x7FFF)
+ , m_romMask(0xFFFF)
, m_program_config("program", ENDIANNESS_BIG, 16, 14, -1)
, m_data_config("data", ENDIANNESS_BIG, 8, 15, 0)
, m_outx_cb(*this)
diff --git a/src/devices/cpu/gigatron/gigatron.h b/src/devices/cpu/gigatron/gigatron.h
index a216978ab0d..50f359af21f 100644
--- a/src/devices/cpu/gigatron/gigatron.h
+++ b/src/devices/cpu/gigatron/gigatron.h
@@ -62,6 +62,7 @@ protected:
uint16_t m_ppc;
uint8_t m_inReg;
uint16_t m_ramMask;
+ uint16_t m_romMask;
uint16_t m_out;
uint16_t m_outx;