diff options
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/script_v8.cpp | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/scumm/script_v8.cpp b/scumm/script_v8.cpp index 8db0f72516..815a82fde5 100644 --- a/scumm/script_v8.cpp +++ b/scumm/script_v8.cpp @@ -1310,12 +1310,9 @@ void ScummEngine_v8::o8_kernelSetFunctions() { break; case 32: // writeRegistryValue { - int array = args[1]; + int idx = args[1]; int value = args[2]; - // FIXME - hack: for some reasons the wrong variable ID arrives here, compared to the - // scripts. Probably a wrong push/pop somewhere. For now override to correct value. - array = 658; - ArrayHeader *ah = (ArrayHeader *)getResourceAddress(rtString, readVar(array)); + ArrayHeader *ah = (ArrayHeader *)getResourceAddress(rtString, idx); debugC(DEBUG_GENERAL,"o8_kernelSetFunctions: writeRegistryValue(%s, %d)", (char *)ah->data, value); } @@ -1412,11 +1409,8 @@ void ScummEngine_v8::o8_kernelGetFunctions() { break; case 0xE0: // readRegistryValue { - int array = args[1]; - // FIXME - hack: for some reasons the wrong variable ID arrives here, compared to the - // scripts. Probably a wrong push/pop somewhere. For now override to correct value. - array = 658; - ArrayHeader *ah = (ArrayHeader *)getResourceAddress(rtString, readVar(array)); + int idx = args[1]; + ArrayHeader *ah = (ArrayHeader *)getResourceAddress(rtString, idx); if (!strcmp((char *)ah->data, "SFX Volume")) push(ConfMan.getInt("sfx_volume") / 2); else if (!strcmp((char *)ah->data, "Voice Volume")) |