Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- !RAM_HP = $1528
- !RAM_Timer = $1534
- !RAM_Proj = $1540
- !RAM_State = $C2
- !RAM_Status = $14C8
- !Phase_Blks = $01
- !HP = $02
- !Proj_1 = $50
- !Proj_2 = $51
- !Proj_3 = $18
- print "INIT ",pc
- LDA #!HP
- STA !RAM_HP,x
- STZ !RAM_State,x
- STZ $1594,x
- RTL
- print "MAIN ",pc
- PHB
- PHK
- PLB
- JSR CodeMain
- PLB
- RTL
- Phases:
- dw Wait
- dw Hover
- dw TwoFireballs
- dw FourBills
- dw FireRain
- dw GotHit
- dw FinalRage
- dw Die
- GFXPhases:
- dw WaitGFX
- dw HoverGFX
- dw FireGFX
- dw BillGFX
- dw FireGFX
- dw HurtGFX
- dw RageGFX
- dw DieGFX
- Die:
- LDX $15E9
- RTS
- CodeMain:
- JSR Graphics
- LDA $9D
- BNE .Return_0
- LDA !RAM_State,x
- STA $0EF9
- LDA !RAM_HP,x
- STA $0F2F
- JSL $019138
- JSR SPRITE_INTERACT
- LDA !RAM_State,x
- CMP #$07
- BNE .Normal
- LDA $1594,x
- BNE +
- DEC $13C6 ; prevent Mario from walking at the level end
- LDA #$FF ; \ set goal
- STA $1493 ; /
- LDA #$0B ; \ set ending music
- STA $1DFB ; /
- STA $1594,x
- + RTS ; return
- .Normal
- LDA !RAM_State,x
- .Gotophase
- ASL A
- PHX
- TAX
- JSR (Phases,x)
- PLX
- .Return_0
- RTS
- Wait: ;Wait till mario approaches the boss
- !MaxLeft = $0080
- !MaxRight = $0080
- LDX $15E9
- LDA $14E0,x
- XBA
- LDA $E4,x
- REP #$20
- SBC $94
- ADC.w #!MaxLeft
- CMP.w #!MaxLeft+!MaxRight
- SEP #$20
- BCS NotCloseEnough
- LDA $77
- AND #$04
- BEQ NotCloseEnough
- LDA #$FF ;hurf durf spin around
- STA !RAM_Timer,x
- INC !RAM_State,x
- ;LDA #$05
- ;STA $1DFB
- NotCloseEnough:
- RTS
- XSpd: db $2C,$2C^$FF-$01
- XAcc: db $02,$01^$FF
- YSpd: db $18,$E8
- YAcc: db $01,$FF
- Hover:
- LDX $15E9
- JSL $03B664
- JSR GetSpriteClipping
- JSL $03B72B
- BCC ++
- LDA $7D
- BMI +
- LDA $140D
- ORA $187A
- BEQ +
- LDA #$02
- STA $1DF9
- JSL $01AA33
- JSL $01AB99
- BRA ++
- + JSL $00F5B7
- RTS
- ++ LDA !RAM_Timer,x
- CMP #$80
- BCS .End
- LDA !RAM_Timer,x
- BEQ .Nomove
- JSR SUB_HORZ_POS
- LDA $B6,x
- CMP XSpd,y
- BEQ .gravity
- CLC
- ADC XAcc,y
- STA $B6,x
- .gravity
- JSL $018022
- LDA $1510,x ;Load... something
- AND #$01 ;AND #$01
- TAY ;Use as index for acceleration table
- LDA $AA,x ;\
- CLC ; |Load Y speed
- ADC YAcc,y ; |Accelerate it
- STA $AA,x ;/
- CMP YSpd,y ;If it didn't reach the desired Y speed
- BNE .Next ;Continue processing the sprite
- INC $1510,x ;If it reached the desired speed, change Y direction
- .Next JSL $01801A ;Update Y pos without gravity
- LDA $1588,x
- AND #$03
- BEQ .Nomove
- LDA $157C,x
- EOR #$01
- STA $157C,x
- RTS
- .Nomove
- .End STZ $B6,x
- JSR NextPhase
- RTS
- TwoFireballs:
- FourBills:
- FireRain:
- JSR NextPhase
- RTS
- GotHit: LDX $15E9
- JSL $03B664
- JSR GetSpriteClipping
- JSL $03B72B
- BCC ++
- LDA $7D
- BMI +
- LDA $140D
- ORA $187A
- BEQ +
- LDA #$02
- STA $1DF9
- JSL $01AA33
- JSL $01AB99
- BRA ++
- + JSL $00F5B7
- RTS
- ++ LDA !RAM_Timer,x
- CMP #$F0
- BNE +
- JSR .Fire
- JSR .Fire
- JSR .Fire
- LDA !RAM_Timer,x
- BNE ++
- RTS
- + LDA !RAM_HP,x
- CMP #$01
- BNE ++
- LDA #$06
- STA !RAM_State,x
- RTS
- ++ JSR NextPhase
- RTS
- .Fire TXY
- STA $00
- LDX #$0B
- .GLoop LDA $14C8,X
- BEQ .Cont
- DEX
- BPL .GLoop
- RTS
- .Cont LDA #$08 ;set to main
- STA $14C8,x ;status
- LDA #!Proj_3 ;sprite to generate
- STA $7FAB9E,x ;custom sprite
- PHY
- JSL $07F7D2 ;clear
- JSL $0187A7
- PLY
- LDA #$88
- STA $7FAB10,x
- LDA $00E4,y
- STA $E4,x
- LDA $14E0,y
- STA $14E0,x
- LDA $00D8,y
- CLC
- ADC #$10
- STA $D8,x
- LDA $14D4,y
- ADC #$00
- STA $14D4,x
- LDA #$17
- STA $1DFC
- PHY
- JSR CALCFULLFRAME ;y is unchanged
- TAY
- LDA XSPEEDS,y
- STA $B6,x
- LDA YSPEEDS,y
- CLC
- ADC #$07
- STA $AA,x
- PLX
- RTS
- FinalRage:
- LDX $15E9
- .clipping
- JSL $03B664
- JSR GetSpriteClipping
- JSL $03B72B
- BCC ++
- LDA $7D
- BMI +
- LDA $140D
- ORA $187A
- BEQ +
- LDA #$02
- STA $1DF9
- JSL $01AA33
- JSL $01AB99
- BRA ++
- + JSL $00F5B7
- RTS
- ++ LDA !RAM_Timer,x
- CMP #$E0
- BEQ .FireRage
- LDA !RAM_Timer,x
- CMP #$80
- BEQ .FireRage
- .GetOut LDX $15E9
- JSR .FireRage
- LDA #$01
- STA !RAM_State,x
- RTS
- .FireRage TXY
- LDX #$0B
- .GLoop LDA $14C8,X
- BEQ .Cont
- DEX
- BPL .GLoop
- RTS
- .Cont LDA #$08 ;set to main
- STA $14C8,x ;status
- LDA #!Proj_3 ;sprite to generate
- STA $7FAB9E,x ;custom sprite
- PHY
- JSL $07F7D2 ;clear
- JSL $0187A7
- PLY
- LDA #$88
- STA $7FAB10,x
- LDA $00E4,y
- STA $E4,x
- LDA $14E0,y
- STA $14E0,x
- LDA $00D8,y
- CLC
- ADC #$10
- STA $D8,x
- LDA $14D4,y
- ADC #$00
- STA $14D4,x
- LDA #$17
- STA $1DFC
- PHY
- JSR CALCFULLFRAME ;y is unchanged
- TAY
- LDA XSPEEDS,y
- STA $B6,x
- LDA YSPEEDS,y
- CLC
- ADC #$07
- STA $AA,x
- PLX
- RTS
- ;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;; GRAPHICS ROUTINES ;;
- ;;;;;;;;;;;;;;;;;;;;;;;;;;
- Graphics:
- JSR GET_DRAW_INFO
- LDA !RAM_State,x
- ASL A
- TAX
- JSR (GFXPhases,x)
- RTS
- PROPERTIES: db $47,$07
- TILEMAP:
- db $80,$82,$A0,$A2 ; FRAME 1 ;\ RIGHT
- db $84,$86,$A4,$A6 ; FRAME 2 ;/ RIGHT
- db $80,$82,$A0,$A2 ; FRAME 1 ;\ LEFT
- db $84,$86,$A4,$A6 ; FRAME 2 ;/ RIGHT
- YDISP: db $F0,$F0,$00,$00 ; FRAME 1 ;\ RIGHT
- db $F0,$F0,$00,$00 ; FRAME 2 ;/ RIGHT
- db $F0,$F0,$00,$00 ; FRAME 1 ;\ RIGHT
- db $F0,$F0,$00,$00 ; FRAME 2 ;/ RIGHT
- XDISP: db $00,$10,$00,$10 ; FRAME 1 ;\ RIGHT
- db $00,$10,$00,$10 ; FRAME 2 ;/ RIGHT
- db $10,$00,$10,$00 ; FRAME 1 ;\ LEFT
- db $10,$00,$10,$00 ; FRAME 2 ;/ LEFT
- WaitGFX:
- HoverGFX:
- FireGFX:
- BillGFX:
- HurtGFX:
- RageGFX:
- DieGFX:
- LDX $15E9
- LDA $14 ;\ Frame counter ..
- LSR A ; |
- LSR A ; | Add in frame animation rate; More LSRs for slower animation.
- AND #$02 ; | 01 means we animate between 2 frames (00 and 01).
- ASL A ; |
- ASL A ; | ASL x2 (0-4) makes it switch between the first byte and fifth byte,
- STA $03 ;/ i.e. first animation and second animation. The result is stored into $03.
- LDA $157C,x
- STA $02 ; Store direction to $02 for use with property routine later.
- BNE NoAdd
- LDA $03 ;\
- CLC ; | If sprite faces left ..
- ADC #$08 ; | Adding 8 more bytes to the table.
- STA $03 ;/ So we can invert XDISP to not mess up the sprite's appearance.
- NoAdd:
- PHX ;\ Push sprite index ..
- LDX #$03 ;/ And load X with number of tiles to loop through.
- Loop:
- PHX ; Push number of tiles to loop through.
- TXA ;\
- ORA $03 ;/ Transfer it to X and add in the "left displacement" if necessary.
- TAX ;\ Get it back into X for an index.
- LDA $00 ;\
- CLC ; | Apply X displacement of the sprite.
- ADC XDISP,x ; |
- STA $0300,y ;/
- LDA $01 ;\
- CLC ; | Y displacement is added for the Y position, so one tile is higher than the other.
- ADC YDISP,x ; | Otherwise, both tiles would have been drawn to the same position!
- STA $0301,y ; | If X is 00, i.e. first tile, then load the first value from the table and apply that
- ;/ as the displacement. For the second tile, F0 is added to make it higher than the first.
- LDA TILEMAP,x
- STA $0302,y
- PHX ; Push number of times to go through loop + "left" displacement if necessary.
- LDX $02 ;\
- LDA PROPERTIES,x ; | Set properties based on direction.
- STA $0303,y ;/
- PLX ; Pull number of times to go through loop.
- INY ;\
- INY ; | The OAM is 8x8, but our sprite is 16x16 ..
- INY ; | So increment it 4 times.
- INY ;/
- PLX ; Pull current tile back.
- DEX ; After drawing this tile, decrease number of tiles to go through loop. If the second tile
- ; is drawn, then loop again to draw the first tile.
- BPL Loop ; Loop until X becomes negative (FF).
- PLX ; Pull back the sprite index! We pushed it at the beginning of the routine.
- LDY #$02 ; Y ends with the tile size .. 02 means it's 16x16
- LDA #$03 ; A -> number of tiles drawn - 1.
- ; I drew 2 tiles, so 2-1 = 1. A = 01.
- JSL $01B7B3 ; Call the routine that draws the sprite.
- RTS ; Never forget this!
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ; GET_DRAW_INFO
- ; This is a helper for the graphics routine. It sets off screen flags, and sets up
- ; variables. It will return with the following:
- ;
- ; Y = index to sprite OAM ($300)
- ; $00 = sprite x position relative to screen boarder
- ; $01 = sprite y position relative to screen boarder
- ;
- ; It is adapted from the subroutine at $03B760
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- SPR_T1: db $0C,$1C
- SPR_T2: db $01,$02
- GET_DRAW_INFO:
- STZ $186C,x ; reset sprite offscreen flag, vertical
- STZ $15A0,x ; reset sprite offscreen flag, horizontal
- LDA $E4,x ; \
- CMP $1A ; | set horizontal offscreen if necessary
- LDA $14E0,x ; |
- SBC $1B ; |
- BEQ ON_SCREEN_X ; |
- INC $15A0,x ; /
- ON_SCREEN_X:
- LDA $14E0,x ; \
- XBA ; |
- LDA $E4,x ; |
- REP #$20 ; |
- SEC ; |
- SBC $1A ; | mark sprite invalid if far enough off screen
- CLC ; |
- ADC.w #$0040 ; |
- CMP.w #$0180 ; |
- SEP #$20 ; |
- ROL A ; |
- AND #$01 ; |
- STA $15C4,x ; /
- BNE INVALID ;
- LDY #$00 ; \ set up loop:
- LDA $1662,x ; |
- AND #$20 ; | if not smushed (1662 & 0x20), go through loop twice
- BEQ ON_SCREEN_LOOP ; | else, go through loop once
- INY ; /
- ON_SCREEN_LOOP:
- LDA $D8,x ; \
- CLC ; | set vertical offscreen if necessary
- ADC SPR_T1,y ; |
- PHP ; |
- CMP $1C ; | (vert screen boundry)
- ROL $00 ; |
- PLP ; |
- LDA $14D4,x ; |
- ADC #$00 ; |
- LSR $00 ; |
- SBC $1D ; |
- BEQ ON_SCREEN_Y ; |
- LDA $186C,x ; | (vert offscreen)
- ORA SPR_T2,y ; |
- STA $186C,x ; |
- ON_SCREEN_Y:
- DEY ; |
- BPL ON_SCREEN_LOOP ; /
- LDY $15EA,x ; get offset to sprite OAM
- LDA $E4,x ; \
- SEC ; |
- SBC $1A ; | $00 = sprite x position relative to screen boarder
- STA $00 ; /
- LDA $D8,x ; \
- SEC ; |
- SBC $1C ; | $01 = sprite y position relative to screen boarder
- STA $01 ; /
- RTS ; return
- INVALID: PLA ; \ return from *main gfx routine* subroutine...
- PLA ; | ...(not just this subroutine)
- RTS ; /
- ;--------------------------;
- ; Sprite Clipping Routine ;
- ; Mostly borrowed from SMW ;
- ;--------------------------;
- GetSpriteClipping:
- LDA $E4,x
- CLC
- ADC #$03
- STA $04
- LDA $14E0,x
- ADC #$00
- STA $0A
- LDA.b #$1F-$03 ; Width of sprite clipping
- STA $06
- LDA $D8,x
- CLC
- ADC #$06
- STA $05
- LDA $14D4,x
- ADC #$00
- STA $0B
- LDA #$19 ; Height of sprite clipping
- STA $07
- RTS
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ; SUB_VERT_POS
- ; This routine determines if Mario is above or below the sprite. It sets the Y register
- ; to the direction such that the sprite would face Mario
- ; It is ripped from $03B829
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- SUB_VERT_POS: LDY #$00
- LDA $96
- SEC
- SBC $D8,x
- STA $0F
- LDA $97
- SBC $14D4,x
- BPL SPR_L11
- INY
- SPR_L11: RTS
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ; SUB_HORZ_POS
- ; This routine determines which side of the sprite Mario is on. It sets the Y register
- ; to the direction such that the sprite would face Mario
- ; It is ripped from $03B817
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- SUB_HORZ_POS: LDY #$00
- LDA $94
- SEC
- SBC $E4,x
- STA $0F
- LDA $95
- SBC $14E0,x
- BPL SPR_L16
- INY
- SPR_L16: RTS
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- !FC_TEMP1 = $00 ; will use 2 bytes
- !FC_TEMP2 = $02 ; will use 2 bytes
- !FC_TEMP3 = $04 ; will use 2 bytes
- !FC_TEMP4 = $06 ; will use 2 bytes
- CALCFULLFRAME: JSR CALCFRAME
- JSR CALCQUADFLIP
- RTS
- CALCQUADFLIP: PHA
- JSR SUB_VERT_POS
- PLA
- CPY #$00
- BNE CHKHORZ
- EOR #$FF
- CLC
- ADC #$1F
- CHKHORZ: PHA
- JSR SUB_HORZ_POS
- PLA
- CPY #$00
- BEQ ENDQUADCHK
- EOR #$FF
- CLC
- ADC #$3E
- ENDQUADCHK: RTS
- CALCFRAME: LDA $D8,x
- SEC
- SBC $96
- STA !FC_TEMP2
- LDA $14D4,x
- SBC $97
- STA !FC_TEMP2+1
- BNE HORZDIST
- LDA !FC_TEMP2
- BNE HORZDIST
- BRA SETHORZ
- HORZDIST: LDA $E4,x
- SEC
- SBC $94
- STA !FC_TEMP1
- LDA $14E0,x
- SBC $95
- STA !FC_TEMP1+1
- BNE BEGINMATH
- LDA !FC_TEMP1
- BNE BEGINMATH
- BRA SETVERT
- BEGINMATH: PHP
- REP #$20
- LDA !FC_TEMP2
- BPL CHKXDIST
- EOR #$FFFF
- INC A
- STA !FC_TEMP2
- CHKXDIST: LDA !FC_TEMP1
- BPL MULT
- EOR #$FFFF
- INC A
- STA !FC_TEMP1
- MULT: ASL A
- ASL A
- ASL A
- ASL A
- STA !FC_TEMP3
- LDA !FC_TEMP1
- CLC
- ADC !FC_TEMP2
- STA !FC_TEMP4
- LDY #$00
- LDA !FC_TEMP4
- DEC A
- DIVLOOP: CMP !FC_TEMP3
- BCS END_DIVIDE
- INY
- CLC
- ADC !FC_TEMP4
- BRA DIVLOOP
- END_DIVIDE: TYA
- PLP
- RTS
- SETHORZ: LDA #$0F
- RTS
- SETVERT: LDA #$00
- RTS
- ;; PROJECTILE SPEEDS FOR EACH ANGLE
- ;; you can make your own speeds with, using http://smwedit.awardspace.com/_TEMP2.php as an aid,
- ;; but that tool won't do all the calculations for you (it'll only calculate the second half of X and Y)
- ;; Default settings:
- ;; Degrees: 180 (don't change)
- ;; Frames: 30 (don't change)
- ;; Radius: 64 (CHANGE THIS, THIS IS THE BASE SPEED)
- ;; Bytes: 1 (don't change)
- ;; #'s/line: 4 (don't change)
- ;; Add end frame: YES
- XSPEEDS: db $00,$07,$0D,$14
- db $1A,$20,$26,$2B
- db $30,$34,$37,$3A
- db $3D,$3F,$40,$40
- db $40,$3F,$3D,$3A
- db $37,$34,$30,$2B
- db $26,$20,$1A,$14
- db $0D,$07,$00
- db $00,$F9,$F3,$EC
- db $E6,$E0,$DA,$D5
- db $D0,$CC,$C9,$C6
- db $C3,$C1,$C0,$C0
- db $C0,$C1,$C3,$C6
- db $C9,$CC,$D0,$D5
- db $DA,$E0,$E6,$EC
- db $F3,$F9,$00
- YSPEEDS: db $C0,$C0,$C1,$C3
- db $C6,$C9,$CC,$D0
- db $D5,$DA,$E0,$E6
- db $EC,$F3,$F9,$00
- db $07,$0D,$14,$1A
- db $20,$26,$2B,$30
- db $34,$37,$3A,$3D
- db $3F,$40,$40
- db $40,$40,$3F,$3D
- db $3A,$37,$34,$30
- db $2B,$26,$20,$1A
- db $14,$0D,$07,$00
- db $F9,$F3,$EC,$E6
- db $E0,$DA,$D5,$D0
- db $CC,$C9,$C6,$C3
- db $C1,$C0,$C0
- ;;;;;;;;;;;;;;;;;;
- ; Interaction ;;
- ;;;;;;;;;;;;;;;;;;
- KILLED_X_SPEED: db $F0,$10
- SPRITE_INTERACT: LDY #$0B ; sprite is being kicked
- INTERACT_LOOP: LDA $14C8,y ; \ if the sprite status is..
- CMP #$09 ; | ...shell-like
- BCS PROCESS_SPRITE ; /
- NEXT_SPRITE: DEY
- BPL INTERACT_LOOP
- RTS
- PROCESS_SPRITE: PHX
- TYX
- JSL $03B6E5 ; get sprite clipping B routine
- PLX
- JSR GetSpriteClipping ; get sprite clipping A routine
- JSL $03B72B ; check for contact routine
- BCC NEXT_SPRITE
- PHX
- TYX
- JSL $01AB72 ; show sprite contact gfx routine
- LDA #$02 ; \ Kill thrown sprite
- STA $14C8,x ; /
- LDA #$D0 ; \ Set killed Y speed
- STA $AA,x ; /
- LDY #$00 ; Set killed X speed
- LDA $B6,x
- BPL SET_SPEED
- INY
- SET_SPEED: LDA KILLED_X_SPEED,y
- STA $B6,x
- NO_KILL: PLX
- HANDLE_HIT: LDA #$28 ; \ Play sound effect
- STA $1DFC ; /
- LDA #$01 ; \ Set stunned state
- STA $C2,x ; /
- LDA #$20 ; \ Set stunned timer
- STA $1564,x ; /
- DEC !RAM_HP,x ; Increase hit counter and...
- LDA !RAM_HP,x ; \ Check if the sprite has been hit 3 times
- BNE JustHit
- LDA #$08
- STA $1DF9
- LDA #$02 ; \ Kill sprite
- STA $14C8,x ;
- LDA #$10
- STA $1DF9
- LDA #$D0
- STA $AA,x
- LDA #$10
- STA $B6,x
- LDA $1588,x
- AND #$0F
- BNE .Kill
- LDA #$07
- STA !RAM_State,x
- RTS
- .Kill
- LDA #$04
- STA $14C8,x
- JSL $07FC3B
- RTS
- JustHit: LDA #$FF
- STA !RAM_Timer,x
- LDA #$05
- STA !RAM_State,x
- LDA #$20
- STA $1DF9
- RTS
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; PHASE SWITCHER ;;;
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;
- PhaseDurationTable: db $69,$FF,$FF,$FF,$FF,$69,$FF,$69
- NextPhase:
- JSL $01ACF9
- LDA $148D
- AND #$07
- STA $00
- JSL $01ACF9
- LDA $148D
- AND #$01
- CLC
- ADC $00
- STA !RAM_State,x
- AND #$07
- TAY
- LDA PhaseDurationTable,y
- CMP #$69
- BEQ NextPhase ;try again until you fetch a valid count
- LDA PhaseDurationTable,y
- STA !RAM_Timer,x
- INC !RAM_Proj,x
- LDA !RAM_Proj,x
- CMP #!Phase_Blks
- BNE +
- STZ !RAM_Proj,x
- JSR GenerateThrowBlockAtTop
- + RTS
- ;====================================
- GenerateThrowBlockAtTop:
- .GenFire TXY
- LDX #$0B
- .GLoop LDA $14C8,X
- BEQ .Cont
- DEX
- BPL .GLoop
- RTS
- .Cont PHY
- LDA #$09 ;set to main
- STA $14C8,x ;status
- LDA #$53 ;sprite to generate
- STA $9E,x ;custom sprite
- PHY
- JSL $07F7D2 ;clear
- PLY
- LDA #$78
- STA $E4,x
- LDA $95
- STA $14E0,x
- LDA #$FF
- STA $1540,x
- LDA #$00
- STA $D8,x
- LDA #$00
- STA $14D4,x
- STZ $B6,x
- STZ $AA,x
- PLX
- RTS
Advertisement
Add Comment
Please, Sign In to add comment