Prev: D244 Up: Map Next: D338
D24E: Handle Rex takes question
Used by the routine at CFB5.
D24E LD (IX+$0C),$00 Set question to not visble
D252 PUSH IX Save IX and BC
D254 PUSH BC
D255 CALL $D36F Reset sound volume chanels
D258 CALL $D63B Copy screen display file into room graphic data buffer
D25B LD BC,$4E20 SET BC = 20.000
D25E CALL $C94E Wait some time ~1s (128 t-states 20.000 times)
D261 LD IX,$ABFE Point IX to the text defintion for SPEED UP
D265 LD B,$01 Set B to the number of rows to draw
D267 CALL $A2E6 Draw the windows into the display file
D26A LD HL,$1CE8 Set A216 the Bonus Windows Loop Counter (7200 loops)
D26D LD ($A216),HL
D270 CALL $A51D Set A a random number between 1-4
D273 AND $03
D275 INC A
D276 LD ($A208),A Set A208 to the number of bonus screen to show (0-speed up 1-shield loss 2-1000 bonus 3-energy loss 4-100 rapid shots)
D279 SLA A Set into IX the address of the text defintion corresponding to the number of bonus
D27B LD E,A
D27C LD D,$00
D27E LD HL,$D244
D281 ADD HL,DE
D282 LD E,(HL)
D283 INC HL
D284 LD D,(HL)
D285 PUSH DE
D286 POP IX
D288 CALL $A4AF Print the line of text into the windows
D28B INC IX Increment pointer for the next bonus line
D28D LD BC,($A216) Set BC to the Bonus Windows Counter
D291 PUSH BC Save BC
D292 CALL $A61F Check FIRE pressed
D295 POP BC Restore BC
D296 JP Z,$D2C7 If FIRE key pressed jump to handle the bonus selected
D299 DEC BC Decrement counter
D29A LD A,B Jump back and wait for keypressed if counter has not reached zero
D29B OR C
D29C JP NZ,$D291
D29F LD HL,($A216) Reset loop counter (substract 200 loops to the previous counter)
D2A2 LD DE,$00C8
D2A5 AND A
D2A6 SBC HL,DE
D2A8 LD ($A216),HL
D2AB LD A,H If loop counter less than 256 then jump to handle the bonus on screen
D2AC OR A
D2AD JP Z,$D2C7
D2B0 LD A,($A208) Increment the bonus windows number
D2B3 INC A
D2B4 LD ($A208),A
D2B7 CP $05 if bonus number equals 5 then point to the first bonus
D2B9 JP NZ,$D288
D2BC LD IX,$ABFE
D2C0 XOR A
D2C1 LD ($A208),A
D2C4 JP $D288 Jump back and show the next bonus
handle bonus selected
D2C7 LD A,($A208) Check bonus slected
D2CA OR A is speed up?
D2CB JP Z,$D2F5 Jump to handle speed up bonus
D2CE CP $01 is shield loss?
D2D0 JP Z,$D305 Jump to handle shield loss
D2D3 CP $02 is 1000 bouns points?
D2D5 JP Z,$D310 Jump to handle bonus points
D2D8 CP $03 is energy loss?
D2DA JP Z,$D31C handle energy loss
D2DD CP $04 is rapid shots?
D2DF JP Z,$D328 handle rapid shots
return to normal game
D2E2 LD BC,$4E20 Set BC to 20.000
D2E5 CALL $C94E Wait some time ~1s (128 t-states 20.000 times)
D2E8 CALL $D346 Reset sound data buffer
D2EB POP BC Restore BC and IX
D2EC POP IX
D2EE CALL $A432 Copy room graphic buffer to display file
D2F1 CALL $C932 Copy room color attribute buffer to attribute file
D2F4 RET
handle speed up
D2F5 LD A,$01 Set Rex fast speed
D2F7 LD ($A20B),A
D2FA LD A,$C8 Set speed up duration to 200
D2FC LD ($A20C),A
D2FF LD HL,$ABFE Set HL to point to the bonus text definition address
D302 JP $D2E2 Jump back and return to normal game
handle shield loss
D305 LD L,$14 loss quantity to L = 20
D307 CALL $98EC Handle shield loss
D30A LD HL,$AC11 Set HL to point to the bonus text definition address
D30D JP $D2E2 Jump back and return to normal game
handle bonus points
D310 LD DE,$000A Set A to the bonus points obtained (*100)
D313 CALL $9945 Increment score
D316 LD HL,$AC24 Set HL to point to the bonus text definition address
D319 JP $D2E2 Jump back and return to normal game
handle energy loss
D31C CALL $BAB8 Handle double weapon energy loss
D31F CALL $A34D Draw HUD
D322 LD HL,$AC37 Set HL to point to the bonus text definition address
D325 JP $D2E2 Jump back and return to normal game
handle rapid shots
D328 LD A,$01 Set rapid shots
D32A LD ($A1D9),A
D32D LD A,$64 Set number of rapid shots
D32F LD ($A1DA),A
D332 LD HL,$AC4A Set HL to point to the bonus text definition address
D335 JP $D2E2 Jump back and return to normal game
Prev: D244 Up: Map Next: D338