Prev: 38911 Up: Map Next: 39366
39192: Turn: Step The Script Pointer
Stores a script pointer on the special-object record. Bit 4 of the script byte skips two bytes first.
Turn_StepTheScriptPointer 39192 ADD HL,DE Step HL on, and jump to Turn_StepTheScriptPointer_StoreThePointer if bit 4 of this script byte is clear.
39193 BIT 4,(IX+0)
39197 JR Z,Turn_StepTheScriptPointer_StoreThePointer
39199 INC HL Skip two bytes of the pointer.
39200 INC HL
Turn_StepTheScriptPointer_StoreThePointer 39201 LD (IY+2),L Store the low byte of the script pointer on the special-object record.
39204 LD (IY+3),H Store the high byte of the script pointer on the special-object record.
39207 RET Return.
This entry point is used by the routine at Turn_GateTheMessage.
Turn_StepTheScriptPointer_RunTheScriptEntry 39208 CALL Turn_StepTheScriptPointer Call Turn_StepTheScriptPointer to step the script pointer past this entry and store it on the special-object record.
39211 BIT 0,(IX+0) Jump to Turn_StepTheScriptPointer_ReadTheHandlerAddress if bit 0 of this script byte is set.
39215 JR NZ,Turn_StepTheScriptPointer_ReadTheHandlerAddress
39217 LD A,(IX+1) Read the action id from this script.
39220 LD (46823),A Update *CurrentAction.
39223 LD A,(IX+2) Read the object id from this script.
39226 LD (46824),A Update *CurrentObject.
39229 LD A,(IX+3) Read the second object id from this script.
39232 LD (46825),A Update *46825.
39235 CALL Turn_ApplyTheSavedMatch Call Turn_ApplyTheSavedMatch to build the action sentence from the saved match.
39238 JR Z,Turn_StepTheScriptPointer_CountAnotherTry Jump to Turn_StepTheScriptPointer_CountAnotherTry if Turn_ApplyTheSavedMatch returned zero.
39240 JR Turn_StepTheScriptPointer_TestAndClear Jump to Turn_StepTheScriptPointer_TestAndClear to skip updating the message gate.
Turn_StepTheScriptPointer_ReadTheHandlerAddress 39242 LD L,(IX+1) Read the low byte of the handler address.
39245 LD H,(IX+2) Read the high byte of the handler address.
39248 SUB A Clear A so the message gate and the message-suppressed flag are both cleared.
39249 LD (46842),A Clear the message gate so the handler may speak.
39252 LD (46843),A Clear the message-suppressed flag before the handler runs.
Run the handler for this action.
39255 CALL TriggerAction Call TriggerAction to call the handler stored for this action.
Test the message-suppressed flag.
39258 LD A,(46843) Jump to Turn_StepTheScriptPointer_CountAnotherTry unless the message-suppressed flag is 1.
39261 CP 1
39263 JR NZ,Turn_StepTheScriptPointer_CountAnotherTry
39265 LD (46842),A Update *46842.
Run the handler for this action.
39268 CALL TriggerAction Call TriggerAction to call the handler stored for this action.
Turn_StepTheScriptPointer_TestAndClear 39271 BIT 5,(IX+0) Jump back to Turn_GateTheMessage_StepThePointerOnBySevenBytes if bit 5 of this script byte is clear.
39275 JP Z,Turn_GateTheMessage_StepThePointerOnBySevenBytes
39278 LD (IX+0),0 Clear this script byte.
39282 JR Turn_GateTheMessage_StepThePointerOnBySevenBytes Jump back to Turn_GateTheMessage_StepThePointerOnBySevenBytes to clear *38923.
This entry point is used by the routine at Turn_GateTheMessage.
Turn_StepTheScriptPointer_StepTwoBytes 39284 LD DE,2 Step the script pointer by 2 bytes.
39287 CALL Turn_StepTheScriptPointer Call Turn_StepTheScriptPointer to step the script pointer past this entry and store it on the special-object record.
39290 LD A,(IX+1) Read the next byte of this script.
39293 CP 255 Jump to Turn_StepTheScriptPointer_FollowThePointer if that script byte is 255.
39295 JR Z,Turn_StepTheScriptPointer_FollowThePointer
39297 LD (46823),A Update *CurrentAction.
Update the current object.
39300 LD A,255 Write 255 to *CurrentObject and *46825.
39302 LD (46824),A
39305 LD (46825),A
39308 CALL Turn_ApplyTheSavedMatch Call Turn_ApplyTheSavedMatch to build the action sentence from the saved match.
39311 JR Z,Turn_StepTheScriptPointer_CountAnotherTry Jump to Turn_StepTheScriptPointer_CountAnotherTry if Turn_ApplyTheSavedMatch returned zero.
39313 JP Turn_GateTheMessage_StepThePointerOnBySevenBytes Jump back to Turn_GateTheMessage_StepThePointerOnBySevenBytes to clear *38923.
Turn_StepTheScriptPointer_FollowThePointer 39316 BIT 4,(IX+0) Jump back to Turn_GateTheMessage_StepThePointerOnBySevenBytes if bit 4 of this script byte is clear.
39320 JP Z,Turn_GateTheMessage_StepThePointerOnBySevenBytes
39323 LD L,(IX+2) Read the low byte of the pointer in this script.
39326 LD H,(IX+3) Read the high byte of the pointer in this script.
39329 LD (IY+2),L Store the low byte of that pointer on the special-object record.
39332 LD (IY+3),H Store the high byte of that pointer on the special-object record.
39335 JP Turn_GateTheMessage_StepThePointerOnBySevenBytes Jump back to Turn_GateTheMessage_StepThePointerOnBySevenBytes to clear *38923.
Turn_StepTheScriptPointer_CountAnotherTry 39338 LD HL,38923 Point HL at 38923.
39341 INC (HL) Count one more try.
39342 BIT 4,(IX+0) Jump back to Turn_GateTheMessage_ReadTheScriptPointer if bit 4 of this script byte is clear.
39346 JP Z,Turn_GateTheMessage_ReadTheScriptPointer
39349 ADD IX,DE Step the script pointer on by DE.
39351 LD H,(IX+1) Read the high byte of the word at this script byte.
39354 LD L,(IX+0) Read this script byte into L.
39357 LD (IY+2),L Store the low byte of that word on the special-object record.
39360 LD (IY+3),H Store the high byte of that word on the special-object record.
39363 JP Turn_GateTheMessage_TestTheTryCount Branch Turn_GateTheMessage_TestTheTryCount on this test.
Prev: 38911 Up: Map Next: 39366