void w65816_device::reset_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } read(m_SP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } dec_SP(); read(m_SP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } dec_SP(); read(m_SP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } dec_SP(); m_P |= F_I; m_PC = read_vector(VEC_RESET); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_PC = set_h(m_PC, read_vector(VEC_RESET + 1)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_end(); m_inst_state = -1; } void w65816_device::reset_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; [[fallthrough]]; case 5: read(m_SP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; dec_SP(); [[fallthrough]]; case 7: read(m_SP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; dec_SP(); [[fallthrough]]; case 9: read(m_SP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; dec_SP(); m_P |= F_I; [[fallthrough]]; case 11: m_PC = read_vector(VEC_RESET); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; [[fallthrough]]; case 13: m_PC = set_h(m_PC, read_vector(VEC_RESET + 1)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_start(); [[fallthrough]]; case 15: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_end(); m_inst_state = -1; break; } m_inst_substate = 0; } void w65816_device::clc_imp_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_P &= ~F_C; prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } prefetch_end(); } void w65816_device::clc_imp_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_P &= ~F_C; prefetch_start(); [[fallthrough]]; case 3: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sec_imp_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_P |= F_C; prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } prefetch_end(); } void w65816_device::sec_imp_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_P |= F_C; prefetch_start(); [[fallthrough]]; case 3: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::cld_imp_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_P &= ~F_D; prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } prefetch_end(); } void w65816_device::cld_imp_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_P &= ~F_D; prefetch_start(); [[fallthrough]]; case 3: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sed_imp_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_P |= F_D; prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } prefetch_end(); } void w65816_device::sed_imp_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_P |= F_D; prefetch_start(); [[fallthrough]]; case 3: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::clv_imp_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_P &= ~F_V; prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } prefetch_end(); } void w65816_device::clv_imp_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_P &= ~F_V; prefetch_start(); [[fallthrough]]; case 3: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::cli_imp_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } prefetch_end(); m_P &= ~F_I; // Do *not* move it before the prefetch } void w65816_device::cli_imp_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; prefetch_start(); [[fallthrough]]; case 3: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; prefetch_end(); m_P &= ~F_I; // Do *not* move it before the prefetch break; } m_inst_substate = 0; } void w65816_device::sei_imp_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } prefetch_end(); m_P |= F_I; // Do *not* move it before the prefetch } void w65816_device::sei_imp_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; prefetch_start(); [[fallthrough]]; case 3: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; prefetch_end(); m_P |= F_I; // Do *not* move it before the prefetch break; } m_inst_substate = 0; } void w65816_device::nop_imp_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } prefetch_end(); } void w65816_device::nop_imp_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; prefetch_start(); [[fallthrough]]; case 3: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::wdm_imm_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_wdm_w(m_TMP2); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } prefetch_end(); } void w65816_device::wdm_imm_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; m_wdm_w(m_TMP2); prefetch_start(); [[fallthrough]]; case 3: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::xce_imp_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_TMP2 = m_P & F_C; if(m_E) m_P |= F_C; else m_P &= ~F_C; if(m_TMP2) { m_E = 1; m_SP = 0x0100 | (m_SP & 0xff); m_X &= 0xff; m_Y &= 0xff; } else m_E = 0; update_state_base(); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } prefetch_end(); } void w65816_device::xce_imp_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_TMP2 = m_P & F_C; if(m_E) m_P |= F_C; else m_P &= ~F_C; if(m_TMP2) { m_E = 1; m_SP = 0x0100 | (m_SP & 0xff); m_X &= 0xff; m_Y &= 0xff; } else m_E = 0; update_state_base(); prefetch_start(); [[fallthrough]]; case 3: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::rep_imm_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_P &= ~m_TMP2; update_state_base(); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } prefetch_end(); } void w65816_device::rep_imm_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_P &= ~m_TMP2; update_state_base(); prefetch_start(); [[fallthrough]]; case 5: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sep_imm_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_P |= m_TMP2; update_state_base(); if(m_P & F_X) { m_X &= 0xff; m_Y &= 0xff; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } prefetch_end(); } void w65816_device::sep_imm_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_P |= m_TMP2; update_state_base(); if(m_P & F_X) { m_X &= 0xff; m_Y &= 0xff; } prefetch_start(); [[fallthrough]]; case 5: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::php_imp_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } write(m_SP, m_P); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } dec_SP(); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } prefetch_end(); } void w65816_device::php_imp_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; [[fallthrough]]; case 3: write(m_SP, m_P); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; dec_SP(); prefetch_start(); [[fallthrough]]; case 5: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::plp_imp_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } read(m_SP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } inc_SP(); m_TMP2 = read(m_SP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_end(); m_P = m_TMP2; // Do *not* move it before the prefetch update_state_base(); if(m_P & F_X) { m_X &= 0xff; m_Y &= 0xff; } } void w65816_device::plp_imp_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; [[fallthrough]]; case 3: read(m_SP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; inc_SP(); [[fallthrough]]; case 5: m_TMP2 = read(m_SP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; prefetch_start(); [[fallthrough]]; case 7: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_end(); m_P = m_TMP2; // Do *not* move it before the prefetch update_state_base(); if(m_P & F_X) { m_X &= 0xff; m_Y &= 0xff; } break; } m_inst_substate = 0; } void w65816_device::jmp_adr_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_PC = m_TMP; prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } prefetch_end(); } void w65816_device::jmp_adr_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; m_PC = m_TMP; prefetch_start(); [[fallthrough]]; case 5: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::jmp_abl_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_PC++; m_PC = m_TMP; m_PB = m_TMP2; prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_end(); } void w65816_device::jmp_abl_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_PC++; m_PC = m_TMP; m_PB = m_TMP2; prefetch_start(); [[fallthrough]]; case 7: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::pha_imp_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } write(m_SP, m_A); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } dec_SP(); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } prefetch_end(); } void w65816_device::pha_imp_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; [[fallthrough]]; case 3: write(m_SP, m_A); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; dec_SP(); prefetch_start(); [[fallthrough]]; case 5: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::pha_w_imp_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } write(m_SP, m_A >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } dec_SP(); write(m_SP, m_A); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } dec_SP(); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_end(); } void w65816_device::pha_w_imp_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; [[fallthrough]]; case 3: write(m_SP, m_A >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; dec_SP(); [[fallthrough]]; case 5: write(m_SP, m_A); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; dec_SP(); prefetch_start(); [[fallthrough]]; case 7: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::pla_imp_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } read(m_SP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } inc_SP(); m_A = set_l(m_A, read(m_SP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } set_nz(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_end(); } void w65816_device::pla_imp_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; [[fallthrough]]; case 3: read(m_SP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; inc_SP(); [[fallthrough]]; case 5: m_A = set_l(m_A, read(m_SP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; set_nz(m_A); prefetch_start(); [[fallthrough]]; case 7: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::pla_w_imp_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } read(m_SP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } inc_SP(); m_A = read(m_SP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } inc_SP(); m_A = set_h(m_A, read(m_SP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::pla_w_imp_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; [[fallthrough]]; case 3: read(m_SP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; inc_SP(); [[fallthrough]]; case 5: m_A = read(m_SP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; inc_SP(); [[fallthrough]]; case 7: m_A = set_h(m_A, read(m_SP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::tsx_imp_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_X = set_l(m_X, m_SP); set_nz(m_X); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } prefetch_end(); } void w65816_device::tsx_imp_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_X = set_l(m_X, m_SP); set_nz(m_X); prefetch_start(); [[fallthrough]]; case 3: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::tsx_w_imp_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_X = m_SP; set_nz16(m_X); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } prefetch_end(); } void w65816_device::tsx_w_imp_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_X = m_SP; set_nz16(m_X); prefetch_start(); [[fallthrough]]; case 3: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::txs_imp_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } if(m_E) m_SP = 0x0100 | (m_X & 0xff); else m_SP = m_X; prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } prefetch_end(); } void w65816_device::txs_imp_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; if(m_E) m_SP = 0x0100 | (m_X & 0xff); else m_SP = m_X; prefetch_start(); [[fallthrough]]; case 3: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::bcc_rel_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(!(m_P & F_C)) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } if(m_E && page_changing(m_PC, int8_t(m_TMP2))) { read_arg(set_l(m_PC, m_PC + int8_t(m_TMP2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } } m_PC += int8_t(m_TMP2); } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_end(); } void w65816_device::bcc_rel_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(!(m_P & F_C)) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; if(m_E && page_changing(m_PC, int8_t(m_TMP2))) { [[fallthrough]]; case 5: read_arg(set_l(m_PC, m_PC + int8_t(m_TMP2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; } m_PC += int8_t(m_TMP2); } prefetch_start(); [[fallthrough]]; case 7: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::bcs_rel_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_P & F_C) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } if(m_E && page_changing(m_PC, int8_t(m_TMP2))) { read_arg(set_l(m_PC, m_PC + int8_t(m_TMP2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } } m_PC += int8_t(m_TMP2); } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_end(); } void w65816_device::bcs_rel_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_P & F_C) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; if(m_E && page_changing(m_PC, int8_t(m_TMP2))) { [[fallthrough]]; case 5: read_arg(set_l(m_PC, m_PC + int8_t(m_TMP2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; } m_PC += int8_t(m_TMP2); } prefetch_start(); [[fallthrough]]; case 7: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::beq_rel_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_P & F_Z) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } if(m_E && page_changing(m_PC, int8_t(m_TMP2))) { read_arg(set_l(m_PC, m_PC + int8_t(m_TMP2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } } m_PC += int8_t(m_TMP2); } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_end(); } void w65816_device::beq_rel_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_P & F_Z) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; if(m_E && page_changing(m_PC, int8_t(m_TMP2))) { [[fallthrough]]; case 5: read_arg(set_l(m_PC, m_PC + int8_t(m_TMP2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; } m_PC += int8_t(m_TMP2); } prefetch_start(); [[fallthrough]]; case 7: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::bne_rel_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(!(m_P & F_Z)) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } if(m_E && page_changing(m_PC, int8_t(m_TMP2))) { read_arg(set_l(m_PC, m_PC + int8_t(m_TMP2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } } m_PC += int8_t(m_TMP2); } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_end(); } void w65816_device::bne_rel_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(!(m_P & F_Z)) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; if(m_E && page_changing(m_PC, int8_t(m_TMP2))) { [[fallthrough]]; case 5: read_arg(set_l(m_PC, m_PC + int8_t(m_TMP2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; } m_PC += int8_t(m_TMP2); } prefetch_start(); [[fallthrough]]; case 7: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::bmi_rel_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_P & F_N) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } if(m_E && page_changing(m_PC, int8_t(m_TMP2))) { read_arg(set_l(m_PC, m_PC + int8_t(m_TMP2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } } m_PC += int8_t(m_TMP2); } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_end(); } void w65816_device::bmi_rel_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_P & F_N) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; if(m_E && page_changing(m_PC, int8_t(m_TMP2))) { [[fallthrough]]; case 5: read_arg(set_l(m_PC, m_PC + int8_t(m_TMP2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; } m_PC += int8_t(m_TMP2); } prefetch_start(); [[fallthrough]]; case 7: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::bpl_rel_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(!(m_P & F_N)) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } if(m_E && page_changing(m_PC, int8_t(m_TMP2))) { read_arg(set_l(m_PC, m_PC + int8_t(m_TMP2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } } m_PC += int8_t(m_TMP2); } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_end(); } void w65816_device::bpl_rel_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(!(m_P & F_N)) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; if(m_E && page_changing(m_PC, int8_t(m_TMP2))) { [[fallthrough]]; case 5: read_arg(set_l(m_PC, m_PC + int8_t(m_TMP2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; } m_PC += int8_t(m_TMP2); } prefetch_start(); [[fallthrough]]; case 7: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::bvc_rel_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(!(m_P & F_V)) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } if(m_E && page_changing(m_PC, int8_t(m_TMP2))) { read_arg(set_l(m_PC, m_PC + int8_t(m_TMP2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } } m_PC += int8_t(m_TMP2); } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_end(); } void w65816_device::bvc_rel_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(!(m_P & F_V)) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; if(m_E && page_changing(m_PC, int8_t(m_TMP2))) { [[fallthrough]]; case 5: read_arg(set_l(m_PC, m_PC + int8_t(m_TMP2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; } m_PC += int8_t(m_TMP2); } prefetch_start(); [[fallthrough]]; case 7: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::bvs_rel_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_P & F_V) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } if(m_E && page_changing(m_PC, int8_t(m_TMP2))) { read_arg(set_l(m_PC, m_PC + int8_t(m_TMP2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } } m_PC += int8_t(m_TMP2); } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_end(); } void w65816_device::bvs_rel_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_P & F_V) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; if(m_E && page_changing(m_PC, int8_t(m_TMP2))) { [[fallthrough]]; case 5: read_arg(set_l(m_PC, m_PC + int8_t(m_TMP2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; } m_PC += int8_t(m_TMP2); } prefetch_start(); [[fallthrough]]; case 7: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::bra_rel_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } if(m_E && page_changing(m_PC, int8_t(m_TMP2))) { read_arg(set_l(m_PC, m_PC + int8_t(m_TMP2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } } m_PC += int8_t(m_TMP2); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_end(); } void w65816_device::bra_rel_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; if(m_E && page_changing(m_PC, int8_t(m_TMP2))) { [[fallthrough]]; case 5: read_arg(set_l(m_PC, m_PC + int8_t(m_TMP2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; } m_PC += int8_t(m_TMP2); prefetch_start(); [[fallthrough]]; case 7: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::brl_rell_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_PC += m_TMP; prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_end(); } void w65816_device::brl_rell_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_PC += m_TMP; prefetch_start(); [[fallthrough]]; case 7: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::jmp_ind_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_PC = read(m_TMP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_PC = set_h(m_PC, read(uint16_t(m_TMP + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::jmp_ind_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_PC = read(m_TMP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_PC = set_h(m_PC, read(uint16_t(m_TMP + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::jml_ind_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_TMP3 = read(m_TMP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP3 = set_h(m_TMP3, read(uint16_t(m_TMP + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_PB = read(uint16_t(m_TMP + 2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_PC = m_TMP3; prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::jml_ind_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_TMP3 = read(m_TMP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP3 = set_h(m_TMP3, read(uint16_t(m_TMP + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_PB = read(uint16_t(m_TMP + 2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; m_PC = m_TMP3; prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::jmp_iax_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP3 = m_TMP + m_X; m_PC = read_arg(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_PC = set_h(m_PC, read_arg(uint16_t(m_TMP3 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::jmp_iax_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_TMP3 = m_TMP + m_X; [[fallthrough]]; case 7: m_PC = read_arg(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_PC = set_h(m_PC, read_arg(uint16_t(m_TMP3 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::jsr_adr_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP3 = m_PC - 1; write(m_SP, m_TMP3 >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } dec_SP(); write(m_SP, m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } dec_SP(); m_PC = m_TMP; prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::jsr_adr_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_TMP3 = m_PC - 1; [[fallthrough]]; case 7: write(m_SP, m_TMP3 >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; dec_SP(); [[fallthrough]]; case 9: write(m_SP, m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; dec_SP(); m_PC = m_TMP; prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::jsr_iax_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; write(m_SP, m_PC >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } dec_SP(); write(m_SP, m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } dec_SP(); m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_PC++; read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_TMP3 = m_TMP + m_X; m_PC = read_arg(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_PC = set_h(m_PC, read_arg(uint16_t(m_TMP3 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_end(); } void w65816_device::jsr_iax_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: write(m_SP, m_PC >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; dec_SP(); [[fallthrough]]; case 5: write(m_SP, m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; dec_SP(); [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; m_PC++; [[fallthrough]]; case 9: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; m_TMP3 = m_TMP + m_X; [[fallthrough]]; case 11: m_PC = read_arg(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; [[fallthrough]]; case 13: m_PC = set_h(m_PC, read_arg(uint16_t(m_TMP3 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_start(); [[fallthrough]]; case 15: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::jsl_abl_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; write(m_SP, m_PB); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } dec_SP_nw(); read(m_SP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_PC++; m_TMP3 = m_PC - 1; write(m_SP, m_TMP3 >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } dec_SP_nw(); write(m_SP, m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } dec_SP_nw(); m_PC = m_TMP; m_PB = m_TMP2; prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_end(); } void w65816_device::jsl_abl_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: write(m_SP, m_PB); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; dec_SP_nw(); [[fallthrough]]; case 7: read(m_SP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; m_PC++; m_TMP3 = m_PC - 1; [[fallthrough]]; case 11: write(m_SP, m_TMP3 >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; dec_SP_nw(); [[fallthrough]]; case 13: write(m_SP, m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; dec_SP_nw(); m_PC = m_TMP; m_PB = m_TMP2; prefetch_start(); [[fallthrough]]; case 15: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::rts_imp_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } read(m_SP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } inc_SP(); m_PC = read(m_SP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } inc_SP(); m_PC = set_h(m_PC, read(m_SP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_PC++; prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::rts_imp_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; [[fallthrough]]; case 3: read(m_SP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; inc_SP(); [[fallthrough]]; case 5: m_PC = read(m_SP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; inc_SP(); [[fallthrough]]; case 7: m_PC = set_h(m_PC, read(m_SP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; m_PC++; prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::rtl_imp_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } inc_SP_nw(); m_TMP = read(m_SP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } inc_SP_nw(); m_TMP = set_h(m_TMP, read(m_SP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } inc_SP_nw(); m_PB = read(m_SP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_PC = m_TMP + 1; prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::rtl_imp_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; inc_SP_nw(); [[fallthrough]]; case 5: m_TMP = read(m_SP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; inc_SP_nw(); [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(m_SP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; inc_SP_nw(); [[fallthrough]]; case 9: m_PB = read(m_SP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; m_PC = m_TMP + 1; prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::brk_imm_full() { if(m_irq_taken || m_nmi_pending) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } } else { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; } write(m_SP, m_PB); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } dec_SP(); write(m_SP, m_PC >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } dec_SP(); write(m_SP, m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } dec_SP(); write(m_SP, m_P); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } dec_SP(); if(m_nmi_pending) { standard_irq_callback(NMI_LINE, m_PC); m_nmi_pending = false; m_TMP = VEC_N_NMI; } else if(m_irq_taken) { standard_irq_callback(IRQ_LINE, m_PC); m_TMP = VEC_N_IRQ; } else m_TMP = VEC_N_BRK; m_irq_taken = false; m_P = (m_P | F_I) & ~F_D; // Do *not* move after the prefetch m_PB = 0; m_PC = read_vector(m_TMP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } m_PC = set_h(m_PC, read_vector(m_TMP + 1)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 17; } else m_inst_substate = 18; return; } prefetch_end(); m_inst_state = -1; } void w65816_device::brk_imm_partial() { switch(m_inst_substate) { case 0: if(m_irq_taken || m_nmi_pending) { [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; } else { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; } [[fallthrough]]; case 5: write(m_SP, m_PB); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; dec_SP(); [[fallthrough]]; case 7: write(m_SP, m_PC >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; dec_SP(); [[fallthrough]]; case 9: write(m_SP, m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; dec_SP(); [[fallthrough]]; case 11: write(m_SP, m_P); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; dec_SP(); if(m_nmi_pending) { standard_irq_callback(NMI_LINE, m_PC); m_nmi_pending = false; m_TMP = VEC_N_NMI; } else if(m_irq_taken) { standard_irq_callback(IRQ_LINE, m_PC); m_TMP = VEC_N_IRQ; } else m_TMP = VEC_N_BRK; m_irq_taken = false; m_P = (m_P | F_I) & ~F_D; // Do *not* move after the prefetch m_PB = 0; [[fallthrough]]; case 13: m_PC = read_vector(m_TMP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; [[fallthrough]]; case 15: m_PC = set_h(m_PC, read_vector(m_TMP + 1)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_start(); [[fallthrough]]; case 17: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 17; } else m_inst_substate = 18; return; } [[fallthrough]]; case 18:; prefetch_end(); m_inst_state = -1; break; } m_inst_substate = 0; } void w65816_device::brk_e_imm_full() { if(m_irq_taken || m_nmi_pending) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } } else { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; } write(m_SP, m_PC >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } dec_SP(); write(m_SP, m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } dec_SP(); write(m_SP, (m_irq_taken || m_nmi_pending) ? (m_P & ~F_B) : (m_P | F_B)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } dec_SP(); if(m_nmi_pending) { standard_irq_callback(NMI_LINE, m_PC); m_nmi_pending = false; m_TMP = VEC_E_NMI; } else if(m_irq_taken) { standard_irq_callback(IRQ_LINE, m_PC); m_TMP = VEC_E_IRQ; } else m_TMP = VEC_E_IRQ; m_irq_taken = false; m_P = (m_P | F_I) & ~F_D; // Do *not* move after the prefetch m_PB = 0; m_PC = read_vector(m_TMP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_PC = set_h(m_PC, read_vector(m_TMP + 1)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_end(); m_inst_state = -1; } void w65816_device::brk_e_imm_partial() { switch(m_inst_substate) { case 0: if(m_irq_taken || m_nmi_pending) { [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; } else { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; } [[fallthrough]]; case 5: write(m_SP, m_PC >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; dec_SP(); [[fallthrough]]; case 7: write(m_SP, m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; dec_SP(); [[fallthrough]]; case 9: write(m_SP, (m_irq_taken || m_nmi_pending) ? (m_P & ~F_B) : (m_P | F_B)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; dec_SP(); if(m_nmi_pending) { standard_irq_callback(NMI_LINE, m_PC); m_nmi_pending = false; m_TMP = VEC_E_NMI; } else if(m_irq_taken) { standard_irq_callback(IRQ_LINE, m_PC); m_TMP = VEC_E_IRQ; } else m_TMP = VEC_E_IRQ; m_irq_taken = false; m_P = (m_P | F_I) & ~F_D; // Do *not* move after the prefetch m_PB = 0; [[fallthrough]]; case 11: m_PC = read_vector(m_TMP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; [[fallthrough]]; case 13: m_PC = set_h(m_PC, read_vector(m_TMP + 1)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_start(); [[fallthrough]]; case 15: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_end(); m_inst_state = -1; break; } m_inst_substate = 0; } void w65816_device::cop_imm_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; write(m_SP, m_PB); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } dec_SP(); write(m_SP, m_PC >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } dec_SP(); write(m_SP, m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } dec_SP(); write(m_SP, m_P); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } dec_SP(); m_P = (m_P | F_I) & ~F_D; // Do *not* move after the prefetch m_PB = 0; m_PC = read_vector(VEC_N_COP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_PC = set_h(m_PC, read_vector(VEC_N_COP + 1)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_end(); m_inst_state = -1; } void w65816_device::cop_imm_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: write(m_SP, m_PB); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; dec_SP(); [[fallthrough]]; case 5: write(m_SP, m_PC >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; dec_SP(); [[fallthrough]]; case 7: write(m_SP, m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; dec_SP(); [[fallthrough]]; case 9: write(m_SP, m_P); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; dec_SP(); m_P = (m_P | F_I) & ~F_D; // Do *not* move after the prefetch m_PB = 0; [[fallthrough]]; case 11: m_PC = read_vector(VEC_N_COP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; [[fallthrough]]; case 13: m_PC = set_h(m_PC, read_vector(VEC_N_COP + 1)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_start(); [[fallthrough]]; case 15: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_end(); m_inst_state = -1; break; } m_inst_substate = 0; } void w65816_device::cop_e_imm_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; write(m_SP, m_PC >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } dec_SP(); write(m_SP, m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } dec_SP(); write(m_SP, m_P | F_B); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } dec_SP(); m_P = (m_P | F_I) & ~F_D; // Do *not* move after the prefetch m_PB = 0; m_PC = read_vector(VEC_E_COP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_PC = set_h(m_PC, read_vector(VEC_E_COP + 1)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); m_inst_state = -1; } void w65816_device::cop_e_imm_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: write(m_SP, m_PC >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; dec_SP(); [[fallthrough]]; case 5: write(m_SP, m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; dec_SP(); [[fallthrough]]; case 7: write(m_SP, m_P | F_B); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; dec_SP(); m_P = (m_P | F_I) & ~F_D; // Do *not* move after the prefetch m_PB = 0; [[fallthrough]]; case 9: m_PC = read_vector(VEC_E_COP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: m_PC = set_h(m_PC, read_vector(VEC_E_COP + 1)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); m_inst_state = -1; break; } m_inst_substate = 0; } void w65816_device::rti_imp_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } inc_SP(); m_TMP2 = read(m_SP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } inc_SP(); m_PC = read(m_SP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } inc_SP(); m_PC = set_h(m_PC, read(m_SP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } inc_SP(); m_PB = read(m_SP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_P = m_TMP2; update_state_base(); if(m_P & F_X) { m_X &= 0xff; m_Y &= 0xff; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::rti_imp_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; inc_SP(); [[fallthrough]]; case 5: m_TMP2 = read(m_SP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; inc_SP(); [[fallthrough]]; case 7: m_PC = read(m_SP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; inc_SP(); [[fallthrough]]; case 9: m_PC = set_h(m_PC, read(m_SP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; inc_SP(); [[fallthrough]]; case 11: m_PB = read(m_SP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; m_P = m_TMP2; update_state_base(); if(m_P & F_X) { m_X &= 0xff; m_Y &= 0xff; } prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::rti_e_imp_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } inc_SP(); m_TMP2 = read(m_SP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } inc_SP(); m_PC = read(m_SP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } inc_SP(); m_PC = set_h(m_PC, read(m_SP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_P = m_TMP2; update_state_base(); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::rti_e_imp_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; inc_SP(); [[fallthrough]]; case 5: m_TMP2 = read(m_SP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; inc_SP(); [[fallthrough]]; case 7: m_PC = read(m_SP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; inc_SP(); [[fallthrough]]; case 9: m_PC = set_h(m_PC, read(m_SP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; m_P = m_TMP2; update_state_base(); prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::inx_imp_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_X = set_l(m_X, do_inc(m_X)); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } prefetch_end(); } void w65816_device::inx_imp_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_X = set_l(m_X, do_inc(m_X)); prefetch_start(); [[fallthrough]]; case 3: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::inx_w_imp_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_X = do_inc16(m_X); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } prefetch_end(); } void w65816_device::inx_w_imp_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_X = do_inc16(m_X); prefetch_start(); [[fallthrough]]; case 3: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::iny_imp_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_Y = set_l(m_Y, do_inc(m_Y)); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } prefetch_end(); } void w65816_device::iny_imp_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_Y = set_l(m_Y, do_inc(m_Y)); prefetch_start(); [[fallthrough]]; case 3: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::iny_w_imp_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_Y = do_inc16(m_Y); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } prefetch_end(); } void w65816_device::iny_w_imp_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_Y = do_inc16(m_Y); prefetch_start(); [[fallthrough]]; case 3: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::dex_imp_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_X = set_l(m_X, do_dec(m_X)); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } prefetch_end(); } void w65816_device::dex_imp_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_X = set_l(m_X, do_dec(m_X)); prefetch_start(); [[fallthrough]]; case 3: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::dex_w_imp_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_X = do_dec16(m_X); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } prefetch_end(); } void w65816_device::dex_w_imp_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_X = do_dec16(m_X); prefetch_start(); [[fallthrough]]; case 3: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::dey_imp_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_Y = set_l(m_Y, do_dec(m_Y)); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } prefetch_end(); } void w65816_device::dey_imp_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_Y = set_l(m_Y, do_dec(m_Y)); prefetch_start(); [[fallthrough]]; case 3: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::dey_w_imp_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_Y = do_dec16(m_Y); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } prefetch_end(); } void w65816_device::dey_w_imp_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_Y = do_dec16(m_Y); prefetch_start(); [[fallthrough]]; case 3: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::phx_imp_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } write(m_SP, m_X); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } dec_SP(); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } prefetch_end(); } void w65816_device::phx_imp_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; [[fallthrough]]; case 3: write(m_SP, m_X); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; dec_SP(); prefetch_start(); [[fallthrough]]; case 5: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::phx_w_imp_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } write(m_SP, m_X >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } dec_SP(); write(m_SP, m_X); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } dec_SP(); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_end(); } void w65816_device::phx_w_imp_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; [[fallthrough]]; case 3: write(m_SP, m_X >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; dec_SP(); [[fallthrough]]; case 5: write(m_SP, m_X); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; dec_SP(); prefetch_start(); [[fallthrough]]; case 7: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::phy_imp_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } write(m_SP, m_Y); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } dec_SP(); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } prefetch_end(); } void w65816_device::phy_imp_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; [[fallthrough]]; case 3: write(m_SP, m_Y); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; dec_SP(); prefetch_start(); [[fallthrough]]; case 5: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::phy_w_imp_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } write(m_SP, m_Y >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } dec_SP(); write(m_SP, m_Y); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } dec_SP(); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_end(); } void w65816_device::phy_w_imp_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; [[fallthrough]]; case 3: write(m_SP, m_Y >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; dec_SP(); [[fallthrough]]; case 5: write(m_SP, m_Y); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; dec_SP(); prefetch_start(); [[fallthrough]]; case 7: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::plx_imp_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } read(m_SP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } inc_SP(); m_X = set_l(m_X, read(m_SP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } set_nz(m_X); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_end(); } void w65816_device::plx_imp_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; [[fallthrough]]; case 3: read(m_SP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; inc_SP(); [[fallthrough]]; case 5: m_X = set_l(m_X, read(m_SP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; set_nz(m_X); prefetch_start(); [[fallthrough]]; case 7: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::plx_w_imp_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } read(m_SP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } inc_SP(); m_X = read(m_SP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } inc_SP(); m_X = set_h(m_X, read(m_SP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } set_nz16(m_X); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::plx_w_imp_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; [[fallthrough]]; case 3: read(m_SP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; inc_SP(); [[fallthrough]]; case 5: m_X = read(m_SP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; inc_SP(); [[fallthrough]]; case 7: m_X = set_h(m_X, read(m_SP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; set_nz16(m_X); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::ply_imp_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } read(m_SP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } inc_SP(); m_Y = set_l(m_Y, read(m_SP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } set_nz(m_Y); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_end(); } void w65816_device::ply_imp_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; [[fallthrough]]; case 3: read(m_SP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; inc_SP(); [[fallthrough]]; case 5: m_Y = set_l(m_Y, read(m_SP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; set_nz(m_Y); prefetch_start(); [[fallthrough]]; case 7: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::ply_w_imp_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } read(m_SP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } inc_SP(); m_Y = read(m_SP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } inc_SP(); m_Y = set_h(m_Y, read(m_SP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } set_nz16(m_Y); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::ply_w_imp_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; [[fallthrough]]; case 3: read(m_SP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; inc_SP(); [[fallthrough]]; case 5: m_Y = read(m_SP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; inc_SP(); [[fallthrough]]; case 7: m_Y = set_h(m_Y, read(m_SP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; set_nz16(m_Y); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::phb_imp_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } write(m_SP, m_DB); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } dec_SP(); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } prefetch_end(); } void w65816_device::phb_imp_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; [[fallthrough]]; case 3: write(m_SP, m_DB); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; dec_SP(); prefetch_start(); [[fallthrough]]; case 5: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::phk_imp_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } write(m_SP, m_PB); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } dec_SP(); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } prefetch_end(); } void w65816_device::phk_imp_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; [[fallthrough]]; case 3: write(m_SP, m_PB); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; dec_SP(); prefetch_start(); [[fallthrough]]; case 5: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::plb_imp_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } read(m_SP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } inc_SP_nw(); m_DB = read(m_SP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } set_nz(m_DB); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_end(); } void w65816_device::plb_imp_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; [[fallthrough]]; case 3: read(m_SP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; inc_SP_nw(); [[fallthrough]]; case 5: m_DB = read(m_SP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; set_nz(m_DB); prefetch_start(); [[fallthrough]]; case 7: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::phd_imp_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } write(m_SP, m_D >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } dec_SP_nw(); write(m_SP, m_D); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } dec_SP_nw(); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_end(); } void w65816_device::phd_imp_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; [[fallthrough]]; case 3: write(m_SP, m_D >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; dec_SP_nw(); [[fallthrough]]; case 5: write(m_SP, m_D); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; dec_SP_nw(); prefetch_start(); [[fallthrough]]; case 7: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::pld_imp_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } read(m_SP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } inc_SP_nw(); m_D = read(m_SP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } inc_SP_nw(); m_D = set_h(m_D, read(m_SP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } set_nz16(m_D); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::pld_imp_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; [[fallthrough]]; case 3: read(m_SP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; inc_SP_nw(); [[fallthrough]]; case 5: m_D = read(m_SP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; inc_SP_nw(); [[fallthrough]]; case 7: m_D = set_h(m_D, read(m_SP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; set_nz16(m_D); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::pea_imm16_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; write(m_SP, m_TMP >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } dec_SP_nw(); write(m_SP, m_TMP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } dec_SP_nw(); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::pea_imm16_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: write(m_SP, m_TMP >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; dec_SP_nw(); [[fallthrough]]; case 7: write(m_SP, m_TMP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; dec_SP_nw(); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::pei_zpg_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP3 = dp(m_TMP2); m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } write(m_SP, m_TMP >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } dec_SP_nw(); write(m_SP, m_TMP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } dec_SP_nw(); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::pei_zpg_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } m_TMP3 = dp(m_TMP2); [[fallthrough]]; case 5: m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: write(m_SP, m_TMP >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; dec_SP_nw(); [[fallthrough]]; case 11: write(m_SP, m_TMP); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; dec_SP_nw(); prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::per_rell_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP3 = m_PC + m_TMP; write(m_SP, m_TMP3 >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } dec_SP_nw(); write(m_SP, m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } dec_SP_nw(); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::per_rell_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_TMP3 = m_PC + m_TMP; [[fallthrough]]; case 7: write(m_SP, m_TMP3 >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; dec_SP_nw(); [[fallthrough]]; case 9: write(m_SP, m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; dec_SP_nw(); prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::tax_imp_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_X = set_l(m_X, m_A); set_nz(m_X); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } prefetch_end(); } void w65816_device::tax_imp_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_X = set_l(m_X, m_A); set_nz(m_X); prefetch_start(); [[fallthrough]]; case 3: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::tax_w_imp_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_X = m_A; set_nz16(m_X); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } prefetch_end(); } void w65816_device::tax_w_imp_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_X = m_A; set_nz16(m_X); prefetch_start(); [[fallthrough]]; case 3: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::tay_imp_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_Y = set_l(m_Y, m_A); set_nz(m_Y); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } prefetch_end(); } void w65816_device::tay_imp_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_Y = set_l(m_Y, m_A); set_nz(m_Y); prefetch_start(); [[fallthrough]]; case 3: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::tay_w_imp_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_Y = m_A; set_nz16(m_Y); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } prefetch_end(); } void w65816_device::tay_w_imp_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_Y = m_A; set_nz16(m_Y); prefetch_start(); [[fallthrough]]; case 3: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::txa_imp_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_A = set_l(m_A, m_X); set_nz(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } prefetch_end(); } void w65816_device::txa_imp_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_A = set_l(m_A, m_X); set_nz(m_A); prefetch_start(); [[fallthrough]]; case 3: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::txa_w_imp_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_A = m_X; set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } prefetch_end(); } void w65816_device::txa_w_imp_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_A = m_X; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 3: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::tya_imp_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_A = set_l(m_A, m_Y); set_nz(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } prefetch_end(); } void w65816_device::tya_imp_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_A = set_l(m_A, m_Y); set_nz(m_A); prefetch_start(); [[fallthrough]]; case 3: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::tya_w_imp_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_A = m_Y; set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } prefetch_end(); } void w65816_device::tya_w_imp_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_A = m_Y; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 3: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::txy_imp_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_Y = set_l(m_Y, m_X); set_nz(m_Y); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } prefetch_end(); } void w65816_device::txy_imp_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_Y = set_l(m_Y, m_X); set_nz(m_Y); prefetch_start(); [[fallthrough]]; case 3: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::txy_w_imp_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_Y = m_X; set_nz16(m_Y); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } prefetch_end(); } void w65816_device::txy_w_imp_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_Y = m_X; set_nz16(m_Y); prefetch_start(); [[fallthrough]]; case 3: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::tyx_imp_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_X = set_l(m_X, m_Y); set_nz(m_X); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } prefetch_end(); } void w65816_device::tyx_imp_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_X = set_l(m_X, m_Y); set_nz(m_X); prefetch_start(); [[fallthrough]]; case 3: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::tyx_w_imp_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_X = m_Y; set_nz16(m_X); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } prefetch_end(); } void w65816_device::tyx_w_imp_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_X = m_Y; set_nz16(m_X); prefetch_start(); [[fallthrough]]; case 3: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::tcs_imp_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } if(m_E) m_SP = 0x0100 | (m_A & 0xff); else m_SP = m_A; prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } prefetch_end(); } void w65816_device::tcs_imp_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; if(m_E) m_SP = 0x0100 | (m_A & 0xff); else m_SP = m_A; prefetch_start(); [[fallthrough]]; case 3: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::tsc_imp_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_A = m_SP; set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } prefetch_end(); } void w65816_device::tsc_imp_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_A = m_SP; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 3: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::tcd_imp_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_D = m_A; set_nz16(m_D); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } prefetch_end(); } void w65816_device::tcd_imp_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_D = m_A; set_nz16(m_D); prefetch_start(); [[fallthrough]]; case 3: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::tdc_imp_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_A = m_D; set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } prefetch_end(); } void w65816_device::tdc_imp_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_A = m_D; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 3: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::mvn_dbf_full() { m_DST = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_SRC = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_DB = m_DST; m_TMP2 = read((m_SRC << 16) | (m_X & 0xff)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } write((m_DST << 16) | (m_Y & 0xff), m_TMP2); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_X = set_l(m_X, m_X + 1); m_Y = set_l(m_Y, m_Y + 1); m_A--; if(m_A != 0xffff) m_PC -= 3; prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::mvn_dbf_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_DST = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_SRC = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; m_DB = m_DST; [[fallthrough]]; case 5: m_TMP2 = read((m_SRC << 16) | (m_X & 0xff)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: write((m_DST << 16) | (m_Y & 0xff), m_TMP2); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; m_X = set_l(m_X, m_X + 1); m_Y = set_l(m_Y, m_Y + 1); m_A--; if(m_A != 0xffff) m_PC -= 3; prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::mvn_w_dbf_full() { m_DST = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_SRC = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_DB = m_DST; m_TMP2 = read((m_SRC << 16) | m_X); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } write((m_DST << 16) | m_Y, m_TMP2); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_X++; m_Y++; m_A--; if(m_A != 0xffff) m_PC -= 3; prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::mvn_w_dbf_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_DST = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_SRC = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; m_DB = m_DST; [[fallthrough]]; case 5: m_TMP2 = read((m_SRC << 16) | m_X); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: write((m_DST << 16) | m_Y, m_TMP2); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; m_X++; m_Y++; m_A--; if(m_A != 0xffff) m_PC -= 3; prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::mvp_dbf_full() { m_DST = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_SRC = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_DB = m_DST; m_TMP2 = read((m_SRC << 16) | (m_X & 0xff)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } write((m_DST << 16) | (m_Y & 0xff), m_TMP2); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_X = set_l(m_X, m_X - 1); m_Y = set_l(m_Y, m_Y - 1); m_A--; if(m_A != 0xffff) m_PC -= 3; prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::mvp_dbf_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_DST = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_SRC = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; m_DB = m_DST; [[fallthrough]]; case 5: m_TMP2 = read((m_SRC << 16) | (m_X & 0xff)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: write((m_DST << 16) | (m_Y & 0xff), m_TMP2); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; m_X = set_l(m_X, m_X - 1); m_Y = set_l(m_Y, m_Y - 1); m_A--; if(m_A != 0xffff) m_PC -= 3; prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::mvp_w_dbf_full() { m_DST = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_SRC = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_DB = m_DST; m_TMP2 = read((m_SRC << 16) | m_X); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } write((m_DST << 16) | m_Y, m_TMP2); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_X--; m_Y--; m_A--; if(m_A != 0xffff) m_PC -= 3; prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::mvp_w_dbf_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_DST = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_SRC = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; m_DB = m_DST; [[fallthrough]]; case 5: m_TMP2 = read((m_SRC << 16) | m_X); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: write((m_DST << 16) | m_Y, m_TMP2); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; m_X--; m_Y--; m_A--; if(m_A != 0xffff) m_PC -= 3; prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::xba_imp_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_A = (m_A >> 8) | (m_A << 8); set_nz(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } prefetch_end(); } void w65816_device::xba_imp_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_A = (m_A >> 8) | (m_A << 8); set_nz(m_A); prefetch_start(); [[fallthrough]]; case 5: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::stp_imp_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } for(;;) { debugger_wait_hook(); m_icount = 0; m_inst_substate = 5; return; } } void w65816_device::stp_imp_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; for(;;) { debugger_wait_hook(); m_icount = 0; m_inst_substate = 5; return; case 5:; } break; } m_inst_substate = 0; } void w65816_device::wai_imp_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } while(!m_nmi_pending && !m_irq_state && !m_abort_state) { debugger_wait_hook(); m_icount = 0; m_inst_substate = 5; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 6; } else m_inst_substate = 7; return; } prefetch_end(); } void w65816_device::wai_imp_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; while(!m_nmi_pending && !m_irq_state && !m_abort_state) { debugger_wait_hook(); m_icount = 0; m_inst_substate = 5; return; case 5:; } prefetch_start(); [[fallthrough]]; case 6: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 6; } else m_inst_substate = 7; return; } [[fallthrough]]; case 7:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::ora_idx_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP3 = dp_idx(m_TMP2, m_X); m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_A = set_l(m_A, m_A | m_VAL); set_nz(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::ora_idx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_TMP3 = dp_idx(m_TMP2, m_X); [[fallthrough]]; case 7: m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; m_A = set_l(m_A, m_A | m_VAL); set_nz(m_A); prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::ora_w_idx_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP3 = dp_idx(m_TMP2, m_X); m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } m_A |= m_VAL; set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_end(); } void w65816_device::ora_w_idx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_TMP3 = dp_idx(m_TMP2, m_X); [[fallthrough]]; case 7: m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; [[fallthrough]]; case 13: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; m_A |= m_VAL; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 15: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::ora_ds_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_VAL = read(sr(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_A = set_l(m_A, m_A | m_VAL); set_nz(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_end(); } void w65816_device::ora_ds_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; [[fallthrough]]; case 5: m_VAL = read(sr(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_A = set_l(m_A, m_A | m_VAL); set_nz(m_A); prefetch_start(); [[fallthrough]]; case 7: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::ora_w_ds_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_VAL = read(sr(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = set_h(m_VAL, read(sr(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_A |= m_VAL; set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::ora_w_ds_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; [[fallthrough]]; case 5: m_VAL = read(sr(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = set_h(m_VAL, read(sr(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; m_A |= m_VAL; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::ora_zpg_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_A = set_l(m_A, m_A | m_VAL); set_nz(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_end(); } void w65816_device::ora_zpg_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_A = set_l(m_A, m_A | m_VAL); set_nz(m_A); prefetch_start(); [[fallthrough]]; case 7: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::ora_w_zpg_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = set_h(m_VAL, read(dp(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_A |= m_VAL; set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::ora_w_zpg_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = set_h(m_VAL, read(dp(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; m_A |= m_VAL; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::ora_zil_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP3 = dp(m_TMP2); m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_TMPL = set_b(m_TMP, read(dp_lng(m_TMP3, 2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = read(lng(m_TMPL)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_A = set_l(m_A, m_A | m_VAL); set_nz(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::ora_zil_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } m_TMP3 = dp(m_TMP2); [[fallthrough]]; case 5: m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_TMPL = set_b(m_TMP, read(dp_lng(m_TMP3, 2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: m_VAL = read(lng(m_TMPL)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; m_A = set_l(m_A, m_A | m_VAL); set_nz(m_A); prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::ora_w_zil_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP3 = dp(m_TMP2); m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_TMPL = set_b(m_TMP, read(dp_lng(m_TMP3, 2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = read(lng(m_TMPL)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_VAL = set_h(m_VAL, read(lng_idx(m_TMPL, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } m_A |= m_VAL; set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_end(); } void w65816_device::ora_w_zil_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } m_TMP3 = dp(m_TMP2); [[fallthrough]]; case 5: m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_TMPL = set_b(m_TMP, read(dp_lng(m_TMP3, 2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: m_VAL = read(lng(m_TMPL)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; [[fallthrough]]; case 13: m_VAL = set_h(m_VAL, read(lng_idx(m_TMPL, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; m_A |= m_VAL; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 15: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::ora_imm_full() { m_VAL = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_A = set_l(m_A, m_A | m_VAL); set_nz(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } prefetch_end(); } void w65816_device::ora_imm_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_VAL = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; m_A = set_l(m_A, m_A | m_VAL); set_nz(m_A); prefetch_start(); [[fallthrough]]; case 3: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::ora_w_imm16_full() { m_VAL = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_VAL = set_h(m_VAL, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_A |= m_VAL; set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } prefetch_end(); } void w65816_device::ora_w_imm16_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_VAL = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_VAL = set_h(m_VAL, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; m_A |= m_VAL; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 5: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::ora_aba_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_A = set_l(m_A, m_A | m_VAL); set_nz(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_end(); } void w65816_device::ora_aba_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_A = set_l(m_A, m_A | m_VAL); set_nz(m_A); prefetch_start(); [[fallthrough]]; case 7: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::ora_w_aba_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_A |= m_VAL; set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::ora_w_aba_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; m_A |= m_VAL; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::ora_abl_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_TMPL = set_b(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_PC++; m_VAL = read(lng(m_TMPL)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_A = set_l(m_A, m_A | m_VAL); set_nz(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::ora_abl_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_TMPL = set_b(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_PC++; [[fallthrough]]; case 7: m_VAL = read(lng(m_TMPL)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; m_A = set_l(m_A, m_A | m_VAL); set_nz(m_A); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::ora_w_abl_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_TMPL = set_b(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_PC++; m_VAL = read(lng(m_TMPL)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = set_h(m_VAL, read(lng_idx(m_TMPL, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_A |= m_VAL; set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::ora_w_abl_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_TMPL = set_b(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_PC++; [[fallthrough]]; case 7: m_VAL = read(lng(m_TMPL)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = set_h(m_VAL, read(lng_idx(m_TMPL, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; m_A |= m_VAL; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::ora_idy_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP = read(dp_ptr(m_TMP2, 0)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_ptr(m_TMP2, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } if(idx_extra_cycle(m_TMP, m_Y)) { read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } } m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_A = set_l(m_A, m_A | m_VAL); set_nz(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::ora_idy_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_TMP = read(dp_ptr(m_TMP2, 0)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_ptr(m_TMP2, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; if(idx_extra_cycle(m_TMP, m_Y)) { [[fallthrough]]; case 9: read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; } [[fallthrough]]; case 11: m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; m_A = set_l(m_A, m_A | m_VAL); set_nz(m_A); prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::ora_w_idy_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP = read(dp_ptr(m_TMP2, 0)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_ptr(m_TMP2, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } if(idx_extra_cycle(m_TMP, m_Y)) { read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } } m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_Y + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } m_A |= m_VAL; set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_end(); } void w65816_device::ora_w_idy_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_TMP = read(dp_ptr(m_TMP2, 0)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_ptr(m_TMP2, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; if(idx_extra_cycle(m_TMP, m_Y)) { [[fallthrough]]; case 9: read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; } [[fallthrough]]; case 11: m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; [[fallthrough]]; case 13: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_Y + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; m_A |= m_VAL; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 15: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::ora_zpi_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP = read(dp_ptr(m_TMP2, 0)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_ptr(m_TMP2, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_A = set_l(m_A, m_A | m_VAL); set_nz(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::ora_zpi_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_TMP = read(dp_ptr(m_TMP2, 0)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_ptr(m_TMP2, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; m_A = set_l(m_A, m_A | m_VAL); set_nz(m_A); prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::ora_w_zpi_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP = read(dp_ptr(m_TMP2, 0)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_ptr(m_TMP2, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_A |= m_VAL; set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::ora_w_zpi_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_TMP = read(dp_ptr(m_TMP2, 0)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_ptr(m_TMP2, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; m_A |= m_VAL; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::ora_dsy_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_TMP = read(sr(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(sr(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_A = set_l(m_A, m_A | m_VAL); set_nz(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::ora_dsy_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; [[fallthrough]]; case 5: m_TMP = read(sr(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(sr(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; m_A = set_l(m_A, m_A | m_VAL); set_nz(m_A); prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::ora_w_dsy_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_TMP = read(sr(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(sr(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_Y + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } m_A |= m_VAL; set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_end(); } void w65816_device::ora_w_dsy_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; [[fallthrough]]; case 5: m_TMP = read(sr(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(sr(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; [[fallthrough]]; case 13: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_Y + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; m_A |= m_VAL; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 15: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::ora_zpx_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = read(dp_idx(m_TMP2, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_A = set_l(m_A, m_A | m_VAL); set_nz(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::ora_zpx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = read(dp_idx(m_TMP2, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; m_A = set_l(m_A, m_A | m_VAL); set_nz(m_A); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::ora_w_zpx_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = read(dp_idx(m_TMP2, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = set_h(m_VAL, read(dp_idx(m_TMP2 + 1, m_X))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_A |= m_VAL; set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::ora_w_zpx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = read(dp_idx(m_TMP2, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = set_h(m_VAL, read(dp_idx(m_TMP2 + 1, m_X))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; m_A |= m_VAL; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::ora_ziy_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP3 = dp(m_TMP2); m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_TMPL = set_b(m_TMP, read(dp_lng(m_TMP3, 2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = read(lng_idx(m_TMPL, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_A = set_l(m_A, m_A | m_VAL); set_nz(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::ora_ziy_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } m_TMP3 = dp(m_TMP2); [[fallthrough]]; case 5: m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_TMPL = set_b(m_TMP, read(dp_lng(m_TMP3, 2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: m_VAL = read(lng_idx(m_TMPL, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; m_A = set_l(m_A, m_A | m_VAL); set_nz(m_A); prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::ora_w_ziy_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP3 = dp(m_TMP2); m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_TMPL = set_b(m_TMP, read(dp_lng(m_TMP3, 2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = read(lng_idx(m_TMPL, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_VAL = set_h(m_VAL, read(lng_idx(m_TMPL, m_Y + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } m_A |= m_VAL; set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_end(); } void w65816_device::ora_w_ziy_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } m_TMP3 = dp(m_TMP2); [[fallthrough]]; case 5: m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_TMPL = set_b(m_TMP, read(dp_lng(m_TMP3, 2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: m_VAL = read(lng_idx(m_TMPL, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; [[fallthrough]]; case 13: m_VAL = set_h(m_VAL, read(lng_idx(m_TMPL, m_Y + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; m_A |= m_VAL; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 15: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::ora_aby_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; if(idx_extra_cycle(m_TMP, m_Y)) { read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } } m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_A = set_l(m_A, m_A | m_VAL); set_nz(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::ora_aby_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; if(idx_extra_cycle(m_TMP, m_Y)) { [[fallthrough]]; case 5: read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; } [[fallthrough]]; case 7: m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; m_A = set_l(m_A, m_A | m_VAL); set_nz(m_A); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::ora_w_aby_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; if(idx_extra_cycle(m_TMP, m_Y)) { read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } } m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_Y + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_A |= m_VAL; set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::ora_w_aby_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; if(idx_extra_cycle(m_TMP, m_Y)) { [[fallthrough]]; case 5: read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; } [[fallthrough]]; case 7: m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_Y + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; m_A |= m_VAL; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::ora_abx_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; if(idx_extra_cycle(m_TMP, m_X)) { read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } } m_VAL = read(ab_idx(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_A = set_l(m_A, m_A | m_VAL); set_nz(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::ora_abx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; if(idx_extra_cycle(m_TMP, m_X)) { [[fallthrough]]; case 5: read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; } [[fallthrough]]; case 7: m_VAL = read(ab_idx(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; m_A = set_l(m_A, m_A | m_VAL); set_nz(m_A); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::ora_w_abx_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; if(idx_extra_cycle(m_TMP, m_X)) { read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } } m_VAL = read(ab_idx(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_X + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_A |= m_VAL; set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::ora_w_abx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; if(idx_extra_cycle(m_TMP, m_X)) { [[fallthrough]]; case 5: read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; } [[fallthrough]]; case 7: m_VAL = read(ab_idx(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_X + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; m_A |= m_VAL; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::ora_alx_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_TMPL = set_b(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_PC++; m_VAL = read(lng_idx(m_TMPL, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_A = set_l(m_A, m_A | m_VAL); set_nz(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::ora_alx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_TMPL = set_b(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_PC++; [[fallthrough]]; case 7: m_VAL = read(lng_idx(m_TMPL, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; m_A = set_l(m_A, m_A | m_VAL); set_nz(m_A); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::ora_w_alx_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_TMPL = set_b(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_PC++; m_VAL = read(lng_idx(m_TMPL, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = set_h(m_VAL, read(lng_idx(m_TMPL, m_X + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_A |= m_VAL; set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::ora_w_alx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_TMPL = set_b(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_PC++; [[fallthrough]]; case 7: m_VAL = read(lng_idx(m_TMPL, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = set_h(m_VAL, read(lng_idx(m_TMPL, m_X + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; m_A |= m_VAL; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::and_idx_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP3 = dp_idx(m_TMP2, m_X); m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_A = set_l(m_A, m_A & m_VAL); set_nz(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::and_idx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_TMP3 = dp_idx(m_TMP2, m_X); [[fallthrough]]; case 7: m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; m_A = set_l(m_A, m_A & m_VAL); set_nz(m_A); prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::and_w_idx_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP3 = dp_idx(m_TMP2, m_X); m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } m_A &= m_VAL; set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_end(); } void w65816_device::and_w_idx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_TMP3 = dp_idx(m_TMP2, m_X); [[fallthrough]]; case 7: m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; [[fallthrough]]; case 13: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; m_A &= m_VAL; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 15: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::and_ds_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_VAL = read(sr(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_A = set_l(m_A, m_A & m_VAL); set_nz(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_end(); } void w65816_device::and_ds_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; [[fallthrough]]; case 5: m_VAL = read(sr(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_A = set_l(m_A, m_A & m_VAL); set_nz(m_A); prefetch_start(); [[fallthrough]]; case 7: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::and_w_ds_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_VAL = read(sr(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = set_h(m_VAL, read(sr(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_A &= m_VAL; set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::and_w_ds_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; [[fallthrough]]; case 5: m_VAL = read(sr(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = set_h(m_VAL, read(sr(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; m_A &= m_VAL; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::and_zpg_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_A = set_l(m_A, m_A & m_VAL); set_nz(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_end(); } void w65816_device::and_zpg_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_A = set_l(m_A, m_A & m_VAL); set_nz(m_A); prefetch_start(); [[fallthrough]]; case 7: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::and_w_zpg_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = set_h(m_VAL, read(dp(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_A &= m_VAL; set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::and_w_zpg_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = set_h(m_VAL, read(dp(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; m_A &= m_VAL; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::and_zil_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP3 = dp(m_TMP2); m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_TMPL = set_b(m_TMP, read(dp_lng(m_TMP3, 2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = read(lng(m_TMPL)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_A = set_l(m_A, m_A & m_VAL); set_nz(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::and_zil_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } m_TMP3 = dp(m_TMP2); [[fallthrough]]; case 5: m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_TMPL = set_b(m_TMP, read(dp_lng(m_TMP3, 2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: m_VAL = read(lng(m_TMPL)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; m_A = set_l(m_A, m_A & m_VAL); set_nz(m_A); prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::and_w_zil_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP3 = dp(m_TMP2); m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_TMPL = set_b(m_TMP, read(dp_lng(m_TMP3, 2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = read(lng(m_TMPL)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_VAL = set_h(m_VAL, read(lng_idx(m_TMPL, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } m_A &= m_VAL; set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_end(); } void w65816_device::and_w_zil_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } m_TMP3 = dp(m_TMP2); [[fallthrough]]; case 5: m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_TMPL = set_b(m_TMP, read(dp_lng(m_TMP3, 2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: m_VAL = read(lng(m_TMPL)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; [[fallthrough]]; case 13: m_VAL = set_h(m_VAL, read(lng_idx(m_TMPL, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; m_A &= m_VAL; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 15: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::and_imm_full() { m_VAL = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_A = set_l(m_A, m_A & m_VAL); set_nz(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } prefetch_end(); } void w65816_device::and_imm_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_VAL = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; m_A = set_l(m_A, m_A & m_VAL); set_nz(m_A); prefetch_start(); [[fallthrough]]; case 3: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::and_w_imm16_full() { m_VAL = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_VAL = set_h(m_VAL, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_A &= m_VAL; set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } prefetch_end(); } void w65816_device::and_w_imm16_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_VAL = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_VAL = set_h(m_VAL, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; m_A &= m_VAL; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 5: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::and_aba_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_A = set_l(m_A, m_A & m_VAL); set_nz(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_end(); } void w65816_device::and_aba_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_A = set_l(m_A, m_A & m_VAL); set_nz(m_A); prefetch_start(); [[fallthrough]]; case 7: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::and_w_aba_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_A &= m_VAL; set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::and_w_aba_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; m_A &= m_VAL; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::and_abl_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_TMPL = set_b(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_PC++; m_VAL = read(lng(m_TMPL)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_A = set_l(m_A, m_A & m_VAL); set_nz(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::and_abl_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_TMPL = set_b(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_PC++; [[fallthrough]]; case 7: m_VAL = read(lng(m_TMPL)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; m_A = set_l(m_A, m_A & m_VAL); set_nz(m_A); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::and_w_abl_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_TMPL = set_b(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_PC++; m_VAL = read(lng(m_TMPL)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = set_h(m_VAL, read(lng_idx(m_TMPL, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_A &= m_VAL; set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::and_w_abl_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_TMPL = set_b(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_PC++; [[fallthrough]]; case 7: m_VAL = read(lng(m_TMPL)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = set_h(m_VAL, read(lng_idx(m_TMPL, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; m_A &= m_VAL; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::and_idy_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP = read(dp_ptr(m_TMP2, 0)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_ptr(m_TMP2, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } if(idx_extra_cycle(m_TMP, m_Y)) { read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } } m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_A = set_l(m_A, m_A & m_VAL); set_nz(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::and_idy_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_TMP = read(dp_ptr(m_TMP2, 0)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_ptr(m_TMP2, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; if(idx_extra_cycle(m_TMP, m_Y)) { [[fallthrough]]; case 9: read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; } [[fallthrough]]; case 11: m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; m_A = set_l(m_A, m_A & m_VAL); set_nz(m_A); prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::and_w_idy_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP = read(dp_ptr(m_TMP2, 0)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_ptr(m_TMP2, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } if(idx_extra_cycle(m_TMP, m_Y)) { read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } } m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_Y + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } m_A &= m_VAL; set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_end(); } void w65816_device::and_w_idy_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_TMP = read(dp_ptr(m_TMP2, 0)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_ptr(m_TMP2, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; if(idx_extra_cycle(m_TMP, m_Y)) { [[fallthrough]]; case 9: read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; } [[fallthrough]]; case 11: m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; [[fallthrough]]; case 13: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_Y + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; m_A &= m_VAL; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 15: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::and_zpi_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP = read(dp_ptr(m_TMP2, 0)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_ptr(m_TMP2, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_A = set_l(m_A, m_A & m_VAL); set_nz(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::and_zpi_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_TMP = read(dp_ptr(m_TMP2, 0)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_ptr(m_TMP2, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; m_A = set_l(m_A, m_A & m_VAL); set_nz(m_A); prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::and_w_zpi_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP = read(dp_ptr(m_TMP2, 0)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_ptr(m_TMP2, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_A &= m_VAL; set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::and_w_zpi_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_TMP = read(dp_ptr(m_TMP2, 0)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_ptr(m_TMP2, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; m_A &= m_VAL; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::and_dsy_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_TMP = read(sr(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(sr(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_A = set_l(m_A, m_A & m_VAL); set_nz(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::and_dsy_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; [[fallthrough]]; case 5: m_TMP = read(sr(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(sr(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; m_A = set_l(m_A, m_A & m_VAL); set_nz(m_A); prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::and_w_dsy_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_TMP = read(sr(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(sr(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_Y + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } m_A &= m_VAL; set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_end(); } void w65816_device::and_w_dsy_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; [[fallthrough]]; case 5: m_TMP = read(sr(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(sr(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; [[fallthrough]]; case 13: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_Y + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; m_A &= m_VAL; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 15: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::and_zpx_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = read(dp_idx(m_TMP2, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_A = set_l(m_A, m_A & m_VAL); set_nz(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::and_zpx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = read(dp_idx(m_TMP2, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; m_A = set_l(m_A, m_A & m_VAL); set_nz(m_A); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::and_w_zpx_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = read(dp_idx(m_TMP2, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = set_h(m_VAL, read(dp_idx(m_TMP2 + 1, m_X))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_A &= m_VAL; set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::and_w_zpx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = read(dp_idx(m_TMP2, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = set_h(m_VAL, read(dp_idx(m_TMP2 + 1, m_X))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; m_A &= m_VAL; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::and_ziy_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP3 = dp(m_TMP2); m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_TMPL = set_b(m_TMP, read(dp_lng(m_TMP3, 2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = read(lng_idx(m_TMPL, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_A = set_l(m_A, m_A & m_VAL); set_nz(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::and_ziy_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } m_TMP3 = dp(m_TMP2); [[fallthrough]]; case 5: m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_TMPL = set_b(m_TMP, read(dp_lng(m_TMP3, 2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: m_VAL = read(lng_idx(m_TMPL, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; m_A = set_l(m_A, m_A & m_VAL); set_nz(m_A); prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::and_w_ziy_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP3 = dp(m_TMP2); m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_TMPL = set_b(m_TMP, read(dp_lng(m_TMP3, 2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = read(lng_idx(m_TMPL, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_VAL = set_h(m_VAL, read(lng_idx(m_TMPL, m_Y + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } m_A &= m_VAL; set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_end(); } void w65816_device::and_w_ziy_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } m_TMP3 = dp(m_TMP2); [[fallthrough]]; case 5: m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_TMPL = set_b(m_TMP, read(dp_lng(m_TMP3, 2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: m_VAL = read(lng_idx(m_TMPL, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; [[fallthrough]]; case 13: m_VAL = set_h(m_VAL, read(lng_idx(m_TMPL, m_Y + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; m_A &= m_VAL; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 15: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::and_aby_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; if(idx_extra_cycle(m_TMP, m_Y)) { read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } } m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_A = set_l(m_A, m_A & m_VAL); set_nz(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::and_aby_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; if(idx_extra_cycle(m_TMP, m_Y)) { [[fallthrough]]; case 5: read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; } [[fallthrough]]; case 7: m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; m_A = set_l(m_A, m_A & m_VAL); set_nz(m_A); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::and_w_aby_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; if(idx_extra_cycle(m_TMP, m_Y)) { read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } } m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_Y + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_A &= m_VAL; set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::and_w_aby_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; if(idx_extra_cycle(m_TMP, m_Y)) { [[fallthrough]]; case 5: read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; } [[fallthrough]]; case 7: m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_Y + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; m_A &= m_VAL; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::and_abx_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; if(idx_extra_cycle(m_TMP, m_X)) { read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } } m_VAL = read(ab_idx(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_A = set_l(m_A, m_A & m_VAL); set_nz(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::and_abx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; if(idx_extra_cycle(m_TMP, m_X)) { [[fallthrough]]; case 5: read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; } [[fallthrough]]; case 7: m_VAL = read(ab_idx(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; m_A = set_l(m_A, m_A & m_VAL); set_nz(m_A); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::and_w_abx_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; if(idx_extra_cycle(m_TMP, m_X)) { read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } } m_VAL = read(ab_idx(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_X + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_A &= m_VAL; set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::and_w_abx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; if(idx_extra_cycle(m_TMP, m_X)) { [[fallthrough]]; case 5: read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; } [[fallthrough]]; case 7: m_VAL = read(ab_idx(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_X + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; m_A &= m_VAL; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::and_alx_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_TMPL = set_b(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_PC++; m_VAL = read(lng_idx(m_TMPL, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_A = set_l(m_A, m_A & m_VAL); set_nz(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::and_alx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_TMPL = set_b(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_PC++; [[fallthrough]]; case 7: m_VAL = read(lng_idx(m_TMPL, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; m_A = set_l(m_A, m_A & m_VAL); set_nz(m_A); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::and_w_alx_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_TMPL = set_b(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_PC++; m_VAL = read(lng_idx(m_TMPL, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = set_h(m_VAL, read(lng_idx(m_TMPL, m_X + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_A &= m_VAL; set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::and_w_alx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_TMPL = set_b(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_PC++; [[fallthrough]]; case 7: m_VAL = read(lng_idx(m_TMPL, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = set_h(m_VAL, read(lng_idx(m_TMPL, m_X + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; m_A &= m_VAL; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::eor_idx_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP3 = dp_idx(m_TMP2, m_X); m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_A = set_l(m_A, m_A ^ m_VAL); set_nz(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::eor_idx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_TMP3 = dp_idx(m_TMP2, m_X); [[fallthrough]]; case 7: m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; m_A = set_l(m_A, m_A ^ m_VAL); set_nz(m_A); prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::eor_w_idx_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP3 = dp_idx(m_TMP2, m_X); m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } m_A ^= m_VAL; set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_end(); } void w65816_device::eor_w_idx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_TMP3 = dp_idx(m_TMP2, m_X); [[fallthrough]]; case 7: m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; [[fallthrough]]; case 13: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; m_A ^= m_VAL; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 15: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::eor_ds_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_VAL = read(sr(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_A = set_l(m_A, m_A ^ m_VAL); set_nz(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_end(); } void w65816_device::eor_ds_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; [[fallthrough]]; case 5: m_VAL = read(sr(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_A = set_l(m_A, m_A ^ m_VAL); set_nz(m_A); prefetch_start(); [[fallthrough]]; case 7: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::eor_w_ds_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_VAL = read(sr(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = set_h(m_VAL, read(sr(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_A ^= m_VAL; set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::eor_w_ds_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; [[fallthrough]]; case 5: m_VAL = read(sr(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = set_h(m_VAL, read(sr(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; m_A ^= m_VAL; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::eor_zpg_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_A = set_l(m_A, m_A ^ m_VAL); set_nz(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_end(); } void w65816_device::eor_zpg_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_A = set_l(m_A, m_A ^ m_VAL); set_nz(m_A); prefetch_start(); [[fallthrough]]; case 7: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::eor_w_zpg_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = set_h(m_VAL, read(dp(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_A ^= m_VAL; set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::eor_w_zpg_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = set_h(m_VAL, read(dp(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; m_A ^= m_VAL; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::eor_zil_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP3 = dp(m_TMP2); m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_TMPL = set_b(m_TMP, read(dp_lng(m_TMP3, 2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = read(lng(m_TMPL)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_A = set_l(m_A, m_A ^ m_VAL); set_nz(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::eor_zil_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } m_TMP3 = dp(m_TMP2); [[fallthrough]]; case 5: m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_TMPL = set_b(m_TMP, read(dp_lng(m_TMP3, 2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: m_VAL = read(lng(m_TMPL)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; m_A = set_l(m_A, m_A ^ m_VAL); set_nz(m_A); prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::eor_w_zil_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP3 = dp(m_TMP2); m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_TMPL = set_b(m_TMP, read(dp_lng(m_TMP3, 2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = read(lng(m_TMPL)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_VAL = set_h(m_VAL, read(lng_idx(m_TMPL, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } m_A ^= m_VAL; set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_end(); } void w65816_device::eor_w_zil_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } m_TMP3 = dp(m_TMP2); [[fallthrough]]; case 5: m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_TMPL = set_b(m_TMP, read(dp_lng(m_TMP3, 2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: m_VAL = read(lng(m_TMPL)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; [[fallthrough]]; case 13: m_VAL = set_h(m_VAL, read(lng_idx(m_TMPL, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; m_A ^= m_VAL; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 15: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::eor_imm_full() { m_VAL = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_A = set_l(m_A, m_A ^ m_VAL); set_nz(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } prefetch_end(); } void w65816_device::eor_imm_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_VAL = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; m_A = set_l(m_A, m_A ^ m_VAL); set_nz(m_A); prefetch_start(); [[fallthrough]]; case 3: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::eor_w_imm16_full() { m_VAL = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_VAL = set_h(m_VAL, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_A ^= m_VAL; set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } prefetch_end(); } void w65816_device::eor_w_imm16_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_VAL = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_VAL = set_h(m_VAL, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; m_A ^= m_VAL; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 5: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::eor_aba_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_A = set_l(m_A, m_A ^ m_VAL); set_nz(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_end(); } void w65816_device::eor_aba_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_A = set_l(m_A, m_A ^ m_VAL); set_nz(m_A); prefetch_start(); [[fallthrough]]; case 7: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::eor_w_aba_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_A ^= m_VAL; set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::eor_w_aba_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; m_A ^= m_VAL; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::eor_abl_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_TMPL = set_b(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_PC++; m_VAL = read(lng(m_TMPL)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_A = set_l(m_A, m_A ^ m_VAL); set_nz(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::eor_abl_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_TMPL = set_b(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_PC++; [[fallthrough]]; case 7: m_VAL = read(lng(m_TMPL)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; m_A = set_l(m_A, m_A ^ m_VAL); set_nz(m_A); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::eor_w_abl_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_TMPL = set_b(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_PC++; m_VAL = read(lng(m_TMPL)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = set_h(m_VAL, read(lng_idx(m_TMPL, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_A ^= m_VAL; set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::eor_w_abl_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_TMPL = set_b(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_PC++; [[fallthrough]]; case 7: m_VAL = read(lng(m_TMPL)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = set_h(m_VAL, read(lng_idx(m_TMPL, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; m_A ^= m_VAL; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::eor_idy_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP = read(dp_ptr(m_TMP2, 0)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_ptr(m_TMP2, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } if(idx_extra_cycle(m_TMP, m_Y)) { read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } } m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_A = set_l(m_A, m_A ^ m_VAL); set_nz(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::eor_idy_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_TMP = read(dp_ptr(m_TMP2, 0)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_ptr(m_TMP2, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; if(idx_extra_cycle(m_TMP, m_Y)) { [[fallthrough]]; case 9: read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; } [[fallthrough]]; case 11: m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; m_A = set_l(m_A, m_A ^ m_VAL); set_nz(m_A); prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::eor_w_idy_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP = read(dp_ptr(m_TMP2, 0)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_ptr(m_TMP2, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } if(idx_extra_cycle(m_TMP, m_Y)) { read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } } m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_Y + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } m_A ^= m_VAL; set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_end(); } void w65816_device::eor_w_idy_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_TMP = read(dp_ptr(m_TMP2, 0)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_ptr(m_TMP2, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; if(idx_extra_cycle(m_TMP, m_Y)) { [[fallthrough]]; case 9: read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; } [[fallthrough]]; case 11: m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; [[fallthrough]]; case 13: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_Y + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; m_A ^= m_VAL; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 15: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::eor_zpi_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP = read(dp_ptr(m_TMP2, 0)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_ptr(m_TMP2, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_A = set_l(m_A, m_A ^ m_VAL); set_nz(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::eor_zpi_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_TMP = read(dp_ptr(m_TMP2, 0)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_ptr(m_TMP2, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; m_A = set_l(m_A, m_A ^ m_VAL); set_nz(m_A); prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::eor_w_zpi_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP = read(dp_ptr(m_TMP2, 0)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_ptr(m_TMP2, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_A ^= m_VAL; set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::eor_w_zpi_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_TMP = read(dp_ptr(m_TMP2, 0)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_ptr(m_TMP2, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; m_A ^= m_VAL; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::eor_dsy_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_TMP = read(sr(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(sr(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_A = set_l(m_A, m_A ^ m_VAL); set_nz(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::eor_dsy_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; [[fallthrough]]; case 5: m_TMP = read(sr(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(sr(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; m_A = set_l(m_A, m_A ^ m_VAL); set_nz(m_A); prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::eor_w_dsy_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_TMP = read(sr(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(sr(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_Y + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } m_A ^= m_VAL; set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_end(); } void w65816_device::eor_w_dsy_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; [[fallthrough]]; case 5: m_TMP = read(sr(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(sr(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; [[fallthrough]]; case 13: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_Y + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; m_A ^= m_VAL; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 15: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::eor_zpx_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = read(dp_idx(m_TMP2, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_A = set_l(m_A, m_A ^ m_VAL); set_nz(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::eor_zpx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = read(dp_idx(m_TMP2, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; m_A = set_l(m_A, m_A ^ m_VAL); set_nz(m_A); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::eor_w_zpx_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = read(dp_idx(m_TMP2, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = set_h(m_VAL, read(dp_idx(m_TMP2 + 1, m_X))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_A ^= m_VAL; set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::eor_w_zpx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = read(dp_idx(m_TMP2, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = set_h(m_VAL, read(dp_idx(m_TMP2 + 1, m_X))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; m_A ^= m_VAL; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::eor_ziy_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP3 = dp(m_TMP2); m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_TMPL = set_b(m_TMP, read(dp_lng(m_TMP3, 2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = read(lng_idx(m_TMPL, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_A = set_l(m_A, m_A ^ m_VAL); set_nz(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::eor_ziy_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } m_TMP3 = dp(m_TMP2); [[fallthrough]]; case 5: m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_TMPL = set_b(m_TMP, read(dp_lng(m_TMP3, 2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: m_VAL = read(lng_idx(m_TMPL, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; m_A = set_l(m_A, m_A ^ m_VAL); set_nz(m_A); prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::eor_w_ziy_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP3 = dp(m_TMP2); m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_TMPL = set_b(m_TMP, read(dp_lng(m_TMP3, 2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = read(lng_idx(m_TMPL, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_VAL = set_h(m_VAL, read(lng_idx(m_TMPL, m_Y + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } m_A ^= m_VAL; set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_end(); } void w65816_device::eor_w_ziy_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } m_TMP3 = dp(m_TMP2); [[fallthrough]]; case 5: m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_TMPL = set_b(m_TMP, read(dp_lng(m_TMP3, 2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: m_VAL = read(lng_idx(m_TMPL, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; [[fallthrough]]; case 13: m_VAL = set_h(m_VAL, read(lng_idx(m_TMPL, m_Y + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; m_A ^= m_VAL; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 15: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::eor_aby_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; if(idx_extra_cycle(m_TMP, m_Y)) { read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } } m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_A = set_l(m_A, m_A ^ m_VAL); set_nz(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::eor_aby_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; if(idx_extra_cycle(m_TMP, m_Y)) { [[fallthrough]]; case 5: read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; } [[fallthrough]]; case 7: m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; m_A = set_l(m_A, m_A ^ m_VAL); set_nz(m_A); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::eor_w_aby_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; if(idx_extra_cycle(m_TMP, m_Y)) { read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } } m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_Y + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_A ^= m_VAL; set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::eor_w_aby_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; if(idx_extra_cycle(m_TMP, m_Y)) { [[fallthrough]]; case 5: read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; } [[fallthrough]]; case 7: m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_Y + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; m_A ^= m_VAL; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::eor_abx_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; if(idx_extra_cycle(m_TMP, m_X)) { read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } } m_VAL = read(ab_idx(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_A = set_l(m_A, m_A ^ m_VAL); set_nz(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::eor_abx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; if(idx_extra_cycle(m_TMP, m_X)) { [[fallthrough]]; case 5: read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; } [[fallthrough]]; case 7: m_VAL = read(ab_idx(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; m_A = set_l(m_A, m_A ^ m_VAL); set_nz(m_A); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::eor_w_abx_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; if(idx_extra_cycle(m_TMP, m_X)) { read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } } m_VAL = read(ab_idx(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_X + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_A ^= m_VAL; set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::eor_w_abx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; if(idx_extra_cycle(m_TMP, m_X)) { [[fallthrough]]; case 5: read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; } [[fallthrough]]; case 7: m_VAL = read(ab_idx(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_X + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; m_A ^= m_VAL; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::eor_alx_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_TMPL = set_b(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_PC++; m_VAL = read(lng_idx(m_TMPL, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_A = set_l(m_A, m_A ^ m_VAL); set_nz(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::eor_alx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_TMPL = set_b(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_PC++; [[fallthrough]]; case 7: m_VAL = read(lng_idx(m_TMPL, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; m_A = set_l(m_A, m_A ^ m_VAL); set_nz(m_A); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::eor_w_alx_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_TMPL = set_b(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_PC++; m_VAL = read(lng_idx(m_TMPL, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = set_h(m_VAL, read(lng_idx(m_TMPL, m_X + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_A ^= m_VAL; set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::eor_w_alx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_TMPL = set_b(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_PC++; [[fallthrough]]; case 7: m_VAL = read(lng_idx(m_TMPL, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = set_h(m_VAL, read(lng_idx(m_TMPL, m_X + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; m_A ^= m_VAL; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::adc_idx_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP3 = dp_idx(m_TMP2, m_X); m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } do_adc(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::adc_idx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_TMP3 = dp_idx(m_TMP2, m_X); [[fallthrough]]; case 7: m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; do_adc(m_VAL); prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::adc_w_idx_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP3 = dp_idx(m_TMP2, m_X); m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } do_adc16(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_end(); } void w65816_device::adc_w_idx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_TMP3 = dp_idx(m_TMP2, m_X); [[fallthrough]]; case 7: m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; [[fallthrough]]; case 13: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; do_adc16(m_VAL); prefetch_start(); [[fallthrough]]; case 15: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::adc_ds_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_VAL = read(sr(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } do_adc(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_end(); } void w65816_device::adc_ds_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; [[fallthrough]]; case 5: m_VAL = read(sr(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; do_adc(m_VAL); prefetch_start(); [[fallthrough]]; case 7: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::adc_w_ds_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_VAL = read(sr(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = set_h(m_VAL, read(sr(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } do_adc16(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::adc_w_ds_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; [[fallthrough]]; case 5: m_VAL = read(sr(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = set_h(m_VAL, read(sr(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; do_adc16(m_VAL); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::adc_zpg_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } do_adc(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_end(); } void w65816_device::adc_zpg_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; do_adc(m_VAL); prefetch_start(); [[fallthrough]]; case 7: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::adc_w_zpg_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = set_h(m_VAL, read(dp(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } do_adc16(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::adc_w_zpg_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = set_h(m_VAL, read(dp(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; do_adc16(m_VAL); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::adc_zil_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP3 = dp(m_TMP2); m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_TMPL = set_b(m_TMP, read(dp_lng(m_TMP3, 2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = read(lng(m_TMPL)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } do_adc(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::adc_zil_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } m_TMP3 = dp(m_TMP2); [[fallthrough]]; case 5: m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_TMPL = set_b(m_TMP, read(dp_lng(m_TMP3, 2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: m_VAL = read(lng(m_TMPL)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; do_adc(m_VAL); prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::adc_w_zil_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP3 = dp(m_TMP2); m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_TMPL = set_b(m_TMP, read(dp_lng(m_TMP3, 2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = read(lng(m_TMPL)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_VAL = set_h(m_VAL, read(lng_idx(m_TMPL, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } do_adc16(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_end(); } void w65816_device::adc_w_zil_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } m_TMP3 = dp(m_TMP2); [[fallthrough]]; case 5: m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_TMPL = set_b(m_TMP, read(dp_lng(m_TMP3, 2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: m_VAL = read(lng(m_TMPL)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; [[fallthrough]]; case 13: m_VAL = set_h(m_VAL, read(lng_idx(m_TMPL, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; do_adc16(m_VAL); prefetch_start(); [[fallthrough]]; case 15: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::adc_imm_full() { m_VAL = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; do_adc(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } prefetch_end(); } void w65816_device::adc_imm_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_VAL = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; do_adc(m_VAL); prefetch_start(); [[fallthrough]]; case 3: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::adc_w_imm16_full() { m_VAL = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_VAL = set_h(m_VAL, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; do_adc16(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } prefetch_end(); } void w65816_device::adc_w_imm16_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_VAL = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_VAL = set_h(m_VAL, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; do_adc16(m_VAL); prefetch_start(); [[fallthrough]]; case 5: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::adc_aba_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } do_adc(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_end(); } void w65816_device::adc_aba_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; do_adc(m_VAL); prefetch_start(); [[fallthrough]]; case 7: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::adc_w_aba_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } do_adc16(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::adc_w_aba_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; do_adc16(m_VAL); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::adc_abl_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_TMPL = set_b(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_PC++; m_VAL = read(lng(m_TMPL)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } do_adc(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::adc_abl_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_TMPL = set_b(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_PC++; [[fallthrough]]; case 7: m_VAL = read(lng(m_TMPL)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; do_adc(m_VAL); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::adc_w_abl_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_TMPL = set_b(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_PC++; m_VAL = read(lng(m_TMPL)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = set_h(m_VAL, read(lng_idx(m_TMPL, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } do_adc16(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::adc_w_abl_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_TMPL = set_b(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_PC++; [[fallthrough]]; case 7: m_VAL = read(lng(m_TMPL)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = set_h(m_VAL, read(lng_idx(m_TMPL, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; do_adc16(m_VAL); prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::adc_idy_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP = read(dp_ptr(m_TMP2, 0)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_ptr(m_TMP2, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } if(idx_extra_cycle(m_TMP, m_Y)) { read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } } m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } do_adc(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::adc_idy_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_TMP = read(dp_ptr(m_TMP2, 0)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_ptr(m_TMP2, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; if(idx_extra_cycle(m_TMP, m_Y)) { [[fallthrough]]; case 9: read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; } [[fallthrough]]; case 11: m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; do_adc(m_VAL); prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::adc_w_idy_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP = read(dp_ptr(m_TMP2, 0)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_ptr(m_TMP2, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } if(idx_extra_cycle(m_TMP, m_Y)) { read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } } m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_Y + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } do_adc16(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_end(); } void w65816_device::adc_w_idy_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_TMP = read(dp_ptr(m_TMP2, 0)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_ptr(m_TMP2, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; if(idx_extra_cycle(m_TMP, m_Y)) { [[fallthrough]]; case 9: read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; } [[fallthrough]]; case 11: m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; [[fallthrough]]; case 13: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_Y + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; do_adc16(m_VAL); prefetch_start(); [[fallthrough]]; case 15: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::adc_zpi_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP = read(dp_ptr(m_TMP2, 0)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_ptr(m_TMP2, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } do_adc(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::adc_zpi_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_TMP = read(dp_ptr(m_TMP2, 0)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_ptr(m_TMP2, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; do_adc(m_VAL); prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::adc_w_zpi_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP = read(dp_ptr(m_TMP2, 0)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_ptr(m_TMP2, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } do_adc16(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::adc_w_zpi_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_TMP = read(dp_ptr(m_TMP2, 0)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_ptr(m_TMP2, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; do_adc16(m_VAL); prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::adc_dsy_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_TMP = read(sr(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(sr(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } do_adc(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::adc_dsy_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; [[fallthrough]]; case 5: m_TMP = read(sr(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(sr(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; do_adc(m_VAL); prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::adc_w_dsy_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_TMP = read(sr(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(sr(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_Y + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } do_adc16(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_end(); } void w65816_device::adc_w_dsy_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; [[fallthrough]]; case 5: m_TMP = read(sr(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(sr(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; [[fallthrough]]; case 13: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_Y + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; do_adc16(m_VAL); prefetch_start(); [[fallthrough]]; case 15: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::adc_zpx_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = read(dp_idx(m_TMP2, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } do_adc(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::adc_zpx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = read(dp_idx(m_TMP2, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; do_adc(m_VAL); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::adc_w_zpx_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = read(dp_idx(m_TMP2, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = set_h(m_VAL, read(dp_idx(m_TMP2 + 1, m_X))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } do_adc16(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::adc_w_zpx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = read(dp_idx(m_TMP2, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = set_h(m_VAL, read(dp_idx(m_TMP2 + 1, m_X))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; do_adc16(m_VAL); prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::adc_ziy_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP3 = dp(m_TMP2); m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_TMPL = set_b(m_TMP, read(dp_lng(m_TMP3, 2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = read(lng_idx(m_TMPL, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } do_adc(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::adc_ziy_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } m_TMP3 = dp(m_TMP2); [[fallthrough]]; case 5: m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_TMPL = set_b(m_TMP, read(dp_lng(m_TMP3, 2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: m_VAL = read(lng_idx(m_TMPL, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; do_adc(m_VAL); prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::adc_w_ziy_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP3 = dp(m_TMP2); m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_TMPL = set_b(m_TMP, read(dp_lng(m_TMP3, 2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = read(lng_idx(m_TMPL, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_VAL = set_h(m_VAL, read(lng_idx(m_TMPL, m_Y + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } do_adc16(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_end(); } void w65816_device::adc_w_ziy_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } m_TMP3 = dp(m_TMP2); [[fallthrough]]; case 5: m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_TMPL = set_b(m_TMP, read(dp_lng(m_TMP3, 2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: m_VAL = read(lng_idx(m_TMPL, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; [[fallthrough]]; case 13: m_VAL = set_h(m_VAL, read(lng_idx(m_TMPL, m_Y + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; do_adc16(m_VAL); prefetch_start(); [[fallthrough]]; case 15: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::adc_aby_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; if(idx_extra_cycle(m_TMP, m_Y)) { read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } } m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } do_adc(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::adc_aby_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; if(idx_extra_cycle(m_TMP, m_Y)) { [[fallthrough]]; case 5: read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; } [[fallthrough]]; case 7: m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; do_adc(m_VAL); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::adc_w_aby_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; if(idx_extra_cycle(m_TMP, m_Y)) { read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } } m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_Y + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } do_adc16(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::adc_w_aby_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; if(idx_extra_cycle(m_TMP, m_Y)) { [[fallthrough]]; case 5: read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; } [[fallthrough]]; case 7: m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_Y + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; do_adc16(m_VAL); prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::adc_abx_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; if(idx_extra_cycle(m_TMP, m_X)) { read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } } m_VAL = read(ab_idx(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } do_adc(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::adc_abx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; if(idx_extra_cycle(m_TMP, m_X)) { [[fallthrough]]; case 5: read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; } [[fallthrough]]; case 7: m_VAL = read(ab_idx(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; do_adc(m_VAL); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::adc_w_abx_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; if(idx_extra_cycle(m_TMP, m_X)) { read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } } m_VAL = read(ab_idx(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_X + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } do_adc16(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::adc_w_abx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; if(idx_extra_cycle(m_TMP, m_X)) { [[fallthrough]]; case 5: read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; } [[fallthrough]]; case 7: m_VAL = read(ab_idx(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_X + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; do_adc16(m_VAL); prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::adc_alx_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_TMPL = set_b(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_PC++; m_VAL = read(lng_idx(m_TMPL, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } do_adc(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::adc_alx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_TMPL = set_b(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_PC++; [[fallthrough]]; case 7: m_VAL = read(lng_idx(m_TMPL, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; do_adc(m_VAL); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::adc_w_alx_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_TMPL = set_b(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_PC++; m_VAL = read(lng_idx(m_TMPL, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = set_h(m_VAL, read(lng_idx(m_TMPL, m_X + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } do_adc16(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::adc_w_alx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_TMPL = set_b(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_PC++; [[fallthrough]]; case 7: m_VAL = read(lng_idx(m_TMPL, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = set_h(m_VAL, read(lng_idx(m_TMPL, m_X + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; do_adc16(m_VAL); prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sbc_idx_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP3 = dp_idx(m_TMP2, m_X); m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } do_sbc(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::sbc_idx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_TMP3 = dp_idx(m_TMP2, m_X); [[fallthrough]]; case 7: m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; do_sbc(m_VAL); prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sbc_w_idx_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP3 = dp_idx(m_TMP2, m_X); m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } do_sbc16(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_end(); } void w65816_device::sbc_w_idx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_TMP3 = dp_idx(m_TMP2, m_X); [[fallthrough]]; case 7: m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; [[fallthrough]]; case 13: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; do_sbc16(m_VAL); prefetch_start(); [[fallthrough]]; case 15: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sbc_ds_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_VAL = read(sr(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } do_sbc(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_end(); } void w65816_device::sbc_ds_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; [[fallthrough]]; case 5: m_VAL = read(sr(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; do_sbc(m_VAL); prefetch_start(); [[fallthrough]]; case 7: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sbc_w_ds_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_VAL = read(sr(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = set_h(m_VAL, read(sr(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } do_sbc16(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::sbc_w_ds_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; [[fallthrough]]; case 5: m_VAL = read(sr(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = set_h(m_VAL, read(sr(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; do_sbc16(m_VAL); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sbc_zpg_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } do_sbc(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_end(); } void w65816_device::sbc_zpg_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; do_sbc(m_VAL); prefetch_start(); [[fallthrough]]; case 7: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sbc_w_zpg_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = set_h(m_VAL, read(dp(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } do_sbc16(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::sbc_w_zpg_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = set_h(m_VAL, read(dp(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; do_sbc16(m_VAL); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sbc_zil_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP3 = dp(m_TMP2); m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_TMPL = set_b(m_TMP, read(dp_lng(m_TMP3, 2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = read(lng(m_TMPL)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } do_sbc(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::sbc_zil_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } m_TMP3 = dp(m_TMP2); [[fallthrough]]; case 5: m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_TMPL = set_b(m_TMP, read(dp_lng(m_TMP3, 2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: m_VAL = read(lng(m_TMPL)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; do_sbc(m_VAL); prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sbc_w_zil_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP3 = dp(m_TMP2); m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_TMPL = set_b(m_TMP, read(dp_lng(m_TMP3, 2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = read(lng(m_TMPL)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_VAL = set_h(m_VAL, read(lng_idx(m_TMPL, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } do_sbc16(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_end(); } void w65816_device::sbc_w_zil_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } m_TMP3 = dp(m_TMP2); [[fallthrough]]; case 5: m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_TMPL = set_b(m_TMP, read(dp_lng(m_TMP3, 2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: m_VAL = read(lng(m_TMPL)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; [[fallthrough]]; case 13: m_VAL = set_h(m_VAL, read(lng_idx(m_TMPL, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; do_sbc16(m_VAL); prefetch_start(); [[fallthrough]]; case 15: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sbc_imm_full() { m_VAL = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; do_sbc(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } prefetch_end(); } void w65816_device::sbc_imm_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_VAL = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; do_sbc(m_VAL); prefetch_start(); [[fallthrough]]; case 3: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sbc_w_imm16_full() { m_VAL = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_VAL = set_h(m_VAL, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; do_sbc16(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } prefetch_end(); } void w65816_device::sbc_w_imm16_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_VAL = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_VAL = set_h(m_VAL, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; do_sbc16(m_VAL); prefetch_start(); [[fallthrough]]; case 5: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sbc_aba_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } do_sbc(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_end(); } void w65816_device::sbc_aba_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; do_sbc(m_VAL); prefetch_start(); [[fallthrough]]; case 7: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sbc_w_aba_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } do_sbc16(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::sbc_w_aba_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; do_sbc16(m_VAL); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sbc_abl_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_TMPL = set_b(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_PC++; m_VAL = read(lng(m_TMPL)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } do_sbc(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::sbc_abl_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_TMPL = set_b(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_PC++; [[fallthrough]]; case 7: m_VAL = read(lng(m_TMPL)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; do_sbc(m_VAL); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sbc_w_abl_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_TMPL = set_b(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_PC++; m_VAL = read(lng(m_TMPL)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = set_h(m_VAL, read(lng_idx(m_TMPL, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } do_sbc16(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::sbc_w_abl_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_TMPL = set_b(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_PC++; [[fallthrough]]; case 7: m_VAL = read(lng(m_TMPL)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = set_h(m_VAL, read(lng_idx(m_TMPL, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; do_sbc16(m_VAL); prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sbc_idy_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP = read(dp_ptr(m_TMP2, 0)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_ptr(m_TMP2, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } if(idx_extra_cycle(m_TMP, m_Y)) { read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } } m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } do_sbc(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::sbc_idy_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_TMP = read(dp_ptr(m_TMP2, 0)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_ptr(m_TMP2, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; if(idx_extra_cycle(m_TMP, m_Y)) { [[fallthrough]]; case 9: read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; } [[fallthrough]]; case 11: m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; do_sbc(m_VAL); prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sbc_w_idy_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP = read(dp_ptr(m_TMP2, 0)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_ptr(m_TMP2, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } if(idx_extra_cycle(m_TMP, m_Y)) { read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } } m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_Y + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } do_sbc16(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_end(); } void w65816_device::sbc_w_idy_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_TMP = read(dp_ptr(m_TMP2, 0)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_ptr(m_TMP2, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; if(idx_extra_cycle(m_TMP, m_Y)) { [[fallthrough]]; case 9: read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; } [[fallthrough]]; case 11: m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; [[fallthrough]]; case 13: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_Y + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; do_sbc16(m_VAL); prefetch_start(); [[fallthrough]]; case 15: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sbc_zpi_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP = read(dp_ptr(m_TMP2, 0)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_ptr(m_TMP2, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } do_sbc(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::sbc_zpi_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_TMP = read(dp_ptr(m_TMP2, 0)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_ptr(m_TMP2, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; do_sbc(m_VAL); prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sbc_w_zpi_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP = read(dp_ptr(m_TMP2, 0)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_ptr(m_TMP2, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } do_sbc16(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::sbc_w_zpi_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_TMP = read(dp_ptr(m_TMP2, 0)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_ptr(m_TMP2, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; do_sbc16(m_VAL); prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sbc_dsy_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_TMP = read(sr(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(sr(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } do_sbc(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::sbc_dsy_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; [[fallthrough]]; case 5: m_TMP = read(sr(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(sr(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; do_sbc(m_VAL); prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sbc_w_dsy_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_TMP = read(sr(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(sr(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_Y + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } do_sbc16(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_end(); } void w65816_device::sbc_w_dsy_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; [[fallthrough]]; case 5: m_TMP = read(sr(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(sr(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; [[fallthrough]]; case 13: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_Y + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; do_sbc16(m_VAL); prefetch_start(); [[fallthrough]]; case 15: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sbc_zpx_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = read(dp_idx(m_TMP2, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } do_sbc(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::sbc_zpx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = read(dp_idx(m_TMP2, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; do_sbc(m_VAL); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sbc_w_zpx_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = read(dp_idx(m_TMP2, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = set_h(m_VAL, read(dp_idx(m_TMP2 + 1, m_X))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } do_sbc16(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::sbc_w_zpx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = read(dp_idx(m_TMP2, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = set_h(m_VAL, read(dp_idx(m_TMP2 + 1, m_X))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; do_sbc16(m_VAL); prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sbc_ziy_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP3 = dp(m_TMP2); m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_TMPL = set_b(m_TMP, read(dp_lng(m_TMP3, 2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = read(lng_idx(m_TMPL, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } do_sbc(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::sbc_ziy_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } m_TMP3 = dp(m_TMP2); [[fallthrough]]; case 5: m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_TMPL = set_b(m_TMP, read(dp_lng(m_TMP3, 2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: m_VAL = read(lng_idx(m_TMPL, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; do_sbc(m_VAL); prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sbc_w_ziy_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP3 = dp(m_TMP2); m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_TMPL = set_b(m_TMP, read(dp_lng(m_TMP3, 2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = read(lng_idx(m_TMPL, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_VAL = set_h(m_VAL, read(lng_idx(m_TMPL, m_Y + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } do_sbc16(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_end(); } void w65816_device::sbc_w_ziy_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } m_TMP3 = dp(m_TMP2); [[fallthrough]]; case 5: m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_TMPL = set_b(m_TMP, read(dp_lng(m_TMP3, 2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: m_VAL = read(lng_idx(m_TMPL, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; [[fallthrough]]; case 13: m_VAL = set_h(m_VAL, read(lng_idx(m_TMPL, m_Y + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; do_sbc16(m_VAL); prefetch_start(); [[fallthrough]]; case 15: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sbc_aby_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; if(idx_extra_cycle(m_TMP, m_Y)) { read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } } m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } do_sbc(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::sbc_aby_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; if(idx_extra_cycle(m_TMP, m_Y)) { [[fallthrough]]; case 5: read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; } [[fallthrough]]; case 7: m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; do_sbc(m_VAL); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sbc_w_aby_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; if(idx_extra_cycle(m_TMP, m_Y)) { read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } } m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_Y + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } do_sbc16(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::sbc_w_aby_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; if(idx_extra_cycle(m_TMP, m_Y)) { [[fallthrough]]; case 5: read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; } [[fallthrough]]; case 7: m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_Y + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; do_sbc16(m_VAL); prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sbc_abx_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; if(idx_extra_cycle(m_TMP, m_X)) { read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } } m_VAL = read(ab_idx(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } do_sbc(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::sbc_abx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; if(idx_extra_cycle(m_TMP, m_X)) { [[fallthrough]]; case 5: read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; } [[fallthrough]]; case 7: m_VAL = read(ab_idx(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; do_sbc(m_VAL); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sbc_w_abx_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; if(idx_extra_cycle(m_TMP, m_X)) { read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } } m_VAL = read(ab_idx(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_X + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } do_sbc16(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::sbc_w_abx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; if(idx_extra_cycle(m_TMP, m_X)) { [[fallthrough]]; case 5: read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; } [[fallthrough]]; case 7: m_VAL = read(ab_idx(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_X + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; do_sbc16(m_VAL); prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sbc_alx_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_TMPL = set_b(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_PC++; m_VAL = read(lng_idx(m_TMPL, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } do_sbc(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::sbc_alx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_TMPL = set_b(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_PC++; [[fallthrough]]; case 7: m_VAL = read(lng_idx(m_TMPL, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; do_sbc(m_VAL); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sbc_w_alx_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_TMPL = set_b(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_PC++; m_VAL = read(lng_idx(m_TMPL, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = set_h(m_VAL, read(lng_idx(m_TMPL, m_X + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } do_sbc16(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::sbc_w_alx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_TMPL = set_b(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_PC++; [[fallthrough]]; case 7: m_VAL = read(lng_idx(m_TMPL, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = set_h(m_VAL, read(lng_idx(m_TMPL, m_X + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; do_sbc16(m_VAL); prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::cmp_idx_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP3 = dp_idx(m_TMP2, m_X); m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } do_cmp(m_A, m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::cmp_idx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_TMP3 = dp_idx(m_TMP2, m_X); [[fallthrough]]; case 7: m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; do_cmp(m_A, m_VAL); prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::cmp_w_idx_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP3 = dp_idx(m_TMP2, m_X); m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } do_cmp16(m_A, m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_end(); } void w65816_device::cmp_w_idx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_TMP3 = dp_idx(m_TMP2, m_X); [[fallthrough]]; case 7: m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; [[fallthrough]]; case 13: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; do_cmp16(m_A, m_VAL); prefetch_start(); [[fallthrough]]; case 15: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::cmp_ds_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_VAL = read(sr(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } do_cmp(m_A, m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_end(); } void w65816_device::cmp_ds_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; [[fallthrough]]; case 5: m_VAL = read(sr(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; do_cmp(m_A, m_VAL); prefetch_start(); [[fallthrough]]; case 7: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::cmp_w_ds_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_VAL = read(sr(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = set_h(m_VAL, read(sr(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } do_cmp16(m_A, m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::cmp_w_ds_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; [[fallthrough]]; case 5: m_VAL = read(sr(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = set_h(m_VAL, read(sr(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; do_cmp16(m_A, m_VAL); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::cmp_zpg_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } do_cmp(m_A, m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_end(); } void w65816_device::cmp_zpg_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; do_cmp(m_A, m_VAL); prefetch_start(); [[fallthrough]]; case 7: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::cmp_w_zpg_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = set_h(m_VAL, read(dp(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } do_cmp16(m_A, m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::cmp_w_zpg_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = set_h(m_VAL, read(dp(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; do_cmp16(m_A, m_VAL); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::cmp_zil_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP3 = dp(m_TMP2); m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_TMPL = set_b(m_TMP, read(dp_lng(m_TMP3, 2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = read(lng(m_TMPL)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } do_cmp(m_A, m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::cmp_zil_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } m_TMP3 = dp(m_TMP2); [[fallthrough]]; case 5: m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_TMPL = set_b(m_TMP, read(dp_lng(m_TMP3, 2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: m_VAL = read(lng(m_TMPL)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; do_cmp(m_A, m_VAL); prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::cmp_w_zil_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP3 = dp(m_TMP2); m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_TMPL = set_b(m_TMP, read(dp_lng(m_TMP3, 2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = read(lng(m_TMPL)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_VAL = set_h(m_VAL, read(lng_idx(m_TMPL, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } do_cmp16(m_A, m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_end(); } void w65816_device::cmp_w_zil_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } m_TMP3 = dp(m_TMP2); [[fallthrough]]; case 5: m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_TMPL = set_b(m_TMP, read(dp_lng(m_TMP3, 2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: m_VAL = read(lng(m_TMPL)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; [[fallthrough]]; case 13: m_VAL = set_h(m_VAL, read(lng_idx(m_TMPL, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; do_cmp16(m_A, m_VAL); prefetch_start(); [[fallthrough]]; case 15: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::cmp_imm_full() { m_VAL = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; do_cmp(m_A, m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } prefetch_end(); } void w65816_device::cmp_imm_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_VAL = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; do_cmp(m_A, m_VAL); prefetch_start(); [[fallthrough]]; case 3: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::cmp_w_imm16_full() { m_VAL = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_VAL = set_h(m_VAL, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; do_cmp16(m_A, m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } prefetch_end(); } void w65816_device::cmp_w_imm16_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_VAL = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_VAL = set_h(m_VAL, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; do_cmp16(m_A, m_VAL); prefetch_start(); [[fallthrough]]; case 5: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::cmp_aba_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } do_cmp(m_A, m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_end(); } void w65816_device::cmp_aba_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; do_cmp(m_A, m_VAL); prefetch_start(); [[fallthrough]]; case 7: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::cmp_w_aba_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } do_cmp16(m_A, m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::cmp_w_aba_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; do_cmp16(m_A, m_VAL); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::cmp_abl_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_TMPL = set_b(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_PC++; m_VAL = read(lng(m_TMPL)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } do_cmp(m_A, m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::cmp_abl_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_TMPL = set_b(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_PC++; [[fallthrough]]; case 7: m_VAL = read(lng(m_TMPL)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; do_cmp(m_A, m_VAL); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::cmp_w_abl_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_TMPL = set_b(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_PC++; m_VAL = read(lng(m_TMPL)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = set_h(m_VAL, read(lng_idx(m_TMPL, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } do_cmp16(m_A, m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::cmp_w_abl_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_TMPL = set_b(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_PC++; [[fallthrough]]; case 7: m_VAL = read(lng(m_TMPL)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = set_h(m_VAL, read(lng_idx(m_TMPL, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; do_cmp16(m_A, m_VAL); prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::cmp_idy_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP = read(dp_ptr(m_TMP2, 0)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_ptr(m_TMP2, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } if(idx_extra_cycle(m_TMP, m_Y)) { read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } } m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } do_cmp(m_A, m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::cmp_idy_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_TMP = read(dp_ptr(m_TMP2, 0)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_ptr(m_TMP2, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; if(idx_extra_cycle(m_TMP, m_Y)) { [[fallthrough]]; case 9: read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; } [[fallthrough]]; case 11: m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; do_cmp(m_A, m_VAL); prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::cmp_w_idy_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP = read(dp_ptr(m_TMP2, 0)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_ptr(m_TMP2, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } if(idx_extra_cycle(m_TMP, m_Y)) { read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } } m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_Y + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } do_cmp16(m_A, m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_end(); } void w65816_device::cmp_w_idy_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_TMP = read(dp_ptr(m_TMP2, 0)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_ptr(m_TMP2, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; if(idx_extra_cycle(m_TMP, m_Y)) { [[fallthrough]]; case 9: read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; } [[fallthrough]]; case 11: m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; [[fallthrough]]; case 13: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_Y + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; do_cmp16(m_A, m_VAL); prefetch_start(); [[fallthrough]]; case 15: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::cmp_zpi_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP = read(dp_ptr(m_TMP2, 0)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_ptr(m_TMP2, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } do_cmp(m_A, m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::cmp_zpi_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_TMP = read(dp_ptr(m_TMP2, 0)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_ptr(m_TMP2, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; do_cmp(m_A, m_VAL); prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::cmp_w_zpi_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP = read(dp_ptr(m_TMP2, 0)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_ptr(m_TMP2, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } do_cmp16(m_A, m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::cmp_w_zpi_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_TMP = read(dp_ptr(m_TMP2, 0)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_ptr(m_TMP2, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; do_cmp16(m_A, m_VAL); prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::cmp_dsy_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_TMP = read(sr(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(sr(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } do_cmp(m_A, m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::cmp_dsy_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; [[fallthrough]]; case 5: m_TMP = read(sr(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(sr(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; do_cmp(m_A, m_VAL); prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::cmp_w_dsy_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_TMP = read(sr(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(sr(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_Y + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } do_cmp16(m_A, m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_end(); } void w65816_device::cmp_w_dsy_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; [[fallthrough]]; case 5: m_TMP = read(sr(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(sr(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; [[fallthrough]]; case 13: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_Y + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; do_cmp16(m_A, m_VAL); prefetch_start(); [[fallthrough]]; case 15: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::cmp_zpx_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = read(dp_idx(m_TMP2, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } do_cmp(m_A, m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::cmp_zpx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = read(dp_idx(m_TMP2, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; do_cmp(m_A, m_VAL); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::cmp_w_zpx_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = read(dp_idx(m_TMP2, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = set_h(m_VAL, read(dp_idx(m_TMP2 + 1, m_X))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } do_cmp16(m_A, m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::cmp_w_zpx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = read(dp_idx(m_TMP2, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = set_h(m_VAL, read(dp_idx(m_TMP2 + 1, m_X))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; do_cmp16(m_A, m_VAL); prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::cmp_ziy_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP3 = dp(m_TMP2); m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_TMPL = set_b(m_TMP, read(dp_lng(m_TMP3, 2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = read(lng_idx(m_TMPL, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } do_cmp(m_A, m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::cmp_ziy_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } m_TMP3 = dp(m_TMP2); [[fallthrough]]; case 5: m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_TMPL = set_b(m_TMP, read(dp_lng(m_TMP3, 2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: m_VAL = read(lng_idx(m_TMPL, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; do_cmp(m_A, m_VAL); prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::cmp_w_ziy_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP3 = dp(m_TMP2); m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_TMPL = set_b(m_TMP, read(dp_lng(m_TMP3, 2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = read(lng_idx(m_TMPL, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_VAL = set_h(m_VAL, read(lng_idx(m_TMPL, m_Y + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } do_cmp16(m_A, m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_end(); } void w65816_device::cmp_w_ziy_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } m_TMP3 = dp(m_TMP2); [[fallthrough]]; case 5: m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_TMPL = set_b(m_TMP, read(dp_lng(m_TMP3, 2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: m_VAL = read(lng_idx(m_TMPL, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; [[fallthrough]]; case 13: m_VAL = set_h(m_VAL, read(lng_idx(m_TMPL, m_Y + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; do_cmp16(m_A, m_VAL); prefetch_start(); [[fallthrough]]; case 15: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::cmp_aby_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; if(idx_extra_cycle(m_TMP, m_Y)) { read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } } m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } do_cmp(m_A, m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::cmp_aby_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; if(idx_extra_cycle(m_TMP, m_Y)) { [[fallthrough]]; case 5: read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; } [[fallthrough]]; case 7: m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; do_cmp(m_A, m_VAL); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::cmp_w_aby_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; if(idx_extra_cycle(m_TMP, m_Y)) { read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } } m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_Y + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } do_cmp16(m_A, m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::cmp_w_aby_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; if(idx_extra_cycle(m_TMP, m_Y)) { [[fallthrough]]; case 5: read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; } [[fallthrough]]; case 7: m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_Y + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; do_cmp16(m_A, m_VAL); prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::cmp_abx_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; if(idx_extra_cycle(m_TMP, m_X)) { read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } } m_VAL = read(ab_idx(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } do_cmp(m_A, m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::cmp_abx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; if(idx_extra_cycle(m_TMP, m_X)) { [[fallthrough]]; case 5: read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; } [[fallthrough]]; case 7: m_VAL = read(ab_idx(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; do_cmp(m_A, m_VAL); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::cmp_w_abx_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; if(idx_extra_cycle(m_TMP, m_X)) { read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } } m_VAL = read(ab_idx(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_X + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } do_cmp16(m_A, m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::cmp_w_abx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; if(idx_extra_cycle(m_TMP, m_X)) { [[fallthrough]]; case 5: read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; } [[fallthrough]]; case 7: m_VAL = read(ab_idx(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_X + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; do_cmp16(m_A, m_VAL); prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::cmp_alx_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_TMPL = set_b(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_PC++; m_VAL = read(lng_idx(m_TMPL, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } do_cmp(m_A, m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::cmp_alx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_TMPL = set_b(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_PC++; [[fallthrough]]; case 7: m_VAL = read(lng_idx(m_TMPL, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; do_cmp(m_A, m_VAL); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::cmp_w_alx_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_TMPL = set_b(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_PC++; m_VAL = read(lng_idx(m_TMPL, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = set_h(m_VAL, read(lng_idx(m_TMPL, m_X + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } do_cmp16(m_A, m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::cmp_w_alx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_TMPL = set_b(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_PC++; [[fallthrough]]; case 7: m_VAL = read(lng_idx(m_TMPL, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = set_h(m_VAL, read(lng_idx(m_TMPL, m_X + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; do_cmp16(m_A, m_VAL); prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::lda_idx_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP3 = dp_idx(m_TMP2, m_X); m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_A = set_l(m_A, m_VAL); set_nz(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::lda_idx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_TMP3 = dp_idx(m_TMP2, m_X); [[fallthrough]]; case 7: m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; m_A = set_l(m_A, m_VAL); set_nz(m_A); prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::lda_w_idx_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP3 = dp_idx(m_TMP2, m_X); m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } m_A = m_VAL; set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_end(); } void w65816_device::lda_w_idx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_TMP3 = dp_idx(m_TMP2, m_X); [[fallthrough]]; case 7: m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; [[fallthrough]]; case 13: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; m_A = m_VAL; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 15: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::lda_ds_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_VAL = read(sr(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_A = set_l(m_A, m_VAL); set_nz(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_end(); } void w65816_device::lda_ds_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; [[fallthrough]]; case 5: m_VAL = read(sr(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_A = set_l(m_A, m_VAL); set_nz(m_A); prefetch_start(); [[fallthrough]]; case 7: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::lda_w_ds_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_VAL = read(sr(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = set_h(m_VAL, read(sr(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_A = m_VAL; set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::lda_w_ds_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; [[fallthrough]]; case 5: m_VAL = read(sr(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = set_h(m_VAL, read(sr(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; m_A = m_VAL; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::lda_zpg_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_A = set_l(m_A, m_VAL); set_nz(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_end(); } void w65816_device::lda_zpg_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_A = set_l(m_A, m_VAL); set_nz(m_A); prefetch_start(); [[fallthrough]]; case 7: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::lda_w_zpg_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = set_h(m_VAL, read(dp(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_A = m_VAL; set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::lda_w_zpg_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = set_h(m_VAL, read(dp(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; m_A = m_VAL; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::lda_zil_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP3 = dp(m_TMP2); m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_TMPL = set_b(m_TMP, read(dp_lng(m_TMP3, 2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = read(lng(m_TMPL)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_A = set_l(m_A, m_VAL); set_nz(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::lda_zil_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } m_TMP3 = dp(m_TMP2); [[fallthrough]]; case 5: m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_TMPL = set_b(m_TMP, read(dp_lng(m_TMP3, 2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: m_VAL = read(lng(m_TMPL)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; m_A = set_l(m_A, m_VAL); set_nz(m_A); prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::lda_w_zil_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP3 = dp(m_TMP2); m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_TMPL = set_b(m_TMP, read(dp_lng(m_TMP3, 2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = read(lng(m_TMPL)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_VAL = set_h(m_VAL, read(lng_idx(m_TMPL, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } m_A = m_VAL; set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_end(); } void w65816_device::lda_w_zil_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } m_TMP3 = dp(m_TMP2); [[fallthrough]]; case 5: m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_TMPL = set_b(m_TMP, read(dp_lng(m_TMP3, 2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: m_VAL = read(lng(m_TMPL)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; [[fallthrough]]; case 13: m_VAL = set_h(m_VAL, read(lng_idx(m_TMPL, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; m_A = m_VAL; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 15: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::lda_imm_full() { m_VAL = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_A = set_l(m_A, m_VAL); set_nz(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } prefetch_end(); } void w65816_device::lda_imm_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_VAL = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; m_A = set_l(m_A, m_VAL); set_nz(m_A); prefetch_start(); [[fallthrough]]; case 3: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::lda_w_imm16_full() { m_VAL = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_VAL = set_h(m_VAL, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_A = m_VAL; set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } prefetch_end(); } void w65816_device::lda_w_imm16_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_VAL = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_VAL = set_h(m_VAL, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; m_A = m_VAL; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 5: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::lda_aba_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_A = set_l(m_A, m_VAL); set_nz(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_end(); } void w65816_device::lda_aba_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_A = set_l(m_A, m_VAL); set_nz(m_A); prefetch_start(); [[fallthrough]]; case 7: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::lda_w_aba_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_A = m_VAL; set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::lda_w_aba_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; m_A = m_VAL; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::lda_abl_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_TMPL = set_b(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_PC++; m_VAL = read(lng(m_TMPL)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_A = set_l(m_A, m_VAL); set_nz(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::lda_abl_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_TMPL = set_b(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_PC++; [[fallthrough]]; case 7: m_VAL = read(lng(m_TMPL)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; m_A = set_l(m_A, m_VAL); set_nz(m_A); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::lda_w_abl_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_TMPL = set_b(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_PC++; m_VAL = read(lng(m_TMPL)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = set_h(m_VAL, read(lng_idx(m_TMPL, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_A = m_VAL; set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::lda_w_abl_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_TMPL = set_b(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_PC++; [[fallthrough]]; case 7: m_VAL = read(lng(m_TMPL)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = set_h(m_VAL, read(lng_idx(m_TMPL, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; m_A = m_VAL; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::lda_idy_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP = read(dp_ptr(m_TMP2, 0)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_ptr(m_TMP2, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } if(idx_extra_cycle(m_TMP, m_Y)) { read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } } m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_A = set_l(m_A, m_VAL); set_nz(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::lda_idy_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_TMP = read(dp_ptr(m_TMP2, 0)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_ptr(m_TMP2, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; if(idx_extra_cycle(m_TMP, m_Y)) { [[fallthrough]]; case 9: read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; } [[fallthrough]]; case 11: m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; m_A = set_l(m_A, m_VAL); set_nz(m_A); prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::lda_w_idy_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP = read(dp_ptr(m_TMP2, 0)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_ptr(m_TMP2, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } if(idx_extra_cycle(m_TMP, m_Y)) { read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } } m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_Y + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } m_A = m_VAL; set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_end(); } void w65816_device::lda_w_idy_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_TMP = read(dp_ptr(m_TMP2, 0)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_ptr(m_TMP2, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; if(idx_extra_cycle(m_TMP, m_Y)) { [[fallthrough]]; case 9: read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; } [[fallthrough]]; case 11: m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; [[fallthrough]]; case 13: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_Y + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; m_A = m_VAL; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 15: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::lda_zpi_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP = read(dp_ptr(m_TMP2, 0)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_ptr(m_TMP2, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_A = set_l(m_A, m_VAL); set_nz(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::lda_zpi_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_TMP = read(dp_ptr(m_TMP2, 0)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_ptr(m_TMP2, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; m_A = set_l(m_A, m_VAL); set_nz(m_A); prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::lda_w_zpi_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP = read(dp_ptr(m_TMP2, 0)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_ptr(m_TMP2, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_A = m_VAL; set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::lda_w_zpi_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_TMP = read(dp_ptr(m_TMP2, 0)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_ptr(m_TMP2, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; m_A = m_VAL; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::lda_dsy_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_TMP = read(sr(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(sr(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_A = set_l(m_A, m_VAL); set_nz(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::lda_dsy_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; [[fallthrough]]; case 5: m_TMP = read(sr(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(sr(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; m_A = set_l(m_A, m_VAL); set_nz(m_A); prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::lda_w_dsy_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_TMP = read(sr(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(sr(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_Y + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } m_A = m_VAL; set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_end(); } void w65816_device::lda_w_dsy_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; [[fallthrough]]; case 5: m_TMP = read(sr(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(sr(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; [[fallthrough]]; case 13: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_Y + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; m_A = m_VAL; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 15: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::lda_zpx_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = read(dp_idx(m_TMP2, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_A = set_l(m_A, m_VAL); set_nz(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::lda_zpx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = read(dp_idx(m_TMP2, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; m_A = set_l(m_A, m_VAL); set_nz(m_A); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::lda_w_zpx_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = read(dp_idx(m_TMP2, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = set_h(m_VAL, read(dp_idx(m_TMP2 + 1, m_X))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_A = m_VAL; set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::lda_w_zpx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = read(dp_idx(m_TMP2, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = set_h(m_VAL, read(dp_idx(m_TMP2 + 1, m_X))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; m_A = m_VAL; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::lda_ziy_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP3 = dp(m_TMP2); m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_TMPL = set_b(m_TMP, read(dp_lng(m_TMP3, 2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = read(lng_idx(m_TMPL, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_A = set_l(m_A, m_VAL); set_nz(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::lda_ziy_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } m_TMP3 = dp(m_TMP2); [[fallthrough]]; case 5: m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_TMPL = set_b(m_TMP, read(dp_lng(m_TMP3, 2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: m_VAL = read(lng_idx(m_TMPL, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; m_A = set_l(m_A, m_VAL); set_nz(m_A); prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::lda_w_ziy_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP3 = dp(m_TMP2); m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_TMPL = set_b(m_TMP, read(dp_lng(m_TMP3, 2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = read(lng_idx(m_TMPL, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_VAL = set_h(m_VAL, read(lng_idx(m_TMPL, m_Y + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } m_A = m_VAL; set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_end(); } void w65816_device::lda_w_ziy_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } m_TMP3 = dp(m_TMP2); [[fallthrough]]; case 5: m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_TMPL = set_b(m_TMP, read(dp_lng(m_TMP3, 2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: m_VAL = read(lng_idx(m_TMPL, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; [[fallthrough]]; case 13: m_VAL = set_h(m_VAL, read(lng_idx(m_TMPL, m_Y + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; m_A = m_VAL; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 15: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::lda_aby_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; if(idx_extra_cycle(m_TMP, m_Y)) { read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } } m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_A = set_l(m_A, m_VAL); set_nz(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::lda_aby_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; if(idx_extra_cycle(m_TMP, m_Y)) { [[fallthrough]]; case 5: read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; } [[fallthrough]]; case 7: m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; m_A = set_l(m_A, m_VAL); set_nz(m_A); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::lda_w_aby_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; if(idx_extra_cycle(m_TMP, m_Y)) { read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } } m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_Y + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_A = m_VAL; set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::lda_w_aby_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; if(idx_extra_cycle(m_TMP, m_Y)) { [[fallthrough]]; case 5: read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; } [[fallthrough]]; case 7: m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_Y + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; m_A = m_VAL; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::lda_abx_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; if(idx_extra_cycle(m_TMP, m_X)) { read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } } m_VAL = read(ab_idx(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_A = set_l(m_A, m_VAL); set_nz(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::lda_abx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; if(idx_extra_cycle(m_TMP, m_X)) { [[fallthrough]]; case 5: read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; } [[fallthrough]]; case 7: m_VAL = read(ab_idx(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; m_A = set_l(m_A, m_VAL); set_nz(m_A); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::lda_w_abx_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; if(idx_extra_cycle(m_TMP, m_X)) { read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } } m_VAL = read(ab_idx(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_X + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_A = m_VAL; set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::lda_w_abx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; if(idx_extra_cycle(m_TMP, m_X)) { [[fallthrough]]; case 5: read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; } [[fallthrough]]; case 7: m_VAL = read(ab_idx(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_X + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; m_A = m_VAL; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::lda_alx_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_TMPL = set_b(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_PC++; m_VAL = read(lng_idx(m_TMPL, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_A = set_l(m_A, m_VAL); set_nz(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::lda_alx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_TMPL = set_b(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_PC++; [[fallthrough]]; case 7: m_VAL = read(lng_idx(m_TMPL, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; m_A = set_l(m_A, m_VAL); set_nz(m_A); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::lda_w_alx_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_TMPL = set_b(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_PC++; m_VAL = read(lng_idx(m_TMPL, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = set_h(m_VAL, read(lng_idx(m_TMPL, m_X + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_A = m_VAL; set_nz16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::lda_w_alx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_TMPL = set_b(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_PC++; [[fallthrough]]; case 7: m_VAL = read(lng_idx(m_TMPL, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = set_h(m_VAL, read(lng_idx(m_TMPL, m_X + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; m_A = m_VAL; set_nz16(m_A); prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sta_idx_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP3 = dp_idx(m_TMP2, m_X); m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } write(ab(m_TMP), m_A); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::sta_idx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_TMP3 = dp_idx(m_TMP2, m_X); [[fallthrough]]; case 7: m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: write(ab(m_TMP), m_A); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sta_w_idx_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP3 = dp_idx(m_TMP2, m_X); m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } write(ab(m_TMP), m_A); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } write(ab_idx(m_TMP, 1), m_A >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_end(); } void w65816_device::sta_w_idx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_TMP3 = dp_idx(m_TMP2, m_X); [[fallthrough]]; case 7: m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: write(ab(m_TMP), m_A); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; [[fallthrough]]; case 13: write(ab_idx(m_TMP, 1), m_A >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_start(); [[fallthrough]]; case 15: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sta_ds_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } write(sr(m_TMP2), m_A); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_end(); } void w65816_device::sta_ds_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; [[fallthrough]]; case 5: write(sr(m_TMP2), m_A); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; prefetch_start(); [[fallthrough]]; case 7: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sta_w_ds_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } write(sr(m_TMP2), m_A); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } write(sr(m_TMP2 + 1), m_A >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::sta_w_ds_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; [[fallthrough]]; case 5: write(sr(m_TMP2), m_A); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: write(sr(m_TMP2 + 1), m_A >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sta_zpg_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } write(dp(m_TMP2), m_A); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_end(); } void w65816_device::sta_zpg_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: write(dp(m_TMP2), m_A); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; prefetch_start(); [[fallthrough]]; case 7: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sta_w_zpg_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } write(dp(m_TMP2), m_A); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } write(dp(m_TMP2 + 1), m_A >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::sta_w_zpg_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: write(dp(m_TMP2), m_A); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: write(dp(m_TMP2 + 1), m_A >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sta_zil_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP3 = dp(m_TMP2); m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_TMPL = set_b(m_TMP, read(dp_lng(m_TMP3, 2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } write(lng(m_TMPL), m_A); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::sta_zil_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } m_TMP3 = dp(m_TMP2); [[fallthrough]]; case 5: m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_TMPL = set_b(m_TMP, read(dp_lng(m_TMP3, 2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: write(lng(m_TMPL), m_A); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sta_w_zil_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP3 = dp(m_TMP2); m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_TMPL = set_b(m_TMP, read(dp_lng(m_TMP3, 2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } write(lng(m_TMPL), m_A); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } write(lng_idx(m_TMPL, 1), m_A >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_end(); } void w65816_device::sta_w_zil_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } m_TMP3 = dp(m_TMP2); [[fallthrough]]; case 5: m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_TMPL = set_b(m_TMP, read(dp_lng(m_TMP3, 2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: write(lng(m_TMPL), m_A); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; [[fallthrough]]; case 13: write(lng_idx(m_TMPL, 1), m_A >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_start(); [[fallthrough]]; case 15: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sta_aba_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; write(ab(m_TMP), m_A); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_end(); } void w65816_device::sta_aba_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: write(ab(m_TMP), m_A); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; prefetch_start(); [[fallthrough]]; case 7: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sta_w_aba_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; write(ab(m_TMP), m_A); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } write(ab_idx(m_TMP, 1), m_A >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::sta_w_aba_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: write(ab(m_TMP), m_A); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: write(ab_idx(m_TMP, 1), m_A >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sta_abl_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_TMPL = set_b(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_PC++; write(lng(m_TMPL), m_A); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::sta_abl_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_TMPL = set_b(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_PC++; [[fallthrough]]; case 7: write(lng(m_TMPL), m_A); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sta_w_abl_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_TMPL = set_b(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_PC++; write(lng(m_TMPL), m_A); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } write(lng_idx(m_TMPL, 1), m_A >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::sta_w_abl_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_TMPL = set_b(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_PC++; [[fallthrough]]; case 7: write(lng(m_TMPL), m_A); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: write(lng_idx(m_TMPL, 1), m_A >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sta_idy_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP = read(dp_ptr(m_TMP2, 0)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_ptr(m_TMP2, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } write(ab_idx(m_TMP, m_Y), m_A); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::sta_idy_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_TMP = read(dp_ptr(m_TMP2, 0)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_ptr(m_TMP2, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: write(ab_idx(m_TMP, m_Y), m_A); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sta_w_idy_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP = read(dp_ptr(m_TMP2, 0)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_ptr(m_TMP2, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } write(ab_idx(m_TMP, m_Y), m_A); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } write(ab_idx(m_TMP, m_Y + 1), m_A >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_end(); } void w65816_device::sta_w_idy_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_TMP = read(dp_ptr(m_TMP2, 0)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_ptr(m_TMP2, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: write(ab_idx(m_TMP, m_Y), m_A); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; [[fallthrough]]; case 13: write(ab_idx(m_TMP, m_Y + 1), m_A >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_start(); [[fallthrough]]; case 15: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sta_zpi_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP = read(dp_ptr(m_TMP2, 0)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_ptr(m_TMP2, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } write(ab(m_TMP), m_A); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::sta_zpi_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_TMP = read(dp_ptr(m_TMP2, 0)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_ptr(m_TMP2, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: write(ab(m_TMP), m_A); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sta_w_zpi_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP = read(dp_ptr(m_TMP2, 0)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_ptr(m_TMP2, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } write(ab(m_TMP), m_A); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } write(ab_idx(m_TMP, 1), m_A >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::sta_w_zpi_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_TMP = read(dp_ptr(m_TMP2, 0)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_ptr(m_TMP2, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: write(ab(m_TMP), m_A); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: write(ab_idx(m_TMP, 1), m_A >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sta_dsy_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_TMP = read(sr(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(sr(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } write(ab_idx(m_TMP, m_Y), m_A); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::sta_dsy_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; [[fallthrough]]; case 5: m_TMP = read(sr(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(sr(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: write(ab_idx(m_TMP, m_Y), m_A); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sta_w_dsy_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_TMP = read(sr(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(sr(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } write(ab_idx(m_TMP, m_Y), m_A); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } write(ab_idx(m_TMP, m_Y + 1), m_A >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_end(); } void w65816_device::sta_w_dsy_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; [[fallthrough]]; case 5: m_TMP = read(sr(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(sr(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: write(ab_idx(m_TMP, m_Y), m_A); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; [[fallthrough]]; case 13: write(ab_idx(m_TMP, m_Y + 1), m_A >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_start(); [[fallthrough]]; case 15: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sta_zpx_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } write(dp_idx(m_TMP2, m_X), m_A); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::sta_zpx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: write(dp_idx(m_TMP2, m_X), m_A); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sta_w_zpx_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } write(dp_idx(m_TMP2, m_X), m_A); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } write(dp_idx(m_TMP2 + 1, m_X), m_A >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::sta_w_zpx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: write(dp_idx(m_TMP2, m_X), m_A); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: write(dp_idx(m_TMP2 + 1, m_X), m_A >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sta_ziy_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP3 = dp(m_TMP2); m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_TMPL = set_b(m_TMP, read(dp_lng(m_TMP3, 2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } write(lng_idx(m_TMPL, m_Y), m_A); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::sta_ziy_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } m_TMP3 = dp(m_TMP2); [[fallthrough]]; case 5: m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_TMPL = set_b(m_TMP, read(dp_lng(m_TMP3, 2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: write(lng_idx(m_TMPL, m_Y), m_A); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sta_w_ziy_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_TMP3 = dp(m_TMP2); m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_TMPL = set_b(m_TMP, read(dp_lng(m_TMP3, 2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } write(lng_idx(m_TMPL, m_Y), m_A); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } write(lng_idx(m_TMPL, m_Y + 1), m_A >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_end(); } void w65816_device::sta_w_ziy_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } m_TMP3 = dp(m_TMP2); [[fallthrough]]; case 5: m_TMP = read(m_TMP3); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_TMP = set_h(m_TMP, read(dp_lng(m_TMP3, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_TMPL = set_b(m_TMP, read(dp_lng(m_TMP3, 2))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: write(lng_idx(m_TMPL, m_Y), m_A); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; [[fallthrough]]; case 13: write(lng_idx(m_TMPL, m_Y + 1), m_A >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_start(); [[fallthrough]]; case 15: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sta_aby_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } write(ab_idx(m_TMP, m_Y), m_A); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::sta_aby_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: write(ab_idx(m_TMP, m_Y), m_A); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sta_w_aby_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } write(ab_idx(m_TMP, m_Y), m_A); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } write(ab_idx(m_TMP, m_Y + 1), m_A >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::sta_w_aby_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: write(ab_idx(m_TMP, m_Y), m_A); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: write(ab_idx(m_TMP, m_Y + 1), m_A >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sta_abx_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } write(ab_idx(m_TMP, m_X), m_A); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::sta_abx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: write(ab_idx(m_TMP, m_X), m_A); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sta_w_abx_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } write(ab_idx(m_TMP, m_X), m_A); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } write(ab_idx(m_TMP, m_X + 1), m_A >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::sta_w_abx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: write(ab_idx(m_TMP, m_X), m_A); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: write(ab_idx(m_TMP, m_X + 1), m_A >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sta_alx_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_TMPL = set_b(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_PC++; write(lng_idx(m_TMPL, m_X), m_A); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::sta_alx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_TMPL = set_b(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_PC++; [[fallthrough]]; case 7: write(lng_idx(m_TMPL, m_X), m_A); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sta_w_alx_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_TMPL = set_b(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_PC++; write(lng_idx(m_TMPL, m_X), m_A); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } write(lng_idx(m_TMPL, m_X + 1), m_A >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::sta_w_alx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_TMPL = set_b(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_PC++; [[fallthrough]]; case 7: write(lng_idx(m_TMPL, m_X), m_A); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: write(lng_idx(m_TMPL, m_X + 1), m_A >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::bit_zpg_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } do_bit(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_end(); } void w65816_device::bit_zpg_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; do_bit(m_VAL); prefetch_start(); [[fallthrough]]; case 7: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::bit_w_zpg_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = set_h(m_VAL, read(dp(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } do_bit16(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::bit_w_zpg_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = set_h(m_VAL, read(dp(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; do_bit16(m_VAL); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::bit_zpx_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = read(dp_idx(m_TMP2, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } do_bit(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::bit_zpx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = read(dp_idx(m_TMP2, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; do_bit(m_VAL); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::bit_w_zpx_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = read(dp_idx(m_TMP2, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = set_h(m_VAL, read(dp_idx(m_TMP2 + 1, m_X))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } do_bit16(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::bit_w_zpx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = read(dp_idx(m_TMP2, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = set_h(m_VAL, read(dp_idx(m_TMP2 + 1, m_X))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; do_bit16(m_VAL); prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::bit_aba_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } do_bit(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_end(); } void w65816_device::bit_aba_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; do_bit(m_VAL); prefetch_start(); [[fallthrough]]; case 7: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::bit_w_aba_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } do_bit16(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::bit_w_aba_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; do_bit16(m_VAL); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::bit_abx_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; if(idx_extra_cycle(m_TMP, m_X)) { read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } } m_VAL = read(ab_idx(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } do_bit(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::bit_abx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; if(idx_extra_cycle(m_TMP, m_X)) { [[fallthrough]]; case 5: read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; } [[fallthrough]]; case 7: m_VAL = read(ab_idx(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; do_bit(m_VAL); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::bit_w_abx_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; if(idx_extra_cycle(m_TMP, m_X)) { read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } } m_VAL = read(ab_idx(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_X + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } do_bit16(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::bit_w_abx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; if(idx_extra_cycle(m_TMP, m_X)) { [[fallthrough]]; case 5: read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; } [[fallthrough]]; case 7: m_VAL = read(ab_idx(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_X + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; do_bit16(m_VAL); prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::bit_imm_full() { m_VAL = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; do_bit_imm(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } prefetch_end(); } void w65816_device::bit_imm_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_VAL = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; do_bit_imm(m_VAL); prefetch_start(); [[fallthrough]]; case 3: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::bit_w_imm16_full() { m_VAL = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_VAL = set_h(m_VAL, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; do_bit_imm16(m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } prefetch_end(); } void w65816_device::bit_w_imm16_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_VAL = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_VAL = set_h(m_VAL, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; do_bit_imm16(m_VAL); prefetch_start(); [[fallthrough]]; case 5: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::ldx_imm_full() { m_VAL = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_X = set_l(m_X, m_VAL); set_nz(m_X); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } prefetch_end(); } void w65816_device::ldx_imm_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_VAL = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; m_X = set_l(m_X, m_VAL); set_nz(m_X); prefetch_start(); [[fallthrough]]; case 3: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::ldx_w_imm16_full() { m_VAL = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_VAL = set_h(m_VAL, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_X = m_VAL; set_nz16(m_X); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } prefetch_end(); } void w65816_device::ldx_w_imm16_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_VAL = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_VAL = set_h(m_VAL, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; m_X = m_VAL; set_nz16(m_X); prefetch_start(); [[fallthrough]]; case 5: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::ldx_zpg_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_X = set_l(m_X, m_VAL); set_nz(m_X); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_end(); } void w65816_device::ldx_zpg_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_X = set_l(m_X, m_VAL); set_nz(m_X); prefetch_start(); [[fallthrough]]; case 7: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::ldx_w_zpg_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = set_h(m_VAL, read(dp(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_X = m_VAL; set_nz16(m_X); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::ldx_w_zpg_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = set_h(m_VAL, read(dp(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; m_X = m_VAL; set_nz16(m_X); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::ldx_zpy_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = read(dp_idx(m_TMP2, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_X = set_l(m_X, m_VAL); set_nz(m_X); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::ldx_zpy_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = read(dp_idx(m_TMP2, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; m_X = set_l(m_X, m_VAL); set_nz(m_X); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::ldx_w_zpy_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = read(dp_idx(m_TMP2, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = set_h(m_VAL, read(dp_idx(m_TMP2 + 1, m_Y))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_X = m_VAL; set_nz16(m_X); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::ldx_w_zpy_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = read(dp_idx(m_TMP2, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = set_h(m_VAL, read(dp_idx(m_TMP2 + 1, m_Y))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; m_X = m_VAL; set_nz16(m_X); prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::ldx_aba_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_X = set_l(m_X, m_VAL); set_nz(m_X); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_end(); } void w65816_device::ldx_aba_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_X = set_l(m_X, m_VAL); set_nz(m_X); prefetch_start(); [[fallthrough]]; case 7: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::ldx_w_aba_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_X = m_VAL; set_nz16(m_X); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::ldx_w_aba_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; m_X = m_VAL; set_nz16(m_X); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::ldx_aby_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; if(idx_extra_cycle(m_TMP, m_Y)) { read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } } m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_X = set_l(m_X, m_VAL); set_nz(m_X); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::ldx_aby_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; if(idx_extra_cycle(m_TMP, m_Y)) { [[fallthrough]]; case 5: read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; } [[fallthrough]]; case 7: m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; m_X = set_l(m_X, m_VAL); set_nz(m_X); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::ldx_w_aby_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; if(idx_extra_cycle(m_TMP, m_Y)) { read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } } m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_Y + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_X = m_VAL; set_nz16(m_X); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::ldx_w_aby_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; if(idx_extra_cycle(m_TMP, m_Y)) { [[fallthrough]]; case 5: read(ab_idx_phantom(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; } [[fallthrough]]; case 7: m_VAL = read(ab_idx(m_TMP, m_Y)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_Y + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; m_X = m_VAL; set_nz16(m_X); prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::ldy_imm_full() { m_VAL = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_Y = set_l(m_Y, m_VAL); set_nz(m_Y); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } prefetch_end(); } void w65816_device::ldy_imm_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_VAL = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; m_Y = set_l(m_Y, m_VAL); set_nz(m_Y); prefetch_start(); [[fallthrough]]; case 3: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::ldy_w_imm16_full() { m_VAL = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_VAL = set_h(m_VAL, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_Y = m_VAL; set_nz16(m_Y); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } prefetch_end(); } void w65816_device::ldy_w_imm16_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_VAL = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_VAL = set_h(m_VAL, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; m_Y = m_VAL; set_nz16(m_Y); prefetch_start(); [[fallthrough]]; case 5: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::ldy_zpg_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_Y = set_l(m_Y, m_VAL); set_nz(m_Y); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_end(); } void w65816_device::ldy_zpg_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_Y = set_l(m_Y, m_VAL); set_nz(m_Y); prefetch_start(); [[fallthrough]]; case 7: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::ldy_w_zpg_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = set_h(m_VAL, read(dp(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_Y = m_VAL; set_nz16(m_Y); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::ldy_w_zpg_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = set_h(m_VAL, read(dp(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; m_Y = m_VAL; set_nz16(m_Y); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::ldy_zpx_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = read(dp_idx(m_TMP2, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_Y = set_l(m_Y, m_VAL); set_nz(m_Y); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::ldy_zpx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = read(dp_idx(m_TMP2, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; m_Y = set_l(m_Y, m_VAL); set_nz(m_Y); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::ldy_w_zpx_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = read(dp_idx(m_TMP2, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = set_h(m_VAL, read(dp_idx(m_TMP2 + 1, m_X))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_Y = m_VAL; set_nz16(m_Y); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::ldy_w_zpx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = read(dp_idx(m_TMP2, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = set_h(m_VAL, read(dp_idx(m_TMP2 + 1, m_X))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; m_Y = m_VAL; set_nz16(m_Y); prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::ldy_aba_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_Y = set_l(m_Y, m_VAL); set_nz(m_Y); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_end(); } void w65816_device::ldy_aba_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; m_Y = set_l(m_Y, m_VAL); set_nz(m_Y); prefetch_start(); [[fallthrough]]; case 7: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::ldy_w_aba_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_Y = m_VAL; set_nz16(m_Y); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::ldy_w_aba_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; m_Y = m_VAL; set_nz16(m_Y); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::ldy_abx_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; if(idx_extra_cycle(m_TMP, m_X)) { read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } } m_VAL = read(ab_idx(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_Y = set_l(m_Y, m_VAL); set_nz(m_Y); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::ldy_abx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; if(idx_extra_cycle(m_TMP, m_X)) { [[fallthrough]]; case 5: read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; } [[fallthrough]]; case 7: m_VAL = read(ab_idx(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; m_Y = set_l(m_Y, m_VAL); set_nz(m_Y); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::ldy_w_abx_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; if(idx_extra_cycle(m_TMP, m_X)) { read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } } m_VAL = read(ab_idx(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_X + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_Y = m_VAL; set_nz16(m_Y); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::ldy_w_abx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; if(idx_extra_cycle(m_TMP, m_X)) { [[fallthrough]]; case 5: read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; } [[fallthrough]]; case 7: m_VAL = read(ab_idx(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_X + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; m_Y = m_VAL; set_nz16(m_Y); prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::stx_zpg_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } write(dp(m_TMP2), m_X); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_end(); } void w65816_device::stx_zpg_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: write(dp(m_TMP2), m_X); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; prefetch_start(); [[fallthrough]]; case 7: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::stx_w_zpg_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } write(dp(m_TMP2), m_X); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } write(dp(m_TMP2 + 1), m_X >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::stx_w_zpg_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: write(dp(m_TMP2), m_X); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: write(dp(m_TMP2 + 1), m_X >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::stx_zpy_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } write(dp_idx(m_TMP2, m_Y), m_X); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::stx_zpy_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: write(dp_idx(m_TMP2, m_Y), m_X); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::stx_w_zpy_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } write(dp_idx(m_TMP2, m_Y), m_X); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } write(dp_idx(m_TMP2 + 1, m_Y), m_X >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::stx_w_zpy_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: write(dp_idx(m_TMP2, m_Y), m_X); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: write(dp_idx(m_TMP2 + 1, m_Y), m_X >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::stx_aba_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; write(ab(m_TMP), m_X); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_end(); } void w65816_device::stx_aba_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: write(ab(m_TMP), m_X); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; prefetch_start(); [[fallthrough]]; case 7: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::stx_w_aba_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; write(ab(m_TMP), m_X); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } write(ab_idx(m_TMP, 1), m_X >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::stx_w_aba_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: write(ab(m_TMP), m_X); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: write(ab_idx(m_TMP, 1), m_X >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sty_zpg_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } write(dp(m_TMP2), m_Y); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_end(); } void w65816_device::sty_zpg_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: write(dp(m_TMP2), m_Y); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; prefetch_start(); [[fallthrough]]; case 7: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sty_w_zpg_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } write(dp(m_TMP2), m_Y); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } write(dp(m_TMP2 + 1), m_Y >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::sty_w_zpg_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: write(dp(m_TMP2), m_Y); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: write(dp(m_TMP2 + 1), m_Y >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sty_zpx_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } write(dp_idx(m_TMP2, m_X), m_Y); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::sty_zpx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: write(dp_idx(m_TMP2, m_X), m_Y); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sty_w_zpx_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } write(dp_idx(m_TMP2, m_X), m_Y); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } write(dp_idx(m_TMP2 + 1, m_X), m_Y >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::sty_w_zpx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: write(dp_idx(m_TMP2, m_X), m_Y); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: write(dp_idx(m_TMP2 + 1, m_X), m_Y >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sty_aba_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; write(ab(m_TMP), m_Y); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_end(); } void w65816_device::sty_aba_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: write(ab(m_TMP), m_Y); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; prefetch_start(); [[fallthrough]]; case 7: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::sty_w_aba_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; write(ab(m_TMP), m_Y); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } write(ab_idx(m_TMP, 1), m_Y >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::sty_w_aba_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: write(ab(m_TMP), m_Y); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: write(ab_idx(m_TMP, 1), m_Y >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::stz_zpg_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } write(dp(m_TMP2), 0x00); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_end(); } void w65816_device::stz_zpg_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: write(dp(m_TMP2), 0x00); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; prefetch_start(); [[fallthrough]]; case 7: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::stz_w_zpg_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } write(dp(m_TMP2), 0x00); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } write(dp(m_TMP2 + 1), 0x00); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::stz_w_zpg_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: write(dp(m_TMP2), 0x00); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: write(dp(m_TMP2 + 1), 0x00); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::stz_zpx_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } write(dp_idx(m_TMP2, m_X), 0x00); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::stz_zpx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: write(dp_idx(m_TMP2, m_X), 0x00); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::stz_w_zpx_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } write(dp_idx(m_TMP2, m_X), 0x00); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } write(dp_idx(m_TMP2 + 1, m_X), 0x00); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::stz_w_zpx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: write(dp_idx(m_TMP2, m_X), 0x00); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: write(dp_idx(m_TMP2 + 1, m_X), 0x00); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::stz_aba_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; write(ab(m_TMP), 0x00); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_end(); } void w65816_device::stz_aba_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: write(ab(m_TMP), 0x00); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; prefetch_start(); [[fallthrough]]; case 7: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::stz_w_aba_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; write(ab(m_TMP), 0x00); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } write(ab_idx(m_TMP, 1), 0x00); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::stz_w_aba_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: write(ab(m_TMP), 0x00); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: write(ab_idx(m_TMP, 1), 0x00); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::stz_abx_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } write(ab_idx(m_TMP, m_X), 0x00); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::stz_abx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: write(ab_idx(m_TMP, m_X), 0x00); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::stz_w_abx_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } write(ab_idx(m_TMP, m_X), 0x00); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } write(ab_idx(m_TMP, m_X + 1), 0x00); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::stz_w_abx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: write(ab_idx(m_TMP, m_X), 0x00); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: write(ab_idx(m_TMP, m_X + 1), 0x00); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::cpx_imm_full() { m_VAL = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; do_cmp(m_X, m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } prefetch_end(); } void w65816_device::cpx_imm_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_VAL = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; do_cmp(m_X, m_VAL); prefetch_start(); [[fallthrough]]; case 3: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::cpx_w_imm16_full() { m_VAL = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_VAL = set_h(m_VAL, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; do_cmp16(m_X, m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } prefetch_end(); } void w65816_device::cpx_w_imm16_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_VAL = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_VAL = set_h(m_VAL, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; do_cmp16(m_X, m_VAL); prefetch_start(); [[fallthrough]]; case 5: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::cpx_zpg_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } do_cmp(m_X, m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_end(); } void w65816_device::cpx_zpg_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; do_cmp(m_X, m_VAL); prefetch_start(); [[fallthrough]]; case 7: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::cpx_w_zpg_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = set_h(m_VAL, read(dp(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } do_cmp16(m_X, m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::cpx_w_zpg_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = set_h(m_VAL, read(dp(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; do_cmp16(m_X, m_VAL); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::cpx_aba_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } do_cmp(m_X, m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_end(); } void w65816_device::cpx_aba_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; do_cmp(m_X, m_VAL); prefetch_start(); [[fallthrough]]; case 7: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::cpx_w_aba_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } do_cmp16(m_X, m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::cpx_w_aba_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; do_cmp16(m_X, m_VAL); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::cpy_imm_full() { m_VAL = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; do_cmp(m_Y, m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } prefetch_end(); } void w65816_device::cpy_imm_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_VAL = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; do_cmp(m_Y, m_VAL); prefetch_start(); [[fallthrough]]; case 3: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::cpy_w_imm16_full() { m_VAL = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_VAL = set_h(m_VAL, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; do_cmp16(m_Y, m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } prefetch_end(); } void w65816_device::cpy_w_imm16_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_VAL = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_VAL = set_h(m_VAL, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; do_cmp16(m_Y, m_VAL); prefetch_start(); [[fallthrough]]; case 5: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::cpy_zpg_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } do_cmp(m_Y, m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_end(); } void w65816_device::cpy_zpg_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; do_cmp(m_Y, m_VAL); prefetch_start(); [[fallthrough]]; case 7: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::cpy_w_zpg_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = set_h(m_VAL, read(dp(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } do_cmp16(m_Y, m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::cpy_w_zpg_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = set_h(m_VAL, read(dp(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; do_cmp16(m_Y, m_VAL); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::cpy_aba_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } do_cmp(m_Y, m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } prefetch_end(); } void w65816_device::cpy_aba_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; do_cmp(m_Y, m_VAL); prefetch_start(); [[fallthrough]]; case 7: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::cpy_w_aba_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } do_cmp16(m_Y, m_VAL); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_end(); } void w65816_device::cpy_w_aba_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; do_cmp16(m_Y, m_VAL); prefetch_start(); [[fallthrough]]; case 9: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::asl_acc_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_A = set_l(m_A, do_asl(m_A)); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } prefetch_end(); } void w65816_device::asl_acc_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_A = set_l(m_A, do_asl(m_A)); prefetch_start(); [[fallthrough]]; case 3: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::asl_w_acc_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_A = do_asl16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } prefetch_end(); } void w65816_device::asl_w_acc_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_A = do_asl16(m_A); prefetch_start(); [[fallthrough]]; case 3: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::asl_zpg_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } write_modify_cycle(dp(m_TMP2), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = do_asl(m_VAL); write(dp(m_TMP2), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::asl_zpg_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: write_modify_cycle(dp(m_TMP2), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; m_VAL = do_asl(m_VAL); [[fallthrough]]; case 9: write(dp(m_TMP2), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::asl_w_zpg_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = set_h(m_VAL, read(dp(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } write_modify_cycle(dp(m_TMP2 + 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = do_asl16(m_VAL); write(dp(m_TMP2 + 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } write(dp(m_TMP2), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_end(); } void w65816_device::asl_w_zpg_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = set_h(m_VAL, read(dp(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: write_modify_cycle(dp(m_TMP2 + 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; m_VAL = do_asl16(m_VAL); [[fallthrough]]; case 11: write(dp(m_TMP2 + 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; [[fallthrough]]; case 13: write(dp(m_TMP2), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_start(); [[fallthrough]]; case 15: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::asl_zpx_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = read(dp_idx(m_TMP2, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } write_modify_cycle(dp_idx(m_TMP2, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = do_asl(m_VAL); write(dp_idx(m_TMP2, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::asl_zpx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = read(dp_idx(m_TMP2, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: write_modify_cycle(dp_idx(m_TMP2, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; m_VAL = do_asl(m_VAL); [[fallthrough]]; case 11: write(dp_idx(m_TMP2, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::asl_w_zpx_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = read(dp_idx(m_TMP2, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = set_h(m_VAL, read(dp_idx(m_TMP2 + 1, m_X))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } write_modify_cycle(dp_idx(m_TMP2 + 1, m_X), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_VAL = do_asl16(m_VAL); write(dp_idx(m_TMP2 + 1, m_X), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } write(dp_idx(m_TMP2, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 17; } else m_inst_substate = 18; return; } prefetch_end(); } void w65816_device::asl_w_zpx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = read(dp_idx(m_TMP2, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = set_h(m_VAL, read(dp_idx(m_TMP2 + 1, m_X))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: write_modify_cycle(dp_idx(m_TMP2 + 1, m_X), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; m_VAL = do_asl16(m_VAL); [[fallthrough]]; case 13: write(dp_idx(m_TMP2 + 1, m_X), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; [[fallthrough]]; case 15: write(dp_idx(m_TMP2, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_start(); [[fallthrough]]; case 17: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 17; } else m_inst_substate = 18; return; } [[fallthrough]]; case 18:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::asl_aba_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } write_modify_cycle(ab(m_TMP), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = do_asl(m_VAL); write(ab(m_TMP), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::asl_aba_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: write_modify_cycle(ab(m_TMP), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; m_VAL = do_asl(m_VAL); [[fallthrough]]; case 9: write(ab(m_TMP), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::asl_w_aba_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } write_modify_cycle(ab_idx(m_TMP, 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = do_asl16(m_VAL); write(ab_idx(m_TMP, 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } write(ab(m_TMP), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_end(); } void w65816_device::asl_w_aba_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: write_modify_cycle(ab_idx(m_TMP, 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; m_VAL = do_asl16(m_VAL); [[fallthrough]]; case 11: write(ab_idx(m_TMP, 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; [[fallthrough]]; case 13: write(ab(m_TMP), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_start(); [[fallthrough]]; case 15: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::asl_abx_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = read(ab_idx(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } write_modify_cycle(ab_idx(m_TMP, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = do_asl(m_VAL); write(ab_idx(m_TMP, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::asl_abx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = read(ab_idx(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: write_modify_cycle(ab_idx(m_TMP, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; m_VAL = do_asl(m_VAL); [[fallthrough]]; case 11: write(ab_idx(m_TMP, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::asl_w_abx_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = read(ab_idx(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_X + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } write_modify_cycle(ab_idx(m_TMP, m_X + 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_VAL = do_asl16(m_VAL); write(ab_idx(m_TMP, m_X + 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } write(ab_idx(m_TMP, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 17; } else m_inst_substate = 18; return; } prefetch_end(); } void w65816_device::asl_w_abx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = read(ab_idx(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_X + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: write_modify_cycle(ab_idx(m_TMP, m_X + 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; m_VAL = do_asl16(m_VAL); [[fallthrough]]; case 13: write(ab_idx(m_TMP, m_X + 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; [[fallthrough]]; case 15: write(ab_idx(m_TMP, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_start(); [[fallthrough]]; case 17: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 17; } else m_inst_substate = 18; return; } [[fallthrough]]; case 18:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::lsr_acc_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_A = set_l(m_A, do_lsr(m_A)); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } prefetch_end(); } void w65816_device::lsr_acc_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_A = set_l(m_A, do_lsr(m_A)); prefetch_start(); [[fallthrough]]; case 3: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::lsr_w_acc_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_A = do_lsr16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } prefetch_end(); } void w65816_device::lsr_w_acc_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_A = do_lsr16(m_A); prefetch_start(); [[fallthrough]]; case 3: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::lsr_zpg_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } write_modify_cycle(dp(m_TMP2), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = do_lsr(m_VAL); write(dp(m_TMP2), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::lsr_zpg_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: write_modify_cycle(dp(m_TMP2), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; m_VAL = do_lsr(m_VAL); [[fallthrough]]; case 9: write(dp(m_TMP2), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::lsr_w_zpg_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = set_h(m_VAL, read(dp(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } write_modify_cycle(dp(m_TMP2 + 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = do_lsr16(m_VAL); write(dp(m_TMP2 + 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } write(dp(m_TMP2), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_end(); } void w65816_device::lsr_w_zpg_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = set_h(m_VAL, read(dp(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: write_modify_cycle(dp(m_TMP2 + 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; m_VAL = do_lsr16(m_VAL); [[fallthrough]]; case 11: write(dp(m_TMP2 + 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; [[fallthrough]]; case 13: write(dp(m_TMP2), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_start(); [[fallthrough]]; case 15: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::lsr_zpx_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = read(dp_idx(m_TMP2, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } write_modify_cycle(dp_idx(m_TMP2, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = do_lsr(m_VAL); write(dp_idx(m_TMP2, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::lsr_zpx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = read(dp_idx(m_TMP2, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: write_modify_cycle(dp_idx(m_TMP2, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; m_VAL = do_lsr(m_VAL); [[fallthrough]]; case 11: write(dp_idx(m_TMP2, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::lsr_w_zpx_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = read(dp_idx(m_TMP2, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = set_h(m_VAL, read(dp_idx(m_TMP2 + 1, m_X))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } write_modify_cycle(dp_idx(m_TMP2 + 1, m_X), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_VAL = do_lsr16(m_VAL); write(dp_idx(m_TMP2 + 1, m_X), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } write(dp_idx(m_TMP2, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 17; } else m_inst_substate = 18; return; } prefetch_end(); } void w65816_device::lsr_w_zpx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = read(dp_idx(m_TMP2, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = set_h(m_VAL, read(dp_idx(m_TMP2 + 1, m_X))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: write_modify_cycle(dp_idx(m_TMP2 + 1, m_X), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; m_VAL = do_lsr16(m_VAL); [[fallthrough]]; case 13: write(dp_idx(m_TMP2 + 1, m_X), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; [[fallthrough]]; case 15: write(dp_idx(m_TMP2, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_start(); [[fallthrough]]; case 17: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 17; } else m_inst_substate = 18; return; } [[fallthrough]]; case 18:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::lsr_aba_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } write_modify_cycle(ab(m_TMP), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = do_lsr(m_VAL); write(ab(m_TMP), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::lsr_aba_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: write_modify_cycle(ab(m_TMP), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; m_VAL = do_lsr(m_VAL); [[fallthrough]]; case 9: write(ab(m_TMP), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::lsr_w_aba_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } write_modify_cycle(ab_idx(m_TMP, 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = do_lsr16(m_VAL); write(ab_idx(m_TMP, 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } write(ab(m_TMP), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_end(); } void w65816_device::lsr_w_aba_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: write_modify_cycle(ab_idx(m_TMP, 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; m_VAL = do_lsr16(m_VAL); [[fallthrough]]; case 11: write(ab_idx(m_TMP, 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; [[fallthrough]]; case 13: write(ab(m_TMP), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_start(); [[fallthrough]]; case 15: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::lsr_abx_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = read(ab_idx(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } write_modify_cycle(ab_idx(m_TMP, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = do_lsr(m_VAL); write(ab_idx(m_TMP, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::lsr_abx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = read(ab_idx(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: write_modify_cycle(ab_idx(m_TMP, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; m_VAL = do_lsr(m_VAL); [[fallthrough]]; case 11: write(ab_idx(m_TMP, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::lsr_w_abx_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = read(ab_idx(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_X + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } write_modify_cycle(ab_idx(m_TMP, m_X + 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_VAL = do_lsr16(m_VAL); write(ab_idx(m_TMP, m_X + 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } write(ab_idx(m_TMP, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 17; } else m_inst_substate = 18; return; } prefetch_end(); } void w65816_device::lsr_w_abx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = read(ab_idx(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_X + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: write_modify_cycle(ab_idx(m_TMP, m_X + 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; m_VAL = do_lsr16(m_VAL); [[fallthrough]]; case 13: write(ab_idx(m_TMP, m_X + 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; [[fallthrough]]; case 15: write(ab_idx(m_TMP, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_start(); [[fallthrough]]; case 17: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 17; } else m_inst_substate = 18; return; } [[fallthrough]]; case 18:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::rol_acc_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_A = set_l(m_A, do_rol(m_A)); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } prefetch_end(); } void w65816_device::rol_acc_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_A = set_l(m_A, do_rol(m_A)); prefetch_start(); [[fallthrough]]; case 3: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::rol_w_acc_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_A = do_rol16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } prefetch_end(); } void w65816_device::rol_w_acc_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_A = do_rol16(m_A); prefetch_start(); [[fallthrough]]; case 3: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::rol_zpg_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } write_modify_cycle(dp(m_TMP2), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = do_rol(m_VAL); write(dp(m_TMP2), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::rol_zpg_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: write_modify_cycle(dp(m_TMP2), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; m_VAL = do_rol(m_VAL); [[fallthrough]]; case 9: write(dp(m_TMP2), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::rol_w_zpg_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = set_h(m_VAL, read(dp(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } write_modify_cycle(dp(m_TMP2 + 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = do_rol16(m_VAL); write(dp(m_TMP2 + 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } write(dp(m_TMP2), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_end(); } void w65816_device::rol_w_zpg_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = set_h(m_VAL, read(dp(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: write_modify_cycle(dp(m_TMP2 + 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; m_VAL = do_rol16(m_VAL); [[fallthrough]]; case 11: write(dp(m_TMP2 + 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; [[fallthrough]]; case 13: write(dp(m_TMP2), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_start(); [[fallthrough]]; case 15: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::rol_zpx_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = read(dp_idx(m_TMP2, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } write_modify_cycle(dp_idx(m_TMP2, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = do_rol(m_VAL); write(dp_idx(m_TMP2, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::rol_zpx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = read(dp_idx(m_TMP2, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: write_modify_cycle(dp_idx(m_TMP2, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; m_VAL = do_rol(m_VAL); [[fallthrough]]; case 11: write(dp_idx(m_TMP2, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::rol_w_zpx_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = read(dp_idx(m_TMP2, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = set_h(m_VAL, read(dp_idx(m_TMP2 + 1, m_X))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } write_modify_cycle(dp_idx(m_TMP2 + 1, m_X), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_VAL = do_rol16(m_VAL); write(dp_idx(m_TMP2 + 1, m_X), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } write(dp_idx(m_TMP2, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 17; } else m_inst_substate = 18; return; } prefetch_end(); } void w65816_device::rol_w_zpx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = read(dp_idx(m_TMP2, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = set_h(m_VAL, read(dp_idx(m_TMP2 + 1, m_X))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: write_modify_cycle(dp_idx(m_TMP2 + 1, m_X), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; m_VAL = do_rol16(m_VAL); [[fallthrough]]; case 13: write(dp_idx(m_TMP2 + 1, m_X), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; [[fallthrough]]; case 15: write(dp_idx(m_TMP2, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_start(); [[fallthrough]]; case 17: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 17; } else m_inst_substate = 18; return; } [[fallthrough]]; case 18:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::rol_aba_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } write_modify_cycle(ab(m_TMP), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = do_rol(m_VAL); write(ab(m_TMP), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::rol_aba_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: write_modify_cycle(ab(m_TMP), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; m_VAL = do_rol(m_VAL); [[fallthrough]]; case 9: write(ab(m_TMP), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::rol_w_aba_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } write_modify_cycle(ab_idx(m_TMP, 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = do_rol16(m_VAL); write(ab_idx(m_TMP, 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } write(ab(m_TMP), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_end(); } void w65816_device::rol_w_aba_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: write_modify_cycle(ab_idx(m_TMP, 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; m_VAL = do_rol16(m_VAL); [[fallthrough]]; case 11: write(ab_idx(m_TMP, 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; [[fallthrough]]; case 13: write(ab(m_TMP), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_start(); [[fallthrough]]; case 15: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::rol_abx_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = read(ab_idx(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } write_modify_cycle(ab_idx(m_TMP, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = do_rol(m_VAL); write(ab_idx(m_TMP, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::rol_abx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = read(ab_idx(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: write_modify_cycle(ab_idx(m_TMP, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; m_VAL = do_rol(m_VAL); [[fallthrough]]; case 11: write(ab_idx(m_TMP, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::rol_w_abx_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = read(ab_idx(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_X + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } write_modify_cycle(ab_idx(m_TMP, m_X + 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_VAL = do_rol16(m_VAL); write(ab_idx(m_TMP, m_X + 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } write(ab_idx(m_TMP, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 17; } else m_inst_substate = 18; return; } prefetch_end(); } void w65816_device::rol_w_abx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = read(ab_idx(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_X + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: write_modify_cycle(ab_idx(m_TMP, m_X + 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; m_VAL = do_rol16(m_VAL); [[fallthrough]]; case 13: write(ab_idx(m_TMP, m_X + 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; [[fallthrough]]; case 15: write(ab_idx(m_TMP, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_start(); [[fallthrough]]; case 17: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 17; } else m_inst_substate = 18; return; } [[fallthrough]]; case 18:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::ror_acc_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_A = set_l(m_A, do_ror(m_A)); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } prefetch_end(); } void w65816_device::ror_acc_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_A = set_l(m_A, do_ror(m_A)); prefetch_start(); [[fallthrough]]; case 3: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::ror_w_acc_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_A = do_ror16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } prefetch_end(); } void w65816_device::ror_w_acc_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_A = do_ror16(m_A); prefetch_start(); [[fallthrough]]; case 3: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::ror_zpg_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } write_modify_cycle(dp(m_TMP2), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = do_ror(m_VAL); write(dp(m_TMP2), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::ror_zpg_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: write_modify_cycle(dp(m_TMP2), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; m_VAL = do_ror(m_VAL); [[fallthrough]]; case 9: write(dp(m_TMP2), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::ror_w_zpg_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = set_h(m_VAL, read(dp(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } write_modify_cycle(dp(m_TMP2 + 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = do_ror16(m_VAL); write(dp(m_TMP2 + 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } write(dp(m_TMP2), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_end(); } void w65816_device::ror_w_zpg_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = set_h(m_VAL, read(dp(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: write_modify_cycle(dp(m_TMP2 + 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; m_VAL = do_ror16(m_VAL); [[fallthrough]]; case 11: write(dp(m_TMP2 + 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; [[fallthrough]]; case 13: write(dp(m_TMP2), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_start(); [[fallthrough]]; case 15: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::ror_zpx_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = read(dp_idx(m_TMP2, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } write_modify_cycle(dp_idx(m_TMP2, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = do_ror(m_VAL); write(dp_idx(m_TMP2, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::ror_zpx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = read(dp_idx(m_TMP2, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: write_modify_cycle(dp_idx(m_TMP2, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; m_VAL = do_ror(m_VAL); [[fallthrough]]; case 11: write(dp_idx(m_TMP2, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::ror_w_zpx_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = read(dp_idx(m_TMP2, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = set_h(m_VAL, read(dp_idx(m_TMP2 + 1, m_X))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } write_modify_cycle(dp_idx(m_TMP2 + 1, m_X), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_VAL = do_ror16(m_VAL); write(dp_idx(m_TMP2 + 1, m_X), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } write(dp_idx(m_TMP2, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 17; } else m_inst_substate = 18; return; } prefetch_end(); } void w65816_device::ror_w_zpx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = read(dp_idx(m_TMP2, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = set_h(m_VAL, read(dp_idx(m_TMP2 + 1, m_X))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: write_modify_cycle(dp_idx(m_TMP2 + 1, m_X), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; m_VAL = do_ror16(m_VAL); [[fallthrough]]; case 13: write(dp_idx(m_TMP2 + 1, m_X), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; [[fallthrough]]; case 15: write(dp_idx(m_TMP2, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_start(); [[fallthrough]]; case 17: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 17; } else m_inst_substate = 18; return; } [[fallthrough]]; case 18:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::ror_aba_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } write_modify_cycle(ab(m_TMP), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = do_ror(m_VAL); write(ab(m_TMP), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::ror_aba_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: write_modify_cycle(ab(m_TMP), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; m_VAL = do_ror(m_VAL); [[fallthrough]]; case 9: write(ab(m_TMP), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::ror_w_aba_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } write_modify_cycle(ab_idx(m_TMP, 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = do_ror16(m_VAL); write(ab_idx(m_TMP, 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } write(ab(m_TMP), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_end(); } void w65816_device::ror_w_aba_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: write_modify_cycle(ab_idx(m_TMP, 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; m_VAL = do_ror16(m_VAL); [[fallthrough]]; case 11: write(ab_idx(m_TMP, 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; [[fallthrough]]; case 13: write(ab(m_TMP), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_start(); [[fallthrough]]; case 15: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::ror_abx_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = read(ab_idx(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } write_modify_cycle(ab_idx(m_TMP, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = do_ror(m_VAL); write(ab_idx(m_TMP, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::ror_abx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = read(ab_idx(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: write_modify_cycle(ab_idx(m_TMP, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; m_VAL = do_ror(m_VAL); [[fallthrough]]; case 11: write(ab_idx(m_TMP, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::ror_w_abx_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = read(ab_idx(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_X + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } write_modify_cycle(ab_idx(m_TMP, m_X + 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_VAL = do_ror16(m_VAL); write(ab_idx(m_TMP, m_X + 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } write(ab_idx(m_TMP, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 17; } else m_inst_substate = 18; return; } prefetch_end(); } void w65816_device::ror_w_abx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = read(ab_idx(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_X + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: write_modify_cycle(ab_idx(m_TMP, m_X + 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; m_VAL = do_ror16(m_VAL); [[fallthrough]]; case 13: write(ab_idx(m_TMP, m_X + 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; [[fallthrough]]; case 15: write(ab_idx(m_TMP, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_start(); [[fallthrough]]; case 17: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 17; } else m_inst_substate = 18; return; } [[fallthrough]]; case 18:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::inc_acc_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_A = set_l(m_A, do_inc(m_A)); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } prefetch_end(); } void w65816_device::inc_acc_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_A = set_l(m_A, do_inc(m_A)); prefetch_start(); [[fallthrough]]; case 3: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::inc_w_acc_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_A = do_inc16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } prefetch_end(); } void w65816_device::inc_w_acc_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_A = do_inc16(m_A); prefetch_start(); [[fallthrough]]; case 3: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::inc_zpg_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } write_modify_cycle(dp(m_TMP2), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = do_inc(m_VAL); write(dp(m_TMP2), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::inc_zpg_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: write_modify_cycle(dp(m_TMP2), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; m_VAL = do_inc(m_VAL); [[fallthrough]]; case 9: write(dp(m_TMP2), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::inc_w_zpg_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = set_h(m_VAL, read(dp(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } write_modify_cycle(dp(m_TMP2 + 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = do_inc16(m_VAL); write(dp(m_TMP2 + 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } write(dp(m_TMP2), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_end(); } void w65816_device::inc_w_zpg_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = set_h(m_VAL, read(dp(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: write_modify_cycle(dp(m_TMP2 + 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; m_VAL = do_inc16(m_VAL); [[fallthrough]]; case 11: write(dp(m_TMP2 + 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; [[fallthrough]]; case 13: write(dp(m_TMP2), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_start(); [[fallthrough]]; case 15: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::inc_zpx_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = read(dp_idx(m_TMP2, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } write_modify_cycle(dp_idx(m_TMP2, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = do_inc(m_VAL); write(dp_idx(m_TMP2, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::inc_zpx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = read(dp_idx(m_TMP2, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: write_modify_cycle(dp_idx(m_TMP2, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; m_VAL = do_inc(m_VAL); [[fallthrough]]; case 11: write(dp_idx(m_TMP2, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::inc_w_zpx_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = read(dp_idx(m_TMP2, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = set_h(m_VAL, read(dp_idx(m_TMP2 + 1, m_X))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } write_modify_cycle(dp_idx(m_TMP2 + 1, m_X), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_VAL = do_inc16(m_VAL); write(dp_idx(m_TMP2 + 1, m_X), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } write(dp_idx(m_TMP2, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 17; } else m_inst_substate = 18; return; } prefetch_end(); } void w65816_device::inc_w_zpx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = read(dp_idx(m_TMP2, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = set_h(m_VAL, read(dp_idx(m_TMP2 + 1, m_X))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: write_modify_cycle(dp_idx(m_TMP2 + 1, m_X), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; m_VAL = do_inc16(m_VAL); [[fallthrough]]; case 13: write(dp_idx(m_TMP2 + 1, m_X), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; [[fallthrough]]; case 15: write(dp_idx(m_TMP2, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_start(); [[fallthrough]]; case 17: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 17; } else m_inst_substate = 18; return; } [[fallthrough]]; case 18:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::inc_aba_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } write_modify_cycle(ab(m_TMP), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = do_inc(m_VAL); write(ab(m_TMP), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::inc_aba_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: write_modify_cycle(ab(m_TMP), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; m_VAL = do_inc(m_VAL); [[fallthrough]]; case 9: write(ab(m_TMP), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::inc_w_aba_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } write_modify_cycle(ab_idx(m_TMP, 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = do_inc16(m_VAL); write(ab_idx(m_TMP, 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } write(ab(m_TMP), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_end(); } void w65816_device::inc_w_aba_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: write_modify_cycle(ab_idx(m_TMP, 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; m_VAL = do_inc16(m_VAL); [[fallthrough]]; case 11: write(ab_idx(m_TMP, 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; [[fallthrough]]; case 13: write(ab(m_TMP), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_start(); [[fallthrough]]; case 15: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::inc_abx_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = read(ab_idx(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } write_modify_cycle(ab_idx(m_TMP, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = do_inc(m_VAL); write(ab_idx(m_TMP, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::inc_abx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = read(ab_idx(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: write_modify_cycle(ab_idx(m_TMP, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; m_VAL = do_inc(m_VAL); [[fallthrough]]; case 11: write(ab_idx(m_TMP, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::inc_w_abx_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = read(ab_idx(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_X + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } write_modify_cycle(ab_idx(m_TMP, m_X + 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_VAL = do_inc16(m_VAL); write(ab_idx(m_TMP, m_X + 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } write(ab_idx(m_TMP, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 17; } else m_inst_substate = 18; return; } prefetch_end(); } void w65816_device::inc_w_abx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = read(ab_idx(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_X + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: write_modify_cycle(ab_idx(m_TMP, m_X + 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; m_VAL = do_inc16(m_VAL); [[fallthrough]]; case 13: write(ab_idx(m_TMP, m_X + 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; [[fallthrough]]; case 15: write(ab_idx(m_TMP, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_start(); [[fallthrough]]; case 17: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 17; } else m_inst_substate = 18; return; } [[fallthrough]]; case 18:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::dec_acc_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_A = set_l(m_A, do_dec(m_A)); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } prefetch_end(); } void w65816_device::dec_acc_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_A = set_l(m_A, do_dec(m_A)); prefetch_start(); [[fallthrough]]; case 3: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::dec_w_acc_full() { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_A = do_dec16(m_A); prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } prefetch_end(); } void w65816_device::dec_w_acc_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_A = do_dec16(m_A); prefetch_start(); [[fallthrough]]; case 3: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::dec_zpg_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } write_modify_cycle(dp(m_TMP2), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = do_dec(m_VAL); write(dp(m_TMP2), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::dec_zpg_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: write_modify_cycle(dp(m_TMP2), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; m_VAL = do_dec(m_VAL); [[fallthrough]]; case 9: write(dp(m_TMP2), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::dec_w_zpg_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = set_h(m_VAL, read(dp(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } write_modify_cycle(dp(m_TMP2 + 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = do_dec16(m_VAL); write(dp(m_TMP2 + 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } write(dp(m_TMP2), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_end(); } void w65816_device::dec_w_zpg_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = set_h(m_VAL, read(dp(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: write_modify_cycle(dp(m_TMP2 + 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; m_VAL = do_dec16(m_VAL); [[fallthrough]]; case 11: write(dp(m_TMP2 + 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; [[fallthrough]]; case 13: write(dp(m_TMP2), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_start(); [[fallthrough]]; case 15: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::dec_zpx_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = read(dp_idx(m_TMP2, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } write_modify_cycle(dp_idx(m_TMP2, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = do_dec(m_VAL); write(dp_idx(m_TMP2, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::dec_zpx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = read(dp_idx(m_TMP2, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: write_modify_cycle(dp_idx(m_TMP2, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; m_VAL = do_dec(m_VAL); [[fallthrough]]; case 11: write(dp_idx(m_TMP2, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::dec_w_zpx_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = read(dp_idx(m_TMP2, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = set_h(m_VAL, read(dp_idx(m_TMP2 + 1, m_X))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } write_modify_cycle(dp_idx(m_TMP2 + 1, m_X), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_VAL = do_dec16(m_VAL); write(dp_idx(m_TMP2 + 1, m_X), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } write(dp_idx(m_TMP2, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 17; } else m_inst_substate = 18; return; } prefetch_end(); } void w65816_device::dec_w_zpx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = read(dp_idx(m_TMP2, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = set_h(m_VAL, read(dp_idx(m_TMP2 + 1, m_X))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: write_modify_cycle(dp_idx(m_TMP2 + 1, m_X), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; m_VAL = do_dec16(m_VAL); [[fallthrough]]; case 13: write(dp_idx(m_TMP2 + 1, m_X), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; [[fallthrough]]; case 15: write(dp_idx(m_TMP2, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_start(); [[fallthrough]]; case 17: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 17; } else m_inst_substate = 18; return; } [[fallthrough]]; case 18:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::dec_aba_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } write_modify_cycle(ab(m_TMP), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = do_dec(m_VAL); write(ab(m_TMP), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::dec_aba_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: write_modify_cycle(ab(m_TMP), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; m_VAL = do_dec(m_VAL); [[fallthrough]]; case 9: write(ab(m_TMP), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::dec_w_aba_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } write_modify_cycle(ab_idx(m_TMP, 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = do_dec16(m_VAL); write(ab_idx(m_TMP, 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } write(ab(m_TMP), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_end(); } void w65816_device::dec_w_aba_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: write_modify_cycle(ab_idx(m_TMP, 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; m_VAL = do_dec16(m_VAL); [[fallthrough]]; case 11: write(ab_idx(m_TMP, 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; [[fallthrough]]; case 13: write(ab(m_TMP), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_start(); [[fallthrough]]; case 15: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::dec_abx_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = read(ab_idx(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } write_modify_cycle(ab_idx(m_TMP, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = do_dec(m_VAL); write(ab_idx(m_TMP, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_end(); } void w65816_device::dec_abx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = read(ab_idx(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: write_modify_cycle(ab_idx(m_TMP, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; m_VAL = do_dec(m_VAL); [[fallthrough]]; case 11: write(ab_idx(m_TMP, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_start(); [[fallthrough]]; case 13: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::dec_w_abx_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = read(ab_idx(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_X + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } write_modify_cycle(ab_idx(m_TMP, m_X + 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } m_VAL = do_dec16(m_VAL); write(ab_idx(m_TMP, m_X + 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } write(ab_idx(m_TMP, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 17; } else m_inst_substate = 18; return; } prefetch_end(); } void w65816_device::dec_w_abx_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: read(ab_idx_phantom(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = read(ab_idx(m_TMP, m_X)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, m_X + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; [[fallthrough]]; case 11: write_modify_cycle(ab_idx(m_TMP, m_X + 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; m_VAL = do_dec16(m_VAL); [[fallthrough]]; case 13: write(ab_idx(m_TMP, m_X + 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; [[fallthrough]]; case 15: write(ab_idx(m_TMP, m_X), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_start(); [[fallthrough]]; case 17: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 17; } else m_inst_substate = 18; return; } [[fallthrough]]; case 18:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::tsb_zpg_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } write_modify_cycle(dp(m_TMP2), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = do_tsb(m_VAL); write(dp(m_TMP2), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::tsb_zpg_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: write_modify_cycle(dp(m_TMP2), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; m_VAL = do_tsb(m_VAL); [[fallthrough]]; case 9: write(dp(m_TMP2), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::tsb_w_zpg_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = set_h(m_VAL, read(dp(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } write_modify_cycle(dp(m_TMP2 + 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = do_tsb16(m_VAL); write(dp(m_TMP2 + 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } write(dp(m_TMP2), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_end(); } void w65816_device::tsb_w_zpg_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = set_h(m_VAL, read(dp(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: write_modify_cycle(dp(m_TMP2 + 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; m_VAL = do_tsb16(m_VAL); [[fallthrough]]; case 11: write(dp(m_TMP2 + 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; [[fallthrough]]; case 13: write(dp(m_TMP2), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_start(); [[fallthrough]]; case 15: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::tsb_aba_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } write_modify_cycle(ab(m_TMP), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = do_tsb(m_VAL); write(ab(m_TMP), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::tsb_aba_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: write_modify_cycle(ab(m_TMP), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; m_VAL = do_tsb(m_VAL); [[fallthrough]]; case 9: write(ab(m_TMP), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::tsb_w_aba_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } write_modify_cycle(ab_idx(m_TMP, 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = do_tsb16(m_VAL); write(ab_idx(m_TMP, 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } write(ab(m_TMP), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_end(); } void w65816_device::tsb_w_aba_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: write_modify_cycle(ab_idx(m_TMP, 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; m_VAL = do_tsb16(m_VAL); [[fallthrough]]; case 11: write(ab_idx(m_TMP, 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; [[fallthrough]]; case 13: write(ab(m_TMP), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_start(); [[fallthrough]]; case 15: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::trb_zpg_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } write_modify_cycle(dp(m_TMP2), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = do_trb(m_VAL); write(dp(m_TMP2), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::trb_zpg_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: write_modify_cycle(dp(m_TMP2), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; m_VAL = do_trb(m_VAL); [[fallthrough]]; case 9: write(dp(m_TMP2), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::trb_w_zpg_full() { m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; if(m_D & 0xff) { read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } } m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = set_h(m_VAL, read(dp(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } write_modify_cycle(dp(m_TMP2 + 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = do_trb16(m_VAL); write(dp(m_TMP2 + 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } write(dp(m_TMP2), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_end(); } void w65816_device::trb_w_zpg_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP2 = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; if(m_D & 0xff) { [[fallthrough]]; case 3: read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; } [[fallthrough]]; case 5: m_VAL = read(dp(m_TMP2)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = set_h(m_VAL, read(dp(m_TMP2 + 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: write_modify_cycle(dp(m_TMP2 + 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; m_VAL = do_trb16(m_VAL); [[fallthrough]]; case 11: write(dp(m_TMP2 + 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; [[fallthrough]]; case 13: write(dp(m_TMP2), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_start(); [[fallthrough]]; case 15: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::trb_aba_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } write_modify_cycle(ab(m_TMP), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } m_VAL = do_trb(m_VAL); write(ab(m_TMP), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } prefetch_end(); } void w65816_device::trb_aba_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: write_modify_cycle(ab(m_TMP), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; m_VAL = do_trb(m_VAL); [[fallthrough]]; case 9: write(ab(m_TMP), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; prefetch_start(); [[fallthrough]]; case 11: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::trb_w_aba_full() { m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } m_PC++; m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } m_PC++; m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } write_modify_cycle(ab_idx(m_TMP, 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } m_VAL = do_trb16(m_VAL); write(ab_idx(m_TMP, 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } write(ab(m_TMP), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } prefetch_start(); m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } prefetch_end(); } void w65816_device::trb_w_aba_partial() { switch(m_inst_substate) { case 0: [[fallthrough]]; case 1: m_TMP = read_pc(); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 1; } else m_inst_substate = 2; return; } [[fallthrough]]; case 2:; m_PC++; [[fallthrough]]; case 3: m_TMP = set_h(m_TMP, read_pc()); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 3; } else m_inst_substate = 4; return; } [[fallthrough]]; case 4:; m_PC++; [[fallthrough]]; case 5: m_VAL = read(ab(m_TMP)); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 5; } else m_inst_substate = 6; return; } [[fallthrough]]; case 6:; [[fallthrough]]; case 7: m_VAL = set_h(m_VAL, read(ab_idx(m_TMP, 1))); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 7; } else m_inst_substate = 8; return; } [[fallthrough]]; case 8:; [[fallthrough]]; case 9: write_modify_cycle(ab_idx(m_TMP, 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 9; } else m_inst_substate = 10; return; } [[fallthrough]]; case 10:; m_VAL = do_trb16(m_VAL); [[fallthrough]]; case 11: write(ab_idx(m_TMP, 1), m_VAL >> 8); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 11; } else m_inst_substate = 12; return; } [[fallthrough]]; case 12:; [[fallthrough]]; case 13: write(ab(m_TMP), m_VAL); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 13; } else m_inst_substate = 14; return; } [[fallthrough]]; case 14:; prefetch_start(); [[fallthrough]]; case 15: m_IR = read_sync(m_PC); m_icount--; if(m_icount <= 0) { if(access_to_be_redone()) { m_icount++; m_inst_substate = 15; } else m_inst_substate = 16; return; } [[fallthrough]]; case 16:; prefetch_end(); break; } m_inst_substate = 0; } void w65816_device::do_exec_full() { switch(m_inst_state) { case 0x00: brk_e_imm_full(); break; case 0x01: ora_idx_full(); break; case 0x02: cop_e_imm_full(); break; case 0x03: ora_ds_full(); break; case 0x04: tsb_zpg_full(); break; case 0x05: ora_zpg_full(); break; case 0x06: asl_zpg_full(); break; case 0x07: ora_zil_full(); break; case 0x08: php_imp_full(); break; case 0x09: ora_imm_full(); break; case 0x0a: asl_acc_full(); break; case 0x0b: phd_imp_full(); break; case 0x0c: tsb_aba_full(); break; case 0x0d: ora_aba_full(); break; case 0x0e: asl_aba_full(); break; case 0x0f: ora_abl_full(); break; case 0x10: bpl_rel_full(); break; case 0x11: ora_idy_full(); break; case 0x12: ora_zpi_full(); break; case 0x13: ora_dsy_full(); break; case 0x14: trb_zpg_full(); break; case 0x15: ora_zpx_full(); break; case 0x16: asl_zpx_full(); break; case 0x17: ora_ziy_full(); break; case 0x18: clc_imp_full(); break; case 0x19: ora_aby_full(); break; case 0x1a: inc_acc_full(); break; case 0x1b: tcs_imp_full(); break; case 0x1c: trb_aba_full(); break; case 0x1d: ora_abx_full(); break; case 0x1e: asl_abx_full(); break; case 0x1f: ora_alx_full(); break; case 0x20: jsr_adr_full(); break; case 0x21: and_idx_full(); break; case 0x22: jsl_abl_full(); break; case 0x23: and_ds_full(); break; case 0x24: bit_zpg_full(); break; case 0x25: and_zpg_full(); break; case 0x26: rol_zpg_full(); break; case 0x27: and_zil_full(); break; case 0x28: plp_imp_full(); break; case 0x29: and_imm_full(); break; case 0x2a: rol_acc_full(); break; case 0x2b: pld_imp_full(); break; case 0x2c: bit_aba_full(); break; case 0x2d: and_aba_full(); break; case 0x2e: rol_aba_full(); break; case 0x2f: and_abl_full(); break; case 0x30: bmi_rel_full(); break; case 0x31: and_idy_full(); break; case 0x32: and_zpi_full(); break; case 0x33: and_dsy_full(); break; case 0x34: bit_zpx_full(); break; case 0x35: and_zpx_full(); break; case 0x36: rol_zpx_full(); break; case 0x37: and_ziy_full(); break; case 0x38: sec_imp_full(); break; case 0x39: and_aby_full(); break; case 0x3a: dec_acc_full(); break; case 0x3b: tsc_imp_full(); break; case 0x3c: bit_abx_full(); break; case 0x3d: and_abx_full(); break; case 0x3e: rol_abx_full(); break; case 0x3f: and_alx_full(); break; case 0x40: rti_e_imp_full(); break; case 0x41: eor_idx_full(); break; case 0x42: wdm_imm_full(); break; case 0x43: eor_ds_full(); break; case 0x44: mvp_dbf_full(); break; case 0x45: eor_zpg_full(); break; case 0x46: lsr_zpg_full(); break; case 0x47: eor_zil_full(); break; case 0x48: pha_imp_full(); break; case 0x49: eor_imm_full(); break; case 0x4a: lsr_acc_full(); break; case 0x4b: phk_imp_full(); break; case 0x4c: jmp_adr_full(); break; case 0x4d: eor_aba_full(); break; case 0x4e: lsr_aba_full(); break; case 0x4f: eor_abl_full(); break; case 0x50: bvc_rel_full(); break; case 0x51: eor_idy_full(); break; case 0x52: eor_zpi_full(); break; case 0x53: eor_dsy_full(); break; case 0x54: mvn_dbf_full(); break; case 0x55: eor_zpx_full(); break; case 0x56: lsr_zpx_full(); break; case 0x57: eor_ziy_full(); break; case 0x58: cli_imp_full(); break; case 0x59: eor_aby_full(); break; case 0x5a: phy_imp_full(); break; case 0x5b: tcd_imp_full(); break; case 0x5c: jmp_abl_full(); break; case 0x5d: eor_abx_full(); break; case 0x5e: lsr_abx_full(); break; case 0x5f: eor_alx_full(); break; case 0x60: rts_imp_full(); break; case 0x61: adc_idx_full(); break; case 0x62: per_rell_full(); break; case 0x63: adc_ds_full(); break; case 0x64: stz_zpg_full(); break; case 0x65: adc_zpg_full(); break; case 0x66: ror_zpg_full(); break; case 0x67: adc_zil_full(); break; case 0x68: pla_imp_full(); break; case 0x69: adc_imm_full(); break; case 0x6a: ror_acc_full(); break; case 0x6b: rtl_imp_full(); break; case 0x6c: jmp_ind_full(); break; case 0x6d: adc_aba_full(); break; case 0x6e: ror_aba_full(); break; case 0x6f: adc_abl_full(); break; case 0x70: bvs_rel_full(); break; case 0x71: adc_idy_full(); break; case 0x72: adc_zpi_full(); break; case 0x73: adc_dsy_full(); break; case 0x74: stz_zpx_full(); break; case 0x75: adc_zpx_full(); break; case 0x76: ror_zpx_full(); break; case 0x77: adc_ziy_full(); break; case 0x78: sei_imp_full(); break; case 0x79: adc_aby_full(); break; case 0x7a: ply_imp_full(); break; case 0x7b: tdc_imp_full(); break; case 0x7c: jmp_iax_full(); break; case 0x7d: adc_abx_full(); break; case 0x7e: ror_abx_full(); break; case 0x7f: adc_alx_full(); break; case 0x80: bra_rel_full(); break; case 0x81: sta_idx_full(); break; case 0x82: brl_rell_full(); break; case 0x83: sta_ds_full(); break; case 0x84: sty_zpg_full(); break; case 0x85: sta_zpg_full(); break; case 0x86: stx_zpg_full(); break; case 0x87: sta_zil_full(); break; case 0x88: dey_imp_full(); break; case 0x89: bit_imm_full(); break; case 0x8a: txa_imp_full(); break; case 0x8b: phb_imp_full(); break; case 0x8c: sty_aba_full(); break; case 0x8d: sta_aba_full(); break; case 0x8e: stx_aba_full(); break; case 0x8f: sta_abl_full(); break; case 0x90: bcc_rel_full(); break; case 0x91: sta_idy_full(); break; case 0x92: sta_zpi_full(); break; case 0x93: sta_dsy_full(); break; case 0x94: sty_zpx_full(); break; case 0x95: sta_zpx_full(); break; case 0x96: stx_zpy_full(); break; case 0x97: sta_ziy_full(); break; case 0x98: tya_imp_full(); break; case 0x99: sta_aby_full(); break; case 0x9a: txs_imp_full(); break; case 0x9b: txy_imp_full(); break; case 0x9c: stz_aba_full(); break; case 0x9d: sta_abx_full(); break; case 0x9e: stz_abx_full(); break; case 0x9f: sta_alx_full(); break; case 0xa0: ldy_imm_full(); break; case 0xa1: lda_idx_full(); break; case 0xa2: ldx_imm_full(); break; case 0xa3: lda_ds_full(); break; case 0xa4: ldy_zpg_full(); break; case 0xa5: lda_zpg_full(); break; case 0xa6: ldx_zpg_full(); break; case 0xa7: lda_zil_full(); break; case 0xa8: tay_imp_full(); break; case 0xa9: lda_imm_full(); break; case 0xaa: tax_imp_full(); break; case 0xab: plb_imp_full(); break; case 0xac: ldy_aba_full(); break; case 0xad: lda_aba_full(); break; case 0xae: ldx_aba_full(); break; case 0xaf: lda_abl_full(); break; case 0xb0: bcs_rel_full(); break; case 0xb1: lda_idy_full(); break; case 0xb2: lda_zpi_full(); break; case 0xb3: lda_dsy_full(); break; case 0xb4: ldy_zpx_full(); break; case 0xb5: lda_zpx_full(); break; case 0xb6: ldx_zpy_full(); break; case 0xb7: lda_ziy_full(); break; case 0xb8: clv_imp_full(); break; case 0xb9: lda_aby_full(); break; case 0xba: tsx_imp_full(); break; case 0xbb: tyx_imp_full(); break; case 0xbc: ldy_abx_full(); break; case 0xbd: lda_abx_full(); break; case 0xbe: ldx_aby_full(); break; case 0xbf: lda_alx_full(); break; case 0xc0: cpy_imm_full(); break; case 0xc1: cmp_idx_full(); break; case 0xc2: rep_imm_full(); break; case 0xc3: cmp_ds_full(); break; case 0xc4: cpy_zpg_full(); break; case 0xc5: cmp_zpg_full(); break; case 0xc6: dec_zpg_full(); break; case 0xc7: cmp_zil_full(); break; case 0xc8: iny_imp_full(); break; case 0xc9: cmp_imm_full(); break; case 0xca: dex_imp_full(); break; case 0xcb: wai_imp_full(); break; case 0xcc: cpy_aba_full(); break; case 0xcd: cmp_aba_full(); break; case 0xce: dec_aba_full(); break; case 0xcf: cmp_abl_full(); break; case 0xd0: bne_rel_full(); break; case 0xd1: cmp_idy_full(); break; case 0xd2: cmp_zpi_full(); break; case 0xd3: cmp_dsy_full(); break; case 0xd4: pei_zpg_full(); break; case 0xd5: cmp_zpx_full(); break; case 0xd6: dec_zpx_full(); break; case 0xd7: cmp_ziy_full(); break; case 0xd8: cld_imp_full(); break; case 0xd9: cmp_aby_full(); break; case 0xda: phx_imp_full(); break; case 0xdb: stp_imp_full(); break; case 0xdc: jml_ind_full(); break; case 0xdd: cmp_abx_full(); break; case 0xde: dec_abx_full(); break; case 0xdf: cmp_alx_full(); break; case 0xe0: cpx_imm_full(); break; case 0xe1: sbc_idx_full(); break; case 0xe2: sep_imm_full(); break; case 0xe3: sbc_ds_full(); break; case 0xe4: cpx_zpg_full(); break; case 0xe5: sbc_zpg_full(); break; case 0xe6: inc_zpg_full(); break; case 0xe7: sbc_zil_full(); break; case 0xe8: inx_imp_full(); break; case 0xe9: sbc_imm_full(); break; case 0xea: nop_imp_full(); break; case 0xeb: xba_imp_full(); break; case 0xec: cpx_aba_full(); break; case 0xed: sbc_aba_full(); break; case 0xee: inc_aba_full(); break; case 0xef: sbc_abl_full(); break; case 0xf0: beq_rel_full(); break; case 0xf1: sbc_idy_full(); break; case 0xf2: sbc_zpi_full(); break; case 0xf3: sbc_dsy_full(); break; case 0xf4: pea_imm16_full(); break; case 0xf5: sbc_zpx_full(); break; case 0xf6: inc_zpx_full(); break; case 0xf7: sbc_ziy_full(); break; case 0xf8: sed_imp_full(); break; case 0xf9: sbc_aby_full(); break; case 0xfa: plx_imp_full(); break; case 0xfb: xce_imp_full(); break; case 0xfc: jsr_iax_full(); break; case 0xfd: sbc_abx_full(); break; case 0xfe: inc_abx_full(); break; case 0xff: sbc_alx_full(); break; case 0x100: brk_imm_full(); break; case 0x101: ora_w_idx_full(); break; case 0x102: cop_imm_full(); break; case 0x103: ora_w_ds_full(); break; case 0x104: tsb_w_zpg_full(); break; case 0x105: ora_w_zpg_full(); break; case 0x106: asl_w_zpg_full(); break; case 0x107: ora_w_zil_full(); break; case 0x108: php_imp_full(); break; case 0x109: ora_w_imm16_full(); break; case 0x10a: asl_w_acc_full(); break; case 0x10b: phd_imp_full(); break; case 0x10c: tsb_w_aba_full(); break; case 0x10d: ora_w_aba_full(); break; case 0x10e: asl_w_aba_full(); break; case 0x10f: ora_w_abl_full(); break; case 0x110: bpl_rel_full(); break; case 0x111: ora_w_idy_full(); break; case 0x112: ora_w_zpi_full(); break; case 0x113: ora_w_dsy_full(); break; case 0x114: trb_w_zpg_full(); break; case 0x115: ora_w_zpx_full(); break; case 0x116: asl_w_zpx_full(); break; case 0x117: ora_w_ziy_full(); break; case 0x118: clc_imp_full(); break; case 0x119: ora_w_aby_full(); break; case 0x11a: inc_w_acc_full(); break; case 0x11b: tcs_imp_full(); break; case 0x11c: trb_w_aba_full(); break; case 0x11d: ora_w_abx_full(); break; case 0x11e: asl_w_abx_full(); break; case 0x11f: ora_w_alx_full(); break; case 0x120: jsr_adr_full(); break; case 0x121: and_w_idx_full(); break; case 0x122: jsl_abl_full(); break; case 0x123: and_w_ds_full(); break; case 0x124: bit_w_zpg_full(); break; case 0x125: and_w_zpg_full(); break; case 0x126: rol_w_zpg_full(); break; case 0x127: and_w_zil_full(); break; case 0x128: plp_imp_full(); break; case 0x129: and_w_imm16_full(); break; case 0x12a: rol_w_acc_full(); break; case 0x12b: pld_imp_full(); break; case 0x12c: bit_w_aba_full(); break; case 0x12d: and_w_aba_full(); break; case 0x12e: rol_w_aba_full(); break; case 0x12f: and_w_abl_full(); break; case 0x130: bmi_rel_full(); break; case 0x131: and_w_idy_full(); break; case 0x132: and_w_zpi_full(); break; case 0x133: and_w_dsy_full(); break; case 0x134: bit_w_zpx_full(); break; case 0x135: and_w_zpx_full(); break; case 0x136: rol_w_zpx_full(); break; case 0x137: and_w_ziy_full(); break; case 0x138: sec_imp_full(); break; case 0x139: and_w_aby_full(); break; case 0x13a: dec_w_acc_full(); break; case 0x13b: tsc_imp_full(); break; case 0x13c: bit_w_abx_full(); break; case 0x13d: and_w_abx_full(); break; case 0x13e: rol_w_abx_full(); break; case 0x13f: and_w_alx_full(); break; case 0x140: rti_imp_full(); break; case 0x141: eor_w_idx_full(); break; case 0x142: wdm_imm_full(); break; case 0x143: eor_w_ds_full(); break; case 0x144: mvp_w_dbf_full(); break; case 0x145: eor_w_zpg_full(); break; case 0x146: lsr_w_zpg_full(); break; case 0x147: eor_w_zil_full(); break; case 0x148: pha_w_imp_full(); break; case 0x149: eor_w_imm16_full(); break; case 0x14a: lsr_w_acc_full(); break; case 0x14b: phk_imp_full(); break; case 0x14c: jmp_adr_full(); break; case 0x14d: eor_w_aba_full(); break; case 0x14e: lsr_w_aba_full(); break; case 0x14f: eor_w_abl_full(); break; case 0x150: bvc_rel_full(); break; case 0x151: eor_w_idy_full(); break; case 0x152: eor_w_zpi_full(); break; case 0x153: eor_w_dsy_full(); break; case 0x154: mvn_w_dbf_full(); break; case 0x155: eor_w_zpx_full(); break; case 0x156: lsr_w_zpx_full(); break; case 0x157: eor_w_ziy_full(); break; case 0x158: cli_imp_full(); break; case 0x159: eor_w_aby_full(); break; case 0x15a: phy_w_imp_full(); break; case 0x15b: tcd_imp_full(); break; case 0x15c: jmp_abl_full(); break; case 0x15d: eor_w_abx_full(); break; case 0x15e: lsr_w_abx_full(); break; case 0x15f: eor_w_alx_full(); break; case 0x160: rts_imp_full(); break; case 0x161: adc_w_idx_full(); break; case 0x162: per_rell_full(); break; case 0x163: adc_w_ds_full(); break; case 0x164: stz_w_zpg_full(); break; case 0x165: adc_w_zpg_full(); break; case 0x166: ror_w_zpg_full(); break; case 0x167: adc_w_zil_full(); break; case 0x168: pla_w_imp_full(); break; case 0x169: adc_w_imm16_full(); break; case 0x16a: ror_w_acc_full(); break; case 0x16b: rtl_imp_full(); break; case 0x16c: jmp_ind_full(); break; case 0x16d: adc_w_aba_full(); break; case 0x16e: ror_w_aba_full(); break; case 0x16f: adc_w_abl_full(); break; case 0x170: bvs_rel_full(); break; case 0x171: adc_w_idy_full(); break; case 0x172: adc_w_zpi_full(); break; case 0x173: adc_w_dsy_full(); break; case 0x174: stz_w_zpx_full(); break; case 0x175: adc_w_zpx_full(); break; case 0x176: ror_w_zpx_full(); break; case 0x177: adc_w_ziy_full(); break; case 0x178: sei_imp_full(); break; case 0x179: adc_w_aby_full(); break; case 0x17a: ply_w_imp_full(); break; case 0x17b: tdc_imp_full(); break; case 0x17c: jmp_iax_full(); break; case 0x17d: adc_w_abx_full(); break; case 0x17e: ror_w_abx_full(); break; case 0x17f: adc_w_alx_full(); break; case 0x180: bra_rel_full(); break; case 0x181: sta_w_idx_full(); break; case 0x182: brl_rell_full(); break; case 0x183: sta_w_ds_full(); break; case 0x184: sty_w_zpg_full(); break; case 0x185: sta_w_zpg_full(); break; case 0x186: stx_w_zpg_full(); break; case 0x187: sta_w_zil_full(); break; case 0x188: dey_w_imp_full(); break; case 0x189: bit_w_imm16_full(); break; case 0x18a: txa_w_imp_full(); break; case 0x18b: phb_imp_full(); break; case 0x18c: sty_w_aba_full(); break; case 0x18d: sta_w_aba_full(); break; case 0x18e: stx_w_aba_full(); break; case 0x18f: sta_w_abl_full(); break; case 0x190: bcc_rel_full(); break; case 0x191: sta_w_idy_full(); break; case 0x192: sta_w_zpi_full(); break; case 0x193: sta_w_dsy_full(); break; case 0x194: sty_w_zpx_full(); break; case 0x195: sta_w_zpx_full(); break; case 0x196: stx_w_zpy_full(); break; case 0x197: sta_w_ziy_full(); break; case 0x198: tya_w_imp_full(); break; case 0x199: sta_w_aby_full(); break; case 0x19a: txs_imp_full(); break; case 0x19b: txy_w_imp_full(); break; case 0x19c: stz_w_aba_full(); break; case 0x19d: sta_w_abx_full(); break; case 0x19e: stz_w_abx_full(); break; case 0x19f: sta_w_alx_full(); break; case 0x1a0: ldy_w_imm16_full(); break; case 0x1a1: lda_w_idx_full(); break; case 0x1a2: ldx_w_imm16_full(); break; case 0x1a3: lda_w_ds_full(); break; case 0x1a4: ldy_w_zpg_full(); break; case 0x1a5: lda_w_zpg_full(); break; case 0x1a6: ldx_w_zpg_full(); break; case 0x1a7: lda_w_zil_full(); break; case 0x1a8: tay_w_imp_full(); break; case 0x1a9: lda_w_imm16_full(); break; case 0x1aa: tax_w_imp_full(); break; case 0x1ab: plb_imp_full(); break; case 0x1ac: ldy_w_aba_full(); break; case 0x1ad: lda_w_aba_full(); break; case 0x1ae: ldx_w_aba_full(); break; case 0x1af: lda_w_abl_full(); break; case 0x1b0: bcs_rel_full(); break; case 0x1b1: lda_w_idy_full(); break; case 0x1b2: lda_w_zpi_full(); break; case 0x1b3: lda_w_dsy_full(); break; case 0x1b4: ldy_w_zpx_full(); break; case 0x1b5: lda_w_zpx_full(); break; case 0x1b6: ldx_w_zpy_full(); break; case 0x1b7: lda_w_ziy_full(); break; case 0x1b8: clv_imp_full(); break; case 0x1b9: lda_w_aby_full(); break; case 0x1ba: tsx_w_imp_full(); break; case 0x1bb: tyx_w_imp_full(); break; case 0x1bc: ldy_w_abx_full(); break; case 0x1bd: lda_w_abx_full(); break; case 0x1be: ldx_w_aby_full(); break; case 0x1bf: lda_w_alx_full(); break; case 0x1c0: cpy_w_imm16_full(); break; case 0x1c1: cmp_w_idx_full(); break; case 0x1c2: rep_imm_full(); break; case 0x1c3: cmp_w_ds_full(); break; case 0x1c4: cpy_w_zpg_full(); break; case 0x1c5: cmp_w_zpg_full(); break; case 0x1c6: dec_w_zpg_full(); break; case 0x1c7: cmp_w_zil_full(); break; case 0x1c8: iny_w_imp_full(); break; case 0x1c9: cmp_w_imm16_full(); break; case 0x1ca: dex_w_imp_full(); break; case 0x1cb: wai_imp_full(); break; case 0x1cc: cpy_w_aba_full(); break; case 0x1cd: cmp_w_aba_full(); break; case 0x1ce: dec_w_aba_full(); break; case 0x1cf: cmp_w_abl_full(); break; case 0x1d0: bne_rel_full(); break; case 0x1d1: cmp_w_idy_full(); break; case 0x1d2: cmp_w_zpi_full(); break; case 0x1d3: cmp_w_dsy_full(); break; case 0x1d4: pei_zpg_full(); break; case 0x1d5: cmp_w_zpx_full(); break; case 0x1d6: dec_w_zpx_full(); break; case 0x1d7: cmp_w_ziy_full(); break; case 0x1d8: cld_imp_full(); break; case 0x1d9: cmp_w_aby_full(); break; case 0x1da: phx_w_imp_full(); break; case 0x1db: stp_imp_full(); break; case 0x1dc: jml_ind_full(); break; case 0x1dd: cmp_w_abx_full(); break; case 0x1de: dec_w_abx_full(); break; case 0x1df: cmp_w_alx_full(); break; case 0x1e0: cpx_w_imm16_full(); break; case 0x1e1: sbc_w_idx_full(); break; case 0x1e2: sep_imm_full(); break; case 0x1e3: sbc_w_ds_full(); break; case 0x1e4: cpx_w_zpg_full(); break; case 0x1e5: sbc_w_zpg_full(); break; case 0x1e6: inc_w_zpg_full(); break; case 0x1e7: sbc_w_zil_full(); break; case 0x1e8: inx_w_imp_full(); break; case 0x1e9: sbc_w_imm16_full(); break; case 0x1ea: nop_imp_full(); break; case 0x1eb: xba_imp_full(); break; case 0x1ec: cpx_w_aba_full(); break; case 0x1ed: sbc_w_aba_full(); break; case 0x1ee: inc_w_aba_full(); break; case 0x1ef: sbc_w_abl_full(); break; case 0x1f0: beq_rel_full(); break; case 0x1f1: sbc_w_idy_full(); break; case 0x1f2: sbc_w_zpi_full(); break; case 0x1f3: sbc_w_dsy_full(); break; case 0x1f4: pea_imm16_full(); break; case 0x1f5: sbc_w_zpx_full(); break; case 0x1f6: inc_w_zpx_full(); break; case 0x1f7: sbc_w_ziy_full(); break; case 0x1f8: sed_imp_full(); break; case 0x1f9: sbc_w_aby_full(); break; case 0x1fa: plx_w_imp_full(); break; case 0x1fb: xce_imp_full(); break; case 0x1fc: jsr_iax_full(); break; case 0x1fd: sbc_w_abx_full(); break; case 0x1fe: inc_w_abx_full(); break; case 0x1ff: sbc_w_alx_full(); break; case 0x200: brk_imm_full(); break; case 0x201: ora_idx_full(); break; case 0x202: cop_imm_full(); break; case 0x203: ora_ds_full(); break; case 0x204: tsb_zpg_full(); break; case 0x205: ora_zpg_full(); break; case 0x206: asl_zpg_full(); break; case 0x207: ora_zil_full(); break; case 0x208: php_imp_full(); break; case 0x209: ora_imm_full(); break; case 0x20a: asl_acc_full(); break; case 0x20b: phd_imp_full(); break; case 0x20c: tsb_aba_full(); break; case 0x20d: ora_aba_full(); break; case 0x20e: asl_aba_full(); break; case 0x20f: ora_abl_full(); break; case 0x210: bpl_rel_full(); break; case 0x211: ora_idy_full(); break; case 0x212: ora_zpi_full(); break; case 0x213: ora_dsy_full(); break; case 0x214: trb_zpg_full(); break; case 0x215: ora_zpx_full(); break; case 0x216: asl_zpx_full(); break; case 0x217: ora_ziy_full(); break; case 0x218: clc_imp_full(); break; case 0x219: ora_aby_full(); break; case 0x21a: inc_acc_full(); break; case 0x21b: tcs_imp_full(); break; case 0x21c: trb_aba_full(); break; case 0x21d: ora_abx_full(); break; case 0x21e: asl_abx_full(); break; case 0x21f: ora_alx_full(); break; case 0x220: jsr_adr_full(); break; case 0x221: and_idx_full(); break; case 0x222: jsl_abl_full(); break; case 0x223: and_ds_full(); break; case 0x224: bit_zpg_full(); break; case 0x225: and_zpg_full(); break; case 0x226: rol_zpg_full(); break; case 0x227: and_zil_full(); break; case 0x228: plp_imp_full(); break; case 0x229: and_imm_full(); break; case 0x22a: rol_acc_full(); break; case 0x22b: pld_imp_full(); break; case 0x22c: bit_aba_full(); break; case 0x22d: and_aba_full(); break; case 0x22e: rol_aba_full(); break; case 0x22f: and_abl_full(); break; case 0x230: bmi_rel_full(); break; case 0x231: and_idy_full(); break; case 0x232: and_zpi_full(); break; case 0x233: and_dsy_full(); break; case 0x234: bit_zpx_full(); break; case 0x235: and_zpx_full(); break; case 0x236: rol_zpx_full(); break; case 0x237: and_ziy_full(); break; case 0x238: sec_imp_full(); break; case 0x239: and_aby_full(); break; case 0x23a: dec_acc_full(); break; case 0x23b: tsc_imp_full(); break; case 0x23c: bit_abx_full(); break; case 0x23d: and_abx_full(); break; case 0x23e: rol_abx_full(); break; case 0x23f: and_alx_full(); break; case 0x240: rti_imp_full(); break; case 0x241: eor_idx_full(); break; case 0x242: wdm_imm_full(); break; case 0x243: eor_ds_full(); break; case 0x244: mvp_w_dbf_full(); break; case 0x245: eor_zpg_full(); break; case 0x246: lsr_zpg_full(); break; case 0x247: eor_zil_full(); break; case 0x248: pha_imp_full(); break; case 0x249: eor_imm_full(); break; case 0x24a: lsr_acc_full(); break; case 0x24b: phk_imp_full(); break; case 0x24c: jmp_adr_full(); break; case 0x24d: eor_aba_full(); break; case 0x24e: lsr_aba_full(); break; case 0x24f: eor_abl_full(); break; case 0x250: bvc_rel_full(); break; case 0x251: eor_idy_full(); break; case 0x252: eor_zpi_full(); break; case 0x253: eor_dsy_full(); break; case 0x254: mvn_w_dbf_full(); break; case 0x255: eor_zpx_full(); break; case 0x256: lsr_zpx_full(); break; case 0x257: eor_ziy_full(); break; case 0x258: cli_imp_full(); break; case 0x259: eor_aby_full(); break; case 0x25a: phy_w_imp_full(); break; case 0x25b: tcd_imp_full(); break; case 0x25c: jmp_abl_full(); break; case 0x25d: eor_abx_full(); break; case 0x25e: lsr_abx_full(); break; case 0x25f: eor_alx_full(); break; case 0x260: rts_imp_full(); break; case 0x261: adc_idx_full(); break; case 0x262: per_rell_full(); break; case 0x263: adc_ds_full(); break; case 0x264: stz_zpg_full(); break; case 0x265: adc_zpg_full(); break; case 0x266: ror_zpg_full(); break; case 0x267: adc_zil_full(); break; case 0x268: pla_imp_full(); break; case 0x269: adc_imm_full(); break; case 0x26a: ror_acc_full(); break; case 0x26b: rtl_imp_full(); break; case 0x26c: jmp_ind_full(); break; case 0x26d: adc_aba_full(); break; case 0x26e: ror_aba_full(); break; case 0x26f: adc_abl_full(); break; case 0x270: bvs_rel_full(); break; case 0x271: adc_idy_full(); break; case 0x272: adc_zpi_full(); break; case 0x273: adc_dsy_full(); break; case 0x274: stz_zpx_full(); break; case 0x275: adc_zpx_full(); break; case 0x276: ror_zpx_full(); break; case 0x277: adc_ziy_full(); break; case 0x278: sei_imp_full(); break; case 0x279: adc_aby_full(); break; case 0x27a: ply_w_imp_full(); break; case 0x27b: tdc_imp_full(); break; case 0x27c: jmp_iax_full(); break; case 0x27d: adc_abx_full(); break; case 0x27e: ror_abx_full(); break; case 0x27f: adc_alx_full(); break; case 0x280: bra_rel_full(); break; case 0x281: sta_idx_full(); break; case 0x282: brl_rell_full(); break; case 0x283: sta_ds_full(); break; case 0x284: sty_w_zpg_full(); break; case 0x285: sta_zpg_full(); break; case 0x286: stx_w_zpg_full(); break; case 0x287: sta_zil_full(); break; case 0x288: dey_w_imp_full(); break; case 0x289: bit_imm_full(); break; case 0x28a: txa_imp_full(); break; case 0x28b: phb_imp_full(); break; case 0x28c: sty_w_aba_full(); break; case 0x28d: sta_aba_full(); break; case 0x28e: stx_w_aba_full(); break; case 0x28f: sta_abl_full(); break; case 0x290: bcc_rel_full(); break; case 0x291: sta_idy_full(); break; case 0x292: sta_zpi_full(); break; case 0x293: sta_dsy_full(); break; case 0x294: sty_w_zpx_full(); break; case 0x295: sta_zpx_full(); break; case 0x296: stx_w_zpy_full(); break; case 0x297: sta_ziy_full(); break; case 0x298: tya_imp_full(); break; case 0x299: sta_aby_full(); break; case 0x29a: txs_imp_full(); break; case 0x29b: txy_w_imp_full(); break; case 0x29c: stz_aba_full(); break; case 0x29d: sta_abx_full(); break; case 0x29e: stz_abx_full(); break; case 0x29f: sta_alx_full(); break; case 0x2a0: ldy_w_imm16_full(); break; case 0x2a1: lda_idx_full(); break; case 0x2a2: ldx_w_imm16_full(); break; case 0x2a3: lda_ds_full(); break; case 0x2a4: ldy_w_zpg_full(); break; case 0x2a5: lda_zpg_full(); break; case 0x2a6: ldx_w_zpg_full(); break; case 0x2a7: lda_zil_full(); break; case 0x2a8: tay_w_imp_full(); break; case 0x2a9: lda_imm_full(); break; case 0x2aa: tax_w_imp_full(); break; case 0x2ab: plb_imp_full(); break; case 0x2ac: ldy_w_aba_full(); break; case 0x2ad: lda_aba_full(); break; case 0x2ae: ldx_w_aba_full(); break; case 0x2af: lda_abl_full(); break; case 0x2b0: bcs_rel_full(); break; case 0x2b1: lda_idy_full(); break; case 0x2b2: lda_zpi_full(); break; case 0x2b3: lda_dsy_full(); break; case 0x2b4: ldy_w_zpx_full(); break; case 0x2b5: lda_zpx_full(); break; case 0x2b6: ldx_w_zpy_full(); break; case 0x2b7: lda_ziy_full(); break; case 0x2b8: clv_imp_full(); break; case 0x2b9: lda_aby_full(); break; case 0x2ba: tsx_w_imp_full(); break; case 0x2bb: tyx_w_imp_full(); break; case 0x2bc: ldy_w_abx_full(); break; case 0x2bd: lda_abx_full(); break; case 0x2be: ldx_w_aby_full(); break; case 0x2bf: lda_alx_full(); break; case 0x2c0: cpy_w_imm16_full(); break; case 0x2c1: cmp_idx_full(); break; case 0x2c2: rep_imm_full(); break; case 0x2c3: cmp_ds_full(); break; case 0x2c4: cpy_w_zpg_full(); break; case 0x2c5: cmp_zpg_full(); break; case 0x2c6: dec_zpg_full(); break; case 0x2c7: cmp_zil_full(); break; case 0x2c8: iny_w_imp_full(); break; case 0x2c9: cmp_imm_full(); break; case 0x2ca: dex_w_imp_full(); break; case 0x2cb: wai_imp_full(); break; case 0x2cc: cpy_w_aba_full(); break; case 0x2cd: cmp_aba_full(); break; case 0x2ce: dec_aba_full(); break; case 0x2cf: cmp_abl_full(); break; case 0x2d0: bne_rel_full(); break; case 0x2d1: cmp_idy_full(); break; case 0x2d2: cmp_zpi_full(); break; case 0x2d3: cmp_dsy_full(); break; case 0x2d4: pei_zpg_full(); break; case 0x2d5: cmp_zpx_full(); break; case 0x2d6: dec_zpx_full(); break; case 0x2d7: cmp_ziy_full(); break; case 0x2d8: cld_imp_full(); break; case 0x2d9: cmp_aby_full(); break; case 0x2da: phx_w_imp_full(); break; case 0x2db: stp_imp_full(); break; case 0x2dc: jml_ind_full(); break; case 0x2dd: cmp_abx_full(); break; case 0x2de: dec_abx_full(); break; case 0x2df: cmp_alx_full(); break; case 0x2e0: cpx_w_imm16_full(); break; case 0x2e1: sbc_idx_full(); break; case 0x2e2: sep_imm_full(); break; case 0x2e3: sbc_ds_full(); break; case 0x2e4: cpx_w_zpg_full(); break; case 0x2e5: sbc_zpg_full(); break; case 0x2e6: inc_zpg_full(); break; case 0x2e7: sbc_zil_full(); break; case 0x2e8: inx_w_imp_full(); break; case 0x2e9: sbc_imm_full(); break; case 0x2ea: nop_imp_full(); break; case 0x2eb: xba_imp_full(); break; case 0x2ec: cpx_w_aba_full(); break; case 0x2ed: sbc_aba_full(); break; case 0x2ee: inc_aba_full(); break; case 0x2ef: sbc_abl_full(); break; case 0x2f0: beq_rel_full(); break; case 0x2f1: sbc_idy_full(); break; case 0x2f2: sbc_zpi_full(); break; case 0x2f3: sbc_dsy_full(); break; case 0x2f4: pea_imm16_full(); break; case 0x2f5: sbc_zpx_full(); break; case 0x2f6: inc_zpx_full(); break; case 0x2f7: sbc_ziy_full(); break; case 0x2f8: sed_imp_full(); break; case 0x2f9: sbc_aby_full(); break; case 0x2fa: plx_w_imp_full(); break; case 0x2fb: xce_imp_full(); break; case 0x2fc: jsr_iax_full(); break; case 0x2fd: sbc_abx_full(); break; case 0x2fe: inc_abx_full(); break; case 0x2ff: sbc_alx_full(); break; case 0x300: brk_imm_full(); break; case 0x301: ora_w_idx_full(); break; case 0x302: cop_imm_full(); break; case 0x303: ora_w_ds_full(); break; case 0x304: tsb_w_zpg_full(); break; case 0x305: ora_w_zpg_full(); break; case 0x306: asl_w_zpg_full(); break; case 0x307: ora_w_zil_full(); break; case 0x308: php_imp_full(); break; case 0x309: ora_w_imm16_full(); break; case 0x30a: asl_w_acc_full(); break; case 0x30b: phd_imp_full(); break; case 0x30c: tsb_w_aba_full(); break; case 0x30d: ora_w_aba_full(); break; case 0x30e: asl_w_aba_full(); break; case 0x30f: ora_w_abl_full(); break; case 0x310: bpl_rel_full(); break; case 0x311: ora_w_idy_full(); break; case 0x312: ora_w_zpi_full(); break; case 0x313: ora_w_dsy_full(); break; case 0x314: trb_w_zpg_full(); break; case 0x315: ora_w_zpx_full(); break; case 0x316: asl_w_zpx_full(); break; case 0x317: ora_w_ziy_full(); break; case 0x318: clc_imp_full(); break; case 0x319: ora_w_aby_full(); break; case 0x31a: inc_w_acc_full(); break; case 0x31b: tcs_imp_full(); break; case 0x31c: trb_w_aba_full(); break; case 0x31d: ora_w_abx_full(); break; case 0x31e: asl_w_abx_full(); break; case 0x31f: ora_w_alx_full(); break; case 0x320: jsr_adr_full(); break; case 0x321: and_w_idx_full(); break; case 0x322: jsl_abl_full(); break; case 0x323: and_w_ds_full(); break; case 0x324: bit_w_zpg_full(); break; case 0x325: and_w_zpg_full(); break; case 0x326: rol_w_zpg_full(); break; case 0x327: and_w_zil_full(); break; case 0x328: plp_imp_full(); break; case 0x329: and_w_imm16_full(); break; case 0x32a: rol_w_acc_full(); break; case 0x32b: pld_imp_full(); break; case 0x32c: bit_w_aba_full(); break; case 0x32d: and_w_aba_full(); break; case 0x32e: rol_w_aba_full(); break; case 0x32f: and_w_abl_full(); break; case 0x330: bmi_rel_full(); break; case 0x331: and_w_idy_full(); break; case 0x332: and_w_zpi_full(); break; case 0x333: and_w_dsy_full(); break; case 0x334: bit_w_zpx_full(); break; case 0x335: and_w_zpx_full(); break; case 0x336: rol_w_zpx_full(); break; case 0x337: and_w_ziy_full(); break; case 0x338: sec_imp_full(); break; case 0x339: and_w_aby_full(); break; case 0x33a: dec_w_acc_full(); break; case 0x33b: tsc_imp_full(); break; case 0x33c: bit_w_abx_full(); break; case 0x33d: and_w_abx_full(); break; case 0x33e: rol_w_abx_full(); break; case 0x33f: and_w_alx_full(); break; case 0x340: rti_imp_full(); break; case 0x341: eor_w_idx_full(); break; case 0x342: wdm_imm_full(); break; case 0x343: eor_w_ds_full(); break; case 0x344: mvp_dbf_full(); break; case 0x345: eor_w_zpg_full(); break; case 0x346: lsr_w_zpg_full(); break; case 0x347: eor_w_zil_full(); break; case 0x348: pha_w_imp_full(); break; case 0x349: eor_w_imm16_full(); break; case 0x34a: lsr_w_acc_full(); break; case 0x34b: phk_imp_full(); break; case 0x34c: jmp_adr_full(); break; case 0x34d: eor_w_aba_full(); break; case 0x34e: lsr_w_aba_full(); break; case 0x34f: eor_w_abl_full(); break; case 0x350: bvc_rel_full(); break; case 0x351: eor_w_idy_full(); break; case 0x352: eor_w_zpi_full(); break; case 0x353: eor_w_dsy_full(); break; case 0x354: mvn_dbf_full(); break; case 0x355: eor_w_zpx_full(); break; case 0x356: lsr_w_zpx_full(); break; case 0x357: eor_w_ziy_full(); break; case 0x358: cli_imp_full(); break; case 0x359: eor_w_aby_full(); break; case 0x35a: phy_imp_full(); break; case 0x35b: tcd_imp_full(); break; case 0x35c: jmp_abl_full(); break; case 0x35d: eor_w_abx_full(); break; case 0x35e: lsr_w_abx_full(); break; case 0x35f: eor_w_alx_full(); break; case 0x360: rts_imp_full(); break; case 0x361: adc_w_idx_full(); break; case 0x362: per_rell_full(); break; case 0x363: adc_w_ds_full(); break; case 0x364: stz_w_zpg_full(); break; case 0x365: adc_w_zpg_full(); break; case 0x366: ror_w_zpg_full(); break; case 0x367: adc_w_zil_full(); break; case 0x368: pla_w_imp_full(); break; case 0x369: adc_w_imm16_full(); break; case 0x36a: ror_w_acc_full(); break; case 0x36b: rtl_imp_full(); break; case 0x36c: jmp_ind_full(); break; case 0x36d: adc_w_aba_full(); break; case 0x36e: ror_w_aba_full(); break; case 0x36f: adc_w_abl_full(); break; case 0x370: bvs_rel_full(); break; case 0x371: adc_w_idy_full(); break; case 0x372: adc_w_zpi_full(); break; case 0x373: adc_w_dsy_full(); break; case 0x374: stz_w_zpx_full(); break; case 0x375: adc_w_zpx_full(); break; case 0x376: ror_w_zpx_full(); break; case 0x377: adc_w_ziy_full(); break; case 0x378: sei_imp_full(); break; case 0x379: adc_w_aby_full(); break; case 0x37a: ply_imp_full(); break; case 0x37b: tdc_imp_full(); break; case 0x37c: jmp_iax_full(); break; case 0x37d: adc_w_abx_full(); break; case 0x37e: ror_w_abx_full(); break; case 0x37f: adc_w_alx_full(); break; case 0x380: bra_rel_full(); break; case 0x381: sta_w_idx_full(); break; case 0x382: brl_rell_full(); break; case 0x383: sta_w_ds_full(); break; case 0x384: sty_zpg_full(); break; case 0x385: sta_w_zpg_full(); break; case 0x386: stx_zpg_full(); break; case 0x387: sta_w_zil_full(); break; case 0x388: dey_imp_full(); break; case 0x389: bit_w_imm16_full(); break; case 0x38a: txa_w_imp_full(); break; case 0x38b: phb_imp_full(); break; case 0x38c: sty_aba_full(); break; case 0x38d: sta_w_aba_full(); break; case 0x38e: stx_aba_full(); break; case 0x38f: sta_w_abl_full(); break; case 0x390: bcc_rel_full(); break; case 0x391: sta_w_idy_full(); break; case 0x392: sta_w_zpi_full(); break; case 0x393: sta_w_dsy_full(); break; case 0x394: sty_zpx_full(); break; case 0x395: sta_w_zpx_full(); break; case 0x396: stx_zpy_full(); break; case 0x397: sta_w_ziy_full(); break; case 0x398: tya_w_imp_full(); break; case 0x399: sta_w_aby_full(); break; case 0x39a: txs_imp_full(); break; case 0x39b: txy_imp_full(); break; case 0x39c: stz_w_aba_full(); break; case 0x39d: sta_w_abx_full(); break; case 0x39e: stz_w_abx_full(); break; case 0x39f: sta_w_alx_full(); break; case 0x3a0: ldy_imm_full(); break; case 0x3a1: lda_w_idx_full(); break; case 0x3a2: ldx_imm_full(); break; case 0x3a3: lda_w_ds_full(); break; case 0x3a4: ldy_zpg_full(); break; case 0x3a5: lda_w_zpg_full(); break; case 0x3a6: ldx_zpg_full(); break; case 0x3a7: lda_w_zil_full(); break; case 0x3a8: tay_imp_full(); break; case 0x3a9: lda_w_imm16_full(); break; case 0x3aa: tax_imp_full(); break; case 0x3ab: plb_imp_full(); break; case 0x3ac: ldy_aba_full(); break; case 0x3ad: lda_w_aba_full(); break; case 0x3ae: ldx_aba_full(); break; case 0x3af: lda_w_abl_full(); break; case 0x3b0: bcs_rel_full(); break; case 0x3b1: lda_w_idy_full(); break; case 0x3b2: lda_w_zpi_full(); break; case 0x3b3: lda_w_dsy_full(); break; case 0x3b4: ldy_zpx_full(); break; case 0x3b5: lda_w_zpx_full(); break; case 0x3b6: ldx_zpy_full(); break; case 0x3b7: lda_w_ziy_full(); break; case 0x3b8: clv_imp_full(); break; case 0x3b9: lda_w_aby_full(); break; case 0x3ba: tsx_imp_full(); break; case 0x3bb: tyx_imp_full(); break; case 0x3bc: ldy_abx_full(); break; case 0x3bd: lda_w_abx_full(); break; case 0x3be: ldx_aby_full(); break; case 0x3bf: lda_w_alx_full(); break; case 0x3c0: cpy_imm_full(); break; case 0x3c1: cmp_w_idx_full(); break; case 0x3c2: rep_imm_full(); break; case 0x3c3: cmp_w_ds_full(); break; case 0x3c4: cpy_zpg_full(); break; case 0x3c5: cmp_w_zpg_full(); break; case 0x3c6: dec_w_zpg_full(); break; case 0x3c7: cmp_w_zil_full(); break; case 0x3c8: iny_imp_full(); break; case 0x3c9: cmp_w_imm16_full(); break; case 0x3ca: dex_imp_full(); break; case 0x3cb: wai_imp_full(); break; case 0x3cc: cpy_aba_full(); break; case 0x3cd: cmp_w_aba_full(); break; case 0x3ce: dec_w_aba_full(); break; case 0x3cf: cmp_w_abl_full(); break; case 0x3d0: bne_rel_full(); break; case 0x3d1: cmp_w_idy_full(); break; case 0x3d2: cmp_w_zpi_full(); break; case 0x3d3: cmp_w_dsy_full(); break; case 0x3d4: pei_zpg_full(); break; case 0x3d5: cmp_w_zpx_full(); break; case 0x3d6: dec_w_zpx_full(); break; case 0x3d7: cmp_w_ziy_full(); break; case 0x3d8: cld_imp_full(); break; case 0x3d9: cmp_w_aby_full(); break; case 0x3da: phx_imp_full(); break; case 0x3db: stp_imp_full(); break; case 0x3dc: jml_ind_full(); break; case 0x3dd: cmp_w_abx_full(); break; case 0x3de: dec_w_abx_full(); break; case 0x3df: cmp_w_alx_full(); break; case 0x3e0: cpx_imm_full(); break; case 0x3e1: sbc_w_idx_full(); break; case 0x3e2: sep_imm_full(); break; case 0x3e3: sbc_w_ds_full(); break; case 0x3e4: cpx_zpg_full(); break; case 0x3e5: sbc_w_zpg_full(); break; case 0x3e6: inc_w_zpg_full(); break; case 0x3e7: sbc_w_zil_full(); break; case 0x3e8: inx_imp_full(); break; case 0x3e9: sbc_w_imm16_full(); break; case 0x3ea: nop_imp_full(); break; case 0x3eb: xba_imp_full(); break; case 0x3ec: cpx_aba_full(); break; case 0x3ed: sbc_w_aba_full(); break; case 0x3ee: inc_w_aba_full(); break; case 0x3ef: sbc_w_abl_full(); break; case 0x3f0: beq_rel_full(); break; case 0x3f1: sbc_w_idy_full(); break; case 0x3f2: sbc_w_zpi_full(); break; case 0x3f3: sbc_w_dsy_full(); break; case 0x3f4: pea_imm16_full(); break; case 0x3f5: sbc_w_zpx_full(); break; case 0x3f6: inc_w_zpx_full(); break; case 0x3f7: sbc_w_ziy_full(); break; case 0x3f8: sed_imp_full(); break; case 0x3f9: sbc_w_aby_full(); break; case 0x3fa: plx_imp_full(); break; case 0x3fb: xce_imp_full(); break; case 0x3fc: jsr_iax_full(); break; case 0x3fd: sbc_w_abx_full(); break; case 0x3fe: inc_w_abx_full(); break; case 0x3ff: sbc_w_alx_full(); break; case 0x400: brk_imm_full(); break; case 0x401: ora_idx_full(); break; case 0x402: cop_imm_full(); break; case 0x403: ora_ds_full(); break; case 0x404: tsb_zpg_full(); break; case 0x405: ora_zpg_full(); break; case 0x406: asl_zpg_full(); break; case 0x407: ora_zil_full(); break; case 0x408: php_imp_full(); break; case 0x409: ora_imm_full(); break; case 0x40a: asl_acc_full(); break; case 0x40b: phd_imp_full(); break; case 0x40c: tsb_aba_full(); break; case 0x40d: ora_aba_full(); break; case 0x40e: asl_aba_full(); break; case 0x40f: ora_abl_full(); break; case 0x410: bpl_rel_full(); break; case 0x411: ora_idy_full(); break; case 0x412: ora_zpi_full(); break; case 0x413: ora_dsy_full(); break; case 0x414: trb_zpg_full(); break; case 0x415: ora_zpx_full(); break; case 0x416: asl_zpx_full(); break; case 0x417: ora_ziy_full(); break; case 0x418: clc_imp_full(); break; case 0x419: ora_aby_full(); break; case 0x41a: inc_acc_full(); break; case 0x41b: tcs_imp_full(); break; case 0x41c: trb_aba_full(); break; case 0x41d: ora_abx_full(); break; case 0x41e: asl_abx_full(); break; case 0x41f: ora_alx_full(); break; case 0x420: jsr_adr_full(); break; case 0x421: and_idx_full(); break; case 0x422: jsl_abl_full(); break; case 0x423: and_ds_full(); break; case 0x424: bit_zpg_full(); break; case 0x425: and_zpg_full(); break; case 0x426: rol_zpg_full(); break; case 0x427: and_zil_full(); break; case 0x428: plp_imp_full(); break; case 0x429: and_imm_full(); break; case 0x42a: rol_acc_full(); break; case 0x42b: pld_imp_full(); break; case 0x42c: bit_aba_full(); break; case 0x42d: and_aba_full(); break; case 0x42e: rol_aba_full(); break; case 0x42f: and_abl_full(); break; case 0x430: bmi_rel_full(); break; case 0x431: and_idy_full(); break; case 0x432: and_zpi_full(); break; case 0x433: and_dsy_full(); break; case 0x434: bit_zpx_full(); break; case 0x435: and_zpx_full(); break; case 0x436: rol_zpx_full(); break; case 0x437: and_ziy_full(); break; case 0x438: sec_imp_full(); break; case 0x439: and_aby_full(); break; case 0x43a: dec_acc_full(); break; case 0x43b: tsc_imp_full(); break; case 0x43c: bit_abx_full(); break; case 0x43d: and_abx_full(); break; case 0x43e: rol_abx_full(); break; case 0x43f: and_alx_full(); break; case 0x440: rti_imp_full(); break; case 0x441: eor_idx_full(); break; case 0x442: wdm_imm_full(); break; case 0x443: eor_ds_full(); break; case 0x444: mvp_dbf_full(); break; case 0x445: eor_zpg_full(); break; case 0x446: lsr_zpg_full(); break; case 0x447: eor_zil_full(); break; case 0x448: pha_imp_full(); break; case 0x449: eor_imm_full(); break; case 0x44a: lsr_acc_full(); break; case 0x44b: phk_imp_full(); break; case 0x44c: jmp_adr_full(); break; case 0x44d: eor_aba_full(); break; case 0x44e: lsr_aba_full(); break; case 0x44f: eor_abl_full(); break; case 0x450: bvc_rel_full(); break; case 0x451: eor_idy_full(); break; case 0x452: eor_zpi_full(); break; case 0x453: eor_dsy_full(); break; case 0x454: mvn_dbf_full(); break; case 0x455: eor_zpx_full(); break; case 0x456: lsr_zpx_full(); break; case 0x457: eor_ziy_full(); break; case 0x458: cli_imp_full(); break; case 0x459: eor_aby_full(); break; case 0x45a: phy_imp_full(); break; case 0x45b: tcd_imp_full(); break; case 0x45c: jmp_abl_full(); break; case 0x45d: eor_abx_full(); break; case 0x45e: lsr_abx_full(); break; case 0x45f: eor_alx_full(); break; case 0x460: rts_imp_full(); break; case 0x461: adc_idx_full(); break; case 0x462: per_rell_full(); break; case 0x463: adc_ds_full(); break; case 0x464: stz_zpg_full(); break; case 0x465: adc_zpg_full(); break; case 0x466: ror_zpg_full(); break; case 0x467: adc_zil_full(); break; case 0x468: pla_imp_full(); break; case 0x469: adc_imm_full(); break; case 0x46a: ror_acc_full(); break; case 0x46b: rtl_imp_full(); break; case 0x46c: jmp_ind_full(); break; case 0x46d: adc_aba_full(); break; case 0x46e: ror_aba_full(); break; case 0x46f: adc_abl_full(); break; case 0x470: bvs_rel_full(); break; case 0x471: adc_idy_full(); break; case 0x472: adc_zpi_full(); break; case 0x473: adc_dsy_full(); break; case 0x474: stz_zpx_full(); break; case 0x475: adc_zpx_full(); break; case 0x476: ror_zpx_full(); break; case 0x477: adc_ziy_full(); break; case 0x478: sei_imp_full(); break; case 0x479: adc_aby_full(); break; case 0x47a: ply_imp_full(); break; case 0x47b: tdc_imp_full(); break; case 0x47c: jmp_iax_full(); break; case 0x47d: adc_abx_full(); break; case 0x47e: ror_abx_full(); break; case 0x47f: adc_alx_full(); break; case 0x480: bra_rel_full(); break; case 0x481: sta_idx_full(); break; case 0x482: brl_rell_full(); break; case 0x483: sta_ds_full(); break; case 0x484: sty_zpg_full(); break; case 0x485: sta_zpg_full(); break; case 0x486: stx_zpg_full(); break; case 0x487: sta_zil_full(); break; case 0x488: dey_imp_full(); break; case 0x489: bit_imm_full(); break; case 0x48a: txa_imp_full(); break; case 0x48b: phb_imp_full(); break; case 0x48c: sty_aba_full(); break; case 0x48d: sta_aba_full(); break; case 0x48e: stx_aba_full(); break; case 0x48f: sta_abl_full(); break; case 0x490: bcc_rel_full(); break; case 0x491: sta_idy_full(); break; case 0x492: sta_zpi_full(); break; case 0x493: sta_dsy_full(); break; case 0x494: sty_zpx_full(); break; case 0x495: sta_zpx_full(); break; case 0x496: stx_zpy_full(); break; case 0x497: sta_ziy_full(); break; case 0x498: tya_imp_full(); break; case 0x499: sta_aby_full(); break; case 0x49a: txs_imp_full(); break; case 0x49b: txy_imp_full(); break; case 0x49c: stz_aba_full(); break; case 0x49d: sta_abx_full(); break; case 0x49e: stz_abx_full(); break; case 0x49f: sta_alx_full(); break; case 0x4a0: ldy_imm_full(); break; case 0x4a1: lda_idx_full(); break; case 0x4a2: ldx_imm_full(); break; case 0x4a3: lda_ds_full(); break; case 0x4a4: ldy_zpg_full(); break; case 0x4a5: lda_zpg_full(); break; case 0x4a6: ldx_zpg_full(); break; case 0x4a7: lda_zil_full(); break; case 0x4a8: tay_imp_full(); break; case 0x4a9: lda_imm_full(); break; case 0x4aa: tax_imp_full(); break; case 0x4ab: plb_imp_full(); break; case 0x4ac: ldy_aba_full(); break; case 0x4ad: lda_aba_full(); break; case 0x4ae: ldx_aba_full(); break; case 0x4af: lda_abl_full(); break; case 0x4b0: bcs_rel_full(); break; case 0x4b1: lda_idy_full(); break; case 0x4b2: lda_zpi_full(); break; case 0x4b3: lda_dsy_full(); break; case 0x4b4: ldy_zpx_full(); break; case 0x4b5: lda_zpx_full(); break; case 0x4b6: ldx_zpy_full(); break; case 0x4b7: lda_ziy_full(); break; case 0x4b8: clv_imp_full(); break; case 0x4b9: lda_aby_full(); break; case 0x4ba: tsx_imp_full(); break; case 0x4bb: tyx_imp_full(); break; case 0x4bc: ldy_abx_full(); break; case 0x4bd: lda_abx_full(); break; case 0x4be: ldx_aby_full(); break; case 0x4bf: lda_alx_full(); break; case 0x4c0: cpy_imm_full(); break; case 0x4c1: cmp_idx_full(); break; case 0x4c2: rep_imm_full(); break; case 0x4c3: cmp_ds_full(); break; case 0x4c4: cpy_zpg_full(); break; case 0x4c5: cmp_zpg_full(); break; case 0x4c6: dec_zpg_full(); break; case 0x4c7: cmp_zil_full(); break; case 0x4c8: iny_imp_full(); break; case 0x4c9: cmp_imm_full(); break; case 0x4ca: dex_imp_full(); break; case 0x4cb: wai_imp_full(); break; case 0x4cc: cpy_aba_full(); break; case 0x4cd: cmp_aba_full(); break; case 0x4ce: dec_aba_full(); break; case 0x4cf: cmp_abl_full(); break; case 0x4d0: bne_rel_full(); break; case 0x4d1: cmp_idy_full(); break; case 0x4d2: cmp_zpi_full(); break; case 0x4d3: cmp_dsy_full(); break; case 0x4d4: pei_zpg_full(); break; case 0x4d5: cmp_zpx_full(); break; case 0x4d6: dec_zpx_full(); break; case 0x4d7: cmp_ziy_full(); break; case 0x4d8: cld_imp_full(); break; case 0x4d9: cmp_aby_full(); break; case 0x4da: phx_imp_full(); break; case 0x4db: stp_imp_full(); break; case 0x4dc: jml_ind_full(); break; case 0x4dd: cmp_abx_full(); break; case 0x4de: dec_abx_full(); break; case 0x4df: cmp_alx_full(); break; case 0x4e0: cpx_imm_full(); break; case 0x4e1: sbc_idx_full(); break; case 0x4e2: sep_imm_full(); break; case 0x4e3: sbc_ds_full(); break; case 0x4e4: cpx_zpg_full(); break; case 0x4e5: sbc_zpg_full(); break; case 0x4e6: inc_zpg_full(); break; case 0x4e7: sbc_zil_full(); break; case 0x4e8: inx_imp_full(); break; case 0x4e9: sbc_imm_full(); break; case 0x4ea: nop_imp_full(); break; case 0x4eb: xba_imp_full(); break; case 0x4ec: cpx_aba_full(); break; case 0x4ed: sbc_aba_full(); break; case 0x4ee: inc_aba_full(); break; case 0x4ef: sbc_abl_full(); break; case 0x4f0: beq_rel_full(); break; case 0x4f1: sbc_idy_full(); break; case 0x4f2: sbc_zpi_full(); break; case 0x4f3: sbc_dsy_full(); break; case 0x4f4: pea_imm16_full(); break; case 0x4f5: sbc_zpx_full(); break; case 0x4f6: inc_zpx_full(); break; case 0x4f7: sbc_ziy_full(); break; case 0x4f8: sed_imp_full(); break; case 0x4f9: sbc_aby_full(); break; case 0x4fa: plx_imp_full(); break; case 0x4fb: xce_imp_full(); break; case 0x4fc: jsr_iax_full(); break; case 0x4fd: sbc_abx_full(); break; case 0x4fe: inc_abx_full(); break; case 0x4ff: sbc_alx_full(); break; case STATE_RESET: reset_full(); break; } } void w65816_device::do_exec_partial() { switch(m_inst_state) { case 0x00: brk_e_imm_partial(); break; case 0x01: ora_idx_partial(); break; case 0x02: cop_e_imm_partial(); break; case 0x03: ora_ds_partial(); break; case 0x04: tsb_zpg_partial(); break; case 0x05: ora_zpg_partial(); break; case 0x06: asl_zpg_partial(); break; case 0x07: ora_zil_partial(); break; case 0x08: php_imp_partial(); break; case 0x09: ora_imm_partial(); break; case 0x0a: asl_acc_partial(); break; case 0x0b: phd_imp_partial(); break; case 0x0c: tsb_aba_partial(); break; case 0x0d: ora_aba_partial(); break; case 0x0e: asl_aba_partial(); break; case 0x0f: ora_abl_partial(); break; case 0x10: bpl_rel_partial(); break; case 0x11: ora_idy_partial(); break; case 0x12: ora_zpi_partial(); break; case 0x13: ora_dsy_partial(); break; case 0x14: trb_zpg_partial(); break; case 0x15: ora_zpx_partial(); break; case 0x16: asl_zpx_partial(); break; case 0x17: ora_ziy_partial(); break; case 0x18: clc_imp_partial(); break; case 0x19: ora_aby_partial(); break; case 0x1a: inc_acc_partial(); break; case 0x1b: tcs_imp_partial(); break; case 0x1c: trb_aba_partial(); break; case 0x1d: ora_abx_partial(); break; case 0x1e: asl_abx_partial(); break; case 0x1f: ora_alx_partial(); break; case 0x20: jsr_adr_partial(); break; case 0x21: and_idx_partial(); break; case 0x22: jsl_abl_partial(); break; case 0x23: and_ds_partial(); break; case 0x24: bit_zpg_partial(); break; case 0x25: and_zpg_partial(); break; case 0x26: rol_zpg_partial(); break; case 0x27: and_zil_partial(); break; case 0x28: plp_imp_partial(); break; case 0x29: and_imm_partial(); break; case 0x2a: rol_acc_partial(); break; case 0x2b: pld_imp_partial(); break; case 0x2c: bit_aba_partial(); break; case 0x2d: and_aba_partial(); break; case 0x2e: rol_aba_partial(); break; case 0x2f: and_abl_partial(); break; case 0x30: bmi_rel_partial(); break; case 0x31: and_idy_partial(); break; case 0x32: and_zpi_partial(); break; case 0x33: and_dsy_partial(); break; case 0x34: bit_zpx_partial(); break; case 0x35: and_zpx_partial(); break; case 0x36: rol_zpx_partial(); break; case 0x37: and_ziy_partial(); break; case 0x38: sec_imp_partial(); break; case 0x39: and_aby_partial(); break; case 0x3a: dec_acc_partial(); break; case 0x3b: tsc_imp_partial(); break; case 0x3c: bit_abx_partial(); break; case 0x3d: and_abx_partial(); break; case 0x3e: rol_abx_partial(); break; case 0x3f: and_alx_partial(); break; case 0x40: rti_e_imp_partial(); break; case 0x41: eor_idx_partial(); break; case 0x42: wdm_imm_partial(); break; case 0x43: eor_ds_partial(); break; case 0x44: mvp_dbf_partial(); break; case 0x45: eor_zpg_partial(); break; case 0x46: lsr_zpg_partial(); break; case 0x47: eor_zil_partial(); break; case 0x48: pha_imp_partial(); break; case 0x49: eor_imm_partial(); break; case 0x4a: lsr_acc_partial(); break; case 0x4b: phk_imp_partial(); break; case 0x4c: jmp_adr_partial(); break; case 0x4d: eor_aba_partial(); break; case 0x4e: lsr_aba_partial(); break; case 0x4f: eor_abl_partial(); break; case 0x50: bvc_rel_partial(); break; case 0x51: eor_idy_partial(); break; case 0x52: eor_zpi_partial(); break; case 0x53: eor_dsy_partial(); break; case 0x54: mvn_dbf_partial(); break; case 0x55: eor_zpx_partial(); break; case 0x56: lsr_zpx_partial(); break; case 0x57: eor_ziy_partial(); break; case 0x58: cli_imp_partial(); break; case 0x59: eor_aby_partial(); break; case 0x5a: phy_imp_partial(); break; case 0x5b: tcd_imp_partial(); break; case 0x5c: jmp_abl_partial(); break; case 0x5d: eor_abx_partial(); break; case 0x5e: lsr_abx_partial(); break; case 0x5f: eor_alx_partial(); break; case 0x60: rts_imp_partial(); break; case 0x61: adc_idx_partial(); break; case 0x62: per_rell_partial(); break; case 0x63: adc_ds_partial(); break; case 0x64: stz_zpg_partial(); break; case 0x65: adc_zpg_partial(); break; case 0x66: ror_zpg_partial(); break; case 0x67: adc_zil_partial(); break; case 0x68: pla_imp_partial(); break; case 0x69: adc_imm_partial(); break; case 0x6a: ror_acc_partial(); break; case 0x6b: rtl_imp_partial(); break; case 0x6c: jmp_ind_partial(); break; case 0x6d: adc_aba_partial(); break; case 0x6e: ror_aba_partial(); break; case 0x6f: adc_abl_partial(); break; case 0x70: bvs_rel_partial(); break; case 0x71: adc_idy_partial(); break; case 0x72: adc_zpi_partial(); break; case 0x73: adc_dsy_partial(); break; case 0x74: stz_zpx_partial(); break; case 0x75: adc_zpx_partial(); break; case 0x76: ror_zpx_partial(); break; case 0x77: adc_ziy_partial(); break; case 0x78: sei_imp_partial(); break; case 0x79: adc_aby_partial(); break; case 0x7a: ply_imp_partial(); break; case 0x7b: tdc_imp_partial(); break; case 0x7c: jmp_iax_partial(); break; case 0x7d: adc_abx_partial(); break; case 0x7e: ror_abx_partial(); break; case 0x7f: adc_alx_partial(); break; case 0x80: bra_rel_partial(); break; case 0x81: sta_idx_partial(); break; case 0x82: brl_rell_partial(); break; case 0x83: sta_ds_partial(); break; case 0x84: sty_zpg_partial(); break; case 0x85: sta_zpg_partial(); break; case 0x86: stx_zpg_partial(); break; case 0x87: sta_zil_partial(); break; case 0x88: dey_imp_partial(); break; case 0x89: bit_imm_partial(); break; case 0x8a: txa_imp_partial(); break; case 0x8b: phb_imp_partial(); break; case 0x8c: sty_aba_partial(); break; case 0x8d: sta_aba_partial(); break; case 0x8e: stx_aba_partial(); break; case 0x8f: sta_abl_partial(); break; case 0x90: bcc_rel_partial(); break; case 0x91: sta_idy_partial(); break; case 0x92: sta_zpi_partial(); break; case 0x93: sta_dsy_partial(); break; case 0x94: sty_zpx_partial(); break; case 0x95: sta_zpx_partial(); break; case 0x96: stx_zpy_partial(); break; case 0x97: sta_ziy_partial(); break; case 0x98: tya_imp_partial(); break; case 0x99: sta_aby_partial(); break; case 0x9a: txs_imp_partial(); break; case 0x9b: txy_imp_partial(); break; case 0x9c: stz_aba_partial(); break; case 0x9d: sta_abx_partial(); break; case 0x9e: stz_abx_partial(); break; case 0x9f: sta_alx_partial(); break; case 0xa0: ldy_imm_partial(); break; case 0xa1: lda_idx_partial(); break; case 0xa2: ldx_imm_partial(); break; case 0xa3: lda_ds_partial(); break; case 0xa4: ldy_zpg_partial(); break; case 0xa5: lda_zpg_partial(); break; case 0xa6: ldx_zpg_partial(); break; case 0xa7: lda_zil_partial(); break; case 0xa8: tay_imp_partial(); break; case 0xa9: lda_imm_partial(); break; case 0xaa: tax_imp_partial(); break; case 0xab: plb_imp_partial(); break; case 0xac: ldy_aba_partial(); break; case 0xad: lda_aba_partial(); break; case 0xae: ldx_aba_partial(); break; case 0xaf: lda_abl_partial(); break; case 0xb0: bcs_rel_partial(); break; case 0xb1: lda_idy_partial(); break; case 0xb2: lda_zpi_partial(); break; case 0xb3: lda_dsy_partial(); break; case 0xb4: ldy_zpx_partial(); break; case 0xb5: lda_zpx_partial(); break; case 0xb6: ldx_zpy_partial(); break; case 0xb7: lda_ziy_partial(); break; case 0xb8: clv_imp_partial(); break; case 0xb9: lda_aby_partial(); break; case 0xba: tsx_imp_partial(); break; case 0xbb: tyx_imp_partial(); break; case 0xbc: ldy_abx_partial(); break; case 0xbd: lda_abx_partial(); break; case 0xbe: ldx_aby_partial(); break; case 0xbf: lda_alx_partial(); break; case 0xc0: cpy_imm_partial(); break; case 0xc1: cmp_idx_partial(); break; case 0xc2: rep_imm_partial(); break; case 0xc3: cmp_ds_partial(); break; case 0xc4: cpy_zpg_partial(); break; case 0xc5: cmp_zpg_partial(); break; case 0xc6: dec_zpg_partial(); break; case 0xc7: cmp_zil_partial(); break; case 0xc8: iny_imp_partial(); break; case 0xc9: cmp_imm_partial(); break; case 0xca: dex_imp_partial(); break; case 0xcb: wai_imp_partial(); break; case 0xcc: cpy_aba_partial(); break; case 0xcd: cmp_aba_partial(); break; case 0xce: dec_aba_partial(); break; case 0xcf: cmp_abl_partial(); break; case 0xd0: bne_rel_partial(); break; case 0xd1: cmp_idy_partial(); break; case 0xd2: cmp_zpi_partial(); break; case 0xd3: cmp_dsy_partial(); break; case 0xd4: pei_zpg_partial(); break; case 0xd5: cmp_zpx_partial(); break; case 0xd6: dec_zpx_partial(); break; case 0xd7: cmp_ziy_partial(); break; case 0xd8: cld_imp_partial(); break; case 0xd9: cmp_aby_partial(); break; case 0xda: phx_imp_partial(); break; case 0xdb: stp_imp_partial(); break; case 0xdc: jml_ind_partial(); break; case 0xdd: cmp_abx_partial(); break; case 0xde: dec_abx_partial(); break; case 0xdf: cmp_alx_partial(); break; case 0xe0: cpx_imm_partial(); break; case 0xe1: sbc_idx_partial(); break; case 0xe2: sep_imm_partial(); break; case 0xe3: sbc_ds_partial(); break; case 0xe4: cpx_zpg_partial(); break; case 0xe5: sbc_zpg_partial(); break; case 0xe6: inc_zpg_partial(); break; case 0xe7: sbc_zil_partial(); break; case 0xe8: inx_imp_partial(); break; case 0xe9: sbc_imm_partial(); break; case 0xea: nop_imp_partial(); break; case 0xeb: xba_imp_partial(); break; case 0xec: cpx_aba_partial(); break; case 0xed: sbc_aba_partial(); break; case 0xee: inc_aba_partial(); break; case 0xef: sbc_abl_partial(); break; case 0xf0: beq_rel_partial(); break; case 0xf1: sbc_idy_partial(); break; case 0xf2: sbc_zpi_partial(); break; case 0xf3: sbc_dsy_partial(); break; case 0xf4: pea_imm16_partial(); break; case 0xf5: sbc_zpx_partial(); break; case 0xf6: inc_zpx_partial(); break; case 0xf7: sbc_ziy_partial(); break; case 0xf8: sed_imp_partial(); break; case 0xf9: sbc_aby_partial(); break; case 0xfa: plx_imp_partial(); break; case 0xfb: xce_imp_partial(); break; case 0xfc: jsr_iax_partial(); break; case 0xfd: sbc_abx_partial(); break; case 0xfe: inc_abx_partial(); break; case 0xff: sbc_alx_partial(); break; case 0x100: brk_imm_partial(); break; case 0x101: ora_w_idx_partial(); break; case 0x102: cop_imm_partial(); break; case 0x103: ora_w_ds_partial(); break; case 0x104: tsb_w_zpg_partial(); break; case 0x105: ora_w_zpg_partial(); break; case 0x106: asl_w_zpg_partial(); break; case 0x107: ora_w_zil_partial(); break; case 0x108: php_imp_partial(); break; case 0x109: ora_w_imm16_partial(); break; case 0x10a: asl_w_acc_partial(); break; case 0x10b: phd_imp_partial(); break; case 0x10c: tsb_w_aba_partial(); break; case 0x10d: ora_w_aba_partial(); break; case 0x10e: asl_w_aba_partial(); break; case 0x10f: ora_w_abl_partial(); break; case 0x110: bpl_rel_partial(); break; case 0x111: ora_w_idy_partial(); break; case 0x112: ora_w_zpi_partial(); break; case 0x113: ora_w_dsy_partial(); break; case 0x114: trb_w_zpg_partial(); break; case 0x115: ora_w_zpx_partial(); break; case 0x116: asl_w_zpx_partial(); break; case 0x117: ora_w_ziy_partial(); break; case 0x118: clc_imp_partial(); break; case 0x119: ora_w_aby_partial(); break; case 0x11a: inc_w_acc_partial(); break; case 0x11b: tcs_imp_partial(); break; case 0x11c: trb_w_aba_partial(); break; case 0x11d: ora_w_abx_partial(); break; case 0x11e: asl_w_abx_partial(); break; case 0x11f: ora_w_alx_partial(); break; case 0x120: jsr_adr_partial(); break; case 0x121: and_w_idx_partial(); break; case 0x122: jsl_abl_partial(); break; case 0x123: and_w_ds_partial(); break; case 0x124: bit_w_zpg_partial(); break; case 0x125: and_w_zpg_partial(); break; case 0x126: rol_w_zpg_partial(); break; case 0x127: and_w_zil_partial(); break; case 0x128: plp_imp_partial(); break; case 0x129: and_w_imm16_partial(); break; case 0x12a: rol_w_acc_partial(); break; case 0x12b: pld_imp_partial(); break; case 0x12c: bit_w_aba_partial(); break; case 0x12d: and_w_aba_partial(); break; case 0x12e: rol_w_aba_partial(); break; case 0x12f: and_w_abl_partial(); break; case 0x130: bmi_rel_partial(); break; case 0x131: and_w_idy_partial(); break; case 0x132: and_w_zpi_partial(); break; case 0x133: and_w_dsy_partial(); break; case 0x134: bit_w_zpx_partial(); break; case 0x135: and_w_zpx_partial(); break; case 0x136: rol_w_zpx_partial(); break; case 0x137: and_w_ziy_partial(); break; case 0x138: sec_imp_partial(); break; case 0x139: and_w_aby_partial(); break; case 0x13a: dec_w_acc_partial(); break; case 0x13b: tsc_imp_partial(); break; case 0x13c: bit_w_abx_partial(); break; case 0x13d: and_w_abx_partial(); break; case 0x13e: rol_w_abx_partial(); break; case 0x13f: and_w_alx_partial(); break; case 0x140: rti_imp_partial(); break; case 0x141: eor_w_idx_partial(); break; case 0x142: wdm_imm_partial(); break; case 0x143: eor_w_ds_partial(); break; case 0x144: mvp_w_dbf_partial(); break; case 0x145: eor_w_zpg_partial(); break; case 0x146: lsr_w_zpg_partial(); break; case 0x147: eor_w_zil_partial(); break; case 0x148: pha_w_imp_partial(); break; case 0x149: eor_w_imm16_partial(); break; case 0x14a: lsr_w_acc_partial(); break; case 0x14b: phk_imp_partial(); break; case 0x14c: jmp_adr_partial(); break; case 0x14d: eor_w_aba_partial(); break; case 0x14e: lsr_w_aba_partial(); break; case 0x14f: eor_w_abl_partial(); break; case 0x150: bvc_rel_partial(); break; case 0x151: eor_w_idy_partial(); break; case 0x152: eor_w_zpi_partial(); break; case 0x153: eor_w_dsy_partial(); break; case 0x154: mvn_w_dbf_partial(); break; case 0x155: eor_w_zpx_partial(); break; case 0x156: lsr_w_zpx_partial(); break; case 0x157: eor_w_ziy_partial(); break; case 0x158: cli_imp_partial(); break; case 0x159: eor_w_aby_partial(); break; case 0x15a: phy_w_imp_partial(); break; case 0x15b: tcd_imp_partial(); break; case 0x15c: jmp_abl_partial(); break; case 0x15d: eor_w_abx_partial(); break; case 0x15e: lsr_w_abx_partial(); break; case 0x15f: eor_w_alx_partial(); break; case 0x160: rts_imp_partial(); break; case 0x161: adc_w_idx_partial(); break; case 0x162: per_rell_partial(); break; case 0x163: adc_w_ds_partial(); break; case 0x164: stz_w_zpg_partial(); break; case 0x165: adc_w_zpg_partial(); break; case 0x166: ror_w_zpg_partial(); break; case 0x167: adc_w_zil_partial(); break; case 0x168: pla_w_imp_partial(); break; case 0x169: adc_w_imm16_partial(); break; case 0x16a: ror_w_acc_partial(); break; case 0x16b: rtl_imp_partial(); break; case 0x16c: jmp_ind_partial(); break; case 0x16d: adc_w_aba_partial(); break; case 0x16e: ror_w_aba_partial(); break; case 0x16f: adc_w_abl_partial(); break; case 0x170: bvs_rel_partial(); break; case 0x171: adc_w_idy_partial(); break; case 0x172: adc_w_zpi_partial(); break; case 0x173: adc_w_dsy_partial(); break; case 0x174: stz_w_zpx_partial(); break; case 0x175: adc_w_zpx_partial(); break; case 0x176: ror_w_zpx_partial(); break; case 0x177: adc_w_ziy_partial(); break; case 0x178: sei_imp_partial(); break; case 0x179: adc_w_aby_partial(); break; case 0x17a: ply_w_imp_partial(); break; case 0x17b: tdc_imp_partial(); break; case 0x17c: jmp_iax_partial(); break; case 0x17d: adc_w_abx_partial(); break; case 0x17e: ror_w_abx_partial(); break; case 0x17f: adc_w_alx_partial(); break; case 0x180: bra_rel_partial(); break; case 0x181: sta_w_idx_partial(); break; case 0x182: brl_rell_partial(); break; case 0x183: sta_w_ds_partial(); break; case 0x184: sty_w_zpg_partial(); break; case 0x185: sta_w_zpg_partial(); break; case 0x186: stx_w_zpg_partial(); break; case 0x187: sta_w_zil_partial(); break; case 0x188: dey_w_imp_partial(); break; case 0x189: bit_w_imm16_partial(); break; case 0x18a: txa_w_imp_partial(); break; case 0x18b: phb_imp_partial(); break; case 0x18c: sty_w_aba_partial(); break; case 0x18d: sta_w_aba_partial(); break; case 0x18e: stx_w_aba_partial(); break; case 0x18f: sta_w_abl_partial(); break; case 0x190: bcc_rel_partial(); break; case 0x191: sta_w_idy_partial(); break; case 0x192: sta_w_zpi_partial(); break; case 0x193: sta_w_dsy_partial(); break; case 0x194: sty_w_zpx_partial(); break; case 0x195: sta_w_zpx_partial(); break; case 0x196: stx_w_zpy_partial(); break; case 0x197: sta_w_ziy_partial(); break; case 0x198: tya_w_imp_partial(); break; case 0x199: sta_w_aby_partial(); break; case 0x19a: txs_imp_partial(); break; case 0x19b: txy_w_imp_partial(); break; case 0x19c: stz_w_aba_partial(); break; case 0x19d: sta_w_abx_partial(); break; case 0x19e: stz_w_abx_partial(); break; case 0x19f: sta_w_alx_partial(); break; case 0x1a0: ldy_w_imm16_partial(); break; case 0x1a1: lda_w_idx_partial(); break; case 0x1a2: ldx_w_imm16_partial(); break; case 0x1a3: lda_w_ds_partial(); break; case 0x1a4: ldy_w_zpg_partial(); break; case 0x1a5: lda_w_zpg_partial(); break; case 0x1a6: ldx_w_zpg_partial(); break; case 0x1a7: lda_w_zil_partial(); break; case 0x1a8: tay_w_imp_partial(); break; case 0x1a9: lda_w_imm16_partial(); break; case 0x1aa: tax_w_imp_partial(); break; case 0x1ab: plb_imp_partial(); break; case 0x1ac: ldy_w_aba_partial(); break; case 0x1ad: lda_w_aba_partial(); break; case 0x1ae: ldx_w_aba_partial(); break; case 0x1af: lda_w_abl_partial(); break; case 0x1b0: bcs_rel_partial(); break; case 0x1b1: lda_w_idy_partial(); break; case 0x1b2: lda_w_zpi_partial(); break; case 0x1b3: lda_w_dsy_partial(); break; case 0x1b4: ldy_w_zpx_partial(); break; case 0x1b5: lda_w_zpx_partial(); break; case 0x1b6: ldx_w_zpy_partial(); break; case 0x1b7: lda_w_ziy_partial(); break; case 0x1b8: clv_imp_partial(); break; case 0x1b9: lda_w_aby_partial(); break; case 0x1ba: tsx_w_imp_partial(); break; case 0x1bb: tyx_w_imp_partial(); break; case 0x1bc: ldy_w_abx_partial(); break; case 0x1bd: lda_w_abx_partial(); break; case 0x1be: ldx_w_aby_partial(); break; case 0x1bf: lda_w_alx_partial(); break; case 0x1c0: cpy_w_imm16_partial(); break; case 0x1c1: cmp_w_idx_partial(); break; case 0x1c2: rep_imm_partial(); break; case 0x1c3: cmp_w_ds_partial(); break; case 0x1c4: cpy_w_zpg_partial(); break; case 0x1c5: cmp_w_zpg_partial(); break; case 0x1c6: dec_w_zpg_partial(); break; case 0x1c7: cmp_w_zil_partial(); break; case 0x1c8: iny_w_imp_partial(); break; case 0x1c9: cmp_w_imm16_partial(); break; case 0x1ca: dex_w_imp_partial(); break; case 0x1cb: wai_imp_partial(); break; case 0x1cc: cpy_w_aba_partial(); break; case 0x1cd: cmp_w_aba_partial(); break; case 0x1ce: dec_w_aba_partial(); break; case 0x1cf: cmp_w_abl_partial(); break; case 0x1d0: bne_rel_partial(); break; case 0x1d1: cmp_w_idy_partial(); break; case 0x1d2: cmp_w_zpi_partial(); break; case 0x1d3: cmp_w_dsy_partial(); break; case 0x1d4: pei_zpg_partial(); break; case 0x1d5: cmp_w_zpx_partial(); break; case 0x1d6: dec_w_zpx_partial(); break; case 0x1d7: cmp_w_ziy_partial(); break; case 0x1d8: cld_imp_partial(); break; case 0x1d9: cmp_w_aby_partial(); break; case 0x1da: phx_w_imp_partial(); break; case 0x1db: stp_imp_partial(); break; case 0x1dc: jml_ind_partial(); break; case 0x1dd: cmp_w_abx_partial(); break; case 0x1de: dec_w_abx_partial(); break; case 0x1df: cmp_w_alx_partial(); break; case 0x1e0: cpx_w_imm16_partial(); break; case 0x1e1: sbc_w_idx_partial(); break; case 0x1e2: sep_imm_partial(); break; case 0x1e3: sbc_w_ds_partial(); break; case 0x1e4: cpx_w_zpg_partial(); break; case 0x1e5: sbc_w_zpg_partial(); break; case 0x1e6: inc_w_zpg_partial(); break; case 0x1e7: sbc_w_zil_partial(); break; case 0x1e8: inx_w_imp_partial(); break; case 0x1e9: sbc_w_imm16_partial(); break; case 0x1ea: nop_imp_partial(); break; case 0x1eb: xba_imp_partial(); break; case 0x1ec: cpx_w_aba_partial(); break; case 0x1ed: sbc_w_aba_partial(); break; case 0x1ee: inc_w_aba_partial(); break; case 0x1ef: sbc_w_abl_partial(); break; case 0x1f0: beq_rel_partial(); break; case 0x1f1: sbc_w_idy_partial(); break; case 0x1f2: sbc_w_zpi_partial(); break; case 0x1f3: sbc_w_dsy_partial(); break; case 0x1f4: pea_imm16_partial(); break; case 0x1f5: sbc_w_zpx_partial(); break; case 0x1f6: inc_w_zpx_partial(); break; case 0x1f7: sbc_w_ziy_partial(); break; case 0x1f8: sed_imp_partial(); break; case 0x1f9: sbc_w_aby_partial(); break; case 0x1fa: plx_w_imp_partial(); break; case 0x1fb: xce_imp_partial(); break; case 0x1fc: jsr_iax_partial(); break; case 0x1fd: sbc_w_abx_partial(); break; case 0x1fe: inc_w_abx_partial(); break; case 0x1ff: sbc_w_alx_partial(); break; case 0x200: brk_imm_partial(); break; case 0x201: ora_idx_partial(); break; case 0x202: cop_imm_partial(); break; case 0x203: ora_ds_partial(); break; case 0x204: tsb_zpg_partial(); break; case 0x205: ora_zpg_partial(); break; case 0x206: asl_zpg_partial(); break; case 0x207: ora_zil_partial(); break; case 0x208: php_imp_partial(); break; case 0x209: ora_imm_partial(); break; case 0x20a: asl_acc_partial(); break; case 0x20b: phd_imp_partial(); break; case 0x20c: tsb_aba_partial(); break; case 0x20d: ora_aba_partial(); break; case 0x20e: asl_aba_partial(); break; case 0x20f: ora_abl_partial(); break; case 0x210: bpl_rel_partial(); break; case 0x211: ora_idy_partial(); break; case 0x212: ora_zpi_partial(); break; case 0x213: ora_dsy_partial(); break; case 0x214: trb_zpg_partial(); break; case 0x215: ora_zpx_partial(); break; case 0x216: asl_zpx_partial(); break; case 0x217: ora_ziy_partial(); break; case 0x218: clc_imp_partial(); break; case 0x219: ora_aby_partial(); break; case 0x21a: inc_acc_partial(); break; case 0x21b: tcs_imp_partial(); break; case 0x21c: trb_aba_partial(); break; case 0x21d: ora_abx_partial(); break; case 0x21e: asl_abx_partial(); break; case 0x21f: ora_alx_partial(); break; case 0x220: jsr_adr_partial(); break; case 0x221: and_idx_partial(); break; case 0x222: jsl_abl_partial(); break; case 0x223: and_ds_partial(); break; case 0x224: bit_zpg_partial(); break; case 0x225: and_zpg_partial(); break; case 0x226: rol_zpg_partial(); break; case 0x227: and_zil_partial(); break; case 0x228: plp_imp_partial(); break; case 0x229: and_imm_partial(); break; case 0x22a: rol_acc_partial(); break; case 0x22b: pld_imp_partial(); break; case 0x22c: bit_aba_partial(); break; case 0x22d: and_aba_partial(); break; case 0x22e: rol_aba_partial(); break; case 0x22f: and_abl_partial(); break; case 0x230: bmi_rel_partial(); break; case 0x231: and_idy_partial(); break; case 0x232: and_zpi_partial(); break; case 0x233: and_dsy_partial(); break; case 0x234: bit_zpx_partial(); break; case 0x235: and_zpx_partial(); break; case 0x236: rol_zpx_partial(); break; case 0x237: and_ziy_partial(); break; case 0x238: sec_imp_partial(); break; case 0x239: and_aby_partial(); break; case 0x23a: dec_acc_partial(); break; case 0x23b: tsc_imp_partial(); break; case 0x23c: bit_abx_partial(); break; case 0x23d: and_abx_partial(); break; case 0x23e: rol_abx_partial(); break; case 0x23f: and_alx_partial(); break; case 0x240: rti_imp_partial(); break; case 0x241: eor_idx_partial(); break; case 0x242: wdm_imm_partial(); break; case 0x243: eor_ds_partial(); break; case 0x244: mvp_w_dbf_partial(); break; case 0x245: eor_zpg_partial(); break; case 0x246: lsr_zpg_partial(); break; case 0x247: eor_zil_partial(); break; case 0x248: pha_imp_partial(); break; case 0x249: eor_imm_partial(); break; case 0x24a: lsr_acc_partial(); break; case 0x24b: phk_imp_partial(); break; case 0x24c: jmp_adr_partial(); break; case 0x24d: eor_aba_partial(); break; case 0x24e: lsr_aba_partial(); break; case 0x24f: eor_abl_partial(); break; case 0x250: bvc_rel_partial(); break; case 0x251: eor_idy_partial(); break; case 0x252: eor_zpi_partial(); break; case 0x253: eor_dsy_partial(); break; case 0x254: mvn_w_dbf_partial(); break; case 0x255: eor_zpx_partial(); break; case 0x256: lsr_zpx_partial(); break; case 0x257: eor_ziy_partial(); break; case 0x258: cli_imp_partial(); break; case 0x259: eor_aby_partial(); break; case 0x25a: phy_w_imp_partial(); break; case 0x25b: tcd_imp_partial(); break; case 0x25c: jmp_abl_partial(); break; case 0x25d: eor_abx_partial(); break; case 0x25e: lsr_abx_partial(); break; case 0x25f: eor_alx_partial(); break; case 0x260: rts_imp_partial(); break; case 0x261: adc_idx_partial(); break; case 0x262: per_rell_partial(); break; case 0x263: adc_ds_partial(); break; case 0x264: stz_zpg_partial(); break; case 0x265: adc_zpg_partial(); break; case 0x266: ror_zpg_partial(); break; case 0x267: adc_zil_partial(); break; case 0x268: pla_imp_partial(); break; case 0x269: adc_imm_partial(); break; case 0x26a: ror_acc_partial(); break; case 0x26b: rtl_imp_partial(); break; case 0x26c: jmp_ind_partial(); break; case 0x26d: adc_aba_partial(); break; case 0x26e: ror_aba_partial(); break; case 0x26f: adc_abl_partial(); break; case 0x270: bvs_rel_partial(); break; case 0x271: adc_idy_partial(); break; case 0x272: adc_zpi_partial(); break; case 0x273: adc_dsy_partial(); break; case 0x274: stz_zpx_partial(); break; case 0x275: adc_zpx_partial(); break; case 0x276: ror_zpx_partial(); break; case 0x277: adc_ziy_partial(); break; case 0x278: sei_imp_partial(); break; case 0x279: adc_aby_partial(); break; case 0x27a: ply_w_imp_partial(); break; case 0x27b: tdc_imp_partial(); break; case 0x27c: jmp_iax_partial(); break; case 0x27d: adc_abx_partial(); break; case 0x27e: ror_abx_partial(); break; case 0x27f: adc_alx_partial(); break; case 0x280: bra_rel_partial(); break; case 0x281: sta_idx_partial(); break; case 0x282: brl_rell_partial(); break; case 0x283: sta_ds_partial(); break; case 0x284: sty_w_zpg_partial(); break; case 0x285: sta_zpg_partial(); break; case 0x286: stx_w_zpg_partial(); break; case 0x287: sta_zil_partial(); break; case 0x288: dey_w_imp_partial(); break; case 0x289: bit_imm_partial(); break; case 0x28a: txa_imp_partial(); break; case 0x28b: phb_imp_partial(); break; case 0x28c: sty_w_aba_partial(); break; case 0x28d: sta_aba_partial(); break; case 0x28e: stx_w_aba_partial(); break; case 0x28f: sta_abl_partial(); break; case 0x290: bcc_rel_partial(); break; case 0x291: sta_idy_partial(); break; case 0x292: sta_zpi_partial(); break; case 0x293: sta_dsy_partial(); break; case 0x294: sty_w_zpx_partial(); break; case 0x295: sta_zpx_partial(); break; case 0x296: stx_w_zpy_partial(); break; case 0x297: sta_ziy_partial(); break; case 0x298: tya_imp_partial(); break; case 0x299: sta_aby_partial(); break; case 0x29a: txs_imp_partial(); break; case 0x29b: txy_w_imp_partial(); break; case 0x29c: stz_aba_partial(); break; case 0x29d: sta_abx_partial(); break; case 0x29e: stz_abx_partial(); break; case 0x29f: sta_alx_partial(); break; case 0x2a0: ldy_w_imm16_partial(); break; case 0x2a1: lda_idx_partial(); break; case 0x2a2: ldx_w_imm16_partial(); break; case 0x2a3: lda_ds_partial(); break; case 0x2a4: ldy_w_zpg_partial(); break; case 0x2a5: lda_zpg_partial(); break; case 0x2a6: ldx_w_zpg_partial(); break; case 0x2a7: lda_zil_partial(); break; case 0x2a8: tay_w_imp_partial(); break; case 0x2a9: lda_imm_partial(); break; case 0x2aa: tax_w_imp_partial(); break; case 0x2ab: plb_imp_partial(); break; case 0x2ac: ldy_w_aba_partial(); break; case 0x2ad: lda_aba_partial(); break; case 0x2ae: ldx_w_aba_partial(); break; case 0x2af: lda_abl_partial(); break; case 0x2b0: bcs_rel_partial(); break; case 0x2b1: lda_idy_partial(); break; case 0x2b2: lda_zpi_partial(); break; case 0x2b3: lda_dsy_partial(); break; case 0x2b4: ldy_w_zpx_partial(); break; case 0x2b5: lda_zpx_partial(); break; case 0x2b6: ldx_w_zpy_partial(); break; case 0x2b7: lda_ziy_partial(); break; case 0x2b8: clv_imp_partial(); break; case 0x2b9: lda_aby_partial(); break; case 0x2ba: tsx_w_imp_partial(); break; case 0x2bb: tyx_w_imp_partial(); break; case 0x2bc: ldy_w_abx_partial(); break; case 0x2bd: lda_abx_partial(); break; case 0x2be: ldx_w_aby_partial(); break; case 0x2bf: lda_alx_partial(); break; case 0x2c0: cpy_w_imm16_partial(); break; case 0x2c1: cmp_idx_partial(); break; case 0x2c2: rep_imm_partial(); break; case 0x2c3: cmp_ds_partial(); break; case 0x2c4: cpy_w_zpg_partial(); break; case 0x2c5: cmp_zpg_partial(); break; case 0x2c6: dec_zpg_partial(); break; case 0x2c7: cmp_zil_partial(); break; case 0x2c8: iny_w_imp_partial(); break; case 0x2c9: cmp_imm_partial(); break; case 0x2ca: dex_w_imp_partial(); break; case 0x2cb: wai_imp_partial(); break; case 0x2cc: cpy_w_aba_partial(); break; case 0x2cd: cmp_aba_partial(); break; case 0x2ce: dec_aba_partial(); break; case 0x2cf: cmp_abl_partial(); break; case 0x2d0: bne_rel_partial(); break; case 0x2d1: cmp_idy_partial(); break; case 0x2d2: cmp_zpi_partial(); break; case 0x2d3: cmp_dsy_partial(); break; case 0x2d4: pei_zpg_partial(); break; case 0x2d5: cmp_zpx_partial(); break; case 0x2d6: dec_zpx_partial(); break; case 0x2d7: cmp_ziy_partial(); break; case 0x2d8: cld_imp_partial(); break; case 0x2d9: cmp_aby_partial(); break; case 0x2da: phx_w_imp_partial(); break; case 0x2db: stp_imp_partial(); break; case 0x2dc: jml_ind_partial(); break; case 0x2dd: cmp_abx_partial(); break; case 0x2de: dec_abx_partial(); break; case 0x2df: cmp_alx_partial(); break; case 0x2e0: cpx_w_imm16_partial(); break; case 0x2e1: sbc_idx_partial(); break; case 0x2e2: sep_imm_partial(); break; case 0x2e3: sbc_ds_partial(); break; case 0x2e4: cpx_w_zpg_partial(); break; case 0x2e5: sbc_zpg_partial(); break; case 0x2e6: inc_zpg_partial(); break; case 0x2e7: sbc_zil_partial(); break; case 0x2e8: inx_w_imp_partial(); break; case 0x2e9: sbc_imm_partial(); break; case 0x2ea: nop_imp_partial(); break; case 0x2eb: xba_imp_partial(); break; case 0x2ec: cpx_w_aba_partial(); break; case 0x2ed: sbc_aba_partial(); break; case 0x2ee: inc_aba_partial(); break; case 0x2ef: sbc_abl_partial(); break; case 0x2f0: beq_rel_partial(); break; case 0x2f1: sbc_idy_partial(); break; case 0x2f2: sbc_zpi_partial(); break; case 0x2f3: sbc_dsy_partial(); break; case 0x2f4: pea_imm16_partial(); break; case 0x2f5: sbc_zpx_partial(); break; case 0x2f6: inc_zpx_partial(); break; case 0x2f7: sbc_ziy_partial(); break; case 0x2f8: sed_imp_partial(); break; case 0x2f9: sbc_aby_partial(); break; case 0x2fa: plx_w_imp_partial(); break; case 0x2fb: xce_imp_partial(); break; case 0x2fc: jsr_iax_partial(); break; case 0x2fd: sbc_abx_partial(); break; case 0x2fe: inc_abx_partial(); break; case 0x2ff: sbc_alx_partial(); break; case 0x300: brk_imm_partial(); break; case 0x301: ora_w_idx_partial(); break; case 0x302: cop_imm_partial(); break; case 0x303: ora_w_ds_partial(); break; case 0x304: tsb_w_zpg_partial(); break; case 0x305: ora_w_zpg_partial(); break; case 0x306: asl_w_zpg_partial(); break; case 0x307: ora_w_zil_partial(); break; case 0x308: php_imp_partial(); break; case 0x309: ora_w_imm16_partial(); break; case 0x30a: asl_w_acc_partial(); break; case 0x30b: phd_imp_partial(); break; case 0x30c: tsb_w_aba_partial(); break; case 0x30d: ora_w_aba_partial(); break; case 0x30e: asl_w_aba_partial(); break; case 0x30f: ora_w_abl_partial(); break; case 0x310: bpl_rel_partial(); break; case 0x311: ora_w_idy_partial(); break; case 0x312: ora_w_zpi_partial(); break; case 0x313: ora_w_dsy_partial(); break; case 0x314: trb_w_zpg_partial(); break; case 0x315: ora_w_zpx_partial(); break; case 0x316: asl_w_zpx_partial(); break; case 0x317: ora_w_ziy_partial(); break; case 0x318: clc_imp_partial(); break; case 0x319: ora_w_aby_partial(); break; case 0x31a: inc_w_acc_partial(); break; case 0x31b: tcs_imp_partial(); break; case 0x31c: trb_w_aba_partial(); break; case 0x31d: ora_w_abx_partial(); break; case 0x31e: asl_w_abx_partial(); break; case 0x31f: ora_w_alx_partial(); break; case 0x320: jsr_adr_partial(); break; case 0x321: and_w_idx_partial(); break; case 0x322: jsl_abl_partial(); break; case 0x323: and_w_ds_partial(); break; case 0x324: bit_w_zpg_partial(); break; case 0x325: and_w_zpg_partial(); break; case 0x326: rol_w_zpg_partial(); break; case 0x327: and_w_zil_partial(); break; case 0x328: plp_imp_partial(); break; case 0x329: and_w_imm16_partial(); break; case 0x32a: rol_w_acc_partial(); break; case 0x32b: pld_imp_partial(); break; case 0x32c: bit_w_aba_partial(); break; case 0x32d: and_w_aba_partial(); break; case 0x32e: rol_w_aba_partial(); break; case 0x32f: and_w_abl_partial(); break; case 0x330: bmi_rel_partial(); break; case 0x331: and_w_idy_partial(); break; case 0x332: and_w_zpi_partial(); break; case 0x333: and_w_dsy_partial(); break; case 0x334: bit_w_zpx_partial(); break; case 0x335: and_w_zpx_partial(); break; case 0x336: rol_w_zpx_partial(); break; case 0x337: and_w_ziy_partial(); break; case 0x338: sec_imp_partial(); break; case 0x339: and_w_aby_partial(); break; case 0x33a: dec_w_acc_partial(); break; case 0x33b: tsc_imp_partial(); break; case 0x33c: bit_w_abx_partial(); break; case 0x33d: and_w_abx_partial(); break; case 0x33e: rol_w_abx_partial(); break; case 0x33f: and_w_alx_partial(); break; case 0x340: rti_imp_partial(); break; case 0x341: eor_w_idx_partial(); break; case 0x342: wdm_imm_partial(); break; case 0x343: eor_w_ds_partial(); break; case 0x344: mvp_dbf_partial(); break; case 0x345: eor_w_zpg_partial(); break; case 0x346: lsr_w_zpg_partial(); break; case 0x347: eor_w_zil_partial(); break; case 0x348: pha_w_imp_partial(); break; case 0x349: eor_w_imm16_partial(); break; case 0x34a: lsr_w_acc_partial(); break; case 0x34b: phk_imp_partial(); break; case 0x34c: jmp_adr_partial(); break; case 0x34d: eor_w_aba_partial(); break; case 0x34e: lsr_w_aba_partial(); break; case 0x34f: eor_w_abl_partial(); break; case 0x350: bvc_rel_partial(); break; case 0x351: eor_w_idy_partial(); break; case 0x352: eor_w_zpi_partial(); break; case 0x353: eor_w_dsy_partial(); break; case 0x354: mvn_dbf_partial(); break; case 0x355: eor_w_zpx_partial(); break; case 0x356: lsr_w_zpx_partial(); break; case 0x357: eor_w_ziy_partial(); break; case 0x358: cli_imp_partial(); break; case 0x359: eor_w_aby_partial(); break; case 0x35a: phy_imp_partial(); break; case 0x35b: tcd_imp_partial(); break; case 0x35c: jmp_abl_partial(); break; case 0x35d: eor_w_abx_partial(); break; case 0x35e: lsr_w_abx_partial(); break; case 0x35f: eor_w_alx_partial(); break; case 0x360: rts_imp_partial(); break; case 0x361: adc_w_idx_partial(); break; case 0x362: per_rell_partial(); break; case 0x363: adc_w_ds_partial(); break; case 0x364: stz_w_zpg_partial(); break; case 0x365: adc_w_zpg_partial(); break; case 0x366: ror_w_zpg_partial(); break; case 0x367: adc_w_zil_partial(); break; case 0x368: pla_w_imp_partial(); break; case 0x369: adc_w_imm16_partial(); break; case 0x36a: ror_w_acc_partial(); break; case 0x36b: rtl_imp_partial(); break; case 0x36c: jmp_ind_partial(); break; case 0x36d: adc_w_aba_partial(); break; case 0x36e: ror_w_aba_partial(); break; case 0x36f: adc_w_abl_partial(); break; case 0x370: bvs_rel_partial(); break; case 0x371: adc_w_idy_partial(); break; case 0x372: adc_w_zpi_partial(); break; case 0x373: adc_w_dsy_partial(); break; case 0x374: stz_w_zpx_partial(); break; case 0x375: adc_w_zpx_partial(); break; case 0x376: ror_w_zpx_partial(); break; case 0x377: adc_w_ziy_partial(); break; case 0x378: sei_imp_partial(); break; case 0x379: adc_w_aby_partial(); break; case 0x37a: ply_imp_partial(); break; case 0x37b: tdc_imp_partial(); break; case 0x37c: jmp_iax_partial(); break; case 0x37d: adc_w_abx_partial(); break; case 0x37e: ror_w_abx_partial(); break; case 0x37f: adc_w_alx_partial(); break; case 0x380: bra_rel_partial(); break; case 0x381: sta_w_idx_partial(); break; case 0x382: brl_rell_partial(); break; case 0x383: sta_w_ds_partial(); break; case 0x384: sty_zpg_partial(); break; case 0x385: sta_w_zpg_partial(); break; case 0x386: stx_zpg_partial(); break; case 0x387: sta_w_zil_partial(); break; case 0x388: dey_imp_partial(); break; case 0x389: bit_w_imm16_partial(); break; case 0x38a: txa_w_imp_partial(); break; case 0x38b: phb_imp_partial(); break; case 0x38c: sty_aba_partial(); break; case 0x38d: sta_w_aba_partial(); break; case 0x38e: stx_aba_partial(); break; case 0x38f: sta_w_abl_partial(); break; case 0x390: bcc_rel_partial(); break; case 0x391: sta_w_idy_partial(); break; case 0x392: sta_w_zpi_partial(); break; case 0x393: sta_w_dsy_partial(); break; case 0x394: sty_zpx_partial(); break; case 0x395: sta_w_zpx_partial(); break; case 0x396: stx_zpy_partial(); break; case 0x397: sta_w_ziy_partial(); break; case 0x398: tya_w_imp_partial(); break; case 0x399: sta_w_aby_partial(); break; case 0x39a: txs_imp_partial(); break; case 0x39b: txy_imp_partial(); break; case 0x39c: stz_w_aba_partial(); break; case 0x39d: sta_w_abx_partial(); break; case 0x39e: stz_w_abx_partial(); break; case 0x39f: sta_w_alx_partial(); break; case 0x3a0: ldy_imm_partial(); break; case 0x3a1: lda_w_idx_partial(); break; case 0x3a2: ldx_imm_partial(); break; case 0x3a3: lda_w_ds_partial(); break; case 0x3a4: ldy_zpg_partial(); break; case 0x3a5: lda_w_zpg_partial(); break; case 0x3a6: ldx_zpg_partial(); break; case 0x3a7: lda_w_zil_partial(); break; case 0x3a8: tay_imp_partial(); break; case 0x3a9: lda_w_imm16_partial(); break; case 0x3aa: tax_imp_partial(); break; case 0x3ab: plb_imp_partial(); break; case 0x3ac: ldy_aba_partial(); break; case 0x3ad: lda_w_aba_partial(); break; case 0x3ae: ldx_aba_partial(); break; case 0x3af: lda_w_abl_partial(); break; case 0x3b0: bcs_rel_partial(); break; case 0x3b1: lda_w_idy_partial(); break; case 0x3b2: lda_w_zpi_partial(); break; case 0x3b3: lda_w_dsy_partial(); break; case 0x3b4: ldy_zpx_partial(); break; case 0x3b5: lda_w_zpx_partial(); break; case 0x3b6: ldx_zpy_partial(); break; case 0x3b7: lda_w_ziy_partial(); break; case 0x3b8: clv_imp_partial(); break; case 0x3b9: lda_w_aby_partial(); break; case 0x3ba: tsx_imp_partial(); break; case 0x3bb: tyx_imp_partial(); break; case 0x3bc: ldy_abx_partial(); break; case 0x3bd: lda_w_abx_partial(); break; case 0x3be: ldx_aby_partial(); break; case 0x3bf: lda_w_alx_partial(); break; case 0x3c0: cpy_imm_partial(); break; case 0x3c1: cmp_w_idx_partial(); break; case 0x3c2: rep_imm_partial(); break; case 0x3c3: cmp_w_ds_partial(); break; case 0x3c4: cpy_zpg_partial(); break; case 0x3c5: cmp_w_zpg_partial(); break; case 0x3c6: dec_w_zpg_partial(); break; case 0x3c7: cmp_w_zil_partial(); break; case 0x3c8: iny_imp_partial(); break; case 0x3c9: cmp_w_imm16_partial(); break; case 0x3ca: dex_imp_partial(); break; case 0x3cb: wai_imp_partial(); break; case 0x3cc: cpy_aba_partial(); break; case 0x3cd: cmp_w_aba_partial(); break; case 0x3ce: dec_w_aba_partial(); break; case 0x3cf: cmp_w_abl_partial(); break; case 0x3d0: bne_rel_partial(); break; case 0x3d1: cmp_w_idy_partial(); break; case 0x3d2: cmp_w_zpi_partial(); break; case 0x3d3: cmp_w_dsy_partial(); break; case 0x3d4: pei_zpg_partial(); break; case 0x3d5: cmp_w_zpx_partial(); break; case 0x3d6: dec_w_zpx_partial(); break; case 0x3d7: cmp_w_ziy_partial(); break; case 0x3d8: cld_imp_partial(); break; case 0x3d9: cmp_w_aby_partial(); break; case 0x3da: phx_imp_partial(); break; case 0x3db: stp_imp_partial(); break; case 0x3dc: jml_ind_partial(); break; case 0x3dd: cmp_w_abx_partial(); break; case 0x3de: dec_w_abx_partial(); break; case 0x3df: cmp_w_alx_partial(); break; case 0x3e0: cpx_imm_partial(); break; case 0x3e1: sbc_w_idx_partial(); break; case 0x3e2: sep_imm_partial(); break; case 0x3e3: sbc_w_ds_partial(); break; case 0x3e4: cpx_zpg_partial(); break; case 0x3e5: sbc_w_zpg_partial(); break; case 0x3e6: inc_w_zpg_partial(); break; case 0x3e7: sbc_w_zil_partial(); break; case 0x3e8: inx_imp_partial(); break; case 0x3e9: sbc_w_imm16_partial(); break; case 0x3ea: nop_imp_partial(); break; case 0x3eb: xba_imp_partial(); break; case 0x3ec: cpx_aba_partial(); break; case 0x3ed: sbc_w_aba_partial(); break; case 0x3ee: inc_w_aba_partial(); break; case 0x3ef: sbc_w_abl_partial(); break; case 0x3f0: beq_rel_partial(); break; case 0x3f1: sbc_w_idy_partial(); break; case 0x3f2: sbc_w_zpi_partial(); break; case 0x3f3: sbc_w_dsy_partial(); break; case 0x3f4: pea_imm16_partial(); break; case 0x3f5: sbc_w_zpx_partial(); break; case 0x3f6: inc_w_zpx_partial(); break; case 0x3f7: sbc_w_ziy_partial(); break; case 0x3f8: sed_imp_partial(); break; case 0x3f9: sbc_w_aby_partial(); break; case 0x3fa: plx_imp_partial(); break; case 0x3fb: xce_imp_partial(); break; case 0x3fc: jsr_iax_partial(); break; case 0x3fd: sbc_w_abx_partial(); break; case 0x3fe: inc_w_abx_partial(); break; case 0x3ff: sbc_w_alx_partial(); break; case 0x400: brk_imm_partial(); break; case 0x401: ora_idx_partial(); break; case 0x402: cop_imm_partial(); break; case 0x403: ora_ds_partial(); break; case 0x404: tsb_zpg_partial(); break; case 0x405: ora_zpg_partial(); break; case 0x406: asl_zpg_partial(); break; case 0x407: ora_zil_partial(); break; case 0x408: php_imp_partial(); break; case 0x409: ora_imm_partial(); break; case 0x40a: asl_acc_partial(); break; case 0x40b: phd_imp_partial(); break; case 0x40c: tsb_aba_partial(); break; case 0x40d: ora_aba_partial(); break; case 0x40e: asl_aba_partial(); break; case 0x40f: ora_abl_partial(); break; case 0x410: bpl_rel_partial(); break; case 0x411: ora_idy_partial(); break; case 0x412: ora_zpi_partial(); break; case 0x413: ora_dsy_partial(); break; case 0x414: trb_zpg_partial(); break; case 0x415: ora_zpx_partial(); break; case 0x416: asl_zpx_partial(); break; case 0x417: ora_ziy_partial(); break; case 0x418: clc_imp_partial(); break; case 0x419: ora_aby_partial(); break; case 0x41a: inc_acc_partial(); break; case 0x41b: tcs_imp_partial(); break; case 0x41c: trb_aba_partial(); break; case 0x41d: ora_abx_partial(); break; case 0x41e: asl_abx_partial(); break; case 0x41f: ora_alx_partial(); break; case 0x420: jsr_adr_partial(); break; case 0x421: and_idx_partial(); break; case 0x422: jsl_abl_partial(); break; case 0x423: and_ds_partial(); break; case 0x424: bit_zpg_partial(); break; case 0x425: and_zpg_partial(); break; case 0x426: rol_zpg_partial(); break; case 0x427: and_zil_partial(); break; case 0x428: plp_imp_partial(); break; case 0x429: and_imm_partial(); break; case 0x42a: rol_acc_partial(); break; case 0x42b: pld_imp_partial(); break; case 0x42c: bit_aba_partial(); break; case 0x42d: and_aba_partial(); break; case 0x42e: rol_aba_partial(); break; case 0x42f: and_abl_partial(); break; case 0x430: bmi_rel_partial(); break; case 0x431: and_idy_partial(); break; case 0x432: and_zpi_partial(); break; case 0x433: and_dsy_partial(); break; case 0x434: bit_zpx_partial(); break; case 0x435: and_zpx_partial(); break; case 0x436: rol_zpx_partial(); break; case 0x437: and_ziy_partial(); break; case 0x438: sec_imp_partial(); break; case 0x439: and_aby_partial(); break; case 0x43a: dec_acc_partial(); break; case 0x43b: tsc_imp_partial(); break; case 0x43c: bit_abx_partial(); break; case 0x43d: and_abx_partial(); break; case 0x43e: rol_abx_partial(); break; case 0x43f: and_alx_partial(); break; case 0x440: rti_imp_partial(); break; case 0x441: eor_idx_partial(); break; case 0x442: wdm_imm_partial(); break; case 0x443: eor_ds_partial(); break; case 0x444: mvp_dbf_partial(); break; case 0x445: eor_zpg_partial(); break; case 0x446: lsr_zpg_partial(); break; case 0x447: eor_zil_partial(); break; case 0x448: pha_imp_partial(); break; case 0x449: eor_imm_partial(); break; case 0x44a: lsr_acc_partial(); break; case 0x44b: phk_imp_partial(); break; case 0x44c: jmp_adr_partial(); break; case 0x44d: eor_aba_partial(); break; case 0x44e: lsr_aba_partial(); break; case 0x44f: eor_abl_partial(); break; case 0x450: bvc_rel_partial(); break; case 0x451: eor_idy_partial(); break; case 0x452: eor_zpi_partial(); break; case 0x453: eor_dsy_partial(); break; case 0x454: mvn_dbf_partial(); break; case 0x455: eor_zpx_partial(); break; case 0x456: lsr_zpx_partial(); break; case 0x457: eor_ziy_partial(); break; case 0x458: cli_imp_partial(); break; case 0x459: eor_aby_partial(); break; case 0x45a: phy_imp_partial(); break; case 0x45b: tcd_imp_partial(); break; case 0x45c: jmp_abl_partial(); break; case 0x45d: eor_abx_partial(); break; case 0x45e: lsr_abx_partial(); break; case 0x45f: eor_alx_partial(); break; case 0x460: rts_imp_partial(); break; case 0x461: adc_idx_partial(); break; case 0x462: per_rell_partial(); break; case 0x463: adc_ds_partial(); break; case 0x464: stz_zpg_partial(); break; case 0x465: adc_zpg_partial(); break; case 0x466: ror_zpg_partial(); break; case 0x467: adc_zil_partial(); break; case 0x468: pla_imp_partial(); break; case 0x469: adc_imm_partial(); break; case 0x46a: ror_acc_partial(); break; case 0x46b: rtl_imp_partial(); break; case 0x46c: jmp_ind_partial(); break; case 0x46d: adc_aba_partial(); break; case 0x46e: ror_aba_partial(); break; case 0x46f: adc_abl_partial(); break; case 0x470: bvs_rel_partial(); break; case 0x471: adc_idy_partial(); break; case 0x472: adc_zpi_partial(); break; case 0x473: adc_dsy_partial(); break; case 0x474: stz_zpx_partial(); break; case 0x475: adc_zpx_partial(); break; case 0x476: ror_zpx_partial(); break; case 0x477: adc_ziy_partial(); break; case 0x478: sei_imp_partial(); break; case 0x479: adc_aby_partial(); break; case 0x47a: ply_imp_partial(); break; case 0x47b: tdc_imp_partial(); break; case 0x47c: jmp_iax_partial(); break; case 0x47d: adc_abx_partial(); break; case 0x47e: ror_abx_partial(); break; case 0x47f: adc_alx_partial(); break; case 0x480: bra_rel_partial(); break; case 0x481: sta_idx_partial(); break; case 0x482: brl_rell_partial(); break; case 0x483: sta_ds_partial(); break; case 0x484: sty_zpg_partial(); break; case 0x485: sta_zpg_partial(); break; case 0x486: stx_zpg_partial(); break; case 0x487: sta_zil_partial(); break; case 0x488: dey_imp_partial(); break; case 0x489: bit_imm_partial(); break; case 0x48a: txa_imp_partial(); break; case 0x48b: phb_imp_partial(); break; case 0x48c: sty_aba_partial(); break; case 0x48d: sta_aba_partial(); break; case 0x48e: stx_aba_partial(); break; case 0x48f: sta_abl_partial(); break; case 0x490: bcc_rel_partial(); break; case 0x491: sta_idy_partial(); break; case 0x492: sta_zpi_partial(); break; case 0x493: sta_dsy_partial(); break; case 0x494: sty_zpx_partial(); break; case 0x495: sta_zpx_partial(); break; case 0x496: stx_zpy_partial(); break; case 0x497: sta_ziy_partial(); break; case 0x498: tya_imp_partial(); break; case 0x499: sta_aby_partial(); break; case 0x49a: txs_imp_partial(); break; case 0x49b: txy_imp_partial(); break; case 0x49c: stz_aba_partial(); break; case 0x49d: sta_abx_partial(); break; case 0x49e: stz_abx_partial(); break; case 0x49f: sta_alx_partial(); break; case 0x4a0: ldy_imm_partial(); break; case 0x4a1: lda_idx_partial(); break; case 0x4a2: ldx_imm_partial(); break; case 0x4a3: lda_ds_partial(); break; case 0x4a4: ldy_zpg_partial(); break; case 0x4a5: lda_zpg_partial(); break; case 0x4a6: ldx_zpg_partial(); break; case 0x4a7: lda_zil_partial(); break; case 0x4a8: tay_imp_partial(); break; case 0x4a9: lda_imm_partial(); break; case 0x4aa: tax_imp_partial(); break; case 0x4ab: plb_imp_partial(); break; case 0x4ac: ldy_aba_partial(); break; case 0x4ad: lda_aba_partial(); break; case 0x4ae: ldx_aba_partial(); break; case 0x4af: lda_abl_partial(); break; case 0x4b0: bcs_rel_partial(); break; case 0x4b1: lda_idy_partial(); break; case 0x4b2: lda_zpi_partial(); break; case 0x4b3: lda_dsy_partial(); break; case 0x4b4: ldy_zpx_partial(); break; case 0x4b5: lda_zpx_partial(); break; case 0x4b6: ldx_zpy_partial(); break; case 0x4b7: lda_ziy_partial(); break; case 0x4b8: clv_imp_partial(); break; case 0x4b9: lda_aby_partial(); break; case 0x4ba: tsx_imp_partial(); break; case 0x4bb: tyx_imp_partial(); break; case 0x4bc: ldy_abx_partial(); break; case 0x4bd: lda_abx_partial(); break; case 0x4be: ldx_aby_partial(); break; case 0x4bf: lda_alx_partial(); break; case 0x4c0: cpy_imm_partial(); break; case 0x4c1: cmp_idx_partial(); break; case 0x4c2: rep_imm_partial(); break; case 0x4c3: cmp_ds_partial(); break; case 0x4c4: cpy_zpg_partial(); break; case 0x4c5: cmp_zpg_partial(); break; case 0x4c6: dec_zpg_partial(); break; case 0x4c7: cmp_zil_partial(); break; case 0x4c8: iny_imp_partial(); break; case 0x4c9: cmp_imm_partial(); break; case 0x4ca: dex_imp_partial(); break; case 0x4cb: wai_imp_partial(); break; case 0x4cc: cpy_aba_partial(); break; case 0x4cd: cmp_aba_partial(); break; case 0x4ce: dec_aba_partial(); break; case 0x4cf: cmp_abl_partial(); break; case 0x4d0: bne_rel_partial(); break; case 0x4d1: cmp_idy_partial(); break; case 0x4d2: cmp_zpi_partial(); break; case 0x4d3: cmp_dsy_partial(); break; case 0x4d4: pei_zpg_partial(); break; case 0x4d5: cmp_zpx_partial(); break; case 0x4d6: dec_zpx_partial(); break; case 0x4d7: cmp_ziy_partial(); break; case 0x4d8: cld_imp_partial(); break; case 0x4d9: cmp_aby_partial(); break; case 0x4da: phx_imp_partial(); break; case 0x4db: stp_imp_partial(); break; case 0x4dc: jml_ind_partial(); break; case 0x4dd: cmp_abx_partial(); break; case 0x4de: dec_abx_partial(); break; case 0x4df: cmp_alx_partial(); break; case 0x4e0: cpx_imm_partial(); break; case 0x4e1: sbc_idx_partial(); break; case 0x4e2: sep_imm_partial(); break; case 0x4e3: sbc_ds_partial(); break; case 0x4e4: cpx_zpg_partial(); break; case 0x4e5: sbc_zpg_partial(); break; case 0x4e6: inc_zpg_partial(); break; case 0x4e7: sbc_zil_partial(); break; case 0x4e8: inx_imp_partial(); break; case 0x4e9: sbc_imm_partial(); break; case 0x4ea: nop_imp_partial(); break; case 0x4eb: xba_imp_partial(); break; case 0x4ec: cpx_aba_partial(); break; case 0x4ed: sbc_aba_partial(); break; case 0x4ee: inc_aba_partial(); break; case 0x4ef: sbc_abl_partial(); break; case 0x4f0: beq_rel_partial(); break; case 0x4f1: sbc_idy_partial(); break; case 0x4f2: sbc_zpi_partial(); break; case 0x4f3: sbc_dsy_partial(); break; case 0x4f4: pea_imm16_partial(); break; case 0x4f5: sbc_zpx_partial(); break; case 0x4f6: inc_zpx_partial(); break; case 0x4f7: sbc_ziy_partial(); break; case 0x4f8: sed_imp_partial(); break; case 0x4f9: sbc_aby_partial(); break; case 0x4fa: plx_imp_partial(); break; case 0x4fb: xce_imp_partial(); break; case 0x4fc: jsr_iax_partial(); break; case 0x4fd: sbc_abx_partial(); break; case 0x4fe: inc_abx_partial(); break; case 0x4ff: sbc_alx_partial(); break; case STATE_RESET: reset_partial(); break; } }