Commit Graph

34 Commits

Author SHA1 Message Date
Travis Howell
7a030fcdcd SCUMM: Fix compiler warning. 2012-02-13 13:38:25 +11:00
Tobias Gunkel
4922055063 SCUMM: cleanup and separation of objIsActor()/objToActor()/actorToObj() for v0 and other engines 2012-02-11 08:36:27 +01:00
Tobias Gunkel
9dd6105ce6 SCUMM: replace "c64" with "v0" when it applies to both C64 and AppleII v0 versions
In addition some routines (e.g. the gfx ones) that are even used in v1.
2012-02-11 08:30:08 +01:00
Tobias Gunkel
daff6f36ae SCUMM: _currentLights is v0 only 2012-02-11 08:30:03 +01:00
Tobias Gunkel
434aaaf0c0 SCUMM: fix gcc compiler warnings 2012-02-11 08:30:00 +01:00
Tobias Gunkel
984c2a05e4 SCUMM: replace o_beginOverride() with o2_beginOverride()
In contrast to the comment in o_beginOverride() VAR(VAR_OVERRIDE) is not set in the disassembly. In addition the cutscene stack-pointer is always 0 as this feature is not used in v0. This makes o_beginOverride() work the same way o2_beginOverride() and so it is not needed anymore.

Note that fetchScriptWord() was changed to ScummEngine::fetchScriptWord() in o2_beginOverride() as ScummEngine_v0::fetchScriptWord() only fetches a byte.
As we need two bytes here we have to use ScummEngine::fetchScriptWord().
2012-02-11 08:29:52 +01:00
Tobias Gunkel
e3f9a09d49 SCUMM: keep track of the number of nested script calls for a sentence
command in v0

If for instance an object necessary for the sentence command is not reachable or pickupable (try to use faucet (object 55) with jar with water in microwave (object 50), the pick-up script of the jar will tell the actor to pickup object 99 (jar not in microwave)) the actor will try to pick-up the jar infinitely.
This is fixed by counting the amount of nested scripts the sentence command has called (directly or indirectly) so far and aborts it if there have been too many.
2012-02-11 08:29:21 +01:00
Tobias Gunkel
fb68456541 SCUMM: complete handling of pending walkTo actions for sentence commands
in v0
2012-02-11 08:29:19 +01:00
Tobias Gunkel
96f8fc6ca9 SCUMM: Fix actor ID handling in v0
Some object functions allow actor IDs and object IDs as parameters. They are easily distinguishable in engines > 0 as actor IDs are < _numActors and object IDs are bigger. In v0 this is not the case as there are objects with IDs like 3 and 5 (e.g. the hamster). So object ID handling was unified for v0 and the other engines by introducing objIsActor(), objToActor() and ActorToObj().
2012-02-11 08:29:13 +01:00
Tobias Gunkel
f22bbc47b4 SCUMM: fix v0 mode handling and actor switching
- handle mode switching correctly
  - do not freeze scripts in cutscene mode (mode 0), as some scripts are freezed in mode 0 that should not be freezed
  - kModeNoNewKid (mode 2) needs the same userState as mode 3
- rename o_cursorCommand to o_setMode as it is not really cursor specific
- handle actorHiding correctly (do not set costume to 0 as the previous costume cannot be reverted after hiding)
- add drawSentence
- document meanings for actor misc flags
- fix actor names for "new kid" if the radiation suit is used (all kids are set to 0 then with actor 0 name " ")
- cleanup actor switching routine
- _userPut is not used anymore in v0
2012-02-11 08:29:05 +01:00
Tobias Gunkel
2f1336cdf0 SCUMM: fix blank sentence line in v0 after cutscenes and remove unused parameter of resetSentence() 2012-02-11 08:29:03 +01:00
Tobias Gunkel
6d4b710c54 SCUMM: fix opcode walkToObject in v0
Before Michael did not develop the film correctly
2012-02-11 08:28:56 +01:00
Tobias Gunkel
347035385e SCUMM: merge object v0 id and type into one object var 2012-02-11 08:28:49 +01:00
Tobias Gunkel
8141511e2f SCUMM: fix ScummEngine_v0::ifEqualActiveObject2Common() parameter name 2012-02-11 08:28:48 +01:00
Tobias Gunkel
c138ef6709 SCUMM: merge _activeObjectNr/_activeObjectType and _cmdObjectNr/_cmdObjectType 2012-02-11 08:28:46 +01:00
Tobias Gunkel
f2309998ff SCUMM: fix debugger for v0 2012-02-11 08:28:44 +01:00
Tobias Gunkel
e14bc5fd6d SCUMM: improve verb and sentence handling
- execute sentence if verb was clicked twice
- reuse the first object if a new verb is selected (but no preposition is used yet)
2012-02-11 08:28:33 +01:00
Tobias Gunkel
32945904d5 SCUMM: fix kid selection in v0
The kid names are now displayed in the sentence line (instead of the verb area) as it is done in the original.
2012-02-11 08:28:27 +01:00
Tobias Gunkel
b337823bab SCUMM: fix verb and script handling
- getVerbEntrypoint() should not handle walk-to differently (revert 0x0D handling back to original behavior)
- VAR_ACTIVE_ACTOR actually is VAR_ACTIVE_OBJECT2
- runSentenceScript(): "if (_cmdVerb == kVerbWalkTo)" must be "if (_cmdVerb != kVerbWalkTo)"
2012-02-11 08:28:26 +01:00
Tobias Gunkel
de0b5f7674 SCUMM: use command stack and SentenceTab in mm c64
- MM C64 uses command stack (SentenceTab, doSentence()) now
- _cmdObject... added for current SentenceTab. The _active... variables are only used to build a sentence in the inventory but never by a script.
-> many routines are not needed anymore and are removed
2012-02-11 08:28:22 +01:00
Tobias Gunkel
d8b435917d SCUMM: mm c64 cleanup 2012-02-11 08:28:21 +01:00
Tobias Gunkel
706b8cf1c5 SCUMM: replace verb, prep and currentMode values with symbolic constants 2012-02-11 08:28:19 +01:00
Tobias Gunkel
6b5abf6919 SCUMM: selecting inventory objects and inventory scrolling works again 2012-02-11 08:28:16 +01:00
Tobias Gunkel
1c32000a00 SCUMM: start handling object type and id correctly in mm c64
- removed complicated and unnecessary _v0ObjectIndex, _v0ObjectInInventory, _v0ObjectFlag vars
- started to merge object id and type into one object value (type<<8|id)
- verb preposition ids do not dependent on language -> remove from VerbSettings

