Prev: 6052 Up: Map Next: 6074
6058: Run High-Priority Scripts
Used by the routines at GameLoop and ObeyCommand.
Clears the first 'J' marker when both marker slots hold 4A, then runs the script table at PriorityScripts.
The loader subtracted 3 from the address written below, so the snapshot clears 5E05 rather than 5E08.
RunPriorityScripts 6058 LD A,($5E05) Object slot 3B must hold 'J' (4A).
605B CP $4A
605D JR NZ,RunPriorityScripts_Run
605F LD A,($5E08) Object slot 3E must hold 'J' as well.
6062 CP $4A
6064 JR NZ,RunPriorityScripts_Run
6066 XOR A Clear slot 3B. A fresh game has FC in slot 3E, so this does not fire.
6067 LD ($5E05),A
RunPriorityScripts_Run 606A LD HL,$96D9 Select the high-priority table and fall into the runner.
606D LD A,$FF
606F LD ($5B96),A
6072 JR RunScripts_Line
Prev: 6052 Up: Map Next: 6074