summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/cpu/m6502
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2015-09-13 08:41:44 +0200
committer Miodrag Milanovic <mmicko@gmail.com>2015-09-13 08:41:44 +0200
commitf88cefad27a1737c76e09d99c9fb43e173506081 (patch)
tree2d8167d03579c46e226471747eb4407bd00ed6fa /src/emu/cpu/m6502
parente92ac9e0fa8e99869894bea00589bbb526be30aa (diff)
Move all devices into separate part of src tree (nw)
Diffstat (limited to 'src/emu/cpu/m6502')
-rw-r--r--src/emu/cpu/m6502/ddeco16.lst18
-rw-r--r--src/emu/cpu/m6502/deco16.c53
-rw-r--r--src/emu/cpu/m6502/deco16.h62
-rw-r--r--src/emu/cpu/m6502/dm4510.lst18
-rw-r--r--src/emu/cpu/m6502/dm6502.lst18
-rw-r--r--src/emu/cpu/m6502/dm6509.lst18
-rw-r--r--src/emu/cpu/m6502/dm6510.lst18
-rw-r--r--src/emu/cpu/m6502/dm65c02.lst18
-rw-r--r--src/emu/cpu/m6502/dm65ce02.lst18
-rw-r--r--src/emu/cpu/m6502/dm740.lst34
-rw-r--r--src/emu/cpu/m6502/dn2a03.lst18
-rw-r--r--src/emu/cpu/m6502/dr65c02.lst18
-rw-r--r--src/emu/cpu/m6502/m3745x.c503
-rw-r--r--src/emu/cpu/m6502/m3745x.h157
-rw-r--r--src/emu/cpu/m6502/m4510.c106
-rw-r--r--src/emu/cpu/m6502/m4510.h82
-rw-r--r--src/emu/cpu/m6502/m5074x.c507
-rw-r--r--src/emu/cpu/m6502/m5074x.h147
-rw-r--r--src/emu/cpu/m6502/m6502.c724
-rw-r--r--src/emu/cpu/m6502/m6502.h335
-rw-r--r--src/emu/cpu/m6502/m6502.txt163
-rwxr-xr-xsrc/emu/cpu/m6502/m6502make.py280
-rw-r--r--src/emu/cpu/m6502/m6504.c61
-rw-r--r--src/emu/cpu/m6502/m6504.h49
-rw-r--r--src/emu/cpu/m6502/m6509.c148
-rw-r--r--src/emu/cpu/m6502/m6509.h87
-rw-r--r--src/emu/cpu/m6502/m6510.c175
-rw-r--r--src/emu/cpu/m6502/m6510.h99
-rw-r--r--src/emu/cpu/m6502/m6510t.c19
-rw-r--r--src/emu/cpu/m6502/m6510t.h34
-rw-r--r--src/emu/cpu/m6502/m65c02.c32
-rw-r--r--src/emu/cpu/m6502/m65c02.h76
-rw-r--r--src/emu/cpu/m6502/m65ce02.c98
-rw-r--r--src/emu/cpu/m6502/m65ce02.h153
-rw-r--r--src/emu/cpu/m6502/m65sc02.c19
-rw-r--r--src/emu/cpu/m6502/m65sc02.h29
-rw-r--r--src/emu/cpu/m6502/m740.c243
-rw-r--r--src/emu/cpu/m6502/m740.h105
-rw-r--r--src/emu/cpu/m6502/m7501.c19
-rw-r--r--src/emu/cpu/m6502/m7501.h34
-rw-r--r--src/emu/cpu/m6502/m8502.c19
-rw-r--r--src/emu/cpu/m6502/m8502.h34
-rw-r--r--src/emu/cpu/m6502/n2a03.c76
-rw-r--r--src/emu/cpu/m6502/n2a03.h70
-rw-r--r--src/emu/cpu/m6502/odeco16.lst101
-rw-r--r--src/emu/cpu/m6502/om4510.lst21
-rw-r--r--src/emu/cpu/m6502/om6502.lst1964
-rw-r--r--src/emu/cpu/m6502/om6509.lst20
-rw-r--r--src/emu/cpu/m6502/om6510.lst46
-rw-r--r--src/emu/cpu/m6502/om65c02.lst584
-rw-r--r--src/emu/cpu/m6502/om65ce02.lst1533
-rw-r--r--src/emu/cpu/m6502/om740.lst749
-rw-r--r--src/emu/cpu/m6502/on2a03.lst297
-rw-r--r--src/emu/cpu/m6502/r65c02.c31
-rw-r--r--src/emu/cpu/m6502/r65c02.h36
55 files changed, 0 insertions, 10376 deletions
diff --git a/src/emu/cpu/m6502/ddeco16.lst b/src/emu/cpu/m6502/ddeco16.lst
deleted file mode 100644
index b57f2614cf0..00000000000
--- a/src/emu/cpu/m6502/ddeco16.lst
+++ /dev/null
@@ -1,18 +0,0 @@
-# deco16 - deco variant
-brk_16_imp ora_idx ill_non ill_non ill_non ora_zpg asl_zpg ill_non php_imp ora_imm asl_acc u0B_zpg ill_non ora_aba asl_aba ill_non
-bpl_rel ora_idy ill_non u13_zpg ill_non ora_zpx asl_zpx ill_non clc_imp ora_aby ill_non ill_non ill_non ora_abx asl_abx ill_non
-jsr_adr and_idx ill_non u23_zpg bit_zpg and_zpg rol_zpg ill_non plp_imp and_imm rol_acc ill_non bit_aba and_aba rol_aba ill_non
-bmi_rel and_idy ill_non ill_non ill_non and_zpx rol_zpx ill_non sec_imp and_aby ill_non ill_non ill_non and_abx rol_abx u3F_zpg
-rti_imp eor_idx ill_non ill_non ill_non eor_zpg lsr_zpg ill_non pha_imp eor_imm lsr_acc u4B_zpg jmp_adr eor_aba lsr_aba ill_non
-bvc_rel eor_idy ill_non ill_non ill_non eor_zpx lsr_zpx ill_non cli_imp eor_aby ill_non ill_non ill_non eor_abx lsr_abx ill_non
-rts_imp adc_idx ill_non ill_non ill_non adc_zpg ror_zpg vbl_zpg pla_imp adc_imm ror_acc ill_non jmp_ind adc_aba ror_aba ill_non
-bvs_rel adc_idy ill_non ill_non ill_non adc_zpx ror_zpx ill_non sei_imp adc_aby ill_non ill_non ill_non adc_abx ror_abx ill_non
-ill_non sta_idx ill_non ill_non sty_zpg sta_zpg stx_zpg u87_zpg dey_imp ill_non txa_imp ill_non sty_aba sta_aba stx_aba u8F_zpg
-bcc_rel sta_idy ill_non ill_non sty_zpx sta_zpx stx_zpy ill_non tya_imp sta_aby txs_imp ill_non ill_non sta_abx ill_non ill_non
-ldy_imm lda_idx ldx_imm uA3_zpg ldy_zpg lda_zpg ldx_zpg ill_non tay_imp lda_imm tax_imp ill_non ldy_aba lda_aba ldx_aba ill_non
-bcs_rel lda_idy ill_non ill_non ldy_zpx lda_zpx ldx_zpy ill_non clv_imp lda_aby tsx_imp uBB_zpg ldy_abx lda_abx ldx_aby ill_non
-cpy_imm cmp_idx ill_non ill_non cpy_zpg cmp_zpg dec_zpg ill_non iny_imp cmp_imm dex_imp ill_non cpy_aba cmp_aba dec_aba ill_non
-bne_rel cmp_idy ill_non ill_non ill_non cmp_zpx dec_zpx ill_non cld_imp cmp_aby ill_non ill_non ill_non cmp_abx dec_abx ill_non
-cpx_imm sbc_idx ill_non ill_non cpx_zpg sbc_zpg inc_zpg ill_non inx_imp sbc_imm nop_imp ill_non cpx_aba sbc_aba inc_aba ill_non
-beq_rel sbc_idy ill_non ill_non ill_non sbc_zpx inc_zpx ill_non sed_imp sbc_aby ill_non ill_non ill_non sbc_abx inc_abx ill_non
-reset_16
diff --git a/src/emu/cpu/m6502/deco16.c b/src/emu/cpu/m6502/deco16.c
deleted file mode 100644
index a500b287d7a..00000000000
--- a/src/emu/cpu/m6502/deco16.c
+++ /dev/null
@@ -1,53 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Olivier Galibert
-/***************************************************************************
-
- deco16.c
-
- 6502, reverse-engineered DECO variant
-
-***************************************************************************/
-
-#include "emu.h"
-#include "deco16.h"
-
-#define DECO16_VERBOSE 1
-
-const device_type DECO16 = &device_creator<deco16_device>;
-
-deco16_device::deco16_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
- m6502_device(mconfig, DECO16, "DECO16", tag, owner, clock, "deco16", __FILE__),
- io_config("io", ENDIANNESS_LITTLE, 8, 16)
-{
-}
-
-offs_t deco16_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options)
-{
- return disassemble_generic(buffer, pc, oprom, opram, options, disasm_entries);
-}
-
-
-void deco16_device::device_start()
-{
- if(direct_disabled)
- mintf = new mi_default_nd;
- else
- mintf = new mi_default_normal;
-
- init();
-
- io = &space(AS_IO);
-}
-
-const address_space_config *deco16_device::memory_space_config(address_spacenum spacenum) const
-{
- switch(spacenum)
- {
- case AS_PROGRAM: return &program_config;
- case AS_IO: return &io_config;
- case AS_DECRYPTED_OPCODES: return has_configured_map(AS_DECRYPTED_OPCODES) ? &sprogram_config : NULL;
- default: return NULL;
- }
-}
-
-#include "cpu/m6502/deco16.inc"
diff --git a/src/emu/cpu/m6502/deco16.h b/src/emu/cpu/m6502/deco16.h
deleted file mode 100644
index d82087477f7..00000000000
--- a/src/emu/cpu/m6502/deco16.h
+++ /dev/null
@@ -1,62 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Olivier Galibert
-/***************************************************************************
-
- deco16.h
-
- 6502, reverse-engineered DECO variant
-
-***************************************************************************/
-
-#ifndef __DECO16_H__
-#define __DECO16_H__
-
-#include "m6502.h"
-
-class deco16_device : public m6502_device {
-public:
- deco16_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
- static const disasm_entry disasm_entries[0x100];
-
- virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options);
- virtual void do_exec_full();
- virtual void do_exec_partial();
-
-protected:
- address_space *io;
- address_space_config io_config;
-
- virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
- virtual void device_start();
-
-#define O(o) void o ## _full(); void o ## _partial()
-
- O(brk_16_imp);
- O(ill_non);
- O(u0B_zpg);
- O(u13_zpg);
- O(u23_zpg);
- O(u3F_zpg);
- O(u4B_zpg);
- O(u87_zpg);
- O(u8F_zpg);
- O(uA3_zpg);
- O(uAB_zpg);
- O(uBB_zpg);
- O(vbl_zpg);
-
- O(reset_16);
-
-#undef O
-};
-
-enum {
- DECO16_IRQ_LINE = m6502_device::IRQ_LINE,
- DECO16_NMI_LINE = m6502_device::NMI_LINE,
- DECO16_SET_OVERFLOW = m6502_device::V_LINE
-};
-
-extern const device_type DECO16;
-
-#endif
diff --git a/src/emu/cpu/m6502/dm4510.lst b/src/emu/cpu/m6502/dm4510.lst
deleted file mode 100644
index 6de7627ebc7..00000000000
--- a/src/emu/cpu/m6502/dm4510.lst
+++ /dev/null
@@ -1,18 +0,0 @@
-# m4510 - 65ce02 with a mmu
-brk_ce_imp ora_ce_idx cle_imp see_imp tsb_ce_zpg ora_ce_zpg asl_ce_zpg rmb_ce_bzp php_ce_imp ora_imm asl_ce_acc tsy_imp tsb_ce_aba ora_aba asl_ce_aba bbr_ce_zpb
-bpl_ce_rel ora_ce_idy ora_idz bpl_rw2 trb_ce_zpg ora_ce_zpx asl_ce_zpx rmb_ce_bzp clc_ce_imp ora_ce_aby inc_ce_acc inz_imp trb_ce_aba ora_ce_abx asl_ce_abx bbr_ce_zpb
-jsr_ce_adr and_ce_idx jsr_ind jsr_iax bit_ce_zpg and_ce_zpg rol_ce_zpg rmb_ce_bzp plp_ce_imp and_imm rol_ce_acc tys_imp bit_aba and_aba rol_ce_aba bbr_ce_zpb
-bmi_ce_rel and_ce_idy and_idz bmi_rw2 bit_ce_zpx and_ce_zpx rol_ce_zpx rmb_ce_bzp sec_ce_imp and_ce_aby dec_ce_acc dez_imp bit_ce_abx and_ce_abx rol_ce_abx bbr_ce_zpb
-rti_ce_imp eor_ce_idx neg_acc asr_acc asr_zpg eor_ce_zpg lsr_ce_zpg rmb_ce_bzp pha_ce_imp eor_imm lsr_ce_acc taz_imp jmp_adr eor_aba lsr_ce_aba bbr_ce_zpb
-bvc_ce_rel eor_ce_idy eor_idz bvc_rw2 asr_zpx eor_ce_zpx lsr_ce_zpx rmb_ce_bzp cli_ce_imp eor_ce_aby phy_ce_imp tab_imp map_imp eor_ce_abx lsr_ce_abx bbr_ce_zpb
-rts_ce_imp adc_ce_idx rtn_imm bsr_rw2 stz_ce_zpg adc_ce_zpg ror_ce_zpg rmb_ce_bzp pla_ce_imp adc_ce_imm ror_ce_acc tza_imp jmp_ce_ind adc_ce_aba ror_ce_aba bbr_ce_zpb
-bvs_ce_rel adc_ce_idy adc_idz bvs_rw2 stz_ce_zpx adc_ce_zpx ror_ce_zpx rmb_ce_bzp sei_ce_imp adc_ce_aby ply_ce_imp tba_imp jmp_ce_iax adc_ce_abx ror_ce_abx bbr_ce_zpb
-bra_ce_rel sta_ce_idx sta_isy bra_rw2 sty_ce_zpg sta_ce_zpg stx_ce_zpg smb_ce_bzp dey_ce_imp bit_ce_imm txa_ce_imp sty_abx sty_aba sta_aba stx_aba bbs_ce_zpb
-bcc_ce_rel sta_ce_idy sta_idz bcc_rw2 sty_ce_zpx sta_ce_zpx stx_ce_zpy smb_ce_bzp tya_ce_imp sta_ce_aby txs_ce_imp stx_aby stz_ce_aba sta_ce_abx stz_ce_abx bbs_ce_zpb
-ldy_imm lda_ce_idx ldx_imm ldz_imm ldy_ce_zpg lda_ce_zpg ldx_ce_zpg smb_ce_bzp tay_ce_imp lda_imm tax_ce_imp ldz_aba ldy_aba lda_aba ldx_aba bbs_ce_zpb
-bcs_ce_rel lda_ce_idy lda_idz bcs_rw2 ldy_ce_zpx lda_ce_zpx ldx_ce_zpy smb_ce_bzp clv_ce_imp lda_ce_aby tsx_ce_imp ldz_abx ldy_ce_abx lda_ce_abx ldx_ce_aby bbs_ce_zpb
-cpy_imm cmp_ce_idx cpz_imm dew_zpg cpy_ce_zpg cmp_ce_zpg dec_ce_zpg smb_ce_bzp iny_ce_imp cmp_imm dex_ce_imp asw_aba cpy_aba cmp_aba dec_ce_aba bbs_ce_zpb
-bne_ce_rel cmp_ce_idy cmp_idz bne_rw2 cpz_zpg cmp_ce_zpx dec_ce_zpx smb_ce_bzp cld_ce_imp cmp_ce_aby phx_ce_imp phz_imp cpz_aba cmp_ce_abx dec_ce_abx bbs_ce_zpb
-cpx_imm sbc_ce_idx lda_isy inw_zpg cpx_ce_zpg sbc_ce_zpg inc_ce_zpg smb_ce_bzp inx_ce_imp sbc_ce_imm eom_imp row_aba cpx_aba sbc_ce_aba inc_ce_aba bbs_ce_zpb
-beq_ce_rel sbc_ce_idy sbc_idz beq_rw2 phw_iw2 sbc_ce_zpx inc_ce_zpx smb_ce_bzp sed_ce_imp sbc_ce_aby plx_ce_imp plz_imp phw_aba sbc_ce_abx inc_ce_abx bbs_ce_zpb
-reset
diff --git a/src/emu/cpu/m6502/dm6502.lst b/src/emu/cpu/m6502/dm6502.lst
deleted file mode 100644
index 335cae3d2e7..00000000000
--- a/src/emu/cpu/m6502/dm6502.lst
+++ /dev/null
@@ -1,18 +0,0 @@
-# m6502_family_device - 6502, 6504
-brk_imp ora_idx kil_non slo_idx nop_zpg ora_zpg asl_zpg slo_zpg php_imp ora_imm asl_acc anc_imm nop_aba ora_aba asl_aba slo_aba
-bpl_rel ora_idy kil_non slo_idy nop_zpx ora_zpx asl_zpx slo_zpx clc_imp ora_aby nop_imp slo_aby nop_abx ora_abx asl_abx slo_abx
-jsr_adr and_idx kil_non rla_idx bit_zpg and_zpg rol_zpg rla_zpg plp_imp and_imm rol_acc anc_imm bit_aba and_aba rol_aba rla_aba
-bmi_rel and_idy kil_non rla_idy nop_zpx and_zpx rol_zpx rla_zpx sec_imp and_aby nop_imp rla_aby nop_abx and_abx rol_abx rla_abx
-rti_imp eor_idx kil_non sre_idx nop_zpg eor_zpg lsr_zpg sre_zpg pha_imp eor_imm lsr_acc asr_imm jmp_adr eor_aba lsr_aba sre_aba
-bvc_rel eor_idy kil_non sre_idy nop_zpx eor_zpx lsr_zpx sre_zpx cli_imp eor_aby nop_imp sre_aby nop_abx eor_abx lsr_abx sre_abx
-rts_imp adc_idx kil_non rra_idx nop_zpg adc_zpg ror_zpg rra_zpg pla_imp adc_imm ror_acc arr_imm jmp_ind adc_aba ror_aba rra_aba
-bvs_rel adc_idy kil_non rra_idy nop_zpx adc_zpx ror_zpx rra_zpx sei_imp adc_aby nop_imp rra_aby nop_abx adc_abx ror_abx rra_abx
-nop_imm sta_idx nop_imm sax_idx sty_zpg sta_zpg stx_zpg sax_zpg dey_imp nop_imm txa_imp ane_imm sty_aba sta_aba stx_aba sax_aba
-bcc_rel sta_idy kil_non sha_idy sty_zpx sta_zpx stx_zpy sax_zpy tya_imp sta_aby txs_imp shs_aby shy_abx sta_abx shx_aby sha_aby
-ldy_imm lda_idx ldx_imm lax_idx ldy_zpg lda_zpg ldx_zpg lax_zpg tay_imp lda_imm tax_imp lxa_imm ldy_aba lda_aba ldx_aba lax_aba
-bcs_rel lda_idy kil_non lax_idy ldy_zpx lda_zpx ldx_zpy lax_zpy clv_imp lda_aby tsx_imp las_aby ldy_abx lda_abx ldx_aby lax_aby
-cpy_imm cmp_idx nop_imm dcp_idx cpy_zpg cmp_zpg dec_zpg dcp_zpg iny_imp cmp_imm dex_imp sbx_imm cpy_aba cmp_aba dec_aba dcp_aba
-bne_rel cmp_idy kil_non dcp_idy nop_zpx cmp_zpx dec_zpx dcp_zpx cld_imp cmp_aby nop_imp dcp_aby nop_abx cmp_abx dec_abx dcp_abx
-cpx_imm sbc_idx nop_imm isb_idx cpx_zpg sbc_zpg inc_zpg isb_zpg inx_imp sbc_imm nop_imp sbc_imm cpx_aba sbc_aba inc_aba isb_aba
-beq_rel sbc_idy kil_non isb_idy nop_zpx sbc_zpx inc_zpx isb_zpx sed_imp sbc_aby nop_imp isb_aby nop_abx sbc_abx inc_abx isb_abx
-reset
diff --git a/src/emu/cpu/m6502/dm6509.lst b/src/emu/cpu/m6502/dm6509.lst
deleted file mode 100644
index 644aa6c79d6..00000000000
--- a/src/emu/cpu/m6502/dm6509.lst
+++ /dev/null
@@ -1,18 +0,0 @@
-# m6509 - special banking on two specific instructions, and banking in general
-brk_imp ora_idx kil_non slo_idx nop_zpg ora_zpg asl_zpg slo_zpg php_imp ora_imm asl_acc anc_imm nop_aba ora_aba asl_aba slo_aba
-bpl_rel ora_idy kil_non slo_idy nop_zpx ora_zpx asl_zpx slo_zpx clc_imp ora_aby nop_imp slo_aby nop_abx ora_abx asl_abx slo_abx
-jsr_adr and_idx kil_non rla_idx bit_zpg and_zpg rol_zpg rla_zpg plp_imp and_imm rol_acc anc_imm bit_aba and_aba rol_aba rla_aba
-bmi_rel and_idy kil_non rla_idy nop_zpx and_zpx rol_zpx rla_zpx sec_imp and_aby nop_imp rla_aby nop_abx and_abx rol_abx rla_abx
-rti_imp eor_idx kil_non sre_idx nop_zpg eor_zpg lsr_zpg sre_zpg pha_imp eor_imm lsr_acc asr_imm jmp_adr eor_aba lsr_aba sre_aba
-bvc_rel eor_idy kil_non sre_idy nop_zpx eor_zpx lsr_zpx sre_zpx cli_imp eor_aby nop_imp sre_aby nop_abx eor_abx lsr_abx sre_abx
-rts_imp adc_idx kil_non rra_idx nop_zpg adc_zpg ror_zpg rra_zpg pla_imp adc_imm ror_acc arr_imm jmp_ind adc_aba ror_aba rra_aba
-bvs_rel adc_idy kil_non rra_idy nop_zpx adc_zpx ror_zpx rra_zpx sei_imp adc_aby nop_imp rra_aby nop_abx adc_abx ror_abx rra_abx
-nop_imm sta_idx nop_imm sax_idx sty_zpg sta_zpg stx_zpg sax_zpg dey_imp nop_imm txa_imp ane_imm sty_aba sta_aba stx_aba sax_aba
-bcc_rel sta_9_idy kil_non sha_idy sty_zpx sta_zpx stx_zpy sax_zpy tya_imp sta_aby txs_imp shs_aby shy_abx sta_abx shx_aby sha_aby
-ldy_imm lda_idx ldx_imm lax_idx ldy_zpg lda_zpg ldx_zpg lax_zpg tay_imp lda_imm tax_imp lxa_imm ldy_aba lda_aba ldx_aba lax_aba
-bcs_rel lda_9_idy kil_non lax_idy ldy_zpx lda_zpx ldx_zpy lax_zpy clv_imp lda_aby tsx_imp las_aby ldy_abx lda_abx ldx_aby lax_aby
-cpy_imm cmp_idx nop_imm dcp_idx cpy_zpg cmp_zpg dec_zpg dcp_zpg iny_imp cmp_imm dex_imp sbx_imm cpy_aba cmp_aba dec_aba dcp_aba
-bne_rel cmp_idy kil_non dcp_idy nop_zpx cmp_zpx dec_zpx dcp_zpx cld_imp cmp_aby nop_imp dcp_aby nop_abx cmp_abx dec_abx dcp_abx
-cpx_imm sbc_idx nop_imm isb_idx cpx_zpg sbc_zpg inc_zpg isb_zpg inx_imp sbc_imm nop_imp sbc_imm cpx_aba sbc_aba inc_aba isb_aba
-beq_rel sbc_idy kil_non isb_idy nop_zpx sbc_zpx inc_zpx isb_zpx sed_imp sbc_aby nop_imp isb_aby nop_abx sbc_abx inc_abx isb_abx
-reset
diff --git a/src/emu/cpu/m6502/dm6510.lst b/src/emu/cpu/m6502/dm6510.lst
deleted file mode 100644
index dbc8bd88d57..00000000000
--- a/src/emu/cpu/m6502/dm6510.lst
+++ /dev/null
@@ -1,18 +0,0 @@
-# m6510_family - identical to 6502, except for some undocumented instructions that have to be handled specifically
-brk_imp ora_idx kil_non slo_idx nop_zpg ora_zpg asl_zpg slo_zpg php_imp ora_imm asl_acc anc_10_imm nop_aba ora_aba asl_aba slo_aba
-bpl_rel ora_idy kil_non slo_idy nop_zpx ora_zpx asl_zpx slo_zpx clc_imp ora_aby nop_imp slo_aby nop_abx ora_abx asl_abx slo_abx
-jsr_adr and_idx kil_non rla_idx bit_zpg and_zpg rol_zpg rla_zpg plp_imp and_imm rol_acc anc_10_imm bit_aba and_aba rol_aba rla_aba
-bmi_rel and_idy kil_non rla_idy nop_zpx and_zpx rol_zpx rla_zpx sec_imp and_aby nop_imp rla_aby nop_abx and_abx rol_abx rla_abx
-rti_imp eor_idx kil_non sre_idx nop_zpg eor_zpg lsr_zpg sre_zpg pha_imp eor_imm lsr_acc asr_10_imm jmp_adr eor_aba lsr_aba sre_aba
-bvc_rel eor_idy kil_non sre_idy nop_zpx eor_zpx lsr_zpx sre_zpx cli_imp eor_aby nop_imp sre_aby nop_abx eor_abx lsr_abx sre_abx
-rts_imp adc_idx kil_non rra_idx nop_zpg adc_zpg ror_zpg rra_zpg pla_imp adc_imm ror_acc arr_10_imm jmp_ind adc_aba ror_aba rra_aba
-bvs_rel adc_idy kil_non rra_idy nop_zpx adc_zpx ror_zpx rra_zpx sei_imp adc_aby nop_imp rra_aby nop_abx adc_abx ror_abx rra_abx
-nop_imm sta_idx nop_imm sax_idx sty_zpg sta_zpg stx_zpg sax_zpg dey_imp nop_imm txa_imp ane_10_imm sty_aba sta_aba stx_aba sax_aba
-bcc_rel sta_idy kil_non sha_idy sty_zpx sta_zpx stx_zpy sax_zpy tya_imp sta_aby txs_imp shs_aby shy_abx sta_abx shx_aby sha_aby
-ldy_imm lda_idx ldx_imm lax_idx ldy_zpg lda_zpg ldx_zpg lax_zpg tay_imp lda_imm tax_imp lxa_10_imm ldy_aba lda_aba ldx_aba lax_aba
-bcs_rel lda_idy kil_non lax_idy ldy_zpx lda_zpx ldx_zpy lax_zpy clv_imp lda_aby tsx_imp las_10_aby ldy_abx lda_abx ldx_aby lax_aby
-cpy_imm cmp_idx nop_imm dcp_idx cpy_zpg cmp_zpg dec_zpg dcp_zpg iny_imp cmp_imm dex_imp sbx_imm cpy_aba cmp_aba dec_aba dcp_aba
-bne_rel cmp_idy kil_non dcp_idy nop_zpx cmp_zpx dec_zpx dcp_zpx cld_imp cmp_aby nop_imp dcp_aby nop_abx cmp_abx dec_abx dcp_abx
-cpx_imm sbc_idx nop_imm isb_idx cpx_zpg sbc_zpg inc_zpg isb_zpg inx_imp sbc_imm nop_imp sbc_imm cpx_aba sbc_aba inc_aba isb_aba
-beq_rel sbc_idy kil_non isb_idy nop_zpx sbc_zpx inc_zpx isb_zpx sed_imp sbc_aby nop_imp isb_aby nop_abx sbc_abx inc_abx isb_abx
-reset
diff --git a/src/emu/cpu/m6502/dm65c02.lst b/src/emu/cpu/m6502/dm65c02.lst
deleted file mode 100644
index 4b0cd1f2db4..00000000000
--- a/src/emu/cpu/m6502/dm65c02.lst
+++ /dev/null
@@ -1,18 +0,0 @@
-# m65c02
-brk_c_imp ora_idx nop_imm nop_c_imp tsb_zpg ora_zpg asl_zpg nop_c_imp php_imp ora_imm asl_acc nop_c_imp tsb_aba ora_aba asl_aba nop_c_imp
-bpl_rel ora_idy ora_zpi nop_c_imp trb_zpg ora_zpx asl_zpx nop_c_imp clc_imp ora_aby inc_acc nop_c_imp trb_aba ora_abx asl_c_abx nop_c_imp
-jsr_adr and_idx nop_imm nop_c_imp bit_zpg and_zpg rol_zpg nop_c_imp plp_imp and_imm rol_acc nop_c_imp bit_aba and_aba rol_aba nop_c_imp
-bmi_rel and_idy and_zpi nop_c_imp bit_zpx and_zpx rol_zpx nop_c_imp sec_imp and_aby dec_acc nop_c_imp bit_abx and_abx rol_c_abx nop_c_imp
-rti_imp eor_idx nop_imm nop_c_imp nop_zpg eor_zpg lsr_zpg nop_c_imp pha_imp eor_imm lsr_acc nop_c_imp jmp_adr eor_aba lsr_aba nop_c_imp
-bvc_rel eor_idy eor_zpi nop_c_imp nop_zpx eor_zpx lsr_zpx nop_c_imp cli_imp eor_aby phy_imp nop_c_imp nop_c_aba eor_abx lsr_c_abx nop_c_imp
-rts_imp adc_c_idx nop_imm nop_c_imp stz_zpg adc_c_zpg ror_zpg nop_c_imp pla_imp adc_c_imm ror_acc nop_c_imp jmp_c_ind adc_c_aba ror_aba nop_c_imp
-bvs_rel adc_c_idy adc_c_zpi nop_c_imp stz_zpx adc_c_zpx ror_zpx nop_c_imp sei_imp adc_c_aby ply_imp nop_c_imp jmp_iax adc_c_abx ror_c_abx nop_c_imp
-bra_rel sta_idx nop_imm nop_c_imp sty_zpg sta_zpg stx_zpg nop_c_imp dey_imp bit_imm txa_imp nop_c_imp sty_aba sta_aba stx_aba nop_c_imp
-bcc_rel sta_idy sta_zpi nop_c_imp sty_zpx sta_zpx stx_zpy nop_c_imp tya_imp sta_aby txs_imp nop_c_imp stz_aba sta_abx stz_abx nop_c_imp
-ldy_imm lda_idx ldx_imm nop_c_imp ldy_zpg lda_zpg ldx_zpg nop_c_imp tay_imp lda_imm tax_imp nop_c_imp ldy_aba lda_aba ldx_aba nop_c_imp
-bcs_rel lda_idy lda_zpi nop_c_imp ldy_zpx lda_zpx ldx_zpy nop_c_imp clv_imp lda_aby tsx_imp nop_c_imp ldy_abx lda_abx ldx_aby nop_c_imp
-cpy_imm cmp_idx nop_imm nop_c_imp cpy_zpg cmp_zpg dec_zpg nop_c_imp iny_imp cmp_imm dex_imp nop_c_imp cpy_aba cmp_aba dec_aba nop_c_imp
-bne_rel cmp_idy cmp_zpi nop_c_imp nop_zpx cmp_zpx dec_zpx nop_c_imp cld_imp cmp_aby phx_imp nop_c_imp nop_c_abx cmp_abx dec_abx nop_c_imp
-cpx_imm sbc_c_idx nop_imm nop_c_imp cpx_zpg sbc_c_zpg inc_zpg nop_c_imp inx_imp sbc_c_imm nop_imp nop_c_imp cpx_aba sbc_c_aba inc_aba nop_c_imp
-beq_rel sbc_c_idy sbc_c_zpi nop_c_imp nop_zpx sbc_c_zpx inc_zpx nop_c_imp sed_imp sbc_c_aby plx_imp nop_c_imp nop_c_abx sbc_c_abx inc_abx nop_c_imp
-reset
diff --git a/src/emu/cpu/m6502/dm65ce02.lst b/src/emu/cpu/m6502/dm65ce02.lst
deleted file mode 100644
index b2fafe67203..00000000000
--- a/src/emu/cpu/m6502/dm65ce02.lst
+++ /dev/null
@@ -1,18 +0,0 @@
-# m65ce02 - Adds the B and Z registers to the r65c02, a bunch of instructions, and changes most of the timings
-brk_ce_imp ora_ce_idx cle_imp see_imp tsb_ce_zpg ora_ce_zpg asl_ce_zpg rmb_ce_bzp php_ce_imp ora_imm asl_ce_acc tsy_imp tsb_ce_aba ora_aba asl_ce_aba bbr_ce_zpb
-bpl_ce_rel ora_ce_idy ora_idz bpl_rw2 trb_ce_zpg ora_ce_zpx asl_ce_zpx rmb_ce_bzp clc_ce_imp ora_ce_aby inc_ce_acc inz_imp trb_ce_aba ora_ce_abx asl_ce_abx bbr_ce_zpb
-jsr_ce_adr and_ce_idx jsr_ind jsr_iax bit_ce_zpg and_ce_zpg rol_ce_zpg rmb_ce_bzp plp_ce_imp and_imm rol_ce_acc tys_imp bit_aba and_aba rol_ce_aba bbr_ce_zpb
-bmi_ce_rel and_ce_idy and_idz bmi_rw2 bit_ce_zpx and_ce_zpx rol_ce_zpx rmb_ce_bzp sec_ce_imp and_ce_aby dec_ce_acc dez_imp bit_ce_abx and_ce_abx rol_ce_abx bbr_ce_zpb
-rti_ce_imp eor_ce_idx neg_acc asr_acc asr_zpg eor_ce_zpg lsr_ce_zpg rmb_ce_bzp pha_ce_imp eor_imm lsr_ce_acc taz_imp jmp_adr eor_aba lsr_ce_aba bbr_ce_zpb
-bvc_ce_rel eor_ce_idy eor_idz bvc_rw2 asr_zpx eor_ce_zpx lsr_ce_zpx rmb_ce_bzp cli_ce_imp eor_ce_aby phy_ce_imp tab_imp aug_iw3 eor_ce_abx lsr_ce_abx bbr_ce_zpb
-rts_ce_imp adc_ce_idx rtn_imm bsr_rw2 stz_ce_zpg adc_ce_zpg ror_ce_zpg rmb_ce_bzp pla_ce_imp adc_ce_imm ror_ce_acc tza_imp jmp_ce_ind adc_ce_aba ror_ce_aba bbr_ce_zpb
-bvs_ce_rel adc_ce_idy adc_idz bvs_rw2 stz_ce_zpx adc_ce_zpx ror_ce_zpx rmb_ce_bzp sei_ce_imp adc_ce_aby ply_ce_imp tba_imp jmp_ce_iax adc_ce_abx ror_ce_abx bbr_ce_zpb
-bra_ce_rel sta_ce_idx sta_isy bra_rw2 sty_ce_zpg sta_ce_zpg stx_ce_zpg smb_ce_bzp dey_ce_imp bit_ce_imm txa_ce_imp sty_abx sty_aba sta_aba stx_aba bbs_ce_zpb
-bcc_ce_rel sta_ce_idy sta_idz bcc_rw2 sty_ce_zpx sta_ce_zpx stx_ce_zpy smb_ce_bzp tya_ce_imp sta_ce_aby txs_ce_imp stx_aby stz_ce_aba sta_ce_abx stz_ce_abx bbs_ce_zpb
-ldy_imm lda_ce_idx ldx_imm ldz_imm ldy_ce_zpg lda_ce_zpg ldx_ce_zpg smb_ce_bzp tay_ce_imp lda_imm tax_ce_imp ldz_aba ldy_aba lda_aba ldx_aba bbs_ce_zpb
-bcs_ce_rel lda_ce_idy lda_idz bcs_rw2 ldy_ce_zpx lda_ce_zpx ldx_ce_zpy smb_ce_bzp clv_ce_imp lda_ce_aby tsx_ce_imp ldz_abx ldy_ce_abx lda_ce_abx ldx_ce_aby bbs_ce_zpb
-cpy_imm cmp_ce_idx cpz_imm dew_zpg cpy_ce_zpg cmp_ce_zpg dec_ce_zpg smb_ce_bzp iny_ce_imp cmp_imm dex_ce_imp asw_aba cpy_aba cmp_aba dec_ce_aba bbs_ce_zpb
-bne_ce_rel cmp_ce_idy cmp_idz bne_rw2 cpz_zpg cmp_ce_zpx dec_ce_zpx smb_ce_bzp cld_ce_imp cmp_ce_aby phx_ce_imp phz_imp cpz_aba cmp_ce_abx dec_ce_abx bbs_ce_zpb
-cpx_imm sbc_ce_idx lda_isy inw_zpg cpx_ce_zpg sbc_ce_zpg inc_ce_zpg smb_ce_bzp inx_ce_imp sbc_ce_imm nop_c_imp row_aba cpx_aba sbc_ce_aba inc_ce_aba bbs_ce_zpb
-beq_ce_rel sbc_ce_idy sbc_idz beq_rw2 phw_iw2 sbc_ce_zpx inc_ce_zpx smb_ce_bzp sed_ce_imp sbc_ce_aby plx_ce_imp plz_imp phw_aba sbc_ce_abx inc_ce_abx bbs_ce_zpb
-reset
diff --git a/src/emu/cpu/m6502/dm740.lst b/src/emu/cpu/m6502/dm740.lst
deleted file mode 100644
index c11f0826cd5..00000000000
--- a/src/emu/cpu/m6502/dm740.lst
+++ /dev/null
@@ -1,34 +0,0 @@
-# m740 device
-brk740_imp ora_idx kil_non bbs_bar nop_zpg ora_zpg asl_zpg bbs_bzr php_imp ora_imm asl_acc seb_bac nop_aba ora_aba asl_aba seb_biz
-bpl_rel ora_idy clt_imp bbc_bar nop_zpx ora_zpx asl_zpx bbc_bzr clc_imp ora_aby dec_acc clb_bac nop_abx ora_abx asl_abx clb_biz
-jsr_adr and_idx jsr_spg bbs_bar bit_zpg and_zpg rol_zpg bbs_bzr plp_imp and_imm rol_acc seb_bac bit_aba and_aba rol_aba seb_biz
-bmi_rel and_idy set_imp bbc_bar nop_zpx and_zpx rol_zpx bbc_bzr sec_imp and_aby inc_acc clb_bac ldm_imz and_abx rol_abx clb_biz
-rti_imp eor_idx kil_non bbs_bar com_zpg eor_zpg lsr_zpg bbs_bzr pha_imp eor_imm lsr_acc seb_bac jmp_adr eor_aba lsr_aba seb_biz
-bvc_rel eor_idy kil_non bbc_bar nop_zpx eor_zpx lsr_zpx bbc_bzr cli_imp eor_aby nop_imp clb_bac nop_abx eor_abx lsr_abx clb_biz
-rts_imp adc_idx kil_non bbs_bar nop_zpg adc_zpg ror_zpg bbs_bzr pla_imp adc_imm ror_acc seb_bac jmp_ind adc_aba ror_aba seb_biz
-bvs_rel adc_idy kil_non bbc_bar nop_zpx adc_zpx ror_zpx bbc_bzr sei_imp adc_aby nop_imp clb_bac nop_abx adc_abx ror_abx clb_biz
-bra_rel sta_idx rrf_zpg bbs_bar sty_zpg sta_zpg stx_zpg bbs_bzr dey_imp nop_imm txa_imp seb_bac sty_aba sta_aba stx_aba seb_biz
-bcc_rel sta_idy kil_non bbc_bar sty_zpx sta_zpx stx_zpy bbc_bzr tya_imp sta_aby txs_imp clb_bac shy_abx sta_abx shx_aby clb_biz
-ldy_imm lda_idx ldx_imm bbs_bar ldy_zpg lda_zpg ldx_zpg bbs_bzr tay_imp lda_imm tax_imp seb_bac ldy_aba lda_aba ldx_aba seb_biz
-bcs_rel lda_idy jmp_zpi bbc_bar ldy_zpx lda_zpx ldx_zpy bbc_bzr clv_imp lda_aby tsx_imp clb_bac ldy_abx lda_abx ldx_aby clb_biz
-cpy_imm cmp_idx nop_imm bbs_bar cpy_zpg cmp_zpg dec_zpg bbs_bzr iny_imp cmp_imm dex_imp seb_bac cpy_aba cmp_aba dec_aba seb_biz
-bne_rel cmp_idy kil_non bbc_bar nop_zpx cmp_zpx dec_zpx bbc_bzr cld_imp cmp_aby nop_imp clb_bac nop_abx cmp_abx dec_abx clb_biz
-cpx_imm sbc_idx nop_imm bbs_bar cpx_zpg sbc_zpg inc_zpg bbs_bzr inx_imp sbc_imm nop_imp seb_bac cpx_aba sbc_aba inc_aba seb_biz
-beq_rel sbc_idy kil_non bbc_bar nop_zpx sbc_zpx inc_zpx bbc_bzr sed_imp sbc_aby nop_imp clb_bac nop_abx sbc_abx inc_abx clb_biz
-brk740_imp ort_idx kil_non bbs_bar nop_zpg ort_zpg asl_zpg bbs_bzr php_imp ort_imm asl_acc seb_bac nop_aba ort_aba asl_aba seb_biz
-bpl_rel ort_idy clt_imp bbc_bar nop_zpx ort_zpx asl_zpx bbc_bzr clc_imp ort_aby dect_acc clb_bac nop_abx ort_abx asl_abx clb_biz
-jsr_adr andt_idx jsr_spg bbs_bar bit_zpg andt_zpg rol_zpg bbs_bzr plp_imp andt_imm rol_acc seb_bac bit_aba andt_aba rol_aba seb_biz
-bmi_rel andt_idy set_imp bbc_bar nop_zpx andt_zpx rol_zpx bbc_bzr sec_imp andt_aby inct_acc clb_bac ldm_imz andt_abx rol_abx clb_biz
-rti_imp eort_idx kil_non bbs_bar com_zpg eort_zpg lsr_zpg bbs_bzr pha_imp eort_imm lsr_acc seb_bac jmp_adr eort_aba lsr_aba seb_biz
-bvc_rel eort_idy kil_non bbc_bar nop_zpx eort_zpx lsr_zpx bbc_bzr cli_imp eort_aby nop_imp clb_bac nop_abx eort_abx lsr_abx clb_biz
-rts_imp adct_idx kil_non bbs_bar nop_zpg adct_zpg ror_zpg bbs_bzr pla_imp adct_imm ror_acc seb_bac jmp_ind adct_aba ror_aba seb_biz
-bvs_rel adct_idy kil_non bbc_bar nop_zpx adct_zpx ror_zpx bbc_bzr sei_imp adct_aby nop_imp clb_bac nop_abx adct_abx ror_abx clb_biz
-bra_rel sta_idx rrf_zpg bbs_bar sty_zpg sta_zpg stx_zpg bbs_bzr dey_imp nop_imm txa_imp seb_bac sty_aba sta_aba stx_aba seb_biz
-bcc_rel sta_idy kil_non bbc_bar sty_zpx sta_zpx stx_zpy bbc_bzr tya_imp sta_aby txs_imp clb_bac shy_abx sta_abx shx_aby clb_biz
-ldy_imm ldt_idx ldx_imm bbs_bar ldy_zpg ldt_zpg ldx_zpg bbs_bzr tay_imp ldt_imm tax_imp seb_bac ldy_aba ldt_aba ldx_aba seb_biz
-bcs_rel ldt_idy jmp_zpi bbc_bar ldy_zpx ldt_zpx ldx_zpy bbc_bzr clv_imp ldt_aby tsx_imp clb_bac ldy_abx ldt_abx ldx_aby clb_biz
-cpy_imm cmp_idx nop_imm bbs_bar cpy_zpg cmpt_zpg dec_zpg bbs_bzr iny_imp cmpt_imm dex_imp seb_bac cpy_aba cmpt_aba dec_aba seb_biz
-bne_rel cmp_idy kil_non bbc_bar nop_zpx cmpt_zpx dec_zpx bbc_bzr cld_imp cmpt_aby nop_imp clb_bac nop_abx cmpt_abx dec_abx clb_biz
-cpx_imm sbct_idx nop_imm bbs_bar cpx_zpg sbct_zpg inc_zpg bbs_bzr inx_imp sbc_imm nop_imp seb_bac cpx_aba sbct_aba inc_aba seb_biz
-beq_rel sbct_idy kil_non bbc_bar nop_zpx sbct_zpx inc_zpx bbc_bzr sed_imp sbc_aby nop_imp clb_bac nop_abx sbct_abx inc_abx clb_biz
-reset740
diff --git a/src/emu/cpu/m6502/dn2a03.lst b/src/emu/cpu/m6502/dn2a03.lst
deleted file mode 100644
index 7f0a5d4a9cb..00000000000
--- a/src/emu/cpu/m6502/dn2a03.lst
+++ /dev/null
@@ -1,18 +0,0 @@
-# n2a03 - D flag is disabled but present in the P register
-brk_imp ora_idx kil_non slo_idx nop_zpg ora_zpg asl_zpg slo_zpg php_imp ora_imm asl_acc anc_imm nop_aba ora_aba asl_aba slo_aba
-bpl_rel ora_idy kil_non slo_idy nop_zpx ora_zpx asl_zpx slo_zpx clc_imp ora_aby nop_imp slo_aby nop_abx ora_abx asl_abx slo_abx
-jsr_adr and_idx kil_non rla_idx bit_zpg and_zpg rol_zpg rla_zpg plp_imp and_imm rol_acc anc_imm bit_aba and_aba rol_aba rla_aba
-bmi_rel and_idy kil_non rla_idy nop_zpx and_zpx rol_zpx rla_zpx sec_imp and_aby nop_imp rla_aby nop_abx and_abx rol_abx rla_abx
-rti_imp eor_idx kil_non sre_idx nop_zpg eor_zpg lsr_zpg sre_zpg pha_imp eor_imm lsr_acc asr_imm jmp_adr eor_aba lsr_aba sre_aba
-bvc_rel eor_idy kil_non sre_idy nop_zpx eor_zpx lsr_zpx sre_zpx cli_imp eor_aby nop_imp sre_aby nop_abx eor_abx lsr_abx sre_abx
-rts_imp adc_nd_idx kil_non rra_nd_idx nop_zpg adc_nd_zpg ror_zpg rra_nd_zpg pla_imp adc_nd_imm ror_acc arr_nd_imm jmp_ind adc_nd_aba ror_aba rra_nd_aba
-bvs_rel adc_nd_idy kil_non rra_nd_idy nop_zpx adc_nd_zpx ror_zpx rra_nd_zpx sei_imp adc_nd_aby nop_imp rra_nd_aby nop_abx adc_nd_abx ror_abx rra_nd_abx
-nop_imm sta_idx nop_imm sax_idx sty_zpg sta_zpg stx_zpg sax_zpg dey_imp nop_imm txa_imp ane_imm sty_aba sta_aba stx_aba sax_aba
-bcc_rel sta_idy kil_non sha_idy sty_zpx sta_zpx stx_zpy sax_zpy tya_imp sta_aby txs_imp shs_aby shy_abx sta_abx shx_aby sha_aby
-ldy_imm lda_idx ldx_imm lax_idx ldy_zpg lda_zpg ldx_zpg lax_zpg tay_imp lda_imm tax_imp lxa_imm ldy_aba lda_aba ldx_aba lax_aba
-bcs_rel lda_idy kil_non lax_idy ldy_zpx lda_zpx ldx_zpy lax_zpy clv_imp lda_aby tsx_imp las_aby ldy_abx lda_abx ldx_aby lax_aby
-cpy_imm cmp_idx nop_imm dcp_idx cpy_zpg cmp_zpg dec_zpg dcp_zpg iny_imp cmp_imm dex_imp sbx_imm cpy_aba cmp_aba dec_aba dcp_aba
-bne_rel cmp_idy kil_non dcp_idy nop_zpx cmp_zpx dec_zpx dcp_zpx cld_imp cmp_aby nop_imp dcp_aby nop_abx cmp_abx dec_abx dcp_abx
-cpx_imm sbc_nd_idx nop_imm isb_nd_idx cpx_zpg sbc_nd_zpg inc_zpg isb_nd_zpg inx_imp sbc_nd_imm nop_imp sbc_nd_imm cpx_aba sbc_nd_aba inc_aba isb_nd_aba
-beq_rel sbc_nd_idy kil_non isb_nd_idy nop_zpx sbc_nd_zpx inc_zpx isb_nd_zpx sed_imp sbc_nd_aby nop_imp isb_nd_aby nop_abx sbc_nd_abx inc_abx isb_nd_abx
-reset
diff --git a/src/emu/cpu/m6502/dr65c02.lst b/src/emu/cpu/m6502/dr65c02.lst
deleted file mode 100644
index fa4a97bda56..00000000000
--- a/src/emu/cpu/m6502/dr65c02.lst
+++ /dev/null
@@ -1,18 +0,0 @@
-# r65c02 - rockwell variant, with the bitwise instructions and stp/wai
-brk_c_imp ora_idx nop_imm nop_c_imp tsb_zpg ora_zpg asl_zpg rmb_bzp php_imp ora_imm asl_acc nop_c_imp tsb_aba ora_aba asl_aba bbr_zpb
-bpl_rel ora_idy ora_zpi nop_c_imp trb_zpg ora_zpx asl_zpx rmb_bzp clc_imp ora_aby inc_acc nop_c_imp trb_aba ora_abx asl_c_abx bbr_zpb
-jsr_adr and_idx nop_imm nop_c_imp bit_zpg and_zpg rol_zpg rmb_bzp plp_imp and_imm rol_acc nop_c_imp bit_aba and_aba rol_aba bbr_zpb
-bmi_rel and_idy and_zpi nop_c_imp bit_zpx and_zpx rol_zpx rmb_bzp sec_imp and_aby dec_acc nop_c_imp bit_abx and_abx rol_c_abx bbr_zpb
-rti_imp eor_idx nop_imm nop_c_imp nop_zpg eor_zpg lsr_zpg rmb_bzp pha_imp eor_imm lsr_acc nop_c_imp jmp_adr eor_aba lsr_aba bbr_zpb
-bvc_rel eor_idy eor_zpi nop_c_imp nop_zpx eor_zpx lsr_zpx rmb_bzp cli_imp eor_aby phy_imp nop_c_imp nop_c_aba eor_abx lsr_c_abx bbr_zpb
-rts_imp adc_c_idx nop_imm nop_c_imp stz_zpg adc_c_zpg ror_zpg rmb_bzp pla_imp adc_c_imm ror_acc nop_c_imp jmp_c_ind adc_c_aba ror_aba bbr_zpb
-bvs_rel adc_c_idy adc_c_zpi nop_c_imp stz_zpx adc_c_zpx ror_zpx rmb_bzp sei_imp adc_c_aby ply_imp nop_c_imp jmp_iax adc_c_abx ror_c_abx bbr_zpb
-bra_rel sta_idx nop_imm nop_c_imp sty_zpg sta_zpg stx_zpg smb_bzp dey_imp bit_imm txa_imp nop_c_imp sty_aba sta_aba stx_aba bbs_zpb
-bcc_rel sta_idy sta_zpi nop_c_imp sty_zpx sta_zpx stx_zpy smb_bzp tya_imp sta_aby txs_imp nop_c_imp stz_aba sta_abx stz_abx bbs_zpb
-ldy_imm lda_idx ldx_imm nop_c_imp ldy_zpg lda_zpg ldx_zpg smb_bzp tay_imp lda_imm tax_imp nop_c_imp ldy_aba lda_aba ldx_aba bbs_zpb
-bcs_rel lda_idy lda_zpi nop_c_imp ldy_zpx lda_zpx ldx_zpy smb_bzp clv_imp lda_aby tsx_imp nop_c_imp ldy_abx lda_abx ldx_aby bbs_zpb
-cpy_imm cmp_idx nop_imm nop_c_imp cpy_zpg cmp_zpg dec_zpg smb_bzp iny_imp cmp_imm dex_imp wai_imp cpy_aba cmp_aba dec_aba bbs_zpb
-bne_rel cmp_idy cmp_zpi nop_c_imp nop_zpx cmp_zpx dec_zpx smb_bzp cld_imp cmp_aby phx_imp stp_imp nop_c_abx cmp_abx dec_abx bbs_zpb
-cpx_imm sbc_c_idx nop_imm nop_c_imp cpx_zpg sbc_c_zpg inc_zpg smb_bzp inx_imp sbc_c_imm nop_imp nop_c_imp cpx_aba sbc_c_aba inc_aba bbs_zpb
-beq_rel sbc_c_idy sbc_c_zpi nop_c_imp nop_zpx sbc_c_zpx inc_zpx smb_bzp sed_imp sbc_c_aby plx_imp nop_c_imp nop_c_abx sbc_c_abx inc_abx bbs_zpb
-reset
diff --git a/src/emu/cpu/m6502/m3745x.c b/src/emu/cpu/m6502/m3745x.c
deleted file mode 100644
index 79aa2a95a83..00000000000
--- a/src/emu/cpu/m6502/m3745x.c
+++ /dev/null
@@ -1,503 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:R. Belmont, Olivier Galibert
-/*
- Mitsubishi M3745x 8-bit microcontroller family
-*/
-
-#include "emu.h"
-#include "m3745x.h"
-
-//**************************************************************************
-// MACROS / CONSTANTS
-//**************************************************************************
-
-// Interrupt control bits (interpolated from C68 program; need 7450 Group manual badly)
-
-#define IRQ1_INT1 (0x04)
-#define IRQ1_INT2 (0x08) // guess, not used in C68
-#define IRQ1_INT3 (0x10) // guess, not used in C68
-
-#define IRQ2_SERIALRX (0x08)
-#define IRQ2_SERIALTX (0x10)
-#define IRQ2_ADC (0x20)
-
-#define ADCTRL_CH_MASK (0x07) // AD ctrl reg. channel mask
-#define ADCTRL_COMPLETE (0x08) // AD ctrl "start"/"complete" bit
-
-//**************************************************************************
-// DEVICE DEFINITIONS
-//**************************************************************************
-
-const device_type M37450 = &device_creator<m37450_device>;
-
-//**************************************************************************
-// LIVE DEVICE
-//**************************************************************************
-
-//-------------------------------------------------
-// m3745x_device - constructor
-//-------------------------------------------------
-m3745x_device::m3745x_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, address_map_constructor internal_map, const char *shortname, const char *source) :
- m740_device(mconfig, type, name, tag, owner, clock, "m3745x", source),
- m_program_config("program", ENDIANNESS_LITTLE, 8, 16, 0, internal_map),
- read_p3(*this),
- read_p4(*this),
- read_p5(*this),
- read_p6(*this),
- write_p3(*this),
- write_p4(*this),
- write_p5(*this),
- write_p6(*this),
- read_ad_0(*this),
- read_ad_1(*this),
- read_ad_2(*this),
- read_ad_3(*this),
- read_ad_4(*this),
- read_ad_5(*this),
- read_ad_6(*this),
- read_ad_7(*this)
-{
-}
-
-//-------------------------------------------------
-// device_start - device-specific startup
-//-------------------------------------------------
-
-void m3745x_device::device_start()
-{
- read_p3.resolve_safe(0);
- read_p4.resolve_safe(0);
- read_p5.resolve_safe(0);
- read_p6.resolve_safe(0);
- write_p3.resolve_safe();
- write_p4.resolve_safe();
- write_p5.resolve_safe();
- write_p6.resolve_safe();
- read_ad_0.resolve_safe(0);
- read_ad_1.resolve_safe(0);
- read_ad_2.resolve_safe(0);
- read_ad_3.resolve_safe(0);
- read_ad_4.resolve_safe(0);
- read_ad_5.resolve_safe(0);
- read_ad_6.resolve_safe(0);
- read_ad_7.resolve_safe(0);
-
- for (int i = 0; i < NUM_TIMERS; i++)
- {
- m_timers[i] = timer_alloc(i, NULL);
- }
-
- m740_device::device_start();
-
- save_item(NAME(m_ports));
- save_item(NAME(m_ddrs));
- save_item(NAME(m_intreq1));
- save_item(NAME(m_intreq2));
- save_item(NAME(m_intctrl1));
- save_item(NAME(m_intctrl2));
- save_item(NAME(m_adctrl));
- save_item(NAME(m_last_all_ints));
-
- // all ports reset to input on startup
- memset(m_ddrs, 0, sizeof(m_ddrs));
- memset(m_ports, 0, sizeof(m_ports));
- m_intreq1 = m_intreq2 = m_intctrl1 = m_intctrl2 = 0;
- m_adctrl = 0;
- m_last_all_ints = 0;
-}
-
-
-//-------------------------------------------------
-// device_reset - device-specific reset
-//-------------------------------------------------
-
-void m3745x_device::device_reset()
-{
- m740_device::device_reset();
-
- SP = 0x01ff; // we have the "traditional" stack in page 1, not 0 like some M740 derivatives
-
- for (int i = 0; i < NUM_TIMERS; i++)
- {
- m_timers[i]->adjust(attotime::never);
- }
-
- // all ports reset to input on startup
- memset(m_ddrs, 0, sizeof(m_ddrs));
- memset(m_ports, 0, sizeof(m_ports));
- m_intreq1 = m_intreq2 = m_intctrl1 = m_intctrl2 = 0;
- m_adctrl = 0;
- m_last_all_ints = 0;
-}
-
-void m3745x_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
-{
- switch (id)
- {
- case TIMER_ADC:
- m_timers[TIMER_ADC]->adjust(attotime::never);
-
- m_adctrl |= ADCTRL_COMPLETE;
- m_intreq2 |= IRQ2_ADC;
- recalc_irqs();
- break;
-
- default:
- printf("M3775x: unknown timer expire %d\n", id);
- break;
- }
-}
-
-void m3745x_device::execute_set_input(int inputnum, int state)
-{
- switch (inputnum)
- {
- case M3745X_INT1_LINE:
- if (state == ASSERT_LINE)
- {
- m_intreq1 |= IRQ1_INT1;
- }
- else
- {
- m_intreq1 &= ~IRQ1_INT1;
- }
- break;
-
- case M3745X_INT2_LINE:
- if (state == ASSERT_LINE)
- {
- m_intreq1 |= IRQ1_INT2;
- }
- else
- {
- m_intreq1 &= ~IRQ1_INT2;
- }
- break;
-
- case M3745X_INT3_LINE:
- if (state == ASSERT_LINE)
- {
- m_intreq1 |= IRQ1_INT3;
- }
- else
- {
- m_intreq1 &= ~IRQ1_INT3;
- }
- break;
-
- case M3745X_SET_OVERFLOW: // the base 740 class can handle this
- m740_device::execute_set_input(M740_SET_OVERFLOW, state);
- break;
- }
-
- recalc_irqs();
-}
-
-void m3745x_device::recalc_irqs()
-{
- UINT16 all_ints = 0;
- int static const irq_lines[16] =
- {
- -1, -1, -1, M740_INT11_LINE, M740_INT12_LINE, M740_INT13_LINE, -1, -1,
- -1, -1, M740_INT2_LINE, M740_INT3_LINE, M740_INT4_LINE, -1, -1, -1
- };
-
- all_ints = (m_intreq1 & m_intctrl1) << 8;
- all_ints |= (m_intreq2 & m_intctrl2);
-
-// printf("recalc_irqs: last_all_ints = %04x last_ints = %04x (req1 %02x ctrl1 %02x req2 %02x ctrl2 %02x)\n", all_ints, m_last_all_ints, m_intreq1, m_intctrl1, m_intreq2, m_intctrl2);
-
- // check all 16 IRQ bits for changes
- for (int i = 0; i < 16; i++)
- {
- // if bit is set now
- if (all_ints & (1 << i))
- {
- // and wasn't last time
- if (!(m_last_all_ints & (1 << i)))
- {
-// printf(" asserting irq %d (%d)\n", i, irq_lines[i]);
- if (irq_lines[i] != -1)
- {
- m740_device::execute_set_input(irq_lines[i], ASSERT_LINE);
- }
- }
- }
- else // bit is clear now
- {
- // ...and wasn't clear last time
- if (m_last_all_ints & (1 << i))
- {
-// printf(" clearing irq %d (%d)\n", i, irq_lines[i]);
- if (irq_lines[i] != -1)
- {
- m740_device::execute_set_input(irq_lines[i], CLEAR_LINE);
- }
- }
- }
- }
-
- m_last_all_ints = all_ints;
-}
-
-void m3745x_device::send_port(address_space &space, UINT8 offset, UINT8 data)
-{
- switch (offset)
- {
- case 0:
- write_p3(data);
- break;
-
- case 1:
- write_p4(data);
- break;
-
- case 2:
- write_p5(data);
- break;
-
- case 3:
- write_p6(data);
- break;
- }
-}
-
-UINT8 m3745x_device::read_port(UINT8 offset)
-{
- UINT8 incoming = 0;
-
- switch (offset)
- {
- case 0:
- incoming = read_p3();
- break;
-
- case 1:
- incoming = read_p4();
- break;
-
- case 2:
- incoming = read_p5();
- break;
-
- case 3:
- incoming = read_p6();
- break;
- }
-
- // apply data direction registers
- incoming &= (m_ddrs[offset] ^ 0xff);
- // OR in ddr-masked version of port writes
- incoming |= (m_ports[offset] & m_ddrs[offset]);
-
- return incoming;
-}
-
-READ8_MEMBER(m3745x_device::ports_r)
-{
- switch (offset)
- {
- case 0:
- return read_port(0);
-
- case 1:
- return m_ddrs[0];
-
- case 2:
- return read_port(1);
-
- case 4:
- return read_port(2);
-
- case 5:
- return m_ddrs[2];
-
- case 6:
- return read_port(3);
-
- case 7:
- return m_ddrs[3];
- }
-
- return 0xff;
-}
-
-WRITE8_MEMBER(m3745x_device::ports_w)
-{
- switch (offset)
- {
- case 0: // p3
- send_port(space, 0, data & m_ddrs[0]);
- m_ports[0] = data;
- break;
-
- case 1: // p3 ddr
- send_port(space, 0, m_ports[0] & data);
- m_ddrs[0] = data;
- break;
-
- case 2: // p4
- send_port(space, 1, data & m_ddrs[1]);
- m_ports[1] = data;
- break;
-
- case 4: // p5
- send_port(space, 2, data & m_ddrs[2]);
- m_ports[2] = data;
- break;
-
- case 5: // p5 ddr
- send_port(space, 2, m_ports[2] & data);
- m_ddrs[2] = data;
- break;
-
- case 6: // p6
- send_port(space, 3, data & m_ddrs[3]);
- m_ports[3] = data;
- break;
-
- case 7: // p6 ddr
- send_port(space, 3, m_ports[3] & data);
- m_ddrs[3] = data;
- break;
- }
-}
-
-READ8_MEMBER(m3745x_device::intregs_r)
-{
- switch (offset)
- {
- case 0:
- return m_intreq1;
-
- case 1:
- return m_intreq2;
-
- case 2:
- return m_intctrl1;
-
- case 3:
- return m_intctrl2;
- }
-
- // this should never happen
- assert(0);
- return 0;
-}
-
-WRITE8_MEMBER(m3745x_device::intregs_w)
-{
- switch (offset)
- {
- case 0:
- m_intreq1 = data;
- break;
-
- case 1:
- m_intreq2 = data;
- break;
-
- case 2:
- m_intctrl1 = data;
- break;
-
- case 3:
- m_intctrl2 = data;
- break;
- }
-
- recalc_irqs();
-}
-
-READ8_MEMBER(m3745x_device::adc_r)
-{
- UINT8 rv = 0;
-
- switch (offset)
- {
- case 0:
- m_intreq2 &= ~IRQ2_ADC;
- recalc_irqs();
-
- switch (m_adctrl & 7)
- {
- case 0:
- rv = read_ad_0();
- break;
-
- case 1:
- rv = read_ad_1();
- break;
-
- case 2:
- rv = read_ad_2();
- break;
-
- case 3:
- rv = read_ad_3();
- break;
-
- case 4:
- rv = read_ad_4();
- break;
-
- case 5:
- rv = read_ad_5();
- break;
-
- case 6:
- rv = read_ad_6();
- break;
-
- case 7:
- rv = read_ad_7();
- break;
- }
- return rv;
-
- case 1:
- return m_adctrl;
- }
-
- return 0;
-}
-
-WRITE8_MEMBER(m3745x_device::adc_w)
-{
- switch (offset)
- {
- case 0:
- printf("M3745x: Write %02x to ADC output?!\n", data);
- break;
-
- case 1:
- m_adctrl = data;
-
- // starting a conversion? this takes 50 cycles.
- if (!(m_adctrl & ADCTRL_COMPLETE))
- {
- double hz = (double)clock() / 50.0;
- m_timers[TIMER_ADC]->adjust(attotime::from_hz(hz));
- }
- break;
- }
-}
-
-/* M37450 - baseline for this familiy */
-static ADDRESS_MAP_START( m37450_map, AS_PROGRAM, 8, m37450_device )
- AM_RANGE(0x0000, 0x00bf) AM_RAM
- AM_RANGE(0x00d6, 0x00dd) AM_READWRITE(ports_r, ports_w)
- AM_RANGE(0x00e2, 0x00e3) AM_READWRITE(adc_r, adc_w)
- AM_RANGE(0x00fc, 0x00ff) AM_READWRITE(intregs_r, intregs_w)
- AM_RANGE(0x0100, 0x01ff) AM_RAM
-ADDRESS_MAP_END
-
-m37450_device::m37450_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
- m3745x_device(mconfig, M37450, "Mitsubishi M37450", tag, owner, clock, ADDRESS_MAP_NAME(m37450_map), "m3745x", __FILE__)
-{
-}
-
-m37450_device::m37450_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
- m3745x_device(mconfig, type, name, tag, owner, clock, ADDRESS_MAP_NAME(m37450_map), shortname, source)
-{
-}
diff --git a/src/emu/cpu/m6502/m3745x.h b/src/emu/cpu/m6502/m3745x.h
deleted file mode 100644
index d7d24c80880..00000000000
--- a/src/emu/cpu/m6502/m3745x.h
+++ /dev/null
@@ -1,157 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Olivier Galibert
-#pragma once
-
-#ifndef __M3745X_H__
-#define __M3745X_H__
-
-#include "m740.h"
-
-//**************************************************************************
-// INTERFACE CONFIGURATION MACROS
-//**************************************************************************
-
-#define MCFG_M3745X_ADC14_CALLBACKS(_ad0, _ad1, _ad2, _ad3) \
- downcast<m3745x_device *>(device)->set_ad14_callbacks(DEVCB_##_ad0, DEVCB_##_ad1, DEVCB_##_ad2, DEVCB_##_ad3);
-
-#define MCFG_M3745X_ADC58_CALLBACKS(_ad0, _ad1, _ad2, _ad3) \
- downcast<m3745x_device *>(device)->set_ad58_callbacks(DEVCB_##_ad0, DEVCB_##_ad1, DEVCB_##_ad2, DEVCB_##_ad3);
-
-#define MCFG_M3745X_PORT3_CALLBACKS(_read, _write) \
- downcast<m3745x_device *>(device)->set_p3_callbacks(DEVCB_##_read, DEVCB_##_write);
-
-#define MCFG_M3745X_PORT4_CALLBACKS(_read, _write) \
- downcast<m3745x_device *>(device)->set_p4_callbacks(DEVCB_##_read, DEVCB_##_write);
-
-#define MCFG_M3745X_PORT5_CALLBACKS(_read, _write) \
- downcast<m3745x_device *>(device)->set_p5_callbacks(DEVCB_##_read, DEVCB_##_write);
-
-#define MCFG_M3745X_PORT6_CALLBACKS(_read, _write) \
- downcast<m3745x_device *>(device)->set_p6_callbacks(DEVCB_##_read, DEVCB_##_write);
-
-//**************************************************************************
-// TYPE DEFINITIONS
-//**************************************************************************
-
-// ======================> m3745x_device
-
-class m3745x_device : public m740_device
-{
- friend class m37450_device;
-
- enum
- {
- TIMER_1 = 0,
- TIMER_2,
- TIMER_3,
-
- TIMER_ADC,
-
- NUM_TIMERS
- };
-
-public:
- enum
- {
- M3745X_INT1_LINE = INPUT_LINE_IRQ0,
- M3745X_INT2_LINE,
- M3745X_INT3_LINE,
-
- M3745X_SET_OVERFLOW = M740_SET_OVERFLOW
- };
-
- // construction/destruction
- m3745x_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, address_map_constructor internal_map, const char *shortname, const char *source);
-
- const address_space_config m_program_config;
-
- template<class _read, class _write> void set_p3_callbacks(_read rd, _write wr)
- {
- read_p3.set_callback(rd);
- write_p3.set_callback(wr);
- }
-
- template<class _read, class _write> void set_p4_callbacks(_read rd, _write wr)
- {
- read_p4.set_callback(rd);
- write_p4.set_callback(wr);
- }
-
- template<class _read, class _write> void set_p5_callbacks(_read rd, _write wr)
- {
- read_p5.set_callback(rd);
- write_p5.set_callback(wr);
- }
-
- template<class _read, class _write> void set_p6_callbacks(_read rd, _write wr)
- {
- read_p6.set_callback(rd);
- write_p6.set_callback(wr);
- }
-
- template<class _read, class _read2, class _read3, class _read4> void set_ad14_callbacks(_read rd, _read2 rd2, _read3 rd3, _read4 rd4)
- {
- read_ad_0.set_callback(rd);
- read_ad_1.set_callback(rd2);
- read_ad_2.set_callback(rd3);
- read_ad_3.set_callback(rd4);
- }
-
- template<class _read, class _read2, class _read3, class _read4> void set_ad58_callbacks(_read rd, _read2 rd2, _read3 rd3, _read4 rd4)
- {
- read_ad_4.set_callback(rd);
- read_ad_5.set_callback(rd2);
- read_ad_6.set_callback(rd3);
- read_ad_7.set_callback(rd4);
- }
-
- devcb_read8 read_p3, read_p4, read_p5, read_p6;
- devcb_write8 write_p3, write_p4, write_p5, write_p6;
- devcb_read8 read_ad_0, read_ad_1, read_ad_2, read_ad_3;
- devcb_read8 read_ad_4, read_ad_5, read_ad_6, read_ad_7;
-
- DECLARE_READ8_MEMBER(ports_r);
- DECLARE_WRITE8_MEMBER(ports_w);
- DECLARE_READ8_MEMBER(adc_r);
- DECLARE_WRITE8_MEMBER(adc_w);
- DECLARE_READ8_MEMBER(intregs_r);
- DECLARE_WRITE8_MEMBER(intregs_w);
-
- bool are_port_bits_output(UINT8 port, UINT8 mask) { return ((m_ddrs[port] & mask) == mask) ? true : false; }
-
-protected:
- // device-level overrides
- virtual void device_start();
- virtual void device_reset();
- virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
- virtual void execute_set_input(int inputnum, int state);
- virtual const address_space_config *memory_space_config(address_spacenum spacenum) const { return (spacenum == AS_PROGRAM) ? &m_program_config : NULL; }
-
- void send_port(address_space &space, UINT8 offset, UINT8 data);
- UINT8 read_port(UINT8 offset);
-
- void recalc_irqs();
-
- UINT8 m_ports[6], m_ddrs[6];
- UINT8 m_intreq1, m_intreq2, m_intctrl1, m_intctrl2;
- UINT8 m_adctrl;
- UINT16 m_last_all_ints;
-
-private:
- emu_timer *m_timers[NUM_TIMERS];
-};
-
-class m37450_device : public m3745x_device
-{
-public:
- m37450_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
- m37450_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
-
-protected:
-
-private:
-};
-
-extern const device_type M37450;
-
-#endif
diff --git a/src/emu/cpu/m6502/m4510.c b/src/emu/cpu/m6502/m4510.c
deleted file mode 100644
index 2a7eb10ee1e..00000000000
--- a/src/emu/cpu/m6502/m4510.c
+++ /dev/null
@@ -1,106 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Olivier Galibert
-/***************************************************************************
-
- m4510.c
-
- 65ce02 with a mmu and a cia integrated
-
-***************************************************************************/
-
-#include "emu.h"
-#include "m4510.h"
-
-const device_type M4510 = &device_creator<m4510_device>;
-
-m4510_device::m4510_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
- m65ce02_device(mconfig, M4510, "M4510", tag, owner, clock, "m4510", __FILE__)
-{
- program_config.m_addrbus_width = 20;
- program_config.m_logaddr_width = 16;
- program_config.m_page_shift = 13;
- sprogram_config.m_addrbus_width = 20;
- sprogram_config.m_logaddr_width = 16;
- sprogram_config.m_page_shift = 13;
-}
-
-offs_t m4510_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options)
-{
- return disassemble_generic(buffer, pc, oprom, opram, options, disasm_entries);
-}
-
-void m4510_device::device_start()
-{
- if(direct_disabled)
- mintf = new mi_4510_nd(this);
- else
- mintf = new mi_4510_normal(this);
-
- m65ce02_device::init();
-
- save_item(NAME(map_offset));
- save_item(NAME(map_enable));
-}
-
-void m4510_device::device_reset()
-{
- map_offset[0] = map_offset[1] = 0;
- map_enable = 0;
- nomap = true;
-
- // Wild guess, this setting makes the cpu start executing some code in the c65 driver
- //map_offset[1] = 0x2e000;
- //map_enable = 0x80;
- m65ce02_device::device_reset();
-}
-
-bool m4510_device::memory_translate(address_spacenum spacenum, int intention, offs_t &address)
-{
- if (spacenum == AS_PROGRAM)
- {
- address = map(address);
- }
-
- return true;
-}
-
-m4510_device::mi_4510_normal::mi_4510_normal(m4510_device *_base)
-{
- base = _base;
-}
-
-UINT8 m4510_device::mi_4510_normal::read(UINT16 adr)
-{
- return program->read_byte(base->map(adr));
-}
-
-UINT8 m4510_device::mi_4510_normal::read_sync(UINT16 adr)
-{
- return sdirect->read_byte(base->map(adr));
-}
-
-UINT8 m4510_device::mi_4510_normal::read_arg(UINT16 adr)
-{
- return direct->read_byte(base->map(adr));
-}
-
-void m4510_device::mi_4510_normal::write(UINT16 adr, UINT8 val)
-{
- program->write_byte(base->map(adr), val);
-}
-
-m4510_device::mi_4510_nd::mi_4510_nd(m4510_device *_base) : mi_4510_normal(_base)
-{
-}
-
-UINT8 m4510_device::mi_4510_nd::read_sync(UINT16 adr)
-{
- return sprogram->read_byte(base->map(adr));
-}
-
-UINT8 m4510_device::mi_4510_nd::read_arg(UINT16 adr)
-{
- return program->read_byte(base->map(adr));
-}
-
-#include "cpu/m6502/m4510.inc"
diff --git a/src/emu/cpu/m6502/m4510.h b/src/emu/cpu/m6502/m4510.h
deleted file mode 100644
index 492572fddb6..00000000000
--- a/src/emu/cpu/m6502/m4510.h
+++ /dev/null
@@ -1,82 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Olivier Galibert
-/***************************************************************************
-
- m4510.h
-
- 65ce02 with a mmu and a port
-
-***************************************************************************/
-
-#ifndef __M4510_H__
-#define __M4510_H__
-
-#include "m65ce02.h"
-
-class m4510_device : public m65ce02_device {
-public:
- m4510_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
- static const disasm_entry disasm_entries[0x100];
-
- virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options);
- virtual void do_exec_full();
- virtual void do_exec_partial();
-
- bool get_nomap() const { return nomap; }
-
-protected:
- UINT32 map_offset[2];
- UINT8 map_enable;
- bool nomap;
-
- class mi_4510_normal : public memory_interface {
- public:
- m4510_device *base;
-
- mi_4510_normal(m4510_device *base);
- virtual ~mi_4510_normal() {}
- virtual UINT8 read(UINT16 adr);
- virtual UINT8 read_sync(UINT16 adr);
- virtual UINT8 read_arg(UINT16 adr);
- virtual void write(UINT16 adr, UINT8 val);
- };
-
- class mi_4510_nd : public mi_4510_normal {
- public:
- mi_4510_nd(m4510_device *base);
- virtual ~mi_4510_nd() {}
- virtual UINT8 read_sync(UINT16 adr);
- virtual UINT8 read_arg(UINT16 adr);
- };
-
- virtual void device_start();
- virtual void device_reset();
- virtual bool memory_translate(address_spacenum spacenum, int intention, offs_t &address);
-
- inline UINT32 map(UINT16 adr) {
- if(map_enable & (1 << (adr >> 13))) {
- nomap = false;
- return adr + map_offset[adr >> 15];
- }
- nomap = true;
- return adr;
- }
-
-#define O(o) void o ## _full(); void o ## _partial()
-
- // 4510 opcodes
- O(eom_imp);
- O(map_imp);
-
-#undef O
-};
-
-enum {
- M4510_IRQ_LINE = m6502_device::IRQ_LINE,
- M4510_NMI_LINE = m6502_device::NMI_LINE
-};
-
-extern const device_type M4510;
-
-#endif
diff --git a/src/emu/cpu/m6502/m5074x.c b/src/emu/cpu/m6502/m5074x.c
deleted file mode 100644
index dc499b912c0..00000000000
--- a/src/emu/cpu/m6502/m5074x.c
+++ /dev/null
@@ -1,507 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:R. Belmont, Olivier Galibert
-/*
- Mitsubishi M5074x 8-bit microcontroller family
-*/
-
-#include "emu.h"
-#include "m5074x.h"
-
-//**************************************************************************
-// MACROS / CONSTANTS
-//**************************************************************************
-
-#define IRQ_CNTRREQ (0x80)
-#define IRQ_CNTRENA (0x40)
-#define IRQ_TMR1REQ (0x20)
-#define IRQ_TMR1ENA (0x10)
-#define IRQ_TMR2REQ (0x08)
-#define IRQ_TMR2ENA (0x04)
-#define IRQ_INTREQ (0x02)
-#define IRQ_INTENA (0x01)
-
-#define TMRC_TMRXREQ (0x80)
-#define TMRC_TMRXENA (0x40)
-#define TMRC_TMRXHLT (0x20)
-#define TMRC_TMRXMDE (0x0c)
-
-//**************************************************************************
-// DEVICE DEFINITIONS
-//**************************************************************************
-
-const device_type M50740 = &device_creator<m50740_device>;
-const device_type M50741 = &device_creator<m50741_device>;
-
-//**************************************************************************
-// LIVE DEVICE
-//**************************************************************************
-
-//-------------------------------------------------
-// m5074x_device - constructor
-//-------------------------------------------------
-m5074x_device::m5074x_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, address_map_constructor internal_map, const char *shortname, const char *source) :
- m740_device(mconfig, type, name, tag, owner, clock, shortname, source),
- m_program_config("program", ENDIANNESS_LITTLE, 8, 13, 0, internal_map),
- read_p0(*this),
- read_p1(*this),
- read_p2(*this),
- read_p3(*this),
- write_p0(*this),
- write_p1(*this),
- write_p2(*this),
- write_p3(*this)
-{
-}
-
-//-------------------------------------------------
-// device_start - device-specific startup
-//-------------------------------------------------
-
-void m5074x_device::device_start()
-{
- read_p0.resolve_safe(0);
- read_p1.resolve_safe(0);
- read_p2.resolve_safe(0);
- read_p3.resolve_safe(0);
- write_p0.resolve_safe();
- write_p1.resolve_safe();
- write_p2.resolve_safe();
- write_p3.resolve_safe();
-
- for (int i = 0; i < NUM_TIMERS; i++)
- {
- m_timers[i] = timer_alloc(i, NULL);
- }
-
- m740_device::device_start();
-
- save_item(NAME(m_ports));
- save_item(NAME(m_ddrs));
- save_item(NAME(m_intctrl));
- save_item(NAME(m_tmrctrl));
- save_item(NAME(m_tmr12pre));
- save_item(NAME(m_tmr1));
- save_item(NAME(m_tmr2));
- save_item(NAME(m_tmrxpre));
- save_item(NAME(m_tmrx));
- save_item(NAME(m_tmr1latch));
- save_item(NAME(m_tmr2latch));
- save_item(NAME(m_tmrxlatch));
- save_item(NAME(m_last_all_ints));
-
- memset(m_ports, 0, sizeof(m_ports));
- memset(m_ddrs, 0, sizeof(m_ddrs));
- m_intctrl = m_tmrctrl = 0;
- m_tmr12pre = m_tmrxpre = 0;
- m_tmr1 = m_tmr2 = m_tmrx = 0;
- m_last_all_ints = 0;
-}
-
-
-//-------------------------------------------------
-// device_reset - device-specific reset
-//-------------------------------------------------
-
-void m5074x_device::device_reset()
-{
- m740_device::device_reset();
-
- // all ports reset to input on startup
- memset(m_ports, 0, sizeof(m_ports));
- memset(m_ddrs, 0, sizeof(m_ddrs));
- m_intctrl = m_tmrctrl = 0;
- m_tmr12pre = m_tmrxpre = 0;
- m_tmr1 = m_tmr2 = m_tmrx = 0;
-}
-
-void m5074x_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
-{
- switch (id)
- {
- case TIMER_1:
- m_tmr1--;
-
- if (m_tmr1 <= 0)
- {
- m_intctrl |= IRQ_TMR1REQ;
- m_tmr1 = m_tmr1latch;
- recalc_irqs();
- }
- break;
-
- case TIMER_2:
- m_tmr2--;
-
- if (m_tmr2 <= 0)
- {
- m_intctrl |= IRQ_TMR2REQ;
- m_tmr2 = m_tmr2latch;
- recalc_irqs();
- }
- break;
-
- case TIMER_X:
- m_tmrx--;
-
- if (m_tmrx <= 0)
- {
- m_tmrctrl |= TMRC_TMRXREQ;
- m_tmrx = m_tmrxlatch;
- recalc_irqs();
- }
- break;
- }
-}
-
-void m5074x_device::execute_set_input(int inputnum, int state)
-{
- switch (inputnum)
- {
- case M5074X_INT1_LINE:
- if (state == ASSERT_LINE)
- {
- m_intctrl |= IRQ_INTREQ;
- }
- else
- {
- m_intctrl &= ~IRQ_INTREQ;
- }
- break;
-
- case M5074X_SET_OVERFLOW: // the base 740 class can handle this
- m740_device::execute_set_input(M740_SET_OVERFLOW, state);
- break;
- }
-
- recalc_irqs();
-}
-
-void m5074x_device::recalc_irqs()
-{
- UINT8 all_ints = 0;
-
- if ((m_intctrl & (IRQ_CNTRREQ|IRQ_CNTRENA)) == (IRQ_CNTRREQ|IRQ_CNTRENA))
- {
- all_ints |= 0x01;
- }
- if ((m_tmrctrl & (TMRC_TMRXREQ|TMRC_TMRXENA)) == (TMRC_TMRXREQ|TMRC_TMRXENA))
- {
- all_ints |= 0x02;
- }
- if ((m_intctrl & (IRQ_TMR1REQ|IRQ_TMR1ENA)) == (IRQ_TMR1REQ|IRQ_TMR1ENA))
- {
- all_ints |= 0x04;
- }
- if ((m_intctrl & (IRQ_TMR2REQ|IRQ_TMR2ENA)) == (IRQ_TMR2REQ|IRQ_TMR2ENA))
- {
- all_ints |= 0x08;
- }
- if ((m_intctrl & (IRQ_INTREQ|IRQ_INTENA)) == (IRQ_INTREQ|IRQ_INTENA))
- {
- all_ints |= 0x10;
- }
-
- // check all 5 IRQ bits for changes
- for (int i = 0; i < 5; i++)
- {
- // if bit is set now
- if (all_ints & (1 << i))
- {
- // and wasn't last time
- if (!(m_last_all_ints & (1 << i)))
- {
- m740_device::execute_set_input(M740_INT0_LINE + i, ASSERT_LINE);
- }
- }
- else // bit is clear now
- {
- // ...and wasn't clear last time
- if (m_last_all_ints & (1 << i))
- {
- m740_device::execute_set_input(M740_INT0_LINE + i, CLEAR_LINE);
- }
- }
- }
-
- m_last_all_ints = all_ints;
-}
-
-void m5074x_device::recalc_timer(int timer)
-{
- int hz;
-
- switch (timer)
- {
- case 0:
- hz = clock() / 16;
- hz /= (m_tmr12pre + 2);
- m_timers[TIMER_1]->adjust(attotime::from_hz(hz), 0, attotime::from_hz(hz));
- break;
-
- case 1:
- hz = clock() / 16;
- hz /= (m_tmr12pre + 2);
- m_timers[TIMER_2]->adjust(attotime::from_hz(hz), 0, attotime::from_hz(hz));
- break;
-
- case 2:
- // Timer X modes: 00 = free run countdown, 01 = invert CNTR pin each time expires,
- // 10 = count each time CNTR pin inverts, 11 = count when CNTR pin low
- if ((m_tmrctrl & TMRC_TMRXMDE) == 0)
- {
- // stop bit?
- if (m_tmrctrl & TMRC_TMRXHLT)
- {
- m_timers[TIMER_X]->adjust(attotime::never, 0, attotime::never);
- }
- else
- {
- hz = clock() / 16;
- hz /= (m_tmrxpre + 2);
- m_timers[TIMER_X]->adjust(attotime::from_hz(hz), 0, attotime::from_hz(hz));
- }
- }
- else
- {
- fatalerror("M5074x: Unhandled timer X mode %d\n", (m_tmrctrl&TMRC_TMRXMDE)>>2);
- }
- break;
- }
-}
-
-void m5074x_device::send_port(address_space &space, UINT8 offset, UINT8 data)
-{
- switch (offset)
- {
- case 0:
- write_p0(data);
- break;
-
- case 1:
- write_p1(data);
- break;
-
- case 2:
- write_p2(data);
- break;
-
- case 3:
- write_p3(data);
- break;
- }
-}
-
-UINT8 m5074x_device::read_port(UINT8 offset)
-{
- UINT8 incoming = 0;
-
- switch (offset)
- {
- case 0:
- incoming = read_p0();
- break;
-
- case 1:
- incoming = read_p1();
- break;
-
- case 2:
- incoming = read_p2();
- break;
-
- case 3:
- incoming = read_p3();
- break;
- }
-
- // apply data direction registers
- incoming &= (m_ddrs[offset] ^ 0xff);
- // OR in ddr-masked version of port writes
- incoming |= (m_ports[offset] & m_ddrs[offset]);
-
- return incoming;
-}
-
-READ8_MEMBER(m5074x_device::ports_r)
-{
- switch (offset)
- {
- case 0:
- return read_port(0);
-
- case 1:
- return m_ddrs[0];
-
- case 2:
- return read_port(1);
-
- case 3:
- return m_ddrs[1];
-
- case 4:
- return read_port(2);
-
- case 5:
- return m_ddrs[2];
-
- case 8:
- return read_port(3);
-
- case 9:
- return m_ddrs[3];
- }
-
- return 0xff;
-}
-
-WRITE8_MEMBER(m5074x_device::ports_w)
-{
- switch (offset)
- {
- case 0: // p0
- send_port(space, 0, data & m_ddrs[0]);
- m_ports[0] = data;
- break;
-
- case 1: // p0 ddr
- send_port(space, 0, m_ports[0] & data);
- m_ddrs[0] = data;
- break;
-
- case 2: // p1
- send_port(space, 1, data & m_ddrs[1]);
- m_ports[1] = data;
- break;
-
- case 3: // p1 ddr
- send_port(space, 1, m_ports[1] & data);
- m_ddrs[1] = data;
- break;
-
- case 4: // p2
- send_port(space, 2, data & m_ddrs[2]);
- m_ports[2] = data;
- break;
-
- case 5: // p2 ddr
- send_port(space, 2, m_ports[2] & data);
- m_ddrs[2] = data;
- break;
-
- case 8: // p3
- send_port(space, 3, data & m_ddrs[3]);
- m_ports[3] = data;
- break;
-
- case 9: // p3 ddr
- send_port(space, 3, m_ports[3] & data);
- m_ddrs[3] = data;
- break;
- }
-}
-
-READ8_MEMBER(m5074x_device::tmrirq_r)
-{
- switch (offset)
- {
- case 0:
- return m_tmr12pre;
-
- case 1:
- return m_tmr1;
-
- case 2:
- return m_tmr2;
-
- case 3:
- return m_tmrxpre;
-
- case 4:
- return m_tmrx;
-
- case 5:
- return m_intctrl;
-
- case 6:
- return m_tmrctrl;
- }
-
- return 0xff;
-}
-
-WRITE8_MEMBER(m5074x_device::tmrirq_w)
-{
-// printf("%02x to tmrirq @ %d\n", data, offset);
-
- switch (offset)
- {
- case 0:
- m_tmr12pre = data;
- recalc_timer(0);
- recalc_timer(1);
- break;
-
- case 1:
- m_tmr1 = m_tmr1latch = data;
- break;
-
- case 2:
- m_tmr2 = m_tmr2latch = data;
- break;
-
- case 3:
- m_tmrxpre = m_tmrxlatch = data;
- recalc_timer(2);
- break;
-
- case 4:
- m_tmrx = data;
- break;
-
- case 5:
- m_intctrl = data;
- recalc_irqs();
- break;
-
- case 6:
- m_tmrctrl = data;
- recalc_irqs();
- break;
- }
-}
-
-/* M50740 - baseline for this familiy */
-static ADDRESS_MAP_START( m50740_map, AS_PROGRAM, 8, m50740_device )
- AM_RANGE(0x0000, 0x005f) AM_RAM
- AM_RANGE(0x00e0, 0x00e9) AM_READWRITE(ports_r, ports_w)
- AM_RANGE(0x00f9, 0x00ff) AM_READWRITE(tmrirq_r, tmrirq_w)
- AM_RANGE(0x1400, 0x1fff) AM_ROM AM_REGION(M5074X_INTERNAL_ROM_REGION, 0)
-ADDRESS_MAP_END
-
-m50740_device::m50740_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
- m5074x_device(mconfig, M50740, "Mitsubishi M50740", tag, owner, clock, ADDRESS_MAP_NAME(m50740_map), "m50740", __FILE__)
-{
-}
-
-m50740_device::m50740_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
- m5074x_device(mconfig, type, name, tag, owner, clock, ADDRESS_MAP_NAME(m50740_map), shortname, source)
-{
-}
-
-/* M50741 - 50740 with a larger internal ROM */
-static ADDRESS_MAP_START( m50741_map, AS_PROGRAM, 8, m50741_device )
- AM_RANGE(0x0000, 0x005f) AM_RAM
- AM_RANGE(0x00e0, 0x00e9) AM_READWRITE(ports_r, ports_w)
- AM_RANGE(0x00f9, 0x00ff) AM_READWRITE(tmrirq_r, tmrirq_w)
- AM_RANGE(0x1000, 0x1fff) AM_ROM AM_REGION("internal", 0)
-ADDRESS_MAP_END
-
-m50741_device::m50741_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
- m5074x_device(mconfig, M50740, "Mitsubishi M50741", tag, owner, clock, ADDRESS_MAP_NAME(m50741_map), "m50741", __FILE__)
-{
-}
-
-m50741_device::m50741_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
- m5074x_device(mconfig, type, name, tag, owner, clock, ADDRESS_MAP_NAME(m50741_map), shortname, source)
-{
-}
diff --git a/src/emu/cpu/m6502/m5074x.h b/src/emu/cpu/m6502/m5074x.h
deleted file mode 100644
index 10f0aa06df5..00000000000
--- a/src/emu/cpu/m6502/m5074x.h
+++ /dev/null
@@ -1,147 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Olivier Galibert
-#pragma once
-
-#ifndef __M5074X_H__
-#define __M5074X_H__
-
-#include "m740.h"
-
-//**************************************************************************
-// CONSTANTS
-//**************************************************************************
-
-// internal ROM region
-#define M5074X_INTERNAL_ROM_REGION "internal"
-#define M5074X_INTERNAL_ROM(_tag) (_tag ":" M5074X_INTERNAL_ROM_REGION)
-
-//**************************************************************************
-// INTERFACE CONFIGURATION MACROS
-//**************************************************************************
-
-#define MCFG_M5074X_PORT0_READ_CALLBACK(_read) \
- devcb = &m5074x_device::set_p0_rd_callback(*device, DEVCB_##_read);
-
-#define MCFG_M5074X_PORT1_READ_CALLBACK(_read) \
- devcb = &m5074x_device::set_p1_rd_callback(*device, DEVCB_##_read);
-
-#define MCFG_M5074X_PORT2_READ_CALLBACK(_read) \
- devcb = &m5074x_device::set_p2_rd_callback(*device, DEVCB_##_read);
-
-#define MCFG_M5074X_PORT3_READ_CALLBACK(_read) \
- devcb = &m5074x_device::set_p3_rd_callback(*device, DEVCB_##_read);
-
-#define MCFG_M5074X_PORT0_WRITE_CALLBACK(_write) \
- devcb = &m5074x_device::set_p0_wr_callback(*device, DEVCB_##_write);
-
-#define MCFG_M5074X_PORT1_WRITE_CALLBACK(_write) \
- devcb = &m5074x_device::set_p1_wr_callback(*device, DEVCB_##_write);
-
-#define MCFG_M5074X_PORT2_WRITE_CALLBACK(_write) \
- devcb = &m5074x_device::set_p2_wr_callback(*device, DEVCB_##_write);
-
-#define MCFG_M5074X_PORT3_WRITE_CALLBACK(_write) \
- devcb = &m5074x_device::set_p3_wr_callback(*device, DEVCB_##_write);
-
-//**************************************************************************
-// TYPE DEFINITIONS
-//**************************************************************************
-
-// ======================> m5074x_device
-
-class m5074x_device : public m740_device
-{
- friend class m50740_device;
- friend class m50741_device;
-
- enum
- {
- M5074X_INT1_LINE = INPUT_LINE_IRQ0,
-
- M5074X_SET_OVERFLOW = M740_SET_OVERFLOW
- };
-
- enum
- {
- TIMER_1 = 0,
- TIMER_2,
- TIMER_X,
-
- NUM_TIMERS
- };
-
-public:
- // construction/destruction
- m5074x_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, address_map_constructor internal_map, const char *shortname, const char *source);
-
- const address_space_config m_program_config;
-
- template<class _Object> static devcb_base &set_p0_rd_callback(device_t &device, _Object object) { return downcast<m5074x_device &>(device).read_p0.set_callback(object); }
- template<class _Object> static devcb_base &set_p1_rd_callback(device_t &device, _Object object) { return downcast<m5074x_device &>(device).read_p1.set_callback(object); }
- template<class _Object> static devcb_base &set_p2_rd_callback(device_t &device, _Object object) { return downcast<m5074x_device &>(device).read_p2.set_callback(object); }
- template<class _Object> static devcb_base &set_p3_rd_callback(device_t &device, _Object object) { return downcast<m5074x_device &>(device).read_p3.set_callback(object); }
- template<class _Object> static devcb_base &set_p0_wr_callback(device_t &device, _Object object) { return downcast<m5074x_device &>(device).write_p0.set_callback(object); }
- template<class _Object> static devcb_base &set_p1_wr_callback(device_t &device, _Object object) { return downcast<m5074x_device &>(device).write_p1.set_callback(object); }
- template<class _Object> static devcb_base &set_p2_wr_callback(device_t &device, _Object object) { return downcast<m5074x_device &>(device).write_p2.set_callback(object); }
- template<class _Object> static devcb_base &set_p3_wr_callback(device_t &device, _Object object) { return downcast<m5074x_device &>(device).write_p3.set_callback(object); }
-
- devcb_read8 read_p0, read_p1, read_p2, read_p3;
- devcb_write8 write_p0, write_p1, write_p2, write_p3;
-
- DECLARE_READ8_MEMBER(ports_r);
- DECLARE_WRITE8_MEMBER(ports_w);
- DECLARE_READ8_MEMBER(tmrirq_r);
- DECLARE_WRITE8_MEMBER(tmrirq_w);
-
- bool are_port_bits_output(UINT8 port, UINT8 mask) { return ((m_ddrs[port] & mask) == mask) ? true : false; }
-
-protected:
- // device-level overrides
- virtual void device_start();
- virtual void device_reset();
- virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
- virtual void execute_set_input(int inputnum, int state);
- virtual const address_space_config *memory_space_config(address_spacenum spacenum) const { return (spacenum == AS_PROGRAM) ? &m_program_config : NULL; }
-
- void send_port(address_space &space, UINT8 offset, UINT8 data);
- UINT8 read_port(UINT8 offset);
-
- void recalc_irqs();
- void recalc_timer(int timer);
-
- UINT8 m_ports[6], m_ddrs[6];
- UINT8 m_intctrl, m_tmrctrl;
- UINT8 m_tmr12pre, m_tmr1, m_tmr2, m_tmrxpre, m_tmrx;
- UINT8 m_tmr1latch, m_tmr2latch, m_tmrxlatch;
- UINT8 m_last_all_ints;
-
-private:
- emu_timer *m_timers[NUM_TIMERS];
-};
-
-class m50740_device : public m5074x_device
-{
-public:
- m50740_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
- m50740_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
-
-protected:
-
-private:
-};
-
-class m50741_device : public m5074x_device
-{
-public:
- m50741_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
- m50741_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
-
-protected:
-
-private:
-};
-
-extern const device_type M50740;
-extern const device_type M50741;
-
-#endif
diff --git a/src/emu/cpu/m6502/m6502.c b/src/emu/cpu/m6502/m6502.c
deleted file mode 100644
index 01b2b8f0f98..00000000000
--- a/src/emu/cpu/m6502/m6502.c
+++ /dev/null
@@ -1,724 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Olivier Galibert
-/***************************************************************************
-
- m6502.c
-
- Mostek 6502, original NMOS variant
-
-***************************************************************************/
-
-#include "emu.h"
-#include "debugger.h"
-#include "m6502.h"
-
-const device_type M6502 = &device_creator<m6502_device>;
-
-m6502_device::m6502_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
- cpu_device(mconfig, M6502, "M6502", tag, owner, clock, "m6502", __FILE__),
- sync_w(*this),
- program_config("program", ENDIANNESS_LITTLE, 8, 16),
- sprogram_config("decrypted_opcodes", ENDIANNESS_LITTLE, 8, 16)
-{
- direct_disabled = false;
-}
-
-m6502_device::m6502_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
- cpu_device(mconfig, type, name, tag, owner, clock, shortname, source),
- sync_w(*this),
- program_config("program", ENDIANNESS_LITTLE, 8, 16),
- sprogram_config("decrypted_opcodes", ENDIANNESS_LITTLE, 8, 16)
-{
- direct_disabled = false;
-}
-
-void m6502_device::device_start()
-{
- if(direct_disabled)
- mintf = new mi_default_nd;
- else
- mintf = new mi_default_normal;
-
- init();
-}
-
-void m6502_device::init()
-{
- mintf->program = &space(AS_PROGRAM);
- mintf->sprogram = has_space(AS_DECRYPTED_OPCODES) ? &space(AS_DECRYPTED_OPCODES) : mintf->program;
-
- mintf->direct = &mintf->program->direct();
- mintf->sdirect = &mintf->sprogram->direct();
-
- sync_w.resolve_safe();
-
- state_add(STATE_GENPC, "GENPC", NPC).noshow();
- state_add(STATE_GENPCBASE, "GENPCBASE", PPC).noshow();
- state_add(STATE_GENSP, "GENSP", SP).noshow();
- state_add(STATE_GENFLAGS, "GENFLAGS", P).callimport().formatstr("%6s").noshow();
- state_add(M6502_PC, "PC", NPC).callimport();
- state_add(M6502_A, "A", A);
- state_add(M6502_X, "X", X);
- state_add(M6502_Y, "Y", Y);
- state_add(M6502_P, "P", P).callimport();
- state_add(M6502_S, "SP", SP);
- state_add(M6502_IR, "IR", IR);
-
- save_item(NAME(PC));
- save_item(NAME(NPC));
- save_item(NAME(A));
- save_item(NAME(X));
- save_item(NAME(Y));
- save_item(NAME(P));
- save_item(NAME(SP));
- save_item(NAME(TMP));
- save_item(NAME(TMP2));
- save_item(NAME(IR));
- save_item(NAME(nmi_state));
- save_item(NAME(irq_state));
- save_item(NAME(apu_irq_state));
- save_item(NAME(v_state));
- save_item(NAME(inst_state));
- save_item(NAME(inst_substate));
- save_item(NAME(inst_state_base));
- save_item(NAME(irq_taken));
- save_item(NAME(inhibit_interrupts));
-
- m_icountptr = &icount;
-
- PC = 0x0000;
- NPC = 0x0000;
- A = 0x00;
- X = 0x80;
- Y = 0x00;
- P = 0x36;
- SP = 0x01bd;
- TMP = 0x0000;
- TMP2 = 0x00;
- IR = 0x00;
- nmi_state = false;
- irq_state = false;
- apu_irq_state = false;
- irq_taken = false;
- v_state = false;
- inst_state = STATE_RESET;
- inst_substate = 0;
- inst_state_base = 0;
- sync = false;
- inhibit_interrupts = false;
-}
-
-void m6502_device::device_reset()
-{
- inst_state = STATE_RESET;
- inst_substate = 0;
- inst_state_base = 0;
- nmi_state = false;
- irq_state = false;
- apu_irq_state = false;
- irq_taken = false;
- v_state = false;
- sync = false;
- sync_w(CLEAR_LINE);
- inhibit_interrupts = false;
-}
-
-
-UINT32 m6502_device::execute_min_cycles() const
-{
- return 1;
-}
-
-UINT32 m6502_device::execute_max_cycles() const
-{
- return 10;
-}
-
-UINT32 m6502_device::execute_input_lines() const
-{
- return NMI_LINE+1;
-}
-
-void m6502_device::do_adc_d(UINT8 val)
-{
- UINT8 c = P & F_C ? 1 : 0;
- P &= ~(F_N|F_V|F_Z|F_C);
- UINT8 al = (A & 15) + (val & 15) + c;
- if(al > 9)
- al += 6;
- UINT8 ah = (A >> 4) + (val >> 4) + (al > 15);
- if(!UINT8(A + val + c))
- P |= F_Z;
- else if(ah & 8)
- P |= F_N;
- if(~(A^val) & (A^(ah << 4)) & 0x80)
- P |= F_V;
- if(ah > 9)
- ah += 6;
- if(ah > 15)
- P |= F_C;
- A = (ah << 4) | (al & 15);
-}
-
-void m6502_device::do_adc_nd(UINT8 val)
-{
- UINT16 sum;
- sum = A + val + (P & F_C ? 1 : 0);
- P &= ~(F_N|F_V|F_Z|F_C);
- if(!UINT8(sum))
- P |= F_Z;
- else if(INT8(sum) < 0)
- P |= F_N;
- if(~(A^val) & (A^sum) & 0x80)
- P |= F_V;
- if(sum & 0xff00)
- P |= F_C;
- A = sum;
-}
-
-void m6502_device::do_adc(UINT8 val)
-{
- if(P & F_D)
- do_adc_d(val);
- else
- do_adc_nd(val);
-}
-
-void m6502_device::do_arr_nd()
-{
- bool c = P & F_C;
- P &= ~(F_N|F_Z|F_C|F_V);
- A >>= 1;
- if(c)
- A |= 0x80;
- if(!A)
- P |= F_Z;
- else if(INT8(A)<0)
- P |= F_N;
- if(A & 0x40)
- P |= F_V|F_C;
- if(A & 0x20)
- P ^= F_V;
-}
-
-void m6502_device::do_arr_d()
-{
- // The adc/ror interaction gives an extremely weird result
- bool c = P & F_C;
- P &= ~(F_N|F_Z|F_C|F_V);
- UINT8 a = A >> 1;
- if(c)
- a |= 0x80;
- if(!a)
- P |= F_Z;
- else if(INT8(a) < 0)
- P |= F_N;
- if((a ^ A) & 0x40)
- P |= F_V;
-
- if((A & 0x0f) >= 0x05)
- a = ((a + 6) & 0x0f) | (a & 0xf0);
-
- if((A & 0xf0) >= 0x50) {
- a += 0x60;
- P |= F_C;
- }
- A = a;
-}
-
-void m6502_device::do_arr()
-{
- if(P & F_D)
- do_arr_d();
- else
- do_arr_nd();
-}
-
-void m6502_device::do_cmp(UINT8 val1, UINT8 val2)
-{
- P &= ~(F_N|F_Z|F_C);
- UINT16 r = val1-val2;
- if(!r)
- P |= F_Z;
- else if(INT8(r) < 0)
- P |= F_N;
- if(!(r & 0xff00))
- P |= F_C;
-}
-
-void m6502_device::do_sbc_d(UINT8 val)
-{
- UINT8 c = P & F_C ? 0 : 1;
- P &= ~(F_N|F_V|F_Z|F_C);
- UINT16 diff = A - val - c;
- UINT8 al = (A & 15) - (val & 15) - c;
- if(INT8(al) < 0)
- al -= 6;
- UINT8 ah = (A >> 4) - (val >> 4) - (INT8(al) < 0);
- if(!UINT8(diff))
- P |= F_Z;
- else if(diff & 0x80)
- P |= F_N;
- if((A^val) & (A^diff) & 0x80)
- P |= F_V;
- if(!(diff & 0xff00))
- P |= F_C;
- if(INT8(ah) < 0)
- ah -= 6;
- A = (ah << 4) | (al & 15);
-}
-
-void m6502_device::do_sbc_nd(UINT8 val)
-{
- UINT16 diff = A - val - (P & F_C ? 0 : 1);
- P &= ~(F_N|F_V|F_Z|F_C);
- if(!UINT8(diff))
- P |= F_Z;
- else if(INT8(diff) < 0)
- P |= F_N;
- if((A^val) & (A^diff) & 0x80)
- P |= F_V;
- if(!(diff & 0xff00))
- P |= F_C;
- A = diff;
-}
-
-void m6502_device::do_sbc(UINT8 val)
-{
- if(P & F_D)
- do_sbc_d(val);
- else
- do_sbc_nd(val);
-}
-
-void m6502_device::do_bit(UINT8 val)
-{
- P &= ~(F_N|F_Z|F_V);
- UINT8 r = A & val;
- if(!r)
- P |= F_Z;
- if(val & 0x80)
- P |= F_N;
- if(val & 0x40)
- P |= F_V;
-}
-
-UINT8 m6502_device::do_asl(UINT8 v)
-{
- P &= ~(F_N|F_Z|F_C);
- UINT8 r = v<<1;
- if(!r)
- P |= F_Z;
- else if(INT8(r) < 0)
- P |= F_N;
- if(v & 0x80)
- P |= F_C;
- return r;
-}
-
-UINT8 m6502_device::do_lsr(UINT8 v)
-{
- P &= ~(F_N|F_Z|F_C);
- if(v & 1)
- P |= F_C;
- v >>= 1;
- if(!v)
- P |= F_Z;
- return v;
-}
-
-UINT8 m6502_device::do_ror(UINT8 v)
-{
- bool c = P & F_C;
- P &= ~(F_N|F_Z|F_C);
- if(v & 1)
- P |= F_C;
- v >>= 1;
- if(c)
- v |= 0x80;
- if(!v)
- P |= F_Z;
- else if(INT8(v)<0)
- P |= F_N;
- return v;
-}
-
-UINT8 m6502_device::do_rol(UINT8 v)
-{
- bool c = P & F_C;
- P &= ~(F_N|F_Z|F_C);
- if(v & 0x80)
- P |= F_C;
- v <<= 1;
- if(c)
- v |= 0x01;
- if(!v)
- P |= F_Z;
- else if(INT8(v)<0)
- P |= F_N;
- return v;
-}
-
-UINT8 m6502_device::do_asr(UINT8 v)
-{
- P &= ~(F_N|F_Z|F_C);
- if(v & 1)
- P |= F_C;
- v >>= 1;
- if(!v)
- P |= F_Z;
- else if(v & 0x40) {
- P |= F_N;
- v |= 0x80;
- }
- return v;
-}
-
-void m6502_device::execute_run()
-{
- if(inst_substate)
- do_exec_partial();
-
- while(icount > 0) {
- if(inst_state < 0xff00) {
- PPC = NPC;
- inst_state = IR | inst_state_base;
- if(machine().debug_flags & DEBUG_FLAG_ENABLED)
- debugger_instruction_hook(this, NPC);
- }
- do_exec_full();
- }
-}
-
-void m6502_device::execute_set_input(int inputnum, int state)
-{
- switch(inputnum) {
- case IRQ_LINE: irq_state = state == ASSERT_LINE; break;
- case APU_IRQ_LINE: apu_irq_state = state == ASSERT_LINE; break;
- case NMI_LINE: nmi_state = nmi_state || (state == ASSERT_LINE); break;
- case V_LINE:
- if(!v_state && state == ASSERT_LINE)
- P |= F_V;
- v_state = state == ASSERT_LINE;
- break;
- }
-}
-
-
-const address_space_config *m6502_device::memory_space_config(address_spacenum spacenum) const
-{
- switch(spacenum)
- {
- case AS_PROGRAM: return &program_config;
- case AS_DECRYPTED_OPCODES: return has_configured_map(AS_DECRYPTED_OPCODES) ? &sprogram_config : NULL;
- default: return NULL;
- }
-}
-
-
-void m6502_device::state_import(const device_state_entry &entry)
-{
- switch(entry.index()) {
- case STATE_GENFLAGS:
- case M6502_P:
- P = P | (F_B|F_E);
- break;
- case M6502_PC:
- PC = NPC;
- irq_taken = false;
- prefetch();
- PPC = NPC;
- inst_state = IR | inst_state_base;
- break;
- }
-}
-
-void m6502_device::state_export(const device_state_entry &entry)
-{
-}
-
-void m6502_device::state_string_export(const device_state_entry &entry, std::string &str)
-{
- switch(entry.index()) {
- case STATE_GENFLAGS:
- case M6502_P:
- strprintf(str, "%c%c%c%c%c%c",
- P & F_N ? 'N' : '.',
- P & F_V ? 'V' : '.',
- P & F_D ? 'D' : '.',
- P & F_I ? 'I' : '.',
- P & F_Z ? 'Z' : '.',
- P & F_C ? 'C' : '.');
- break;
- }
-}
-
-
-UINT32 m6502_device::disasm_min_opcode_bytes() const
-{
- return 1;
-}
-
-UINT32 m6502_device::disasm_max_opcode_bytes() const
-{
- return 4;
-}
-
-offs_t m6502_device::disassemble_generic(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options, const disasm_entry *table)
-{
- const disasm_entry &e = table[oprom[0] | inst_state_base];
- UINT32 flags = e.flags | DASMFLAG_SUPPORTED;
- buffer += sprintf(buffer, "%s", e.opcode);
-
- switch(e.mode) {
- case DASM_non:
- flags |= 1;
- break;
-
- case DASM_aba:
- sprintf(buffer, " $%02x%02x", opram[2], opram[1]);
- flags |= 3;
- break;
-
- case DASM_abx:
- sprintf(buffer, " $%02x%02x, x", opram[2], opram[1]);
- flags |= 3;
- break;
-
- case DASM_aby:
- sprintf(buffer, " $%02x%02x, y", opram[2], opram[1]);
- flags |= 3;
- break;
-
- case DASM_acc:
- sprintf(buffer, " a");
- flags |= 1;
- break;
-
- case DASM_adr:
- sprintf(buffer, " $%02x%02x", opram[2], opram[1]);
- flags |= 3;
- break;
-
- case DASM_bzp:
- sprintf(buffer, "%d $%02x", (oprom[0] >> 4) & 7, opram[1]);
- flags |= 2;
- break;
-
- case DASM_iax:
- sprintf(buffer, " ($%02x%02x, x)", opram[2], opram[1]);
- flags |= 3;
- break;
-
- case DASM_idx:
- sprintf(buffer, " ($%02x, x)", opram[1]);
- flags |= 2;
- break;
-
- case DASM_idy:
- sprintf(buffer, " ($%02x), y", opram[1]);
- flags |= 2;
- break;
-
- case DASM_idz:
- sprintf(buffer, " ($%02x), z", opram[1]);
- flags |= 2;
- break;
-
- case DASM_imm:
- sprintf(buffer, " #$%02x", opram[1]);
- flags |= 2;
- break;
-
- case DASM_imp:
- flags |= 1;
- break;
-
- case DASM_ind:
- sprintf(buffer, " ($%02x%02x)", opram[2], opram[1]);
- flags |= 3;
- break;
-
- case DASM_isy:
- sprintf(buffer, " ($%02x, s), y", opram[1]);
- flags |= 2;
- break;
-
- case DASM_iw2:
- sprintf(buffer, " #$%02x%02x", opram[2], opram[1]);
- flags |= 3;
- break;
-
- case DASM_iw3:
- sprintf(buffer, " #$%02x%02x%02x", opram[3], opram[2], opram[1]);
- flags |= 4;
- break;
-
- case DASM_rel:
- sprintf(buffer, " $%04x", (pc & 0xf0000) | UINT16(pc + 2 + INT8(opram[1])));
- flags |= 2;
- break;
-
- case DASM_rw2:
- sprintf(buffer, " $%04x", (pc & 0xf0000) | UINT16(pc + 2 + INT16((opram[2] << 8) | opram[1])));
- flags |= 3;
- break;
-
- case DASM_zpb:
- sprintf(buffer, "%d $%02x, $%04x", (oprom[0] >> 4) & 7, opram[1], (pc & 0xf0000) | UINT16(pc + 3 + INT8(opram[2])));
- flags |= 3;
- break;
-
- case DASM_zpg:
- sprintf(buffer, " $%02x", opram[1]);
- flags |= 2;
- break;
-
- case DASM_zpi:
- sprintf(buffer, " ($%02x)", opram[1]);
- flags |= 2;
- break;
-
- case DASM_zpx:
- sprintf(buffer, " $%02x, x", opram[1]);
- flags |= 2;
- break;
-
- case DASM_zpy:
- sprintf(buffer, " $%02x, y", opram[1]);
- flags |= 2;
- break;
-
- case DASM_imz:
- sprintf(buffer, " #$%02x, $%02x", opram[1], opram[2]);
- flags |= 3;
- break;
-
- case DASM_spg:
- sprintf(buffer, " \\$%02x", opram[1]);
- flags |= 2;
- break;
-
- case DASM_biz:
- sprintf(buffer, " %d, $%02x", (opram[0] >> 5) & 7, opram[1]);
- flags |= 2;
- break;
-
- case DASM_bzr:
- sprintf(buffer, " %d, $%02x, $%04x", (opram[0] >> 5) & 7, opram[1], (pc & 0xf0000) | UINT16(pc + 3 + INT8(opram[2])));
- flags |= 3;
- break;
-
- case DASM_bar:
- sprintf(buffer, " %d, a, $%04x", (opram[0] >> 5) & 7, (pc & 0xf0000) | UINT16(pc + 3 + INT8(opram[1])));
- flags |= 2;
- break;
-
- case DASM_bac:
- sprintf(buffer, " %d, a", (opram[0] >> 5) & 7);
- flags |= 1;
- break;
-
- default:
- fprintf(stderr, "Unhandled dasm mode %d\n", e.mode);
- abort();
- }
- return flags;
-}
-
-void m6502_device::prefetch()
-{
- sync = true;
- sync_w(ASSERT_LINE);
- NPC = PC;
- IR = mintf->read_sync(PC);
- sync = false;
- sync_w(CLEAR_LINE);
-
- if((nmi_state || ((irq_state || apu_irq_state) && !(P & F_I))) && !inhibit_interrupts) {
- irq_taken = true;
- IR = 0x00;
- } else
- PC++;
-}
-
-void m6502_device::prefetch_noirq()
-{
- sync = true;
- sync_w(ASSERT_LINE);
- NPC = PC;
- IR = mintf->read_sync(PC);
- sync = false;
- sync_w(CLEAR_LINE);
- PC++;
-}
-
-void m6502_device::set_nz(UINT8 v)
-{
- P &= ~(F_Z|F_N);
- if(v & 0x80)
- P |= F_N;
- if(!v)
- P |= F_Z;
-}
-
-offs_t m6502_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options)
-{
- return disassemble_generic(buffer, pc, oprom, opram, options, disasm_entries);
-}
-
-
-UINT8 m6502_device::memory_interface::read_9(UINT16 adr)
-{
- return read(adr);
-}
-
-void m6502_device::memory_interface::write_9(UINT16 adr, UINT8 val)
-{
- write(adr, val);
-}
-
-
-UINT8 m6502_device::mi_default_normal::read(UINT16 adr)
-{
- return program->read_byte(adr);
-}
-
-UINT8 m6502_device::mi_default_normal::read_sync(UINT16 adr)
-{
- return sdirect->read_byte(adr);
-}
-
-UINT8 m6502_device::mi_default_normal::read_arg(UINT16 adr)
-{
- return direct->read_byte(adr);
-}
-
-
-void m6502_device::mi_default_normal::write(UINT16 adr, UINT8 val)
-{
- program->write_byte(adr, val);
-}
-
-UINT8 m6502_device::mi_default_nd::read_sync(UINT16 adr)
-{
- return sprogram->read_byte(adr);
-}
-
-UINT8 m6502_device::mi_default_nd::read_arg(UINT16 adr)
-{
- return program->read_byte(adr);
-}
-
-
-WRITE_LINE_MEMBER( m6502_device::irq_line )
-{
- set_input_line( M6502_IRQ_LINE, state );
-}
-
-WRITE_LINE_MEMBER( m6502_device::nmi_line )
-{
- set_input_line( M6502_NMI_LINE, state );
-}
-
-#include "cpu/m6502/m6502.inc"
diff --git a/src/emu/cpu/m6502/m6502.h b/src/emu/cpu/m6502/m6502.h
deleted file mode 100644
index 33b13f3afb6..00000000000
--- a/src/emu/cpu/m6502/m6502.h
+++ /dev/null
@@ -1,335 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Olivier Galibert
-/***************************************************************************
-
- m6502.h
-
- Mostek 6502, original NMOS variant
-
-***************************************************************************/
-
-#ifndef __M6502FAM_H__
-#define __M6502FAM_H__
-
-#define MCFG_M6502_DISABLE_DIRECT() \
- downcast<m6502_device *>(device)->disable_direct();
-
-#define MCFG_M6502_SYNC_CALLBACK(_cb) \
- devcb = &m6502_device::set_sync_callback(*device, DEVCB_##_cb);
-
-class m6502_device : public cpu_device {
-public:
- enum {
- IRQ_LINE = INPUT_LINE_IRQ0,
- APU_IRQ_LINE = INPUT_LINE_IRQ1,
- NMI_LINE = INPUT_LINE_NMI,
- V_LINE = INPUT_LINE_IRQ0 + 16
- };
-
- m6502_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
- m6502_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
-
- DECLARE_WRITE_LINE_MEMBER( irq_line );
- DECLARE_WRITE_LINE_MEMBER( nmi_line );
-
- bool get_sync() const { return sync; }
- void disable_direct() { direct_disabled = true; }
-
- template<class _Object> static devcb_base &set_sync_callback(device_t &device, _Object object) { return downcast<m6502_device &>(device).sync_w.set_callback(object); }
-
- devcb_write_line sync_w;
-
-protected:
- class memory_interface {
- public:
- address_space *program, *sprogram;
- direct_read_data *direct, *sdirect;
-
- virtual ~memory_interface() {}
- virtual UINT8 read(UINT16 adr) = 0;
- virtual UINT8 read_9(UINT16 adr);
- virtual UINT8 read_sync(UINT16 adr) = 0;
- virtual UINT8 read_arg(UINT16 adr) = 0;
- virtual void write(UINT16 adr, UINT8 val) = 0;
- virtual void write_9(UINT16 adr, UINT8 val);
- };
-
- class mi_default_normal : public memory_interface {
- public:
- virtual ~mi_default_normal() {}
- virtual UINT8 read(UINT16 adr);
- virtual UINT8 read_sync(UINT16 adr);
- virtual UINT8 read_arg(UINT16 adr);
- virtual void write(UINT16 adr, UINT8 val);
- };
-
- class mi_default_nd : public mi_default_normal {
- public:
- virtual ~mi_default_nd() {}
- virtual UINT8 read_sync(UINT16 adr);
- virtual UINT8 read_arg(UINT16 adr);
- };
-
- struct disasm_entry {
- const char *opcode;
- int mode;
- offs_t flags;
- };
-
- enum {
- STATE_RESET = 0xff00
- };
-
- enum {
- DASM_non, /* no additional arguments */
- DASM_aba, /* absolute */
- DASM_abx, /* absolute + X */
- DASM_aby, /* absolute + Y */
- DASM_acc, /* accumulator */
- DASM_adr, /* absolute address (jmp,jsr) */
- DASM_bzp, /* zero page with bit selection */
- DASM_iax, /* indirect + X (65c02 jmp) */
- DASM_idx, /* zero page pre indexed */
- DASM_idy, /* zero page post indexed */
- DASM_idz, /* zero page post indexed (65ce02) */
- DASM_imm, /* immediate */
- DASM_imp, /* implicit */
- DASM_ind, /* indirect (jmp) */
- DASM_isy, /* zero page pre indexed sp and post indexed Y (65ce02) */
- DASM_iw2, /* immediate word (65ce02) */
- DASM_iw3, /* augment (65ce02) */
- DASM_rel, /* relative */
- DASM_rw2, /* relative word (65cs02, 65ce02) */
- DASM_zpb, /* zero page and branch (65c02 bbr, bbs) */
- DASM_zpg, /* zero page */
- DASM_zpi, /* zero page indirect (65c02) */
- DASM_zpx, /* zero page + X */
- DASM_zpy, /* zero page + Y */
- DASM_imz, /* load immediate byte, store to zero page address (M740) */
- DASM_spg, /* "special page": implied FF00 OR immediate value (M740)*/
- DASM_biz, /* bit, zero page (M740) */
- DASM_bzr, /* bit, zero page, relative offset (M740) */
- DASM_bar, /* bit, accumulator, relative offset (M740) */
- DASM_bac /* bit, accumulator (M740) */
- };
-
- enum {
- F_N = 0x80,
- F_V = 0x40,
- F_E = 0x20, // 65ce02
- F_T = 0x20, // M740: replaces A with $00,X in some opcodes when set
- F_B = 0x10,
- F_D = 0x08,
- F_I = 0x04,
- F_Z = 0x02,
- F_C = 0x01
- };
-
- virtual void init();
-
- // device-level overrides
- virtual void device_start();
- virtual void device_reset();
-
- // device_execute_interface overrides
- virtual UINT32 execute_min_cycles() const;
- virtual UINT32 execute_max_cycles() const;
- virtual UINT32 execute_input_lines() const;
- virtual void execute_run();
- virtual void execute_set_input(int inputnum, int state);
-
- // device_memory_interface overrides
- virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
-
- // device_state_interface overrides
- virtual void state_import(const device_state_entry &entry);
- virtual void state_export(const device_state_entry &entry);
- virtual void state_string_export(const device_state_entry &entry, std::string &str);
-
- // device_disasm_interface overrides
- virtual UINT32 disasm_min_opcode_bytes() const;
- virtual UINT32 disasm_max_opcode_bytes() const;
- virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options);
-
- address_space_config program_config, sprogram_config;
-
- UINT16 PPC; /* previous program counter */
- UINT16 NPC; /* next start-of-instruction program counter */
- UINT16 PC; /* program counter */
- UINT16 SP; /* stack pointer (always 100 - 1FF) */
- UINT16 TMP; /* temporary internal values */
- UINT8 TMP2; /* another temporary internal value, 8 bits this time */
- UINT8 A; /* Accumulator */
- UINT8 X; /* X index register */
- UINT8 Y; /* Y index register */
- UINT8 P; /* Processor status */
- UINT8 IR; /* Prefetched instruction register */
- int inst_state_base; /* Current instruction bank */
-
- memory_interface *mintf;
- int inst_state, inst_substate;
- int icount;
- bool nmi_state, irq_state, apu_irq_state, v_state;
- bool irq_taken, sync, direct_disabled, inhibit_interrupts;
-
- static const disasm_entry disasm_entries[0x100];
-
- offs_t disassemble_generic(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options, const disasm_entry *table);
- UINT8 read(UINT16 adr) { return mintf->read(adr); }
- UINT8 read_9(UINT16 adr) { return mintf->read_9(adr); }
- void write(UINT16 adr, UINT8 val) { mintf->write(adr, val); }
- void write_9(UINT16 adr, UINT8 val) { mintf->write_9(adr, val); }
- UINT8 read_arg(UINT16 adr) { return mintf->read_arg(adr); }
- UINT8 read_pc() { return mintf->read_arg(PC++); }
- UINT8 read_pc_noinc() { return mintf->read_arg(PC); }
- void prefetch();
- void prefetch_noirq();
- void set_nz(UINT8 v);
-
- virtual void do_exec_full();
- virtual void do_exec_partial();
-
- // inline helpers
- static inline bool page_changing(UINT16 base, int delta) { return ((base + delta) ^ base) & 0xff00; }
- static inline UINT16 set_l(UINT16 base, UINT8 val) { return (base & 0xff00) | val; }
- static inline UINT16 set_h(UINT16 base, UINT8 val) { return (base & 0x00ff) | (val << 8); }
-
- inline void dec_SP() { SP = set_l(SP, SP-1); }
- inline void inc_SP() { SP = set_l(SP, SP+1); }
-
- void do_adc_d(UINT8 val);
- void do_adc_nd(UINT8 val);
- void do_sbc_d(UINT8 val);
- void do_sbc_nd(UINT8 val);
- void do_arr_d();
- void do_arr_nd();
-
- void do_adc(UINT8 val);
- void do_cmp(UINT8 val1, UINT8 val2);
- void do_sbc(UINT8 val);
- void do_bit(UINT8 val);
- void do_arr();
- UINT8 do_asl(UINT8 v);
- UINT8 do_lsr(UINT8 v);
- UINT8 do_ror(UINT8 v);
- UINT8 do_rol(UINT8 v);
- UINT8 do_asr(UINT8 v);
-
-#define O(o) void o ## _full(); void o ## _partial()
-
- // NMOS 6502 opcodes
- // documented opcodes
- O(adc_aba); O(adc_abx); O(adc_aby); O(adc_idx); O(adc_idy); O(adc_imm); O(adc_zpg); O(adc_zpx);
- O(and_aba); O(and_abx); O(and_aby); O(and_imm); O(and_idx); O(and_idy); O(and_zpg); O(and_zpx);
- O(asl_aba); O(asl_abx); O(asl_acc); O(asl_zpg); O(asl_zpx);
- O(bcc_rel);
- O(bcs_rel);
- O(beq_rel);
- O(bit_aba); O(bit_zpg);
- O(bmi_rel);
- O(bne_rel);
- O(bpl_rel);
- O(brk_imp);
- O(bvc_rel);
- O(bvs_rel);
- O(clc_imp);
- O(cld_imp);
- O(cli_imp);
- O(clv_imp);
- O(cmp_aba); O(cmp_abx); O(cmp_aby); O(cmp_idx); O(cmp_idy); O(cmp_imm); O(cmp_zpg); O(cmp_zpx);
- O(cpx_aba); O(cpx_imm); O(cpx_zpg);
- O(cpy_aba); O(cpy_imm); O(cpy_zpg);
- O(dec_aba); O(dec_abx); O(dec_zpg); O(dec_zpx);
- O(dex_imp);
- O(dey_imp);
- O(eor_aba); O(eor_abx); O(eor_aby); O(eor_idx); O(eor_idy); O(eor_imm); O(eor_zpg); O(eor_zpx);
- O(inc_aba); O(inc_abx); O(inc_zpg); O(inc_zpx);
- O(inx_imp);
- O(iny_imp);
- O(jmp_adr); O(jmp_ind);
- O(jsr_adr);
- O(lda_aba); O(lda_abx); O(lda_aby); O(lda_idx); O(lda_idy); O(lda_imm); O(lda_zpg); O(lda_zpx);
- O(ldx_aba); O(ldx_aby); O(ldx_imm); O(ldx_zpg); O(ldx_zpy);
- O(ldy_aba); O(ldy_abx); O(ldy_imm); O(ldy_zpg); O(ldy_zpx);
- O(lsr_aba); O(lsr_abx); O(lsr_acc); O(lsr_zpg); O(lsr_zpx);
- O(nop_imp);
- O(ora_aba); O(ora_abx); O(ora_aby); O(ora_imm); O(ora_idx); O(ora_idy); O(ora_zpg); O(ora_zpx);
- O(pha_imp);
- O(php_imp);
- O(pla_imp);
- O(plp_imp);
- O(rol_aba); O(rol_abx); O(rol_acc); O(rol_zpg); O(rol_zpx);
- O(ror_aba); O(ror_abx); O(ror_acc); O(ror_zpg); O(ror_zpx);
- O(rti_imp);
- O(rts_imp);
- O(sbc_aba); O(sbc_abx); O(sbc_aby); O(sbc_idx); O(sbc_idy); O(sbc_imm); O(sbc_zpg); O(sbc_zpx);
- O(sec_imp);
- O(sed_imp);
- O(sei_imp);
- O(sta_aba); O(sta_abx); O(sta_aby); O(sta_idx); O(sta_idy); O(sta_zpg); O(sta_zpx);
- O(stx_aba); O(stx_zpg); O(stx_zpy);
- O(sty_aba); O(sty_zpg); O(sty_zpx);
- O(tax_imp);
- O(tay_imp);
- O(tsx_imp);
- O(txa_imp);
- O(txs_imp);
- O(tya_imp);
-
- // exceptions
- O(reset);
-
- // undocumented reliable instructions
- O(dcp_aba); O(dcp_abx); O(dcp_aby); O(dcp_idx); O(dcp_idy); O(dcp_zpg); O(dcp_zpx);
- O(isb_aba); O(isb_abx); O(isb_aby); O(isb_idx); O(isb_idy); O(isb_zpg); O(isb_zpx);
- O(lax_aba); O(lax_aby); O(lax_idx); O(lax_idy); O(lax_zpg); O(lax_zpy);
- O(rla_aba); O(rla_abx); O(rla_aby); O(rla_idx); O(rla_idy); O(rla_zpg); O(rla_zpx);
- O(rra_aba); O(rra_abx); O(rra_aby); O(rra_idx); O(rra_idy); O(rra_zpg); O(rra_zpx);
- O(sax_aba); O(sax_idx); O(sax_zpg); O(sax_zpy);
- O(sbx_imm);
- O(sha_aby); O(sha_idy);
- O(shs_aby);
- O(shx_aby);
- O(shy_abx);
- O(slo_aba); O(slo_abx); O(slo_aby); O(slo_idx); O(slo_idy); O(slo_zpg); O(slo_zpx);
- O(sre_aba); O(sre_abx); O(sre_aby); O(sre_idx); O(sre_idy); O(sre_zpg); O(sre_zpx);
-
- // undocumented unreliable instructions
- // behaviour differs between visual6502 and online docs, which
- // is a clear sign reliability is not to be expected
- // implemented version follows visual6502
- O(anc_imm);
- O(ane_imm);
- O(arr_imm);
- O(asr_imm);
- O(las_aby);
- O(lxa_imm);
-
- // nop variants
- O(nop_imm); O(nop_aba); O(nop_abx); O(nop_zpg); O(nop_zpx);
-
- // system killers
- O(kil_non);
-
-#undef O
-};
-
-enum {
- M6502_PC = 1,
- M6502_A,
- M6502_X,
- M6502_Y,
- M6502_P,
- M6502_S,
- M6502_IR
-};
-
-enum {
- M6502_IRQ_LINE = m6502_device::IRQ_LINE,
- M6502_NMI_LINE = m6502_device::NMI_LINE,
- M6502_SET_OVERFLOW = m6502_device::V_LINE
-};
-
-extern const device_type M6502;
-
-#endif
diff --git a/src/emu/cpu/m6502/m6502.txt b/src/emu/cpu/m6502/m6502.txt
deleted file mode 100644
index d92af7ec146..00000000000
--- a/src/emu/cpu/m6502/m6502.txt
+++ /dev/null
@@ -1,163 +0,0 @@
-mos metal oxid semiconductor
-bought by cbm
-
-license to produce chips
- rockwell
-
-transistor, logic gate designs:
-NMOS (M65xx)
-CMOS (M65Cxx)
-HMOS (M75xx) hyper? MOS, used in early c16/plus4 series
-H2MOS (M85xx) hyper2 MOS, used in C128, later c16/plus4, late C64
-?SCMOS (M65SCxx) Super? CMOS
-?CE (M65CExx, M45xx) CMOS Enhanced?, used in not released C65
-
-HMOS, H2MOS CPUs have the same core as the NMOS series
-
-6500 / 6501
-mask programable microcontroller
-32 io ports (2 interruptable)
-timer
-64 byte ram
-8 kbyte rom
-
-6502 (used in many designs)
-b-flag always 1! (only pushed as 0 when break executed!)
-memory changing opcodes accesses memory: read, write data, write modified data
-
-6504
-only 12 address pins a11..a0
-
-6508
-8 io pins (p0 bis p7)
-
-6509
-1 megabyte memory management
-(lda,sta (zeropage),y modified, uses 2nd address extension register)
-
-6510/8500 (used in some designs)
-6 io pins (p0 bis p5)
-
-6510T/8503? (used in commodore C1551 floppy)
-8 io pins
-integrated clock generation?
-
-7501/8501 (c16, c116, c232, c264, plus4, c364)
-7 io pins (no p5)
-no nmi
-
-8502 (c128)
-7 io pins (no p7)
-
-the above series is opcode compatible (including illegal opcodes)
-
-
-n2a03 (some arcades, NES)
--------------------------
-(nintendo variant)
-NMOS based!
-illegal opcodes
-$6c jump indirect low byte overrun problem as in 6502
-no decimal mode
-integrated sound hardware
-
-
-65c02 (used in some designs)
-----------------------------
-fixed jmp ind opcode
-memory changing opcodes accesses memory: read, read, write
-no illegal opcodes from the above series
-so not full compatible to 6502 series
-b flag always 1 as in NMOS Series is not known?
-additional commands
-
-several other CMOS variants
-
-
-65sc02 (where used?)
---------------------
-65c02 compatible
-additional commands
-
-atari lynx bastian schicks bll
-integrated m65sc02 cpu core
-no bbr bbs instructions, else m65c02 compatible
-
-watara supervision
-integrated m65c02 cpu core (or m65sc02 or m65ce02?)
-
-
-gte65816 (nintendo snes)
-------------------------
-65802 upgrade cpu (c64 and c128 upgrade cpu)
-16 bit wide registers
-24 bit address space
-65c02? compatible mode
-additional commands
-
-
-spc700
-------
-(snes sound processor)
-same register layout?
-same addressing modes?
-heavily modified opcodes
-YA could be combined for 16 bit operations?
-
-
-huc6280 (nec pcengine)
-----------------------
-65sc02 compatible?
-8 memory registers
-(highest 3 bits select memory register, these build a22..a13)
-(so 2 Megabyte address room!)
-additional commands?
-several additional integrated features
-
-
-65ce02 (c65 prototype)
-----------------------
-(scan of documentation available, also use
-c65 m4510 documentation)
-(cpu core to be used in asics)
-65sc02 compatible
-z register
-(65c02 zeropage indexed addressing is now (zeropage),z)
-b bank register, highbyte of all zerozape addressing
-register for stack high byte
-additional command (some from the 65816)
-
-
-m4510 (Commodore C65 CPU)
--------------------------
-(scan of documentation (in c65 documentation) available)
-65ce02 compatible
-integrated 20 bit memory management (map)
-(aug opcode changed to map opcode)
-2 cia6526 integrated
-1 uart integrated
-
-
-mitsubishi 740 series
----------------------
-(data book in electronic form available)
-(M507xx, M509xx, M374xx, M38xxx, M375xx)
-NMOS based
-additional operation mode
-(arithmetic instruction not performing on akku (a=a operation addressing mode)
-but on zeropage ([x]=[x] operation addressing mode))
-additional instructions LDM, MUL, DIV, TST, COM, RRF, CLT, SET, WIT, STP, CLP
-BRK 1 byte only?
-BRA CMOS compatible
-BBC, BBR different opcode as CMOS, and also akku addressing
-different TRB, TSB
-no CMOS STZ, JMP ind,x
-STP not in all variants
-MUL, DIV not in all variants
-
-
-Set Overflow Pin
-----------------
-in 6502 and pin compatibles (65C02 65SC02 65SC802 65CE02), M6509
-no SO pin 6510/7501/8500/8501/8502/65sc816
-6510T ?
diff --git a/src/emu/cpu/m6502/m6502make.py b/src/emu/cpu/m6502/m6502make.py
deleted file mode 100755
index 4ac62e90ce9..00000000000
--- a/src/emu/cpu/m6502/m6502make.py
+++ /dev/null
@@ -1,280 +0,0 @@
-#!/usr/bin/python
-
-from __future__ import print_function
-
-USAGE = """
-Usage:
-%s device_name {opc.lst|-} disp.lst device.inc
-"""
-import sys
-import logging
-
-MAX_STATES = 0
-
-def load_opcodes(fname):
- """Load opcodes from .lst file"""
- opcodes = []
- logging.info("load_opcodes: %s", fname)
- try:
- f = open(fname, "rU")
- except Exception:
- err = sys.exc_info()[1]
- logging.error("cannot read opcodes file %s [%s]", fname, err)
- sys.exit(1)
-
- for line in f:
- if line.startswith("#"): continue
- line = line.rstrip()
- if not line: continue
- if line.startswith(" ") or line.startswith("\t"):
- # append instruction to last opcode
- opcodes[-1][1].append(line)
- else:
- # add new opcode
- opcodes.append((line, []))
- return opcodes
-
-
-def load_disp(fname):
- logging.info("load_disp: %s", fname)
- states = []
- try:
- f = open(fname, "rU")
- except Exception:
- err = sys.exc_info()[1]
- logging.error("cannot read display file %s [%s]", fname, err)
- sys.exit(1)
- for line in f:
- if line.startswith("#"): continue
- line = line.strip()
- if not line: continue
- tokens = line.split()
- states += tokens
- return states
-
-def emit(f, text):
- """write string to file"""
- print(text, file=f)
-
-FULL_PROLOG="""\
-void %(device)s::%(opcode)s_full()
-{
-"""
-
-FULL_EPILOG="""\
-}
-"""
-
-FULL_EAT_ALL="""\
-\ticount=0; inst_substate = %(substate)s; return;
-"""
-
-FULL_MEMORY="""\
-\tif(icount == 0) { inst_substate = %(substate)s; return; }
-%(ins)s
-\ticount--;
-"""
-
-FULL_NONE="""\
-%(ins)s
-"""
-
-PARTIAL_PROLOG="""\
-void %(device)s::%(opcode)s_partial()
-{
-switch(inst_substate) {
-case 0:
-"""
-
-PARTIAL_EPILOG="""\
-}
-\tinst_substate = 0;
-}
-
-"""
-
-PARTIAL_EAT_ALL="""\
-\ticount=0; inst_substate = %(substate)s; return;
-case %(substate)s:;
-"""
-
-PARTIAL_MEMORY="""\
-\tif(icount == 0) { inst_substate = %(substate)s; return; }
-case %(substate)s:
-%(ins)s
-\ticount--;
-"""
-
-PARTIAL_NONE="""\
-%(ins)s
-"""
-def identify_line_type(ins):
- if "eat-all-cycles" in ins: return "EAT"
- for s in ["read", "write", "prefetch(", "prefetch_noirq("]:
- if s in ins:
- return "MEMORY"
- return "NONE"
-
-
-def save_opcodes(f, device, opcodes):
- for name, instructions in opcodes:
- d = { "device": device,
- "opcode": name,
- }
-
- emit(f, FULL_PROLOG % d)
- substate = 1
- for ins in instructions:
- d["substate"] = str(substate)
- d["ins"] = ins
- line_type = identify_line_type(ins)
- if line_type == "EAT":
- emit(f, FULL_EAT_ALL % d)
- substate += 1
- elif line_type == "MEMORY":
- emit(f, FULL_MEMORY % d)
- substate += 1
- else:
- emit(f, FULL_NONE %d)
- emit(f, FULL_EPILOG % d)
-
- emit(f, PARTIAL_PROLOG % d)
- substate = 1
- for ins in instructions:
- d["substate"] = str(substate)
- d["ins"] = ins
- line_type = identify_line_type(ins)
- if line_type == "EAT":
- emit(f, PARTIAL_EAT_ALL % d)
- substate += 1
- elif line_type == "MEMORY":
- emit(f, PARTIAL_MEMORY % d)
- substate += 1
- else:
- emit(f, PARTIAL_NONE %d)
- emit(f, PARTIAL_EPILOG % d)
-
-
-DO_EXEC_FULL_PROLOG="""\
-void %(device)s::do_exec_full()
-{
-\tswitch(inst_state) {
-"""
-
-DO_EXEC_FULL_EPILOG="""\
-\t}
-}
-"""
-
-DO_EXEC_PARTIAL_PROLOG="""\
-void %(device)s::do_exec_partial()
-{
-\tswitch(inst_state) {
-"""
-
-DO_EXEC_PARTIAL_EPILOG="""\
-\t}
-}
-"""
-
-DISASM_PROLOG="""\
-const %(device)s::disasm_entry %(device)s::disasm_entries[0x%(disasm_count)x] = {
-"""
-
-DISASM_EPILOG="""\
-};
-"""
-
-def save_tables(f, device, states):
- total_states = len(states)
-
- d = { "device": device,
- "disasm_count": total_states-1
- }
-
-
- emit(f, DO_EXEC_FULL_PROLOG % d)
- for n, state in enumerate(states):
- if state == ".": continue
- if n < total_states - 1:
- emit(f, "\tcase 0x%02x: %s_full(); break;\n" % (n, state))
- else:
- emit(f, "\tcase %s: %s_full(); break;\n" % ("STATE_RESET", state))
- emit(f, DO_EXEC_FULL_EPILOG % d)
-
- emit(f, DO_EXEC_PARTIAL_PROLOG % d)
- for n, state in enumerate(states):
- if state == ".": continue
- if n < total_states - 1:
- emit(f, "\tcase 0x%02x: %s_partial(); break;\n" % (n, state))
- else:
- emit(f, "\tcase %s: %s_partial(); break;\n" % ("STATE_RESET", state))
- emit(f, DO_EXEC_PARTIAL_EPILOG % d)
-
- emit(f, DISASM_PROLOG % d )
- for n, state in enumerate(states):
- if state == ".": continue
- if n == total_states - 1: break
- tokens = state.split("_")
- opc = tokens[0]
- mode = tokens[-1]
- extra = "0"
- if opc in ["jsr", "bsr"]:
- extra = "DASMFLAG_STEP_OVER"
- elif opc in ["rts", "rti", "rtn"]:
- extra = "DASMFLAG_STEP_OUT"
- emit(f, '\t{ "%s", DASM_%s, %s },\n' % (opc, mode, extra))
- emit(f, DISASM_EPILOG % d)
-
-def save(fname, device, opcodes, states):
- logging.info("saving: %s", fname)
- try:
- f = open(fname, "w")
- except Exception:
- err = sys.exc_info()[1]
- logging.error("cannot write file %s [%s]", fname, err)
- sys.exit(1)
- save_opcodes(f,device, opcodes)
- emit(f, "\n")
- save_tables(f, device, states)
- f.close()
-
-
-def main(argv):
- debug = False
- logformat=("%(levelname)s:"
- "%(module)s:"
- "%(lineno)d:"
- "%(threadName)s:"
- "%(message)s")
- if debug:
- logging.basicConfig(level=logging.INFO, format=logformat)
- else:
- logging.basicConfig(level=logging.WARNING, format=logformat)
-
-
- if len(argv) != 5:
- print(USAGE % argv[0])
- return 1
-
- device_name = argv[1]
-
- opcodes = []
- if argv[2] != "-":
- opcodes = load_opcodes(argv[2])
- logging.info("found %d opcodes", len(opcodes))
- else:
- logging.info("skipping opcode reading")
-
-
- states = load_disp(argv[3])
- logging.info("loaded %s states", len(states))
-
- assert (len(states) & 0xff) == 1
- save(argv[4], device_name, opcodes, states)
-
-
-# ======================================================================
-if __name__ == "__main__":
- sys.exit(main(sys.argv))
-
diff --git a/src/emu/cpu/m6502/m6504.c b/src/emu/cpu/m6502/m6504.c
deleted file mode 100644
index f2ae2c4b6d9..00000000000
--- a/src/emu/cpu/m6502/m6504.c
+++ /dev/null
@@ -1,61 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Olivier Galibert
-/***************************************************************************
-
- m6504.c
-
- Mostek 6502, NMOS variant with reduced address bus
-
-***************************************************************************/
-
-#include "emu.h"
-#include "m6504.h"
-
-const device_type M6504 = &device_creator<m6504_device>;
-
-m6504_device::m6504_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
- m6502_device(mconfig, M6504, "M6504", tag, owner, clock, "m6504", __FILE__)
-{
- program_config.m_addrbus_width = 13;
- sprogram_config.m_addrbus_width = 13;
-}
-
-void m6504_device::device_start()
-{
- if(direct_disabled)
- mintf = new mi_6504_nd;
- else
- mintf = new mi_6504_normal;
-
- init();
-}
-
-UINT8 m6504_device::mi_6504_normal::read(UINT16 adr)
-{
- return program->read_byte(adr & 0x1fff);
-}
-
-UINT8 m6504_device::mi_6504_normal::read_sync(UINT16 adr)
-{
- return sdirect->read_byte(adr & 0x1fff);
-}
-
-UINT8 m6504_device::mi_6504_normal::read_arg(UINT16 adr)
-{
- return direct->read_byte(adr & 0x1fff);
-}
-
-void m6504_device::mi_6504_normal::write(UINT16 adr, UINT8 val)
-{
- program->write_byte(adr & 0x1fff, val);
-}
-
-UINT8 m6504_device::mi_6504_nd::read_sync(UINT16 adr)
-{
- return sprogram->read_byte(adr & 0x1fff);
-}
-
-UINT8 m6504_device::mi_6504_nd::read_arg(UINT16 adr)
-{
- return program->read_byte(adr & 0x1fff);
-}
diff --git a/src/emu/cpu/m6502/m6504.h b/src/emu/cpu/m6502/m6504.h
deleted file mode 100644
index f272b059333..00000000000
--- a/src/emu/cpu/m6502/m6504.h
+++ /dev/null
@@ -1,49 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Olivier Galibert
-/***************************************************************************
-
- m6504.h
-
- Mostek 6502, NMOS variant with reduced address bus
-
-***************************************************************************/
-
-#ifndef __M6504_H__
-#define __M6504_H__
-
-#include "m6502.h"
-
-class m6504_device : public m6502_device {
-public:
- m6504_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
-protected:
- class mi_6504_normal : public memory_interface {
- public:
- virtual ~mi_6504_normal() {}
- virtual UINT8 read(UINT16 adr);
- virtual UINT8 read_sync(UINT16 adr);
- virtual UINT8 read_arg(UINT16 adr);
- virtual void write(UINT16 adr, UINT8 val);
- };
-
- class mi_6504_nd : public mi_6504_normal {
- public:
- virtual ~mi_6504_nd() {}
- virtual UINT8 read_sync(UINT16 adr);
- virtual UINT8 read_arg(UINT16 adr);
- };
-
- virtual void device_start();
-};
-
-
-enum {
- M6504_IRQ_LINE = m6502_device::IRQ_LINE,
- M6504_NMI_LINE = m6502_device::NMI_LINE,
- M6504_SET_OVERFLOW = m6502_device::V_LINE
-};
-
-extern const device_type M6504;
-
-#endif
diff --git a/src/emu/cpu/m6502/m6509.c b/src/emu/cpu/m6502/m6509.c
deleted file mode 100644
index 77af9e8f1f7..00000000000
--- a/src/emu/cpu/m6502/m6509.c
+++ /dev/null
@@ -1,148 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Olivier Galibert
-/***************************************************************************
-
- m6509.c
-
- 6502 with banking and extended address bus
-
-***************************************************************************/
-
-#include "emu.h"
-#include "m6509.h"
-
-const device_type M6509 = &device_creator<m6509_device>;
-
-m6509_device::m6509_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
- m6502_device(mconfig, M6509, "M6509", tag, owner, clock, "m6509", __FILE__)
-{
- program_config.m_addrbus_width = 20;
- program_config.m_logaddr_width = 20;
- sprogram_config.m_addrbus_width = 20;
- sprogram_config.m_logaddr_width = 20;
-}
-
-void m6509_device::device_start()
-{
- if(direct_disabled)
- mintf = new mi_6509_nd(this);
- else
- mintf = new mi_6509_normal(this);
-
- init();
-
- state_add(STATE_GENPC, "GENPC", XPC).callexport().noshow();
- state_add(M6509_BI, "BI", bank_i);
- state_add(M6509_BY, "BY", bank_y);
-}
-
-void m6509_device::device_reset()
-{
- m6502_device::device_reset();
- bank_i = 0x0f;
- bank_y = 0x0f;
-}
-
-void m6509_device::state_export(const device_state_entry &entry)
-{
- switch(entry.index()) {
- case STATE_GENPC:
- XPC = adr_in_bank_i(NPC);
- break;
- }
-}
-
-offs_t m6509_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options)
-{
- return disassemble_generic(buffer, pc, oprom, opram, options, disasm_entries);
-}
-
-
-m6509_device::mi_6509_normal::mi_6509_normal(m6509_device *_base)
-{
- base = _base;
-}
-
-UINT8 m6509_device::mi_6509_normal::read(UINT16 adr)
-{
- UINT8 res = program->read_byte(base->adr_in_bank_i(adr));
- if(adr == 0x0000)
- res = base->bank_i_r();
- else if(adr == 0x0001)
- res = base->bank_y_r();
- return res;
-}
-
-UINT8 m6509_device::mi_6509_normal::read_sync(UINT16 adr)
-{
- UINT8 res = sdirect->read_byte(base->adr_in_bank_i(adr));
- if(adr == 0x0000)
- res = base->bank_i_r();
- else if(adr == 0x0001)
- res = base->bank_y_r();
- return res;
-}
-
-UINT8 m6509_device::mi_6509_normal::read_arg(UINT16 adr)
-{
- UINT8 res = direct->read_byte(base->adr_in_bank_i(adr));
- if(adr == 0x0000)
- res = base->bank_i_r();
- else if(adr == 0x0001)
- res = base->bank_y_r();
- return res;
-}
-
-UINT8 m6509_device::mi_6509_normal::read_9(UINT16 adr)
-{
- UINT8 res = program->read_byte(base->adr_in_bank_y(adr));
- if(adr == 0x0000)
- res = base->bank_i_r();
- else if(adr == 0x0001)
- res = base->bank_y_r();
- return res;
-}
-
-void m6509_device::mi_6509_normal::write(UINT16 adr, UINT8 val)
-{
- program->write_byte(base->adr_in_bank_i(adr), val);
- if(adr == 0x0000)
- base->bank_i_w(val);
- else if(adr == 0x0001)
- base->bank_y_w(val);
-}
-
-void m6509_device::mi_6509_normal::write_9(UINT16 adr, UINT8 val)
-{
- program->write_byte(base->adr_in_bank_y(adr), val);
- if(adr == 0x0000)
- base->bank_i_w(val);
- else if(adr == 0x0001)
- base->bank_y_w(val);
-}
-
-m6509_device::mi_6509_nd::mi_6509_nd(m6509_device *_base) : mi_6509_normal(_base)
-{
-}
-
-UINT8 m6509_device::mi_6509_nd::read_sync(UINT16 adr)
-{
- UINT8 res = sprogram->read_byte(base->adr_in_bank_i(adr));
- if(adr == 0x0000)
- res = base->bank_i_r();
- else if(adr == 0x0001)
- res = base->bank_y_r();
- return res;
-}
-
-UINT8 m6509_device::mi_6509_nd::read_arg(UINT16 adr)
-{
- UINT8 res = program->read_byte(base->adr_in_bank_i(adr));
- if(adr == 0x0000)
- res = base->bank_i_r();
- else if(adr == 0x0001)
- res = base->bank_y_r();
- return res;
-}
-
-#include "cpu/m6502/m6509.inc"
diff --git a/src/emu/cpu/m6502/m6509.h b/src/emu/cpu/m6502/m6509.h
deleted file mode 100644
index 2bfee01981a..00000000000
--- a/src/emu/cpu/m6502/m6509.h
+++ /dev/null
@@ -1,87 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Olivier Galibert
-/***************************************************************************
-
- m6509.h
-
- 6502 with banking and extended address bus
-
-***************************************************************************/
-
-#ifndef __M6509_H__
-#define __M6509_H__
-
-#include "m6502.h"
-
-class m6509_device : public m6502_device {
-public:
- m6509_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
- static const disasm_entry disasm_entries[0x100];
-
- virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options);
- virtual void do_exec_full();
- virtual void do_exec_partial();
-
-protected:
- class mi_6509_normal : public memory_interface {
- public:
- m6509_device *base;
-
- mi_6509_normal(m6509_device *base);
- virtual ~mi_6509_normal() {}
- virtual UINT8 read(UINT16 adr);
- virtual UINT8 read_9(UINT16 adr);
- virtual UINT8 read_sync(UINT16 adr);
- virtual UINT8 read_arg(UINT16 adr);
- virtual void write(UINT16 adr, UINT8 val);
- virtual void write_9(UINT16 adr, UINT8 val);
- };
-
- class mi_6509_nd : public mi_6509_normal {
- public:
- mi_6509_nd(m6509_device *base);
- virtual ~mi_6509_nd() {}
- virtual UINT8 read_sync(UINT16 adr);
- virtual UINT8 read_arg(UINT16 adr);
- };
-
- virtual void device_start();
- virtual void device_reset();
- virtual void state_export(const device_state_entry &entry);
-
- UINT32 XPC;
-
- UINT8 bank_i, bank_y;
-
- UINT8 bank_i_r() { return bank_i; }
- UINT8 bank_y_r() { return bank_y; }
- void bank_i_w(UINT8 data) { bank_i = data; }
- void bank_y_w(UINT8 data) { bank_y = data; }
-
- UINT32 adr_in_bank_i(UINT16 adr) { return adr | ((bank_i & 0xf) << 16); }
- UINT32 adr_in_bank_y(UINT16 adr) { return adr | ((bank_y & 0xf) << 16); }
-
-#define O(o) void o ## _full(); void o ## _partial()
-
- // 6509 opcodes
- O(lda_9_idy);
- O(sta_9_idy);
-
-#undef O
-};
-
-enum {
- M6509_IRQ_LINE = m6502_device::IRQ_LINE,
- M6509_NMI_LINE = m6502_device::NMI_LINE,
- M6509_SET_OVERFLOW = m6502_device::V_LINE
-};
-
-enum {
- M6509_BI = M6502_IR+1,
- M6509_BY
-};
-
-extern const device_type M6509;
-
-#endif
diff --git a/src/emu/cpu/m6502/m6510.c b/src/emu/cpu/m6502/m6510.c
deleted file mode 100644
index 10e57fb27b8..00000000000
--- a/src/emu/cpu/m6502/m6510.c
+++ /dev/null
@@ -1,175 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Olivier Galibert
-/***************************************************************************
-
- m6510.c
-
- 6502 with 6 i/o pins, also known as 8500
-
-***************************************************************************/
-
-#include "emu.h"
-#include "m6510.h"
-
-const device_type M6510 = &device_creator<m6510_device>;
-
-m6510_device::m6510_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
- m6502_device(mconfig, M6510, "M6510", tag, owner, clock, "m6510", __FILE__),
- read_port(*this),
- write_port(*this)
-{
- pullup = 0x00;
- floating = 0x00;
-}
-
-m6510_device::m6510_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
- m6502_device(mconfig, type, name, tag, owner, clock, shortname, source),
- read_port(*this),
- write_port(*this)
-{
- pullup = 0x00;
- floating = 0x00;
-}
-
-void m6510_device::set_pulls(UINT8 _pullup, UINT8 _floating)
-{
- pullup = _pullup;
- floating = _floating;
-}
-
-offs_t m6510_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options)
-{
- return disassemble_generic(buffer, pc, oprom, opram, options, disasm_entries);
-}
-
-void m6510_device::device_start()
-{
- read_port.resolve_safe(0);
- write_port.resolve_safe();
-
- if(direct_disabled)
- mintf = new mi_6510_nd(this);
- else
- mintf = new mi_6510_normal(this);
-
- init();
-
- save_item(NAME(pullup));
- save_item(NAME(floating));
- save_item(NAME(dir));
- save_item(NAME(port));
- save_item(NAME(drive));
-}
-
-void m6510_device::device_reset()
-{
- m6502_device::device_reset();
- dir = 0x00;
- port = 0x00;
- drive = 0x00;
- update_port();
-}
-
-void m6510_device::update_port()
-{
- drive = (port & dir) | (drive & ~dir);
- write_port((port & dir) | (pullup & ~dir));
-}
-
-UINT8 m6510_device::get_port()
-{
- return (port & dir) | (pullup & ~dir);
-}
-
-UINT8 m6510_device::dir_r()
-{
- return dir;
-}
-
-UINT8 m6510_device::port_r()
-{
- return ((read_port() | (floating & drive)) & ~dir) | (port & dir);
-}
-
-void m6510_device::dir_w(UINT8 data)
-{
- dir = data;
- update_port();
-}
-
-void m6510_device::port_w(UINT8 data)
-{
- port = data;
- update_port();
-}
-
-
-m6510_device::mi_6510_normal::mi_6510_normal(m6510_device *_base)
-{
- base = _base;
-}
-
-UINT8 m6510_device::mi_6510_normal::read(UINT16 adr)
-{
- UINT8 res = program->read_byte(adr);
- if(adr == 0x0000)
- res = base->dir_r();
- else if(adr == 0x0001)
- res = base->port_r();
- return res;
-}
-
-UINT8 m6510_device::mi_6510_normal::read_sync(UINT16 adr)
-{
- UINT8 res = sdirect->read_byte(adr);
- if(adr == 0x0000)
- res = base->dir_r();
- else if(adr == 0x0001)
- res = base->port_r();
- return res;
-}
-
-UINT8 m6510_device::mi_6510_normal::read_arg(UINT16 adr)
-{
- UINT8 res = direct->read_byte(adr);
- if(adr == 0x0000)
- res = base->dir_r();
- else if(adr == 0x0001)
- res = base->port_r();
- return res;
-}
-
-void m6510_device::mi_6510_normal::write(UINT16 adr, UINT8 val)
-{
- program->write_byte(adr, val);
- if(adr == 0x0000)
- base->dir_w(val);
- else if(adr == 0x0001)
- base->port_w(val);
-}
-
-m6510_device::mi_6510_nd::mi_6510_nd(m6510_device *_base) : mi_6510_normal(_base)
-{
-}
-
-UINT8 m6510_device::mi_6510_nd::read_sync(UINT16 adr)
-{
- UINT8 res = sprogram->read_byte(adr);
- if(adr == 0x0000)
- res = base->dir_r();
- else if(adr == 0x0001)
- res = base->port_r();
- return res;
-}
-
-UINT8 m6510_device::mi_6510_nd::read_arg(UINT16 adr)
-{
- UINT8 res = program->read_byte(adr);
- if(adr == 0x0000)
- res = base->dir_r();
- else if(adr == 0x0001)
- res = base->port_r();
- return res;
-}
-
-#include "cpu/m6502/m6510.inc"
diff --git a/src/emu/cpu/m6502/m6510.h b/src/emu/cpu/m6502/m6510.h
deleted file mode 100644
index 86aaa60ffaa..00000000000
--- a/src/emu/cpu/m6502/m6510.h
+++ /dev/null
@@ -1,99 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Olivier Galibert
-/***************************************************************************
-
- m6510.h
-
- 6502 with 6 i/o pins, also known as 8500
-
-***************************************************************************/
-
-#ifndef __M6510FAM_H__
-#define __M6510FAM_H__
-
-#include "m6502.h"
-
-#define MCFG_M6510_PORT_CALLBACKS(_read, _write) \
- downcast<m6510_device *>(device)->set_callbacks(DEVCB_##_read, DEVCB_##_write);
-
-#define MCFG_M6510_PORT_PULLS(_up, _down) \
- downcast<m6510_device *>(device)->set_pulls(_up, _down);
-
-class m6510_device : public m6502_device {
-public:
- m6510_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
- m6510_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
-
- UINT8 get_port();
- void set_port(UINT8 val);
- void set_pulls(UINT8 pullup, UINT8 pulldown);
-
- template<class _read, class _write> void set_callbacks(_read rd, _write wr) {
- read_port.set_callback(rd);
- write_port.set_callback(wr);
- }
-
- static const disasm_entry disasm_entries[0x100];
-
- virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options);
- virtual void do_exec_full();
- virtual void do_exec_partial();
-
-protected:
- class mi_6510_normal : public memory_interface {
- public:
- m6510_device *base;
-
- mi_6510_normal(m6510_device *base);
- virtual ~mi_6510_normal() {}
- virtual UINT8 read(UINT16 adr);
- virtual UINT8 read_sync(UINT16 adr);
- virtual UINT8 read_arg(UINT16 adr);
- virtual void write(UINT16 adr, UINT8 val);
- };
-
- class mi_6510_nd : public mi_6510_normal {
- public:
- mi_6510_nd(m6510_device *base);
- virtual ~mi_6510_nd() {}
- virtual UINT8 read_sync(UINT16 adr);
- virtual UINT8 read_arg(UINT16 adr);
- };
-
- devcb_read8 read_port;
- devcb_write8 write_port;
-
- UINT8 pullup, floating, dir, port, drive;
-
- virtual void device_start();
- virtual void device_reset();
-
- UINT8 dir_r();
- void dir_w(UINT8 data);
- UINT8 port_r();
- void port_w(UINT8 data);
-
- void update_port();
-
-#define O(o) void o ## _full(); void o ## _partial()
-
- // 6510 undocumented instructions in a C64 context
- // implementation follows what the test suites expect (usually an extra and)
- O(anc_10_imm);
- O(ane_10_imm);
- O(arr_10_imm);
- O(asr_10_imm);
- O(las_10_aby);
- O(lxa_10_imm);
-
-#undef O
-};
-
-enum {
- M6510_IRQ_LINE = m6502_device::IRQ_LINE,
- M6510_NMI_LINE = m6502_device::NMI_LINE
-};
-
-extern const device_type M6510;
-
-#endif
diff --git a/src/emu/cpu/m6502/m6510t.c b/src/emu/cpu/m6502/m6510t.c
deleted file mode 100644
index 7e8a34c6f20..00000000000
--- a/src/emu/cpu/m6502/m6510t.c
+++ /dev/null
@@ -1,19 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Olivier Galibert
-/***************************************************************************
-
- m6510t.c
-
- 6510 with the full 8 i/o pins at the expense of the NMI and RDY lines.
-
-***************************************************************************/
-
-#include "emu.h"
-#include "m6510t.h"
-
-const device_type M6510T = &device_creator<m6510t_device>;
-
-m6510t_device::m6510t_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
- m6510_device(mconfig, M6510T, "M6510T", tag, owner, clock, "m6510t", __FILE__)
-{
-}
diff --git a/src/emu/cpu/m6502/m6510t.h b/src/emu/cpu/m6502/m6510t.h
deleted file mode 100644
index f580ed6aef3..00000000000
--- a/src/emu/cpu/m6502/m6510t.h
+++ /dev/null
@@ -1,34 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Olivier Galibert
-/***************************************************************************
-
- m6510t.h
-
- 6510 with the full 8 i/o pins at the expense of the NMI and RDY lines.
-
-***************************************************************************/
-
-#ifndef __M6510T_H__
-#define __M6510T_H__
-
-#include "m6510.h"
-
-#define MCFG_M6510T_PORT_CALLBACKS(_read, _write) \
- downcast<m6510t_device *>(device)->set_callbacks(DEVCB_##_read, DEVCB_##_write);
-
-#define MCFG_M6510T_PORT_PULLS(_up, _down) \
- downcast<m6510t_device *>(device)->set_pulls(_up, _down);
-
-class m6510t_device : public m6510_device {
-public:
- m6510t_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-};
-
-enum {
- M6510T_IRQ_LINE = m6502_device::IRQ_LINE,
- M6510T_SET_OVERFLOW = m6502_device::V_LINE
-};
-
-extern const device_type M6510T;
-
-#endif
diff --git a/src/emu/cpu/m6502/m65c02.c b/src/emu/cpu/m6502/m65c02.c
deleted file mode 100644
index 4f02de6471c..00000000000
--- a/src/emu/cpu/m6502/m65c02.c
+++ /dev/null
@@ -1,32 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Olivier Galibert
-/***************************************************************************
-
- m65c02.c
-
- Mostek 6502, CMOS variant with some additional instructions (but
- not the bitwise ones)
-
-***************************************************************************/
-
-#include "emu.h"
-#include "m65c02.h"
-
-const device_type M65C02 = &device_creator<m65c02_device>;
-
-m65c02_device::m65c02_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
- m6502_device(mconfig, M65C02, "M65C02", tag, owner, clock, "mc65c02", __FILE__)
-{
-}
-
-m65c02_device::m65c02_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
- m6502_device(mconfig, type, name, tag, owner, clock, shortname, source)
-{
-}
-
-offs_t m65c02_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options)
-{
- return disassemble_generic(buffer, pc, oprom, opram, options, disasm_entries);
-}
-
-#include "cpu/m6502/m65c02.inc"
diff --git a/src/emu/cpu/m6502/m65c02.h b/src/emu/cpu/m6502/m65c02.h
deleted file mode 100644
index 5eda5593fee..00000000000
--- a/src/emu/cpu/m6502/m65c02.h
+++ /dev/null
@@ -1,76 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Olivier Galibert
-/***************************************************************************
-
- m65c02.h
-
- Mostek 6502, CMOS variant with some additional instructions (but
- not the bitwise ones)
-
-***************************************************************************/
-
-#ifndef __M65C02_H__
-#define __M65C02_H__
-
-#include "m6502.h"
-
-class m65c02_device : public m6502_device {
-public:
- m65c02_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
- m65c02_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
-
- static const disasm_entry disasm_entries[0x100];
-
- virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options);
- virtual void do_exec_full();
- virtual void do_exec_partial();
-
-protected:
-#define O(o) void o ## _full(); void o ## _partial()
-
- // 65c02 opcodes
- O(adc_c_aba); O(adc_c_abx); O(adc_c_aby); O(adc_c_idx); O(adc_c_idy); O(adc_c_imm); O(adc_c_zpg); O(adc_c_zpi); O(adc_c_zpx);
- O(and_zpi);
- O(asl_c_abx);
- O(bbr_zpb);
- O(bbs_zpb);
- O(bit_abx); O(bit_imm); O(bit_zpx);
- O(bra_rel);
- O(brk_c_imp);
- O(cmp_zpi);
- O(dec_acc);
- O(eor_zpi);
- O(inc_acc);
- O(jmp_c_ind); O(jmp_iax);
- O(lda_zpi);
- O(lsr_c_abx);
- O(nop_c_aba); O(nop_c_abx); O(nop_c_imp);
- O(ora_zpi);
- O(phx_imp);
- O(phy_imp);
- O(plx_imp);
- O(ply_imp);
- O(rmb_bzp);
- O(rol_c_abx);
- O(ror_c_abx);
- O(sbc_c_aba); O(sbc_c_abx); O(sbc_c_aby); O(sbc_c_idx); O(sbc_c_idy); O(sbc_c_imm); O(sbc_c_zpg); O(sbc_c_zpi); O(sbc_c_zpx);
- O(smb_bzp);
- O(stp_imp);
- O(sta_zpi);
- O(stz_aba); O(stz_abx); O(stz_zpg); O(stz_zpx);
- O(trb_aba); O(trb_zpg);
- O(tsb_aba); O(tsb_zpg);
- O(wai_imp);
-
-#undef O
-};
-
-enum {
- M65C02_IRQ_LINE = m6502_device::IRQ_LINE,
- M65C02_NMI_LINE = m6502_device::NMI_LINE,
- M65C02_SET_OVERFLOW = m6502_device::V_LINE
-};
-
-extern const device_type M65C02;
-
-#endif
diff --git a/src/emu/cpu/m6502/m65ce02.c b/src/emu/cpu/m6502/m65ce02.c
deleted file mode 100644
index 97ad2c4b535..00000000000
--- a/src/emu/cpu/m6502/m65ce02.c
+++ /dev/null
@@ -1,98 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Olivier Galibert
-/***************************************************************************
-
- m65ce02.c
-
- 6502 with Z register and some more stuff
-
-***************************************************************************/
-
-#include "emu.h"
-#include "m65ce02.h"
-
-const device_type M65CE02 = &device_creator<m65ce02_device>;
-
-m65ce02_device::m65ce02_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
- m65c02_device(mconfig, M65CE02, "M65CE02", tag, owner, clock, "m65ce02", __FILE__)
-{
-}
-
-m65ce02_device::m65ce02_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
- m65c02_device(mconfig, type, name, tag, owner, clock, shortname, source)
-{
-}
-
-offs_t m65ce02_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options)
-{
- return disassemble_generic(buffer, pc, oprom, opram, options, disasm_entries);
-}
-
-void m65ce02_device::init()
-{
- m65c02_device::init();
- state_add(M65CE02_Z, "Z", Z);
- state_add(M65CE02_B, "B", B).callimport().formatstr("%2s");
- save_item(NAME(B));
- save_item(NAME(Z));
- save_item(NAME(TMP3));
- Z = 0x00;
- B = 0x0000;
- TMP3 = 0x0000;
-}
-
-void m65ce02_device::device_start()
-{
- if(direct_disabled)
- mintf = new mi_default_nd;
- else
- mintf = new mi_default_normal;
-
- init();
-}
-
-void m65ce02_device::device_reset()
-{
- m65c02_device::device_reset();
- Z = 0x00;
- B = 0x0000;
-}
-
-void m65ce02_device::state_import(const device_state_entry &entry)
-{
- switch(entry.index()) {
- case STATE_GENFLAGS:
- case M6502_P:
- P = P | F_B;
- break;
- case M65CE02_B:
- B <<= 8;
- break;
- }
-}
-
-void m65ce02_device::state_export(const device_state_entry &entry)
-{
-}
-
-void m65ce02_device::state_string_export(const device_state_entry &entry, std::string &str)
-{
- switch(entry.index()) {
- case STATE_GENFLAGS:
- case M6502_P:
- strprintf(str, "%c%c%c%c%c%c%c",
- P & F_N ? 'N' : '.',
- P & F_V ? 'V' : '.',
- P & F_E ? 'E' : '.',
- P & F_D ? 'D' : '.',
- P & F_I ? 'I' : '.',
- P & F_Z ? 'Z' : '.',
- P & F_C ? 'C' : '.');
- break;
- case M65CE02_B:
- strprintf(str, "%02x", B >> 8);
- break;
- }
-}
-
-#include "cpu/m6502/m65ce02.inc"
diff --git a/src/emu/cpu/m6502/m65ce02.h b/src/emu/cpu/m6502/m65ce02.h
deleted file mode 100644
index f8e03867d82..00000000000
--- a/src/emu/cpu/m6502/m65ce02.h
+++ /dev/null
@@ -1,153 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Olivier Galibert
-/***************************************************************************
-
- m65ce02.h
-
- 6502 with Z register and some more stuff
-
-***************************************************************************/
-
-#ifndef __M65CE02_H__
-#define __M65CE02_H__
-
-#include "m65c02.h"
-
-class m65ce02_device : public m65c02_device {
-public:
- m65ce02_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
- m65ce02_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
-
- static const disasm_entry disasm_entries[0x100];
-
- virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options);
- virtual void do_exec_full();
- virtual void do_exec_partial();
-
-protected:
- UINT16 TMP3; /* temporary internal values */
- UINT8 Z; /* Z index register */
- UINT16 B; /* Zero page base address (always xx00) */
-
- virtual void init();
- virtual void device_start();
- virtual void device_reset();
- virtual void state_import(const device_state_entry &entry);
- virtual void state_export(const device_state_entry &entry);
- virtual void state_string_export(const device_state_entry &entry, std::string &str);
-
- inline void dec_SP_ce() { if(P & F_E) SP = set_l(SP, SP-1); else SP--; }
- inline void inc_SP_ce() { if(P & F_E) SP = set_l(SP, SP+1); else SP++; }
-
-#define O(o) void o ## _full(); void o ## _partial()
-
- // 65ce02 opcodes
- O(adc_ce_aba); O(adc_ce_abx); O(adc_ce_aby); O(adc_ce_idx); O(adc_ce_idy); O(adc_idz); O(adc_ce_imm); O(adc_ce_zpg); O(adc_ce_zpx);
- O(and_ce_abx); O(and_ce_aby); O(and_ce_idx); O(and_ce_idy); O(and_idz); O(and_ce_zpg); O(and_ce_zpx);
- O(asl_ce_aba); O(asl_ce_abx); O(asl_ce_acc); O(asl_ce_zpg); O(asl_ce_zpx);
- O(asr_acc); O(asr_zpg); O(asr_zpx);
- O(asw_aba);
- O(aug_iw3);
- O(bbr_ce_zpb);
- O(bbs_ce_zpb);
- O(bcc_ce_rel); O(bcc_rw2);
- O(bcs_ce_rel); O(bcs_rw2);
- O(beq_ce_rel); O(beq_rw2);
- O(bit_ce_abx); O(bit_ce_imm); O(bit_ce_zpg); O(bit_ce_zpx);
- O(bmi_ce_rel); O(bmi_rw2);
- O(bne_ce_rel); O(bne_rw2);
- O(bpl_ce_rel); O(bpl_rw2);
- O(bra_ce_rel); O(bra_rw2);
- O(brk_ce_imp);
- O(bsr_rw2);
- O(bvc_ce_rel); O(bvc_rw2);
- O(bvs_ce_rel); O(bvs_rw2);
- O(clc_ce_imp);
- O(cld_ce_imp);
- O(cle_imp);
- O(cli_ce_imp);
- O(clv_ce_imp);
- O(cmp_ce_abx); O(cmp_ce_aby); O(cmp_ce_idx); O(cmp_ce_idy); O(cmp_idz); O(cmp_ce_zpg); O(cmp_ce_zpx);
- O(cpx_ce_zpg);
- O(cpy_ce_zpg);
- O(cpz_aba); O(cpz_imm); O(cpz_zpg);
- O(dec_ce_aba); O(dec_ce_abx); O(dec_ce_acc); O(dec_ce_zpg); O(dec_ce_zpx);
- O(dew_zpg);
- O(dex_ce_imp);
- O(dey_ce_imp);
- O(dez_imp);
- O(eor_ce_abx); O(eor_ce_aby); O(eor_ce_idx); O(eor_ce_idy); O(eor_idz); O(eor_ce_zpg); O(eor_ce_zpx);
- O(inc_ce_aba); O(inc_ce_abx); O(inc_ce_acc); O(inc_ce_zpg); O(inc_ce_zpx);
- O(inw_zpg);
- O(inx_ce_imp);
- O(iny_ce_imp);
- O(inz_imp);
- O(jmp_ce_iax); O(jmp_ce_ind);
- O(jsr_ce_adr); O(jsr_ind); O(jsr_iax);
- O(lda_ce_abx); O(lda_ce_aby); O(lda_ce_idx); O(lda_ce_idy); O(lda_idz); O(lda_isy); O(lda_ce_zpg); O(lda_ce_zpx);
- O(ldx_ce_aby); O(ldx_ce_zpg); O(ldx_ce_zpy);
- O(ldy_ce_abx); O(ldy_ce_zpg); O(ldy_ce_zpx);
- O(ldz_aba); O(ldz_abx); O(ldz_imm);
- O(lsr_ce_aba); O(lsr_ce_abx); O(lsr_ce_acc); O(lsr_ce_zpg); O(lsr_ce_zpx);
- O(neg_acc);
- O(ora_ce_abx); O(ora_ce_aby); O(ora_ce_idx); O(ora_ce_idy); O(ora_idz); O(ora_ce_zpg); O(ora_ce_zpx);
- O(pha_ce_imp);
- O(php_ce_imp);
- O(phw_aba); O(phw_iw2);
- O(phx_ce_imp);
- O(phy_ce_imp);
- O(phz_imp);
- O(pla_ce_imp);
- O(plp_ce_imp);
- O(plx_ce_imp);
- O(ply_ce_imp);
- O(plz_imp);
- O(rmb_ce_bzp);
- O(rol_ce_aba); O(rol_ce_abx); O(rol_ce_acc); O(rol_ce_zpg); O(rol_ce_zpx);
- O(ror_ce_aba); O(ror_ce_abx); O(ror_ce_acc); O(ror_ce_zpg); O(ror_ce_zpx);
- O(row_aba);
- O(rti_ce_imp);
- O(rtn_imm);
- O(rts_ce_imp);
- O(sbc_ce_aba); O(sbc_ce_abx); O(sbc_ce_aby); O(sbc_ce_idx); O(sbc_ce_idy); O(sbc_idz); O(sbc_ce_imm); O(sbc_ce_zpg); O(sbc_ce_zpx);
- O(sec_ce_imp);
- O(sed_ce_imp);
- O(see_imp);
- O(sei_ce_imp);
- O(smb_ce_bzp);
- O(sta_ce_abx); O(sta_ce_aby); O(sta_ce_idx); O(sta_ce_idy); O(sta_idz); O(sta_isy); O(sta_ce_zpg); O(sta_ce_zpx);
- O(stx_aby); O(stx_ce_zpg); O(stx_ce_zpy);
- O(sty_abx); O(sty_ce_zpg); O(sty_ce_zpx);
- O(stz_ce_aba); O(stz_ce_abx); O(stz_ce_zpg); O(stz_ce_zpx);
- O(tab_imp);
- O(tax_ce_imp);
- O(tay_ce_imp);
- O(taz_imp);
- O(tba_imp);
- O(trb_ce_aba); O(trb_ce_zpg);
- O(tsb_ce_aba); O(tsb_ce_zpg);
- O(tsx_ce_imp);
- O(tsy_imp);
- O(txa_ce_imp);
- O(txs_ce_imp);
- O(tys_imp);
- O(tya_ce_imp);
- O(tza_imp);
-
-#undef O
-};
-
-enum {
- M65CE02_IRQ_LINE = m6502_device::IRQ_LINE,
- M65CE02_NMI_LINE = m6502_device::NMI_LINE
-};
-
-
-enum {
- M65CE02_Z = M6502_IR+1,
- M65CE02_B
-};
-
-extern const device_type M65CE02;
-
-#endif
diff --git a/src/emu/cpu/m6502/m65sc02.c b/src/emu/cpu/m6502/m65sc02.c
deleted file mode 100644
index f61bc63cf7f..00000000000
--- a/src/emu/cpu/m6502/m65sc02.c
+++ /dev/null
@@ -1,19 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Olivier Galibert
-/***************************************************************************
-
- m65sc02.c
-
- Rockwell-class 65c02 with internal static registers, making clock stoppable?
-
-***************************************************************************/
-
-#include "emu.h"
-#include "m65sc02.h"
-
-const device_type M65SC02 = &device_creator<m65sc02_device>;
-
-m65sc02_device::m65sc02_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
- r65c02_device(mconfig, M65SC02, "M65SC02", tag, owner, clock, "m65sc02", __FILE__)
-{
-}
diff --git a/src/emu/cpu/m6502/m65sc02.h b/src/emu/cpu/m6502/m65sc02.h
deleted file mode 100644
index f754fc3de89..00000000000
--- a/src/emu/cpu/m6502/m65sc02.h
+++ /dev/null
@@ -1,29 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Olivier Galibert
-/***************************************************************************
-
- m65sc02.h
-
- Rockwell-class 65c02 with internal static registers, making clock stoppable?
-
-***************************************************************************/
-
-#ifndef __M65SC02_H__
-#define __M65SC02_H__
-
-#include "r65c02.h"
-
-class m65sc02_device : public r65c02_device {
-public:
- m65sc02_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-};
-
-enum {
- M65SC02_IRQ_LINE = m6502_device::IRQ_LINE,
- M65SC02_NMI_LINE = m6502_device::NMI_LINE,
- M65SC02_SET_OVERFLOW = m6502_device::V_LINE
-};
-
-extern const device_type M65SC02;
-
-#endif
diff --git a/src/emu/cpu/m6502/m740.c b/src/emu/cpu/m6502/m740.c
deleted file mode 100644
index 5e011ba3561..00000000000
--- a/src/emu/cpu/m6502/m740.c
+++ /dev/null
@@ -1,243 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Olivier Galibert
-/***************************************************************************
-
- m740.c
-
- Mitsubishi M740 series (M507xx/M509xx)
-
-***************************************************************************/
-
-#include "emu.h"
-#include "m740.h"
-
-const device_type M740 = &device_creator<m740_device>;
-
-m740_device::m740_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
- m6502_device(mconfig, M740, "M740", tag, owner, clock, "m740", __FILE__)
-{
-}
-
-m740_device::m740_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
- m6502_device(mconfig, type, name, tag, owner, clock, shortname, source)
-{
-}
-
-offs_t m740_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options)
-{
- return disassemble_generic(buffer, pc, oprom, opram, options, disasm_entries);
-}
-
-void m740_device::device_start()
-{
- m6502_device::device_start();
-
- save_item(NAME(m_irq_multiplex));
- save_item(NAME(m_irq_vector));
-}
-
-void m740_device::device_reset()
-{
- inst_state_base = 0;
- inst_state = STATE_RESET;
- inst_substate = 0;
- nmi_state = false;
- irq_state = false;
- m_irq_multiplex = 0;
- m_irq_vector = 0xfffc;
- apu_irq_state = false;
- irq_taken = false;
- v_state = false;
- sync = false;
- inhibit_interrupts = false;
- SP = 0x00ff;
-}
-
-void m740_device::state_string_export(const device_state_entry &entry, std::string &str)
-{
- switch(entry.index()) {
- case STATE_GENFLAGS:
- case M6502_P:
- strprintf(str, "%c%c%c%c%c%c%c",
- P & F_N ? 'N' : '.',
- P & F_V ? 'V' : '.',
- P & F_T ? 'T' : '.',
- P & F_D ? 'D' : '.',
- P & F_I ? 'I' : '.',
- P & F_Z ? 'Z' : '.',
- P & F_C ? 'C' : '.');
- break;
- }
-}
-
-UINT8 m740_device::do_clb(UINT8 in, UINT8 bit)
-{
- return in & ~(1<<bit);
-}
-
-UINT8 m740_device::do_seb(UINT8 in, UINT8 bit)
-{
- return in | (1<<bit);
-}
-
-// swap the two nibbles of the input (Rotate Right Four bits)
-// doesn't affect the flags
-UINT8 m740_device::do_rrf(UINT8 in)
-{
- return ((in&0xf)<<4) | ((in&0xf0)>>4);
-}
-
-void m740_device::do_sbc_dt(UINT8 val)
-{
- UINT8 c = P & F_C ? 0 : 1;
- P &= ~(F_N|F_V|F_Z|F_C);
- UINT16 diff = TMP2 - val - c;
- UINT8 al = (TMP2 & 15) - (val & 15) - c;
- if(INT8(al) < 0)
- al -= 6;
- UINT8 ah = (TMP2 >> 4) - (val >> 4) - (INT8(al) < 0);
- if(!UINT8(diff))
- P |= F_Z;
- else if(diff & 0x80)
- P |= F_N;
- if((TMP2^val) & (TMP2^diff) & 0x80)
- P |= F_V;
- if(!(diff & 0xff00))
- P |= F_C;
- if(INT8(ah) < 0)
- ah -= 6;
- TMP2 = (ah << 4) | (al & 15);
-}
-
-void m740_device::do_sbc_ndt(UINT8 val)
-{
- UINT16 diff = TMP2 - val - (P & F_C ? 0 : 1);
- P &= ~(F_N|F_V|F_Z|F_C);
- if(!UINT8(diff))
- P |= F_Z;
- else if(INT8(diff) < 0)
- P |= F_N;
- if((TMP2^val) & (TMP2^diff) & 0x80)
- P |= F_V;
- if(!(diff & 0xff00))
- P |= F_C;
- TMP2 = diff;
-}
-
-void m740_device::do_sbct(UINT8 val)
-{
- if(P & F_D)
- do_sbc_dt(val);
- else
- do_sbc_ndt(val);
-}
-
-void m740_device::do_adc_dt(UINT8 val)
-{
- UINT8 c = P & F_C ? 1 : 0;
- P &= ~(F_N|F_V|F_Z|F_C);
- UINT8 al = (TMP2 & 15) + (val & 15) + c;
- if(al > 9)
- al += 6;
- UINT8 ah = (TMP2 >> 4) + (val >> 4) + (al > 15);
- if(!UINT8(TMP2 + val + c))
- P |= F_Z;
- else if(ah & 8)
- P |= F_N;
- if(~(TMP2^val) & (TMP2^(ah << 4)) & 0x80)
- P |= F_V;
- if(ah > 9)
- ah += 6;
- if(ah > 15)
- P |= F_C;
- TMP2 = (ah << 4) | (al & 15);
-}
-
-void m740_device::do_adc_ndt(UINT8 val)
-{
- UINT16 sum;
- sum = TMP2 + val + (P & F_C ? 1 : 0);
- P &= ~(F_N|F_V|F_Z|F_C);
- if(!UINT8(sum))
- P |= F_Z;
- else if(INT8(sum) < 0)
- P |= F_N;
- if(~(TMP2^val) & (TMP2^sum) & 0x80)
- P |= F_V;
- if(sum & 0xff00)
- P |= F_C;
- TMP2 = sum;
-}
-
-void m740_device::do_adct(UINT8 val)
-{
- if(P & F_D)
- do_adc_dt(val);
- else
- do_adc_ndt(val);
-}
-
-void m740_device::execute_set_input(int inputnum, int state)
-{
- switch(inputnum)
- {
- case M740_INT0_LINE:
- case M740_INT1_LINE:
- case M740_INT2_LINE:
- case M740_INT3_LINE:
- case M740_INT4_LINE:
- case M740_INT5_LINE:
- case M740_INT6_LINE:
- case M740_INT7_LINE:
- case M740_INT8_LINE:
- case M740_INT9_LINE:
- case M740_INT10_LINE:
- case M740_INT11_LINE:
- case M740_INT12_LINE:
- case M740_INT13_LINE:
- case M740_INT14_LINE: // 37450 has 15 IRQ lines, no other known variant has that many
- set_irq_line(inputnum - M740_INT0_LINE, state);
- break;
-
- case V_LINE:
- if(!v_state && state == ASSERT_LINE)
- {
- P |= F_V;
- }
- v_state = state == ASSERT_LINE;
- break;
- }
-}
-
-void m740_device::set_irq_line(int line, int state)
-{
- assert(line > 0);
- assert(line <= M740_MAX_INT_LINE);
-
- if (state == ASSERT_LINE)
- {
- m_irq_multiplex |= (1<<line);
- }
- else
- {
- m_irq_multiplex &= ~(1<<line);
- }
-
- irq_state = (m_irq_multiplex != 0);
-
- if (irq_state)
- {
- for (int i = 0; i < M740_MAX_INT_LINE; i++)
- {
- if (m_irq_multiplex & (1 << i))
- {
- m_irq_vector = 0xfffc - (UINT16)(2 * i);
- break;
- }
- }
- }
-
-// printf("M740 single IRQ state is %d (MPX %08x, vector %x)\n", irq_state, m_irq_multiplex, m_irq_vector);
-}
-
-#include "cpu/m6502/m740.inc"
diff --git a/src/emu/cpu/m6502/m740.h b/src/emu/cpu/m6502/m740.h
deleted file mode 100644
index 728fea5a074..00000000000
--- a/src/emu/cpu/m6502/m740.h
+++ /dev/null
@@ -1,105 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Olivier Galibert
-/***************************************************************************
-
- m740.h
-
- Mitsubishi M740 series (M507xx/M509xx)
-
-***************************************************************************/
-
-#ifndef __M740_H__
-#define __M740_H__
-
-#include "m6502.h"
-
-class m740_device : public m6502_device {
-public:
- enum
- {
- M740_INT0_LINE = INPUT_LINE_IRQ0, // (fffc)
- M740_INT1_LINE, // (fffa)
- M740_INT2_LINE, // (fff8)
- M740_INT3_LINE, // (fff6)
- M740_INT4_LINE, // (fff4)
- M740_INT5_LINE, // (fff2)
- M740_INT6_LINE, // (fff0)
- M740_INT7_LINE, // (ffee)
- M740_INT8_LINE, // (ffec)
- M740_INT9_LINE, // (ffea)
- M740_INT10_LINE, // (ffe8)
- M740_INT11_LINE, // (ffe6)
- M740_INT12_LINE, // (ffe4)
- M740_INT13_LINE, // (ffe2)
- M740_INT14_LINE, // (ffe0)
- M740_MAX_INT_LINE = M740_INT14_LINE,
- M740_SET_OVERFLOW = m6502_device::V_LINE
- };
-
- m740_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
- m740_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
-
- virtual void device_start();
- virtual void device_reset();
-
- static const disasm_entry disasm_entries[0x200];
-
- virtual void state_string_export(const device_state_entry &entry, std::string &str);
-
- virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options);
- virtual void do_exec_full();
- virtual void do_exec_partial();
- virtual void execute_set_input(int inputnum, int state);
-
-protected:
-#define O(o) void o ## _full(); void o ## _partial()
-
- UINT8 do_clb(UINT8 in, UINT8 bit);
- UINT8 do_seb(UINT8 in, UINT8 bit);
- UINT8 do_rrf(UINT8 in);
- void do_sbc_dt(UINT8 val);
- void do_sbc_ndt(UINT8 val);
- void do_sbct(UINT8 val);
- void do_adc_dt(UINT8 val);
- void do_adc_ndt(UINT8 val);
- void do_adct(UINT8 val);
-
- // m740 opcodes
- O(brk740_imp);
- O(clt_imp);
- O(set_imp);
- O(ldm_imz);
- O(jsr_spg);
- O(reset740);
- O(seb_biz); O(seb_bac);
- O(clb_biz); O(clb_bac);
- O(bbc_bzr); O(bbc_bar);
- O(bbs_bzr); O(bbs_bar);
- O(rrf_zpg);
- O(bra_rel);
- O(jmp_zpi);
-
- O(adct_aba); O(adct_abx); O(adct_aby); O(adct_idx); O(adct_idy); O(adct_imm); O(adct_zpg); O(adct_zpx);
- O(andt_aba); O(andt_abx); O(andt_aby); O(andt_imm); O(andt_idx); O(andt_idy); O(andt_zpg); O(andt_zpx);
- O(cmpt_aba); O(cmpt_abx); O(cmpt_aby); O(cmpt_idx); O(cmpt_idy); O(cmpt_imm); O(cmpt_zpg); O(cmpt_zpx);
- O(com_zpg);
- O(dec_acc);
- O(dect_acc);
- O(eort_aba); O(eort_abx); O(eort_aby); O(eort_idx); O(eort_idy); O(eort_imm); O(eort_zpg); O(eort_zpx);
- O(inc_acc);
- O(inct_acc);
- O(ldt_aba); O(ldt_abx); O(ldt_aby); O(ldt_idx); O(ldt_idy); O(ldt_imm); O(ldt_zpg); O(ldt_zpx);
- O(ort_aba); O(ort_abx); O(ort_aby); O(ort_imm); O(ort_idx); O(ort_idy); O(ort_zpg); O(ort_zpx);
- O(sbct_aba); O(sbct_abx); O(sbct_aby); O(sbct_idx); O(sbct_idy); O(sbct_imm); O(sbct_zpg); O(sbct_zpx);
-
-#undef O
-
- UINT32 m_irq_multiplex;
- UINT16 m_irq_vector;
-
- void set_irq_line(int line, int state);
-};
-
-extern const device_type M740;
-
-#endif
diff --git a/src/emu/cpu/m6502/m7501.c b/src/emu/cpu/m6502/m7501.c
deleted file mode 100644
index 83bc290a172..00000000000
--- a/src/emu/cpu/m6502/m7501.c
+++ /dev/null
@@ -1,19 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Olivier Galibert
-/***************************************************************************
-
- m7501.c
-
- 6510 derivative, essentially identical. Also known as the 8501.
-
-***************************************************************************/
-
-#include "emu.h"
-#include "m7501.h"
-
-const device_type M7501 = &device_creator<m7501_device>;
-
-m7501_device::m7501_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
- m6510_device(mconfig, M7501, "M7501", tag, owner, clock, "m7501", __FILE__)
-{
-}
diff --git a/src/emu/cpu/m6502/m7501.h b/src/emu/cpu/m6502/m7501.h
deleted file mode 100644
index 7ded4caffe2..00000000000
--- a/src/emu/cpu/m6502/m7501.h
+++ /dev/null
@@ -1,34 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Olivier Galibert
-/***************************************************************************
-
- m7501.h
-
- 6510 derivative, essentially identical. Also known as the 8501.
-
-***************************************************************************/
-
-#ifndef __M7501_H__
-#define __M7501_H__
-
-#include "m6510.h"
-
-#define MCFG_M7501_PORT_CALLBACKS(_read, _write) \
- downcast<m7501_device *>(device)->set_callbacks(DEVCB_##_read, DEVCB_##_write);
-
-#define MCFG_M7501_PORT_PULLS(_up, _down) \
- downcast<m7501_device *>(device)->set_pulls(_up, _down);
-
-class m7501_device : public m6510_device {
-public:
- m7501_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-};
-
-enum {
- M7501_IRQ_LINE = m6502_device::IRQ_LINE,
- M7501_NMI_LINE = m6502_device::NMI_LINE
-};
-
-extern const device_type M7501;
-
-#endif
diff --git a/src/emu/cpu/m6502/m8502.c b/src/emu/cpu/m6502/m8502.c
deleted file mode 100644
index a967d03d74c..00000000000
--- a/src/emu/cpu/m6502/m8502.c
+++ /dev/null
@@ -1,19 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Olivier Galibert
-/***************************************************************************
-
- m8502.c
-
- 6510 derivative, capable of running at 2MHz.
-
-***************************************************************************/
-
-#include "emu.h"
-#include "m8502.h"
-
-const device_type M8502 = &device_creator<m8502_device>;
-
-m8502_device::m8502_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
- m6510_device(mconfig, M8502, "M8502", tag, owner, clock, "m8502", __FILE__)
-{
-}
diff --git a/src/emu/cpu/m6502/m8502.h b/src/emu/cpu/m6502/m8502.h
deleted file mode 100644
index 1969ba6ffad..00000000000
--- a/src/emu/cpu/m6502/m8502.h
+++ /dev/null
@@ -1,34 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Olivier Galibert
-/***************************************************************************
-
- m8502.h
-
- 6510 derivative, capable of running at 2MHz.
-
-***************************************************************************/
-
-#ifndef __M8502_H__
-#define __M8502_H__
-
-#include "m6510.h"
-
-#define MCFG_M8502_PORT_CALLBACKS(_read, _write) \
- downcast<m8502_device *>(device)->set_callbacks(DEVCB_##_read, DEVCB_##_write);
-
-#define MCFG_M8502_PORT_PULLS(_up, _down) \
- downcast<m8502_device *>(device)->set_pulls(_up, _down);
-
-class m8502_device : public m6510_device {
-public:
- m8502_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-};
-
-enum {
- M8502_IRQ_LINE = m6502_device::IRQ_LINE,
- M8502_NMI_LINE = m6502_device::NMI_LINE
-};
-
-extern const device_type M8502;
-
-#endif
diff --git a/src/emu/cpu/m6502/n2a03.c b/src/emu/cpu/m6502/n2a03.c
deleted file mode 100644
index b3b2cb31808..00000000000
--- a/src/emu/cpu/m6502/n2a03.c
+++ /dev/null
@@ -1,76 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Olivier Galibert
-/***************************************************************************
-
- m6502.c
-
- 6502, NES variant
-
-***************************************************************************/
-
-#include "emu.h"
-#include "n2a03.h"
-
-const device_type N2A03 = &device_creator<n2a03_device>;
-
-n2a03_device::n2a03_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
- m6502_device(mconfig, N2A03, "N2A03", tag, owner, clock, "n2a03", __FILE__)
-{
-}
-
-offs_t n2a03_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options)
-{
- return disassemble_generic(buffer, pc, oprom, opram, options, disasm_entries);
-}
-
-void n2a03_device::device_start()
-{
- if(direct_disabled)
- mintf = new mi_2a03_nd;
- else
- mintf = new mi_2a03_normal;
-
- init();
-}
-
-UINT8 n2a03_device::mi_2a03_normal::read(UINT16 adr)
-{
- return program->read_byte(adr);
-}
-
-UINT8 n2a03_device::mi_2a03_normal::read_sync(UINT16 adr)
-{
- return sdirect->read_byte(adr);
-}
-
-UINT8 n2a03_device::mi_2a03_normal::read_arg(UINT16 adr)
-{
- return direct->read_byte(adr);
-}
-
-void n2a03_device::mi_2a03_normal::write(UINT16 adr, UINT8 val)
-{
- program->write_byte(adr, val);
-}
-
-UINT8 n2a03_device::mi_2a03_nd::read(UINT16 adr)
-{
- return program->read_byte(adr);
-}
-
-UINT8 n2a03_device::mi_2a03_nd::read_sync(UINT16 adr)
-{
- return sprogram->read_byte(adr);
-}
-
-UINT8 n2a03_device::mi_2a03_nd::read_arg(UINT16 adr)
-{
- return program->read_byte(adr);
-}
-
-void n2a03_device::mi_2a03_nd::write(UINT16 adr, UINT8 val)
-{
- program->write_byte(adr, val);
-}
-
-#include "cpu/m6502/n2a03.inc"
diff --git a/src/emu/cpu/m6502/n2a03.h b/src/emu/cpu/m6502/n2a03.h
deleted file mode 100644
index 6d56a42e9b7..00000000000
--- a/src/emu/cpu/m6502/n2a03.h
+++ /dev/null
@@ -1,70 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Olivier Galibert
-/***************************************************************************
-
- n2a03.h
-
- 6502, NES variant
-
-***************************************************************************/
-
-#ifndef __N2A03_H__
-#define __N2A03_H__
-
-#include "m6502.h"
-
-class n2a03_device : public m6502_device {
-public:
- n2a03_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
- static const disasm_entry disasm_entries[0x100];
-
- virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options);
- virtual void do_exec_full();
- virtual void do_exec_partial();
-
-protected:
- class mi_2a03_normal : public memory_interface {
- public:
- virtual ~mi_2a03_normal() {}
- virtual UINT8 read(UINT16 adr);
- virtual UINT8 read_sync(UINT16 adr);
- virtual UINT8 read_arg(UINT16 adr);
- virtual void write(UINT16 adr, UINT8 val);
- };
-
- class mi_2a03_nd : public memory_interface {
- public:
- virtual ~mi_2a03_nd() {}
- virtual UINT8 read(UINT16 adr);
- virtual UINT8 read_sync(UINT16 adr);
- virtual UINT8 read_arg(UINT16 adr);
- virtual void write(UINT16 adr, UINT8 val);
- };
-
- virtual void device_start();
-
-#define O(o) void o ## _full(); void o ## _partial()
-
- // n2a03 opcodes - same as 6502 with D disabled
- O(adc_nd_aba); O(adc_nd_abx); O(adc_nd_aby); O(adc_nd_idx); O(adc_nd_idy); O(adc_nd_imm); O(adc_nd_zpg); O(adc_nd_zpx);
- O(arr_nd_imm);
- O(isb_nd_aba); O(isb_nd_abx); O(isb_nd_aby); O(isb_nd_idx); O(isb_nd_idy); O(isb_nd_zpg); O(isb_nd_zpx);
- O(rra_nd_aba); O(rra_nd_abx); O(rra_nd_aby); O(rra_nd_idx); O(rra_nd_idy); O(rra_nd_zpg); O(rra_nd_zpx);
- O(sbc_nd_aba); O(sbc_nd_abx); O(sbc_nd_aby); O(sbc_nd_idx); O(sbc_nd_idy); O(sbc_nd_imm); O(sbc_nd_zpg); O(sbc_nd_zpx);
-
-#undef O
-};
-
-#define N2A03_DEFAULTCLOCK (21477272.724 / 12)
-
-enum {
- N2A03_IRQ_LINE = m6502_device::IRQ_LINE,
- N2A03_APU_IRQ_LINE = m6502_device::APU_IRQ_LINE,
- N2A03_NMI_LINE = m6502_device::NMI_LINE,
- N2A03_SET_OVERFLOW = m6502_device::V_LINE
-};
-
-extern const device_type N2A03;
-
-#endif
diff --git a/src/emu/cpu/m6502/odeco16.lst b/src/emu/cpu/m6502/odeco16.lst
deleted file mode 100644
index 6cea2fa7282..00000000000
--- a/src/emu/cpu/m6502/odeco16.lst
+++ /dev/null
@@ -1,101 +0,0 @@
-# deco 16 opcodes
-brk_16_imp
- // The 6502 bug when a nmi occurs in a brk is reproduced (case !irq_taken && nmi_state)
- if(irq_taken) {
- read_pc_noinc();
- } else {
- read_pc();
- }
- write(SP, PC >> 8);
- dec_SP();
- write(SP, PC);
- dec_SP();
- write(SP, irq_taken ? P & ~F_B : P);
- dec_SP();
- if(nmi_state) {
- PC = read_arg(0xfff7);
- PC = set_h(PC, read_arg(0xfff6));
- nmi_state = false;
- standard_irq_callback(NMI_LINE);
- } else {
- PC = read_arg(0xfff3);
- PC = set_h(PC, read_arg(0xfff2));
- if(irq_taken)
- standard_irq_callback(IRQ_LINE);
- }
- irq_taken = false;
- P |= F_I; // Do *not* move after the prefetch
- prefetch();
- inst_state = -1;
-
-ill_non
- logerror("%s: Unimplemented instruction %02x\n", tag(), inst_state);
- prefetch();
-
-u0B_zpg
- TMP2 = read_pc();
- if(DECO16_VERBOSE)
- logerror("%s: OP0B %02x (%04x)\n", tag(), NPC, TMP2);
- prefetch();
-
-u13_zpg
- TMP2 = read_pc();
- if(DECO16_VERBOSE)
- logerror("%s: OP13 %02x (%04x)\n", tag(), NPC, TMP2);
- prefetch();
-
-u23_zpg
- TMP2 = read_pc();
- if(DECO16_VERBOSE)
- logerror("%s: OP23 %02x (%04x)\n", tag(), NPC, TMP2);
- prefetch();
-
-u3F_zpg
- TMP2 = read_pc();
- if(DECO16_VERBOSE)
- logerror("%s: OPBB %02x (%04x)\n", tag(), NPC, TMP2);
- prefetch();
-
-u4B_zpg
- TMP2 = read_pc();
- A = io->read_byte(1);
- prefetch();
-
-u87_zpg
- TMP2 = read_pc();
- if(DECO16_VERBOSE)
- logerror("%s: OP87 %02x (%04x)\n", tag(), NPC, TMP2);
- prefetch();
-
-u8F_zpg
- TMP2 = read_pc();
- if(DECO16_VERBOSE)
- logerror("%s: OP8F (BANK) %02x (%04x)\n", tag(), NPC, TMP2);
- io->write_byte(0, TMP2);
- prefetch();
-
-uA3_zpg
- TMP2 = read_pc();
- if(DECO16_VERBOSE)
- logerror("%s: OPA3 %02x (%04x)\n", tag(), NPC, TMP2);
- prefetch();
-
-uBB_zpg
- TMP2 = read_pc();
- if(DECO16_VERBOSE)
- logerror("%s: OPBB %02x (%04x)\n", tag(), NPC, TMP2);
- prefetch();
-
-vbl_zpg
- TMP2 = read_pc();
- A = io->read_byte(0);
- if(DECO16_VERBOSE)
- logerror("%s: VBL %02x (%04x)\n", tag(), NPC, TMP2);
- prefetch();
-
-# exceptions
-reset_16
- PC = read_arg(0xfff1);
- PC = set_h(PC, read_arg(0xfff0));
- prefetch();
- inst_state = -1;
diff --git a/src/emu/cpu/m6502/om4510.lst b/src/emu/cpu/m6502/om4510.lst
deleted file mode 100644
index fbe49491fac..00000000000
--- a/src/emu/cpu/m6502/om4510.lst
+++ /dev/null
@@ -1,21 +0,0 @@
-# 4510 opcodes
-
-eom_imp
- inhibit_interrupts = false; // before or after prefetch?
- prefetch();
-
-map_imp
- inhibit_interrupts = true;
- map_offset[0] = (A<<8) | ((X & 0xf) << 16);
- map_offset[1] = (Y<<8) | ((Z & 0xf) << 16);
- map_enable = ((X & 0xf0) >> 4) | (Z & 0xf0);
- logerror("MAP execute\n");
- logerror("0x0000 - 0x1fff = %08x\n",map_enable & 1 ? map_offset[0]+0x0000 : 0x0000);
- logerror("0x2000 - 0x3fff = %08x\n",map_enable & 2 ? map_offset[0]+0x2000 : 0x2000);
- logerror("0x4000 - 0x5fff = %08x\n",map_enable & 4 ? map_offset[0]+0x4000 : 0x4000);
- logerror("0x6000 - 0x7fff = %08x\n",map_enable & 8 ? map_offset[0]+0x6000 : 0x6000);
- logerror("0x8000 - 0x9fff = %08x\n",map_enable & 16 ? map_offset[1]+0x8000 : 0x8000);
- logerror("0xa000 - 0xbfff = %08x\n",map_enable & 32 ? map_offset[1]+0xa000 : 0xa000);
- logerror("0xc000 - 0xdfff = %08x\n",map_enable & 64 ? map_offset[1]+0xc000 : 0xc000);
- logerror("0xe000 - 0xffff = %08x\n",map_enable & 128 ? map_offset[1]+0xe000 : 0xe000);
- prefetch();
diff --git a/src/emu/cpu/m6502/om6502.lst b/src/emu/cpu/m6502/om6502.lst
deleted file mode 100644
index 24c560c02fa..00000000000
--- a/src/emu/cpu/m6502/om6502.lst
+++ /dev/null
@@ -1,1964 +0,0 @@
-# NMOS 6502 opcodes
-# Verified with visual6502
-# documented opcodes
-
-adc_aba
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP = read(TMP);
- do_adc(TMP);
- prefetch();
-
-adc_abx
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- if(page_changing(TMP, X)) {
- read(set_l(TMP, TMP+X));
- }
- TMP += X;
- TMP = read(TMP);
- do_adc(TMP);
- prefetch();
-
-adc_aby
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- if(page_changing(TMP, Y)) {
- read(set_l(TMP, TMP+Y));
- }
- TMP += Y;
- TMP = read(TMP);
- do_adc(TMP);
- prefetch();
-
-adc_idx
- TMP2 = read_pc();
- read(TMP2);
- TMP2 += X;
- TMP = read(TMP2 & 0xff);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- do_adc(read(TMP));
- prefetch();
-
-adc_idy
- TMP2 = read_pc();
- TMP = read(TMP2);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- if(page_changing(TMP, Y)) {
- read(set_l(TMP, TMP+Y));
- }
- do_adc(read(TMP+Y));
- prefetch();
-
-adc_imm
- TMP = read_pc();
- do_adc(TMP);
- prefetch();
-
-adc_zpg
- TMP = read_pc();
- TMP = read(TMP);
- do_adc(TMP);
- prefetch();
-
-adc_zpx
- TMP = read_pc();
- read(TMP);
- TMP = read(UINT8(TMP+X));
- do_adc(TMP);
- prefetch();
-
-and_aba
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- A &= read(TMP);
- set_nz(A);
- prefetch();
-
-and_abx
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- if(page_changing(TMP, X)) {
- read(set_l(TMP, TMP+X));
- }
- TMP += X;
- A &= read(TMP);
- set_nz(A);
- prefetch();
-
-and_aby
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- if(page_changing(TMP, Y)) {
- read(set_l(TMP, TMP+Y));
- }
- TMP += Y;
- A &= read(TMP);
- set_nz(A);
- prefetch();
-
-and_imm
- A &= read_pc();
- set_nz(A);
- prefetch();
-
-and_idx
- TMP2 = read_pc();
- read(TMP2);
- TMP2 += X;
- TMP = read(TMP2 & 0xff);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- A &= read(TMP);
- set_nz(A);
- prefetch();
-
-and_idy
- TMP2 = read_pc();
- TMP = read(TMP2);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- if(page_changing(TMP, Y)) {
- read(set_l(TMP, TMP+Y));
- }
- A &= read(TMP+Y);
- set_nz(A);
- prefetch();
-
-and_zpg
- TMP = read_pc();
- A &= read(TMP);
- set_nz(A);
- prefetch();
-
-and_zpx
- TMP = read_pc();
- read(TMP);
- A &= read(UINT8(TMP+X));
- set_nz(A);
- prefetch();
-
-asl_aba
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2 = do_asl(TMP2);
- write(TMP, TMP2);
- prefetch();
-
-asl_abx
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- read(set_l(TMP, TMP+X));
- TMP += X;
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2 = do_asl(TMP2);
- write(TMP, TMP2);
- prefetch();
-
-asl_acc
- read_pc_noinc();
- A = do_asl(A);
- prefetch();
-
-asl_zpg
- TMP = read_pc();
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2 = do_asl(TMP2);
- write(TMP, TMP2);
- prefetch();
-
-asl_zpx
- TMP = read_pc();
- read(TMP);
- TMP = UINT8(TMP+X);
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2 = do_asl(TMP2);
- write(TMP, TMP2);
- prefetch();
-
-bcc_rel
- TMP = read_pc();
- if(!(P & F_C)) {
- read_pc_noinc();
- if(page_changing(PC, INT8(TMP))) {
- read_arg(set_l(PC, PC+INT8(TMP)));
- }
- PC += INT8(TMP);
- }
- prefetch();
-
-bcs_rel
- TMP = read_pc();
- if(P & F_C) {
- read_pc_noinc();
- if(page_changing(PC, INT8(TMP))) {
- read_arg(set_l(PC, PC+INT8(TMP)));
- }
- PC += INT8(TMP);
- }
- prefetch();
-
-beq_rel
- TMP = read_pc();
- if(P & F_Z) {
- read_pc_noinc();
- if(page_changing(PC, INT8(TMP))) {
- read_arg(set_l(PC, PC+INT8(TMP)));
- }
- PC += INT8(TMP);
- }
- prefetch();
-
-bit_aba
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- do_bit(read(TMP));
- prefetch();
-
-bit_zpg
- TMP = read_pc();
- do_bit(read(TMP));
- prefetch();
-
-bmi_rel
- TMP = read_pc();
- if(P & F_N) {
- read_pc_noinc();
- if(page_changing(PC, INT8(TMP))) {
- read_arg(set_l(PC, PC+INT8(TMP)));
- }
- PC += INT8(TMP);
- }
- prefetch();
-
-bne_rel
- TMP = read_pc();
- if(!(P & F_Z)) {
- read_pc_noinc();
- if(page_changing(PC, INT8(TMP))) {
- read_arg(set_l(PC, PC+INT8(TMP)));
- }
- PC += INT8(TMP);
- }
- prefetch();
-
-bpl_rel
- TMP = read_pc();
- if(!(P & F_N)) {
- read_pc_noinc();
- if(page_changing(PC, INT8(TMP))) {
- read_arg(set_l(PC, PC+INT8(TMP)));
- }
- PC += INT8(TMP);
- }
- prefetch();
-
-brk_imp
- // The 6502 bug when a nmi occurs in a brk is reproduced (case !irq_taken && nmi_state)
- if(irq_taken) {
- read_pc_noinc();
- } else {
- read_pc();
- }
- write(SP, PC >> 8);
- dec_SP();
- write(SP, PC);
- dec_SP();
- write(SP, irq_taken ? P & ~F_B : P);
- dec_SP();
- if(nmi_state) {
- PC = read_arg(0xfffa);
- PC = set_h(PC, read_arg(0xfffb));
- nmi_state = false;
- standard_irq_callback(NMI_LINE);
- } else {
- PC = read_arg(0xfffe);
- PC = set_h(PC, read_arg(0xffff));
- if(irq_taken)
- standard_irq_callback(IRQ_LINE);
- }
- irq_taken = false;
- P |= F_I; // Do *not* move after the prefetch
- prefetch();
- inst_state = -1;
-
-bvc_rel
- TMP = read_pc();
- if(!(P & F_V)) {
- read_pc_noinc();
- if(page_changing(PC, INT8(TMP))) {
- read_arg(set_l(PC, PC+INT8(TMP)));
- }
- PC += INT8(TMP);
- }
- prefetch();
-
-bvs_rel
- TMP = read_pc();
- if(P & F_V) {
- read_pc_noinc();
- if(page_changing(PC, INT8(TMP))) {
- read_arg(set_l(PC, PC+INT8(TMP)));
- }
- PC += INT8(TMP);
- }
- prefetch();
-
-clc_imp
- read_pc_noinc();
- P &= ~F_C;
- prefetch();
-
-cld_imp
- read_pc_noinc();
- P &= ~F_D;
- prefetch();
-
-cli_imp
- read_pc_noinc();
- prefetch();
- P &= ~F_I; // Do *not* move it before the prefetch
-
-clv_imp
- read_pc_noinc();
- P &= ~F_V;
- prefetch();
-
-cmp_aba
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP = read(TMP);
- do_cmp(A, TMP);
- prefetch();
-
-cmp_abx
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- if(page_changing(TMP, X)) {
- read(set_l(TMP, TMP+X));
- }
- TMP += X;
- TMP = read(TMP);
- do_cmp(A, TMP);
- prefetch();
-
-cmp_aby
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- if(page_changing(TMP, Y)) {
- read(set_l(TMP, TMP+Y));
- }
- TMP += Y;
- TMP = read(TMP);
- do_cmp(A, TMP);
- prefetch();
-
-cmp_idx
- TMP2 = read_pc();
- read(TMP2);
- TMP2 += X;
- TMP = read(TMP2 & 0xff);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- do_cmp(A, read(TMP));
- prefetch();
-
-cmp_idy
- TMP2 = read_pc();
- TMP = read(TMP2);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- if(page_changing(TMP, Y)) {
- read(set_l(TMP, TMP+Y));
- }
- do_cmp(A, read(TMP+Y));
- prefetch();
-
-cmp_imm
- TMP = read_pc();
- do_cmp(A, TMP);
- prefetch();
-
-cmp_zpg
- TMP = read_pc();
- TMP = read(TMP);
- do_cmp(A, TMP);
- prefetch();
-
-cmp_zpx
- TMP = read_pc();
- read(TMP);
- TMP = read(UINT8(TMP+X));
- do_cmp(A, TMP);
- prefetch();
-
-cpx_aba
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP = read(TMP);
- do_cmp(X, TMP);
- prefetch();
-
-cpx_imm
- TMP = read_pc();
- do_cmp(X, TMP);
- prefetch();
-
-cpx_zpg
- TMP = read_pc();
- TMP = read(TMP);
- do_cmp(X, TMP);
- prefetch();
-
-cpy_aba
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP = read(TMP);
- do_cmp(Y, TMP);
- prefetch();
-
-cpy_imm
- TMP = read_pc();
- do_cmp(Y, TMP);
- prefetch();
-
-cpy_zpg
- TMP = read_pc();
- TMP = read(TMP);
- do_cmp(Y, TMP);
- prefetch();
-
-dec_aba
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2--;
- set_nz(TMP2);
- write(TMP, TMP2);
- prefetch();
-
-dec_abx
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- read(set_l(TMP, TMP+X));
- TMP += X;
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2--;
- set_nz(TMP2);
- write(TMP, TMP2);
- prefetch();
-
-dec_zpg
- TMP = read_pc();
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2--;
- set_nz(TMP2);
- write(TMP, TMP2);
- prefetch();
-
-dec_zpx
- TMP = read_pc();
- read(TMP);
- TMP = UINT8(TMP+X);
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2--;
- set_nz(TMP2);
- write(TMP, TMP2);
- prefetch();
-
-dex_imp
- read_pc_noinc();
- X--;
- set_nz(X);
- prefetch();
-
-dey_imp
- read_pc_noinc();
- Y--;
- set_nz(Y);
- prefetch();
-
-eor_aba
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- A ^= read(TMP);
- set_nz(A);
- prefetch();
-
-eor_abx
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- if(page_changing(TMP, X)) {
- read(set_l(TMP, TMP+X));
- }
- TMP += X;
- A ^= read(TMP);
- set_nz(A);
- prefetch();
-
-eor_aby
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- if(page_changing(TMP, Y)) {
- read(set_l(TMP, TMP+Y));
- }
- TMP += Y;
- A ^= read(TMP);
- set_nz(A);
- prefetch();
-
-eor_idx
- TMP2 = read_pc();
- read(TMP2);
- TMP2 += X;
- TMP = read(TMP2 & 0xff);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- A ^= read(TMP);
- set_nz(A);
- prefetch();
-
-eor_idy
- TMP2 = read_pc();
- TMP = read(TMP2);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- if(page_changing(TMP, Y)) {
- read(set_l(TMP, TMP+Y));
- }
- A ^= read(TMP+Y);
- set_nz(A);
- prefetch();
-
-eor_imm
- A ^= read_pc();
- set_nz(A);
- prefetch();
-
-eor_zpg
- TMP = read_pc();
- A ^= read(TMP);
- set_nz(A);
- prefetch();
-
-eor_zpx
- TMP = read_pc();
- read(TMP);
- A ^= read(UINT8(TMP+X));
- set_nz(A);
- prefetch();
-
-inc_aba
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2++;
- set_nz(TMP2);
- write(TMP, TMP2);
- prefetch();
-
-inc_abx
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- read(set_l(TMP, TMP+X));
- TMP += X;
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2++;
- set_nz(TMP2);
- write(TMP, TMP2);
- prefetch();
-
-inc_zpg
- TMP = read_pc();
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2++;
- set_nz(TMP2);
- write(TMP, TMP2);
- prefetch();
-
-inc_zpx
- TMP = read_pc();
- read(TMP);
- TMP = UINT8(TMP+X);
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2++;
- set_nz(TMP2);
- write(TMP, TMP2);
- prefetch();
-
-inx_imp
- read_pc_noinc();
- X++;
- set_nz(X);
- prefetch();
-
-iny_imp
- read_pc_noinc();
- Y++;
- set_nz(Y);
- prefetch();
-
-jmp_adr
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- PC = TMP;
- prefetch();
-
-jmp_ind
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- PC = read(TMP);
- PC = set_h(PC, read(set_l(TMP, TMP+1)));
- prefetch();
-
-jsr_adr
- TMP = read_pc();
- read(SP);
- write(SP, PC>>8);
- dec_SP();
- write(SP, PC);
- dec_SP();
- TMP = set_h(TMP, read_pc());
- PC = TMP;
- prefetch();
-
-lda_aba
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- A = read(TMP);
- set_nz(A);
- prefetch();
-
-lda_abx
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- if(page_changing(TMP, X)) {
- read(set_l(TMP, TMP+X));
- }
- A = read(TMP + X);
- set_nz(A);
- prefetch();
-
-lda_aby
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- if(page_changing(TMP, Y)) {
- read(set_l(TMP, TMP+Y));
- }
- A = read(TMP + Y);
- set_nz(A);
- prefetch();
-
-lda_idx
- TMP2 = read_pc();
- read(TMP2);
- TMP2 += X;
- TMP = read(TMP2 & 0xff);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- A = read(TMP);
- set_nz(A);
- prefetch();
-
-lda_idy
- TMP2 = read_pc();
- TMP = read(TMP2);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- if(page_changing(TMP, Y)) {
- read(set_l(TMP, TMP+Y));
- }
- A = read(TMP+Y);
- set_nz(A);
- prefetch();
-
-lda_imm
- A = read_pc();
- set_nz(A);
- prefetch();
-
-lda_zpg
- TMP = read_pc();
- A = read(TMP);
- set_nz(A);
- prefetch();
-
-lda_zpx
- TMP = read_pc();
- read(TMP);
- A = read(UINT8(TMP+X));
- set_nz(A);
- prefetch();
-
-ldx_aba
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- X = read(TMP);
- set_nz(X);
- prefetch();
-
-ldx_aby
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- if(page_changing(TMP, Y)) {
- read(set_l(TMP, TMP+Y));
- }
- X = read(TMP + Y);
- set_nz(X);
- prefetch();
-
-ldx_imm
- X = read_pc();
- set_nz(X);
- prefetch();
-
-ldx_zpg
- TMP = read_pc();
- X = read(TMP);
- set_nz(X);
- prefetch();
-
-ldx_zpy
- TMP = read_pc();
- read(TMP);
- X = read(UINT8(TMP+Y));
- set_nz(X);
- prefetch();
-
-ldy_aba
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- Y = read(TMP);
- set_nz(Y);
- prefetch();
-
-ldy_abx
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- if(page_changing(TMP, X)) {
- read(set_l(TMP, TMP+X));
- }
- TMP += X;
- Y = read(TMP);
- set_nz(Y);
- prefetch();
-
-ldy_imm
- Y = read_pc();
- set_nz(Y);
- prefetch();
-
-ldy_zpg
- TMP = read_pc();
- Y = read(TMP);
- set_nz(Y);
- prefetch();
-
-ldy_zpx
- TMP = read_pc();
- read(TMP);
- Y = read(UINT8(TMP+X));
- set_nz(Y);
- prefetch();
-
-lsr_aba
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2 = do_lsr(TMP2);
- write(TMP, TMP2);
- prefetch();
-
-lsr_abx
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- read(set_l(TMP, TMP+X));
- TMP += X;
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2 = do_lsr(TMP2);
- write(TMP, TMP2);
- prefetch();
-
-lsr_acc
- read_pc_noinc();
- A = do_lsr(A);
- prefetch();
-
-lsr_zpg
- TMP = read_pc();
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2 = do_lsr(TMP2);
- write(TMP, TMP2);
- prefetch();
-
-lsr_zpx
- TMP = read_pc();
- read(TMP);
- TMP = UINT8(TMP+X);
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2 = do_lsr(TMP2);
- write(TMP, TMP2);
- prefetch();
-
-nop_imp
- read_pc_noinc();
- prefetch();
-
-ora_aba
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- A |= read(TMP);
- set_nz(A);
- prefetch();
-
-ora_abx
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- if(page_changing(TMP, X)) {
- read(set_l(TMP, TMP+X));
- }
- TMP += X;
- A |= read(TMP);
- set_nz(A);
- prefetch();
-
-ora_aby
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- if(page_changing(TMP, Y)) {
- read(set_l(TMP, TMP+Y));
- }
- TMP += Y;
- A |= read(TMP);
- set_nz(A);
- prefetch();
-
-ora_imm
- A |= read_pc();
- set_nz(A);
- prefetch();
-
-ora_idx
- TMP2 = read_pc();
- read(TMP2);
- TMP2 += X;
- TMP = read(TMP2 & 0xff);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- A |= read(TMP);
- set_nz(A);
- prefetch();
-
-ora_idy
- TMP2 = read_pc();
- TMP = read(TMP2);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- if(page_changing(TMP, Y)) {
- read(set_l(TMP, TMP+Y));
- }
- A |= read(TMP+Y);
- set_nz(A);
- prefetch();
-
-ora_zpg
- TMP = read_pc();
- A |= read(TMP);
- set_nz(A);
- prefetch();
-
-ora_zpx
- TMP = read_pc();
- read(TMP);
- A |= read(UINT8(TMP+X));
- set_nz(A);
- prefetch();
-
-pha_imp
- read_pc_noinc();
- write(SP, A);
- dec_SP();
- prefetch();
-
-php_imp
- read_pc_noinc();
- write(SP, P);
- dec_SP();
- prefetch();
-
-pla_imp
- read_pc_noinc();
- read(SP);
- inc_SP();
- A = read(SP);
- set_nz(A);
- prefetch();
-
-plp_imp
- read_pc_noinc();
- read(SP);
- inc_SP();
- TMP = read(SP) | (F_B|F_E);
- prefetch();
- P = TMP; // Do *not* move it before the prefetch
-
-rol_aba
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2 = do_rol(TMP2);
- write(TMP, TMP2);
- prefetch();
-
-rol_abx
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- read(set_l(TMP, TMP+X));
- TMP += X;
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2 = do_rol(TMP2);
- write(TMP, TMP2);
- prefetch();
-
-rol_acc
- read_pc_noinc();
- A = do_rol(A);
- prefetch();
-
-rol_zpg
- TMP = read_pc();
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2 = do_rol(TMP2);
- write(TMP, TMP2);
- prefetch();
-
-rol_zpx
- TMP = read_pc();
- read(TMP);
- TMP = UINT8(TMP+X);
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2 = do_rol(TMP2);
- write(TMP, TMP2);
- prefetch();
-
-ror_aba
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2 = do_ror(TMP2);
- write(TMP, TMP2);
- prefetch();
-
-ror_abx
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- read(set_l(TMP, TMP+X));
- TMP += X;
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2 = do_ror(TMP2);
- write(TMP, TMP2);
- prefetch();
-
-ror_acc
- read_pc_noinc();
- A = do_ror(A);
- prefetch();
-
-ror_zpg
- TMP = read_pc();
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2 = do_ror(TMP2);
- write(TMP, TMP2);
- prefetch();
-
-ror_zpx
- TMP = read_pc();
- read(TMP);
- TMP = UINT8(TMP+X);
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2 = do_ror(TMP2);
- write(TMP, TMP2);
- prefetch();
-
-rti_imp
- read_pc_noinc();
- read(SP);
- inc_SP();
- P = read(SP) | (F_B|F_E);
- inc_SP();
- PC = read(SP);
- inc_SP();
- PC = set_h(PC, read(SP));
- prefetch();
-
-rts_imp
- read_pc_noinc();
- read(SP);
- inc_SP();
- PC = read(SP);
- inc_SP();
- PC = set_h(PC, read(SP));
- read_pc();
- prefetch();
-
-sbc_aba
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP = read(TMP);
- do_sbc(TMP);
- prefetch();
-
-sbc_abx
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- if(page_changing(TMP, X)) {
- read(set_l(TMP, TMP+X));
- }
- TMP += X;
- TMP = read(TMP);
- do_sbc(TMP);
- prefetch();
-
-sbc_aby
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- if(page_changing(TMP, Y)) {
- read(set_l(TMP, TMP+Y));
- }
- TMP += Y;
- TMP = read(TMP);
- do_sbc(TMP);
- prefetch();
-
-sbc_idx
- TMP2 = read_pc();
- read(TMP2);
- TMP2 += X;
- TMP = read(TMP2 & 0xff);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- do_sbc(read(TMP));
- prefetch();
-
-sbc_idy
- TMP2 = read_pc();
- TMP = read(TMP2);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- if(page_changing(TMP, Y)) {
- read(set_l(TMP, TMP+Y));
- }
- do_sbc(read(TMP+Y));
- prefetch();
-
-sbc_imm
- TMP = read_pc();
- do_sbc(TMP);
- prefetch();
-
-sbc_zpg
- TMP = read_pc();
- TMP = read(TMP);
- do_sbc(TMP);
- prefetch();
-
-sbc_zpx
- TMP = read_pc();
- read(TMP);
- TMP = read(UINT8(TMP+X));
- do_sbc(TMP);
- prefetch();
-
-sec_imp
- read_pc_noinc();
- P |= F_C;
- prefetch();
-
-sed_imp
- read_pc_noinc();
- P |= F_D;
- prefetch();
-
-sei_imp
- read_pc_noinc();
- prefetch();
- P |= F_I; // Do *not* move it before the prefetch
-
-sta_aba
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- write(TMP, A);
- prefetch();
-
-sta_abx
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- read(set_l(TMP, TMP+X));
- write(TMP+X, A);
- prefetch();
-
-sta_aby
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- read(set_l(TMP, TMP+Y));
- write(TMP+Y, A);
- prefetch();
-
-sta_idx
- TMP2 = read_pc();
- read(TMP2);
- TMP2 += X;
- TMP = read(TMP2 & 0xff);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- write(TMP, A);
- prefetch();
-
-sta_idy
- TMP2 = read_pc();
- TMP = read(TMP2);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- read(set_l(TMP, TMP+Y));
- write(TMP+Y, A);
- prefetch();
-
-sta_zpg
- TMP = read_pc();
- write(TMP, A);
- prefetch();
-
-sta_zpx
- TMP = read_pc();
- read(TMP);
- write(UINT8(TMP+X), A);
- prefetch();
-
-stx_aba
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- write(TMP, X);
- prefetch();
-
-stx_zpg
- TMP = read_pc();
- write(TMP, X);
- prefetch();
-
-stx_zpy
- TMP = read_pc();
- read(TMP);
- write(UINT8(TMP+Y), X);
- prefetch();
-
-sty_aba
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- write(TMP, Y);
- prefetch();
-
-sty_zpg
- TMP = read_pc();
- write(TMP, Y);
- prefetch();
-
-sty_zpx
- TMP = read_pc();
- read(TMP);
- write(UINT8(TMP+X), Y);
- prefetch();
-
-tax_imp
- read_pc_noinc();
- X = A;
- set_nz(X);
- prefetch();
-
-tay_imp
- read_pc_noinc();
- Y = A;
- set_nz(Y);
- prefetch();
-
-tsx_imp
- read_pc_noinc();
- X = SP;
- set_nz(X);
- prefetch();
-
-txa_imp
- read_pc_noinc();
- A = X;
- set_nz(A);
- prefetch();
-
-txs_imp
- read_pc_noinc();
- SP = set_l(SP, X);
- prefetch();
-
-tya_imp
- read_pc_noinc();
- A = Y;
- set_nz(A);
- prefetch();
-
-# exceptions
-reset
- PC = read_arg(0xfffc);
- PC = set_h(PC, read_arg(0xfffd));
- prefetch();
- inst_state = -1;
-
-
-# undocumented reliable instructions
-dcp_aba
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2--;
- write(TMP, TMP2);
- do_cmp(A, TMP2);
- prefetch();
-
-dcp_abx
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- read(set_l(TMP, TMP+X));
- TMP += X;
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2--;
- write(TMP, TMP2);
- do_cmp(A, TMP2);
- prefetch();
-
-dcp_aby
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- read(set_l(TMP, TMP+Y));
- TMP += Y;
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2--;
- write(TMP, TMP2);
- do_cmp(A, TMP2);
- prefetch();
-
-dcp_idx
- TMP2 = read_pc();
- read(TMP2);
- TMP2 += X;
- TMP = read(TMP2 & 0xff);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2--;
- write(TMP, TMP2);
- do_cmp(A, TMP2);
- prefetch();
-
-dcp_idy
- TMP2 = read_pc();
- TMP = read(TMP2);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- read(set_l(TMP, TMP+Y));
- TMP += Y;
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2--;
- write(TMP, TMP2);
- do_cmp(A, TMP2);
- prefetch();
-
-dcp_zpg
- TMP = read_pc();
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2--;
- write(TMP, TMP2);
- do_cmp(A, TMP2);
- prefetch();
-
-dcp_zpx
- TMP = read_pc();
- read(TMP);
- TMP = UINT8(TMP+X);
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2--;
- write(TMP, TMP2);
- do_cmp(A, TMP2);
- prefetch();
-
-isb_aba
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2++;
- write(TMP, TMP2);
- do_sbc(TMP2);
- prefetch();
-
-isb_abx
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- read(set_l(TMP, TMP+X));
- TMP += X;
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2++;
- write(TMP, TMP2);
- do_sbc(TMP2);
- prefetch();
-
-isb_aby
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- read(set_l(TMP, TMP+Y));
- TMP += Y;
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2++;
- write(TMP, TMP2);
- do_sbc(TMP2);
- prefetch();
-
-isb_idx
- TMP2 = read_pc();
- read(TMP2);
- TMP2 += X;
- TMP = read(TMP2 & 0xff);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2++;
- write(TMP, TMP2);
- do_sbc(TMP2);
- prefetch();
-
-isb_idy
- TMP2 = read_pc();
- TMP = read(TMP2);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- read(set_l(TMP, TMP+Y));
- TMP += Y;
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2++;
- write(TMP, TMP2);
- do_sbc(TMP2);
- prefetch();
-
-isb_zpg
- TMP = read_pc();
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2++;
- write(TMP, TMP2);
- do_sbc(TMP2);
- prefetch();
-
-isb_zpx
- TMP = read_pc();
- read(TMP);
- TMP = UINT8(TMP+X);
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2++;
- write(TMP, TMP2);
- do_sbc(TMP2);
- prefetch();
-
-lax_aba
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- A = X = read(TMP);
- set_nz(A);
- prefetch();
-
-lax_aby
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- read(set_l(TMP, TMP+Y));
- TMP += Y;
- A = X = read(TMP);
- set_nz(A);
- prefetch();
-
-lax_idx
- TMP2 = read_pc();
- read(TMP2);
- TMP2 += X;
- TMP = read(TMP2 & 0xff);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- A = X = read(TMP);
- set_nz(A);
- prefetch();
-
-lax_idy
- TMP2 = read_pc();
- TMP = read(TMP2);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- if(page_changing(TMP, Y)) {
- read(set_l(TMP, TMP+Y));
- }
- A = X = read(TMP+Y);
- set_nz(A);
- prefetch();
-
-lax_zpg
- TMP = read_pc();
- A = X = read(TMP);
- set_nz(A);
- prefetch();
-
-lax_zpy
- TMP = read_pc();
- read(TMP);
- TMP = UINT8(TMP+Y);
- A = X = read(TMP);
- set_nz(A);
- prefetch();
-
-rla_aba
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2 = do_rol(TMP2);
- write(TMP, TMP2);
- A &= TMP2;
- set_nz(A);
- prefetch();
-
-rla_abx
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- read(set_l(TMP, TMP+X));
- TMP += X;
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2 = do_rol(TMP2);
- write(TMP, TMP2);
- A &= TMP2;
- set_nz(A);
- prefetch();
-
-rla_aby
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- read(set_l(TMP, TMP+Y));
- TMP += Y;
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2 = do_rol(TMP2);
- write(TMP, TMP2);
- A &= TMP2;
- set_nz(A);
- prefetch();
-
-rla_idx
- TMP2 = read_pc();
- read(TMP2);
- TMP2 += X;
- TMP = read(TMP2 & 0xff);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2 = do_rol(TMP2);
- write(TMP, TMP2);
- A &= TMP2;
- set_nz(A);
- prefetch();
-
-rla_idy
- TMP2 = read_pc();
- TMP = read(TMP2);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- read(set_l(TMP, TMP+Y));
- TMP += Y;
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2 = do_rol(TMP2);
- write(TMP, TMP2);
- A &= TMP2;
- set_nz(A);
- prefetch();
-
-rla_zpg
- TMP = read_pc();
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2 = do_rol(TMP2);
- write(TMP, TMP2);
- A &= TMP2;
- set_nz(A);
- prefetch();
-
-rla_zpx
- TMP = read_pc();
- read(TMP);
- TMP = UINT8(TMP+X);
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2 = do_rol(TMP2);
- write(TMP, TMP2);
- A &= TMP2;
- set_nz(A);
- prefetch();
-
-rra_aba
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2 = do_ror(TMP2);
- write(TMP, TMP2);
- do_adc(TMP2);
- prefetch();
-
-rra_abx
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- read(set_l(TMP, TMP+X));
- TMP += X;
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2 = do_ror(TMP2);
- write(TMP, TMP2);
- do_adc(TMP2);
- prefetch();
-
-rra_aby
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- read(set_l(TMP, TMP+Y));
- TMP += Y;
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2 = do_ror(TMP2);
- write(TMP, TMP2);
- do_adc(TMP2);
- prefetch();
-
-rra_idx
- TMP2 = read_pc();
- read(TMP2);
- TMP2 += X;
- TMP = read(TMP2 & 0xff);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2 = do_ror(TMP2);
- write(TMP, TMP2);
- do_adc(TMP2);
- prefetch();
-
-rra_idy
- TMP2 = read_pc();
- TMP = read(TMP2);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- read(set_l(TMP, TMP+Y));
- TMP += Y;
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2 = do_ror(TMP2);
- write(TMP, TMP2);
- do_adc(TMP2);
- prefetch();
-
-rra_zpg
- TMP = read_pc();
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2 = do_ror(TMP2);
- write(TMP, TMP2);
- do_adc(TMP2);
- prefetch();
-
-rra_zpx
- TMP = read_pc();
- read(TMP);
- TMP = UINT8(TMP+X);
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2 = do_ror(TMP2);
- write(TMP, TMP2);
- do_adc(TMP2);
- prefetch();
-
-sax_aba
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP2 = A & X;
- write(TMP, TMP2);
- prefetch();
-
-sax_idx
- TMP2 = read_pc();
- read(TMP2);
- TMP2 += X;
- TMP = read(TMP2 & 0xff);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- TMP2 = A & X;
- write(TMP, TMP2);
- prefetch();
-
-sax_zpg
- TMP = read_pc();
- TMP2 = A & X;
- write(TMP, TMP2);
- prefetch();
-
-sax_zpy
- TMP = read_pc();
- read(TMP);
- TMP = UINT8(TMP+Y);
- TMP2 = A & X;
- write(TMP, TMP2);
- prefetch();
-
-sbx_imm
- TMP2 = read_pc();
- X &= A;
- if(X < TMP2)
- P &= ~F_C;
- else
- P |= F_C;
- X -= TMP2;
- set_nz(X);
- prefetch();
-
-sha_aby
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- read(set_l(TMP, TMP+Y));
- TMP2 = A & X & ((TMP >> 8)+1);
- if(page_changing(TMP, Y))
- TMP = set_h(TMP+Y, TMP2);
- else
- TMP += Y;
- write(TMP, TMP2);
- prefetch();
-
-sha_idy
- TMP2 = read_pc();
- TMP = read(TMP2);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- read(set_l(TMP, TMP+Y));
- TMP2 = A & X & ((TMP >> 8)+1);
- if(page_changing(TMP, Y))
- TMP = set_h(TMP+Y, TMP2);
- else
- TMP += Y;
- write(TMP, TMP2);
- prefetch();
-
-shs_aby
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- read(set_l(TMP, TMP+Y));
- SP = set_l(SP, A & X);
- TMP2 = A & X & ((TMP >> 8)+1);
- if(page_changing(TMP, Y))
- TMP = set_h(TMP+Y, TMP2);
- else
- TMP += Y;
- write(TMP, TMP2);
- prefetch();
-
-shx_aby
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- read(set_l(TMP, TMP+Y));
- TMP2 = X & ((TMP >> 8)+1);
- if(page_changing(TMP, Y))
- TMP = set_h(TMP+Y, TMP2);
- else
- TMP += Y;
- write(TMP, TMP2);
- prefetch();
-
-shy_abx
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- read(set_l(TMP, TMP+X));
- TMP2 = Y & ((TMP >> 8)+1);
- if(page_changing(TMP, X))
- TMP = set_h(TMP+X, TMP2);
- else
- TMP += X;
- write(TMP, TMP2);
- prefetch();
-
-slo_aba
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2 = do_asl(TMP2);
- write(TMP, TMP2);
- A |= TMP2;
- set_nz(A);
- prefetch();
-
-slo_abx
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- read(set_l(TMP, TMP+X));
- TMP += X;
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2 = do_asl(TMP2);
- write(TMP, TMP2);
- A |= TMP2;
- set_nz(A);
- prefetch();
-
-slo_aby
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- read(set_l(TMP, TMP+Y));
- TMP += Y;
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2 = do_asl(TMP2);
- write(TMP, TMP2);
- A |= TMP2;
- set_nz(A);
- prefetch();
-
-slo_idx
- TMP2 = read_pc();
- read(TMP2);
- TMP2 += X;
- TMP = read(TMP2 & 0xff);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2 = do_asl(TMP2);
- write(TMP, TMP2);
- A |= TMP2;
- set_nz(A);
- prefetch();
-
-slo_idy
- TMP2 = read_pc();
- TMP = read(TMP2);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- read(set_l(TMP, TMP+Y));
- TMP += Y;
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2 = do_asl(TMP2);
- write(TMP, TMP2);
- A |= TMP2;
- set_nz(A);
- prefetch();
-
-slo_zpg
- TMP = read_pc();
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2 = do_asl(TMP2);
- write(TMP, TMP2);
- A |= TMP2;
- set_nz(A);
- prefetch();
-
-slo_zpx
- TMP = read_pc();
- read(TMP);
- TMP = UINT8(TMP+X);
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2 = do_asl(TMP2);
- write(TMP, TMP2);
- A |= TMP2;
- set_nz(A);
- prefetch();
-
-sre_aba
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2 = do_lsr(TMP2);
- write(TMP, TMP2);
- A ^= TMP2;
- set_nz(A);
- prefetch();
-
-sre_abx
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- read(set_l(TMP, TMP+X));
- TMP += X;
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2 = do_lsr(TMP2);
- write(TMP, TMP2);
- A ^= TMP2;
- set_nz(A);
- prefetch();
-
-sre_aby
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- read(set_l(TMP, TMP+Y));
- TMP += Y;
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2 = do_lsr(TMP2);
- write(TMP, TMP2);
- A ^= TMP2;
- set_nz(A);
- prefetch();
-
-sre_idx
- TMP2 = read_pc();
- read(TMP2);
- TMP2 += X;
- TMP = read(TMP2 & 0xff);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2 = do_lsr(TMP2);
- write(TMP, TMP2);
- A ^= TMP2;
- set_nz(A);
- prefetch();
-
-sre_idy
- TMP2 = read_pc();
- TMP = read(TMP2);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- read(set_l(TMP, TMP+Y));
- TMP += Y;
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2 = do_lsr(TMP2);
- write(TMP, TMP2);
- A ^= TMP2;
- set_nz(A);
- prefetch();
-
-sre_zpg
- TMP = read_pc();
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2 = do_lsr(TMP2);
- write(TMP, TMP2);
- A ^= TMP2;
- set_nz(A);
- prefetch();
-
-sre_zpx
- TMP = read_pc();
- read(TMP);
- TMP = UINT8(TMP+X);
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2 = do_lsr(TMP2);
- write(TMP, TMP2);
- A ^= TMP2;
- set_nz(A);
- prefetch();
-
-# undocumented unreliable instructions
-anc_imm
- A &= read_pc();
- set_nz(A);
- if(A & 0x80)
- P |= F_C;
- else
- P &= ~F_C;
- prefetch();
-
-ane_imm
- TMP2 = read_pc();
- A &= TMP2 & X;
- set_nz(A);
- prefetch();
-
-asr_imm
- A &= read_pc();
- A = do_lsr(A);
- prefetch();
-
-arr_imm
- A &= read_pc();
- do_arr();
- prefetch();
-
-las_aby
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- if(page_changing(TMP, Y)) {
- read(set_l(TMP, TMP+Y));
- }
- TMP2 = read(TMP+Y);
- A = TMP2 | 0x51;
- X = 0xff;
- set_nz(TMP2);
- prefetch();
-
-lxa_imm
- A = X = read_pc();
- set_nz(A);
- prefetch();
-
-# nop variants
-nop_aba
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- read(TMP);
- prefetch();
-
-nop_abx
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- if(page_changing(TMP, X)) {
- read(set_l(TMP, TMP+X));
- }
- read(TMP + X);
- prefetch();
-
-nop_imm
- read_pc();
- prefetch();
-
-nop_zpg
- TMP = read_pc();
- read(TMP);
- prefetch();
-
-nop_zpx
- TMP = read_pc();
- read(TMP);
- read(UINT8(TMP+X));
- prefetch();
-
-# system killers
-kil_non
- read_pc();
- read(0xffff);
- read(0xfffe);
- read(0xfffe);
- for(;;) {
- read(0xffff);
- }
diff --git a/src/emu/cpu/m6502/om6509.lst b/src/emu/cpu/m6502/om6509.lst
deleted file mode 100644
index 4595827b1d7..00000000000
--- a/src/emu/cpu/m6502/om6509.lst
+++ /dev/null
@@ -1,20 +0,0 @@
-# 6509 opcodes
-
-lda_9_idy
- TMP2 = read_pc();
- TMP = read(TMP2);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- if(page_changing(TMP, Y)) {
- read_9(set_l(TMP, TMP+Y));
- }
- A = read_9(TMP+Y);
- set_nz(A);
- prefetch();
-
-sta_9_idy
- TMP2 = read_pc();
- TMP = read(TMP2);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- read_9(set_l(TMP, TMP+Y));
- write_9(TMP+Y, A);
- prefetch();
diff --git a/src/emu/cpu/m6502/om6510.lst b/src/emu/cpu/m6502/om6510.lst
deleted file mode 100644
index e08a5229111..00000000000
--- a/src/emu/cpu/m6502/om6510.lst
+++ /dev/null
@@ -1,46 +0,0 @@
-# 6510 undocumented instructions in a C64 context
-anc_10_imm
- TMP2 = read_pc();
- A &= TMP2;
- set_nz(A);
- if(A & 0x80)
- P |= F_C;
- else
- P &= ~F_C;
- prefetch();
-
-ane_10_imm
- TMP2 = read_pc();
- A = (A | 0xee) & TMP2 & X;
- set_nz(A);
- prefetch();
-
-asr_10_imm
- TMP2 = read_pc();
- A = do_lsr(A & TMP2);
- set_nz(A);
- prefetch();
-
-arr_10_imm
- TMP2 = read_pc();
- A &= TMP2;
- do_arr();
- prefetch();
-
-las_10_aby
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- if(page_changing(TMP, Y)) {
- read(set_l(TMP, TMP+Y));
- }
- TMP2 = read(TMP+Y);
- A = X = TMP2 & SP;
- SP = set_l(SP, A);
- set_nz(A);
- prefetch();
-
-lxa_10_imm
- TMP2 = read_pc();
- A = X = (A | 0xee) & TMP2;
- set_nz(A);
- prefetch();
diff --git a/src/emu/cpu/m6502/om65c02.lst b/src/emu/cpu/m6502/om65c02.lst
deleted file mode 100644
index d64ddcdc409..00000000000
--- a/src/emu/cpu/m6502/om65c02.lst
+++ /dev/null
@@ -1,584 +0,0 @@
-# m65c02 opcodes
-
-adc_c_aba
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP = read(TMP);
- do_adc(TMP);
- if(P & F_D) {
- read_pc_noinc();
- set_nz(A);
- }
- prefetch();
-
-adc_c_abx
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- if(page_changing(TMP, X)) {
- read(set_l(TMP, TMP+X));
- }
- TMP += X;
- TMP = read(TMP);
- do_adc(TMP);
- if(P & F_D) {
- read_pc_noinc();
- set_nz(A);
- }
- prefetch();
-
-adc_c_aby
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- if(page_changing(TMP, Y)) {
- read(set_l(TMP, TMP+Y));
- }
- TMP += Y;
- TMP = read(TMP);
- do_adc(TMP);
- if(P & F_D) {
- read_pc_noinc();
- set_nz(A);
- }
- prefetch();
-
-adc_c_idx
- TMP2 = read_pc();
- read(TMP2);
- TMP2 += X;
- TMP = read(TMP2 & 0xff);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- do_adc(read(TMP));
- if(P & F_D) {
- read_pc_noinc();
- set_nz(A);
- }
- prefetch();
-
-adc_c_idy
- TMP2 = read_pc();
- TMP = read(TMP2);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- if(page_changing(TMP, Y)) {
- read(set_l(TMP, TMP+Y));
- }
- do_adc(read(TMP+Y));
- if(P & F_D) {
- read_pc_noinc();
- set_nz(A);
- }
- prefetch();
-
-adc_c_imm
- TMP = read_pc();
- do_adc(TMP);
- if(P & F_D) {
- read_pc_noinc();
- set_nz(A);
- }
- prefetch();
-
-adc_c_zpg
- TMP = read_pc();
- TMP = read(TMP);
- do_adc(TMP);
- if(P & F_D) {
- read_pc_noinc();
- set_nz(A);
- }
- prefetch();
-
-adc_c_zpi
- TMP2 = read_pc();
- TMP = read(TMP2 & 0xff);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- do_adc(read(TMP));
- if(P & F_D) {
- read_pc_noinc();
- set_nz(A);
- }
- prefetch();
-
-adc_c_zpx
- TMP = read_pc();
- read(TMP);
- TMP = read(UINT8(TMP+X));
- do_adc(TMP);
- if(P & F_D) {
- read_pc_noinc();
- set_nz(A);
- }
- prefetch();
-
-and_zpi
- TMP2 = read_pc();
- TMP = read(TMP2 & 0xff);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- A &= read(TMP);
- set_nz(A);
- prefetch();
-
-asl_c_abx
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- if(page_changing(TMP, X)) {
- read(set_l(TMP, TMP+X));
- }
- TMP += X;
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2 = do_asl(TMP2);
- write(TMP, TMP2);
- prefetch();
-
-bbr_zpb
- // Access pattern uncertain
- TMP = read_pc();
- TMP2 = read(TMP);
- TMP = read_pc();
- read_pc_noinc();
- if(!(TMP2 & (1 << ((inst_state >> 4) & 7)))) {
- PC += INT8(TMP);
- }
- prefetch();
-
-bbs_zpb
- // Access pattern uncertain
- TMP = read_pc();
- TMP2 = read(TMP);
- TMP = read_pc();
- read_pc_noinc();
- if(TMP2 & (1 << ((inst_state >> 4) & 7))) {
- PC += INT8(TMP);
- }
- prefetch();
-
-bit_abx
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- if(page_changing(TMP, X)) {
- read(set_l(TMP, TMP+X));
- }
- TMP += X;
- do_bit(read(TMP));
- prefetch();
-
-bit_imm
- TMP = read_pc();
- if(A & TMP)
- P &= ~F_Z;
- else
- P |= F_Z;
- prefetch();
-
-bit_zpx
- TMP = read_pc();
- read(TMP);
- TMP = read(UINT8(TMP+X));
- do_bit(TMP);
- prefetch();
-
-bra_rel
- TMP = read_pc();
- read_pc_noinc();
- if(page_changing(PC, INT8(TMP))) {
- read_arg(set_l(PC, PC+INT8(TMP)));
- }
- PC += INT8(TMP);
- prefetch();
-
-brk_c_imp
- if(irq_taken || nmi_state) {
- read_pc_noinc();
- } else {
- read_pc();
- }
- write(SP, PC >> 8);
- dec_SP();
- write(SP, PC);
- dec_SP();
- write(SP, irq_taken || nmi_state ? P & ~F_B : P);
- dec_SP();
- if(irq_taken && nmi_state) {
- PC = read_arg(0xfffa);
- PC = set_h(PC, read_arg(0xfffb));
- nmi_state = false;
- standard_irq_callback(NMI_LINE);
- } else {
- PC = read_arg(0xfffe);
- PC = set_h(PC, read_arg(0xffff));
- if(irq_taken)
- standard_irq_callback(IRQ_LINE);
- }
- irq_taken = false;
- P = (P | F_I) & ~F_D; // Do *not* move after the prefetch
- prefetch();
- inst_state = -1;
-
-cmp_zpi
- TMP2 = read_pc();
- TMP = read(TMP2 & 0xff);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- do_cmp(A, read(TMP));
- prefetch();
-
-dec_acc
- read_pc_noinc();
- A--;
- set_nz(A);
- prefetch();
-
-eor_zpi
- TMP2 = read_pc();
- TMP = read(TMP2 & 0xff);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- A ^= read(TMP);
- set_nz(A);
- prefetch();
-
-inc_acc
- read_pc_noinc();
- A++;
- set_nz(A);
- prefetch();
-
-jmp_iax
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- read(set_l(TMP, TMP+X));
- TMP += X;
- PC = read(TMP);
- PC = set_h(PC, read(TMP+1));
- prefetch();
-
-jmp_c_ind
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- PC = read(TMP);
- read(set_l(TMP, TMP+1));
- PC = set_h(PC, read(TMP+1));
- prefetch();
-
-lda_zpi
- TMP2 = read_pc();
- TMP = read(TMP2 & 0xff);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- A = read(TMP);
- set_nz(A);
- prefetch();
-
-
-lsr_c_abx
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- if(page_changing(TMP, X)) {
- read(set_l(TMP, TMP+X));
- }
- TMP += X;
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2 = do_lsr(TMP2);
- write(TMP, TMP2);
- prefetch();
-
-nop_c_imp
- prefetch();
-
-nop_c_aba
- read_pc();
- read_pc();
- read_pc_noinc();
- read_pc_noinc();
- read_pc_noinc();
- read_pc_noinc();
- read_pc_noinc();
- prefetch();
-
-nop_c_abx
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- read(set_l(TMP, TMP+X));
- prefetch();
-
-ora_zpi
- TMP2 = read_pc();
- TMP = read(TMP2 & 0xff);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- A |= read(TMP);
- set_nz(A);
- prefetch();
-
-phx_imp
- read_pc_noinc();
- write(SP, X);
- dec_SP();
- prefetch();
-
-phy_imp
- read_pc_noinc();
- write(SP, Y);
- dec_SP();
- prefetch();
-
-plx_imp
- read_pc_noinc();
- read(SP);
- inc_SP();
- X = read(SP);
- set_nz(X);
- prefetch();
-
-ply_imp
- read_pc_noinc();
- read(SP);
- inc_SP();
- Y = read(SP);
- set_nz(Y);
- prefetch();
-
-rmb_bzp
- // Access pattern unknown but probable (built upon inc_zpg)
- TMP = read_pc();
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2 &= ~(1 << ((inst_state >> 4) & 7));
- write(TMP, TMP2);
- prefetch();
-
-rol_c_abx
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- if(page_changing(TMP, X)) {
- read(set_l(TMP, TMP+X));
- }
- TMP += X;
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2 = do_rol(TMP2);
- write(TMP, TMP2);
- prefetch();
-
-
-ror_c_abx
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- if(page_changing(TMP, X)) {
- read(set_l(TMP, TMP+X));
- }
- TMP += X;
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2 = do_ror(TMP2);
- write(TMP, TMP2);
- prefetch();
-
-sbc_c_aba
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP = read(TMP);
- do_sbc(TMP);
- if(P & F_D) {
- read_pc_noinc();
- set_nz(A);
- }
- prefetch();
-
-sbc_c_abx
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- if(page_changing(TMP, X)) {
- read(set_l(TMP, TMP+X));
- }
- TMP += X;
- TMP = read(TMP);
- do_sbc(TMP);
- if(P & F_D) {
- read_pc_noinc();
- set_nz(A);
- }
- prefetch();
-
-sbc_c_aby
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- if(page_changing(TMP, Y)) {
- read(set_l(TMP, TMP+Y));
- }
- TMP += Y;
- TMP = read(TMP);
- do_sbc(TMP);
- if(P & F_D) {
- read_pc_noinc();
- set_nz(A);
- }
- prefetch();
-
-sbc_c_idx
- TMP2 = read_pc();
- read(TMP2);
- TMP2 += X;
- TMP = read(TMP2 & 0xff);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- do_sbc(read(TMP));
- if(P & F_D) {
- read_pc_noinc();
- set_nz(A);
- }
- prefetch();
-
-sbc_c_idy
- TMP2 = read_pc();
- TMP = read(TMP2);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- if(page_changing(TMP, Y)) {
- read(set_l(TMP, TMP+Y));
- }
- do_sbc(read(TMP+Y));
- if(P & F_D) {
- read_pc_noinc();
- set_nz(A);
- }
- prefetch();
-
-sbc_c_imm
- TMP = read_pc();
- do_sbc(TMP);
- if(P & F_D) {
- read_pc_noinc();
- set_nz(A);
- }
- prefetch();
-
-sbc_c_zpg
- TMP = read_pc();
- TMP = read(TMP);
- do_sbc(TMP);
- if(P & F_D) {
- read_pc_noinc();
- set_nz(A);
- }
- prefetch();
-
-sbc_c_zpi
- TMP2 = read_pc();
- TMP = read(TMP2 & 0xff);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- do_sbc(read(TMP));
- if(P & F_D) {
- read_pc_noinc();
- set_nz(A);
- }
- prefetch();
-
-sbc_c_zpx
- TMP = read_pc();
- read(TMP);
- TMP = read(UINT8(TMP+X));
- do_sbc(TMP);
- if(P & F_D) {
- read_pc_noinc();
- set_nz(A);
- }
- prefetch();
-
-smb_bzp
- // Access pattern unknown but probable (built upon inc_zpg)
- TMP = read_pc();
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2 |= 1 << ((inst_state >> 4) & 7);
- write(TMP, TMP2);
- prefetch();
-
-sta_zpi
- TMP2 = read_pc();
- TMP = read(TMP2 & 0xff);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- write(TMP, A);
- prefetch();
-
-stp_imp
- for(;;) {
- eat-all-cycles;
- }
-
-stz_aba
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- write(TMP, 0x00);
- prefetch();
-
-stz_abx
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- read(set_l(TMP, TMP+X));
- write(TMP+X, 0x00);
- prefetch();
-
-stz_zpg
- TMP = read_pc();
- write(TMP, 0x00);
- prefetch();
-
-stz_zpx
- TMP = read_pc();
- read(TMP);
- write(UINT8(TMP+X), 0x00);
- prefetch();
-
-trb_aba
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP2 = read(TMP);
- write(TMP, TMP2);
- if(A & TMP2)
- P &= ~F_Z;
- else
- P |= F_Z;
- TMP2 &= ~A;
- write(TMP, TMP2);
- prefetch();
-
-trb_zpg
- TMP = read_pc();
- TMP2 = read(TMP);
- write(TMP, TMP2);
- if(A & TMP2)
- P &= ~F_Z;
- else
- P |= F_Z;
- TMP2 &= ~A;
- write(TMP, TMP2);
- prefetch();
-
-tsb_aba
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP2 = read(TMP);
- write(TMP, TMP2);
- if(A & TMP2)
- P &= ~F_Z;
- else
- P |= F_Z;
- TMP2 |= A;
- write(TMP, TMP2);
- prefetch();
-
-tsb_zpg
- TMP = read_pc();
- TMP2 = read(TMP);
- write(TMP, TMP2);
- if(A & TMP2)
- P &= ~F_Z;
- else
- P |= F_Z;
- TMP2 |= A;
- write(TMP, TMP2);
- prefetch();
-
-wai_imp
- read_pc_noinc();
- read_pc_noinc();
- while(!nmi_state && !irq_state) {
- eat-all-cycles;
- }
- prefetch();
diff --git a/src/emu/cpu/m6502/om65ce02.lst b/src/emu/cpu/m6502/om65ce02.lst
deleted file mode 100644
index 049097fded8..00000000000
--- a/src/emu/cpu/m6502/om65ce02.lst
+++ /dev/null
@@ -1,1533 +0,0 @@
-# 65ce02 opcodes, a lot only remove dummy read/write cycles, some are new, some use the B register
-
-adc_ce_aba
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP = read(TMP);
- do_adc(TMP);
- if(P & F_D)
- set_nz(A);
- prefetch();
-
-adc_ce_abx
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP += X;
- TMP = read(TMP);
- do_adc(TMP);
- if(P & F_D)
- set_nz(A);
- prefetch();
-
-adc_ce_aby
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP += Y;
- TMP = read(TMP);
- do_adc(TMP);
- if(P & F_D)
- set_nz(A);
- prefetch();
-
-adc_ce_idx
- TMP2 = read_pc();
- TMP2 += X;
- TMP = read(B|TMP2);
- TMP2++;
- TMP = set_h(TMP, read(B|TMP2));
- do_adc(read(TMP));
- if(P & F_D)
- set_nz(A);
- prefetch();
-
-adc_ce_idy
- TMP2 = read_pc();
- TMP = read(B|TMP2);
- TMP2++;
- TMP = set_h(TMP, read(B|TMP2));
- do_adc(read(TMP+Y));
- if(P & F_D)
- set_nz(A);
- prefetch();
-
-adc_idz
- TMP2 = read_pc();
- TMP = read(B|TMP2);
- TMP2++;
- TMP = set_h(TMP, read(B|TMP2));
- do_adc(read(TMP+Z));
- if(P & F_D)
- set_nz(A);
- prefetch();
-
-adc_ce_imm
- TMP = read_pc();
- do_adc(TMP);
- if(P & F_D)
- set_nz(A);
- prefetch();
-
-adc_ce_zpg
- TMP = read_pc();
- TMP = read(B|TMP);
- do_adc(TMP);
- if(P & F_D)
- set_nz(A);
- prefetch();
-
-adc_ce_zpx
- TMP = read_pc();
- TMP = read(B|UINT8(TMP+X));
- do_adc(TMP);
- if(P & F_D)
- set_nz(A);
- prefetch();
-
-and_ce_abx
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP += X;
- A &= read(TMP);
- set_nz(A);
- prefetch();
-
-and_ce_aby
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP += Y;
- A &= read(TMP);
- set_nz(A);
- prefetch();
-
-and_ce_idx
- TMP2 = read_pc();
- TMP2 += X;
- TMP = read(B|TMP2);
- TMP2++;
- TMP = set_h(TMP, read(B|TMP2));
- A &= read(TMP);
- set_nz(A);
- prefetch();
-
-and_ce_idy
- TMP2 = read_pc();
- TMP = read(B|TMP2);
- TMP2++;
- TMP = set_h(TMP, read(B|TMP2));
- A &= read(TMP+Y);
- set_nz(A);
- prefetch();
-
-and_idz
- TMP2 = read_pc();
- TMP = read(B|TMP2);
- TMP2++;
- TMP = set_h(TMP, read(B|TMP2));
- A &= read(TMP+Z);
- set_nz(A);
- prefetch();
-
-and_ce_zpg
- TMP = read_pc();
- A &= read(B|TMP);
- set_nz(A);
- prefetch();
-
-and_ce_zpx
- TMP = read_pc();
- A &= read(B|UINT8(TMP+X));
- set_nz(A);
- prefetch();
-
-asl_ce_aba
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP2 = read(TMP);
- TMP2 = do_asl(TMP2);
- write(TMP, TMP2);
- prefetch();
-
-asl_ce_abx
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP += X;
- TMP2 = read(TMP);
- TMP2 = do_asl(TMP2);
- write(TMP, TMP2);
- prefetch();
-
-asl_ce_acc
- A = do_asl(A);
- prefetch();
-
-asl_ce_zpg
- TMP = B|read_pc();
- TMP2 = read(TMP);
- TMP2 = do_asl(TMP2);
- write(TMP, TMP2);
- prefetch();
-
-asl_ce_zpx
- TMP = read_pc();
- TMP = B|UINT8(TMP+X);
- TMP2 = read(TMP);
- TMP2 = do_asl(TMP2);
- write(TMP, TMP2);
- prefetch();
-
-asr_acc
- A = do_asr(A);
- prefetch();
-
-asr_zpg
- TMP = B|read_pc();
- TMP2 = read(TMP);
- TMP2 = do_asr(TMP2);
- write(TMP, TMP2);
- prefetch();
-
-asr_zpx
- TMP = read_pc();
- TMP = B|UINT8(TMP+X);
- TMP2 = read(TMP);
- TMP2 = do_asr(TMP2);
- write(TMP, TMP2);
- prefetch();
-
-asw_aba
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP3 = read(TMP);
- TMP3 = set_h(TMP3, read(TMP+1));
- P &= ~(F_C|F_N|F_Z);
- if(TMP3 & 0x8000)
- P |= F_C;
- TMP3 <<= 1;
- if(!TMP3)
- P |= F_Z;
- else if(TMP3 & 0x8000)
- P |= F_N;
- write(TMP, TMP3);
- write(TMP, TMP3 >> 8);
- prefetch();
-
-aug_iw3
- read_pc();
- read_pc();
- read_pc();
- prefetch();
-
-bbr_ce_zpb
- // Access pattern uncertain
- TMP = read_pc();
- TMP2 = read(TMP);
- TMP = read_pc();
- if(!(TMP2 & (1 << ((inst_state >> 4) & 7))))
- PC += INT8(TMP);
- prefetch();
-
-bbs_ce_zpb
- // Access pattern uncertain
- TMP = read_pc();
- TMP2 = read(TMP);
- TMP = read_pc();
- if(TMP2 & (1 << ((inst_state >> 4) & 7)))
- PC += INT8(TMP);
- prefetch();
-
-bcc_ce_rel
- TMP = read_pc();
- if(!(P & F_C))
- PC += INT8(TMP);
- prefetch();
-
-bcc_rw2
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- if(!(P & F_C))
- PC += TMP-1;
- prefetch();
-
-bcs_ce_rel
- TMP = read_pc();
- if(P & F_C)
- PC += INT8(TMP);
- prefetch();
-
-bcs_rw2
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- if(P & F_C)
- PC += TMP-1;
- prefetch();
-
-beq_ce_rel
- TMP = read_pc();
- if(P & F_Z)
- PC += INT8(TMP);
- prefetch();
-
-beq_rw2
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- if(P & F_Z)
- PC += TMP-1;
- prefetch();
-
-bit_ce_abx
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP += X;
- do_bit(read(TMP));
- prefetch();
-
-bit_ce_imm
- TMP = read_pc();
- do_bit(TMP);
- prefetch();
-
-bit_ce_zpg
- TMP = B|read_pc();
- do_bit(read(TMP));
- prefetch();
-
-bit_ce_zpx
- TMP = read_pc();
- TMP = read(B|UINT8(TMP+X));
- do_bit(TMP);
- prefetch();
-
-bmi_ce_rel
- TMP = read_pc();
- if(P & F_N)
- PC += INT8(TMP);
- prefetch();
-
-bmi_rw2
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- if(P & F_N)
- PC += TMP-1;
- prefetch();
-
-bne_ce_rel
- TMP = read_pc();
- if(!(P & F_Z))
- PC += INT8(TMP);
- prefetch();
-
-bne_rw2
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- if(!(P & F_Z))
- PC += TMP-1;
- prefetch();
-
-bpl_ce_rel
- TMP = read_pc();
- if(!(P & F_N))
- PC += INT8(TMP);
- prefetch();
-
-bpl_rw2
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- if(!(P & F_N))
- PC += TMP-1;
- prefetch();
-
-bra_ce_rel
- TMP = read_pc();
- PC += INT8(TMP);
- prefetch();
-
-bra_rw2
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- PC += TMP - 1;
- prefetch();
-
-brk_ce_imp
- if(irq_taken) {
- read_pc_noinc();
- } else {
- read_pc();
- }
- write(SP, PC >> 8);
- dec_SP_ce();
- write(SP, PC);
- dec_SP_ce();
- write(SP, irq_taken || nmi_state ? P & ~F_B : P);
- dec_SP_ce();
- if(nmi_state) {
- PC = read_arg(0xfffa);
- PC = set_h(PC, read_arg(0xfffb));
- nmi_state = false;
- } else {
- PC = read_arg(0xfffe);
- PC = set_h(PC, read_arg(0xffff));
- }
- irq_taken = false;
- P = (P | F_I) & ~F_D; // Do *not* move after the prefetch
- prefetch();
- inst_state = -1;
-
-bsr_rw2
- TMP = read_pc();
- write(SP, PC>>8);
- dec_SP_ce();
- write(SP, PC);
- dec_SP_ce();
- TMP = set_h(TMP, read_pc());
- PC += TMP-1;
- prefetch();
-
-bvc_ce_rel
- TMP = read_pc();
- if(!(P & F_V))
- PC += INT8(TMP);
- prefetch();
-
-bvc_rw2
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- if(!(P & F_V))
- PC += TMP-1;
- prefetch();
-
-bvs_ce_rel
- TMP = read_pc();
- if(P & F_V)
- PC += INT8(TMP);
- prefetch();
-
-bvs_rw2
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- if(P & F_V)
- PC += TMP-1;
- prefetch();
-
-clc_ce_imp
- P &= ~F_C;
- prefetch();
-
-cld_ce_imp
- P &= ~F_D;
- prefetch();
-
-cle_imp
- read_pc_noinc();
- P &= ~F_E;
- logerror("CLE\n");
- prefetch();
-
-cli_ce_imp
- prefetch();
- P &= ~F_I; // Do *not* move it before the prefetch
-
-clv_ce_imp
- P &= ~F_V;
- prefetch();
-
-cmp_ce_abx
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP += X;
- TMP = read(TMP);
- do_cmp(A, TMP);
- prefetch();
-
-cmp_ce_aby
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP += Y;
- TMP = read(TMP);
- do_cmp(A, TMP);
- prefetch();
-
-cmp_ce_idx
- TMP2 = read_pc();
- TMP2 += X;
- TMP = read(B|TMP2);
- TMP2++;
- TMP = set_h(TMP, read(B|TMP2));
- do_cmp(A, read(TMP));
- prefetch();
-
-cmp_ce_idy
- TMP2 = read_pc();
- TMP = read(B|TMP2);
- TMP2++;
- TMP = set_h(TMP, read(B|TMP2));
- do_cmp(A, read(TMP+Y));
- prefetch();
-
-cmp_idz
- TMP2 = read_pc();
- TMP = read(B|TMP2);
- TMP2++;
- TMP = set_h(TMP, read(B|TMP2));
- do_cmp(A, read(TMP+Z));
- prefetch();
-
-cmp_ce_zpg
- TMP = read_pc();
- TMP = read(B|TMP);
- do_cmp(A, TMP);
- prefetch();
-
-cmp_ce_zpx
- TMP = read_pc();
- read(TMP);
- TMP = read(B|UINT8(TMP+X));
- do_cmp(A, TMP);
- prefetch();
-
-cpx_ce_zpg
- TMP = read_pc();
- TMP = read(B|TMP);
- do_cmp(X, TMP);
- prefetch();
-
-cpy_ce_zpg
- TMP = read_pc();
- TMP = read(B|TMP);
- do_cmp(Y, TMP);
- prefetch();
-
-cpz_aba
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP = read(TMP);
- do_cmp(Z, TMP);
- prefetch();
-
-cpz_imm
- TMP = read_pc();
- do_cmp(Z, TMP);
- prefetch();
-
-cpz_zpg
- TMP = read_pc();
- TMP = read(B|TMP);
- do_cmp(Z, TMP);
- prefetch();
-
-dec_ce_aba
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP2 = read(TMP);
- TMP2--;
- set_nz(TMP2);
- write(TMP, TMP2);
- prefetch();
-
-dec_ce_abx
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP += X;
- TMP2 = read(TMP);
- TMP2--;
- set_nz(TMP2);
- write(TMP, TMP2);
- prefetch();
-
-dec_ce_acc
- A--;
- set_nz(A);
- prefetch();
-
-dec_ce_zpg
- TMP = B|read_pc();
- TMP2 = read(TMP);
- TMP2--;
- set_nz(TMP2);
- write(TMP, TMP2);
- prefetch();
-
-dec_ce_zpx
- TMP = read_pc();
- TMP = B|UINT8(TMP+X);
- TMP2 = read(TMP);
- TMP2--;
- set_nz(TMP2);
- write(TMP, TMP2);
- prefetch();
-
-dew_zpg
- TMP2 = read_pc();
- TMP = read(B|TMP2);
- TMP2++;
- TMP = set_h(TMP, read(B|TMP2));
- P &= ~(F_N|F_Z);
- TMP++;
- if(!TMP)
- P |= F_Z;
- else if(TMP & 0x8000)
- P |= F_N;
- TMP2++;
- write(B|TMP2, TMP);
- TMP2++;
- write(B|TMP2, TMP >> 8);
- prefetch();
-
-dex_ce_imp
- X--;
- set_nz(X);
- prefetch();
-
-dey_ce_imp
- Y--;
- set_nz(Y);
- prefetch();
-
-dez_imp
- Z--;
- set_nz(Z);
- prefetch();
-
-eor_ce_abx
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP += X;
- A ^= read(TMP);
- set_nz(A);
- prefetch();
-
-eor_ce_aby
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP += Y;
- A ^= read(TMP);
- set_nz(A);
- prefetch();
-
-eor_ce_idx
- TMP2 = read_pc();
- TMP2 += X;
- TMP = read(B|TMP2);
- TMP2++;
- TMP = set_h(TMP, read(B|TMP2));
- A ^= read(TMP);
- set_nz(A);
- prefetch();
-
-eor_ce_idy
- TMP2 = read_pc();
- TMP = read(B|TMP2);
- TMP2++;
- TMP = set_h(TMP, read(B|TMP2));
- A ^= read(TMP+Y);
- set_nz(A);
- prefetch();
-
-eor_idz
- TMP2 = read_pc();
- TMP = read(B|TMP2);
- TMP2++;
- TMP = set_h(TMP, read(B|TMP2));
- A ^= read(TMP+Z);
- set_nz(A);
- prefetch();
-
-eor_ce_zpg
- TMP = read_pc();
- A ^= read(B|TMP);
- set_nz(A);
- prefetch();
-
-eor_ce_zpx
- TMP = read_pc();
- A ^= read(B|UINT8(TMP+X));
- set_nz(A);
- prefetch();
-
-inc_ce_aba
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP2 = read(TMP);
- TMP2++;
- set_nz(TMP2);
- write(TMP, TMP2);
- prefetch();
-
-inc_ce_abx
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP += X;
- TMP2 = read(TMP);
- TMP2++;
- set_nz(TMP2);
- write(TMP, TMP2);
- prefetch();
-
-inc_ce_acc
- A++;
- set_nz(A);
- prefetch();
-
-inc_ce_zpg
- TMP = B|read_pc();
- TMP2 = read(TMP);
- TMP2++;
- set_nz(TMP2);
- write(TMP, TMP2);
- prefetch();
-
-inc_ce_zpx
- TMP = read_pc();
- TMP = B|UINT8(TMP+X);
- TMP2 = read(TMP);
- TMP2++;
- set_nz(TMP2);
- write(TMP, TMP2);
- prefetch();
-
-inw_zpg
- TMP2 = read_pc();
- TMP = read(B|TMP2);
- TMP2++;
- TMP = set_h(TMP, read(B|TMP2));
- P &= ~(F_N|F_Z);
- TMP++;
- if(!TMP)
- P |= F_Z;
- else if(TMP & 0x8000)
- P |= F_N;
- TMP2--;
- write(B|TMP2, TMP);
- TMP2++;
- write(B|TMP2, TMP >> 8);
- prefetch();
-
-inx_ce_imp
- X++;
- set_nz(X);
- prefetch();
-
-iny_ce_imp
- Y++;
- set_nz(Y);
- prefetch();
-
-inz_imp
- Z++;
- set_nz(Z);
- prefetch();
-
-jmp_ce_iax
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP += X;
- PC = read(TMP);
- PC = set_h(PC, read(TMP+1));
- prefetch();
-
-jmp_ce_ind
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- PC = read(TMP);
- PC = set_h(PC, read(TMP+1));
- prefetch();
-
-jsr_ce_adr
- TMP = read_pc();
- write(SP, PC>>8);
- dec_SP_ce();
- write(SP, PC);
- dec_SP_ce();
- TMP = set_h(TMP, read_pc());
- PC = TMP;
- prefetch();
-
-jsr_iax
- TMP = read_pc();
- write(SP, PC>>8);
- dec_SP_ce();
- write(SP, PC);
- dec_SP_ce();
- TMP = set_h(TMP, read_pc());
- PC = read(TMP);
- PC = set_h(PC, read(TMP+1));
- PC += X;
- prefetch();
-
-jsr_ind
- TMP = read_pc();
- write(SP, PC>>8);
- dec_SP_ce();
- write(SP, PC);
- dec_SP_ce();
- TMP = set_h(TMP, read_pc());
- PC = read(TMP);
- PC = set_h(PC, read(TMP+1));
- prefetch();
-
-lda_ce_abx
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- A = read(TMP + X);
- set_nz(A);
- prefetch();
-
-lda_ce_aby
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- A = read(TMP + Y);
- set_nz(A);
- prefetch();
-
-lda_ce_idx
- TMP2 = read_pc();
- TMP2 += X;
- TMP = read(B|TMP2);
- TMP2++;
- TMP = set_h(TMP, read(B|TMP2));
- A = read(TMP);
- set_nz(A);
- prefetch();
-
-lda_ce_idy
- TMP2 = read_pc();
- TMP = read(B|TMP2);
- TMP2++;
- TMP = set_h(TMP, read(B|TMP2));
- A = read(TMP+Y);
- set_nz(A);
- prefetch();
-
-lda_idz
- TMP2 = read_pc();
- TMP = read(B|TMP2);
- TMP2++;
- TMP = set_h(TMP, read(B|TMP2));
- A = read(TMP+Z);
- set_nz(A);
- prefetch();
-
-lda_isy
- read_pc_noinc();
- TMP = read_pc();
- if(P & F_E)
- TMP = set_l(SP, SP+TMP);
- else
- TMP = SP + TMP;
- TMP2 = read(TMP);
- TMP++;
- TMP = TMP2 | (read(TMP) << 8);
- A = read(TMP+Y);
- set_nz(A);
- prefetch();
-
-lda_ce_zpg
- TMP = read_pc();
- A = read(B|TMP);
- set_nz(A);
- prefetch();
-
-lda_ce_zpx
- TMP = read_pc();
- A = read(B|UINT8(TMP+X));
- set_nz(A);
- prefetch();
-
-ldx_ce_aby
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- X = read(TMP + Y);
- set_nz(X);
- prefetch();
-
-ldx_ce_zpg
- TMP = read_pc();
- X = read(B|TMP);
- set_nz(X);
- prefetch();
-
-ldx_ce_zpy
- TMP = read_pc();
- X = read(B|UINT8(TMP+Y));
- set_nz(X);
- prefetch();
-
-ldy_ce_abx
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP += X;
- Y = read(TMP);
- set_nz(Y);
- prefetch();
-
-ldy_ce_zpg
- TMP = read_pc();
- Y = read(B|TMP);
- set_nz(Y);
- prefetch();
-
-ldy_ce_zpx
- TMP = read_pc();
- Y = read(B|UINT8(TMP+X));
- set_nz(Y);
- prefetch();
-
-ldz_aba
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- Z = read(TMP);
- set_nz(Z);
- prefetch();
-
-ldz_abx
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- Z = read(TMP + X);
- set_nz(Z);
- prefetch();
-
-ldz_imm
- Z = read_pc();
- set_nz(Z);
- prefetch();
-
-lsr_ce_aba
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP2 = read(TMP);
- TMP2 = do_lsr(TMP2);
- write(TMP, TMP2);
- prefetch();
-
-lsr_ce_abx
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- read(set_l(TMP, TMP+X));
- TMP += X;
- TMP2 = read(TMP);
- TMP2 = do_lsr(TMP2);
- write(TMP, TMP2);
- prefetch();
-
-lsr_ce_acc
- A = do_lsr(A);
- prefetch();
-
-lsr_ce_zpg
- TMP = B|read_pc();
- TMP2 = read(TMP);
- TMP2 = do_lsr(TMP2);
- write(TMP, TMP2);
- prefetch();
-
-lsr_ce_zpx
- TMP = read_pc();
- TMP = B|UINT8(TMP+X);
- TMP2 = read(TMP);
- TMP2 = do_lsr(TMP2);
- write(TMP, TMP2);
- prefetch();
-
-neg_acc
- read_pc_noinc();
- A = -A;
- set_nz(A);
- prefetch();
-
-ora_ce_abx
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP += X;
- A |= read(TMP);
- set_nz(A);
- prefetch();
-
-ora_ce_aby
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP += Y;
- A |= read(TMP);
- set_nz(A);
- prefetch();
-
-ora_ce_idx
- TMP2 = read_pc();
- TMP2 += X;
- TMP = read(B|TMP2);
- TMP2++;
- TMP = set_h(TMP, read(B|TMP2));
- A |= read(TMP);
- set_nz(A);
- prefetch();
-
-ora_ce_idy
- TMP2 = read_pc();
- TMP = read(B|TMP2);
- TMP2++;
- TMP = set_h(TMP, read(B|TMP2));
- A |= read(TMP+Y);
- set_nz(A);
- prefetch();
-
-ora_idz
- TMP2 = read_pc();
- TMP = read(B|TMP2);
- TMP2++;
- TMP = set_h(TMP, read(B|TMP2));
- A |= read(TMP+Z);
- set_nz(A);
- prefetch();
-
-ora_ce_zpg
- TMP = read_pc();
- A |= read(B|TMP);
- set_nz(A);
- prefetch();
-
-ora_ce_zpx
- TMP = read_pc();
- A |= read(B|UINT8(TMP+X));
- set_nz(A);
- prefetch();
-
-# push/pop instructions and rti/rtn/rts are not fully streamlined
-pha_ce_imp
- read_pc_noinc();
- write(SP, A);
- dec_SP_ce();
- prefetch();
-
-php_ce_imp
- read_pc_noinc();
- write(SP, P);
- dec_SP_ce();
- prefetch();
-
-phw_aba
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP3 = read(TMP);
- TMP3 = set_h(TMP3, read(TMP+1));
- dec_SP_ce();
- write(SP, TMP3);
- dec_SP_ce();
- write(SP, TMP3 >> 8);
- prefetch();
-
-phw_iw2
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- dec_SP_ce();
- write(SP, TMP);
- dec_SP_ce();
- write(SP, TMP >> 8);
- prefetch();
-
-phx_ce_imp
- read_pc_noinc();
- write(SP, X);
- dec_SP_ce();
- prefetch();
-
-phy_ce_imp
- read_pc_noinc();
- write(SP, Y);
- dec_SP_ce();
- prefetch();
-
-phz_imp
- read_pc_noinc();
- write(SP, Z);
- dec_SP_ce();
- prefetch();
-
-pla_ce_imp
- read_pc_noinc();
- inc_SP_ce();
- A = read(SP);
- set_nz(A);
- prefetch();
-
-plp_ce_imp
- read_pc_noinc();
- inc_SP_ce();
- TMP = read(SP) | F_B;
- prefetch();
- P = TMP; // Do *not* move it before the prefetch
-
-plx_ce_imp
- read_pc_noinc();
- inc_SP_ce();
- X = read(SP);
- set_nz(X);
- prefetch();
-
-ply_ce_imp
- read_pc_noinc();
- inc_SP_ce();
- Y = read(SP);
- set_nz(Y);
- prefetch();
-
-plz_imp
- read_pc_noinc();
- inc_SP_ce();
- Z = read(SP);
- set_nz(Z);
- prefetch();
-
-rmb_ce_bzp
- TMP = read_pc();
- TMP2 = read(TMP);
- TMP2 &= ~(1 << ((inst_state >> 4) & 7));
- write(TMP, TMP2);
- prefetch();
-
-rol_ce_aba
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP2 = read(TMP);
- TMP2 = do_rol(TMP2);
- write(TMP, TMP2);
- prefetch();
-
-rol_ce_abx
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP += X;
- TMP2 = read(TMP);
- TMP2 = do_rol(TMP2);
- write(TMP, TMP2);
- prefetch();
-
-rol_ce_acc
- A = do_rol(A);
- prefetch();
-
-rol_ce_zpg
- TMP = B|read_pc();
- TMP2 = read(TMP);
- TMP2 = do_rol(TMP2);
- write(TMP, TMP2);
- prefetch();
-
-rol_ce_zpx
- TMP = read_pc();
- TMP = B|UINT8(TMP+X);
- TMP2 = read(TMP);
- TMP2 = do_rol(TMP2);
- write(TMP, TMP2);
- prefetch();
-
-ror_ce_aba
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP2 = read(TMP);
- TMP2 = do_ror(TMP2);
- write(TMP, TMP2);
- prefetch();
-
-ror_ce_abx
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP += X;
- TMP2 = read(TMP);
- TMP2 = do_ror(TMP2);
- write(TMP, TMP2);
- prefetch();
-
-ror_ce_acc
- A = do_ror(A);
- prefetch();
-
-ror_ce_zpg
- TMP = B|read_pc();
- TMP2 = read(TMP);
- TMP2 = do_ror(TMP2);
- write(TMP, TMP2);
- prefetch();
-
-ror_ce_zpx
- TMP = read_pc();
- TMP = B|UINT8(TMP+X);
- TMP2 = read(TMP);
- TMP2 = do_ror(TMP2);
- write(TMP, TMP2);
- prefetch();
-
-row_aba
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP3 = read(TMP);
- TMP3 = set_h(TMP3, read(TMP+1));
- TMP2 = P;
- P &= ~(F_C|F_N|F_Z);
- if(TMP3 & 0x8000)
- P |= F_C;
- TMP3 <<= 1;
- if(TMP2 & F_C)
- TMP3 |= 0x0001;
- if(!TMP3)
- P |= F_Z;
- else if(TMP3 & 0x8000)
- P |= F_N;
- write(TMP, TMP3);
- write(TMP, TMP3 >> 8);
- prefetch();
-
-rti_ce_imp
- read_pc_noinc();
- inc_SP_ce();
- P = read(SP) | F_B;
- inc_SP_ce();
- PC = read(SP);
- inc_SP_ce();
- PC = set_h(PC, read(SP));
- prefetch();
-
-rtn_imm
- TMP = read_pc();
- if(P & F_E)
- SP = set_l(SP, SP+TMP);
- else
- SP += TMP;
- read_pc_noinc();
- read(SP);
- inc_SP();
- PC = read(SP);
- inc_SP();
- PC = set_h(PC, read(SP));
- read_pc();
- prefetch();
-
-rts_ce_imp
- inc_SP_ce();
- PC = read(SP);
- inc_SP_ce();
- PC = set_h(PC, read(SP));
- read_pc();
- prefetch();
-
-sbc_ce_aba
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP = read(TMP);
- do_sbc(TMP);
- if(P & F_D)
- set_nz(A);
- prefetch();
-
-sbc_ce_abx
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP += X;
- TMP = read(TMP);
- do_sbc(TMP);
- if(P & F_D)
- set_nz(A);
- prefetch();
-
-sbc_ce_aby
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP += Y;
- TMP = read(TMP);
- do_sbc(TMP);
- if(P & F_D)
- set_nz(A);
- prefetch();
-
-sbc_ce_idx
- TMP2 = read_pc();
- TMP2 += X;
- TMP = read(B|TMP2);
- TMP2++;
- TMP = set_h(TMP, read(B|TMP2));
- do_sbc(read(TMP));
- if(P & F_D)
- set_nz(A);
- prefetch();
-
-sbc_ce_idy
- TMP2 = read_pc();
- TMP = read(B|TMP2);
- TMP2++;
- TMP = set_h(TMP, read(B|TMP2));
- do_sbc(read(TMP+Y));
- if(P & F_D)
- set_nz(A);
- prefetch();
-
-sbc_idz
- TMP2 = read_pc();
- TMP = read(B|TMP2);
- TMP2++;
- TMP = set_h(TMP, read(B|TMP2));
- do_sbc(read(TMP+Z));
- if(P & F_D)
- set_nz(A);
- prefetch();
-
-sbc_ce_imm
- TMP = read_pc();
- do_sbc(TMP);
- if(P & F_D)
- set_nz(A);
- prefetch();
-
-sbc_ce_zpg
- TMP = read_pc();
- TMP = read(B|TMP);
- do_sbc(TMP);
- if(P & F_D)
- set_nz(A);
- prefetch();
-
-sbc_ce_zpx
- TMP = read_pc();
- read(TMP);
- TMP = read(B|UINT8(TMP+X));
- do_sbc(TMP);
- if(P & F_D)
- set_nz(A);
- prefetch();
-
-sec_ce_imp
- P |= F_C;
- prefetch();
-
-sed_ce_imp
- P |= F_D;
- prefetch();
-
-see_imp
- read_pc_noinc();
- P |= F_E;
- prefetch();
-
-sei_ce_imp
- prefetch();
- P |= F_I; // Do *not* move it before the prefetch
-
-smb_ce_bzp
- TMP = read_pc();
- TMP2 = read(TMP);
- TMP2 |= 1 << ((inst_state >> 4) & 7);
- write(TMP, TMP2);
- prefetch();
-
-sta_ce_abx
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- write(TMP+X, A);
- prefetch();
-
-sta_ce_aby
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- write(TMP+Y, A);
- prefetch();
-
-sta_ce_idx
- TMP2 = read_pc();
- TMP2 += X;
- TMP = read(B|TMP2);
- TMP2++;
- TMP = set_h(TMP, read(B|TMP2));
- write(TMP, A);
- prefetch();
-
-sta_ce_idy
- TMP2 = read_pc();
- TMP = read(B|TMP2);
- TMP2++;
- TMP = set_h(TMP, read(B|TMP2));
- write(TMP+Y, A);
- prefetch();
-
-sta_idz
- TMP2 = read_pc();
- TMP = read(B|TMP2);
- TMP2++;
- TMP = set_h(TMP, read(B|TMP2));
- write(TMP+Z, A);
- prefetch();
-
-sta_isy
- read_pc_noinc();
- TMP = read_pc();
- if(P & F_E)
- TMP = set_l(SP, SP+TMP);
- else
- TMP = SP + TMP;
- TMP2 = read(TMP);
- TMP++;
- TMP = TMP2 | (read(TMP) << 8);
- write(TMP+Y, A);
- prefetch();
-
-sta_ce_zpg
- TMP = read_pc();
- write(B|TMP, A);
- prefetch();
-
-sta_ce_zpx
- TMP = read_pc();
- write(B|UINT8(TMP+X), A);
- prefetch();
-
-stx_aby
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- write(TMP+Y, X);
- prefetch();
-
-stx_ce_zpg
- TMP = read_pc();
- write(B|TMP, X);
- prefetch();
-
-stx_ce_zpy
- TMP = read_pc();
- write(B|UINT8(TMP+Y), X);
- prefetch();
-
-sty_abx
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- write(TMP+X, Y);
- prefetch();
-
-sty_ce_zpg
- TMP = read_pc();
- write(B|TMP, Y);
- prefetch();
-
-sty_ce_zpx
- TMP = read_pc();
- write(B|UINT8(TMP+X), Y);
- prefetch();
-
-stz_ce_aba
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- write(TMP, A);
- prefetch();
-
-stz_ce_abx
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- write(TMP+X, A);
- prefetch();
-
-stz_ce_zpg
- TMP = read_pc();
- write(B|TMP, Z);
- prefetch();
-
-stz_ce_zpx
- TMP = read_pc();
- write(B|UINT8(TMP+X), Z);
- prefetch();
-
-tab_imp
- B = A << 8;
- prefetch();
-
-tax_ce_imp
- X = A;
- set_nz(X);
- prefetch();
-
-tay_ce_imp
- Y = A;
- set_nz(Y);
- prefetch();
-
-taz_imp
- Z = A;
- set_nz(Z);
- prefetch();
-
-tba_imp
- A = B >> 8;
- set_nz(A);
- prefetch();
-
-trb_ce_aba
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP2 = read(TMP);
- if(A & TMP2)
- P &= ~F_Z;
- else
- P |= F_Z;
- TMP2 &= ~A;
- write(TMP, TMP2);
- prefetch();
-
-trb_ce_zpg
- TMP = read_pc();
- TMP2 = read(TMP);
- if(A & TMP2)
- P &= ~F_Z;
- else
- P |= F_Z;
- TMP2 &= ~A;
- write(TMP, TMP2);
- prefetch();
-
-tsb_ce_aba
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP2 = read(TMP);
- if(A & TMP2)
- P &= ~F_Z;
- else
- P |= F_Z;
- TMP2 |= A;
- write(TMP, TMP2);
- prefetch();
-
-tsb_ce_zpg
- TMP = read_pc();
- TMP2 = read(TMP);
- if(A & TMP2)
- P &= ~F_Z;
- else
- P |= F_Z;
- TMP2 |= A;
- write(TMP, TMP2);
- prefetch();
-
-tsx_ce_imp
- X = SP;
- set_nz(X);
- prefetch();
-
-tsy_imp
- Y = SP >> 8;
- set_nz(Y);
- prefetch();
-
-txa_ce_imp
- A = X;
- set_nz(A);
- prefetch();
-
-txs_ce_imp
- SP = set_l(SP, X);
- prefetch_noirq();
-
-tys_imp
- SP = set_h(SP, Y);
- prefetch();
-
-tya_ce_imp
- A = Y;
- set_nz(A);
- prefetch();
-
-tza_imp
- A = Z;
- set_nz(A);
- prefetch();
diff --git a/src/emu/cpu/m6502/om740.lst b/src/emu/cpu/m6502/om740.lst
deleted file mode 100644
index 9f17dc639bf..00000000000
--- a/src/emu/cpu/m6502/om740.lst
+++ /dev/null
@@ -1,749 +0,0 @@
-# m740 opcodes
-set_imp
- read_pc_noinc();
- P |= F_T;
- inst_state_base = 0x100;
- prefetch();
-
-clt_imp
- read_pc_noinc();
- P &= ~F_T;
- inst_state_base = 0;
- prefetch();
-
-ldm_imz
- TMP = read_pc();
- TMP2 = read_pc();
- write(TMP2, TMP);
- prefetch();
-
-jsr_spg
- TMP = read_pc_noinc();
- read(SP);
- write(SP, PC>>8);
- dec_SP();
- write(SP, PC);
- dec_SP();
- TMP = set_h(TMP, 0xff);
- PC = TMP;
- prefetch();
-
-clb_bac
- read_pc_noinc();
- A = do_clb(A, (IR>>5) & 7);
- prefetch();
-
-seb_bac
- read_pc_noinc();
- A = do_seb(A, (IR>>5) & 7);
- prefetch();
-
-clb_biz
- TMP = read_pc();
- TMP2 = read(TMP);
- TMP2 = do_clb(TMP2, (IR>>5) & 7);
- write(TMP, TMP2);
- prefetch();
-
-seb_biz
- TMP = read_pc();
- TMP2 = read(TMP);
- TMP2 = do_seb(TMP2, (IR>>5) & 7);
- write(TMP, TMP2);
- prefetch();
-
-bbc_bzr
- TMP = read_pc();
- TMP2 = read(TMP);
- TMP = read_pc();
- read_pc_noinc();
- if(!(TMP2 & (1 << ((IR>>5) & 7)))) {
- PC += INT8(TMP);
- }
- prefetch();
-
-bbs_bzr
- TMP = read_pc();
- TMP2 = read(TMP);
- TMP = read_pc();
- read_pc_noinc();
- if(TMP2 & (1 << ((IR>>5) & 7))) {
- PC += INT8(TMP);
- }
- prefetch();
-
-bbc_bar
- TMP = read_pc();
- read_pc_noinc();
- if(!(A & (1 << ((IR>>5) & 7)))) {
- PC += INT8(TMP);
- }
- prefetch();
-
-bbs_bar
- TMP = read_pc();
- read_pc_noinc();
- if(A & (1 << ((IR>>5) & 7))) {
- PC += INT8(TMP);
- }
- prefetch();
-
-rrf_zpg
- TMP = read_pc();
- TMP2 = read(TMP);
- TMP2 = do_rrf(TMP2);
- write(TMP, TMP2);
- prefetch();
-
-bra_rel
- TMP = read_pc();
- read_pc_noinc();
- if(page_changing(PC, INT8(TMP))) {
- read_arg(set_l(PC, PC+INT8(TMP)));
- }
- PC += INT8(TMP);
- prefetch();
-
-jmp_zpi
- TMP2 = read_pc();
- TMP = read(TMP2 & 0xff);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- PC = TMP;
- prefetch();
-
-reset740
- PC = read_arg(0xfffe);
- PC = set_h(PC, read_arg(0xffff));
- prefetch();
- inst_state = -1;
-
-brk740_imp
- // The 6502 bug when a nmi occurs in a brk is reproduced (case !irq_taken && nmi_state)
- if(irq_taken) {
- read_pc_noinc();
- } else {
- read_pc();
- }
- write(SP, PC >> 8);
- dec_SP();
- write(SP, PC);
- dec_SP();
- write(SP, irq_taken ? P & ~F_B : P);
- dec_SP();
- if(nmi_state) {
- PC = read_arg(0xfffa);
- PC = set_h(PC, read_arg(0xfffb));
- nmi_state = false;
- standard_irq_callback(NMI_LINE);
- } else {
- PC = read_arg(m_irq_vector);
- PC = set_h(PC, read_arg(m_irq_vector+1));
- if(irq_taken)
- standard_irq_callback(IRQ_LINE);
- }
- irq_taken = false;
- P |= F_I; // Do *not* move after the prefetch
- prefetch();
- inst_state = -1;
-
-# T=1 opcodes
-
-adct_aba
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP = read(TMP);
- TMP2 = read(X);
- do_adct(TMP);
- write(X, TMP2);
- prefetch();
-
-adct_abx
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- if(page_changing(TMP, X)) {
- read(set_l(TMP, TMP+X));
- }
- TMP += X;
- TMP = read(TMP);
- TMP2 = read(X);
- do_adct(TMP);
- write(X, TMP2);
- prefetch();
-
-adct_aby
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- if(page_changing(TMP, Y)) {
- read(set_l(TMP, TMP+Y));
- }
- TMP += Y;
- TMP = read(TMP);
- TMP2 = read(X);
- do_adct(TMP);
- write(X, TMP2);
- prefetch();
-
-adct_idx
- TMP2 = read_pc();
- read(TMP2);
- TMP2 += X;
- TMP = read(TMP2 & 0xff);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- TMP2 = read(X);
- do_adct(read(TMP));
- write(X, TMP2);
- prefetch();
-
-adct_idy
- TMP2 = read_pc();
- TMP = read(TMP2);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- if(page_changing(TMP, Y)) {
- read(set_l(TMP, TMP+Y));
- }
- TMP2 = read(X);
- do_adct(read(TMP+Y));
- write(X, TMP2);
- prefetch();
-
-adct_imm
- TMP = read_pc();
- TMP2 = read(X);
- do_adct(TMP);
- write(X, TMP2);
- prefetch();
-
-adct_zpg
- TMP = read_pc();
- TMP = read(TMP);
- TMP2 = read(X);
- do_adct(TMP);
- write(X, TMP2);
- prefetch();
-
-adct_zpx
- TMP = read_pc();
- read(TMP);
- TMP = read(UINT8(TMP+X));
- TMP2 = read(X);
- do_adct(TMP);
- write(X, TMP2);
- prefetch();
-
-andt_aba
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP2 = read(X);
- TMP2 &= read(TMP);
- set_nz(TMP2);
- write(X, TMP2);
- prefetch();
-
-andt_abx
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- if(page_changing(TMP, X)) {
- read(set_l(TMP, TMP+X));
- }
- TMP += X;
- TMP2 = read(X);
- TMP2 &= read(TMP);
- set_nz(TMP2);
- write(X, TMP2);
- prefetch();
-
-andt_aby
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- if(page_changing(TMP, Y)) {
- read(set_l(TMP, TMP+Y));
- }
- TMP += Y;
- TMP2 = read(X);
- TMP2 &= read(TMP);
- set_nz(TMP2);
- write(X, TMP2);
- prefetch();
-
-andt_imm
- TMP2 = read(X);
- TMP2 &= read_pc();
- set_nz(TMP2);
- write(X, TMP2);
- prefetch();
-
-andt_idx
- TMP2 = read_pc();
- read(TMP2);
- TMP2 += X;
- TMP = read(TMP2 & 0xff);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- TMP2 = read(X);
- TMP2 &= read(TMP);
- set_nz(TMP2);
- write(X, TMP2);
- prefetch();
-
-andt_idy
- TMP2 = read_pc();
- TMP = read(TMP2);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- if(page_changing(TMP, Y)) {
- read(set_l(TMP, TMP+Y));
- }
- TMP2 = read(X);
- TMP2 &= read(TMP+Y);
- set_nz(TMP2);
- write(X, TMP2);
- prefetch();
-
-andt_zpg
- TMP = read_pc();
- TMP2 = read(X);
- TMP2 &= read(TMP);
- set_nz(TMP2);
- write(X, TMP2);
- prefetch();
-
-andt_zpx
- TMP = read_pc();
- read(TMP);
- TMP2 = read(X);
- TMP2 &= read(UINT8(TMP+X));
- set_nz(TMP2);
- write(X, TMP2);
- prefetch();
-
-com_zpg
- TMP = read_pc();
- TMP2 = read(TMP);
- TMP2 ^= 0xff;
- set_nz(TMP2);
- write(TMP, TMP2);
- prefetch();
-
-cmpt_aba
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP = read(TMP);
- TMP2 = read(X);
- do_cmp(TMP2, TMP);
- prefetch();
-
-cmpt_abx
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- if(page_changing(TMP, X)) {
- read(set_l(TMP, TMP+X));
- }
- TMP += X;
- TMP = read(TMP);
- TMP2 = read(X);
- do_cmp(TMP2, TMP);
- prefetch();
-
-cmpt_aby
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- if(page_changing(TMP, Y)) {
- read(set_l(TMP, TMP+Y));
- }
- TMP += Y;
- TMP = read(TMP);
- TMP2 = read(X);
- do_cmp(TMP2, TMP);
- prefetch();
-
-cmpt_idx
- TMP2 = read_pc();
- read(TMP2);
- TMP2 += X;
- TMP = read(TMP2 & 0xff);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- TMP2 = read(X);
- do_cmp(TMP2, read(TMP));
- prefetch();
-
-cmpt_idy
- TMP2 = read_pc();
- TMP = read(TMP2);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- if(page_changing(TMP, Y)) {
- read(set_l(TMP, TMP+Y));
- }
- TMP2 = read(X);
- do_cmp(TMP2, read(TMP+Y));
- prefetch();
-
-cmpt_imm
- TMP = read_pc();
- TMP2 = read(X);
- do_cmp(TMP2, TMP);
- prefetch();
-
-cmpt_zpg
- TMP = read_pc();
- TMP = read(TMP);
- TMP2 = read(X);
- do_cmp(TMP2, TMP);
- prefetch();
-
-cmpt_zpx
- TMP = read_pc();
- read(TMP);
- TMP = read(UINT8(TMP+X));
- TMP2 = read(X);
- do_cmp(TMP2, TMP);
- prefetch();
-
-dec_acc
- read_pc_noinc();
- A--;
- set_nz(A);
- prefetch();
-
-dect_acc
- read_pc_noinc();
- TMP2 = read(X);
- TMP2--;
- set_nz(TMP2);
- write(X, TMP2);
- prefetch();
-
-eort_aba
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP2 = read(X);
- TMP2 ^= read(TMP);
- set_nz(TMP2);
- write(X, TMP2);
- prefetch();
-
-eort_abx
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- if(page_changing(TMP, X)) {
- read(set_l(TMP, TMP+X));
- }
- TMP += X;
- TMP2 = read(X);
- TMP2 ^= read(TMP);
- set_nz(TMP2);
- write(X, TMP2);
- prefetch();
-
-eort_aby
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- if(page_changing(TMP, Y)) {
- read(set_l(TMP, TMP+Y));
- }
- TMP += Y;
- TMP2 = read(X);
- TMP2 ^= read(TMP);
- set_nz(TMP2);
- write(X, TMP2);
- prefetch();
-
-eort_idx
- TMP2 = read_pc();
- read(TMP2);
- TMP2 += X;
- TMP = read(TMP2 & 0xff);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- TMP2 = read(X);
- TMP2 ^= read(TMP);
- set_nz(TMP2);
- write(X, TMP2);
- prefetch();
-
-eort_idy
- TMP2 = read_pc();
- TMP = read(TMP2);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- if(page_changing(TMP, Y)) {
- read(set_l(TMP, TMP+Y));
- }
- TMP2 = read(X);
- TMP2 ^= read(TMP+Y);
- set_nz(TMP2);
- write(X, TMP2);
- prefetch();
-
-eort_imm
- TMP2 = read(X);
- TMP2 ^= read_pc();
- set_nz(TMP2);
- write(X, TMP2);
- prefetch();
-
-eort_zpg
- TMP = read_pc();
- TMP2 = read(X);
- TMP2 ^= read(TMP+Y);
- set_nz(TMP2);
- write(X, TMP2);
- prefetch();
-
-eort_zpx
- TMP = read_pc();
- read(TMP);
- TMP2 = read(X);
- TMP2 ^= read(UINT8(TMP+X));
- set_nz(TMP2);
- write(X, TMP2);
- prefetch();
-
-inc_acc
- read_pc_noinc();
- A++;
- set_nz(A);
- prefetch();
-
-inct_acc
- read_pc_noinc();
- TMP2 = read(X);
- TMP2++;
- set_nz(TMP2);
- write(X, TMP2);
- prefetch();
-
-ldt_aba
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP2 = read(TMP);
- set_nz(TMP2);
- write(X, TMP2);
- prefetch();
-
-ldt_abx
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- if(page_changing(TMP, X)) {
- read(set_l(TMP, TMP+X));
- }
- TMP2 = read(TMP + X);
- set_nz(TMP2);
- write(X, TMP2);
- prefetch();
-
-ldt_aby
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- if(page_changing(TMP, Y)) {
- read(set_l(TMP, TMP+Y));
- }
- TMP2 = read(TMP + Y);
- set_nz(TMP2);
- write(X, TMP2);
- prefetch();
-
-ldt_idx
- TMP2 = read_pc();
- read(TMP2);
- TMP2 += X;
- TMP = read(TMP2 & 0xff);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- TMP2 = read(TMP);
- set_nz(TMP2);
- write(X, TMP2);
- prefetch();
-
-ldt_idy
- TMP2 = read_pc();
- TMP = read(TMP2);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- if(page_changing(TMP, Y)) {
- read(set_l(TMP, TMP+Y));
- }
- TMP2 = read(TMP+Y);
- set_nz(TMP2);
- write(X, TMP2);
- prefetch();
-
-ldt_imm
- TMP2 = read_pc();
- set_nz(TMP2);
- write(X, TMP2);
- prefetch();
-
-ldt_zpg
- TMP = read_pc();
- TMP2 = read(TMP);
- set_nz(TMP2);
- write(X, TMP2);
- prefetch();
-
-ldt_zpx
- TMP = read_pc();
- read(TMP);
- TMP2 = read(UINT8(TMP+X));
- set_nz(TMP2);
- write(X, TMP2);
- prefetch();
-
-ort_aba
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP2 = read(X);
- TMP2 |= read(TMP);
- set_nz(TMP2);
- write(X, TMP2);
- prefetch();
-
-ort_abx
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- if(page_changing(TMP, X)) {
- read(set_l(TMP, TMP+X));
- }
- TMP += X;
- TMP2 = read(X);
- TMP2 |= read(TMP);
- set_nz(TMP2);
- write(X, TMP2);
- prefetch();
-
-ort_aby
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- if(page_changing(TMP, Y)) {
- read(set_l(TMP, TMP+Y));
- }
- TMP += Y;
- TMP2 = read(X);
- TMP2 |= read(TMP);
- set_nz(TMP2);
- write(X, TMP2);
- prefetch();
-
-ort_imm
- TMP2 = read(X);
- TMP2 |= read_pc();
- set_nz(TMP2);
- write(X, TMP2);
- prefetch();
-
-ort_idx
- TMP2 = read_pc();
- read(TMP2);
- TMP2 += X;
- TMP = read(TMP2 & 0xff);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- TMP2 = read(X);
- TMP2 |= read(TMP);
- set_nz(TMP2);
- write(X, TMP2);
- prefetch();
-
-ort_idy
- TMP2 = read_pc();
- TMP = read(TMP2);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- if(page_changing(TMP, Y)) {
- read(set_l(TMP, TMP+Y));
- }
- TMP2 = read(X);
- TMP2 |= read(TMP+Y);
- set_nz(TMP2);
- write(X, TMP2);
- prefetch();
-
-ort_zpg
- TMP = read_pc();
- TMP2 = read(X);
- TMP2 |= read(TMP);
- set_nz(TMP2);
- write(X, TMP2);
- prefetch();
-
-ort_zpx
- TMP = read_pc();
- read(TMP);
- TMP2 = read(X);
- TMP2 |= read(UINT8(TMP+X));
- set_nz(TMP2);
- write(X, TMP2);
- prefetch();
-
-sbct_aba
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP = read(TMP);
- TMP2 = read(X);
- do_sbct(TMP);
- write(X, TMP2);
- prefetch();
-
-sbct_abx
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- if(page_changing(TMP, X)) {
- read(set_l(TMP, TMP+X));
- }
- TMP += X;
- TMP = read(TMP);
- TMP2 = read(X);
- do_sbct(TMP);
- write(X, TMP2);
- prefetch();
-
-sbct_aby
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- if(page_changing(TMP, Y)) {
- read(set_l(TMP, TMP+Y));
- }
- TMP += Y;
- TMP = read(TMP);
- TMP2 = read(X);
- do_sbct(TMP);
- write(X, TMP2);
- prefetch();
-
-sbct_idx
- TMP2 = read_pc();
- read(TMP2);
- TMP2 += X;
- TMP = read(TMP2 & 0xff);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- TMP2 = read(X);
- do_sbct(read(TMP));
- write(X, TMP2);
- prefetch();
-
-sbct_idy
- TMP2 = read_pc();
- TMP = read(TMP2);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- if(page_changing(TMP, Y)) {
- read(set_l(TMP, TMP+Y));
- }
- TMP2 = read(X);
- do_sbct(read(TMP+Y));
- write(X, TMP2);
- prefetch();
-
-sbct_imm
- TMP = read_pc();
- TMP2 = read(X);
- do_sbct(TMP);
- write(X, TMP2);
- prefetch();
-
-sbct_zpg
- TMP = read_pc();
- TMP = read(TMP);
- TMP2 = read(X);
- do_sbct(TMP);
- write(X, TMP2);
- prefetch();
-
-sbct_zpx
- TMP = read_pc();
- read(TMP);
- TMP = read(UINT8(TMP+X));
- TMP2 = read(X);
- do_sbct(TMP);
- write(X, TMP2);
- prefetch();
diff --git a/src/emu/cpu/m6502/on2a03.lst b/src/emu/cpu/m6502/on2a03.lst
deleted file mode 100644
index 7d8a72c8d62..00000000000
--- a/src/emu/cpu/m6502/on2a03.lst
+++ /dev/null
@@ -1,297 +0,0 @@
-# n2a03 opcodes - same as 6502 but with d disabled
-adc_nd_aba
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP = read(TMP);
- do_adc_nd(TMP);
- prefetch();
-
-adc_nd_abx
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- if(page_changing(TMP, X)) {
- read(set_l(TMP, TMP+X));
- }
- TMP += X;
- TMP = read(TMP);
- do_adc_nd(TMP);
- prefetch();
-
-adc_nd_aby
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- if(page_changing(TMP, Y)) {
- read(set_l(TMP, TMP+Y));
- }
- TMP += Y;
- TMP = read(TMP);
- do_adc_nd(TMP);
- prefetch();
-
-adc_nd_idx
- TMP2 = read_pc();
- read(TMP2);
- TMP2 += X;
- TMP = read(TMP2 & 0xff);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- do_adc_nd(read(TMP));
- prefetch();
-
-adc_nd_idy
- TMP2 = read_pc();
- TMP = read(TMP2);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- if(page_changing(TMP, Y)) {
- read(set_l(TMP, TMP+Y));
- }
- do_adc_nd(read(TMP+Y));
- prefetch();
-
-adc_nd_imm
- TMP = read_pc();
- do_adc_nd(TMP);
- prefetch();
-
-adc_nd_zpg
- TMP = read_pc();
- TMP = read(TMP);
- do_adc_nd(TMP);
- prefetch();
-
-adc_nd_zpx
- TMP = read_pc();
- read(TMP);
- TMP = read(UINT8(TMP+X));
- do_adc_nd(TMP);
- prefetch();
-
-arr_nd_imm
- A &= read_pc();
- do_arr_nd();
- prefetch();
-
-rra_nd_aba
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2 = do_ror(TMP2);
- write(TMP, TMP2);
- do_adc_nd(TMP2);
- prefetch();
-
-rra_nd_abx
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- read(set_l(TMP, TMP+X));
- TMP += X;
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2 = do_ror(TMP2);
- write(TMP, TMP2);
- do_adc_nd(TMP2);
- prefetch();
-
-rra_nd_aby
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- read(set_l(TMP, TMP+Y));
- TMP += Y;
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2 = do_ror(TMP2);
- write(TMP, TMP2);
- do_adc_nd(TMP2);
- prefetch();
-
-rra_nd_idx
- TMP2 = read_pc();
- read(TMP2);
- TMP2 += X;
- TMP = read(TMP2 & 0xff);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2 = do_ror(TMP2);
- write(TMP, TMP2);
- do_adc_nd(TMP2);
- prefetch();
-
-rra_nd_idy
- TMP2 = read_pc();
- TMP = read(TMP2);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- read(set_l(TMP, TMP+Y));
- TMP += Y;
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2 = do_ror(TMP2);
- write(TMP, TMP2);
- do_adc_nd(TMP2);
- prefetch();
-
-rra_nd_zpg
- TMP = read_pc();
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2 = do_ror(TMP2);
- write(TMP, TMP2);
- do_adc_nd(TMP2);
- prefetch();
-
-rra_nd_zpx
- TMP = read_pc();
- read(TMP);
- TMP = UINT8(TMP+X);
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2 = do_ror(TMP2);
- write(TMP, TMP2);
- do_adc_nd(TMP2);
- prefetch();
-
-sbc_nd_aba
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP = read(TMP);
- do_sbc_nd(TMP);
- prefetch();
-
-sbc_nd_abx
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- if(page_changing(TMP, X)) {
- read(set_l(TMP, TMP+X));
- }
- TMP += X;
- TMP = read(TMP);
- do_sbc_nd(TMP);
- prefetch();
-
-sbc_nd_aby
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- if(page_changing(TMP, Y)) {
- read(set_l(TMP, TMP+Y));
- }
- TMP += Y;
- TMP = read(TMP);
- do_sbc_nd(TMP);
- prefetch();
-
-sbc_nd_idx
- TMP2 = read_pc();
- read(TMP2);
- TMP2 += X;
- TMP = read(TMP2 & 0xff);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- do_sbc_nd(read(TMP));
- prefetch();
-
-sbc_nd_idy
- TMP2 = read_pc();
- TMP = read(TMP2);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- if(page_changing(TMP, Y)) {
- read(set_l(TMP, TMP+Y));
- }
- do_sbc_nd(read(TMP+Y));
- prefetch();
-
-sbc_nd_imm
- TMP = read_pc();
- do_sbc_nd(TMP);
- prefetch();
-
-sbc_nd_zpg
- TMP = read_pc();
- TMP = read(TMP);
- do_sbc_nd(TMP);
- prefetch();
-
-sbc_nd_zpx
- TMP = read_pc();
- read(TMP);
- TMP = read(UINT8(TMP+X));
- do_sbc_nd(TMP);
- prefetch();
-
-isb_nd_aba
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2++;
- write(TMP, TMP2);
- do_sbc_nd(TMP2);
- prefetch();
-
-isb_nd_abx
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- read(set_l(TMP, TMP+X));
- TMP += X;
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2++;
- write(TMP, TMP2);
- do_sbc_nd(TMP2);
- prefetch();
-
-isb_nd_aby
- TMP = read_pc();
- TMP = set_h(TMP, read_pc());
- read(set_l(TMP, TMP+Y));
- TMP += Y;
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2++;
- write(TMP, TMP2);
- do_sbc_nd(TMP2);
- prefetch();
-
-isb_nd_idx
- TMP2 = read_pc();
- read(TMP2);
- TMP2 += X;
- TMP = read(TMP2 & 0xff);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2++;
- write(TMP, TMP2);
- do_sbc_nd(TMP2);
- prefetch();
-
-isb_nd_idy
- TMP2 = read_pc();
- TMP = read(TMP2);
- TMP = set_h(TMP, read((TMP2+1) & 0xff));
- read(set_l(TMP, TMP+Y));
- TMP += Y;
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2++;
- write(TMP, TMP2);
- do_sbc_nd(TMP2);
- prefetch();
-
-isb_nd_zpg
- TMP = read_pc();
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2++;
- write(TMP, TMP2);
- do_sbc_nd(TMP2);
- prefetch();
-
-isb_nd_zpx
- TMP = read_pc();
- read(TMP);
- TMP = UINT8(TMP+X);
- TMP2 = read(TMP);
- write(TMP, TMP2);
- TMP2++;
- write(TMP, TMP2);
- do_sbc_nd(TMP2);
- prefetch();
diff --git a/src/emu/cpu/m6502/r65c02.c b/src/emu/cpu/m6502/r65c02.c
deleted file mode 100644
index 3101ffd0341..00000000000
--- a/src/emu/cpu/m6502/r65c02.c
+++ /dev/null
@@ -1,31 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Olivier Galibert
-/***************************************************************************
-
- r65c02.c
-
- Rockwell 65c02, CMOS variant with bitwise instructions
-
-***************************************************************************/
-
-#include "emu.h"
-#include "r65c02.h"
-
-const device_type R65C02 = &device_creator<r65c02_device>;
-
-r65c02_device::r65c02_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
- m65c02_device(mconfig, R65C02, "R65C02", tag, owner, clock, "r65c02", __FILE__)
-{
-}
-
-r65c02_device::r65c02_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
- m65c02_device(mconfig, type, name, tag, owner, clock, shortname, source)
-{
-}
-
-offs_t r65c02_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options)
-{
- return disassemble_generic(buffer, pc, oprom, opram, options, disasm_entries);
-}
-
-#include "cpu/m6502/r65c02.inc"
diff --git a/src/emu/cpu/m6502/r65c02.h b/src/emu/cpu/m6502/r65c02.h
deleted file mode 100644
index ed3f65f40ad..00000000000
--- a/src/emu/cpu/m6502/r65c02.h
+++ /dev/null
@@ -1,36 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Olivier Galibert
-/***************************************************************************
-
- r65c02.h
-
- Rockwell 65c02, CMOS variant with bitwise instructions
-
-***************************************************************************/
-
-#ifndef __R65C02_H__
-#define __R65C02_H__
-
-#include "m65c02.h"
-
-class r65c02_device : public m65c02_device {
-public:
- r65c02_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
- r65c02_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
-
- static const disasm_entry disasm_entries[0x100];
-
- virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options);
- virtual void do_exec_full();
- virtual void do_exec_partial();
-};
-
-enum {
- R65C02_IRQ_LINE = m6502_device::IRQ_LINE,
- R65C02_NMI_LINE = m6502_device::NMI_LINE,
- R65C02_SET_OVERFLOW = m6502_device::V_LINE
-};
-
-extern const device_type R65C02;
-
-#endif