mirror of
https://github.com/holub/mame
synced 2025-10-08 09:30:17 +03:00
g65816: WDM is a 2-byte opcode per WDC docs, added WDM callback. [R. Belmont]
This commit is contained in:
parent
13676f9905
commit
55ead0c997
@ -17,6 +17,10 @@ All rights reserved.
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
Changes:
|
Changes:
|
||||||
|
1.02 (2019-02-02):
|
||||||
|
R. Belmont
|
||||||
|
- Corrected WDM to take 2 bytes and added callback
|
||||||
|
|
||||||
1.01 (2010-04-04):
|
1.01 (2010-04-04):
|
||||||
Angelo Salese
|
Angelo Salese
|
||||||
- Added boundary checks for MVP and MVN in M mode.
|
- Added boundary checks for MVP and MVN in M mode.
|
||||||
@ -115,6 +119,7 @@ g65816_device::g65816_device(const machine_config &mconfig, device_type type, co
|
|||||||
, m_data_config("data", ENDIANNESS_LITTLE, 8, 24, 0, internal)
|
, m_data_config("data", ENDIANNESS_LITTLE, 8, 24, 0, internal)
|
||||||
, m_opcode_config("opcodes", ENDIANNESS_LITTLE, 8, 24, 0, internal)
|
, m_opcode_config("opcodes", ENDIANNESS_LITTLE, 8, 24, 0, internal)
|
||||||
, m_vector_config("vectors", ENDIANNESS_LITTLE, 8, 5, 0)
|
, m_vector_config("vectors", ENDIANNESS_LITTLE, 8, 5, 0)
|
||||||
|
, m_wdm_w(*this)
|
||||||
, m_cpu_type(cpu_type)
|
, m_cpu_type(cpu_type)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -860,6 +865,8 @@ void g65816_device::device_start()
|
|||||||
m_program_cache = program_space.cache<0, 0, ENDIANNESS_LITTLE>();
|
m_program_cache = program_space.cache<0, 0, ENDIANNESS_LITTLE>();
|
||||||
m_opcode_cache = (has_space(AS_OPCODES) ? space(AS_OPCODES) : program_space).cache<0, 0, ENDIANNESS_LITTLE>();
|
m_opcode_cache = (has_space(AS_OPCODES) ? space(AS_OPCODES) : program_space).cache<0, 0, ENDIANNESS_LITTLE>();
|
||||||
|
|
||||||
|
m_wdm_w.resolve_safe();
|
||||||
|
|
||||||
save_item(NAME(m_a));
|
save_item(NAME(m_a));
|
||||||
save_item(NAME(m_b));
|
save_item(NAME(m_b));
|
||||||
save_item(NAME(m_x));
|
save_item(NAME(m_x));
|
||||||
|
@ -56,6 +56,8 @@ public:
|
|||||||
// construction/destruction
|
// construction/destruction
|
||||||
g65816_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
g65816_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||||
|
|
||||||
|
auto wdm_handler() { return m_wdm_w.bind(); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/* Registers - used by g65816_set_reg() and g65816_get_reg() */
|
/* Registers - used by g65816_set_reg() and g65816_get_reg() */
|
||||||
enum
|
enum
|
||||||
@ -96,6 +98,7 @@ protected:
|
|||||||
address_space_config m_data_config;
|
address_space_config m_data_config;
|
||||||
address_space_config m_opcode_config;
|
address_space_config m_opcode_config;
|
||||||
address_space_config m_vector_config;
|
address_space_config m_vector_config;
|
||||||
|
devcb_write8 m_wdm_w; /* WDM callback */
|
||||||
|
|
||||||
typedef void (g65816_device::*opcode_func) ();
|
typedef void (g65816_device::*opcode_func) ();
|
||||||
typedef unsigned (g65816_device::*get_reg_func)(int regnum);
|
typedef unsigned (g65816_device::*get_reg_func)(int regnum);
|
||||||
|
@ -101,7 +101,7 @@ const g65816_disassembler::opcode_struct g65816_disassembler::s_opcodes[256] =
|
|||||||
{op::BIT, M, DX }, {op::AND, M, DX }, {op::ROL, M, DX }, {op::AND, M, DLIY},
|
{op::BIT, M, DX }, {op::AND, M, DX }, {op::ROL, M, DX }, {op::AND, M, DLIY},
|
||||||
{op::SEC, I, IMP }, {op::AND, M, AY }, {op::DEA, I, IMP }, {op::TSC, I, IMP },
|
{op::SEC, I, IMP }, {op::AND, M, AY }, {op::DEA, I, IMP }, {op::TSC, I, IMP },
|
||||||
{op::BIT, M, AX }, {op::AND, M, AX }, {op::ROL, M, AX }, {op::AND, M, ALX },
|
{op::BIT, M, AX }, {op::AND, M, AX }, {op::ROL, M, AX }, {op::AND, M, ALX },
|
||||||
{op::RTI, I, IMP }, {op::EOR, M, DXI }, {op::WDM, I, IMP }, {op::EOR, M, S },
|
{op::RTI, I, IMP }, {op::EOR, M, DXI }, {op::WDM, I, SIG }, {op::EOR, M, S },
|
||||||
{op::MVP, I, MVP }, {op::EOR, M, D }, {op::LSR, M, D }, {op::EOR, M, DLI },
|
{op::MVP, I, MVP }, {op::EOR, M, D }, {op::LSR, M, D }, {op::EOR, M, DLI },
|
||||||
{op::PHA, I, IMP }, {op::EOR, M, IMM }, {op::LSR, M, ACC }, {op::PHK, I, IMP },
|
{op::PHA, I, IMP }, {op::EOR, M, IMM }, {op::LSR, M, ACC }, {op::PHK, I, IMP },
|
||||||
{op::JMP, I, A }, {op::EOR, M, A }, {op::LSR, M, A }, {op::EOR, M, AL },
|
{op::JMP, I, A }, {op::EOR, M, A }, {op::LSR, M, A }, {op::EOR, M, AL },
|
||||||
|
@ -1428,7 +1428,8 @@
|
|||||||
#undef OP_WDM
|
#undef OP_WDM
|
||||||
#define OP_WDM() \
|
#define OP_WDM() \
|
||||||
CLK(CLK_OP + CLK_IMPLIED); \
|
CLK(CLK_OP + CLK_IMPLIED); \
|
||||||
REGISTER_PC++
|
SRC = OPER_8_IMM(); \
|
||||||
|
m_wdm_w(SRC);
|
||||||
|
|
||||||
/* G65816 Exchange accum high and low bytes */
|
/* G65816 Exchange accum high and low bytes */
|
||||||
#undef OP_XBA
|
#undef OP_XBA
|
||||||
|
Loading…
Reference in New Issue
Block a user