ScummVM API documentation
OSystem_Dreamcast Class Reference
Inheritance diagram for OSystem_Dreamcast:
DCHardware EventsBaseBackend PaletteManager FilesystemFactory BaseBackend Common::EventSource Common::NonCopyable OSystem Common::NonCopyable

Public Member Functions

virtual void initBackend ()
 
bool hasFeature (Feature f)
 
void setFeatureState (Feature f, bool enable)
 
bool getFeatureState (Feature f)
 
PaletteManagergetPaletteManager ()
 
Graphics::PixelFormat getScreenFormat () const
 
Common::List< Graphics::PixelFormatgetSupportedFormats () const
 
void initSize (uint w, uint h, const Graphics::PixelFormat *format)
 
int16 getHeight ()
 
int16 getWidth ()
 
void copyRectToScreen (const void *buf, int pitch, int x, int y, int w, int h)
 
virtual Graphics::SurfacelockScreen ()
 
virtual void unlockScreen ()
 
void updateScreen ()
 
bool showMouse (bool visible)
 
void warpMouse (int x, int y)
 
void setMouseCursor (const void *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, bool dontScale, const Graphics::PixelFormat *format, const byte *mask)
 
void setCursorPalette (const byte *colors, uint start, uint num)
 
void setShakePos (int shake_x_pos, int shake_y_pos)
 
uint32 getMillis (bool skipRecord=false)
 
void delayMillis (uint msecs)
 
void getTimeAndDate (TimeDate &td, bool skipRecord=false) const
 
bool pollEvent (Common::Event &event)
 
void quit ()
 
int16 getOverlayHeight ()
 
int16 getOverlayWidth ()
 
bool isOverlayVisible () const
 
void showOverlay (bool inGUI)
 
void hideOverlay ()
 
void clearOverlay ()
 
void grabOverlay (Graphics::Surface &surface)
 
void copyRectToOverlay (const void *buf, int pitch, int x, int y, int w, int h)
 
virtual Graphics::PixelFormat getOverlayFormat () const
 
Common::MutexInternalcreateMutex ()
 
void setWindowCaption (const Common::U32String &caption)
 
Audio::MixergetMixer ()
 
void mouseToSoftKbd (int x, int y, int &rx, int &ry) const
 
AbstractFSNodemakeRootFileNode () const override
 
AbstractFSNodemakeCurrentDirectoryFileNode () const override
 
AbstractFSNodemakeFileNodePath (const Common::String &path) const override
 
- Public Member Functions inherited from BaseBackend
bool setScaler (const char *name, int factor) override final
 
void displayMessageOnOSD (const Common::U32String &msg) override
 
void displayActivityIconOnOSD (const Graphics::Surface *icon) override
 
void fillScreen (uint32 col) override
 
void fillScreen (const Common::Rect &r, uint32 col) override
 
- Public Member Functions inherited from OSystem
void destroy ()
 
virtual void init ()
 
bool backendInitialized () const
 
virtual void engineInit ()
 
virtual void engineDone ()
 
virtual void taskStarted (Task)
 
virtual void taskFinished (Task)
 
virtual void updateStartSettings (const Common::String &executable, Common::String &command, Common::StringMap &startSettings, Common::StringArray &additionalArgs)
 
virtual const GraphicsModegetSupportedGraphicsModes () const
 
virtual int getDefaultGraphicsMode () const
 
virtual bool setGraphicsMode (int mode, uint flags=kGfxModeNoFlags)
 
bool setGraphicsMode (const char *name)
 
virtual int getGraphicsMode () const
 
Graphics::PixelFormat getScreenFormat () const
 
Common::List< Graphics::PixelFormatgetSupportedFormats () const
 
virtual Common::Array< uint > getSupportedAntiAliasingLevels () const
 
virtual OpenGL::ContextType getOpenGLType () const
 
virtual bool setShader (const Common::Path &fileName)
 
virtual const GraphicsModegetSupportedStretchModes () const
 
virtual int getDefaultStretchMode () const
 
virtual bool setStretchMode (int mode)
 
bool setStretchMode (const char *name)
 
virtual int getStretchMode () const
 
virtual uint getDefaultScaler () const
 
virtual uint getDefaultScaleFactor () const
 
