Added/stubbed some Feeble opcodes, and fixed a regression that made it

impossible to load old (and probably new, for that matter) Simon savegames.

svn-id: r18958
This commit is contained in:
Torbjörn Andersson 2005-10-08 09:59:36 +00:00
parent a202b15062
commit c4752fc320
3 changed files with 90 additions and 6 deletions

View file

@ -412,7 +412,11 @@ bool SimonEngine::save_game(uint slot, char *caption) {
return false;
}
f->write(caption, 0x12);
if (_game == GAME_FEEBLEFILES) {
f->write(caption, 100);
} else {
f->write(caption, 18);
}
f->writeUint32BE(_itemArrayInited - 1);
f->writeUint32BE(0xFFFFFFFF);
@ -477,6 +481,12 @@ bool SimonEngine::save_game(uint slot, char *caption) {
for (i = 0; i != 32; i++)
f->writeUint16BE(_bitArray[i]);
// Write the bits in array 3
if (_game == GAME_FEEBLEFILES) {
for (i = 33; i != 48; i++)
f->writeUint16BE(_bitArray[i]);
}
delete f;
_lockWord &= ~0x100;
@ -514,9 +524,9 @@ bool SimonEngine::load_game(uint slot) {
}
if (_game == GAME_FEEBLEFILES) {
f->read(ident, 18);
} else {
f->read(ident, 100);
} else {
f->read(ident, 18);
}
num = f->readUint32BE();
@ -590,15 +600,21 @@ bool SimonEngine::load_game(uint slot) {
writeVariable(i, f->readUint16BE());
}
// write the items in array 6
// read the items in array 6
for (i = 0; i != 10; i++) {
_itemArray6[i] = derefItem(f->readUint16BE());
}
// Write the bits in array 1 & 2
// Read the bits in array 1 & 2
for (i = 0; i != 32; i++)
_bitArray[i] = f->readUint16BE();
// Read the bits in array 3
if (_game == GAME_FEEBLEFILES) {
for (i = 33; i != 48; i++)
_bitArray[i] = f->readUint16BE();
}
if (f->ioFailed()) {
error("load failed");
}