m6502: don't clear input pins external state at device_reset

This commit is contained in:
hap 2023-07-25 21:34:53 +02:00
parent d18f2469ac
commit f1e86f85c0
3 changed files with 9 additions and 20 deletions

View File

@ -29,8 +29,9 @@ m6502_device::m6502_device(const machine_config &mconfig, device_type type, cons
cpu_device(mconfig, type, tag, owner, clock),
sync_w(*this),
program_config("program", ENDIANNESS_LITTLE, 8, 16),
sprogram_config("decrypted_opcodes", ENDIANNESS_LITTLE, 8, 16), PPC(0), NPC(0), PC(0), SP(0), TMP(0), TMP2(0), A(0), X(0), Y(0), P(0), IR(0), inst_state_base(0), mintf(nullptr),
inst_state(0), inst_substate(0), icount(0), nmi_state(false), irq_state(false), apu_irq_state(false), v_state(false), nmi_pending(false), irq_taken(false), sync(false), inhibit_interrupts(false), uses_custom_memory_interface(false)
sprogram_config("decrypted_opcodes", ENDIANNESS_LITTLE, 8, 16),
mintf(nullptr),
uses_custom_memory_interface(false)
{
}
@ -55,8 +56,6 @@ void m6502_device::init()
space(AS_PROGRAM).specific(mintf->program14);
}
XPC = 0;
state_add(STATE_GENPC, "GENPC", XPC).callexport().noshow();
state_add(STATE_GENPCBASE, "CURPC", XPC).callexport().noshow();
state_add(STATE_GENFLAGS, "GENFLAGS", P).callimport().formatstr("%6s").noshow();
@ -92,6 +91,8 @@ void m6502_device::init()
set_icountptr(icount);
XPC = 0x0000;
PPC = 0x0000;
PC = 0x0000;
NPC = 0x0000;
A = 0x00;
@ -121,10 +122,6 @@ void m6502_device::device_reset()
inst_state = STATE_RESET;
inst_substate = 0;
inst_state_base = 0;
irq_state = false;
nmi_state = false;
apu_irq_state = false;
v_state = false;
nmi_pending = false;
irq_taken = false;
sync = false;
@ -150,7 +147,7 @@ uint32_t m6502_device::execute_input_lines() const noexcept
bool m6502_device::execute_input_edge_triggered(int inputnum) const noexcept
{
return inputnum == NMI_LINE;
return inputnum == NMI_LINE || inputnum == V_LINE;
}
void m6502_device::do_adc_d(uint8_t val)

View File

@ -130,7 +130,7 @@ protected:
uint8_t Y; /* Y index register */
uint8_t P; /* Processor status */
uint8_t IR; /* Prefetched instruction register */
int inst_state_base; /* Current instruction bank */
int inst_state_base; /* Current instruction bank */
std::unique_ptr<memory_interface> mintf;
int inst_state, inst_substate;

View File

@ -36,19 +36,11 @@ void m740_device::device_start()
void m740_device::device_reset()
{
inst_state_base = 0;
inst_state = STATE_RESET;
inst_substate = 0;
nmi_state = false;
m6502_device::device_reset();
irq_state = false;
m_irq_multiplex = 0;
m_irq_vector = 0xfffc;
apu_irq_state = false;
irq_taken = false;
nmi_pending = false;
v_state = false;
sync = false;
inhibit_interrupts = false;
SP = 0x00ff;
}