Prev: BF67 Up: Map Next: C047
BF72: Test 08 : Is Boxing Glove Trap safe.
Input
Output
Checks to see if Wally will get hit by the Boxing Glove trap, carrying the towel will stop this.
This test will act on the trap if it becomes false.
Test08_BoxingGloveSafe BF72 LD A,(Pocket1) Is Wally carrying the towel.
BF75 CP $15
BF77 JP Z,Room_CllEvnt_NxtCmd True, next command / test.
BF7A LD A,(Pocket2) Again for pocket 2.
BF7D CP $15
BF7F JP Z,Room_CllEvnt_NxtCmd
BF82 LD A,(Wally_RoomNo) Is Wally in the same room as where the trap has been made active?
BF85 LD B,A
BF86 LD A,(BoxingTrap_Room)
BF89 CP B
BF8A JP NZ,Room_CllEvnt_NxtCmd False, next command / test.
BF8D PUSH HL
BF8E PUSH DE
BF8F PUSH BC
BF90 LD BC,$0000
BF93 LD DE,$0101
BF96 LD HL,$E600
BF99 CALL Beep_Effect
BF9C POP BC
BF9D POP DE
BF9E POP HL
BF9F LD A,$01
BFA1 LD (DeathFlag),A
BFA4 LD HL,(BoxingTrap_NextPtr) Move the trap onto the next room in the list.
BFA7 LD A,(HL)
BFA8 LD (BoxingTrap_Room),A
BFAB INC HL
BFAC LD A,(HL)
BFAD CP $FF If we reach the end of the list, then reset back to start of list.
BFAF JR NZ,Test08_BoxingGloveSafe_0
BFB1 LD HL,BoxingTrap_Rooms
Test08_BoxingGloveSafe_0 BFB4 LD (BoxingTrap_NextPtr),HL
BFB7 LD HL,$98E8
BFBA LD (BitmapX),HL
BFBD LD A,$A5
BFBF CALL Bitmap16Draw
BFC2 LD B,$07
BFC4 LD C,A
Test08_BoxingGloveSafe_1 BFC5 PUSH BC
BFC6 CALL Wally_Erase
BFC9 LD HL,(Wally_X)
BFCC DEC L
BFCD DEC L
BFCE LD (Wally_X),HL
BFD1 CALL Wally_Draw
BFD4 POP BC
BFD5 LD A,C
BFD6 LD HL,$98E8
BFD9 LD (BitmapX),HL
BFDC CALL Bitmap16Draw
BFDF INC C
BFE0 INC A
BFE1 CALL Bitmap16Draw
BFE4 PUSH BC
BFE5 CALL Pause_Short
BFE8 CALL Room_EventCaller
BFEB POP BC
BFEC DJNZ Test08_BoxingGloveSafe_1
BFEE CALL Wally_StartOfDeath
BFF1 LD B,$28
Test08_BoxingGloveSafe_2 BFF3 PUSH BC
BFF4 CALL Pause_Short
BFF7 CALL Room_EventCaller
BFFA POP BC
BFFB DJNZ Test08_BoxingGloveSafe_2
BFFD LD HL,$98E8
C000 LD (BitmapX),HL
C003 LD A,$AC
C005 CALL Bitmap16Draw
C008 CALL Wally_Erase
C00B LD D,$A8
C00D LD A,(MilkLevel)
C010 CP $1A
C012 JP NC,$BDC3
C015 XOR A
C016 LD (DeathFlag),A
C019 LD (Wally_JumpDir),A
C01C LD (Wally_Dir),A
C01F LD A,$10
C021 LD (Wally_Frame),A
C024 CALL Wally_Draw
C027 LD B,$05
C029 CALL Milk_DecreaseByAmount
C02C LD A,$01
C02E LD (DeathFlag),A
C031 LD B,$0A
Test08_BoxingGloveSafe_3 C033 PUSH BC
C034 CALL Pause_Short
C037 CALL Room_EventCaller
C03A POP BC
C03B DJNZ Test08_BoxingGloveSafe_3
C03D XOR A
C03E LD (DeathFlag),A
C041 LD SP,$0000
C044 JP GameLoop
Prev: BF67 Up: Map Next: C047