Note:
- objects with type=0 are foreground objects. They have a state, an owner and a bg overlay image.
- objects with type=1 are bg objects. They do not have a state or owner and are already contained in the bg image. The do not have an entry in objectState/OwnerTable
2012-02-11 08:28:14 +01:00
Tobias Gunkel
a79f224c23 SCUMM: changed handling of _activeInventory/_activeActor to _activeObject(2)/_activeObject(2)Type
Note: the transition is not completed yet. The code compiles but is probably not runnable as not every occurrence of _activeInventory has been properly replaced.
The usage of _v0ObjectIndex and _v0ObjectInInventory should be revised too and both variables should be replaced by another mechanism (maybe by using a single variable "obj = (type << 8) | id").

- moved v0 only vars _activeInventory, _activeObject, _activeVerb from  ScummEngine_v2 to ScummEngine_v0
- removed _activeActor, _activeInvExecute, _activeObject2Inv and _activeInventory. They are handled by _activeObject/_activeObjectType and _activeObject2/_activeObject2Type now.
- removed _activeObject(2)Index as they only bloat the code without any benefit (?)
- merge prep-name tables from ScummEngine_v2::drawPreposition() and ScummEngine_v0::drawSentenceWord() by introducing ScummEngine_v2::drawPreposition()
- rename ObjectData.flags -> obj_type (quick-fix only, needs review! Maybe obj_nr and obj_type can be merged into one var: obj_nr = (obj_type << 8) | obj_nr)
- o_unknown2 is negation of o_ifActiveObject (o_ifNotEqualActiveObject2)
- renamed o_ifActiveObject -> o_ifEqualActiveObject2 as it acts only on _activeObject2
- renamed ScummEngine_v0::drawSentenceWord() -> ScummEngine_v0::getObjectName()
2012-02-11 08:02:32 +01:00
Matthew Hoops
1277975c66 ALL: neighbour -> neighbor 2011-05-25 10:50:46 -04:00
strangerke
69b1485a22 GIT: Clean up: Suppress SVN tags, now useless 2011-05-12 01:16:22 +02:00
Max Horn
2c00aed172 SCUMM: Avoid hiding overloaded virtual method
svn-id: r55809
2011-02-07 17:53:34 +00:00
Travis Howell
ae3b6f0aa3 SCUMM: Fix bug #3070077 - MMC64: No music when Syd plays the piano.
svn-id: r52796
2010-09-18 14:18:48 +00:00
Travis Howell
26948eca76 Add patch #2846425 - MM C64: walkbox fixed, with minor changes.
svn-id: r45437
2009-10-27 11:32:33 +00:00
Travis Howell
c02ad3b7bf Add patch #2821100 - MM C64 Objects / Verb fixes, with minor clean up applied.
svn-id: r42737
2009-07-25 06:27:41 +00:00
Max Horn
6a7bb77305 SCUMM: Introduced new method ScummEngine_v5::jumpRelative; unified some v0 and v2 opcodes
svn-id: r40025
2009-04-20 12:35:17 +00:00
Max Horn
432e7917a5 SCUMM: Switched opcode tables to use Common::Functor0 (a bit like Kyra does it)
svn-id: r39956
2009-04-16 09:26:37 +00:00
Max Horn
6f4b567124 SCUMM: Split intern.h into multiple headers
svn-id: r39567
2009-03-20 16:33:58 +00:00