mirror of
https://github.com/Oibaf66/frodo-wii.git
synced 2024-11-26 05:24:21 +01:00
Correct save game handling again
This commit is contained in:
parent
d34cb27cb8
commit
3ef8d0328d
@ -167,6 +167,7 @@ public:
|
|||||||
int fake_key_keytime;
|
int fake_key_keytime;
|
||||||
|
|
||||||
bool prefs_changed;
|
bool prefs_changed;
|
||||||
|
char save_game_name[256];
|
||||||
|
|
||||||
void select_disc(Prefs *np);
|
void select_disc(Prefs *np);
|
||||||
void bind_key(Prefs *np);
|
void bind_key(Prefs *np);
|
||||||
|
@ -71,6 +71,8 @@ void C64::c64_ctor1(void)
|
|||||||
this->fake_key_type = 0;
|
this->fake_key_type = 0;
|
||||||
|
|
||||||
this->prefs_changed = false;
|
this->prefs_changed = false;
|
||||||
|
memset(this->save_game_name, 0, sizeof(this->save_game_name));
|
||||||
|
strcpy(this->save_game_name, "unknown");
|
||||||
|
|
||||||
MENU_SIZE_X = FULL_DISPLAY_X - FULL_DISPLAY_X / 4;
|
MENU_SIZE_X = FULL_DISPLAY_X - FULL_DISPLAY_X / 4;
|
||||||
MENU_SIZE_Y = FULL_DISPLAY_Y - FULL_DISPLAY_Y / 4;
|
MENU_SIZE_Y = FULL_DISPLAY_Y - FULL_DISPLAY_Y / 4;
|
||||||
@ -189,6 +191,7 @@ void C64::select_disc(Prefs *np)
|
|||||||
{
|
{
|
||||||
snprintf(np->DrivePath[0], 255, "%s/%s",
|
snprintf(np->DrivePath[0], 255, "%s/%s",
|
||||||
IMAGE_PATH, name);
|
IMAGE_PATH, name);
|
||||||
|
strncpy(this->save_game_name, name, 255);
|
||||||
if (strstr(name, ".d64") || strstr(name, ".D64"))
|
if (strstr(name, ".d64") || strstr(name, ".D64"))
|
||||||
np->DriveType[0] = DRVTYPE_D64;
|
np->DriveType[0] = DRVTYPE_D64;
|
||||||
else if (strstr(name, ".prg") || strstr(name, ".PRG") ||
|
else if (strstr(name, ".prg") || strstr(name, ".PRG") ||
|
||||||
@ -360,16 +363,9 @@ void C64::save_load_state(Prefs *np)
|
|||||||
case 1: /* save */
|
case 1: /* save */
|
||||||
{
|
{
|
||||||
char buf[255];
|
char buf[255];
|
||||||
char name[255];
|
|
||||||
char *p;
|
|
||||||
|
|
||||||
p = strrchr(ThePrefs.DrivePath[0], '/');
|
snprintf(buf, 255, "%s/%s.sav", SAVES_PATH,
|
||||||
if (p == NULL)
|
this->save_game_name);
|
||||||
strcpy(name, "unknown");
|
|
||||||
else
|
|
||||||
strncpy(name, p + 1, 255);
|
|
||||||
|
|
||||||
snprintf(buf, 255, "%s/%s.sav", SAVES_PATH, name);
|
|
||||||
|
|
||||||
this->SaveSnapshot(buf);
|
this->SaveSnapshot(buf);
|
||||||
} break;
|
} break;
|
||||||
|
Loading…
Reference in New Issue
Block a user