virtual bool setScaler (uint mode, int factor)
 
virtual uint getScaler () const
 
virtual uint getScaleFactor () const
 
virtual void initSizeHint (const Graphics::ModeList &modes)
 
virtual int getScreenChangeID () const
 
virtual void beginGFXTransaction ()
 
virtual TransactionError endGFXTransaction ()
 
virtual float getHiDPIScreenFactor () const
 
virtual void setFocusRectangle (const Common::Rect &rect)
 
virtual void clearFocusRectangle ()
 
virtual void saveScreenshot ()
 
virtual bool lockMouse (bool lock)
 
virtual uint32 getDoubleClickTime () const
 
virtual Common::TimerManagergetTimerManager ()
 
Common::EventManagergetEventManager ()
 
virtual Common::HardwareInputSetgetHardwareInputSet ()
 
virtual Common::KeymapArray getGlobalKeymaps ()
 
virtual Common::KeymapperDefaultBindingsgetKeymapperDefaultBindings ()
 
AudioCDManagergetAudioCDManager ()
 
virtual void fatalError ()
 
virtual Common::SaveFileManagergetSavefileManager ()
 
virtual Common::TextToSpeechManagergetTextToSpeechManager ()
 
virtual Common::DialogManagergetDialogManager ()
 
virtual DLC::StoregetDLCStore ()
 
virtual FilesystemFactorygetFilesystemFactory ()
 
virtual void addSysArchivesToSearchSet (Common::SearchSet &s, int priority=0)
 
virtual Common::Path getDefaultConfigFileName ()
 
virtual Common::Path getDefaultLogFileName ()
 
virtual void registerDefaultSettings (const Common::String &target) const
 
virtual GUI::OptionsContainerWidgetbuildBackendOptionsWidget (GUI::GuiObject *boss, const Common::String &name, const Common::String &target) const
 
virtual const char *const * buildHelpDialogData ()
 
virtual void applyBackendSettings ()
 
virtual void messageBox (LogMessageType::Type type, const char *message)
 
virtual bool displayLogFile ()
 
virtual bool hasTextInClipboard ()
 
virtual Common::U32String getTextFromClipboard ()
 
virtual bool setTextInClipboard (const Common::U32String &text)
 
virtual bool openUrl (const Common::String &url)
 
virtual bool isConnectionLimited ()
 
- Public Member Functions inherited from PaletteManager
void setPalette (const Graphics::Palette &pal, uint start=0)
 
Graphics::Palette grabPalette (uint start, uint num)
 
- Public Member Functions inherited from FilesystemFactory
virtual ~FilesystemFactory ()
 
virtual Common::String getSystemFullPath (const Common::String &path) const
 

Protected Member Functions

void setPalette (const byte *colors, uint start, uint num)
 
void grabPalette (byte *colors, uint start, uint num) const
 

Additional Inherited Members

- Public Types inherited from OSystem
enum  Task { kLocalServer, kCloudDownload, kDataPackDownload }
 
enum  Feature {
  kFeatureFullscreenMode, kFeatureAspectRatioCorrection, kFeatureFilteringMode, kFeatureStretchMode,
  kFeatureVirtualKeyboard, kFeatureCursorPalette, kFeatureCursorAlpha, kFeatureCursorMask,
  kFeatureCursorMaskInvert, kFeatureCursorMaskPaletteXorColorXnor, kFeatureOverlaySupportsAlpha, kFeatureIconifyWindow,
  kFeatureOpenGLForGame, kFeatureShadersForGame, kFeatureVSync, kFeatureFullscreenToggleKeepsContext,
  kFeatureDisplayLogFile, kFeatureClipboardSupport, kFeatureOpenUrl, kFeatureTouchpadMode,
  kFeatureKbdMouseSpeed, kFeatureJoystickDeadzone, kFeatureScalers, kFeatureShaders,
  kFeatureDLC, kFeatureSystemBrowserDialog, kFeatureNoQuit, kFeatureTouchscreen,
  kFeatureCpuNEON, kFeatureCpuSSE2, kFeatureCpuSSE41, kFeatureCpuAVX2,
  kFeatureCpuAltivec, kFeatureRotationMode
}
 
enum  GfxModeFlags { kGfxModeNoFlags = 0, kGfxModeRender3d = (1 << 0) }
 
