1
//============================================================================
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
11
// Copyright (c) 1995-2008 by Bradford W. Mott and the Stella team
13
// See the file "license" for information on usage and redistribution of
14
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
16
// $Id: MediaSrc.hxx,v 1.19 2008/05/21 14:01:30 stephena Exp $
17
//============================================================================
19
#ifndef MEDIASOURCE_HXX
20
#define MEDIASOURCE_HXX
30
This class provides an interface for accessing graphics and audio data.
32
@author Bradford W. Mott
33
@version $Id: MediaSrc.hxx,v 1.19 2008/05/21 14:01:30 stephena Exp $
39
Create a new media source
46
virtual ~MediaSource();
50
This method should be called at an interval corresponding to the
51
desired frame rate to update the media source. Invoking this method
52
will update the graphics buffer and generate the corresponding audio
55
virtual void update() = 0;
58
Answers the current frame buffer
60
@return Pointer to the current frame buffer
62
virtual uInt8* currentFrameBuffer() const = 0;
65
Answers the previous frame buffer
67
@return Pointer to the previous frame buffer
69
virtual uInt8* previousFrameBuffer() const = 0;
71
#ifdef DEBUGGER_SUPPORT
73
This method should be called whenever a new scanline is to be drawn.
74
Invoking this method will update the graphics buffer and generate
75
the corresponding audio samples.
77
virtual void updateScanline() = 0;
80
This method should be called whenever a new partial scanline is to be
81
drawn by stepping one CPU instruction. Invoking this method will update the
82
graphics buffer and generate the corresponding audio samples.
84
virtual void updateScanlineByStep() = 0;
87
This method should be called whenever a new partial scanline is to be
88
drawn by tracing to target address. Invoking this method will update the
89
graphics buffer and generate the corresponding audio samples.
91
virtual void updateScanlineByTrace(int target) = 0;
96
Answers the height of the frame buffer
98
@return The frame's height
100
virtual uInt32 height() const = 0;
103
Answers the width of the frame buffer
105
@return The frame's width
107
virtual uInt32 width() const = 0;
111
Enables/disables auto-frame calculation. If enabled, the
112
MediaSource should re-adjust the framerate at regular intervals.
114
@param mode Whether to enable or disable all auto-frame calculation
116
virtual void enableAutoFrame(bool mode) = 0;
119
Answers the total number of scanlines the media source generated
120
in producing the current frame buffer.
122
@return The total number of scanlines generated
124
virtual uInt32 scanlines() const = 0;
127
Sets the sound device for the TIA.
129
virtual void setSound(Sound& sound) = 0;
132
// Copy constructor isn't supported by this class so make it private
133
MediaSource(const MediaSource&);
135
// Assignment operator isn't supported by this class so make it private
136
MediaSource& operator = (const MediaSource&);