mirror of
https://github.com/holub/mame
synced 2025-10-08 17:37:56 +03:00
tms1000: split execute_run into execute_one (nw)
This commit is contained in:
parent
be9fea28e4
commit
50ee57f1b3
@ -64,3 +64,21 @@ u32 tms1000c_cpu_device::decode_micro(u8 sel)
|
|||||||
|
|
||||||
return decode;
|
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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -23,6 +23,7 @@ protected:
|
|||||||
// overrides
|
// overrides
|
||||||
virtual void device_add_mconfig(machine_config &config) override;
|
virtual void device_add_mconfig(machine_config &config) override;
|
||||||
virtual u32 decode_micro(u8 sel) 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_br() override { op_br3(); } // 3-level stack
|
||||||
virtual void op_call() override { op_call3(); } // "
|
virtual void op_call() override { op_call3(); } // "
|
||||||
|
@ -144,7 +144,7 @@ void tms1k_base_device::device_start()
|
|||||||
m_r = 0;
|
m_r = 0;
|
||||||
m_o = 0;
|
m_o = 0;
|
||||||
m_o_index = 0;
|
m_o_index = 0;
|
||||||
m_halt = false;
|
m_halt_pin = false;
|
||||||
m_cki_bus = 0;
|
m_cki_bus = 0;
|
||||||
m_c4 = 0;
|
m_c4 = 0;
|
||||||
m_p = 0;
|
m_p = 0;
|
||||||
@ -184,7 +184,7 @@ void tms1k_base_device::device_start()
|
|||||||
save_item(NAME(m_r));
|
save_item(NAME(m_r));
|
||||||
save_item(NAME(m_o));
|
save_item(NAME(m_o));
|
||||||
save_item(NAME(m_o_index));
|
save_item(NAME(m_o_index));
|
||||||
save_item(NAME(m_halt));
|
save_item(NAME(m_halt_pin));
|
||||||
save_item(NAME(m_cki_bus));
|
save_item(NAME(m_cki_bus));
|
||||||
save_item(NAME(m_c4));
|
save_item(NAME(m_c4));
|
||||||
save_item(NAME(m_p));
|
save_item(NAME(m_p));
|
||||||
@ -314,7 +314,7 @@ void tms1k_base_device::execute_set_input(int line, int state)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// HALT pin (CMOS only)
|
// HALT pin (CMOS only)
|
||||||
m_halt = bool(state);
|
m_halt_pin = bool(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
void tms1k_base_device::write_o_output(u8 index)
|
void tms1k_base_device::write_o_output(u8 index)
|
||||||
@ -604,22 +604,11 @@ void tms1k_base_device::op_sbl()
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// execute_run
|
// execute
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
void tms1k_base_device::execute_run()
|
void tms1k_base_device::execute_one()
|
||||||
{
|
{
|
||||||
while (m_icount > 0)
|
|
||||||
{
|
|
||||||
m_icount--;
|
|
||||||
|
|
||||||
if (m_halt)
|
|
||||||
{
|
|
||||||
// not running (output pins remain unchanged)
|
|
||||||
m_icount = 0;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (m_subcycle)
|
switch (m_subcycle)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
@ -745,4 +734,12 @@ void tms1k_base_device::execute_run()
|
|||||||
|
|
||||||
m_subcycle = (m_subcycle + 1) % 6;
|
m_subcycle = (m_subcycle + 1) % 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void tms1k_base_device::execute_run()
|
||||||
|
{
|
||||||
|
while (m_icount > 0)
|
||||||
|
{
|
||||||
|
m_icount--;
|
||||||
|
execute_one();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -106,10 +106,11 @@ protected:
|
|||||||
|
|
||||||
// device_execute_interface overrides
|
// device_execute_interface overrides
|
||||||
virtual u32 execute_min_cycles() const override { return 1; }
|
virtual u32 execute_min_cycles() const override { return 1; }
|
||||||
virtual u32 execute_max_cycles() const override { return 6; }
|
virtual u32 execute_max_cycles() const override { return 1; }
|
||||||
virtual u32 execute_input_lines() 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_set_input(int line, int state) override;
|
||||||
virtual void execute_run() override;
|
virtual void execute_run() override;
|
||||||
|
virtual void execute_one();
|
||||||
|
|
||||||
// device_memory_interface overrides
|
// device_memory_interface overrides
|
||||||
virtual space_config_vector memory_space_config() const override;
|
virtual space_config_vector memory_space_config() const override;
|
||||||
@ -256,7 +257,7 @@ protected:
|
|||||||
int m_subcycle;
|
int m_subcycle;
|
||||||
int m_icount;
|
int m_icount;
|
||||||
u8 m_o_index;
|
u8 m_o_index;
|
||||||
bool m_halt; // halt pin state
|
bool m_halt_pin;
|
||||||
|
|
||||||
u8 m_o_pins; // how many O pins
|
u8 m_o_pins; // how many O pins
|
||||||
u8 m_r_pins; // how many R pins
|
u8 m_r_pins; // how many R pins
|
||||||
|
Loading…
Reference in New Issue
Block a user