enum  TransactionError {
  kTransactionSuccess = 0, kTransactionAspectRatioFailed = (1 << 0), kTransactionFullscreenFailed = (1 << 1), kTransactionModeSwitchFailed = (1 << 2),
  kTransactionSizeChangeFailed = (1 << 3), kTransactionFormatNotSupported = (1 << 4), kTransactionFilteringFailed = (1 << 5), kTransactionStretchModeSwitchFailed = (1 << 6),
  kTransactionShaderChangeFailed = (1 << 7), kTransactionVSyncFailed = (1 << 8)
}
 
- Protected Attributes inherited from OSystem
AudioCDManager_audiocdManager
 
Common::EventManager_eventManager
 
Common::TimerManager_timerManager
 
Common::SaveFileManager_savefileManager
 
Common::TextToSpeechManager_textToSpeechManager
 
Common::DialogManager_dialogManager
 
FilesystemFactory_fsFactory
 
DLC::Store_dlcStore
 
Common::U32String _clipboard
 
bool _dummyUnused
 

Member Function Documentation

◆ initBackend()

virtual void OSystem_Dreamcast::initBackend ( )
virtual

The following method is called once, from main.cpp, after all config data (including command line params etc.) is fully loaded.

Note
Subclasses should always invoke the implementation of their parent class. They should do so near the end of their own implementation.

Reimplemented from EventsBaseBackend.

◆ hasFeature()

bool OSystem_Dreamcast::hasFeature ( Feature  f)
virtual

Determine whether the backend supports the specified feature.

Reimplemented from OSystem.

◆ setFeatureState()

void OSystem_Dreamcast::setFeatureState ( Feature  f,
bool  enable 
)
virtual

Enable or disable the specified feature.

For example, this may be used to enable fullscreen mode or to deactivate aspect correction, etc.

Reimplemented from OSystem.

◆ getFeatureState()

bool OSystem_Dreamcast::getFeatureState ( Feature  f)
virtual

Query the state of the specified feature.

For example, test whether fullscreen mode is active or not.

Reimplemented from OSystem.

◆ getPaletteManager()

PaletteManager* OSystem_Dreamcast::getPaletteManager ( )
inlinevirtual

Return the palette manager singleton.

For more information, see PaletteManager.

Implements OSystem.

◆ setPalette()

void OSystem_Dreamcast::setPalette ( const byte *  colors,
uint  start,
uint  num 
)
protectedvirtual

Replace the specified range of the palette with new colors. The palette entries from 'start' till (start+num-1) will be replaced - so a full palette update is accomplished via start=0, num=256.

The palette data is specified in interleaved RGB format. That is, the first byte of the memory block 'colors' points at is the red component of the first new color; the second byte the green component of the first new color; the third byte the blue component, the last byte to the alpha (transparency) value. Then the second color starts, and so on. So memory looks like this: R1-G1-B1-R2-G2-B2-R3-...

Parameters
colorsthe new palette data, in interleaved RGB format
startthe first palette entry to be updated
numthe number of palette entries to be updated
Note
It is an error if start+num exceeds 256, behavior is undefined in that case (the backend may ignore it silently or assert).
It is an error if this function gets called when the pixel format in use (the return value of getScreenFormat) has more than one byte per pixel.
See also
getScreenFormat

Implements PaletteManager.

◆ grabPalette()

void OSystem_Dreamcast::grabPalette ( byte *  colors,
uint  start,
uint  num 
) const
protectedvirtual

Grabs a specified part of the currently active palette. The format is the same as for setPalette.

This should return exactly the same RGB data as was setup via previous setPalette calls.

For example, for every valid value of start and num of the following code:

byte origPal[num*3]; // Setup origPal's data however you like g_system->setPalette(origPal, start, num); byte obtainedPal[num*3]; g_system->grabPalette(obtainedPal, start, num);

the following should be true:

memcmp(origPal, obtainedPal, num*3) == 0

See also
setPalette
Parameters
colorsthe palette data, in interleaved RGB format
startthe first platte entry to be read
numthe number of palette entries to be read
Note
It is an error if this function gets called when the pixel format in use (the return value of getScreenFormat) has more than one byte per pixel.
See also
getScreenFormat

