Browse Source

Reset background and dither flags when switching video modes. Fixes flickering background.

tess_experiment
Nico de Poel 3 years ago
parent
commit
1336d0b2b5
  1. 16
      display.c
  2. 5
      input.c

16
display.c

@ -57,14 +57,6 @@ void display_init()
int screenHeight;
display_reset(GetVideoMode(), 0, &screenHeight);
// Set and enable clear color
setRGB0(&draw[0], 49, 77, 121);
setRGB0(&draw[1], 49, 77, 121);
draw[0].isbg = 1;
draw[0].dtd = 1;
draw[1].isbg = 1;
draw[1].dtd = 1;
// Clear double buffer counter
db = 0;
@ -134,6 +126,14 @@ void display_reset(int mode, u_char interlaced, int *outScreenHeight)
disp[0].screen.y = disp[1].screen.y = yOffset;
disp[0].screen.h = disp[1].screen.h = screenHeight;
// Set and enable clear color
setRGB0(&draw[0], 49, 77, 121);
setRGB0(&draw[1], 49, 77, 121);
draw[0].isbg = 1;
draw[0].dtd = 1;
draw[1].isbg = 1;
draw[1].dtd = 1;
gte_SetGeomOffset(SCREENWIDTH >> 1, screenHeight >> 1);
if (outScreenHeight != NULL)

5
input.c

@ -11,7 +11,7 @@ static const int moveSpeed = 1024;
static const short rotSpeed = 1024;
static const char deadZone = 0x30;
static u_char disp_interlace = 0;
static u_char dispmode = 0;
static u_char dispmode_held = 0;
void input_init()
@ -106,7 +106,8 @@ void input_process()
if (!dispmode_held)
{
dispmode_held = 1;
disp_interlace = !disp_interlace;
//dispmode = (dispmode + 1) & 0x3;
//display_reset(!!(dispmode & 2), !!(dispmode & 1), NULL);
display_reset(!GetVideoMode(), 0, NULL);
}
}

Loading…
Cancel
Save