22 #ifndef PSP_DISPLAY_MAN_H 23 #define PSP_DISPLAY_MAN_H 25 #include "backends/platform/psp/thread.h" 26 #include "common/list.h" 28 #define UNCACHED(x) ((byte *)(((uint32)(x)) | 0x40000000)) 29 #define CACHED(x) ((byte *)(((uint32)(x)) & 0xBFFFFFFF)) 37 void *allocate(int32 size,
bool smallAllocation =
false);
38 void deallocate(
void *pointer);
40 static inline bool isAddressInVram(
void *address) {
41 if ((uint32)(CACHED(address)) >= VRAM_START_ADDRESS && (uint32)(CACHED(address)) < VRAM_END_ADDRESS)
54 void *getEnd() {
return address + size; }
55 Allocation(
void *Address, uint32 Size) : address((byte *)Address), size(Size) {}
56 Allocation() : address(0), size(0) {}
60 VRAM_START_ADDRESS = 0x04000000,
61 VRAM_END_ADDRESS = 0x04200000,
62 VRAM_SMALL_ADDRESS = VRAM_END_ADDRESS - (4 * 1024)
65 uint32 _bytesAllocated;
75 _renderSema(1, 1), _callbackId(-1) {}
80 bool isRenderFinished() {
return _renderFinished; }
81 void sleepUntilRenderFinished();
82 void setupCallbackThread();
84 virtual void threadFunction();
85 static uint32 _displayList[];
86 uint32 _lastRenderTime;
87 void guProgramDisplayBufferSizes();
88 static int guCallback(
int,
int,
void *__this);
110 DisplayManager() : _screen(0), _cursor(0), _overlay(0), _keyboard(0),
111 _imageViewer(0), _lastUpdateTime(0), _graphicsMode(0) {}
116 void waitUntilRenderFinished();
117 bool setGraphicsMode(
int mode);
118 int getGraphicsMode()
const {
return _graphicsMode; }
119 uint32 getDefaultGraphicsMode()
const {
return FIT_TO_SCREEN; }
123 void setScreen(
Screen *screen) { _screen = screen; }
124 void setCursor(
Cursor *cursor) { _cursor = cursor; }
125 void setOverlay(
Overlay *overlay) { _overlay = overlay; }
126 void setKeyboard(
PSPKeyboard *keyboard) { _keyboard = keyboard; }
127 void setImageViewer(
ImageViewer *imageViewer) { _imageViewer = imageViewer; }
132 float getScaleX()
const {
return _displayParams.scaleX; }
133 float getScaleY()
const {
return _displayParams.scaleY; }
134 uint32 getOutputWidth()
const {
return _displayParams.screenOutput.width; }
135 uint32 getOutputHeight()
const {
return _displayParams.screenOutput.height; }
136 uint32 getOutputBitsPerPixel()
const {
return _displayParams.outputBitsPerPixel; }
140 struct GlobalDisplayParams {
145 uint32 outputBitsPerPixel;
146 GlobalDisplayParams() : scaleX(0.0f), scaleY(0.0f), outputBitsPerPixel(0) {}
157 uint32 _lastUpdateTime;
159 GlobalDisplayParams _displayParams;
162 void calculateScaleParams();
163 bool isTimeToUpdate();
Possible output formats onscreen
Definition: display_manager.h:106
GraphicsModeID
Definition: display_manager.h:105
Definition: atari-screen.h:60
Definition: display_manager.h:72
Definition: display_manager.h:103
Definition: display_manager.h:34
Definition: atari-cursor.h:38
Definition: image_viewer.h:29
Definition: pspkeyboard.h:37
Definition: default_display_client.h:65
Definition: display_client.h:67
Definition: singleton.h:42