Implements PaletteManager.

◆ initSize()

void OSystem_Dreamcast::initSize ( uint  width,
uint  height,
const Graphics::PixelFormat format 
)
virtual

Set the size and color format of the virtual screen.

Typical sizes include:

  • 320x200 (e.g. for most SCUMM games, and Simon)
  • 320x240 (e.g. for FM-TOWN SCUMM games)
  • 640x480 (e.g. for Curse of Monkey Island)

This is the resolution for which the client code generates data. This is not necessarily equal to the actual display size. For example, a backend may magnify the graphics to fit on the screen (see also the GraphicsMode), stretch the data to perform aspect ratio correction, or shrink it to fit on small screens (in cell phones).

Typical formats include:

  • CLUT8 (e.g. 256 color, for most games)
  • RGB555 (e.g. 16-bit color, for later SCUMM HE games)
  • RGB565 (e.g. 16-bit color, for Urban Runner)

This is the pixel format for which the client code generates data. It is not necessarily equal to the hardware pixel format. For example, a backend may perform color lookup of 8-bit graphics before pushing a screen to hardware, or correct the ARGB color order.

Parameters
widthNew virtual screen width.
heightNew virtual screen height.
formatNew virtual screen pixel format.

Implements OSystem.

◆ getHeight()

int16 OSystem_Dreamcast::getHeight ( )
inlinevirtual

Return the currently set virtual screen height.

See also
initSize
Returns
Currently set virtual screen height.

Implements OSystem.

◆ getWidth()

int16 OSystem_Dreamcast::getWidth ( )
inlinevirtual

Return the currently set virtual screen width.

See also
initSize
Returns
Currently set virtual screen width.

Implements OSystem.

◆ copyRectToScreen()

void OSystem_Dreamcast::copyRectToScreen ( const void *  buf,
int  pitch,
int  x,
int  y,
int  w,
int  h 
)
virtual

Blit a bitmap to the virtual screen.

The real screen will not immediately be updated to reflect the changes. Client code must call updateScreen to ensure any changes are visible to the user. This can be used to optimize drawing and reduce flicker.

If the current pixel format has one byte per pixel, the graphics data uses 8 bits per pixel, using the palette specified via setPalette. If more than one byte per pixel is in use, the graphics data uses the pixel format returned by getScreenFormat.

Parameters
bufBuffer containing the graphics data source.
pitchPitch of the buffer (number of bytes in a scanline).
xx coordinate of the destination rectangle.
yy coordinate of the destination rectangle.
wWidth of the destination rectangle.
hHeight of the destination rectangle.
Note
The specified destination rectangle must be completly contained in the visible screen space, and must be non-empty. If not, a backend may or may not perform clipping, trigger an assert, or silently corrupt memory.
See also
updateScreen
getScreenFormat

Implements OSystem.

◆ lockScreen()

virtual Graphics::Surface* OSystem_Dreamcast::lockScreen ( )
virtual

Lock the active screen framebuffer and return a Graphics::Surface representing it.

The caller can then perform arbitrary graphics transformations on the framebuffer (blitting, scrolling, etc.). Must be followed by a matching call to unlockScreen(). Code that is calling this should make sure to only lock the framebuffer for the shortest time possible, as the whole system is potentially stalled while the lock is active.

Returns
0 if an error occurs. Otherwise, a surface with the pixel format described by getScreenFormat is returned.

The returned surface must not be deleted by the client code.

See also
getScreenFormat

Implements OSystem.

◆ unlockScreen()

virtual void OSystem_Dreamcast::unlockScreen ( )
virtual

Unlock the screen framebuffer, and mark it as dirty, i.e. during the next updateScreen() call, the whole screen will be updated.

Implements OSystem.

◆ updateScreen()

void OSystem_Dreamcast::updateScreen ( )
virtual

Flush the whole screen, i.e. render the current content of the screen framebuffer to the display.

This method may be called very often by engines. Backends are hence supposed to only perform any redrawing if it is necessary and otherwise return immediately. See https://wiki.scummvm.org/index.php/HOWTO-Backends#updateScreen.28.29_method

Implements OSystem.

◆ showMouse()

bool OSystem_Dreamcast::showMouse ( bool  visible)
virtual

Show or hide the mouse cursor.

