From 8931792bb8a58de4f44198730b5b55d59ca292fa Mon Sep 17 00:00:00 2001 From: hap Date: Thu, 12 Dec 2024 19:22:21 +0100 Subject: m6805: add cycle tables for hd6305 and hd63705 --- src/devices/cpu/m6805/hd6305.cpp | 10 ++++++---- src/devices/cpu/m6805/m6805.cpp | 42 ++++++++++++++++++++++++++++++++++++++++ src/devices/cpu/m6805/m6805.h | 2 ++ 3 files changed, 50 insertions(+), 4 deletions(-) diff --git a/src/devices/cpu/m6805/hd6305.cpp b/src/devices/cpu/m6805/hd6305.cpp index 814746bf27c..2f34521a9c7 100644 --- a/src/devices/cpu/m6805/hd6305.cpp +++ b/src/devices/cpu/m6805/hd6305.cpp @@ -1,9 +1,11 @@ // license:BSD-3-Clause // copyright-holders:Aaron Giles, Vas Crabb, Olivier Galibert /* + Hitachi HD6305 series TODO: +- add unimplemented opcodes: STOP, WAIT, DAA, and HD63705Z0 also has MUL - add HD6305Y2 peripherals (nothing to test it with?) - add HD63705Z0 peripherals @@ -374,7 +376,7 @@ hd6305v0_device::hd6305v0_device(const machine_config &mconfig, const char *tag, owner, clock, HD6305V0, - { s_hmos_s_ops, s_hmos_cycles, 14, 0x00ff, 0x00c0, 0x1fff, 0x1ffc }, + { s_hmos_s_ops, s_hd6305_cycles, 14, 0x00ff, 0x00c0, 0x1fff, 0x1ffc }, address_map_constructor(FUNC(hd6305v0_device::internal_map), this)) { } @@ -411,7 +413,7 @@ hd6305y0_device::hd6305y0_device(const machine_config &mconfig, const char *tag, owner, clock, HD6305Y0, - { s_hmos_s_ops, s_cmos_cycles, 14, 0x00ff, 0x00c0, 0x1fff, 0x1ffc }, + { s_hmos_s_ops, s_hd6305_cycles, 14, 0x00ff, 0x00c0, 0x1fff, 0x1ffc }, address_map_constructor(FUNC(hd6305y0_device::internal_map), this)) { } @@ -459,7 +461,7 @@ hd6305y2_device::hd6305y2_device(const machine_config &mconfig, const char *tag, owner, clock, HD6305Y2, - { s_hmos_s_ops, s_hmos_cycles, 14, 0x00ff, 0x00c0, 0x1fff, 0x1ffc }, + { s_hmos_s_ops, s_hd6305_cycles, 14, 0x00ff, 0x00c0, 0x1fff, 0x1ffc }, address_map_constructor(FUNC(hd6305y2_device::internal_map), this)) { } @@ -482,7 +484,7 @@ hd63705z0_device::hd63705z0_device(const machine_config &mconfig, const char *ta owner, clock, HD63705Z0, - { s_hmos_b_ops, s_hmos_cycles, 16, 0x017f, 0x0100, 0x1fff, 0x1ffa }, + { s_hmos_b_ops, s_hd63705_cycles, 16, 0x017f, 0x0100, 0x1fff, 0x1ffa }, address_map_constructor(FUNC(hd63705z0_device::internal_map), this)) { } diff --git a/src/devices/cpu/m6805/m6805.cpp b/src/devices/cpu/m6805/m6805.cpp index a5d854c776b..4b82f042f17 100644 --- a/src/devices/cpu/m6805/m6805.cpp +++ b/src/devices/cpu/m6805/m6805.cpp @@ -305,6 +305,48 @@ const m6805_base_device::cycle_count_table m6805_base_device::s_hc_cycles = /*F*/ 3, 3, 3, 3, 3, 3, 3, 4, 3, 3, 3, 3, 2, 5, 3, 4 }; +const m6805_base_device::cycle_count_table m6805_base_device::s_hd6305_cycles = +{ + /* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ + /*0*/ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + /*1*/ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + /*2*/ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + /*3*/ 5, 0, 0, 5, 5, 0, 5, 5, 5, 5, 5, 0, 5, 4, 0, 5, + /*4*/ 2, 0, 0, 2, 2, 0, 2, 2, 2, 2, 2, 0, 2, 2, 0, 2, + /*5*/ 2, 0, 0, 2, 2, 0, 2, 2, 2, 2, 2, 0, 2, 2, 0, 2, + /*6*/ 6, 0, 0, 6, 6, 0, 6, 6, 6, 6, 6, 0, 6, 5, 0, 6, + /*7*/ 5, 0, 0, 5, 5, 0, 5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0, 2, 4, 4, + /*9*/ 0, 0, 0, 0, 0, 0, 0, 2, 1, 1, 2, 2, 2, 1, 0, 2, + /*A*/ 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 0, 6, 2, 0, + /*B*/ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 6, 3, 3, + /*C*/ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 3, 7, 4, 4, + /*D*/ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 4, 7, 5, 5, + /*E*/ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 3, 6, 4, 4, + /*F*/ 3, 3, 3, 3, 3, 3, 3, 4, 3, 3, 3, 3, 2, 6, 3, 4 +}; + //------------------------------------------------- // m6809_base_device - constructor diff --git a/src/devices/cpu/m6805/m6805.h b/src/devices/cpu/m6805/m6805.h index ef38352ea4f..a7908e2a542 100644 --- a/src/devices/cpu/m6805/m6805.h +++ b/src/devices/cpu/m6805/m6805.h @@ -103,6 +103,8 @@ protected: static cycle_count_table s_hmos_cycles; static cycle_count_table s_cmos_cycles; static cycle_count_table s_hc_cycles; + static cycle_count_table s_hd6305_cycles; + static cycle_count_table s_hd63705_cycles; // construction/destruction m6805_base_device( -- cgit v1.2.3