Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $03/A822 A6 01 LDX $01 [$00:0CC9] A:0102 X:0002 Y:0000 P:envMXdIzc ;Main pointer to get which Zero event (00-16)
- $03/A824 7C 27 A8 JMP ($A827,x)[$03:xxxx] A:0102 X:0000 Y:0000 P:envMXdIZc
- 00 (3F A8) - Zero Introduction with Spycopter (03:A83F to 03:AA02)
- 02 (02 AA) - X captured by Mac (03:AA02 to 03:AD0F)
- 04 (0F AD) - Rescue X from Mac (03:AD0F to 03:AEF9)
- 06 (F9 AE) - Zero teleport after Maoh the Giant defeated (03:AEF9 to 03:AFD5)
- 08 (D5 AF) - Zero power cell damaged when defeated in a level (03:AFD5 to 03:B020)
- 0A (20 B0) - Dr. Cain lab pinpoint Doppler's Lab (03:B020 to 03:B0DC)
- 0C (DC B0) - REX-2000 Event (03:B0DC to 03:BC1C)
- 0E (1C B2) - Damaged by Mosquitus (03:BC1C to 03:B373)
- 10 (73 B3) - Z-Saber to Sigma's Wall (03:B373 to 03:B53D)
- 12 (3D B5) - Fall from ceiling and slash Sigma Virus (03:B53D to 03:BA33)
- 14 (33 BA) - Standing on Cliff (03:BA33 to 03:BA5E)
- 16 (5E BA
- ) - Credits Roll (03:BA5E to 03:BA9D)
- $03/A83F A6 02 LDX $02 [$00:0CCA] A:0102 X:00xx Y:0000 P:envMXdIZc ;Loads which sub-event for Spy Copter
- $03/A841 7C 44 A8 JMP ($A844,x)[$03:xxxx] A:0102 X:00xx Y:0000 P:envMXdIZc
- 5C A8
- B1 A8
- D6 A8
- 0B A9
- 26 A9
- 70 A9
- 91 A9
- D1 BA
- B4 A9
- CF A9
- EE A9
- FF A9
- 03:BB11 - Used by various NPCs (JMP short) [PC NPCs should have their own setup in their event area]
- 03:BB04 - Used by various NPCs (JMP short) [PC NPCs should have their own setup in their event area]
- 03:BB37 - Load Zero NPC sprites (JSR short) [Will be compressed down to a universal routine]
- 03:BB49 - Load Zero Z-Saber NPC sprites (JSR Short) [Will be compressed down to a universal routine]
- 03:BAF6 - Load Fall Velocity of NPCs (JSR short) [PC NPCs should have their own setup in their event area]
- Event #00 is generally used to preset the NPC object:
- --> Graphics, palette, sprite assembly, height
- -----------------------------
- Zero Introduction Spycopter
- -----------------------------
- Sub-event #00 ;Sets Zero's sprite data up & palette, Z-Saber palette, Zero's jump velocity, distance and height.
- -----------------------------
- $03/A85C E6 02 INC $02 [$00:0CCA] A:0102 X:0000 Y:0000 P:EnvMXdIzc ;Increase Zero Introduction Spycopter Event to 02
- $03/A85E E6 02 INC $02 [$00:0CCA] A:0102 X:0000 Y:0000 P:EnvMXdIzc ;Increase Zero Introduction Spycopter Event to 02
- $03/A860 A9 30 LDA #$30 A:0102 X:0000 Y:0000 P:EnvMXdIzc ;Set base VRAM location of Zero
- $03/A862 85 18 STA $18 [$00:0CE0] A:0130 X:0000 Y:0000 P:EnvMXdIzc ;Store to NPC RAM $7E:0CE0
- $03/A864 20 37 BB JSR $BB37 [$00:BB37] A:0130 X:0000 Y:0000 P:EnvMXdIzc ;Load Zero's normal sprite setup [MUST BE MADE INTO A UNIVERSAL ROUTINE]
- $03/A867 A9 52 LDA #$52 A:01B4 X:0000 Y:0000 P:EnvMXdIzc ;Animation for Zero jumping up onto Spycopter
- $03/A869 22 67 B9 04 JSL $04B967[$04:B967] A:0152 X:0000 Y:0000 P:EnvMXdIzc ;Load animation routine
- $03/A86D 22 A2 BC 04 JSL $04BCA2[$04:BCA2] A:CF80 X:00DE Y:0002 P:EnvMXdIzc ;Load VRAM data storage (Gets graphics and stores to VRAM)
- $03/A871 A9 3C LDA #$3C A:6410 X:00AD Y:0008 P:EnvMXdIzc ;Set palette of Zero using RAM address
- $03/A873 85 11 STA $11 [$00:0CD9] A:643C X:00AD Y:0008 P:EnvMXdIzc ;Store to NPC RAM $7E:0CD9
- $03/A875 C2 10 REP #$10 A:643C X:00AD Y:0008 P:EnvMXdIzc ;Set to 16-bit reading on X/Y only
- $03/A877 A2 50 00 LDX #$0050 A:643C X:00AD Y:0008 P:EnvMxdIzc ;Load RAM storage of Zero's palette
- $03/A87A A0 D0 00 LDY #$00D0 A:643C X:0050 Y:0008 P:EnvMxdIzc ;Load pointer to Zero's palette
- $03/A87D 22 4A 80 01 JSL $01804A[$01:804A] A:643C X:0050 Y:00D0 P:EnvMxdIzc ;Load palette storage routine
- $03/A881 A2 70 00 LDX #$0070 A:1001 X:00E0 Y:0000 P:EnvMxdIzc ;Load RAM storage of Z-Saber palette
- $03/A884 A0 D2 00 LDY #$00D2 A:1001 X:0070 Y:0000 P:EnvMxdIzc ;Load pointer to Z-Saber palette
- $03/A887 22 4A 80 01 JSL $01804A[$01:804A] A:1001 X:0070 Y:00D2 P:EnvMxdIzc ;Load palette storage routine
- $03/A88B C2 20 REP #$20 A:1001 X:0000 Y:0000 P:envMxdIzc ;Set to 16-bit reading on A/X/Y
- $03/A88D AD 5D 1E LDA $1E5D [$06:1E5D] A:1001 X:0000 Y:0000 P:envmxdIzc ;Load X coordinate of screen
- $03/A890 18 CLC A:0922 X:0000 Y:0000 P:envmxdIzc ;Clear carry flag
- $03/A891 69 00 01 ADC #$0100 A:0922 X:0000 Y:0000 P:envmxdIzc ;Add #$0100 to current 'A' value
- $03/A894 85 05 STA $05 [$00:0CCD] A:0A22 X:0000 Y:0000 P:envmxdIzc ;Store to PC NPC RAM at $7E:0CCD (PC NPC X coordinate)
- $03/A896 AD 60 1E LDA $1E60 [$06:1E60] A:0A22 X:0000 Y:0000 P:envmxdIzc ;Load Y coordinate of screen
- $03/A899 18 CLC A:0100 X:0000 Y:0000 P:envmxdIzc ;Clear carry flag
- $03/A89A 69 E0 00 ADC #$00E0 A:0100 X:0000 Y:0000 P:envmxdIzc ;Add #$00E0 to current 'A' value
- $03/A89D 85 08 STA $08 [$00:0CD0] A:01E0 X:0000 Y:0000 P:envmxdIzc ;Store to PC NPC RAM at $7E:0CD0 (PC NPC Y coordinate)
- $03/A89F A9 00 07 LDA #$0700 A:01E0 X:0000 Y:0000 P:envmxdIzc ;Load velocity of Zero's jump [Change to #$0710 for better landing]
- $03/A8A2 85 1C STA $1C [$00:0CE4] A:0700 X:0000 Y:0000 P:envmxdIzc ;Store to PC NPC RAM at $7E:0CE4 (PC NPC Velocity)
- $03/A8A4 A9 00 FF LDA #$FF00 A:0700 X:0000 Y:0000 P:envmxdIzc ;Load distance of Zero's jump (Maybe speed?) [Change to #$FE80 for better landing]
- $03/A8A7 85 1A STA $1A [$00:0CE2] A:FF00 X:0000 Y:0000 P:eNvmxdIzc ;Store to PC NPC RAM at $7E:0CE2 (PC NPC jump speed/distance)
- $03/A8A9 A9 40 00 LDA #$0040 A:FF00 X:0000 Y:0000 P:eNvmxdIzc ;Load height of Zero's jump
- $03/A8AC 85 1E STA $1E [$00:0CE6] A:0040 X:0000 Y:0000 P:envmxdIzc ;Store to PC NPC RAM at $7E:0CE6 (PC NPC jump height)
- $03/A8AE E2 30 SEP #$30 A:0040 X:0000 Y:0000 P:envmxdIzc ;Set to 8-bit reading on A/X/Y
- $03/A8B0 6B RTL A:0040 X:0000 Y:0000 P:envMXdIzc ;Return long
- -----------------------------
- Sub-event #02 ;Zero flying up to land on Spycopter
- -----------------------------
- $03/A8B1 22 F8 D6 02 JSL $02D6F8[$02:D6F8] A:0102 X:0002 Y:0000 P:envMXdIzc ;Routine to check for NPC's landing on objects or structures
- $03/A8B5 24 1D BIT $1D [$00:0CE5] A:D901 X:0002 Y:0000 P:envMXdIzc ;Bit test with high byte of PC NPC's jump velocity
- $03/A8B7 10 19 BPL $19 [$A8D2] A:D901 X:0002 Y:0000 P:envMXdIZc ;If not correct, BPL to $03/A8D2
- $03/A8B9 C2 20 REP #$20 A:8101 X:0002 Y:0000 P:eNVMXdIzc ;Set to 16-bit reading on A/X/Y
- $03/A8BB A5 08 LDA $08 [$00:0CD0] A:8101 X:0002 Y:0000 P:eNVmXdIzc ;Load Y coordinate of PC NPC from $7E:0CD0
- $03/A8BD C9 78 01 CMP #$0178 A:0181 X:0002 Y:0000 P:enVmXdIzc ;Check for value of #$0178
- $03/A8C0 E2 20 SEP #$20 A:0181 X:0002 Y:0000 P:enVmXdIzC ;Set to 8-bit reading on A/X/Y
- $03/A8C2 30 0E BMI $0E [$A8D2] A:0181 X:0002 Y:0000 P:enVMXdIzC ;If <= #$0178, BMI to $03/A8D2 to ignore event increase and loop event
- $03/A8C4 E6 02 INC $02 [$00:0CCA] A:0181 X:0002 Y:0000 P:enVMXdIzC ;Increase Zero Introduction Spycopter Event to 04
- $03/A8C6 E6 02 INC $02 [$00:0CCA] A:0181 X:0002 Y:0000 P:enVMXdIzC ;Increase Zero Introduction Spycopter Event to 04
- $03/A8C8 A9 6F LDA #$6F A:0181 X:0002 Y:0000 P:enVMXdIzC ;Load animation for Zero landing on Spycopter
- $03/A8CA 22 67 B9 04 JSL $04B967[$04:B967] A:016F X:0002 Y:0000 P:enVMXdIzC ;Load animation routine (Generally used for single frame loading)
- $03/A8CE 22 A2 BC 04 JSL $04BCA2[$04:BCA2] A:D080 X:00DE Y:0002 P:enVMXdIzC ;Load VRAM data storage (Force an update: Gets graphics & stores to VRAM)
- $03/A8D2 5C 36 D6 02 JMP $02D636[$02:D636] A:6410 X:0001 Y:0008 P:enVMXdIzC ;Sets various data for sprite objects & screen then loop events
- It seems that 22 67 B9 04 etc.. needs to be loaded as a prerequisite when first loading the NPC graphics
- Otherwise after that it's redundant. (NEED FURTHER TESTING)
- 22 67 B9 04 \ ;Can be replaced with 4C 04 BB then 4C 11 BB anytime after the first animation(?). This does the same thing but checks if it NEEDS to update.
- 22 A2 BC 04 | ;What's happening right now is it FORCES an update and is generally used for single frames from an animation.
- 5C 36 D6 02 / ;The 4C 11 BB/4C 04 BB will animate and object from any point in the given frame #.
- -----------------------------
- Sub-event #04 ;Zero landing on Spycopter
- -----------------------------
- $03/A8D6 C2 30 REP #$30 A:0102 X:0004 Y:0000 P:envMXdIzc ;Set to 16-bit reading on A/X/Y
- $03/A8D8 AE 57 1F LDX $1F57 [$06:1F57] A:0102 X:0004 Y:0000 P:envmxdIzc ;Load base RAM for large Spycopter that X/Zero are on
- $03/A8DB BD 05 00 LDA $0005,x[$06:0D1D] A:0102 X:0D18 Y:0000 P:envmxdIzc ;Load X coordinates of Spycopter
- $03/A8DE 18 CLC A:09DE X:0D18 Y:0000 P:envmxdIzc ;Clear carry flag
- $03/A8DF 69 18 00 ADC #$0018 A:09DE X:0D18 Y:0000 P:envmxdIzc ;ADC #$0018 to current 'A' value
- $03/A8E2 85 05 STA $05 [$00:0CCD] A:09F6 X:0D18 Y:0000 P:envmxdIzc ;Store to PC NPC RAM at $7E:0CCD (PC NPC X coordinate)
- $03/A8E4 BD 08 00 LDA $0008,x[$06:0D20] A:09F6 X:0D18 Y:0000 P:envmxdIzc ;Load Y coordinates of Spycopter
- $03/A8E7 85 08 STA $08 [$00:0CD0] A:0180 X:0D18 Y:0000 P:envmxdIzc ;Store to PC NPC RAM at $7E:0CD0 (PC NPC Y coordinate)
- $03/A8E9 AD 5D 1E LDA $1E5D [$06:1E5D] A:0180 X:0D18 Y:0000 P:envmxdIzc ;Load X coordinates of screen
- $03/A8EC C9 D0 09 CMP #$09D0 A:095E X:0D18 Y:0000 P:envmxdIzc ;Check for #$09D0
- $03/A8EF 10 05 BPL $05 [$A8F6] A:095E X:0D18 Y:0000 P:eNvmxdIzc ;If >= #$09D0, BPL to $03/A8F6
- $03/A8F1 E2 30 SEP #$30 A:095E X:0D18 Y:0000 P:eNvmxdIzc ;Set to 8-bit reading on A/X/Y
- $03/A8F3 4C 11 BB JMP $BB11 [$03:BB11] A:095E X:0018 Y:0000 P:eNvMXdIzc ;Load routine for NPC consistent animation data update/storing VRAM if needed. [MAKE UNIVERSAL]
- $03/A8F6 A9 00 06 LDA #$0600 A:09D0 X:0D18 Y:0000 P:envmxdIZC ;Load distance of Zero's jump (Maybe speed?)
- $03/A8F9 85 1A STA $1A [$00:0CE2] A:0600 X:0D18 Y:0000 P:envmxdIzC ;Store to PC NPC RAM at $7E:0CE2 (PC NPC jump speed/distance)
- $03/A8FB A9 80 03 LDA #$0380 A:0600 X:0D18 Y:0000 P:envmxdIzC ;Load velocity of Zero's jump
- $03/A8FE 85 1C STA $1C [$00:0CE4] A:0380 X:0D18 Y:0000 P:envmxdIzC ;Store to PC NPC RAM at $7E:0CE4 (PC NPC Velocity)
- $03/A900 E2 30 SEP #$30 A:0380 X:0D18 Y:0000 P:envmxdIzC ;Set to 8-bit reading on A/X/Y
- $03/A902 E6 02 INC $02 [$00:0CCA] A:0380 X:0018 Y:0000 P:envMXdIzC ;Increase Introduction Spycopter Event to 06
- $03/A904 E6 02 INC $02 [$00:0CCA] A:0380 X:0018 Y:0000 P:envMXdIzC ;Increase Introduction Spycopter Event to 06
- $03/A906 A9 72 LDA #$72 A:0380 X:0018 Y:0000 P:envMXdIzC ;Load Zero kicking off wall animation
- $03/A908 4C 04 BB JMP $BB04 [$03:BB04] A:0372 X:0018 Y:0000 P:envMXdIzC ;Load routine for NPC consistent single frame VRAM storage/update next frame VRAM if needed. [MAKE UNIVERSAL]
- $03:BB04 ;Routine to check if animation data needs to be updated or not.
- ;Loads Animation Data routine (04:B967) [JSL]
- ;Loads ??? (03:BB1E) [JSR] ;Loads current frame of PC NPC and checks whether it needs a VRAM update per frame for animation
- --> ;If frame VRAM data does not need to be updated, it skips the update and stores the value back to the current frame's location
- --> ;Seems to be used for animations where the PC NPC transitions from ground to air or vice versa
- ;Sets various data for sprite objects & screen (02:D636) [JMP]
- $03:BB11 ;Routine to check if VRAM needs to update or not.
- ;Load VRAM data storage (Force an update: Gets graphics & stores to VRAM) (04:B94A) [JSL]
- ;Loads ??? (03:BB1E) [JSR] ;Loads current frame of PC NPC and checks whether it needs a VRAM update per frame for animation
- --> ;If frame VRAM data does not need to be updated, it skips the update and stores the value back to the current frame's location
- --> ;Seems to be used for animations where the PC NPC transitions from ground to air or vice versa
- ;Sets various data for sprite objects & screen (02:D636) [JMP]
- -----------------------------
- Sub-event #06 ;Check for ??? then load Zero's Z-Saber sprite assembly data and animation
- -----------------------------
- $03/A90B 22 F8 D6 02 JSL $02D6F8[$02:D6F8] A:0102 X:0006 Y:0000 P:EnvMXdIzc ;Routine to check for NPC's landing on objects or structures
- $03/A90F A5 0F LDA $0F [$00:0CD7] A:7D01 X:0006 Y:0000 P:EnvMXdIzc ;Load flag to check if NPC needs to update their VRAM data
- $03/A911 30 03 BMI $03 [$A916] A:7D00 X:0006 Y:0000 P:EnvMXdIzc ;Check if >= 80(?), if so, BMI to $03/A916
- $03/A913 4C 11 BB JMP $BB11 [$03:BB11] A:7D00 X:0006 Y:0000 P:EnvMXdIzc ;Load routine for NPC consistent animation data update/storing VRAM if needed. [MAKE UNIVERSAL]
- $03/A916 E6 02 INC $02 [$00:0CCA] A:7381 X:0006 Y:0000 P:eNvMXdIzc ;Increase Introduction Spycopter Event to 08
- $03/A918 E6 02 INC $02 [$00:0CCA] A:7381 X:0006 Y:0000 P:envMXdIzc ;Increase Introduction Spycopter Event to 08
- $03/A91A 64 1A STZ $1A [$00:0CE2] A:7381 X:0006 Y:0000 P:envMXdIzc ;Store 00 to PC NPC RAM at $7E:0CE2 (PC NPC jump speed/distance)
- $03/A91C 64 1B STZ $1B [$00:0CE3] A:7381 X:0006 Y:0000 P:envMXdIzc ;Store 00 to PC NPC RAM at $7E:0CE4 (PC NPC Velocity)
- $03/A91E 20 49 BB JSR $BB49 [$03:BB49] A:7381 X:0006 Y:0000 P:EnvMXdIzc ;Load Zero's Z-Saber Sprite data setup [MUST BE MADE INTO A UNIVERSAL ROUTINE]
- $03/A921 A9 0E LDA #$0E A:73B4 X:0006 Y:0000 P:eNvMXdIzc ;Load Zero using Z-Saber animation
- $03/A923 4C 04 BB JMP $BB04 [$03:BB04] A:730E X:0006 Y:0000 P:envMXdIzc ;Load routine for NPC consistent single frame VRAM storage/update next frame VRAM if needed. [MAKE UNIVERSAL]
- 03:BAF6 - Fall velocity for NPC (Used in various locations for NPCs falling)
- -----------------------------
- Sub-event #08 ;Draw Z-Saber object
- -----------------------------
- $03/A926 22 F8 D6 02 JSL $02D6F8[$02:D6F8] A:0102 X:0008 Y:0000 P:envMXdIzc ;Routine to check for NPC's landing on objects or structures
- $03/A92A 20 F6 BA JSR $BAF6 [$03:BAF6] A:7101 X:0008 Y:0000 P:envMXdIzc ;Set fall velocity for NPC
- $03/A92D 24 0F BIT $0F [$00:0CD7] A:FA80 X:0008 Y:0000 P:eNvMXdIzC ;Load flag to check if NPC needs to update their VRAM data
- $03/A92F 30 33 BMI $33 [$A964] A:FA80 X:0008 Y:0000 P:envMXdIZC If >(?) 80, BMI to $03/A964
- $03/A931 50 2C BVC $2C [$A95F] A:FA80 X:0008 Y:0000 P:envMXdIZC ;If <= 80(?), BMI to $03/A95F
- --- This whole section should be in it's own universal routine so the Z-Saber can be drawn on the fly --- [May need to check on this just to be sure]
- --- Same should be done for Sigma Wall event. Seems pointless to have separate code for each event to draw the same specifics --- [May need to check on this just to be sure]
- ---------------------------------------------------------------------------------------------------------------------------------
- $03/A933 22 C4 D8 02 JSL $02D8C4[$02:D8C4] A:FA80 X:0008 Y:0000 P:enVMXdIZC ;Check various missile objects to test if Z-Saber can be drawn
- $03/A937 D0 26 BNE $26 [$A95F] A:0000 X:10D8 Y:0000 P:enVMxdIZC ;If > 00, jump to $03/A95F to update animation
- $03/A939 FE 00 00 INC $0000,x[$06:10D8] A:0000 X:10D8 Y:0000 P:enVMxdIZC ;Increase missile object RAM at $7E:0000,x to state that it's ACTIVE
- $03/A93C A9 02 LDA #$02 A:0000 X:10D8 Y:0000 P:enVMxdIzC ;Set Z-Saber event to 02 so it's active
- $03/A93E 9D 0A 00 STA $000A,x[$06:10E2] A:0002 X:10D8 Y:0000 P:enVMxdIzC ;Store to missile object RAM at $7E:000A,x so it loads the proper event start
- $03/A941 A9 82 LDA #$82 A:0002 X:10D8 Y:0000 P:enVMxdIzC ;Load Z-Saber type to use (+80 = NPC usage) [80 = X's Z-Saber, 82 = Zero's Z-Saber)
- $03/A943 9D 0B 00 STA $000B,x[$06:10E3] A:0082 X:10D8 Y:0000 P:eNVMxdIzC ;Store to missile object RAM at $7E:000B,x so it loads the proper graphical setup
- $03/A946 A9 28 LDA #$28 A:0082 X:10D8 Y:0000 P:eNVMxdIzC ;Load Z-Saber palette RAM location
- $03/A948 9D 18 00 STA $0018,x[$06:10F0] A:0028 X:10D8 Y:0000 P:enVMxdIzC ;Store to $7E:0018,x so it sets the proper palette data for object
- $03/A94B A5 11 LDA $11 [$00:0CD9] A:0028 X:10D8 Y:0000 P:enVMxdIzC ;Load palette of NPC
- $03/A94D 29 70 AND #$70 A:003C X:10D8 Y:0000 P:enVMxdIzC ;AND #$70
- $03/A94F 09 0E ORA #$0E A:0030 X:10D8 Y:0000 P:enVMxdIzC ;ORA with #$0E
- $03/A951 9D 11 00 STA $0011,x[$06:10E9] A:003E X:10D8 Y:0000 P:enVMxdIzC ;Store new palette setup to missile object RAM at $7E:0011,x so it loads above proper BG layers
- $03/A954 A9 07 LDA #$07 A:003E X:10D8 Y:0000 P:enVMxdIzC ;Load animation of Z-Saber
- $03/A956 9D 3C 00 STA $003C,x[$06:1114] A:0007 X:10D8 Y:0000 P:enVMxdIzC ;Store to missile object RAM at $7E:003C,x so it loads proper animation
- $03/A959 8D 44 1F STA $1F44 [$06:1F44] A:0007 X:10D8 Y:0000 P:enVMxdIzC ;Store to $7E:1F44 so it gets proper animation
- $03/A95C 9E 12 00 STZ $0012,x[$06:10EA] A:0007 X:10D8 Y:0000 P:enVMxdIzC ;STZ to missile object RAM at $7E:0012,x so it loads above other sprites
- $03/A95F E2 30 SEP #$30 A:FA80 X:0008 Y:0000 P:EnvMXdIzc ;Set to 8-bit reading on A/X/Y
- $03/A961 4C 11 BB JMP $BB11 [$03:BB11] A:FA80 X:0008 Y:0000 P:EnvMXdIzc ;Load routine for NPC consistent animation data update/storing VRAM if needed. [MAKE UNIVERSAL]
- $03/A964 E6 02 INC $02 [$00:0CCA] A:FA80 X:0008 Y:0000 P:eNvMXdIzC ;Increase Introduction Spycopter Event to 0A
- $03/A966 E6 02 INC $02 [$00:0CCA] A:FA80 X:0008 Y:0000 P:envMXdIzC ;Increase Introduction Spycopter Event to 0A
- $03/A968 20 37 BB JSR $BB37 [$03:BB37] A:FA80 X:0008 Y:0000 P:EnvMXdIzc ;Load Zero's normal sprite setup [MUST BE MADE INTO A UNIVERSAL ROUTINE]
- $03/A96B A9 55 LDA #$55 A:FAB4 X:0008 Y:0000 P:eNvMXdIzC ;Load Zero falling animation [Change to A9 57 for better animation transition]
- $03/A96D 4C 04 BB JMP $BB04 [$03:BB04] A:FA55 X:0008 Y:0000 P:envMXdIzC ;Load routine for NPC consistent single frame VRAM storage/update next frame VRAM if needed. [MAKE UNIVERSAL]
- -----------------------------
- Sub-event #0A ;Spycopter breaking with NPC Zero falling/landing
- -----------------------------
- -- This is for Zero falling from Spycopter --
- $03/A970 20 F6 BA JSR $BAF6 [$03:BAF6] A:0102 X:000A Y:0000 P:envMXdIzc ;Set fall velocity for NPC
- $03/A973 22 F8 D6 02 JSL $02D6F8[$02:D6F8] A:FA80 X:000A Y:0000 P:envMXdIZC ;Routine to check for NPC's landing on objects or structures
- $03/A977 22 F7 C0 04 JSL $04C0F7[$04:C0F7] A:F901 X:000A Y:0000 P:envMXdIZC ;Detects PC landing on ground sets their air or ground byte
- $03/A97B A5 2B LDA $2B [$00:0CF3] A:0000 X:00C8 Y:00F9 P:envMXdIZC ;Load byte to determine if NPC is on ground or in air
- $03/A97D 89 04 BIT #$04 A:0000 X:00C8 Y:00F9 P:envMXdIZC ;BIT #$04 (On ground)
- $03/A97F D0 03 BNE $03 [$A984] A:0000 X:00C8 Y:00F9 P:envMXdIZC ;If == #$04, BNE to $03/A984
- $03/A981 4C 11 BB JMP $BB11 [$03:BB11] A:0000 X:00C8 Y:00F9 P:envMXdIZC ;Load routine for NPC consistent animation data update/storing VRAM if needed. [MAKE UNIVERSAL]
- -- This is for when Zero lands on the ground --
- $03/A984 E6 02 INC $02 [$00:0CCA] A:0404 X:00C8 Y:00A6 P:envMXdIzC ;Increase Introduction Spycopter Event to 0C
- $03/A986 E6 02 INC $02 [$00:0CCA] A:0404 X:00C8 Y:00A6 P:envMXdIzC ;Increase Introduction Spycopter Event to 0C
- $03/A988 A9 3C LDA #$3C A:0404 X:00C8 Y:00A6 P:envMXdIzC ;Load delay timer before dialogue box can load up
- $03/A98A 85 3C STA $3C [$00:0D04] A:043C X:00C8 Y:00A6 P:envMXdIzC ;Store to NPC RAM at $7E:0D04
- $03/A98C A9 50 LDA #$50 A:043C X:00C8 Y:00A6 P:envMXdIzC ;Load animation for Zero landing on ground
- $03/A98E 4C 04 BB JMP $BB04 [$03:BB04] A:0450 X:00C8 Y:00A6 P:EnvMXdIzc ;Load routine for NPC consistent single frame VRAM storage/update next frame VRAM if needed. [MAKE UNIVERSAL]
- -----------------------------
- Sub-event #0C ;Initiate data to draw dialogue box
- -----------------------------
- $03/A991 C6 3C DEC $3C [$00:0D04] A:0402 X:000C Y:0000 P:envMXdIzc ;Decrease delay timer from $7E:0D04
- $03/A993 F0 08 BEQ $08 [$A99D] A:0402 X:000C Y:0000 P:envMXdIzc ;Check if == 00, if so, BEQ to $03/A99D
- $03/A995 22 4A B9 04 JSL $04B94A[$04:B94A] A:0402 X:000C Y:0000 P:envMXdIzc ;Load alternate force VRAM update? (Can be changed to 04:BCA2 and it works just fine still?)
- $03/A999 5C 36 D6 02 JMP $02D636[$02:D636] A:0402 X:000C Y:0000 P:envMXdIzc ;Routine to check for NPC's landing on objects or structures
- $03/A99D E6 02 INC $02 [$00:0CCA] A:0402 X:000C Y:0000 P:envMXdIZc ;Increase Introduction Spycopter Event to 0E
- $03/A99F E6 02 INC $02 [$00:0CCA] A:0402 X:000C Y:0000 P:envMXdIzc ;Increase Introduction Spycopter Event to 0E
- $03/A9A1 A9 3C LDA #$3C A:0402 X:000C Y:0000 P:envMXdIzc ;Load delay timer before Zero teleports out after dialogue
- $03/A9A3 85 3C STA $3C [$00:0D04] A:043C X:000C Y:0000 P:envMXdIzc ;Store to NPC RAM at $7E:0D04
- $03/A9A5 A9 30 LDA #$30 A:043C X:000C Y:0000 P:envMXdIzc ;Load which dialogue to use
- $03/A9A7 22 B1 FC 02 JSL $02FCB1[$02:FCB1] A:0430 X:000C Y:0000 P:envMXdIzc ;Load routine to draw dialogue box and dialogue itself
- $03/A9AB A9 50 LDA #$50 A:0001 X:0018 Y:0000 P:envMXdIZc ;Load frame to use after Zero NPC is done talking
- $03/A9AD 85 43 STA $43 [$00:0D0B] A:0050 X:0018 Y:0000 P:envMXdIzc ;Store to NPC RAM at $7E:0D0B
- $03/A9AF A9 87 LDA #$87 A:0050 X:0018 Y:0000 P:envMXdIzc ;Load frame for Zero Talking
- $03/A9B1 4C 04 BB JMP $BB04 [$03:BB04] A:0087 X:0018 Y:0000 P:EnvMXdIzc ;Load routine for NPC consistent single frame VRAM storage/update next frame VRAM if needed. [MAKE UNIVERSAL]
- -----------------------------
- Sub-event #0E ;Initate dialogue and animation updating
- [Different location than the other pieces]
- -----------------------------
- $03/BAD1 AD 3F 1F LDA $1F3F [$06:1F3F] A:0402 X:000E Y:0000 P:envMXdIzc ;Check for 'Event lock'
- $03/BAD4 10 18 BPL $18 [$BAEE] A:0480 X:000E Y:0000 P:eNvMXdIzc ;If value <= 7F, BPL to $03/BAEE
- $03/BAD6 AD 51 1F LDA $1F51 [$06:1F51] A:0480 X:000E Y:0000 P:eNvMXdIzc ;Load NPC talk animation bit
- $03/BAD9 D0 07 BNE $07 [$BAE2] A:0400 X:000E Y:0000 P:envMXdIZc ;If > 00, BNE to $03/BAE2
- $03/BADB AD 50 1F LDA $1F50 [$06:1F50] A:0400 X:000E Y:0000 P:envMXdIZc ;Check for NPC allowed to talk animation bit
- $03/BADE C9 01 CMP #$01 A:0400 X:000E Y:0000 P:envMXdIZc ;Check if #$01
- $03/BAE0 F0 04 BEQ $04 [$BAE6] A:0400 X:000E Y:0000 P:eNvMXdIzc ;If so, BEQ to $03/BAE6
- $03/BAE2 A5 0F LDA $0F [$00:0CD7] A:0400 X:000E Y:0000 P:eNvMXdIzc ;Load flag to check if NPC needs to update their VRAM data
- $03/BAE4 F0 04 BEQ $04 [$BAEA] A:0400 X:000E Y:0000 P:envMXdIZc ;If == 00, BEQ to $03/BAEA to update
- $03/BAE6 22 4A B9 04 JSL $04B94A[$04:B94A] A:0400 X:000E Y:0000 P:envMXdIZc ;Load alternate force VRAM update? (Can be changed to 04:BCA2 and it works just fine still?)
- $03/BAEA 5C 36 D6 02 JMP $02D636[$02:D636] A:0400 X:000E Y:0000 P:envMXdIZc ;Sets various data for sprite objects & screen then loop events
- $03/BAEE E6 02 INC $02 [$00:0CCA] A:0480 X:000E Y:0000 P:eNvMXdIzc ;Increase Introduction Spycopter Event to 10
- $03/BAF0 E6 02 INC $02 [$00:0CCA] A:0480 X:000E Y:0000 P:envMXdIzc ;Increase Introduction Spycopter Event to 10
- $03/BAF2 A5 43 LDA $43 [$00:0D0B] A:0480 X:000E Y:0000 P:envMXdIzc ;Load frame to load after talking
- $03/BAF4 80 0E BRA $0E [$BB04] A:0450 X:000E Y:0000 P:envMXdIzc ;BRA to $03/BB04 to force update animations
- $03/BB04 E2 30 SEP #$30 A:0450 X:000E Y:0000 P:envMXdIzc
- $03/BB06 22 67 B9 04 JSL $04B967[$04:B967] A:0450 X:000E Y:0000 P:envMXdIzc ;Load animation routine (Generally used for single frame loading)
- $03/BB0A 20 1E BB JSR $BB1E [$03:BB1E] A:CE80 X:00DE Y:0002 P:envMXdIzc ;Loads current frame of PC NPC and checks whether it needs a VRAM update per frame for animation
- $03/BB0D 5C 36 D6 02 JMP $02D636[$02:D636] A:CEA8 X:00DE Y:0002 P:eNvMXdIzC ;Sets various data for sprite objects & screen then loop events
- -----------------------------
- Sub-event #10 ;Zero end dialogue
- -----------------------------
- $03/A9B4 C6 3C DEC $3C [$00:0D04] A:0402 X:0010 Y:0000 P:envMXdIzc ;Decrease delay timer from $7E:0D04
- $03/A9B6 F0 08 BEQ $08 [$A9C0] A:0402 X:0010 Y:0000 P:envMXdIzc ;If == 00, BEQ to $03/A9C0
- $03/A9B8 22 4A B9 04 JSL $04B94A[$04:B94A] A:0402 X:0010 Y:0000 P:envMXdIzc ;Load alternate force VRAM update? (Can be changed to 04:BCA2 and it works just fine still?)
- $03/A9BC 5C 36 D6 02 JMP $02D636[$02:D636] A:0402 X:0010 Y:0000 P:envMXdIzc ;Sets various data for sprite objects & screen then loop events
- $03/A9C0 E6 02 INC $02 [$00:0CCA] A:0402 X:0010 Y:0000 P:envMXdIZc ;Increase Introduction Spycopter Event to 12
- $03/A9C2 E6 02 INC $02 [$00:0CCA] A:0402 X:0010 Y:0000 P:envMXdIzc ;Increase Introduction Spycopter Event to 12
- $03/A9C4 A9 11 LDA #$11 A:0402 X:0010 Y:0000 P:envMXdIzc ;Load teleport out SFX
- $03/A9C6 22 2B 80 01 JSL $01802B[$01:802B] A:0411 X:0010 Y:0000 P:envMXdIzc ;Load routine for SFX
- $03/A9CA A9 7F LDA #$7F A:0412 X:0010 Y:0000 P:envMXdIzc ;Load Zero begin teleporting out animation
- $03/A9CC 4C 04 BB JMP $BB04 [$03:BB04] A:047F X:0010 Y:0000 P:envMXdIzc ;Load routine for NPC consistent single frame VRAM storage/update next frame VRAM if needed. [MAKE UNIVERSAL]
- -----------------------------
- Sub-event #12 ;Begin Zero teleport
- -----------------------------
- $03/A9CF A5 0F LDA $0F [$00:0CD7] A:0402 X:0012 Y:0000 P:envMXdIzc ;Load flag to check if NPC needs to update their VRAM data
- $03/A9D1 30 03 BMI $03 [$A9D6] A:0400 X:0012 Y:0000 P:envMXdIZc If so, BMI to $03/A9D1
- $03/A9D3 4C 11 BB JMP $BB11 [$03:BB11] A:0400 X:0012 Y:0000 P:envMXdIZc ;Load routine for NPC consistent animation data update/storing VRAM if needed. [MAKE UNIVERSAL]
- $03/A9D6 E6 02 INC $02 [$00:0CCA] A:0480 X:0012 Y:0000 P:eNvMXdIzc ;Increase Introduction Spycopter Event to 14
- $03/A9D8 E6 02 INC $02 [$00:0CCA] A:0480 X:0012 Y:0000 P:envMXdIzc ;Increase Introduction Spycopter Event to 14
- $03/A9DA C2 20 REP #$20 A:0480 X:0012 Y:0000 P:envMXdIzc ;Set to 16-bit reading on A/X/Y
- $03/A9DC A9 A6 0A LDA #$0AA6 A:0480 X:0012 Y:0000 P:envmXdIzc ;Load velocity of Zero
- $03/A9DF 85 1C STA $1C [$00:0CE4] A:0AA6 X:0012 Y:0000 P:envmXdIzc ;Store to PC NPC RAM at $7E:0CE4 (PC NPC Velocity)
- $03/A9E1 E2 20 SEP #$20 A:0AA6 X:0012 Y:0000 P:envmXdIzc ;Set to 8-bit reading on A/X/Y
- $03/A9E3 A9 10 LDA #$10 A:0AA6 X:0012 Y:0000 P:envMXdIzc ;Load teleport out SFX #2
- $03/A9E5 22 2B 80 01 JSL $01802B[$01:802B] A:0A10 X:0012 Y:0000 P:envMXdIzc ;Load routine for SFX
- $03/A9E9 A9 7D LDA #$7D A:0A14 X:0012 Y:0000 P:EnvMXdIzc ;Load Zero teleport out animation
- $03/A9EB 4C 04 BB JMP $BB04 [$03:BB04] A:0A7D X:0012 Y:0000 P:EnvMXdIzc ;Load routine for NPC consistent single frame VRAM storage/update next frame VRAM if needed. [MAKE UNIVERSAL]
- -----------------------------
- Sub-event #14 ;Zero teleporting out
- -----------------------------
- $03/A9EE 22 12 D8 02 JSL $02D812[$02:D812] A:0402 X:0014 Y:0000 P:envMXdIzc ;Load routine to move NPC off screen with Velocity only?
- $03/A9F2 A5 0E LDA $0E [$00:0CD6] A:A604 X:0014 Y:0000 P:envMXdIzc ;Load whether NPC is still active from NPC RAM $7E:0CD6
- $03/A9F4 F0 04 BEQ $04 [$A9FA] A:A681 X:0014 Y:0000 P:eNvMXdIzc ;If == 00 (Not active), BEQ to $03/A9FA
- $03/A9F6 5C 36 D6 02 JMP $02D636[$02:D636] A:A681 X:0014 Y:0000 P:eNvMXdIzc ;Sets various data for sprite objects & screen then loop events
- $03/A9FA E6 02 INC $02 [$00:0002] A:0000 X:0000 Y:0000 P:EnvMXdIzc ;Increase Introduction Spycopter Event to 16
- $03/A9FC E6 02 INC $02 [$00:0002] A:0000 X:0000 Y:0000 P:EnvMXdIzc ;Increase Introduction Spycopter Event to 16
- $03/A9FE 6B RTL A:0000 X:0000 Y:0000 P:EnvMXdIzc ;Return long
- -----------------------------
- Sub-event #16 ;End Introduction event
- -----------------------------
- $03/A9FF 64 00 STZ $00 [$00:0CC8] A:0402 X:0016 Y:0000 P:envMXdIzc ;Store 00 to NPC RAM at $7E:0CC8 so NPC is removed from screen
- $03/AA01 6B RTL A:0402 X:0016 Y:0000 P:envMXdIzc ;Return long
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement