Prev: 30419 Up: Map Next: 30683
30423: Handler: Ghost Rider
Used by the routines at 29038 and 29457.
Handler_GhostRider 30423 CALL DrawSpriteObject Call DrawSpriteObject.
30426 LD A,(30757) Return if *SpriteState is zero.
30429 AND A
30430 RET Z
30431 XOR A Write 0 to *SpriteState.
30432 LD (30757),A
30435 LD A,(30762) Return if *Action is not zero.
30438 AND A
30439 RET NZ
30440 EXX Switch to the shadow registers.
30441 LD A,C A=C'.
30442 EXX Switch back to the normal registers.
30443 CP 68 Jump to Handler_GhostRider_2 if A is lower than 68.
30445 JR C,Handler_GhostRider_2
30447 JR NZ,Handler_GhostRider_0 Jump to Handler_GhostRider_0 if A is not equal to 68.
30449 LD HL,30784 HL=30784.
30452 LD A,(HL) Jump to 60458 if *HL is not zero.
30453 AND A
30454 JP NZ,60458
30457 LD (HL),1 Write 1 to *HL.
30459 CALL 60431 Call 60431.
30462 NOP No operation.
30463 LD HL,(30788) Add 500 to *Score.
30466 LD DE,500
30469 ADD HL,DE
30470 LD (30788),HL
Print the "THE RACE IS ON!" messaging in the footer.
race-is-on
30473 LD A,150 A=150 (INK: YELLOW, PAPER: RED FLASH: ON).
30475 LD HL,47782 HL=Messaging_RaceIsOn.
30478 CALL PrintFooterColourString Call PrintFooterColourString.
30481 CALL Sounds_TheRaceIsOn Call Sounds_TheRaceIsOn.
30484 CALL PrintDemoMode Call PrintDemoMode.
30487 XOR A Write 0 to *30756.
30488 LD (30756),A
30491 INC A Write 1 to *30746.
30492 LD (30746),A
30495 LD HL,2926 Write 2926 to *30785.
30498 LD (30785),HL
30501 NOP No operation.
30502 CALL 27977 Call 27977.
Handler_GhostRider_0 30505 CP 70 Jump to Handler_GhostRider_1 if A is higher than 70.
30507 JR NC,Handler_GhostRider_1
30509 LD DE,50 Add 0050 to *Score.
30512 LD HL,(30788)
30515 ADD HL,DE
30516 LD (30788),HL
30519 POP HL Restore HL and DE from the stack.
30520 POP DE
30521 PUSH DE Stash DE and HL on the stack.
30522 PUSH HL
30523 LD HL,65530 HL=65530.
30526 ADD HL,DE HL+=DE.
30527 SET 7,(HL) Set bit 7 of *HL.
30529 RET Return.
Handler_GhostRider_1 30530 JR NZ,Handler_GhostRider_10 Jump to Handler_GhostRider_10 if {} is not zero.
Handler_GhostRider_2 30532 NOP No operation.
30533 NOP
30534 NOP
30535 NOP
30536 NOP
30537 NOP
30538 POP HL Restore HL and DE from the stack.
30539 POP DE
30540 LD HL,(30782) HL=*30782.
30543 LD BC,8 BC=0008.
30546 LD A,C A=C.
Handler_GhostRider_3 30547 SET 7,(HL) Set bit 7 of *HL.
30549 ADD HL,BC HL+=BC.
30550 DEC A Decrease A by one.
30551 JR NZ,Handler_GhostRider_3 Jump to Handler_GhostRider_3 until A is zero.
30553 LD HL,65530 HL=65530.
30556 ADD HL,DE HL+=DE.
30557 RES 7,(HL) Reset bit 7 of *HL.
This entry point is used by the routine at 60458.
Handler_GhostRider_4 30559 PUSH HL Stash HL on the stack.
30560 LD B,6 B=6.
Handler_GhostRider_5 30562 PUSH BC Stash BC on the stack.
30563 CALL RemoveSprites Call RemoveSprites.
30566 CALL Handler_PlayerSprite Call Handler_PlayerSprite.
30569 LD C,40 C=40.
30571 LD HL,2048 HL=2048.
30574 LD A,2 A=2.
Handler_GhostRider_6 30576 OUT (254),A OUT 254
30578 XOR %00010000 Flip bit 4.
30580 LD D,A D=A.
30581 LD B,C B=C.
Handler_GhostRider_7 30582 DJNZ Handler_GhostRider_7 Decrease counter by one and loop back to Handler_GhostRider_7 until counter is zero.
30584 DEC HL Decrease HL by one.
30585 LD A,H Is HL zero?
30586 OR L
30587 LD A,D A=D.
30588 JR NZ,Handler_GhostRider_6 Jump to Handler_GhostRider_6 if HL is not zero.
30590 CALL RemoveSprites Call RemoveSprites.
30593 CALL 29460 Call 29460.
30596 LD C,20 C=20.
30598 LD HL,4096 HL=4096.
30601 LD A,6 A=6.
Handler_GhostRider_8 30603 OUT (254),A OUT 254
30605 XOR %00010000 Flip bit 4.
30607 LD D,A D=A.
30608 LD B,C B=C.
Handler_GhostRider_9 30609 DJNZ Handler_GhostRider_9 Decrease counter by one and loop back to Handler_GhostRider_9 until counter is zero.
30611 DEC HL Decrease HL by one.
30612 LD A,H Is HL zero?
30613 OR L
30614 LD A,D A=D.
30615 JR NZ,Handler_GhostRider_8 Jump to Handler_GhostRider_8 if HL is not zero.
30617 POP BC Restore BC from the stack.
30618 DJNZ Handler_GhostRider_5 Decrease counter by one and loop back to Handler_GhostRider_5 until counter is zero.
30620 POP HL Restore HL from the stack.
30621 SET 7,(HL) Set bit 7 of *HL.
30623 JP Handler_GameOver_8 Jump to Handler_GameOver_8.
Handler_GhostRider_10 30626 NOP No operation.
30627 NOP
30628 NOP
30629 NOP
30630 NOP
30631 NOP
30632 LD DE,1000 Add 1000 to *Score.
30635 LD HL,(30788)
30638 ADD HL,DE
30639 LD (30788),HL
30642 CALL UpdateScoreDisplay Call UpdateScoreDisplay.
30645 CALL RemoveSprites Call RemoveSprites.
30648 NOP No operation.
30649 NOP
30650 NOP
30651 NOP
30652 LD HL,30777 Write 5 to *Lives.
30655 LD (HL),5
30657 CALL GetLevelPassword Call GetLevelPassword.
Print the "NEW CODE ABCDE-PRESS KEY TO PLAY" messaging in the footer.
new-code
30660 LD A,159 A=159 (INK: WHITE, PAPER: MAGENTA FLASH: ON).
30662 LD HL,47814 HL=Messaging_NewCode.
30665 CALL PrintFooterColourString Call PrintFooterColourString.
30668 CALL Sounds_LevelComplete Call Sounds_LevelComplete.
LevelComplete_Input 30671 CALL KeyboardInput Call KeyboardInput.
30674 AND A Jump to LevelComplete_Input until any key is pressed.
30675 JR Z,LevelComplete_Input
30677 CALL PrintDemoMode Call PrintDemoMode.
30680 JP SetNewGameStates Jump to SetNewGameStates.
Prev: 30419 Up: Map Next: 30683