Previous 199869 Revisions Next

r21727 Saturday 9th March, 2013 at 00:51:04 UTC by Nathan Woods
m6809 fix; vectrex works now (nw)
[src/emu/cpu/m6809]m6809.h m6809inl.h

trunk/src/emu/cpu/m6809/m6809.h
r21726r21727
195195   void write_operand(int ordinal, UINT8 data);
196196
197197   // delay loops
198   bool match_target_bytes(UINT16 address, const UINT8 *bytes, int length);
198199   void burn_any_delay_loops();
199200
200201   // instructions
trunk/src/emu/cpu/m6809/m6809inl.h
r21726r21727
124124
125125
126126//-------------------------------------------------
127//  match_target_bytes
128//-------------------------------------------------
129
130inline ATTR_FORCE_INLINE bool m6809_base_device::match_target_bytes(UINT16 address, const UINT8 *bytes, int length)
131{
132   UINT8 *start_raw      = (UINT8 *) m_direct->read_raw_ptr(address);
133   UINT8 *start_decrypted   = (UINT8 *) m_direct->read_decrypted_ptr(address);
134   UINT8 *end_raw         = (UINT8 *) m_direct->read_raw_ptr(address + length - 1);
135   UINT8 *end_decrypted   = (UINT8 *) m_direct->read_decrypted_ptr(address + length - 1);
136
137   return (start_raw != NULL)
138      && (end_raw != NULL)
139      && (start_raw == start_decrypted)
140      && (end_raw == end_decrypted)
141      && (start_raw + length - 1 == end_raw)
142      && !memcmp(start_raw, bytes, length);
143}
144
145
146//-------------------------------------------------
127147//  burn_any_delay_loops - optimization for delay
128148//   loops
129149//-------------------------------------------------
130150
131151inline ATTR_FORCE_INLINE void m6809_base_device::burn_any_delay_loops()
132152{
153   static const UINT8 target_bytes[] = { 0x30, 0x1F, 0x26, 0xFC };
154
133155   if ((m_opcode == 0x26)
134156      && !(m_cc & CC_Z)
135157      && !(machine().debug_flags & DEBUG_FLAG_CALL_HOOK)
136      && (read_opcode_arg(m_pc.w) == 0xFC)
137      && (read_opcode(m_pc.w - 3) == 0x30)
138      && (read_opcode_arg(m_pc.w - 2) == 0x1F))
158      && match_target_bytes(m_pc.w - 3, target_bytes, ARRAY_LENGTH(target_bytes)))
139159   {
140160      // LEAX -1,X ; BNE *
141161      UINT16 burned_loops = MIN((int) m_x.w - 1, m_icount / 8);

Previous 199869 Revisions Next


© 1997-2024 The MAME Team