From 379aa241ed4dbccb008d334d22c398922ec1d8fa Mon Sep 17 00:00:00 2001 From: hap Date: Sat, 7 Mar 2015 22:42:07 +0100 Subject: fix MR and pattern offsets --- src/emu/cpu/hmcs40/hmcs40.c | 4 ++-- src/emu/cpu/hmcs40/hmcs40op.inc | 18 +++++++++++++----- src/mess/drivers/hh_hmcs40.c | 12 +++++++----- 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/src/emu/cpu/hmcs40/hmcs40.c b/src/emu/cpu/hmcs40/hmcs40.c index 098f80a3ef6..648d90fd8b9 100644 --- a/src/emu/cpu/hmcs40/hmcs40.c +++ b/src/emu/cpu/hmcs40/hmcs40.c @@ -67,12 +67,12 @@ const device_type HD44828 = &device_creator; // CMOS version, lo // internal memory maps static ADDRESS_MAP_START(program_1k, AS_PROGRAM, 16, hmcs40_cpu_device) AM_RANGE(0x0000, 0x03ff) AM_ROM - AM_RANGE(0x0400, 0x043f) AM_ROM + AM_RANGE(0x0780, 0x07bf) AM_ROM // patterns on page 30 ADDRESS_MAP_END static ADDRESS_MAP_START(program_2k, AS_PROGRAM, 16, hmcs40_cpu_device) AM_RANGE(0x0000, 0x07ff) AM_ROM - AM_RANGE(0x0800, 0x087f) AM_ROM + AM_RANGE(0x0f40, 0x0fbf) AM_ROM // patterns on page 61,62 ADDRESS_MAP_END diff --git a/src/emu/cpu/hmcs40/hmcs40op.inc b/src/emu/cpu/hmcs40/hmcs40op.inc index bdcba20c658..8464f492ef3 100644 --- a/src/emu/cpu/hmcs40/hmcs40op.inc +++ b/src/emu/cpu/hmcs40/hmcs40op.inc @@ -4,13 +4,13 @@ inline UINT8 hmcs40_cpu_device::ram_r() { - UINT16 address = (m_x << 4 | m_y) & m_datamask; + UINT8 address = (m_x << 4 | m_y) & m_datamask; return m_data->read_byte(address) & 0xf; } inline void hmcs40_cpu_device::ram_w(UINT8 data) { - UINT16 address = (m_x << 4 | m_y) & m_datamask; + UINT8 address = (m_x << 4 | m_y) & m_datamask; m_data->write_byte(address, data & 0xf); } @@ -75,10 +75,18 @@ void hmcs40_cpu_device::op_xamr() // XAMR m: Exchange A and MR(m) // determine MR(Memory Register) location - UINT8 y = m_op & 0xf; - UINT8 x = (y > 3) ? 0xf : (y + 12); - UINT16 address = (x << 4 | y) & m_datamask; + UINT8 address = m_op & 0xf; + // HMCS42: MR0 on file 0, MR4-MR15 on file 4 (there is no file 1-3) + // HMCS43: MR0-MR3 on file 0-3, MR4-MR15 on file 4 + if (m_family == FAMILY_HMCS42 || m_family == FAMILY_HMCS43) + address |= (address < 4) ? (address << 4) : 0x40; + + // HMCS44/45/46/47: all on last file + else + address |= 0xf0; + + address &= m_datamask; UINT8 old_a = m_a; m_a = m_data->read_byte(address) & 0xf; m_data->write_byte(address, old_a & 0xf); diff --git a/src/mess/drivers/hh_hmcs40.c b/src/mess/drivers/hh_hmcs40.c index 3bef2d87e27..c2a587895a4 100644 --- a/src/mess/drivers/hh_hmcs40.c +++ b/src/mess/drivers/hh_hmcs40.c @@ -208,7 +208,7 @@ WRITE8_MEMBER(hh_hmcs40_state::alnattck_plate_w) READ16_MEMBER(hh_hmcs40_state::alnattck_d_r) { // D5: inputs - return (offset == 5) ? (read_inputs(7) << 5 & 0x20) : 0; + return (read_inputs(7) & 1) << 5; } WRITE16_MEMBER(hh_hmcs40_state::alnattck_d_w) @@ -321,14 +321,16 @@ MACHINE_CONFIG_END ***************************************************************************/ ROM_START( alnattck ) - ROM_REGION( 0x1100, "maincpu", 0 ) - ROM_LOAD( "hd38800a25", 0x0000, 0x1100, CRC(18b50869) SHA1(11e9d5f7b4ae818b077b0ee14a3b43190e20bff3) ) + ROM_REGION( 0x2000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD( "hd38800a25", 0x0000, 0x1000, CRC(18b50869) SHA1(11e9d5f7b4ae818b077b0ee14a3b43190e20bff3) ) + ROM_CONTINUE( 0x1e80, 0x0100 ) ROM_END ROM_START( tmtron ) - ROM_REGION( 0x1100, "maincpu", 0 ) - ROM_LOAD( "hd38800a88", 0x0000, 0x1100, CRC(33db9670) SHA1(d6f747a59356526698784047bcfdbb59e79b9a23) ) + ROM_REGION( 0x2000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD( "hd38800a88", 0x0000, 0x1000, CRC(33db9670) SHA1(d6f747a59356526698784047bcfdbb59e79b9a23) ) + ROM_CONTINUE( 0x1e80, 0x0100 ) ROM_END -- cgit v1.2.3