~ubuntu-branches/debian/squeeze/stella/squeeze

« back to all changes in this revision

Viewing changes to src/emucore/m6502/src/M6502Hi.hxx

  • Committer: Bazaar Package Importer
  • Author(s): Stephen Kitt
  • Date: 2010-07-12 23:49:36 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20100712234936-juawrr3etzhr2qpv
Tags: 3.1.2-1
* New maintainer (closes: #532039).
* New upstream version (closes: #461121):
  - includes launcher (closes: #396058).
* Fix the reference to the X Window System in the description (closes:
  #411815).
* Move to main, DFSG-free ROMs are available (see README.Debian).
* Enhance the package description.
* Drop the libslang2-dev dependency (closes: #560274).
* Remove the Encoding entry from stella.desktop.
* Avoid ignoring errors when cleaning.
* Add ${misc:Depends} to the package dependencies.
* Provide a doc-base file to install the documentation using doc-base.
* Switch to debhelper 7 with a simplified rules file.
* Use autotools-dev to provide updated configuration files.
* Update to Standards-Version 3.9.0:
  - Move to menu section Applications/Emulators.
  - Move the homepage declaration.
* Re-write the manpage.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
//============================================================================
2
 
//
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
10
 
//
11
 
// Copyright (c) 1995-2008 by Bradford W. Mott and the Stella team
12
 
//
13
 
// See the file "license" for information on usage and redistribution of
14
 
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
15
 
//
16
 
// $Id: M6502Hi.hxx,v 1.6 2008/02/06 13:45:22 stephena Exp $
17
 
//============================================================================
18
 
 
19
 
#ifndef M6502HIGH_HXX
20
 
#define M6502HIGH_HXX
21
 
 
22
 
class M6502High;
23
 
class Serializer;
24
 
class Deserializer;
25
 
 
26
 
#include "bspf.hxx"
27
 
#include "M6502.hxx"
28
 
 
29
 
/**
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.
36
 
 
37
 
  @author  Bradford W. Mott
38
 
  @version $Id: M6502Hi.hxx,v 1.6 2008/02/06 13:45:22 stephena Exp $
39
 
*/
40
 
class M6502High : public M6502
41
 
{
42
 
  public:
43
 
    /**
44
 
      Create a new high compatibility 6502 microprocessor with the 
45
 
      specified cycle multiplier.
46
 
 
47
 
      @param systemCyclesPerProcessorCycle The cycle multiplier
48
 
    */
49
 
    M6502High(uInt32 systemCyclesPerProcessorCycle);
50
 
 
51
 
    /**
52
 
      Destructor
53
 
    */
54
 
    virtual ~M6502High();
55
 
 
56
 
  public:
57
 
    /**
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.
61
 
 
62
 
      @param number Indicates the number of instructions to execute
63
 
      @return true iff execution stops normally
64
 
    */
65
 
    virtual bool execute(uInt32 number);
66
 
 
67
 
    /**
68
 
      Saves the current state of this device to the given Serializer.
69
 
 
70
 
      @param out The serializer device to save to.
71
 
      @return The result of the save.  True on success, false on failure.
72
 
    */
73
 
    virtual bool save(Serializer& out);
74
 
 
75
 
    /**
76
 
      Loads the current state of this device from the given Deserializer.
77
 
 
78
 
      @param in The deserializer device to load from.
79
 
      @return The result of the load.  True on success, false on failure.
80
 
    */
81
 
    virtual bool load(Deserializer& in);
82
 
 
83
 
    /**
84
 
      Get a null terminated string which is the processors's name (i.e. "M6532")
85
 
 
86
 
      @return The name of the device
87
 
    */
88
 
    virtual const char* name() const;
89
 
 
90
 
  public:
91
 
    /**
92
 
      Get the number of memory accesses to distinct memory locations
93
 
 
94
 
      @return The number of memory accesses to distinct memory locations
95
 
    */
96
 
    uInt32 distinctAccesses() const
97
 
    {
98
 
      return myNumberOfDistinctAccesses;
99
 
    }
100
 
 
101
 
  protected:
102
 
    /**
103
 
      Called after an interrupt has be requested using irq() or nmi()
104
 
    */
105
 
    void interruptHandler();
106
 
 
107
 
  protected:
108
 
    /*
109
 
      Get the byte at the specified address and update the cycle
110
 
      count
111
 
 
112
 
      @return The byte at the specified address
113
 
    */
114
 
    inline uInt8 peek(uInt16 address);
115
 
 
116
 
    /**
117
 
      Change the byte at the specified address to the given value and
118
 
      update the cycle count
119
 
 
120
 
      @param address The address where the value should be stored
121
 
      @param value The value to be stored at the address
122
 
    */
123
 
    inline void poke(uInt16 address, uInt8 value);
124
 
 
125
 
  private:
126
 
    // Indicates the numer of distinct memory accesses
127
 
    uInt32 myNumberOfDistinctAccesses;
128
 
 
129
 
    // Indicates the last address which was accessed
130
 
    uInt16 myLastAddress;
131
 
};
132
 
#endif
133