tms1000: move tms0270 devcb binders to base class (nw)

This commit is contained in:
hap 2019-03-01 14:49:40 +01:00
parent 17fcc38a25
commit ae00d7c0da
11 changed files with 53 additions and 83 deletions

View File

@ -24,9 +24,6 @@ DEFINE_DEVICE_TYPE(TMS0270, tms0270_cpu_device, "tms0270", "Texas Instruments TM
// device definitions
tms0270_cpu_device::tms0270_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: tms0980_cpu_device(mconfig, TMS0270, tag, owner, clock, 16 /* o pins */, 16 /* r pins */, 7 /* pc bits */, 9 /* byte width */, 4 /* x width */, 11 /* prg width */, address_map_constructor(FUNC(tms0270_cpu_device::program_11bit_9), this), 8 /* data width */, address_map_constructor(FUNC(tms0270_cpu_device::data_144x4), this))
, m_read_ctl(*this)
, m_write_ctl(*this)
, m_write_pdc(*this)
{
}
@ -47,10 +44,6 @@ void tms0270_cpu_device::device_start()
// common init
tms1k_base_device::device_start();
m_read_ctl.resolve_safe(0);
m_write_ctl.resolve_safe();
m_write_pdc.resolve_safe();
// zerofill
m_r_prev = 0;
m_chipsel = 0;

View File

@ -19,11 +19,6 @@ class tms0270_cpu_device : public tms0980_cpu_device
public:
tms0270_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
// TMS0270 was designed to interface with TMS5100, set it up at driver level
auto read_ctl() { return m_read_ctl.bind(); }
auto write_ctl() { return m_write_ctl.bind(); }
auto write_pdc() { return m_write_pdc.bind(); }
protected:
// overrides
virtual void device_start() override;
@ -50,10 +45,6 @@ private:
u8 m_o_latch_low;
u8 m_o_latch;
u8 m_o_latch_prev;
devcb_read8 m_read_ctl;
devcb_write8 m_write_ctl;
devcb_write_line m_write_pdc;
};

View File

@ -52,21 +52,3 @@ u32 tms1000c_cpu_device::decode_micro(u8 sel)
return decode;
}
// execute
void tms1000c_cpu_device::execute_run()
{
while (m_icount > 0)
{
if (m_halt_pin)
{
// not running (output pins remain unchanged)
m_icount = 0;
return;
}
m_icount--;
execute_one();
}
}

View File

@ -23,7 +23,6 @@ protected:
// overrides
virtual void device_add_mconfig(machine_config &config) override;
virtual u32 decode_micro(u8 sel) override;
virtual void execute_run() override;
virtual void op_br() override { op_br3(); } // 3-level stack
virtual void op_call() override { op_call3(); } // "

View File

