Skip to content

Commit

Permalink
port: actually parse allocation strings; double gfx buffer size on 64…
Browse files Browse the repository at this point in the history
…-bit
  • Loading branch information
fgsfdsfgs committed Dec 17, 2024
1 parent a14e9ed commit 1e76f6a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
2 changes: 2 additions & 0 deletions port/src/pdmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,8 @@ void mainInit(void)
joyInit();
joyReset();

var8005d9b0 = rmonIsDisabled();

g_Is4Mb = (osGetMemSize() <= 0x400000);
g_VmShowStats = 0;

Expand Down
19 changes: 14 additions & 5 deletions src/game/gfxmemory.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@
* marker for the end of the second element's allocation.
*/

/**
* On 64-bit platforms the Gfx struct is twice as large.
*/
#ifdef PLATFORM_64BIT
#define GFX_SIZE_MULTIPLIER 2
#else
#define GFX_SIZE_MULTIPLIER 1
#endif

u8 *g_GfxBuffers[NUM_GFXTASKS + 1];
u32 var800aa58c;
u8 *g_VtxBuffers[NUM_GFXTASKS + 1];
Expand All @@ -44,10 +53,10 @@ u8 g_GfxActiveBufferIndex;
u32 g_GfxRequestedDisplayList;

u32 g_GfxSizesByPlayerCount[] = {
0x00010000,
0x00018000,
0x00020000,
0x00028000,
0x00010000 * GFX_SIZE_MULTIPLIER,
0x00018000 * GFX_SIZE_MULTIPLIER,
0x00020000 * GFX_SIZE_MULTIPLIER,
0x00028000 * GFX_SIZE_MULTIPLIER,
};

u32 g_VtxSizesByPlayerCount[] = {
Expand Down Expand Up @@ -94,7 +103,7 @@ void gfxReset(void)
// ******** Original Amount required = %dK ber buffer\n
// ******** Extra Amount required = %dK ber buffer\n
// ******** Total of %dK (Double Buffered)\n
g_GfxSizesByPlayerCount[PLAYERCOUNT() - 1] = gfx + gfxtra;
g_GfxSizesByPlayerCount[PLAYERCOUNT() - 1] = (gfx + gfxtra) * GFX_SIZE_MULTIPLIER;
}

if (argFindByPrefix(1, "-mvtx")) {
Expand Down

0 comments on commit 1e76f6a

Please sign in to comment.