Properly specify save file buffer and maximum size

This commit is contained in:
Lephenixnoir 2021-09-19 14:10:37 +02:00
parent 0602d21683
commit 26c451697d
Signed by: Lephenixnoir
GPG Key ID: 1BBA026E13FC0495
2 changed files with 7 additions and 3 deletions

View File

@ -67,7 +67,8 @@
#include "g_game.h"
#define SAVEGAMESIZE 0x2c000
/* CGDoom: Amount of data available at screens[0], here full VRAM */
#define SAVEGAMESIZE (384*216*2)
#define SAVESTRINGSIZE 24
@ -1009,7 +1010,7 @@ void G_DoSaveGame (void)
sprintf(name, SAVEGAMENAME "%d.dsg", savegameslot);
description = savedescription;
save_p = savebuffer = screens[1]+0x4000;
save_p = savebuffer = screens[0];
memcpy (save_p, description, SAVESTRINGSIZE);
save_p += SAVESTRINGSIZE;

View File

@ -131,7 +131,10 @@ byte *I_ScreenBase(int screen)
-> Give 320*200 = 64 kB to screens[0] (main display)
-> Give 320*200 = 64 kB to screens[1] (intermissions)
-> Give 320*32 = 10 kiB to screens[4] (status bar)
-> 27 kiB are left */
-> 27 kiB are left
Note that the screen buffers are used as temporary storage to write game
data during saves, so if continuity is broken g_game.c must be updated
to point savebuffer elsewhere and/or update SAVEGAMESIZE. */
if (screen == 0)
return CGDOOM_SCREENS_BASE;
if (screen == 1)