Updated based on last changes

svn-id: r15768
This commit is contained in:
Chris Apers 2004-11-09 11:49:07 +00:00
parent 27449a3254
commit c9c862989a
2 changed files with 37 additions and 10 deletions

View File

@ -25,6 +25,7 @@
#include <ctype.h>
#include "globals.h"
#include "palmdefs.h"
#include "start.h"
#include "games.h"
#include "skin.h"
@ -62,11 +63,12 @@ static Err GamUpdateList() {
frmP = FrmInitForm(ConvertForm);
FrmSetActiveForm(frmP);
FrmDrawForm(frmP);
SysTaskDelay(200);
SysTaskDelay(1 * SysTicksPerSecond());
MemSet(&gitCur, sizeof(GameInfoType), 0);
if (version == itemVersion_27 ||
if (version == itemVersion_30 ||
version == itemVersion_27 ||
version == itemVersion_26 ||
version == itemVersion_25) {
@ -78,6 +80,7 @@ static Err GamUpdateList() {
MemMove(&gitCur, tmpP, MemHandleSize(tmpH));
MemHandleUnlock(tmpH);
if (version != itemVersion_30) {
gitCur.musicInfo.volume.master = 192;
gitCur.musicInfo.volume.music = 192;
gitCur.musicInfo.volume.sfx = 192;
@ -87,6 +90,9 @@ static Err GamUpdateList() {
gitCur.musicInfo.sound.tempo = 100;
gitCur.musicInfo.sound.defaultTrackLength = 10;
gitCur.musicInfo.sound.firstTrack = 1;
}
gitCur.engine = 0;
// simply resize the old record
tmpH = DmResizeRecord(gameDB, index, sizeof(GameInfoType)); // TODO : check error on resize tmpH==NULL
@ -138,6 +144,8 @@ static Err GamUpdateList() {
gitCur.musicInfo.sound.defaultTrackLength = 10;
gitCur.musicInfo.sound.firstTrack = 1;
gitCur.engine = 0;
tmpH = DmResizeRecord(gameDB, index, sizeof(GameInfoType)); // TODO : check error on resize tmpH==NULL
tmpP = MemHandleLock(tmpH);
DmWrite(tmpP, 0, &gitCur, sizeof(GameInfoType));
@ -186,6 +194,8 @@ static Err GamUpdateList() {
gitCur.musicInfo.sound.defaultTrackLength = 10;
gitCur.musicInfo.sound.firstTrack = 1;
gitCur.engine = 0;
tmpH = DmResizeRecord(gameDB, index, sizeof(GameInfoType)); // TODO : check error on resize tmpH==NULL
tmpP = MemHandleLock(tmpH);
DmWrite(tmpP, 0, &gitCur, sizeof(GameInfoType));

View File

@ -23,6 +23,14 @@
#ifndef __GAMES_H__
#define __GAMES_H__
#define curItemVersion sysMakeROMVersion(3,1,0,0,0)
#define itemVersion_30 sysMakeROMVersion(3,0,0,0,0)
#define itemVersion_27 sysMakeROMVersion(2,7,0,0,0)
#define itemVersion_26 sysMakeROMVersion(2,6,0,0,0)
#define itemVersion_25 sysMakeROMVersion(2,5,0,0,0)
#define itemVersion_20 sysMakeROMVersion(2,0,0,0,0)
// old config structs
typedef struct {
UInt32 version;
@ -126,8 +134,17 @@ typedef struct {
MusicInfoType musicInfo;// v3.0
UInt8 engine; // |- v3.1
} GameInfoType;
enum {
ENGINE_SCUMM = 0,
ENGINE_SIMON,
ENGINE_QUEEN,
ENGINE_SWORD1
};
// protos
Err GamOpenDatabase ();
void GamImportDatabase ();