@ -90,6 +90,9 @@ tms1k_base_device::tms1k_base_device(const machine_config &mconfig, device_type
, m_write_o(*this)
, m_write_r(*this)
, m_power_off(*this)
, m_read_ctl(*this)
, m_write_ctl(*this)
, m_write_pdc(*this)
{
}
@ -131,6 +134,9 @@ void tms1k_base_device::device_start()
m_write_o.resolve_safe();
m_write_r.resolve_safe();
m_power_off.resolve_safe();
m_read_ctl.resolve_safe(0);
m_write_ctl.resolve_safe();
m_write_pdc.resolve_safe();
// zerofill
m_pc = 0;
@ -147,7 +153,6 @@ void tms1k_base_device::device_start()
m_r = 0;
m_o = 0;
m_o_index = 0;
m_halt_pin = false;
m_cki_bus = 0;
m_c4 = 0;
m_p = 0;
@ -187,7 +192,6 @@ void tms1k_base_device::device_start()
save_item(NAME(m_r));
save_item(NAME(m_o));
save_item(NAME(m_o_index));
save_item(NAME(m_halt_pin));
save_item(NAME(m_cki_bus));
save_item(NAME(m_c4));
save_item(NAME(m_p));
@ -311,15 +315,6 @@ void tms1k_base_device::read_opcode()
// i/o handling
//-------------------------------------------------
void tms1k_base_device::execute_set_input(int line, int state)
{
if (line != TMS1XXX_INPUT_LINE_HALT)
return;
// HALT pin (CMOS only)
m_halt_pin = bool(state);
}
void tms1k_base_device::write_o_output(u8 index)
{
// a hardcoded table is supported if the output pla is unknown

View File

@ -17,10 +17,6 @@
#include "machine/pla.h"
// HALT input pin on CMOS chips (use set_input_line)
#define TMS1XXX_INPUT_LINE_HALT 0
// pinout reference
/*
@ -78,6 +74,14 @@ public:
// OFF request on TMS0980 and up
auto power_off() { return m_power_off.bind(); }
// note: for HALT input pin on CMOS chips, use set_input_line with INPUT_LINE_HALT
// similarly with the INIT pin, simply use INPUT_LINE_RESET
// TMS0270 was designed to interface with TMS5100, set it up at driver level
auto read_ctl() { return m_read_ctl.bind(); }
auto write_ctl() { return m_write_ctl.bind(); }
auto write_pdc() { return m_write_pdc.bind(); }
// Use this if the output PLA is unknown:
// If the microinstructions (or other) PLA is unknown, try using one from another romset.
void set_output_pla(const u16 *output_pla) { m_output_pla_table = output_pla; }
@ -95,8 +99,6 @@ protected:
// device_execute_interface overrides
virtual u32 execute_min_cycles() const override { return 1; }
virtual u32 execute_max_cycles() const override { return 1; }
virtual u32 execute_input_lines() const override { return 1; }
virtual void execute_set_input(int line, int state) override;
virtual void execute_run() override;
virtual void execute_one();
@ -245,7 +247,6 @@ protected:
int m_subcycle;
int m_icount;
u8 m_o_index;
bool m_halt_pin;
u8 m_o_pins; // how many O pins
u8 m_r_pins; // how many R pins
@ -261,6 +262,9 @@ protected:
devcb_write16 m_write_o;
devcb_write16 m_write_r;
devcb_write_line m_power_off;
devcb_read8 m_read_ctl;
devcb_write8 m_write_ctl;
devcb_write_line m_write_pdc;
u32 m_o_mask;
u32 m_r_mask;

View File

@ -9380,7 +9380,7 @@ void xl25_state::update_halt()
{
// O5+K4 go to HALT pin (used when pressing store/recall button)
bool halt = !((m_o & 0x20) || (read_k(machine().dummy_space(), 0) & 4));
m_maincpu->set_input_line(TMS1XXX_INPUT_LINE_HALT, halt ? ASSERT_LINE : CLEAR_LINE);
m_maincpu->set_input_line(INPUT_LINE_HALT, halt ? ASSERT_LINE : CLEAR_LINE);
}
void xl25_state::prepare_display()

View File

@ -280,7 +280,7 @@ void ti74_state::main_map(address_map &map)
map.unmap_value_high();
map(0x1000, 0x1001).rw("hd44780", FUNC(hd44780_device::read), FUNC(hd44780_device::write));
map(0x2000, 0x3fff).ram().share("sysram.ic3");
//AM_RANGE(0x4000, 0xbfff) // mapped by the cartslot
//map(0x4000, 0xbfff) // mapped by the cartslot
map(0xc000, 0xdfff).bankr("sysbank");
}

View File

@ -500,7 +500,7 @@ private:
// cartridge
u32 m_cart_max_size;
u8* m_cart_base;
u8 *m_cart_base;
u8 m_overlay;
};
@ -710,7 +710,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(tispeak_state::tntell_get_overlay)
// try to get it from (external) layout
if (m_overlay == 0x20)
{
// as output value, eg. with defstate
// as output value, eg. with defstate (in decimal)
m_overlay = output().get_value("overlay_code") & 0x1f;
// and from current view name ($ + 2 hex digits)
@ -1308,14 +1308,14 @@ void tispeak_state::tms5110_route(machine_config &config)
void tispeak_state::snmath(machine_config &config)
{
/* basic machine hardware */
tms0270_cpu_device &tms(TMS0270(config, m_maincpu, MASTER_CLOCK/2));
tms.k().set(FUNC(tispeak_state::snspell_read_k));
tms.o().set(FUNC(tispeak_state::snmath_write_o));
tms.r().set(FUNC(tispeak_state::snspell_write_r));
TMS0270(config, m_maincpu, MASTER_CLOCK/2);
m_maincpu->k().set(FUNC(tispeak_state::snspell_read_k));
m_maincpu->o().set(FUNC(tispeak_state::snmath_write_o));
m_maincpu->r().set(FUNC(tispeak_state::snspell_write_r));
tms.read_ctl().set("tms5100", FUNC(tms5110_device::ctl_r));
tms.write_ctl().set("tms5100", FUNC(tms5110_device::ctl_w));
tms.write_pdc().set("tms5100", FUNC(tms5110_device::pdc_w));
m_maincpu->read_ctl().set("tms5100", FUNC(tms5110_device::ctl_r));
m_maincpu->write_ctl().set("tms5100", FUNC(tms5110_device::ctl_w));
m_maincpu->write_pdc().set("tms5100", FUNC(tms5110_device::pdc_w));
TIMER(config, "display_decay").configure_periodic(FUNC(hh_tms1k_state::display_decay_tick), attotime::from_msec(1));
config.set_default_layout(layout_snmath);

View File

@ -69,8 +69,8 @@
class tispellb_state : public hh_tms1k_state
{
public:
tispellb_state(const machine_config &mconfig, device_type type, const char *tag)
: hh_tms1k_state(mconfig, type, tag),
tispellb_state(const machine_config &mconfig, device_type type, const char *tag) :
hh_tms1k_state(mconfig, type, tag),
m_subcpu(*this, "subcpu"),
m_tms6100(*this, "tms6100")
{ }
@ -82,7 +82,7 @@ public:
private:
// devices
optional_device<cpu_device> m_subcpu;
optional_device<tms1k_base_device> m_subcpu;
optional_device<tms6100_device> m_tms6100;
u8 m_rev1_ctl;
@ -348,17 +348,17 @@ INPUT_PORTS_END
void tispellb_state::rev1(machine_config &config)
{
/* basic machine hardware */
tms0270_cpu_device &tms(TMS0270(config, m_maincpu, 350000)); // approximation
tms.k().set(FUNC(tispellb_state::main_read_k));
tms.o().set(FUNC(tispellb_state::main_write_o));
tms.r().set(FUNC(tispellb_state::main_write_r));
tms.read_ctl().set(FUNC(tispellb_state::rev1_ctl_r));
tms.write_ctl().set(FUNC(tispellb_state::rev1_ctl_w));
TMS0270(config, m_maincpu, 350000); // approximation
m_maincpu->k().set(FUNC(tispellb_state::main_read_k));
m_maincpu->o().set(FUNC(tispellb_state::main_write_o));
m_maincpu->r().set(FUNC(tispellb_state::main_write_r));
m_maincpu->read_ctl().set(FUNC(tispellb_state::rev1_ctl_r));
m_maincpu->write_ctl().set(FUNC(tispellb_state::rev1_ctl_w));
tms1980_cpu_device &subcpu(TMS1980(config, m_subcpu, 350000)); // approximation
subcpu.k().set(FUNC(tispellb_state::sub_read_k));
subcpu.o().set(FUNC(tispellb_state::sub_write_o));
subcpu.r().set(FUNC(tispellb_state::sub_write_r));
TMS1980(config, m_subcpu, 350000); // approximation
m_subcpu->k().set(FUNC(tispellb_state::sub_read_k));
m_subcpu->o().set(FUNC(tispellb_state::sub_write_o));
m_subcpu->r().set(FUNC(tispellb_state::sub_write_r));
config.m_perfect_cpu_quantum = subtag("maincpu");
@ -372,12 +372,12 @@ void tispellb_state::rev1(machine_config &config)
void tispellb_state::rev2(machine_config &config)
{
/* basic machine hardware */
tms0270_cpu_device &tms(TMS0270(config, m_maincpu, 350000)); // approximation
tms.k().set(FUNC(tispellb_state::main_read_k));
tms.o().set(FUNC(tispellb_state::rev2_write_o));
tms.r().set(FUNC(tispellb_state::rev2_write_r));
tms.read_ctl().set(m_tms6100, FUNC(tms6100_device::data_r));
tms.write_ctl().set(m_tms6100, FUNC(tms6100_device::add_w));
TMS0270(config, m_maincpu, 350000); // approximation
m_maincpu->k().set(FUNC(tispellb_state::main_read_k));
m_maincpu->o().set(FUNC(tispellb_state::rev2_write_o));
m_maincpu->r().set(FUNC(tispellb_state::rev2_write_r));
m_maincpu->read_ctl().set(m_tms6100, FUNC(tms6100_device::data_r));
m_maincpu->write_ctl().set(m_tms6100, FUNC(tms6100_device::add_w));
TMS6100(config, m_tms6100, 350000);
m_tms6100->enable_4bit_mode(true);

View File

@ -5,6 +5,7 @@
<element name="static_black"><rect><color red="0.1" green="0.1" blue="0.1" /></rect></element>
<element name="static_white"><rect><color red="0.98" green="0.98" blue="1.0" /></rect></element>
<element name="overlay_default" defstate="4"><text string=" "></text></element>
<element name="text_on">
<rect><color red="0.98" green="0.98" blue="1.0" /></rect>
@ -40,6 +41,11 @@
<view name="Internal Layout">
<bounds left="3" right="71.8" top="9.7" bottom="71.8" />
<!-- this "overlay_code" example only works for 1 view, since MAME parses all views and not just current active one -->
<!-- you can also put the overlay code in the view name, as $XX where XX is the hex value of the overlay in tispeak.cpp -->
<bezel name="overlay_code" element="overlay_default"><bounds x="0" y="0" width="1" height="1" /></bezel>
<bezel element="static_black">
<bounds left="3" right="71.8" top="9.7" bottom="71.8" />
</bezel>