1
//============================================================================
3
// MM MM 6666 555555 0000 2222
4
// MMMM MMMM 66 66 55 00 00 22 22
5
// MM MMM MM 66 55 00 00 22
6
// MM M MM 66666 55555 00 00 22222 -- "A 6502 Microprocessor Emulator"
7
// MM MM 66 66 55 00 00 22
8
// MM MM 66 66 55 55 00 00 22
9
// MM MM 6666 5555 0000 222222
11
// Copyright (c) 1995-2008 by Bradford W. Mott and the Stella team
13
// See the file "license" for information on usage and redistribution of
14
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
16
// $Id: M6502Hi.hxx,v 1.6 2008/02/06 13:45:22 stephena Exp $
17
//============================================================================
30
This class provides a high compatibility 6502 microprocessor emulator.
31
The memory accesses and cycle counts it generates are valid at the
32
sub-instruction level and "false" reads are generated (such as the ones
33
produced by the Indirect,X addressing when it crosses a page boundary).
34
This provides provides better compatibility for hardware that has side
35
effects and for games which are very time sensitive.
37
@author Bradford W. Mott
38
@version $Id: M6502Hi.hxx,v 1.6 2008/02/06 13:45:22 stephena Exp $
40
class M6502High : public M6502
44
Create a new high compatibility 6502 microprocessor with the
45
specified cycle multiplier.
47
@param systemCyclesPerProcessorCycle The cycle multiplier
49
M6502High(uInt32 systemCyclesPerProcessorCycle);
58
Execute instructions until the specified number of instructions
59
is executed, someone stops execution, or an error occurs. Answers
60
true iff execution stops normally.
62
@param number Indicates the number of instructions to execute
63
@return true iff execution stops normally
65
virtual bool execute(uInt32 number);
68
Saves the current state of this device to the given Serializer.
70
@param out The serializer device to save to.
71
@return The result of the save. True on success, false on failure.
73
virtual bool save(Serializer& out);
76
Loads the current state of this device from the given Deserializer.
78
@param in The deserializer device to load from.
79
@return The result of the load. True on success, false on failure.
81
virtual bool load(Deserializer& in);
84
Get a null terminated string which is the processors's name (i.e. "M6532")
86
@return The name of the device
88
virtual const char* name() const;
92
Get the number of memory accesses to distinct memory locations
94
@return The number of memory accesses to distinct memory locations
96
uInt32 distinctAccesses() const
98
return myNumberOfDistinctAccesses;
103
Called after an interrupt has be requested using irq() or nmi()
105
void interruptHandler();
109
Get the byte at the specified address and update the cycle
112
@return The byte at the specified address
114
inline uInt8 peek(uInt16 address);
117
Change the byte at the specified address to the given value and
118
update the cycle count
120
@param address The address where the value should be stored
121
@param value The value to be stored at the address
123
inline void poke(uInt16 address, uInt8 value);
126
// Indicates the numer of distinct memory accesses
127
uInt32 myNumberOfDistinctAccesses;
129
// Indicates the last address which was accessed
130
uInt16 myLastAddress;