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

« back to all changes in this revision

Viewing changes to src/emucore/m6502/src/M6502Low.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: M6502Low.hxx,v 1.8 2008/02/06 13:45:22 stephena Exp $
17
 
//============================================================================
18
 
 
19
 
#ifndef M6502LOW_HXX
20
 
#define M6502LOW_HXX
21
 
 
22
 
class M6502Low;
23
 
class Serializer;
24
 
class Deserializer;
25
 
 
26
 
#include "bspf.hxx"
27
 
#include "M6502.hxx"
28
 
 
29
 
/**
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:
33
 
 
34
 
    1. Only memory accesses which are actually needed are done 
35
 
       (i.e. no "false" reads and writes are performed)
36
 
 
37
 
    2. Cycle counts are updated at the beginning of the instruction
38
 
       execution and not valid at the sub-instruction level
39
 
 
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.
42
 
  
43
 
  @author  Bradford W. Mott
44
 
  @version $Id: M6502Low.hxx,v 1.8 2008/02/06 13:45:22 stephena Exp $
45
 
*/
46
 
class M6502Low : public M6502
47
 
{
48
 
  public:
49
 
    /**
50
 
      Create a new low compatibility 6502 microprocessor with the specified 
51
 
      cycle multiplier.
52
 
 
53
 
      @param systemCyclesPerProcessorCycle The cycle multiplier
54
 
    */
55
 
    M6502Low(uInt32 systemCyclesPerProcessorCycle);
56
 
 
57
 
    /**
58
 
      Destructor
59
 
    */
60
 
    virtual ~M6502Low();
61
 
 
62
 
  public:
63
 
    /**
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.
67
 
 
68
 
      @param number Indicates the number of instructions to execute
69
 
      @return true iff execution stops normally
70
 
    */
71
 
    virtual bool execute(uInt32 number);
72
 
 
73
 
    /**
74
 
      Saves the current state of this device to the given Serializer.
75
 
 
76
 
      @param out The serializer device to save to.
77
 
      @return The result of the save.  True on success, false on failure.
78
 
    */
79
 
    virtual bool save(Serializer& out);
80
 
 
81
 
    /**
82
 
      Loads the current state of this device from the given Deserializer.
83
 
 
84
 
      @param in The deserializer device to load from.
85
 
      @return The result of the load.  True on success, false on failure.
86
 
    */
87
 
    virtual bool load(Deserializer& in);
88
 
 
89
 
    /**
90
 
      Get a null terminated string which is the processors's name (i.e. "M6532")
91
 
 
92
 
      @return The name of the device
93
 
    */
94
 
    virtual const char* name() const;
95
 
 
96
 
  protected:
97
 
    /**
98
 
      Called after an interrupt has be requested using irq() or nmi()
99
 
    */
100
 
    void interruptHandler();
101
 
 
102
 
  protected:
103
 
    /*
104
 
      Get the byte at the specified address 
105
 
 
106
 
      @return The byte at the specified address
107
 
    */
108
 
    inline uInt8 peek(uInt16 address);
109
 
 
110
 
    /**
111
 
      Change the byte at the specified address to the given value
112
 
 
113
 
      @param address The address where the value should be stored
114
 
      @param value The value to be stored at the address
115
 
    */
116
 
    inline void poke(uInt16 address, uInt8 value);
117
 
};
118
 
#endif
119