diff options
author | Ludvig Strigeus | 2001-10-24 20:12:52 +0000 |
---|---|---|
committer | Ludvig Strigeus | 2001-10-24 20:12:52 +0000 |
commit | f9daf35824dff14fbea17af81180e589ec145a32 (patch) | |
tree | cf9a8ac80829f6fe69f484efc25e94775379c842 | |
parent | 61c7eccfd7c4317f1291e43be8ed5101e5388490 (diff) | |
download | scummvm-rg350-f9daf35824dff14fbea17af81180e589ec145a32.tar.gz scummvm-rg350-f9daf35824dff14fbea17af81180e589ec145a32.tar.bz2 scummvm-rg350-f9daf35824dff14fbea17af81180e589ec145a32.zip |
fixed some bugs related to string handling
svn-id: r3445
-rw-r--r-- | resource.cpp | 13 | ||||
-rw-r--r-- | script_v2.cpp | 5 | ||||
-rw-r--r-- | scumm.h | 5 | ||||
-rw-r--r-- | scummvm.cpp | 4 | ||||
-rw-r--r-- | scummvm.dsp | 4 | ||||
-rw-r--r-- | string.cpp | 9 |
6 files changed, 34 insertions, 6 deletions
diff --git a/resource.cpp b/resource.cpp index bb7db92c04..b080ee06b7 100644 --- a/resource.cpp +++ b/resource.cpp @@ -17,6 +17,9 @@ * * Change Log: * $Log$ + * Revision 1.6 2001/10/24 20:12:52 strigeus + * fixed some bugs related to string handling + * * Revision 1.5 2001/10/23 19:51:50 strigeus * recompile not needed when switching games * debugger skeleton implemented @@ -575,6 +578,16 @@ byte *Scumm::getResourceAddress(int type, int index) { return ptr + sizeof(ResHeader); } +byte *Scumm::getStringAddress(int i) { + byte *b = getResourceAddress(7, i); + if (!b) + return b; + + if (_majorScummVersion==6) + return ((ArrayHeader*)b)->data; + return b; +} + void Scumm::setResourceFlags(int type, int index, byte flag) { res.flags[type][index] &= 0x80; res.flags[type][index] |= flag; diff --git a/script_v2.cpp b/script_v2.cpp index 3687b6d9ee..7e38f04831 100644 --- a/script_v2.cpp +++ b/script_v2.cpp @@ -17,6 +17,9 @@ * * Change Log: * $Log$ + * Revision 1.3 2001/10/24 20:12:52 strigeus + * fixed some bugs related to string handling + * * Revision 1.2 2001/10/23 19:51:50 strigeus * recompile not needed when switching games * debugger skeleton implemented @@ -1557,7 +1560,7 @@ void Scumm::o6_verbOps() { if (a==0) { ptr = (byte*)""; } else { - ptr = getResourceAddress(7, a); + ptr = getStringAddress(a); } loadPtrToResource(8, slot, ptr); vs->type = 0; @@ -17,6 +17,9 @@ * * Change Log: * $Log$ + * Revision 1.13 2001/10/24 20:12:52 strigeus + * fixed some bugs related to string handling + * * Revision 1.12 2001/10/23 19:51:50 strigeus * recompile not needed when switching games * debugger skeleton implemented @@ -521,6 +524,7 @@ enum GameId { GID_MONKEY2 = 2, GID_INDY4 = 3, GID_MONKEY = 4, + GID_SAMNMAX = 5, }; struct ScummDebugger; @@ -940,6 +944,7 @@ struct Scumm { void nukeResource(int type, int i); byte *getResourceAddress(int type, int i); + byte *getStringAddress(int i); void ensureResourceLoaded(int type, int i); int loadResource(int type, int i); int getResourceRoomNr(int type, int index); diff --git a/scummvm.cpp b/scummvm.cpp index 473aa0de7d..7fceb6733d 100644 --- a/scummvm.cpp +++ b/scummvm.cpp @@ -17,6 +17,9 @@ * * Change Log: * $Log$ + * Revision 1.12 2001/10/24 20:12:52 strigeus + * fixed some bugs related to string handling + * * Revision 1.11 2001/10/23 19:51:50 strigeus * recompile not needed when switching games * debugger skeleton implemented @@ -443,6 +446,7 @@ static const VersionSettings version_settings[] = { {"atlantis", "Indiana Jones 4 and the Fate of Atlantis", GID_INDY4, 5, 5, 0}, {"fate", "Indiana Jones 4 and the Fate of Atlantis (Demo)", GID_INDY4, 5, 5, 0}, {"tentacle", "Day Of The Tenctacle", GID_TENTACLE, 6, 4, 2}, + {"samnmax", "Sam & Max", GID_SAMNMAX, 6, 4, 2}, {NULL,NULL} }; diff --git a/scummvm.dsp b/scummvm.dsp index 60d7f79525..645324c467 100644 --- a/scummvm.dsp +++ b/scummvm.dsp @@ -136,10 +136,6 @@ SOURCE=.\scummvm.cpp # End Source File
# Begin Source File
-SOURCE=.\sdl.cpp
-# End Source File
-# Begin Source File
-
SOURCE=.\sound.cpp
# End Source File
# Begin Source File
diff --git a/string.cpp b/string.cpp index 8ef0dce496..ab0a00ac47 100644 --- a/string.cpp +++ b/string.cpp @@ -17,6 +17,9 @@ * * Change Log: * $Log$ + * Revision 1.4 2001/10/24 20:12:52 strigeus + * fixed some bugs related to string handling + * * Revision 1.3 2001/10/23 19:51:50 strigeus * recompile not needed when switching games * debugger skeleton implemented @@ -568,8 +571,12 @@ void Scumm::unkAddMsgToStack4(int var) { void Scumm::unkAddMsgToStack5(int var) { byte *ptr; + + if (_majorScummVersion==6) + var = readVar(var); + if (var) { - ptr = getResourceAddress(7, var); + ptr = getStringAddress(var); if (ptr) { addMessageToStack(ptr); return; |