Prev: 52990 Up: Map Next: 53120
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 Call ClearScriptCommandFlags_ClearFirst if bit 7 is set.
53064 CALL NZ,ClearScriptCommandFlags_ClearFirst
53067 BIT 4,A Call ClearScriptCommandFlags_ClearFirst if bit 4 is set.
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 Jump to ClearScriptCommandFlags_ClearFirst for command type 1.
53076 JR Z,ClearScriptCommandFlags_ClearFirst
53078 CP 2 Jump to ClearScriptCommandFlags_ClearTwo for command types:
  • 2
  • 5
  • 7
53080 JR Z,ClearScriptCommandFlags_ClearTwo
53082 CP 5
53084 JR Z,ClearScriptCommandFlags_ClearTwo
53086 CP 7
53088 JR Z,ClearScriptCommandFlags_ClearOne
53090 CP 6 Jump to ClearScriptCommandFlags_ClearOneAlt for command type 6.
53092 JR Z,ClearScriptCommandFlags_ClearOneAlt
53094 CP 4 Call ClearScriptCommandFlags_ClearSecond for command type 4.
ClearScriptCommandFlags_ClearOne 53096 CALL Z,ClearScriptCommandFlags_ClearSecond Clear one flag byte.
ClearScriptCommandFlags_ClearTwo 53099 CALL Z,ClearScriptCommandFlags_ClearFirst Call ClearScriptCommandFlags_ClearFirst for command type 4 (alternative path).
53102 CP 3 Call ClearScriptCommandFlags_ClearSecond for command type 3.
ClearScriptCommandFlags_ClearOneAlt 53104 CALL Z,ClearScriptCommandFlags_ClearSecond Clear one flag byte.
ClearScriptCommandFlags_ClearFirst 53107 LD (IX+0),0 Clear the first flag byte.
53111 INC IX Advance the pointer.
ClearScriptCommandFlags_ClearSecond 53113 LD (IX+0),0 Clear the second flag byte.
53117 INC IX Advance the pointer.
53119 RET Return.
Prev: 52990 Up: Map Next: 53120