mirror of
https://github.com/holub/mame
synced 2025-04-22 00:11:58 +03:00
cosmac: Fix disassembly; very minor cleanup (nw)
This commit is contained in:
parent
2c7e42261a
commit
aeab957b52
@ -35,7 +35,7 @@ offs_t cosmac_disassembler::short_branch(offs_t base_pc, offs_t &pc, const data_
|
||||
|
||||
offs_t cosmac_disassembler::long_branch(offs_t &pc, const data_buffer ¶ms)
|
||||
{
|
||||
u16 res = params.r16(pc);
|
||||
u16 res = params.r8(pc) << 8 | params.r8(pc + 1);
|
||||
pc += 2;
|
||||
return res;
|
||||
}
|
||||
|
@ -161,7 +161,7 @@ const cosmac_device::ophandler cdp1801_device::s_opcodetable[256] =
|
||||
&cdp1801_device::adi, &cdp1801_device::sdi, &cdp1801_device::und, &cdp1801_device::smi
|
||||
};
|
||||
|
||||
cosmac_device::ophandler cdp1801_device::get_ophandler(uint8_t opcode)
|
||||
cosmac_device::ophandler cdp1801_device::get_ophandler(uint8_t opcode) const
|
||||
{
|
||||
return s_opcodetable[opcode];
|
||||
}
|
||||
@ -249,7 +249,7 @@ const cosmac_device::ophandler cdp1802_device::s_opcodetable[256] =
|
||||
&cdp1802_device::adi, &cdp1802_device::sdi, &cdp1802_device::shl, &cdp1802_device::smi
|
||||
};
|
||||
|
||||
cosmac_device::ophandler cdp1802_device::get_ophandler(uint8_t opcode)
|
||||
cosmac_device::ophandler cdp1802_device::get_ophandler(uint8_t opcode) const
|
||||
{
|
||||
return s_opcodetable[opcode];
|
||||
}
|
||||
@ -828,8 +828,8 @@ inline void cosmac_device::set_q_flag(int state)
|
||||
inline void cosmac_device::fetch_instruction()
|
||||
{
|
||||
// instruction fetch
|
||||
m_op = read_opcode(R[P]);
|
||||
R[P]++;
|
||||
offs_t addr = R[P]++;
|
||||
m_op = read_opcode(addr);
|
||||
|
||||
I = m_op >> 4;
|
||||
N = m_op & 0x0f;
|
||||
@ -919,9 +919,8 @@ inline void cosmac_device::execute_instruction()
|
||||
|
||||
inline void cosmac_device::dma_input()
|
||||
{
|
||||
RAM_W(R[0], m_read_dma(R[0]));
|
||||
|
||||
R[0]++;
|
||||
offs_t addr = R[0]++;
|
||||
RAM_W(addr, m_read_dma(addr));
|
||||
|
||||
m_icount -= CLOCKS_DMA;
|
||||
|
||||
@ -956,9 +955,8 @@ inline void cosmac_device::dma_input()
|
||||
|
||||
inline void cosmac_device::dma_output()
|
||||
{
|
||||
m_write_dma((offs_t)R[0], RAM_R(R[0]));
|
||||
|
||||
R[0]++;
|
||||
offs_t addr = R[0]++;
|
||||
m_write_dma(addr, RAM_R(addr));
|
||||
|
||||
m_icount -= CLOCKS_DMA;
|
||||
|
||||
|
@ -441,7 +441,7 @@ protected:
|
||||
|
||||
// opcode/condition tables
|
||||
typedef void (cosmac_device::*ophandler)();
|
||||
virtual cosmac_device::ophandler get_ophandler(uint8_t opcode) = 0;
|
||||
virtual cosmac_device::ophandler get_ophandler(uint8_t opcode) const = 0;
|
||||
};
|
||||
|
||||
|
||||
@ -457,7 +457,7 @@ protected:
|
||||
// device_disasm_interface overrides
|
||||
virtual std::unique_ptr<util::disasm_interface> create_disassembler() override;
|
||||
|
||||
virtual cosmac_device::ophandler get_ophandler(uint8_t opcode) override;
|
||||
virtual cosmac_device::ophandler get_ophandler(uint8_t opcode) const override;
|
||||
|
||||
static const ophandler s_opcodetable[256];
|
||||
};
|
||||
@ -475,7 +475,7 @@ protected:
|
||||
// device_disasm_interface overrides
|
||||
virtual std::unique_ptr<util::disasm_interface> create_disassembler() override;
|
||||
|
||||
virtual cosmac_device::ophandler get_ophandler(uint8_t opcode) override;
|
||||
virtual cosmac_device::ophandler get_ophandler(uint8_t opcode) const override;
|
||||
|
||||
static const ophandler s_opcodetable[256];
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user