File: CartAR.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 (83 lines) | stat: -rw-r--r-- 2,347 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
75
76
77
78
79
80
81
82
83
//============================================================================
//
//    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 CARTRIDGEAR_HXX
#define CARTRIDGEAR_HXX

class CartridgeAR;

#include "machine.hxx"
#include "Cart.hxx"

/**
  This is the cartridge class for Arcadia (aka Starpath) Supercharger 
  games.  Christopher Salomon provided most of the details and code 
  used for this class.

  The Supercharger has four 2K banks.  There are three banks of RAM 
  and one bank of ROM.  All 6K of the RAM can be read and written.

  @author  Bradford W. Mott
  @version $Id: CartAR.hxx,v 1.1 1997/05/17 19:04:12 bwmott Exp $
*/
class CartridgeAR : public Cartridge
{
  public:
    /// Constructor
    CartridgeAR(System& system, uByte* image, uLong size);
 
    /// Destructor
    virtual ~CartridgeAR();

    /// Answer the byte at the given address
    virtual uByte peek(uWord addr);

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

  private:
    // Handle a change to the bank configuration
    void bankConfiguration(uByte configuration);

    // Handle setting the current image from the load images
    void setupCurrentImage(uByte load);

    // Sets up a "dummy" bootstrap ROM in the ROM bank of the cartridge
    void setupROM();
     
  private:
    // Addressing offset in ROM image
    uWord myImageOffset[2];

    // Current 8k ROM Image of the cartridge
    uByte myImage[8192];

    // 256 byte header of the cartridge
    uByte myHeader[256];

    // All of the load images of the cartridge (needed for multiloads)
    uByte *myLoadImages;

    // Indicates how many 8K loads images there are
    uByte myNumberOfLoadImages;

    // Indicates if the RAM is write enabled
    bool myWriteEnabled;

    // Indicates if the ROM's power is on or off
    bool myPower;

    // Indicates when the power was last turned on
    uLong myPowerRomCycle;
};
#endif