Currently, the backend is not required to immediately draw the mouse cursor on showMouse(true).

See also
Graphics::CursorManager::showMouse

Implements OSystem.

◆ warpMouse()

void OSystem_Dreamcast::warpMouse ( int  x,
int  y 
)
virtual

Move ("warp") the mouse cursor to the specified position in virtual screen coordinates.

Parameters
xNew x position of the mouse.
yNew y position of the mouse.

Implements OSystem.

◆ setMouseCursor()

void OSystem_Dreamcast::setMouseCursor ( const void *  buf,
uint  w,
uint  h,
int  hotspotX,
int  hotspotY,
uint32  keycolor,
bool  dontScale,
const Graphics::PixelFormat format,
const byte *  mask 
)
virtual

Set the bitmap used for drawing the cursor.

Parameters
bufPixmap data to be used.
wWidth of the mouse cursor.
hHeight of the mouse cursor.
hotspotXHorizontal offset from the left side to the hotspot.
hotspotYVertical offset from the top side to the hotspot.
keycolorTransparency color value. This should not exceed the maximum color value of the specified format. In case it does, the behavior is undefined. The backend might just error out or simply ignore the value. (The SDL backend will just assert to prevent abuse of this). This parameter does nothing if a mask is provided.
dontScaleWhether the cursor should never be scaled. An exception is high ppi displays, where the cursor might be too small to notice otherwise, these are allowed to scale the cursor anyway.
formatPointer to the pixel format that the cursor graphic uses (0 means CLUT8).
maskA mask containing values from the CursorMaskValue enum for each cursor pixel.

Implements OSystem.

◆ setCursorPalette()

void OSystem_Dreamcast::setCursorPalette ( const byte *  colors,
uint  start,
uint  num 
)
virtual

Replace the specified range of cursor palette with new colors.

The palette entries from 'start' till (start+num-1) will be replaced - so a full palette update is accomplished via start=0, num=256.

Backends which implement this should have the kFeatureCursorPalette flag set.

See also
setPalette
kFeatureCursorPalette

Reimplemented from OSystem.

◆ setShakePos()

void OSystem_Dreamcast::setShakePos ( int  shakeXOffset,
int  shakeYOffset 
)
virtual

Set current shake position, a feature needed for screen effects in some engines.

The effect causes the displayed graphics to be shifted downwards and rightwards by the specified offsets (the offsets can be negative to shift upwards or leftwards). The area at the border of the screen which is moved into view by this (for example at the bottom when moving upward) is filled with black. This does not cause any graphic data to be lost. To restore the original view, the game engine only has to call this method again with offset equal to zero. No calls to copyRectToScreen are necessary.

Parameters
shakeXOffsetShake x offset.
shakeYOffsetShake y offset.
Note
This is currently used in the SCUMM, QUEEN, KYRA, SCI, DREAMWEB, SUPERNOVA, TEENAGENT, TOLTECS, ULTIMA, and PETKA engines.

Implements OSystem.

◆ getMillis()

uint32 OSystem_Dreamcast::getMillis ( bool  skipRecord = false)
virtual

Get the number of milliseconds since the program was started.

Parameters
skipRecordSkip recording of this value by the event recorder. This might be needed particularly when we are in an on-screen GUI loop where the player can pause the recording.

Implements OSystem.

◆ delayMillis()

void OSystem_Dreamcast::delayMillis ( uint  msecs)
virtual

Delay/sleep for the specified amount of milliseconds.

Implements OSystem.

◆ getTimeAndDate()

void OSystem_Dreamcast::getTimeAndDate ( TimeDate td,
bool  skipRecord = false 
) const
virtual

Get the current time and date, in the local timezone.

On many systems, this corresponds to the combination of time() and localtime().

Implements OSystem.

◆ pollEvent()

bool OSystem_Dreamcast::pollEvent ( Common::Event event)
virtual

Query an event from the source.

Parameters
eventReference to the event struct where the event should be stored.
Return values
trueIf an event was polled, false otherwise.

Implements Common::EventSource.

◆ quit()

void OSystem_Dreamcast::quit ( )
virtual

Quit (exit) the application.

Implements OSystem.

◆ getOverlayHeight()

int16 OSystem_Dreamcast::getOverlayHeight ( )
virtual

