Skip to content

Commit

Permalink
Add LGJ scaling and fix ABC
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbydilley committed May 25, 2024
1 parent d5ce6f3 commit 4c006d5
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 2 deletions.
39 changes: 39 additions & 0 deletions src/lindbergh/graphics.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,45 @@ int XF86VidModeGetAllModeLines(Display *display, int screen, int *modecount_retu
return true;
}

/**
* Function which games use to scale the output, some games behave well when this is changed
* others less so.
*/
void glViewport(GLint x, GLint y, GLsizei width, GLsizei height)
{
int (*_glViewport)(GLint x, GLint y, GLsizei width, GLsizei height) = dlsym(RTLD_NEXT, "glViewport");
switch (getConfig()->crc32)
{
case LETS_GO_JUNGLE:
case LETS_GO_JUNGLE_REVA:
{
if (width == 1360 && height == 768)
{
width = getConfig()->width;
height = getConfig()->height;
}
}
break;

case LETS_GO_JUNGLE_SPECIAL:
{
printf("glViewPort(%d, %d, %d, %d);\n", x, y, width, height);

if (width == 2048 && height == 768)
{
width = getConfig()->width * 2;
height = getConfig()->height;
}
}
break;

default:
break;
}

_glViewport(x, y, width, height);
}

typedef unsigned int uint;

int glXSwapIntervalSGI(int interval)
Expand Down
4 changes: 2 additions & 2 deletions src/lindbergh/patch.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ int initPatch()
detourFunction(0x083a61cc, stubReturn);
}
break;
case AFTER_BURNER_CLIMAX_REVA:
case AFTER_BURNER_CLIMAX_REVB:
{
if (config->showDebugMessages == 1)
{
Expand All @@ -309,7 +309,7 @@ int initPatch()
detourFunction(0x081e492e, amDipswSetLed);
}
break;
case AFTER_BURNER_CLIMAX_REVB:
case AFTER_BURNER_CLIMAX_REVA:
{
if (config->showDebugMessages == 1)
{
Expand Down

0 comments on commit 4c006d5

Please sign in to comment.