![]() |
Routines |
| Prev: CF40 | Up: Map | Next: CF73 |
|
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.
|
||||||||
| ClearScriptCommandFlags | CF43 | LD A,(IX+$00) | Read the command flag byte. | |||||
|
Clear the first flag byte if certain flag bits are set, indicating those conditions have been processed.
|
||||||||
| CF46 | BIT 7,A | If bit 7 of the command is set, call ClearScriptCommandFlags_ClearFirst to clear one flag byte. | ||||||
| CF48 | CALL NZ,ClearScriptCommandFlags_ClearFirst | |||||||
| CF4B | BIT 4,A | If bit 4 of the command is set, call ClearScriptCommandFlags_ClearFirst to clear one flag byte. | ||||||
| CF4D | CALL NZ,ClearScriptCommandFlags_ClearFirst | |||||||
| CF50 | 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.
|
||||||||
| CF52 | CP $01 | Go to ClearScriptCommandFlags_ClearFirst when the command is 01. | ||||||
| CF54 | JR Z,ClearScriptCommandFlags_ClearFirst | |||||||
| CF56 | CP $02 | Go to ClearScriptCommandFlags_ClearTwo when the command is 02. | ||||||
| CF58 | JR Z,ClearScriptCommandFlags_ClearTwo | |||||||
| CF5A | CP $05 | Go to ClearScriptCommandFlags_ClearTwo when the command is 05. | ||||||
| CF5C | JR Z,ClearScriptCommandFlags_ClearTwo | |||||||
| CF5E | CP $07 | Go to ClearScriptCommandFlags_ClearOne when the command is 07. | ||||||
| CF60 | JR Z,ClearScriptCommandFlags_ClearOne | |||||||
| CF62 | CP $06 | Go to ClearScriptCommandFlags_ClearOneAlt when the command is 06. | ||||||
| CF64 | JR Z,ClearScriptCommandFlags_ClearOneAlt | |||||||
| CF66 | CP $04 | Compare the command with 04. | ||||||
| ClearScriptCommandFlags_ClearOne | CF68 | CALL Z,ClearScriptCommandFlags_ClearSecond | Call ClearScriptCommandFlags_ClearSecond if the command is 04 or 07. | |||||
| ClearScriptCommandFlags_ClearTwo | CF6B | CALL Z,ClearScriptCommandFlags_ClearFirst | Call ClearScriptCommandFlags_ClearFirst if the command is 02 04 05 or 07. | |||||
| CF6E | CP $03 | See whether the command type is 03. | ||||||
| ClearScriptCommandFlags_ClearOneAlt | CF70 | CALL Z,ClearScriptCommandFlags_ClearSecond | Call ClearScriptCommandFlags_ClearSecond if the command is 03 or 06. | |||||
| Prev: CF40 | Up: Map | Next: CF73 |