~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): Tom Lear
  • Date: 1999-11-06 16:41:05 UTC
  • Revision ID: james.westby@ubuntu.com-19991106164105-iygopamo5mpcozvx
Tags: upstream-1.1
ImportĀ upstreamĀ versionĀ 1.1

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-1998 by Bradford W. Mott
 
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.2 1998/07/15 20:48:20 bwmott Exp $
 
17
//============================================================================
 
18
 
 
19
#ifndef M6502HIGH_HXX
 
20
#define M6502HIGH_HXX
 
21
 
 
22
class M6502High;
 
23
 
 
24
#include "bspf.hxx"
 
25
#include "M6502.hxx"
 
26
 
 
27
/**
 
28
  This class provides a high compatibility 6502 microprocessor emulator.  
 
29
  The memory accesses and cycle counts it generates are valid at the
 
30
  sub-instruction level and "false" reads are generated (such as the ones 
 
31
  produced by the Indirect,X addressing when it crosses a page boundary).
 
32
  This provides provides better compatibility for hardware that has side
 
33
  effects and for games which are very time sensitive.
 
34
 
 
35
  @author  Bradford W. Mott
 
36
  @version $Id: M6502Hi.hxx,v 1.2 1998/07/15 20:48:20 bwmott Exp $
 
37
*/
 
38
class M6502High : public M6502
 
39
{
 
40
  public:
 
41
    /**
 
42
      Create a new high compatibility 6502 microprocessor with the 
 
43
      specified cycle multiplier.
 
44
 
 
45
      @param systemCyclesPerProcessorCycle The cycle multiplier
 
46
    */
 
47
    M6502High(uInt32 systemCyclesPerProcessorCycle);
 
48
 
 
49
    /**
 
50
      Destructor
 
51
    */
 
52
    virtual ~M6502High();
 
53
 
 
54
  public:
 
55
    /**
 
56
      Execute instructions until the specified number of instructions
 
57
      is executed, someone stops execution, or an error occurs.  Answers
 
58
      true iff execution stops normally.
 
59
 
 
60
      @param number Indicates the number of instructions to execute
 
61
      @return true iff execution stops normally
 
62
    */
 
63
    virtual bool execute(uInt32 number);
 
64
 
 
65
  public:
 
66
    /**
 
67
      Get the number of memory accesses to distinct memory locations
 
68
 
 
69
      @return The number of memory accesses to distinct memory locations
 
70
    */
 
71
    uInt32 distinctAccesses() const
 
72
    {
 
73
      return myNumberOfDistinctAccesses;
 
74
    }
 
75
 
 
76
  protected:
 
77
    /**
 
78
      Called after an interrupt has be requested using irq() or nmi()
 
79
    */
 
80
    void interruptHandler();
 
81
 
 
82
  protected:
 
83
    /*
 
84
      Get the byte at the specified address and update the cycle
 
85
      count
 
86
 
 
87
      @return The byte at the specified address
 
88
    */
 
89
    inline uInt8 peek(uInt16 address);
 
90
 
 
91
    /**
 
92
      Change the byte at the specified address to the given value and
 
93
      update the cycle count
 
94
 
 
95
      @param address The address where the value should be stored
 
96
      @param value The value to be stored at the address
 
97
    */
 
98
    inline void poke(uInt16 address, uInt8 value);
 
99
 
 
100
  private:
 
101
    // Indicates the numer of distinct memory accesses
 
102
    uInt32 myNumberOfDistinctAccesses;
 
103
 
 
104
    // Indicates the last address which was accessed
 
105
    uInt16 myLastAddress;
 
106
};
 
107
#endif
 
108