Prev: 7F72 Up: Map Next: 967B
947A: The game has just loaded
947A DI Disable interrupts
947B XOR A A=0
947C LD ($A0AE),A Initialise input device type to $00 at A0AE
947F LD ($A0C2),A Initialise to 0 the number of room to display in attract-mode
9482 CALL $DAC0 Main loop for the tile screen
9485 LD HL,$E4FF Clear the attribute buffer for HUD and room
9488 LD DE,$E500
948B LD BC,$02FF
948E LD (HL),$00
9490 LDIR
9492 LD HL,$000A Set the minimum score for the game to 1000 = $0A * 100
9495 LD ($A08B),HL
Initialise data buffers and game states variables. Used by the routines at 9C76, A7CE and A915.
9498 CALL $A628 Initialise drones configuration data buffer
949B LD A,$08 Initialise laser duration to 8
949D LD ($A068),A
94A0 XOR A Set A=0
94A1 OUT ($FE),A Reset keyboard reading
94A3 LD ($A071),A Set Rex to be mortal
94A6 LD ($A0B8),A Set current room number
94A9 LD ($A069),A Set the respawn indicator index value for animation
94AC LD ($A06A),A Set the shield recharger index value for animation
94AF LD ($A07C),A Set the water effect index value for animation
94B2 LD ($A069),A Duplicated code
94B5 LD ($A06B),A Set the respawn fire index value for animation
94B8 LD ($A05B),A Number of room in the last saved respawn
94BB LD ($A05C),A Set current room not configured
94BE LD ($A072),A Set Rex speed to normal
94C1 LD ($A073),A
94C4 LD ($ABA0),A Initialize variable related to DOUBLE FIRE weapon selection windows in game
94C7 LD ($ABB1),A Initialize variable related to LASER weapon selection windows in game
94CA LD ($ABBC),A Initialize variable related to MULTIPLE weapon selection in game
94CD LD ($ABCA),A Initialize variable related to SPRAY weapon selection in game
94D0 LD ($A055),A Set Rex alive
94D3 XOR A
94D4 LD ($A064),A Set time bar update slot index
94D7 LD ($A066),A Set time bar update direction to right
94DA LD HL,$0313 Initialise seed for pseudo random number generator
94DD LD ($A0A1),HL
94E0 LD A,$11
94E2 LD ($A0A3),A
94E5 LD HL,$0000 Set initial score
94E8 LD ($A03E),HL
94EB LD ($A076),HL Set initial score for live bonus
94EE LD ($A089),HL Set humans killed
94F1 LD A,$04 Set the number of lives of Rex
94F3 LD ($A063),A
94F6 LD A,$03 Set the number of smartbombs in inventory
94F8 LD ($A06C),A
94FB CALL $BA49 Initialise weapon data
94FE LD A,$63 Set shield power
9500 LD ($A04D),A
9503 LD A,$02 Set shield loss counter. Shield loss when this value reaches 0
9505 LD ($A04E),A
9508 LD A,$01 Machine gun weapon available on init
950A LD ($A04F),A
950D XOR A Set A=0
950E LD ($A050),A Double fire weapon not available on init
9511 LD ($A051),A Laser weapon not available on init
9514 LD ($A052),A Multiple weapon not available on init
9517 LD ($A053),A Spray weapon not available on init
951A XOR A
951B LD ($A040),A Set rapid shots inactive
951E LD ($A038),A Variable not used in game
9521 LD ($A030),A Set Destroy all enemies inactive
9524 LD ($A0B3),A Variable not used in game
9527 LD ($A049),A Shield inactive
952A LD A,$A0 Set initial x-position of Rex
952C LD ($A0B6),A
952F LD ($A059),A
9532 LD A,$60 Set initial y-position of Rex
9534 LD ($A0B7),A
9537 LD ($A05A),A
953A XOR A
953B LD ($A0BB),A Set Rex facing direction to right
953E LD ($A0BD),A Set Rex not jumping
9541 LD ($A091),A Rex falling y-speed 0
9544 LD ($A0BC),A Set Rex not falling
9547 XOR A Set weapon energy quantity
9548 LD ($A018),A
954B LD A,$FF Set HUD flash inactive
954D LD ($A042),A
9550 LD A,$00
9552 CALL $A3AE Reset display and attribute file Draw HUD and the windows to start play
9555 CALL $A1A5 Draw HUD
9558 CALL $99BB Draw lives number on HUD
955B CALL $CF8F Copy the attribute file of the HUD to the attribute buffer of the HUD
955E LD IX,$AAAE Draw windows PHASE ONE: PROCEED ON FOOT THROUGH UNDERGROUND COMPLEX
9562 LD B,$03
9564 CALL $A13E
9567 CALL $97C3 Reset sound buffer, volume channels and check for FIRE key
956A LD IX,$AB25 Draw windows PRESS FIRE TO BEGIN
956E LD B,$02
9570 CALL $A13E
9573 CALL $97C3 Reset sound buffer, volume channels and check for FIRE key
9576 LD A,($A093) FIRE key pressed?
9579 OR A
957A JP Z,$A915 Jump to attract-mode if it isn't
957D CALL $D5AE Reset sound data buffer
9580 CALL $9D1F Configure data for Rex teleporting on game begins
Main loop for the game. This entry point is used by the routines at 9C76 and C95A.
9583 CALL $A89D Configure current room
9586 CALL $B64E Draw Rex projectiles
9589 CALL $B645 Draw enemy projectiles
958C CALL $A639 Draw drones for multiple weapon
958F CALL $969B Draw Rex and shield
9592 CALL $9D71 Handle Rex visibility during teleporting
9595 CALL $9E02 Handle Rex atoms flush during teleporting
9598 CALL $BA5C Draw enmies
959B CALL $D68C Play sound channels
959E CALL $B33E Copy tile graphic into room graphic data buffer
95A1 CALL $A28A Copy room graphic data buffer to display file
95A4 CALL $B205 Reset room graphic data buffer
95A7 CALL $D68C Play sound channels
95AA CALL $D1B9 Handle enemy projectile collision with Rex
95AD CALL $B96B Update attribute color for weapon icon on HUD
95B0 CALL $C978 Generate train parts: front, middle or rear wagon
95B3 CALL $C9CA Creates a new mobile enemy on room
95B6 CALL $9786 Destroy an enemy if smartbomb released or Rex has been killed
95B9 CALL $9992 Update attribute color for score points in HUD
95BC CALL $9A4C HUD flash
95BF CALL $A0C4 Update timer bar in HUD
95C2 CALL $A4DB Check if DOWN key pressed
95C5 CALL Z,$967F Active/inactive shield power if keypressed
95C8 CALL $A4DB Check if DOWN key pressed
95CB JP Z,$95D2 Jump forward if DOWN key is still pressed
95CE XOR A Set Shield power key not hold down
95CF LD ($A04C),A
95D2 LD BC,$BFFE Check if RESET key (ENTER) is pressed
95D5 IN A,(C)
95D7 BIT 0,A
95D9 JP Z,$9498 Jump back to reset game
95DC LD BC,$BFFE Check if PAUSE key (H) is pressed
95DF IN A,(C)
95E1 BIT 4,A
95E3 CALL Z,$A4E7 Pause game if pressed
95E6 LD BC,$7FFE Check if SMARTBOMB key (SPACE) is pressed
95E9 IN A,(C)
95EB BIT 0,A
95ED CALL Z,$9751 Release a smartbomb if pressed
95F0 LD A,($A0B6) Copy x-position of Rex into A0AF
95F3 LD ($A0AF),A
95F6 LD A,($A0B7) Copy y-position of Rex into A0B0
95F9 LD ($A0B0),A
95FC LD A,($A0BB) Set A the face direction of Rex
95FF CALL $A503 Computes address position in tile type buffer based on (x,y) position on screen
9602 LD ($A019),HL Set this address into A019
9605 LD A,($A055) Jump forward if Rex is dead
9608 OR A
9609 JP NZ,$9645
Rex is alive
960C LD A,($A040) Jump forward if no rapid shots
960F OR A
9610 JP Z,$9617
9613 XOR A Set FIRE key not hold down
9614 LD ($A012),A
9617 CALL $A477 Check if FIRE key is pressed
961A CALL Z,$B372 Fire weapon if pressed
961D CALL $A477 Check if FIRE key is pressed
9620 JP Z,$9627 Jump forward if key is still pressed
9623 XOR A Set FIRE key not hold down
9624 LD ($A012),A
9627 CALL $A4A9 Check if RIGHT key is pressed
962A CALL Z,$CFDA Jump to move Rex right if key pressed
962D CALL $A490 Check if LEFT key is pressed
9630 CALL Z,$CFF6 Jump to move Rex left is key pressed
9633 CALL $A4C2 Check if UP key is pressed
9636 CALL Z,$D0C2 Jump to set Rex jump is key pressed
9639 CALL $D0E4 Handle Rex jumping
963C CALL $D14D Handle Rex falling
963F CALL $D013 Handle Rex lateral movement
9642 CALL $9F5F Handle Rex over special tiles
Rex is dead
9645 LD HL,$6758 Rotate left tile $6F. Not used in game
9648 LD B,$08
964A RRC (HL)
964C INC HL
964D DJNZ $964A
964F LD HL,$6858 Rotate right two times tile $8F. Simulate horizontal conveyor belt
9652 LD B,$08
9654 RLC (HL)
9656 RLC (HL)
9658 INC HL
9659 DJNZ $9654
965B LD HL,$64C0 Set HL to point to tile $1C graphic data (vertical conveyor belt)
965E CALL $A7BA Simulate conveyor belt going down
9661 LD HL,$6438 Set HL to point to tile $0B graphic data (vertical conveyor belt)
9664 CALL $A7A9 Simulate conveyor belt going up
9667 LD HL,$64B0 Set HL to point to tile $1A graphic data (vertical conveyor belt)
966A CALL $A7BA Simulate conveyor belt going down
966D CALL $A55E Update arrow tiles, shield recharger, respawn indicator, fire and water effect
9670 LD A,($A017) Change tilt arrow tiles
9673 XOR $01
9675 LD ($A017),A
9678 JP $9586 Jump back to main loop game
Prev: 7F72 Up: Map Next: 967B