SCI: Some changes regarding the string heap in saved games
- Maintain the state of the string heap space in saved games - Merged SegManager::reconstructScripts() inside SegManager::saveLoadWithSerializer() - Disabled a now unnecessary script patch for the cipher puzzle in Castle of Dr. Brain, and performed some cleanup for another disabled patch - Removed direct access to the _baseObj variable of objects svn-id: r54133
This commit is contained in:
parent
97a98cf9db
commit
5de2668939
6 changed files with 158 additions and 112 deletions
|
@ -60,6 +60,8 @@ struct SciScriptSignature {
|
|||
// - if not EOS, an adjust offset and the actual bytes
|
||||
// - rinse and repeat
|
||||
|
||||
#if 0
|
||||
|
||||
// ===========================================================================
|
||||
// Castle of Dr. Brain
|
||||
// cipher::init (script 391) is called on room 380 init. This resets the word
|
||||
|
@ -105,6 +107,8 @@ const SciScriptSignature castlebrainSignatures[] = {
|
|||
SCI_SIGNATUREENTRY_TERMINATOR
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
// ===========================================================================
|
||||
// stayAndHelp::changeState (0) is called when ego swims to the left or right
|
||||
// boundaries of room 660. Normally a textbox is supposed to get on screen
|
||||
|
@ -402,69 +406,73 @@ const SciScriptSignature gk1Signatures[] = {
|
|||
SCI_SIGNATUREENTRY_TERMINATOR
|
||||
};
|
||||
|
||||
#if 0
|
||||
|
||||
// ===========================================================================
|
||||
// this here gets called on entry and when going out of game windows
|
||||
// uEvt::port will not get changed after kDisposeWindow but a bit later, so
|
||||
// we would get an invalid port handle to a kSetPort call. We just patch in
|
||||
// resetting of the port selector. We destroy the stop/fade code in there,
|
||||
// it seems it isn't used at all in the game.
|
||||
//const byte hoyle4SignaturePortFix[] = {
|
||||
// 28,
|
||||
// 0x39, 0x09, // pushi 09
|
||||
// 0x89, 0x0b, // lsg 0b
|
||||
// 0x39, 0x64, // pushi 64
|
||||
// 0x38, 0xc8, 0x00, // pushi 00c8
|
||||
// 0x38, 0x2c, 0x01, // pushi 012c
|
||||
// 0x38, 0x90, 0x01, // pushi 0190
|
||||
// 0x38, 0xf4, 0x01, // pushi 01f4
|
||||
// 0x38, 0x58, 0x02, // pushi 0258
|
||||
// 0x38, 0xbc, 0x02, // pushi 02bc
|
||||
// 0x38, 0x20, 0x03, // pushi 0320
|
||||
// 0x46, // calle [xxxx] [xxxx] [xx]
|
||||
// +5, 43, // [skip 5 bytes]
|
||||
// 0x30, 0x27, 0x00, // bnt 0027 -> end of routine
|
||||
// 0x87, 0x00, // lap 00
|
||||
// 0x30, 0x19, 0x00, // bnt 0019 -> fade out
|
||||
// 0x87, 0x01, // lap 01
|
||||
// 0x30, 0x14, 0x00, // bnt 0014 -> fade out
|
||||
// 0x38, 0xa7, 0x00, // pushi 00a7
|
||||
// 0x76, // push0
|
||||
// 0x80, 0x29, 0x01, // lag 0129
|
||||
// 0x4a, 0x04, // send 04 - call song::stop
|
||||
// 0x39, 0x27, // pushi 27
|
||||
// 0x78, // push1
|
||||
// 0x8f, 0x01, // lsp 01
|
||||
// 0x51, 0x54, // class 54
|
||||
// 0x4a, 0x06, // send 06 - call PlaySong::play
|
||||
// 0x33, 0x09, // jmp 09 -> end of routine
|
||||
// 0x38, 0xaa, 0x00, // pushi 00aa
|
||||
// 0x76, // push0
|
||||
// 0x80, 0x29, 0x01, // lag 0129
|
||||
// 0x4a, 0x04, // send 04
|
||||
// 0x48, // ret
|
||||
// 0
|
||||
//};
|
||||
const byte hoyle4SignaturePortFix[] = {
|
||||
28,
|
||||
0x39, 0x09, // pushi 09
|
||||
0x89, 0x0b, // lsg 0b
|
||||
0x39, 0x64, // pushi 64
|
||||
0x38, 0xc8, 0x00, // pushi 00c8
|
||||
0x38, 0x2c, 0x01, // pushi 012c
|
||||
0x38, 0x90, 0x01, // pushi 0190
|
||||
0x38, 0xf4, 0x01, // pushi 01f4
|
||||
0x38, 0x58, 0x02, // pushi 0258
|
||||
0x38, 0xbc, 0x02, // pushi 02bc
|
||||
0x38, 0x20, 0x03, // pushi 0320
|
||||
0x46, // calle [xxxx] [xxxx] [xx]
|
||||
+5, 43, // [skip 5 bytes]
|
||||
0x30, 0x27, 0x00, // bnt 0027 -> end of routine
|
||||
0x87, 0x00, // lap 00
|
||||
0x30, 0x19, 0x00, // bnt 0019 -> fade out
|
||||
0x87, 0x01, // lap 01
|
||||
0x30, 0x14, 0x00, // bnt 0014 -> fade out
|
||||
0x38, 0xa7, 0x00, // pushi 00a7
|
||||
0x76, // push0
|
||||
0x80, 0x29, 0x01, // lag 0129
|
||||
0x4a, 0x04, // send 04 - call song::stop
|
||||
0x39, 0x27, // pushi 27
|
||||
0x78, // push1
|
||||
0x8f, 0x01, // lsp 01
|
||||
0x51, 0x54, // class 54
|
||||
0x4a, 0x06, // send 06 - call PlaySong::play
|
||||
0x33, 0x09, // jmp 09 -> end of routine
|
||||
0x38, 0xaa, 0x00, // pushi 00aa
|
||||
0x76, // push0
|
||||
0x80, 0x29, 0x01, // lag 0129
|
||||
0x4a, 0x04, // send 04
|
||||
0x48, // ret
|
||||
0
|
||||
};
|
||||
|
||||
//const uint16 hoyle4PatchPortFix[] = {
|
||||
// PATCH_ADDTOOFFSET | +33,
|
||||
// 0x38, 0x31, 0x01, // pushi 0131 (selector curEvent)
|
||||
// 0x76, // push0
|
||||
// 0x80, 0x50, 0x00, // lag 0050 (global var 80h, "User")
|
||||
// 0x4a, 0x04, // send 04 - read User::curEvent
|
||||
//
|
||||
// 0x38, 0x93, 0x00, // pushi 0093 (selector port)
|
||||
// 0x78, // push1
|
||||
// 0x76, // push0
|
||||
// 0x4a, 0x06, // send 06 - write 0 to that object::port
|
||||
// 0x48, // ret
|
||||
// PATCH_END
|
||||
//};
|
||||
const uint16 hoyle4PatchPortFix[] = {
|
||||
PATCH_ADDTOOFFSET | +33,
|
||||
0x38, 0x31, 0x01, // pushi 0131 (selector curEvent)
|
||||
0x76, // push0
|
||||
0x80, 0x50, 0x00, // lag 0050 (global var 80h, "User")
|
||||
0x4a, 0x04, // send 04 - read User::curEvent
|
||||
|
||||
0x38, 0x93, 0x00, // pushi 0093 (selector port)
|
||||
0x78, // push1
|
||||
0x76, // push0
|
||||
0x4a, 0x06, // send 06 - write 0 to that object::port
|
||||
0x48, // ret
|
||||
PATCH_END
|
||||
};
|
||||
|
||||
// script, description, magic DWORD, adjust
|
||||
//const SciScriptSignature hoyle4Signatures[] = {
|
||||
// { 0, "port fix when disposing windows", PATCH_MAGICDWORD(0x64, 0x38, 0xC8, 0x00), -5, hoyle4SignaturePortFix, hoyle4PatchPortFix },
|
||||
// { 0, NULL, 0, 0, NULL, NULL }
|
||||
//};
|
||||
const SciScriptSignature hoyle4Signatures[] = {
|
||||
{ 0, "port fix when disposing windows", PATCH_MAGICDWORD(0x64, 0x38, 0xC8, 0x00), -5, hoyle4SignaturePortFix, hoyle4PatchPortFix },
|
||||
{ 0, NULL, 0, 0, NULL, NULL }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
// ===========================================================================
|
||||
// at least during harpy scene export 29 of script 0 is called in kq5cd and
|
||||
|
@ -874,9 +882,12 @@ int32 Script::findSignature(const SciScriptSignature *signature, const byte *scr
|
|||
void Script::matchSignatureAndPatch(uint16 scriptNr, byte *scriptData, const uint32 scriptSize) {
|
||||
const SciScriptSignature *signatureTable = NULL;
|
||||
switch (g_sci->getGameId()) {
|
||||
// Dr. Brain now works because we properly maintain the state of the string heap in savegames
|
||||
#if 0
|
||||
case GID_CASTLEBRAIN:
|
||||
signatureTable = castlebrainSignatures;
|
||||
break;
|
||||
#endif
|
||||
case GID_ECOQUEST:
|
||||
signatureTable = ecoquest1Signatures;
|
||||
break;
|
||||
|
@ -890,9 +901,11 @@ void Script::matchSignatureAndPatch(uint16 scriptNr, byte *scriptData, const uin
|
|||
signatureTable = gk1Signatures;
|
||||
break;
|
||||
// hoyle4 now works due to workaround inside GfxPorts
|
||||
//case GID_HOYLE4:
|
||||
// signatureTable = hoyle4Signatures;
|
||||
// break;
|
||||
#if 0
|
||||
case GID_HOYLE4:
|
||||
signatureTable = hoyle4Signatures;
|
||||
break;
|
||||
#endif
|
||||
case GID_KQ5:
|
||||
signatureTable = kq5Signatures;
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue