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: M6502Low.hxx,v 1.8 2008/02/06 13:45:22 stephena Exp $
17
//============================================================================
30
This class provides a low compatibility 6502 microprocessor emulator.
31
The memory accesses and cycle updates of this emulator are not 100%
32
accurate as shown below:
34
1. Only memory accesses which are actually needed are done
35
(i.e. no "false" reads and writes are performed)
37
2. Cycle counts are updated at the beginning of the instruction
38
execution and not valid at the sub-instruction level
40
If speed is the most important issue then use this class, however, if
41
better compatibility is neccessary use one of the other 6502 classes.
43
@author Bradford W. Mott
44
@version $Id: M6502Low.hxx,v 1.8 2008/02/06 13:45:22 stephena Exp $
46
class M6502Low : public M6502
50
Create a new low compatibility 6502 microprocessor with the specified
53
@param systemCyclesPerProcessorCycle The cycle multiplier
55
M6502Low(uInt32 systemCyclesPerProcessorCycle);
64
Execute instructions until the specified number of instructions
65
is executed, someone stops execution, or an error occurs. Answers
66
true iff execution stops normally.
68
@param number Indicates the number of instructions to execute
69
@return true iff execution stops normally
71
virtual bool execute(uInt32 number);
74
Saves the current state of this device to the given Serializer.
76
@param out The serializer device to save to.
77
@return The result of the save. True on success, false on failure.
79
virtual bool save(Serializer& out);
82
Loads the current state of this device from the given Deserializer.
84
@param in The deserializer device to load from.
85
@return The result of the load. True on success, false on failure.
87
virtual bool load(Deserializer& in);
90
Get a null terminated string which is the processors's name (i.e. "M6532")
92
@return The name of the device
94
virtual const char* name() const;
98
Called after an interrupt has be requested using irq() or nmi()
100
void interruptHandler();
104
Get the byte at the specified address
106
@return The byte at the specified address
108
inline uInt8 peek(uInt16 address);
111
Change the byte at the specified address to the given value
113
@param address The address where the value should be stored
114
@param value The value to be stored at the address
116
inline void poke(uInt16 address, uInt8 value);