22 #ifndef BACKENDS_GRAPHICS_ATARI_H 23 #define BACKENDS_GRAPHICS_ATARI_H 25 #include "backends/graphics/graphics.h" 26 #include "common/events.h" 28 #include <mint/osbind.h> 30 #include "common/rect.h" 31 #include "graphics/surface.h" 33 #include "atari-cursor.h" 34 #include "atari-pendingscreenchanges.h" 35 #include "atari-screen.h" 37 #define MAX_HZ_SHAKE 16 // Falcon only 38 #define MAX_V_SHAKE 16 55 {
"direct",
"Direct rendering", kDirectRendering },
56 {
"single",
"Single buffering", kSingleBuffering },
57 {
"triple",
"Triple buffering", kTripleBuffering },
58 {
nullptr,
nullptr, 0 }
62 int getDefaultGraphicsMode()
const override {
return kTripleBuffering; }
64 int getGraphicsMode()
const override {
return _currentState.mode; }
68 int getScreenChangeID()
const override {
return 0; }
70 void beginGFXTransaction()
override;
73 int16 getHeight()
const override {
return _currentState.height; }
74 int16 getWidth()
const override {
return _currentState.width; }
75 void setPalette(
const byte *colors, uint start, uint num)
override;
76 void grabPalette(byte *colors, uint start, uint num)
const override;
77 void copyRectToScreen(
const void *buf,
int pitch,
int x,
int y,
int w,
int h)
override;
79 void unlockScreen()
override;
80 void fillScreen(uint32 col)
override;
81 void fillScreen(
const Common::Rect &r, uint32 col)
override;
82 void updateScreen()
override;
83 void setShakePos(
int shakeXOffset,
int shakeYOffset)
override;
84 void setFocusRectangle(
const Common::Rect& rect)
override {}
85 void clearFocusRectangle()
override {}
87 void showOverlay(
bool inGUI)
override;
88 void hideOverlay()
override;
89 bool isOverlayVisible()
const override {
return _overlayState == kOverlayVisible; }
91 void clearOverlay()
override;
93 void copyRectToOverlay(
const void *buf,
int pitch,
int x,
int y,
int w,
int h)
override;
94 int16 getOverlayHeight()
const override {
return 480; }
95 int16 getOverlayWidth()
const override {
return _vgaMonitor ? 640 : 640*1.2; }
97 bool showMouse(
bool visible)
override;
98 void warpMouse(
int x,
int y)
override;
99 void setMouseCursor(
const void *buf, uint w, uint h,
int hotspotX,
int hotspotY, uint32 keycolor,
100 bool dontScale =
false,
const Graphics::PixelFormat *format = NULL,
const byte *mask = NULL)
override;
101 void setCursorPalette(
const byte *colors, uint start, uint num)
override;
104 if (isOverlayVisible()) {
105 return _screen[kOverlayBuffer]->cursor.getPosition();
108 return _screen[kFrontBuffer]->cursor.getPosition();
111 void updateMousePosition(
int deltaX,
int deltaY);
117 typedef void* (*AtariMemAlloc)(
size_t bytes);
118 typedef void (*AtariMemFree)(
void *ptr);
120 void allocateSurfaces();
126 kDirectRendering = 0,
127 kSingleBuffering = 1,
131 enum CustomEventAction {
132 kActionToggleAspectRatioCorrection = 100,
135 #ifndef DISABLE_FANCY_THEMES 136 int16 getMaximumScreenHeight()
const {
return 480; }
137 int16 getMaximumScreenWidth()
const {
return _tt ? 320 : (_vgaMonitor ? 640 : 640*1.2); }
139 int16 getMaximumScreenHeight()
const {
return _tt ? 480 : 240; }
140 int16 getMaximumScreenWidth()
const {
return _tt ? 320 : (_vgaMonitor ? 320 : 320*1.2); }
144 int x,
int y,
int w,
int h);
147 const void *buf,
int pitch,
int x,
int y,
int w,
int h,
152 bool isOverlayDirectRendering()
const;
154 virtual AtariMemAlloc getStRamAllocFunc()
const {
155 return [](
size_t bytes) {
return (
void*)Mxalloc(bytes, MX_STRAM); };
157 virtual AtariMemFree getStRamFreeFunc()
const {
158 return [](
void *ptr) { Mfree(ptr); };
162 int destX,
int destY,
167 virtual void drawMaskedSprite(
Graphics::Surface &dstSurface,
int dstBitsPerPixel,
169 int destX,
int destY,
172 virtual Common::Rect alignRect(
int x,
int y,
int w,
int h)
const = 0;
178 bool _vgaMonitor =
true;
180 bool _checkUnalignedPitch =
false;
182 struct GraphicsState {
184 : inTransaction(
false)
191 bool isValid()
const {
192 return mode != kUnknownMode && width > 0 && height > 0 && format.
bytesPerPixel != 0;
201 GraphicsState _pendingState;
202 GraphicsState _currentState;
205 bool _aspectRatioCorrection =
false;
216 Screen *_screen[kBufferCount] = {};
225 int _overlayState = kOverlayHidden;
226 bool _ignoreHideOverlay =
true;
bool notifyEvent(const Common::Event &event) override
void grabPalette(byte *colors, uint start, uint num) const override
Feature
Definition: system.h:403
Definition: atari-screen.h:60
Definition: atari-cursor.h:38
int16 width() const
Definition: rect.h:192
TransactionError
Definition: system.h:1155
int16 left
Definition: rect.h:145
void setPalette(const byte *colors, uint start, uint num) override
Definition: graphics.h:37
Definition: atari-pendingscreenchanges.h:33
Definition: atari-graphics.h:40
void copyRectToSurface(const void *buffer, int srcPitch, int destX, int destY, int width, int height)
int16 height() const
Definition: rect.h:193
Definition: atari-screen.h:44