From aa455aa20b87b78d3f90e49ad34d16066ef6b02e Mon Sep 17 00:00:00 2001 From: hap Date: Mon, 22 Apr 2019 22:05:27 +0200 Subject: [PATCH] sm530: add some opcodes (nw) --- src/devices/cpu/sm510/sm500core.cpp | 14 ++-- src/devices/cpu/sm510/sm510.h | 4 +- src/devices/cpu/sm510/sm510base.cpp | 7 +- src/devices/cpu/sm510/sm510core.cpp | 7 +- src/devices/cpu/sm510/sm510d.h | 2 + src/devices/cpu/sm510/sm510op.cpp | 17 ++-- src/devices/cpu/sm510/sm511core.cpp | 21 +++-- src/devices/cpu/sm510/sm530.h | 20 ++++- src/devices/cpu/sm510/sm530core.cpp | 121 ++++++++++++++++++++++++---- src/devices/cpu/sm510/sm530op.cpp | 63 +++++++++++++-- src/devices/cpu/sm510/sm590core.cpp | 28 +++---- src/devices/cpu/sm510/sm590op.cpp | 1 + src/devices/cpu/sm510/sm5acore.cpp | 28 +++---- 13 files changed, 247 insertions(+), 86 deletions(-) diff --git a/src/devices/cpu/sm510/sm500core.cpp b/src/devices/cpu/sm510/sm500core.cpp index abe34e55fa3..8396d8e3107 100644 --- a/src/devices/cpu/sm510/sm500core.cpp +++ b/src/devices/cpu/sm510/sm500core.cpp @@ -36,16 +36,14 @@ void sm500_device::data_4x10x4(address_map &map) // device definitions -sm500_device::sm500_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) - : sm500_device(mconfig, SM500, tag, owner, clock, 1 /* stack levels */, 7 /* o group pins */, 11 /* prg width */, address_map_constructor(FUNC(sm500_device::program_1_2k), this), 6 /* data width */, address_map_constructor(FUNC(sm500_device::data_4x10x4), this)) -{ -} +sm500_device::sm500_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + sm500_device(mconfig, SM500, tag, owner, clock, 1 /* stack levels */, 7 /* o group pins */, 11 /* prg width */, address_map_constructor(FUNC(sm500_device::program_1_2k), this), 6 /* data width */, address_map_constructor(FUNC(sm500_device::data_4x10x4), this)) +{ } -sm500_device::sm500_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int stack_levels, int o_pins, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data) - : sm510_base_device(mconfig, type, tag, owner, clock, stack_levels, prgwidth, program, datawidth, data), +sm500_device::sm500_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int stack_levels, int o_pins, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data) : + sm510_base_device(mconfig, type, tag, owner, clock, stack_levels, prgwidth, program, datawidth, data), m_o_pins(o_pins) -{ -} +{ } // disasm diff --git a/src/devices/cpu/sm510/sm510.h b/src/devices/cpu/sm510/sm510.h index 03cd24efe89..6171de9ee6e 100644 --- a/src/devices/cpu/sm510/sm510.h +++ b/src/devices/cpu/sm510/sm510.h @@ -149,6 +149,7 @@ protected: u8 m_bl; u8 m_bm; bool m_sbm; + bool m_sbl; u8 m_c; bool m_skip; u8 m_w; @@ -164,7 +165,7 @@ protected: emu_timer *m_lcd_timer; u8 m_l, m_x; u8 m_y; - bool m_bp; + u8 m_bp; bool m_bc; u16 get_lcd_row(int column, u8* ram); @@ -214,6 +215,7 @@ protected: // opcode handlers virtual void op_lb(); virtual void op_lbl(); + virtual void op_sbl(); virtual void op_sbm(); virtual void op_exbla(); virtual void op_incb(); diff --git a/src/devices/cpu/sm510/sm510base.cpp b/src/devices/cpu/sm510/sm510base.cpp index 919fcea9e17..ab7b659cbb2 100644 --- a/src/devices/cpu/sm510/sm510base.cpp +++ b/src/devices/cpu/sm510/sm510base.cpp @@ -61,6 +61,7 @@ void sm510_base_device::device_start() m_acc = 0; m_bl = 0; m_bm = 0; + m_sbl = false; m_sbm = false; m_c = 0; m_skip = false; @@ -73,7 +74,7 @@ void sm510_base_device::device_start() m_l = 0; m_x = 0; m_y = 0; - m_bp = false; + m_bp = 0; m_bc = false; m_halt = false; m_melody_rd = 0; @@ -93,6 +94,7 @@ void sm510_base_device::device_start() save_item(NAME(m_acc)); save_item(NAME(m_bl)); save_item(NAME(m_bm)); + save_item(NAME(m_sbl)); save_item(NAME(m_sbm)); save_item(NAME(m_c)); save_item(NAME(m_skip)); @@ -147,13 +149,14 @@ void sm510_base_device::device_reset() // ACL m_skip = false; m_halt = false; + m_sbl = false; m_sbm = false; m_op = m_prev_op = 0; reset_vector(); m_prev_pc = m_pc; // lcd is on (Bp on, BC off, bs(y) off) - m_bp = true; + m_bp = 1; m_bc = false; m_y = 0; diff --git a/src/devices/cpu/sm510/sm510core.cpp b/src/devices/cpu/sm510/sm510core.cpp index 4d5edbef5f1..80ab6bf6ab3 100644 --- a/src/devices/cpu/sm510/sm510core.cpp +++ b/src/devices/cpu/sm510/sm510core.cpp @@ -37,10 +37,9 @@ void sm510_device::data_96_32x4(address_map &map) // device definitions -sm510_device::sm510_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) - : sm510_base_device(mconfig, SM510, tag, owner, clock, 2 /* stack levels */, 12 /* prg width */, address_map_constructor(FUNC(sm510_device::program_2_7k), this), 7 /* data width */, address_map_constructor(FUNC(sm510_device::data_96_32x4), this)) -{ -} +sm510_device::sm510_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + sm510_base_device(mconfig, SM510, tag, owner, clock, 2 /* stack levels */, 12 /* prg width */, address_map_constructor(FUNC(sm510_device::program_2_7k), this), 7 /* data width */, address_map_constructor(FUNC(sm510_device::data_96_32x4), this)) +{ } // disasm diff --git a/src/devices/cpu/sm510/sm510d.h b/src/devices/cpu/sm510/sm510d.h index a29a1f201a0..660471ad640 100644 --- a/src/devices/cpu/sm510/sm510d.h +++ b/src/devices/cpu/sm510/sm510d.h @@ -125,6 +125,8 @@ public: virtual offs_t disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) override; + virtual u32 interface_flags() const override { return NONLINEAR_PC | PAGED; } + private: static const u8 sm530_mnemonic[0x100]; }; diff --git a/src/devices/cpu/sm510/sm510op.cpp b/src/devices/cpu/sm510/sm510op.cpp index 654ce20a5d2..acaf607f9df 100644 --- a/src/devices/cpu/sm510/sm510op.cpp +++ b/src/devices/cpu/sm510/sm510op.cpp @@ -11,15 +11,17 @@ u8 sm510_base_device::ram_r() { + int blh = (m_sbl) ? 8 : 0; // from SBL (optional) int bmh = (m_sbm) ? (1 << (m_datawidth-1)) : 0; // from SBM - u8 address = (bmh | m_bm << 4 | m_bl) & m_datamask; + u8 address = (bmh | blh | m_bm << 4 | m_bl) & m_datamask; return m_data->read_byte(address) & 0xf; } void sm510_base_device::ram_w(u8 data) { + int blh = (m_sbl) ? 8 : 0; // from SBL (optional) int bmh = (m_sbm) ? (1 << (m_datawidth-1)) : 0; // from SBM - u8 address = (bmh | m_bm << 4 | m_bl) & m_datamask; + u8 address = (bmh | blh | m_bm << 4 | m_bl) & m_datamask; m_data->write_byte(address, data & 0xf); } @@ -40,7 +42,7 @@ void sm510_base_device::push_stack() void sm510_base_device::do_branch(u8 pu, u8 pm, u8 pl) { // set new PC(Pu/Pm/Pl) - m_pc = ((pu << 10 & 0xc00) | (pm << 6 & 0x3c0) | (pl & 0x03f)) & m_prgmask; + m_pc = ((pu << 10) | (pm << 6 & 0x3c0) | (pl & 0x03f)) & m_prgmask; } u8 sm510_base_device::bitmask(u16 param) @@ -69,6 +71,11 @@ void sm510_base_device::op_lbl() m_bm = (m_param & m_datamask) >> 4; } +void sm510_base_device::op_sbl() +{ + // SBL: set BL high bit for next opcode - handled in execute_one() +} + void sm510_base_device::op_sbm() { // SBM: set BM high bit for next opcode - handled in execute_one() @@ -139,7 +146,7 @@ void sm510_base_device::op_tml() void sm510_base_device::op_tm() { - // TM x: indirect subroutine call, pointers(IDX) are in page 0 + // TM x: indirect subroutine call, pointers(IDX) are on page 0 m_icount--; push_stack(); u8 idx = m_program->read_byte(m_op & 0x3f); @@ -225,7 +232,7 @@ void sm510_base_device::op_kta() void sm510_base_device::op_atbp() { // ATBP: output ACC to BP(internal LCD backplate signal) - m_bp = ((m_acc & 1) != 0); + m_bp = m_acc & 1; } void sm510_base_device::op_atx() diff --git a/src/devices/cpu/sm510/sm511core.cpp b/src/devices/cpu/sm510/sm511core.cpp index 6585f18febf..c7a26de07e2 100644 --- a/src/devices/cpu/sm510/sm511core.cpp +++ b/src/devices/cpu/sm510/sm511core.cpp @@ -54,20 +54,17 @@ std::unique_ptr sm511_device::create_disassembler() // device definitions -sm511_device::sm511_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) - : sm511_device(mconfig, SM511, tag, owner, clock, 2 /* stack levels */, 12 /* prg width */, address_map_constructor(FUNC(sm511_device::program_4k), this), 7 /* data width */, address_map_constructor(FUNC(sm511_device::data_96_32x4), this)) -{ -} +sm511_device::sm511_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + sm511_device(mconfig, SM511, tag, owner, clock, 2 /* stack levels */, 12 /* prg width */, address_map_constructor(FUNC(sm511_device::program_4k), this), 7 /* data width */, address_map_constructor(FUNC(sm511_device::data_96_32x4), this)) +{ } -sm511_device::sm511_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int stack_levels, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data) - : sm510_base_device(mconfig, type, tag, owner, clock, stack_levels, prgwidth, program, datawidth, data) -{ -} +sm511_device::sm511_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int stack_levels, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data) : + sm510_base_device(mconfig, type, tag, owner, clock, stack_levels, prgwidth, program, datawidth, data) +{ } -sm512_device::sm512_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) - : sm511_device(mconfig, SM512, tag, owner, clock, 2, 12, address_map_constructor(FUNC(sm512_device::program_4k), this), 7, address_map_constructor(FUNC(sm512_device::data_80_48x4), this)) -{ -} +sm512_device::sm512_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + sm511_device(mconfig, SM512, tag, owner, clock, 2, 12, address_map_constructor(FUNC(sm512_device::program_4k), this), 7, address_map_constructor(FUNC(sm512_device::data_80_48x4), this)) +{ } diff --git a/src/devices/cpu/sm510/sm530.h b/src/devices/cpu/sm510/sm530.h index 64e03884481..8837ea1e2cd 100644 --- a/src/devices/cpu/sm510/sm530.h +++ b/src/devices/cpu/sm510/sm530.h @@ -25,14 +25,30 @@ protected: void program_2k(address_map &map); void data_64_24x4(address_map &map); + virtual void device_start() override; virtual void device_reset() override; virtual std::unique_ptr create_disassembler() override; + virtual u64 execute_clocks_to_cycles(u64 clocks) const override { return (clocks + 3 - 1) / 3; } // 3 cycles per machine cycle + virtual u64 execute_cycles_to_clocks(u64 cycles) const override { return (cycles * 3); } // " virtual void execute_one() override; virtual void get_opcode_param() override; - virtual u8 ram_r() override; - virtual void ram_w(u8 data) override; + using sm510_base_device::do_branch; + virtual void do_branch(u8 pu, u8 pl); // does not have Pm + virtual void reset_vector() override { do_branch(0xf, 0); } + virtual void wakeup_vector() override { reset_vector(); } + + // opcode handlers + virtual void op_lb() override; + virtual void op_incb() override; + + virtual void op_tl() override; + virtual void op_trs(); + + virtual void op_adx() override; + + virtual void op_atbp() override; }; class sm531_device : public sm530_device diff --git a/src/devices/cpu/sm510/sm530core.cpp b/src/devices/cpu/sm510/sm530core.cpp index 1a1b00b392f..3d3a424ad90 100644 --- a/src/devices/cpu/sm510/sm530core.cpp +++ b/src/devices/cpu/sm510/sm530core.cpp @@ -5,7 +5,7 @@ Sharp SM530 MCU core implementation TODO: - - everything + - almost everything */ @@ -29,8 +29,8 @@ void sm530_device::program_2k(address_map &map) void sm530_device::data_64_24x4(address_map &map) { map(0x00, 0x3f).ram(); - map(0x40, 0x4b).ram(); - map(0x50, 0x5b).ram(); + map(0x40, 0x4b).mirror(0x20).ram().share("lcd_ram_a"); + map(0x50, 0x5b).mirror(0x20).ram().share("lcd_ram_b"); } @@ -42,19 +42,28 @@ std::unique_ptr sm530_device::create_disassembler() // device definitions -sm530_device::sm530_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) - : sm530_device(mconfig, SM530, tag, owner, clock, 1 /* stack levels */, 11 /* prg width */, address_map_constructor(FUNC(sm530_device::program_2k), this), 7 /* data width */, address_map_constructor(FUNC(sm530_device::data_64_24x4), this)) -{ -} +sm530_device::sm530_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + sm530_device(mconfig, SM530, tag, owner, clock, 1 /* stack levels */, 11 /* prg width */, address_map_constructor(FUNC(sm530_device::program_2k), this), 7 /* data width */, address_map_constructor(FUNC(sm530_device::data_64_24x4), this)) +{ } -sm530_device::sm530_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int stack_levels, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data) - : sm511_device(mconfig, type, tag, owner, clock, stack_levels, prgwidth, program, datawidth, data) -{ -} +sm530_device::sm530_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int stack_levels, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data) : + sm511_device(mconfig, type, tag, owner, clock, stack_levels, prgwidth, program, datawidth, data) +{ } -sm531_device::sm531_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) - : sm530_device(mconfig, SM531, tag, owner, clock, 1, 11, address_map_constructor(FUNC(sm531_device::program_2k), this), 7, address_map_constructor(FUNC(sm531_device::data_64_24x4), this)) +sm531_device::sm531_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + sm530_device(mconfig, SM531, tag, owner, clock, 1, 11, address_map_constructor(FUNC(sm531_device::program_2k), this), 7, address_map_constructor(FUNC(sm531_device::data_64_24x4), this)) +{ } + + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void sm530_device::device_start() { + // common init + sm511_device::device_start(); } @@ -65,7 +74,8 @@ sm531_device::sm531_device(const machine_config &mconfig, const char *tag, devic void sm530_device::device_reset() { - sm510_base_device::device_reset(); + // common reset + sm511_device::device_reset(); } @@ -76,8 +86,91 @@ void sm530_device::device_reset() void sm530_device::get_opcode_param() { + // LBL, PRE, TL opcodes are 2 bytes + if (m_op == 0x6b || m_op == 0x78 || ((m_op & 0xf8) == 0x60)) + { + m_icount--; + m_param = m_program->read_byte(m_pc); + increment_pc(); + } } void sm530_device::execute_one() { + switch (m_op & 0xf0) + { + case 0x00: op_adx(); break; + case 0x10: op_lax(); break; + case 0x30: op_lb(); break; + + case 0x80: case 0x90: case 0xa0: case 0xb0: + op_t(); break; // TR + case 0xc0: case 0xd0: case 0xe0: case 0xf0: + op_trs(); break; + + default: + switch (m_op & 0xfc) + { + case 0x20: op_lda(); break; + case 0x24: op_exc(); break; + case 0x28: op_exci(); break; + case 0x2c: op_excd(); break; + case 0x40: op_rm(); break; + case 0x44: op_sm(); break; + case 0x48: op_tmi(); break; // TM + case 0x60: case 0x64: op_tl(); break; + //case 0x6c: op_tg(); break; + + default: + switch (m_op) + { + case 0x4c: op_incb(); break; + case 0x4d: op_decb(); break; + //case 0x4e: op_rds(); break; + //case 0x4f: op_sds(); break; + + case 0x50: op_kta(); break; + //case 0x51: op_keta(); break; + //case 0x52: op_dta(); break; + case 0x53: op_coma(); break; + case 0x54: op_add(); break; + case 0x55: op_add11(); break; // ADDC + case 0x56: op_rc(); break; + case 0x57: op_sc(); break; + case 0x58: op_tabl(); break; + case 0x59: op_tam(); break; + case 0x5a: op_exbla(); break; // EXBL + case 0x5b: op_tc(); break; + //case 0x5c: op_ats(); break; + //case 0x5d: op_atf(); break; + case 0x5e: op_atbp(); break; + + case 0x68: op_rtn0(); break; // RTN + case 0x69: op_rtn1(); break; // RTNS + case 0x6a: op_atpl(); break; + case 0x6b: op_lbl(); break; + + //case 0x70: op_idiv(); break; + //case 0x71: op_inis(); break; + case 0x72: op_sbm(); break; // SABM + case 0x73: op_sbl(); break; // SABL + case 0x74: op_cend(); break; + case 0x75: op_tmel(); break; + case 0x76: op_rme(); break; + case 0x77: op_sme(); break; + case 0x78: op_pre(); break; + case 0x79: op_tal(); break; // TBA + + default: op_illegal(); break; + } + break; // 0xff + + } + break; // 0xfc + + } // big switch + + // SABL/SABM is only valid for 1 step + m_sbl = (m_op == 0x73); + m_sbm = (m_op == 0x72); } diff --git a/src/devices/cpu/sm510/sm530op.cpp b/src/devices/cpu/sm510/sm530op.cpp index 256feccdb4b..3aec192b0a0 100644 --- a/src/devices/cpu/sm510/sm530op.cpp +++ b/src/devices/cpu/sm510/sm530op.cpp @@ -9,15 +9,66 @@ // internal helpers -u8 sm530_device::ram_r() -{ - return 0; -} - -void sm530_device::ram_w(u8 data) +void sm530_device::do_branch(u8 pu, u8 pl) { + // set new PC(Pu/Pl) + m_pc = ((pu << 6) | (pl & 0x3f)) & m_prgmask; } // instruction set + +// RAM address instructions + +void sm530_device::op_lb() +{ + // LB x: load BM/BL with 4-bit immediate value (partial) + m_bl = (m_op << 2 & 8) | (m_op & 1) | 6; + m_bm = m_op >> 2 & 3; +} + +void sm530_device::op_incb() +{ + // INCB: increment BL, but overflow on 3rd bit! + sm510_base_device::op_incb(); + m_skip = (m_bl == 8); +} + + +// ROM address instructions + +void sm530_device::op_tl() +{ + // TL xy: long jump + do_branch((m_op << 2) | (m_param >> 6 & 3), m_param & 0x3f); +} + +void sm530_device::op_trs() +{ + // TRS x: indirect subroutine call, jump vectors are on page 14 + m_icount--; + push_stack(); + u8 jump = m_program->read_byte((14 << 6) | (m_op & 0x3f)); + do_branch(jump >> 5 & 7, jump & 0x1f); +} + + +// Arithmetic instructions + +void sm530_device::op_adx() +{ + // ADX x: add immediate value to ACC, skip next on carry + m_acc += (m_op & 0xf); + m_skip = bool(m_acc & 0x10); + m_acc &= 0xf; +} + + +// I/O instructions + +void sm530_device::op_atbp() +{ + // ATBP: output ACC to BP + m_bp = m_acc; +} diff --git a/src/devices/cpu/sm510/sm590core.cpp b/src/devices/cpu/sm510/sm590core.cpp index 8086732ac23..54e4267d7de 100644 --- a/src/devices/cpu/sm510/sm590core.cpp +++ b/src/devices/cpu/sm510/sm590core.cpp @@ -35,25 +35,21 @@ void sm590_device::data_16x2x4(address_map &map) } // device definitions -sm590_device::sm590_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) - : sm590_device(mconfig, SM590, tag, owner, clock, 4 /* stack levels */, 9 /* prg width */, address_map_constructor(FUNC(sm590_device::program_1x128x4), this), 5 /* data width */, address_map_constructor(FUNC(sm590_device::data_16x2x4), this)) -{ -} +sm590_device::sm590_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + sm590_device(mconfig, SM590, tag, owner, clock, 4 /* stack levels */, 9 /* prg width */, address_map_constructor(FUNC(sm590_device::program_1x128x4), this), 5 /* data width */, address_map_constructor(FUNC(sm590_device::data_16x2x4), this)) +{ } -//sm591_device::sm591_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) -// : sm510_base_device(mconfig, SM591, tag, owner, clock, 4 /* stack levels */, 10 /* prg width */, address_map_constructor(FUNC(sm591_device::program_2x128x4), this), 6 /* data width */, address_map_constructor(FUNC(sm591_device::data_16x3.5x4), this)) -//{ -//} +//sm591_device::sm591_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : +// sm510_base_device(mconfig, SM591, tag, owner, clock, 4 /* stack levels */, 10 /* prg width */, address_map_constructor(FUNC(sm591_device::program_2x128x4), this), 6 /* data width */, address_map_constructor(FUNC(sm591_device::data_16x3.5x4), this)) +//{ } -//sm595_device::sm595_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) -// : sm510_base_device(mconfig, SM595, tag, owner, clock, 4 /* stack levels */, 10 /* prg width */, address_map_constructor(FUNC(sm595_device::program_1x128x4_1x128x2), this), 5 /* data width */, address_map_constructor(FUNC(sm595_device::data_16x2x4), this)) -//{ -//} +//sm595_device::sm595_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : +// sm510_base_device(mconfig, SM595, tag, owner, clock, 4 /* stack levels */, 10 /* prg width */, address_map_constructor(FUNC(sm595_device::program_1x128x4_1x128x2), this), 5 /* data width */, address_map_constructor(FUNC(sm595_device::data_16x2x4), this)) +//{ } -sm590_device::sm590_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int stack_levels, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data) - : sm510_base_device(mconfig, type, tag, owner, clock, stack_levels, prgwidth, program, datawidth, data) -{ -} +sm590_device::sm590_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int stack_levels, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data) : + sm510_base_device(mconfig, type, tag, owner, clock, stack_levels, prgwidth, program, datawidth, data) +{ } std::unique_ptr sm590_device::create_disassembler() diff --git a/src/devices/cpu/sm510/sm590op.cpp b/src/devices/cpu/sm510/sm590op.cpp index 99b1c7189b7..c9ead123360 100644 --- a/src/devices/cpu/sm510/sm590op.cpp +++ b/src/devices/cpu/sm510/sm590op.cpp @@ -8,6 +8,7 @@ // internal helpers + void sm590_device::do_branch(u8 pu, u8 pm, u8 pl) { // set new PC(Pu/Pm/Pl) diff --git a/src/devices/cpu/sm510/sm5acore.cpp b/src/devices/cpu/sm510/sm5acore.cpp index d32f46a24bf..a48ffb8110d 100644 --- a/src/devices/cpu/sm510/sm5acore.cpp +++ b/src/devices/cpu/sm510/sm5acore.cpp @@ -44,25 +44,21 @@ void sm5a_device::data_5x13x4(address_map &map) // device definitions -sm5a_device::sm5a_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) - : sm5a_device(mconfig, SM5A, tag, owner, clock, 1 /* stack levels */, 9 /* o group pins */, 11 /* prg width */, address_map_constructor(FUNC(sm5a_device::program_1_8k), this), 7 /* data width */, address_map_constructor(FUNC(sm5a_device::data_5x13x4), this)) -{ -} +sm5a_device::sm5a_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + sm5a_device(mconfig, SM5A, tag, owner, clock, 1 /* stack levels */, 9 /* o group pins */, 11 /* prg width */, address_map_constructor(FUNC(sm5a_device::program_1_8k), this), 7 /* data width */, address_map_constructor(FUNC(sm5a_device::data_5x13x4), this)) +{ } -sm5a_device::sm5a_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int stack_levels, int o_pins, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data) - : sm500_device(mconfig, type, tag, owner, clock, stack_levels, o_pins, prgwidth, program, datawidth, data) -{ -} +sm5a_device::sm5a_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int stack_levels, int o_pins, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data) : + sm500_device(mconfig, type, tag, owner, clock, stack_levels, o_pins, prgwidth, program, datawidth, data) +{ } -sm5l_device::sm5l_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) - : sm5a_device(mconfig, SM5L, tag, owner, clock, 1, 9, 11, address_map_constructor(FUNC(sm5l_device::program_1_8k), this), 7, address_map_constructor(FUNC(sm5l_device::data_5x13x4), this)) -{ -} +sm5l_device::sm5l_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + sm5a_device(mconfig, SM5L, tag, owner, clock, 1, 9, 11, address_map_constructor(FUNC(sm5l_device::program_1_8k), this), 7, address_map_constructor(FUNC(sm5l_device::data_5x13x4), this)) +{ } -kb1013vk12_device::kb1013vk12_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) - : sm5a_device(mconfig, KB1013VK12, tag, owner, clock, 1, 9, 11, address_map_constructor(FUNC(kb1013vk12_device::program_1_8k), this), 7, address_map_constructor(FUNC(kb1013vk12_device::data_5x13x4), this)) -{ -} +kb1013vk12_device::kb1013vk12_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + sm5a_device(mconfig, KB1013VK12, tag, owner, clock, 1, 9, 11, address_map_constructor(FUNC(kb1013vk12_device::program_1_8k), this), 7, address_map_constructor(FUNC(kb1013vk12_device::data_5x13x4), this)) +{ } // disasm