diff --git a/display.c b/display.c index 5763d40..027df95 100644 --- a/display.c +++ b/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]); diff --git a/input.c b/input.c index fb8423b..d9cb894 100644 --- a/input.c +++ b/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))