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

« back to all changes in this revision

Viewing changes to src/emucore/Cart.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
//   SSSS    tt          lll  lll       
 
4
//  SS  SS   tt           ll   ll        
 
5
//  SS     tttttt  eeee   ll   ll   aaaa 
 
6
//   SSSS    tt   ee  ee  ll   ll      aa
 
7
//      SS   tt   eeeeee  ll   ll   aaaaa  --  "An Atari 2600 VCS Emulator"
 
8
//  SS  SS   tt   ee      ll   ll  aa  aa
 
9
//   SSSS     ttt  eeeee llll llll  aaaaa
 
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: Cart.hxx,v 1.2 1998/07/15 20:24:05 bwmott Exp $
 
17
//============================================================================
 
18
 
 
19
#ifndef CARTRIDGE_HXX
 
20
#define CARTRIDGE_HXX
 
21
 
 
22
class Cartridge;
 
23
class Properties;
 
24
class System;
 
25
 
 
26
#include "bspf.hxx"
 
27
#include "Device.hxx"
 
28
 
 
29
/**
 
30
  A cartridge is a device which contains the machine code for a 
 
31
  game and handles any bankswitching performed by the cartridge.
 
32
 
 
33
  @author  Bradford W. Mott
 
34
  @version $Id: Cart.hxx,v 1.2 1998/07/15 20:24:05 bwmott Exp $
 
35
*/
 
36
class Cartridge : public Device
 
37
{
 
38
  public:
 
39
    /**
 
40
      Create a new cartridge object allocated on the heap.  The
 
41
      type of cartridge created depends on the properties object.
 
42
 
 
43
      @param image A pointer to the ROM image
 
44
      @param size The size of the ROM image 
 
45
      @param properties The properties associated with the game
 
46
      @return Pointer to the new cartridge object allocated on the heap
 
47
    */
 
48
    static Cartridge* create(const uInt8* image, uInt32 size, 
 
49
        const Properties& properties);
 
50
 
 
51
  public:
 
52
    /**
 
53
      Create a new cartridge
 
54
    */
 
55
    Cartridge();
 
56
 
 
57
    /**
 
58
      Destructor
 
59
    */
 
60
    virtual ~Cartridge();
 
61
 
 
62
  private:
 
63
    /**
 
64
      Try to auto-detect the bankswitching type of the cartridge
 
65
 
 
66
      @param image A pointer to the ROM image
 
67
      @param size The size of the ROM image 
 
68
      @return The "best guess" for the cartridge type
 
69
    */
 
70
    static string autodetectType(const uInt8* image, uInt32 size);
 
71
 
 
72
  private:
 
73
    // Copy constructor isn't supported by cartridges so make it private
 
74
    Cartridge(const Cartridge&);
 
75
 
 
76
    // Assignment operator isn't supported by cartridges so make it private
 
77
    Cartridge& operator = (const Cartridge&);
 
78
};
 
79
#endif
 
80