Browse Source

Made some tweaks after experimenting with interlaced mode:

- VSync needs to be enabled for interlaced mode to work at all
- Y offset does not need to be doubled in interlaced mode
unrollquadloop
Nico de Poel 3 years ago
parent
commit
62cfb91f1c
  1. 11
      display.c
  2. 4
      input.c

11
display.c

@ -46,6 +46,7 @@ VECTOR aspect_scale = { SCREENWIDTH * ONE / 320, ONE, ONE };
u_short polyCount;
u_char enableTexturing = 1;
u_char enableVsync = 0;
void display_init()
{
@ -104,8 +105,8 @@ void display_reset(int mode, u_char interlaced, u_char widescreen, int *outScree
if (interlaced)
{
screenHeight <<= 1;
yOffset <<= 1;
aspect_scale.vy <<= 1;
enableVsync = 1;
// Define display environments, interlaced images cover the same area in VRAM
SetDefDispEnv(&disp[0], 0, 0, SCREENWIDTH, screenHeight);
@ -119,6 +120,8 @@ void display_reset(int mode, u_char interlaced, u_char widescreen, int *outScree
}
else
{
enableVsync = 0;
// Define display environments, first on top and second on bottom
SetDefDispEnv(&disp[0], 0, 0, SCREENWIDTH, screenHeight);
SetDefDispEnv(&disp[1], 0, screenHeight, SCREENWIDTH, screenHeight);
@ -184,9 +187,9 @@ void display_finish()
// Wait for all drawing to complete
DrawSync(0);
// Wait for vertical sync to cap the logic to 60fps (or 50 in PAL mode)
// and prevent screen tearing
//VSync(0);
// Wait for vertical sync to cap the logic to 60fps (or 50 in PAL mode) and prevent screen tearing
if (enableVsync)
VSync(0);
// Switch pages
PutDispEnv(&disp[db]);

4
input.c

@ -98,8 +98,8 @@ void input_process()
if (!(buttons & PAD_SELECT) && (prevButtons & PAD_SELECT))
{
// Switch display mode
//dispmode = (dispmode + 1) & 0x3;
//display_reset(!!(dispmode & 2), !!(dispmode & 1), widescreen, NULL);
// dispmode = (dispmode + 1) & 0x3;
// display_reset(!!(dispmode & 2), !!(dispmode & 1), widescreen, NULL);
display_reset(!GetVideoMode(), 0, widescreen, NULL);
}
if (!(buttons & PAD_START) && (prevButtons & PAD_START))

Loading…
Cancel
Save