PS1: Properly reset GPU

This commit is contained in:
UnknownShadow200 2024-07-15 22:29:07 +10:00
parent 7bef6c6d99
commit f32af27f1b
2 changed files with 8 additions and 9 deletions

View File

@ -92,7 +92,6 @@ void Gfx_Create(void) {
Gfx.Created = true;
Gfx_RestoreState();
ResetGraph(0);
SetupContexts(Window_Main.Width, Window_Main.Height, 63, 0, 127);
SetDispMask(1);

View File

@ -26,6 +26,7 @@
static cc_bool launcherMode;
struct _DisplayData DisplayInfo;
struct cc_window WindowInfo;
static DISPENV disp;
void Window_PreInit(void) { }
void Window_Init(void) {
@ -49,9 +50,16 @@ void Window_Init(void) {
void Window_Free(void) { }
void Window_Create2D(int width, int height) {
ResetGraph(0);
launcherMode = true;
SetDefDispEnv(&disp, 0, 0, SCREEN_XRES, SCREEN_YRES);
PutDispEnv(&disp);
SetDispMask(1);
}
void Window_Create3D(int width, int height) {
ResetGraph(0);
launcherMode = false;
}
@ -160,15 +168,7 @@ void Gamepads_Process(float delta) {
/*########################################################################################################################*
*------------------------------------------------------Framebuffer--------------------------------------------------------*
*#########################################################################################################################*/
static DISPENV disp;
void Window_AllocFramebuffer(struct Bitmap* bmp, int width, int height) {
SetDefDispEnv(&disp, 0, 0, SCREEN_XRES, SCREEN_YRES);
disp.isinter = 1;
PutDispEnv(&disp);
SetDispMask(1);
bmp->scan0 = (BitmapCol*)Mem_Alloc(width * height, BITMAPCOLOR_SIZE, "window pixels");
bmp->width = width;
bmp->height = height;