From 411a58e45ce2fd06efc55ba60d96ec8c874ca6cf Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 14 Sep 2021 05:19:12 +0200 Subject: [PATCH] show history again --- src/datafile.c | 12 +++++++++--- src/psp/pspmain.c | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/datafile.c b/src/datafile.c index 885c419..7e90c1f 100644 --- a/src/datafile.c +++ b/src/datafile.c @@ -593,7 +593,13 @@ int load_driver_history (const struct GameDriver *drv, char *buffer, int bufsize if(!history_filename) - history_filename = "history.dat"; + { + // use individual history file for each build + // history_filename = "history.dat"; + char tmp[64]; + sprintf(tmp, "hist/%s-history.dat", BUILD_NAME); + history_filename = tmp; + } /* try to open history datafile */ if (ParseOpen (history_filename)) @@ -601,8 +607,8 @@ int load_driver_history (const struct GameDriver *drv, char *buffer, int bufsize /* create index if necessary */ if (hist_idx) history = 1; - // else - // history = (index_datafile (&hist_idx) != 0); + else + history = (index_datafile (&hist_idx) != 0); /* load history text */ if (hist_idx) diff --git a/src/psp/pspmain.c b/src/psp/pspmain.c index d83205e..8d84694 100644 --- a/src/psp/pspmain.c +++ b/src/psp/pspmain.c @@ -186,7 +186,7 @@ int main(int argc, char *argv[]) // create nonexisting dirs // bad file descriptor workaround - char needed_dirs[4][256] = { "roms", "cfg", "nvram", "sta" }; + char needed_dirs[4][256] = { "roms", "cfg", "nvram", "sta", "hist" }; for (int i = 0; i < 4; i++) { if(sceIoDopen(needed_dirs[i]) < 0) { sceIoMkdir(needed_dirs[i], 0777);