File: M6532.hxx

package info (click to toggle)
stella 0.7-2
  • links: PTS
  • area: non-free
  • in suites: hamm, slink
  • size: 864 kB
  • ctags: 1,158
  • sloc: cpp: 6,615; ansic: 492; makefile: 224; asm: 31
file content (74 lines) | stat: -rw-r--r-- 1,875 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
//============================================================================
//
//    SSSS    tt          lll  lll              
//   SS  SS   tt           ll   ll                
//   SS     tttttt  eeee   ll   ll   aaaa    "An Atari 2600 VCS Emulator"
//    SSSS    tt   ee  ee  ll   ll      aa      
//       SS   tt   eeeeee  ll   ll   aaaaa   Copyright (c) 1995,1996,1997
//   SS  SS   tt   ee      ll   ll  aa  aa         Bradford W. Mott
//    SSSS     ttt  eeeee llll llll  aaaaa    
//
//============================================================================

#ifndef M6532_HXX
#define M6532_HXX

class System;

#include "machine.hxx"
#include "Device.hxx"

/**
  RIOT

  @author  Bradford W. Mott
  @version $Id: M6532.hxx,v 1.2 1997/05/17 19:00:06 bwmott Exp $
*/
class M6532 : public Device
{
  public:
    /// Constructor
    M6532(System& system);
 
    /// Destructor
    virtual ~M6532();
 
    /// Answer the byte at the given address
    uByte peek(uWord addr);

    /// Write value at the given address.
    void poke(uWord addr, uByte value);

    /// Reset to my power on state
    void reset();

  private:
    // Offset used for RAM addressing (always zero)
    uWord myRAMOffset;

    // I contain an amazing 128 bytes of RAM
    uByte myRAM[128];

    // Indicates the adjustment value for the timer from the properties
    Long myTimerAdjustment;

    // Current value of my Timer
    uLong myTimer;

    // Log base 2 of the number of cycles in a timer interval
    uLong myIntervalShift;

    // Indicates the number of CPU cycles when the timer was last set
    uLong myCyclesWhenTimerSet;

    // Indicates if a read from timer has taken place after interrupt occured
    bool myTimerReadAfterInterrupt;

    // Data Direction Register for Port A
    uByte myDDRA;

    // Data Direction Register for Port B
    uByte myDDRB;
};
#endif