Return the height of the overlay.

See also
getHeight

Implements OSystem.

◆ getOverlayWidth()

int16 OSystem_Dreamcast::getOverlayWidth ( )
virtual

Return the width of the overlay.

See also
getWidth

Implements OSystem.

◆ isOverlayVisible()

bool OSystem_Dreamcast::isOverlayVisible ( ) const
inlinevirtual

Return true if the overlay mode is activated, false otherwise.

Implements OSystem.

◆ showOverlay()

void OSystem_Dreamcast::showOverlay ( bool  inGUI)
virtual

Activate the overlay mode.

Implements OSystem.

◆ hideOverlay()

void OSystem_Dreamcast::hideOverlay ( )
virtual

Deactivate the overlay mode.

Implements OSystem.

◆ clearOverlay()

void OSystem_Dreamcast::clearOverlay ( )
virtual

Reset the overlay.

After calling this method while the overlay mode is active, the user should be seeing only the game graphics. How this is achieved depends on how the backend implements the overlay. It either sets all pixels of the overlay to be transparent (when alpha blending is used) or, in case of fake alpha blending, it might just put a copy of the current game graphics screen into the overlay.

Implements OSystem.

◆ grabOverlay()

void OSystem_Dreamcast::grabOverlay ( Graphics::Surface surface)
virtual

Copy the content of the overlay into a surface provided by the caller.

This is only used to implement fake alpha blending.

Implements OSystem.

◆ copyRectToOverlay()

void OSystem_Dreamcast::copyRectToOverlay ( const void *  buf,
int  pitch,
int  x,
int  y,
int  w,
int  h 
)
virtual

Blit a graphics buffer to the overlay.

In a sense, this is the reverse of grabOverlay.

Parameters
bufBuffer containing the graphics data source.
pitchPitch of the buffer (number of bytes in a scanline).
xx coordinate of the destination rectangle.
yy coordinate of the destination rectangle.
wWidth of the destination rectangle.
hHeight of the destination rectangle.
See also
copyRectToScreen
grabOverlay

Implements OSystem.

◆ getOverlayFormat()

virtual Graphics::PixelFormat OSystem_Dreamcast::getOverlayFormat ( ) const
inlinevirtual

Return the pixel format description of the overlay.

See also
Graphics::PixelFormat

Implements OSystem.

◆ createMutex()

Common::MutexInternal* OSystem_Dreamcast::createMutex ( )
virtual

Create a new mutex.

Returns
The newly created mutex, or 0 if an error occurred.

Implements OSystem.

◆ setWindowCaption()

void OSystem_Dreamcast::setWindowCaption ( const Common::U32String caption)
virtual

Set a window caption or any other comparable status display to the given value.

Parameters
captionThe window caption to use.

Reimplemented from OSystem.

◆ getMixer()

Audio::Mixer* OSystem_Dreamcast::getMixer ( )
inlinevirtual

Return the audio mixer.

For more information, see Audio::Mixer.

Implements OSystem.

◆ makeRootFileNode()

AbstractFSNode* OSystem_Dreamcast::makeRootFileNode ( ) const
overridevirtual

Returns a special node representing the filesystem root. The starting point for any file system browsing.

On Unix, this will be simply the node for / (the root directory). On Windows, it will be a special node which "contains" all drives (C:, D:, E:).

Implements FilesystemFactory.

◆ makeCurrentDirectoryFileNode()

AbstractFSNode* OSystem_Dreamcast::makeCurrentDirectoryFileNode ( ) const
overridevirtual

Returns a node representing the "current directory". If your system does not support this concept, you can either try to emulate it or simply return some "sensible" default directory node, e.g. the same value as getRoot() returns.

Implements FilesystemFactory.

◆ makeFileNodePath()

AbstractFSNode* OSystem_Dreamcast::makeFileNodePath ( const Common::String path) const
overridevirtual

Construct a node based on a path; the path is in the same format as it would be for calls to fopen().

Furthermore getNodeForPath(oldNode.path()) should create a new node identical to oldNode. Hence, we can use the "path" value for persistent storage e.g. in the config file.

Parameters
pathThe path string to create a FSNode for.

Implements FilesystemFactory.


The documentation for this class was generated from the following file: