Browse Source

Added anamorphic 16:9 widescreen support because why the heck not?

tess_experiment
Nico de Poel 3 years ago
parent
commit
586ee71c3c
  1. 7
      display.c
  2. 2
      display.h
  3. 19
      input.c

7
display.c

@ -57,7 +57,7 @@ void display_init()
// Start the display in progressive mode
int screenHeight;
display_reset(GetVideoMode(), 0, &screenHeight);
display_reset(GetVideoMode(), 0, 0, &screenHeight);
// Clear double buffer counter
db = 0;
@ -73,7 +73,7 @@ void display_init()
FntOpen(0, 16, SCREENWIDTH, screenHeight, 0, 512);
}
void display_reset(int mode, u_char interlaced, int *outScreenHeight)
void display_reset(int mode, u_char interlaced, u_char widescreen, int *outScreenHeight)
{
if (mode != GetVideoMode())
SetVideoMode(mode);
@ -125,6 +125,9 @@ void display_reset(int mode, u_char interlaced, int *outScreenHeight)
disp[0].isinter = disp[1].isinter = 0;
}
// Scale X coordinates to set the aspect ratio for 4:3 or 16:9 widescreen
aspect_scale.vx = SCREENWIDTH * ONE / (widescreen ? 426 : 320);
disp[0].screen.y = disp[1].screen.y = yOffset;
disp[0].screen.h = disp[1].screen.h = screenHeight;

2
display.h

@ -13,7 +13,7 @@ extern u_long *curOT;
extern u_short polyCount;
void display_init();
void display_reset(int mode, u_char interlaced, int *outScreenHeight);
void display_reset(int mode, u_char interlaced, u_char widescreen, int *outScreenHeight);
void display_start();
void display_finish();

19
input.c

@ -13,6 +13,8 @@ static const char deadZone = 0x30;
static u_char dispmode = 0;
static u_char dispmode_held = 0;
static u_char widescreen = 0;
static u_char widescreen_held = 0;
void input_init()
{
@ -107,14 +109,27 @@ void input_process()
{
dispmode_held = 1;
//dispmode = (dispmode + 1) & 0x3;
//display_reset(!!(dispmode & 2), !!(dispmode & 1), NULL);
display_reset(!GetVideoMode(), 0, NULL);
//display_reset(!!(dispmode & 2), !!(dispmode & 1), widescreen, NULL);
display_reset(!GetVideoMode(), 0, widescreen, NULL);
}
}
else
{
dispmode_held = 0;
}
if (!(buttons & PAD_START))
{
if (!widescreen_held)
{
widescreen_held = 1;
widescreen = !widescreen;
display_reset(GetVideoMode(), 0, widescreen, NULL);
}
}
else
{
widescreen_held = 0;
}
// Check for analog controller
u_char padType = padBuffer[0][1] >> 4;

Loading…
Cancel
Save