Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Robbbert committed Jun 12, 2024
2 parents ef9afcf + 9282055 commit 39dcb16
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 28 deletions.
8 changes: 2 additions & 6 deletions src/devices/cpu/z80/z80.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -883,19 +883,15 @@ void nsc800_device::device_reset()
memset(m_nsc800_irq_state, 0, sizeof(m_nsc800_irq_state));
}

bool z80_device::check_icount(u8 to_step, int icount_saved, bool redonable)
bool z80_device::check_icount(u8 to_step, int icount_saved, bool redoable)
{
if ((m_icount < 0) && redonable && access_to_be_redone())
if ((m_icount < 0) && redoable && access_to_be_redone())
{
m_icount = icount_saved;
m_ref = (m_ref & 0xffff00) | (to_step - 1);
m_redone = true;
return true;
}
if (m_wait_state)
{
m_icount = 0;
}
if (m_icount <= 0)
{
m_ref = (m_ref & 0xffff00) | to_step;
Expand Down
2 changes: 1 addition & 1 deletion src/devices/cpu/z80/z80.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class z80_device : public cpu_device, public z80_daisy_chain_interface
void block_io_interrupted_flags();

virtual void do_op();
bool check_icount(u8 to_step, int icount_saved, bool redonable);
bool check_icount(u8 to_step, int icount_saved, bool redoable);

virtual u8 data_read(u16 addr);
virtual void data_write(u16 addr, u8 value);
Expand Down
3 changes: 2 additions & 1 deletion src/emu/devcpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ void cpu_device::access_after_delay(u32 cycles) noexcept

void cpu_device::defer_access() noexcept
{
if(*m_icountptr > 0)
*m_icountptr = 0;
m_access_to_be_redone = true;
*m_icountptr = 0;
}
2 changes: 1 addition & 1 deletion src/mame/apple/apple2e.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2493,7 +2493,7 @@ u8 apple2e_state::c000_iic_r(offs_t offset)
case 0x7e: // read IOUDIS
m_vbl = false;
lower_irq(IRQ_VBL);
return (m_ioudis ? 0x00 : 0x80) | uFloatingBus7;
return (m_ioudis ? 0x80 : 0x00) | uFloatingBus7;

case 0x7f: // read DHIRES
return (m_video->get_dhires() ? 0x00 : 0x80) | uFloatingBus7;
Expand Down
2 changes: 2 additions & 0 deletions src/mame/apple/maciifx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ void maciifx_state::machine_reset()
space.unmap_write(0x00000000, memory_end);
space.install_rom(0x00000000, memory_end & ~memory_mirror, memory_mirror, m_rom_ptr);
m_overlay = true;

m_6015_timer->adjust(attotime::from_hz(60.15), 0, attotime::from_hz(60.15));
}

uint32_t maciifx_state::rom_switch_r(offs_t offset)
Expand Down
39 changes: 20 additions & 19 deletions src/mame/novag/savant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The display (both the LCD and the sensors) didn't last long, probably none exist
anymore in original working order.
TODO:
- get rid of m_wait_in hack when Z80 core accurately emulates WAIT pin
- hard locks MAME, suspect issue with access_to_be_redone in z80.cpp
*******************************************************************************/

Expand Down Expand Up @@ -68,6 +68,7 @@ class savant_state : public driver_device

protected:
virtual void machine_start() override;
virtual void machine_reset() override;

private:
// devices/pointers
Expand All @@ -82,7 +83,7 @@ class savant_state : public driver_device
required_shared_ptr<u8> m_nvram;
required_ioport_array<3> m_inputs;

bool m_wait_in = false;
bool m_z80_wait = false;
u8 m_inp_mux = 0;
u8 m_databus = 0;
u8 m_control = 0;
Expand Down Expand Up @@ -115,13 +116,18 @@ class savant_state : public driver_device
void savant_state::machine_start()
{
// register for savestates
save_item(NAME(m_wait_in));
save_item(NAME(m_z80_wait));
save_item(NAME(m_inp_mux));
save_item(NAME(m_databus));
save_item(NAME(m_control));
save_item(NAME(m_lcd_data));
}

void savant_state::machine_reset()
{
m_z80_wait = false;
}



/*******************************************************************************
Expand All @@ -144,22 +150,24 @@ u8 savant_state::nvram_r(offs_t offset)
void savant_state::stall_w(offs_t offset, u8 data)
{
// any access to port C0 puts the Z80 into WAIT, sets BUSRQ, and sets MCU EXT INT
m_databus = offset >> 8;
m_psu->ext_int_w(1);
m_maincpu->set_input_line(Z80_INPUT_LINE_WAIT, ASSERT_LINE);
m_maincpu->set_input_line(Z80_INPUT_LINE_BUSRQ, ASSERT_LINE);
if (!m_z80_wait)
{
m_databus = offset >> 8;
m_psu->ext_int_w(1);
m_maincpu->set_input_line(Z80_INPUT_LINE_WAIT, ASSERT_LINE);
m_maincpu->set_input_line(Z80_INPUT_LINE_BUSRQ, ASSERT_LINE);
m_maincpu->defer_access();
}

m_z80_wait = !m_z80_wait;
}

u8 savant_state::stall_r(offs_t offset)
{
if (!machine().side_effects_disabled())
{
m_wait_in = true;
stall_w(offset);
}

// return value is databus (see control_w)
return 0;
return m_databus;
}

u8 savant_state::mcustatus_r()
Expand Down Expand Up @@ -206,13 +214,6 @@ void savant_state::control_w(u8 data)
{
m_psu->ext_int_w(0);
m_maincpu->set_input_line(Z80_INPUT_LINE_WAIT, CLEAR_LINE);

// hack to set Z80 A after IN A,($C0)
if (m_wait_in)
{
m_maincpu->set_state_int(Z80_A, m_databus);
m_wait_in = false;
}
}

// d1: clear Z80 BUSRQ
Expand Down

0 comments on commit 39dcb16

Please sign in to comment.