Prev: 53056 Up: Map Next: 53107
53059: Clear Script Command Flags
Used by the routine at ContinueScriptExecution.
Clears flag bytes in a script command based on the command type and flag bits. Different command types require clearing different numbers of flag bytes to mark them as processed.
Input
IX Pointer to script command data
ClearScriptCommandFlags 53059 LD A,(IX+0) Read the command flag byte.
Clear the first flag byte if certain flag bits are set, indicating those conditions have been processed.
53062 BIT 7,A If bit 7 of the command is set, call ClearScriptCommandFlags_ClearFirst to clear one flag byte.
53064 CALL NZ,ClearScriptCommandFlags_ClearFirst
53067 BIT 4,A If bit 4 of the command is set, call ClearScriptCommandFlags_ClearFirst to clear one flag byte.
53069 CALL NZ,ClearScriptCommandFlags_ClearFirst
53072 AND %00001111 Extract the command type (bits 0-3).
Route to the appropriate handler based on command type to clear the required number of flag bytes.
53074 CP 1 Go to ClearScriptCommandFlags_ClearFirst when the command is 1.
53076 JR Z,ClearScriptCommandFlags_ClearFirst
53078 CP 2 Go to ClearScriptCommandFlags_ClearTwo when the command is 2.
53080 JR Z,ClearScriptCommandFlags_ClearTwo
53082 CP 5 Go to ClearScriptCommandFlags_ClearTwo when the command is 5.
53084 JR Z,ClearScriptCommandFlags_ClearTwo
53086 CP 7 Go to ClearScriptCommandFlags_ClearOne when the command is 7.
53088 JR Z,ClearScriptCommandFlags_ClearOne
53090 CP 6 Go to ClearScriptCommandFlags_ClearOneAlt when the command is 6.
53092 JR Z,ClearScriptCommandFlags_ClearOneAlt
53094 CP 4 Compare the command with 4.
ClearScriptCommandFlags_ClearOne 53096 CALL Z,ClearScriptCommandFlags_ClearSecond Call ClearScriptCommandFlags_ClearSecond if the command is 4 or 7.
ClearScriptCommandFlags_ClearTwo 53099 CALL Z,ClearScriptCommandFlags_ClearFirst Call ClearScriptCommandFlags_ClearFirst if the command is 2 4 5 or 7.
53102 CP 3 See whether the command type is 3.
ClearScriptCommandFlags_ClearOneAlt 53104 CALL Z,ClearScriptCommandFlags_ClearSecond Call ClearScriptCommandFlags_ClearSecond if the command is 3 or 6.
Prev: 53056 Up: Map Next: 53107