![]() |
Routines |
| Prev: 9240 | Up: Map | Next: 9663 |
|
|
||||
| 9470 | DI | Disable interrupts | ||
| 9471 | XOR A | A=0 | ||
| 9472 | LD ($A247),A | Initialise input device type to $00 | ||
| 9475 | LD ($A25B),A | Initialise to 0 the number of room to display in attract-mode | ||
| 9478 | CALL $DAC0 | Main loop for the tile screen | ||
| 947B | LD HL,$E4FF | Clear the attribute buffer for HUD and room | ||
| 947E | LD DE,$E500 | |||
| 9481 | LD BC,$02FF | |||
| 9484 | LD (HL),$00 | |||
| 9486 | LDIR | |||
| 9488 | LD HL,$000A | Set the minimum score for the game to 1000 = $0A * 100 | ||
| 948B | LD ($A224),HL | |||
|
Initialise data buffers and game states variables. This entry point is used by the routine at 9D68.
|
||||
| 948E | CALL $A793 | Initialise drones configuration data buffer | ||
| 9491 | LD A,$08 | Initialise laser duration to 8 | ||
| 9493 | LD ($A201),A | |||
| 9496 | XOR A | Set A=0 | ||
| 9497 | OUT ($FE),A | Reset keyboard reading | ||
| 9499 | LD ($A20A),A | Set Rex to be mortal | ||
| 949C | LD A,$00 | Set current room number | ||
| 949E | LD ($A251),A | |||
| 94A1 | XOR A | Set A=0 | ||
| 94A2 | LD ($A268),A | Set FINAL BOSS alive | ||
| 94A5 | LD ($A202),A | Set the respawn indicator index value for animatio | ||
| 94A8 | LD ($A203),A | Set the shield recharger index value for animation | ||
| 94AB | LD ($A215),A | Initialized but never used | ||
| 94AE | LD ($A202),A | Duplicated code | ||
| 94B1 | LD ($A204),A | Initialized but never used | ||
| 94B4 | LD ($A1F4),A | Number of room in the last saved respawn | ||
| 94B7 | LD ($A1F5),A | Set current room not configured | ||
| 94BA | LD ($A20B),A | Set Rex speed to normal | ||
| 94BD | LD ($A20C),A | |||
| 94C0 | LD ($AC5D),A | Initialize variable related to DOUBLE FIRE weapon selection windows | ||
| 94C3 | LD ($AC6E),A | Initialize variable related to LASER weapon selection windows | ||
| 94C6 | LD ($AC79),A | Initialize variable related to MULTIPLE weapon selection windows | ||
| 94C9 | LD ($AC87),A | Initialize variable related to SPRAY weapon selection windows | ||
| 94CC | LD ($A1EE),A | Set Rex alive | ||
| 94CF | XOR A | |||
| 94D0 | LD ($A1FD),A | Set time bar update slot index | ||
| 94D3 | LD ($A1FF),A | Set time bar update direction to right | ||
| 94D6 | LD HL,$0313 | Initialise seed for pseudo random number generator | ||
| 94D9 | LD ($A23A),HL | |||
| 94DC | LD A,$11 | |||
| 94DE | LD ($A23C),A | |||
| 94E1 | LD HL,($A263) | Set HL the score from Rex (Side A) | ||
| 94E4 | LD ($A1D7),HL | Set the initial score | ||
| 94E7 | LD ($A222),HL | Set the initial number of humans killed | ||
| 94EA | LD A,($A267) | Set A the number of lives from Rex (Side A) | ||
| 94ED | LD ($A1FC),A | Set the initial number of lives | ||
| 94F0 | LD A,($A266) | Set A the number of smartbombs from Rex (Side A) | ||
| 94F3 | LD ($A205),A | Set the initial number of smartbombs | ||
| 94F6 | CALL $BAC6 | Initialise weapon data (laser in use) | ||
| 94F9 | LD A,($A265) | Set A the shield power | ||
| 94FC | LD ($A1E6),A | Set the initial shield power | ||
| 94FF | LD A,$02 | Set shield loss counter | ||
| 9501 | LD ($A1E7),A | |||
| 9504 | LD HL,($A1D7) | Computes and set the increment lives score counter. Lives score counter = Score counter from Rex (Side A) mod 100 | ||
| 9507 | LD DE,$0064 | |||
| 950A | AND A | |||
| 950B | SBC HL,DE | |||
| 950D | JP NC,$950A | |||
| 9510 | ADD HL,DE | |||
| 9511 | LD ($A20F),HL | |||
| 9514 | LD A,$01 | Set machine gun weapon available | ||
| 9516 | LD ($A1E8),A | |||
| 9519 | XOR A | Set rapid shots inactive | ||
| 951A | LD ($A1D9),A | |||
| 951D | LD ($A1D1),A | Initialized but never used | ||
| 9520 | LD ($A1C9),A | Set to not destroy all enemies | ||
| 9523 | LD ($A24C),A | Initialized but never used | ||
| 9526 | LD ($A1E2),A | Set shield power inactive | ||
| 9529 | LD A,$70 | Set initial Rex x-position | ||
| 952B | LD ($A24F),A | |||
| 952E | LD ($A1F2),A | Set initial respawn x-position | ||
| 9531 | LD A,$30 | Set initial Rex y-position | ||
| 9533 | LD ($A250),A | |||
| 9536 | LD ($A1F3),A | Set initial respawn y-position | ||
| 9539 | XOR A | |||
| 953A | LD ($A254),A | Set Rex facing right | ||
| 953D | LD ($A256),A | Set Rex to not jumping | ||
| 9540 | LD ($A22A),A | Set speed of Rex | ||
| 9543 | LD ($A255),A | Set Rex to not falling | ||
| 9546 | XOR A | |||
| 9547 | LD ($A1B1),A | Set weapon energy quantity | ||
| 954A | LD A,$FF | Set HUD flash ianctive | ||
| 954C | LD ($A1DB),A | |||
| 954F | LD A,$00 | |||
| 9551 | CALL $A556 | Reset display and attribute file | ||
| 9554 | CALL $A34D | Draw HUD | ||
| 9557 | CALL $98D9 | Draws lives number on HUD | ||
| 955A | CALL $98C9 | Draw score on HUD | ||
| 955D | CALL $BC0B | Copy the attribute file of the HUD to the attribute buffer | ||
| 9560 | LD IX,$AAF7 | Point IX to text definition for game start | ||
| 9564 | LD B,$03 | Set B the number of lines to show | ||
| 9566 | CALL $A2E6 | Draws windows for game start | ||
| 9569 | CALL $97AB | Reset sound buffer, volume channels and check for FIRE key | ||
| 956C | LD IX,$ABE2 | Point IX to text definition for press key | ||
| 9570 | LD B,$02 | Set B the number of lines to show | ||
| 9572 | CALL $A2E6 | Draws windows for press key | ||
| 9575 | CALL $97AB | Reset sound data and wait some time for FIRE key | ||
| 9578 | LD A,($A22C) | Check if FIRE key ispressed | ||
| 957B | OR A | |||
| 957C | JP Z,$A98E | Jump to attract-mode if FIRE key not pressed | ||
| 957F | CALL $D346 | Reset sound data buffer | ||
| 9582 | CALL $9E15 | Configure data for Rex teleporting when game begins | ||
| 9585 | CALL $A939 | Configure current room | ||
| 9588 | CALL $B694 | Draw Rex projectiles | ||
| 958B | CALL $B68B | Draw enemy projectiles | ||
| 958E | CALL $A7A4 | Draw drones for multiple weapon | ||
| 9591 | CALL $9683 | Draw Rex and shield | ||
| 9594 | CALL $9E67 | Handle Rex visibility during teleporting | ||
| 9597 | CALL $9F9B | Handle Rex atoms flush during teleporting | ||
| 959A | CALL $BC48 | Draw enemies | ||
| 959D | CALL $D424 | Play sound channels | ||
| 95A0 | CALL $B384 | Copy tile graphic into room graphic data | ||
| 95A3 | LD A,($A268) | Jump to handle explosions if FINAL BOSS is dead | ||
| 95A6 | OR A | |||
| 95A7 | CALL NZ,$99E3 | |||
| 95AA | CALL $A432 | Copy room graphic buffer to display file | ||
| 95AD | CALL $B243 | Reset room graphic buffer | ||
| 95B0 | CALL $D424 | Play sound channels | ||
| 95B3 | CALL $CF59 | Handle enemy projectile collision with Rex | ||
| 95B6 | CALL $B9E6 | Update color attribute for weapon icon on HUD | ||
| 95B9 | CALL $C9E3 | Generate train parts: front, middle or rear wagon. No trains in Rex (Side B) | ||
| 95BC | CALL $CA35 | Creates a new mobile enemy on room | ||
| 95BF | CALL $976E | Destroy an enemy if smartbomb released or Rex dead | ||
| 95C2 | CALL $98B0 | Update attribute color for score points in HUD | ||
| 95C5 | CALL $996A | HUD flash | ||
| 95C8 | CALL $A26C | Update timer bar in HUD | ||
| 95CB | CALL $A683 | Check if DOWN key pressed | ||
| 95CE | CALL Z,$9667 | Active/inactive shield power if keypressed | ||
| 95D1 | CALL $A683 | Check if DOWN key pressed | ||
| 95D4 | JP Z,$95DB | Jump forward if DOWN key is still pressed | ||
| 95D7 | XOR A | Set Shield power key not hold down | ||
| 95D8 | LD ($A1E5),A | |||
| 95DB | LD BC,$BFFE | Check if RESET key (ENTER) is pressed | ||
| 95DE | IN A,(C) | |||
| 95E0 | BIT 0,A | |||
| 95E2 | JP Z,$948E | Jump back to reset game | ||
| 95E5 | LD BC,$BFFE | Check if PAUSE key (H) is pressed | ||
| 95E8 | IN A,(C) | |||
| 95EA | BIT 4,A | |||
| 95EC | CALL Z,$A68F | Pause game if pressed | ||
| 95EF | LD BC,$7FFE | Check if SMARTBOMB key (SPACE) is pressed | ||
| 95F2 | IN A,(C) | |||
| 95F4 | BIT 0,A | |||
| 95F6 | CALL Z,$9739 | Release a smartbomb if pressed | ||
| 95F9 | LD A,($A24F) | Copy x-position of Rex into A248 | ||
| 95FC | LD ($A248),A | |||
| 95FF | LD A,($A250) | Copy y-position of Rex into A250 | ||
| 9602 | LD ($A249),A | |||
| 9605 | LD A,($A254) | Set A the face direction of Rex | ||
| 9608 | CALL $A6AB | Computes address position in tile type buffer based on (x,y) position on screen | ||
| 960B | LD ($A1B2),HL | Set this address into A1EE | ||
| 960E | LD A,($A1EE) | Jump forward if Rex is dead | ||
| 9611 | OR A | |||
| 9612 | JP NZ,$9655 | |||
|
Rex is alive
|
||||
| 9615 | LD A,($A1D9) | Jump forward if no rapid shots | ||
| 9618 | OR A | |||
| 9619 | JP Z,$9620 | |||
| 961C | XOR A | Set FIRE key not hold down | ||
| 961D | LD ($A1AB),A | |||
| 9620 | CALL $A61F | Check if FIRE key is pressed | ||
| 9623 | CALL Z,$B3B8 | Fire weapon if pressed | ||
| 9626 | CALL $A61F | Check if FIRE key is pressed | ||
| 9629 | JP Z,$9630 | Jump forward if key is still pressed | ||
| 962C | XOR A | Set FIRE key not hold down | ||
| 962D | LD ($A1AB),A | |||
| 9630 | LD A,($A268) | Jump forward if FINAL BOSS is dead | ||
| 9633 | OR A | |||
| 9634 | JP NZ,$9643 | |||
| 9637 | CALL $A651 | Check if RIGHT key is pressed | ||
| 963A | CALL Z,$CD52 | Jump to move Rex right if key pressed | ||
| 963D | CALL $A638 | Check if LEFT key is pressed | ||
| 9640 | CALL Z,$CD6E | Jump to move Rex left is key pressed | ||
| 9643 | CALL $A66A | Check if UP key is pressed | ||
| 9646 | CALL Z,$CE52 | Jump to set Rex jump is key pressed | ||
| 9649 | CALL $CE74 | Handle Rex jumping | ||
| 964C | CALL $CEE5 | Handle Rex falling | ||
| 964F | CALL $CD8B | Handle Rex lateral movement | ||
| 9652 | CALL $A0F8 | Handle Rex over special tiles | ||
| 9655 | CALL $A706 | Update arrow tiles, shield recharger and respawn indicator | ||
| 9658 | LD A,($A1B0) | Change tilt arrow tiles indicator | ||
| 965B | XOR $01 | |||
| 965D | LD ($A1B0),A | |||
| 9660 | JP $9588 | Jump back to main loop game | ||
| Prev: 9240 | Up: Map | Next: 9663 |