more inlining

This commit is contained in:
Andrei Holub 2025-04-04 15:18:36 -04:00
parent e50bb06ccd
commit 1ddb3643df
10 changed files with 30 additions and 22 deletions

View File

@ -47,9 +47,14 @@ void nsc800_device::device_reset()
//-------------------------------------------------
// execute
//-------------------------------------------------
void nsc800_device::do_op()
void nsc800_device::execute_run()
{
if (m_wait_state)
{
m_icount = 0; // stalled
return;
}
#include "cpu/z80/ncs800.hxx"
}

View File

@ -26,9 +26,9 @@ protected:
virtual void device_reset() override ATTR_COLD;
// device_execute_interface implementation
virtual void execute_run() override;
virtual void execute_set_input(int inputnum, int state) override;
virtual void do_op() override;
u8 m_nsc800_irq_state[3]; // state of NSC800 restart interrupts A, B, C
};

View File

@ -97,7 +97,13 @@ void r800_device::muluw(u16 value)
set_f((F & (HF|NF)) | z | c);
}
void r800_device::do_op()
void r800_device::execute_run()
{
if (m_wait_state)
{
m_icount = 0; // stalled
return;
}
#include "cpu/z80/r800.hxx"
}

View File

@ -33,6 +33,7 @@ protected:
// device_execute_interface overrides
virtual u64 execute_clocks_to_cycles(u64 clocks) const noexcept override { return (clocks + 4 - 1) / 4; }
virtual u64 execute_cycles_to_clocks(u64 cycles) const noexcept override { return (cycles * 4); }
virtual void execute_run() override;
// device_disasm_interface implementation
virtual std::unique_ptr<util::disasm_interface> create_disassembler() override;
@ -40,8 +41,6 @@ protected:
u8 r800_sll(u8 value);
void mulub(u8 value);
void muluw(u16 value);
virtual void do_op() override;
};
// device type declaration

View File

@ -699,11 +699,6 @@ void z80_device::device_reset()
m_iff2 = 0;
}
void z80_device::do_op()
{
#include "cpu/z80/z80.hxx"
}
/****************************************************************************
* Execute 'cycles' T-states.
****************************************************************************/
@ -715,10 +710,7 @@ void z80_device::execute_run()
return;
}
while (m_icount > 0)
{
do_op();
}
#include "cpu/z80/z80.hxx"
}
void z80_device::execute_set_input(int inputnum, int state)

View File

@ -121,8 +121,6 @@ protected:
void set_f(u8 f);
void block_io_interrupted_flags();
virtual void do_op();
virtual u8 data_read(u16 addr);
virtual void data_write(u16 addr, u8 value);
virtual u8 stack_read(u16 addr) { return data_read(addr); }

View File

@ -679,7 +679,7 @@ ffff
}
if (m_icount > 0)
m_icount = 0;
return;
goto leave;
} else if (m_busack_state) {
m_busack_state = 0;
m_busack_cb(0);

View File

@ -74,7 +74,7 @@ class Opcode:
to_step = "0x%s" % (hex(256 + step)[3:])
il.print("if (m_icount <= 0) {", f)
il.print(" m_ref = (m_ref & 0xffff00) | %s;" % (to_step), f)
il.print(" return;", f)
il.print(" goto leave;", f)
il.print("}", f)
il.print("[[fallthrough]];", f)
print("\t\tcase %s:" % (to_step), file=f)
@ -92,7 +92,7 @@ class Opcode:
step += 1
to_step = "0x%s" % (hex(256 + step)[3:])
il.print(" m_ref = (m_ref & 0xffff00) | %s;" % (to_step), f)
il.print(" return;", f)
il.print(" goto leave;", f)
il.print("}", f)
il.print("[[fallthrough]];", f)
print("\t\tcase %s:" % (to_step), file=f)
@ -251,6 +251,7 @@ class OpcodeList:
print("", file=f)
print("m_ref = 0xffff00;", file=f)
print("goto rop;", file=f)
print("leave: ;", file=f)
def main(argv):
if len(argv) != 3 and len(argv) != 4:

View File

@ -31,8 +31,14 @@ z80n_device::z80n_device(const machine_config &mconfig, const char *tag, device_
{
}
void z80n_device::do_op()
void z80n_device::execute_run()
{
if (m_wait_state)
{
m_icount = 0; // stalled
return;
}
#include "cpu/z80/z80n.hxx"
}

View File

@ -26,7 +26,8 @@ protected:
virtual void device_start() override ATTR_COLD;
virtual void device_reset() override ATTR_COLD;
virtual void do_op() override;
// device_execute_interface implementation
virtual void execute_run() override;
devcb_write8 m_out_retn_seen_cb;
devcb_read8 m_in_nextreg_cb;