From acbb4b98b62833dbc7bedc0f226aada8523cccab Mon Sep 17 00:00:00 2001 From: Chris Apers Date: Thu, 5 Feb 2004 13:46:28 +0000 Subject: Fixed memory card import svn-id: r12733 --- backends/PalmOS/Src/extend.h | 3 ++- backends/PalmOS/Src/games.cpp | 19 ++++++------------- 2 files changed, 8 insertions(+), 14 deletions(-) (limited to 'backends') diff --git a/backends/PalmOS/Src/extend.h b/backends/PalmOS/Src/extend.h index 1863757bea..cb03be9e09 100644 --- a/backends/PalmOS/Src/extend.h +++ b/backends/PalmOS/Src/extend.h @@ -36,7 +36,8 @@ extern const Char *SCUMMVM_SAVEPATH; // PalmOS #define DISABLE_TAPWAVE -#define DEBUG_ARM +#define DISABLE_ARM +//#define DEBUG_ARM int main(int argc, char **argv); diff --git a/backends/PalmOS/Src/games.cpp b/backends/PalmOS/Src/games.cpp index 33ba1a7fb2..868d87ceef 100644 --- a/backends/PalmOS/Src/games.cpp +++ b/backends/PalmOS/Src/games.cpp @@ -24,6 +24,7 @@ #include #include +#include "globals.h" #include "start.h" #include "games.h" #include "skin.h" @@ -184,7 +185,6 @@ void GamImportDatabase() { if (!e) { UInt16 oCardNo, nCardNo; LocalID oDbID, nDbID; - UInt32 type = 'ODAT'; // change the type to avoid the old db to be loaded in case of crash VFSFileClose(file); if (gPrefs->card.confirmMoveDB) @@ -197,19 +197,12 @@ void GamImportDatabase() { // get current db info and rename it DmOpenDatabaseInfo(gameDB, &oDbID, 0, 0, &oCardNo, 0); GamCloseDatabase(true); - DmSetDatabaseInfo(oCardNo, oDbID, "ScummVM-Data-old.pdb", 0, 0, 0, 0, 0, 0, 0, 0, &type, 0); + e = DmDeleteDatabase(oCardNo, oDbID); + + if (!e) + if (e = VFSImportDatabaseFromFile(gPrefs->card.volRefNum, "/Palm/Programs/ScummVM/listdata.pdb", &nCardNo, &nDbID)) + FrmCustomAlert(FrmErrorAlert, "Failed to import games database from memory card.", 0, 0); - - e = VFSImportDatabaseFromFile(gPrefs->card.volRefNum, "/Palm/Programs/ScummVM/listdata.pdb", &nCardNo, &nDbID); - if (e) { - type = 'DATA'; - FrmCustomAlert(FrmErrorAlert, "Failed to import games database from memory card.", 0, 0); - DmSetDatabaseInfo(oCardNo, oDbID, "ScummVM-Data.pdb", 0, 0, 0, 0, 0, 0, 0, 0, &type, 0); - } else { - // in OS5 the localID may change ... ? (cause Free Handle error) TODO : check if this is still required, crash now with tapwave !!! -// oDbID = DmFindDatabase (oCardNo, "ScummVM-Data-old.pdb"); - e = DmDeleteDatabase(oCardNo, oDbID); - } GamOpenDatabase(); } } -- cgit v1.2.3