Than there's the problem. It has to end with a Boss for the Credits to happen. (Unless there is a way to do it without a boss using ASM)
I change my layout every 4-5 months
Ramp202's Profile → Posts
CODE_02C479: A9 0D LDA.B #$0D ; \ Extended sprite = Baseball CODE_02C47B: 99 0B 17 STA.W RAM_ExSpriteNum,Y ; /
db "STAR" dw End-Code-$01 dw End-Code-$01^#$FFFF Code: ; Your Custom Code goes here End: ; Do not put anything after here
X_SPEED dcb $00,$00,$F8,$00,$08 MOVEMENT dcb $00,$00,$FF,$00,$01 .... TILEMAP dcb $EA,$EA,$8C,$8C,$85,$87,$8C,$8C,$87,$85 PROPERTIES dcb $00,$40,$00,$40,$00,$00,$80,$C0,$40,$40
X_SPEED dcb $00,$00,$08,$00,$F8 MOVEMENT dcb $00,$00,$01,$00,$FF .... TILEMAP dcb $EA,$EA,$8C,$8C,$87,$85,$8C,$8C,$85,$87 PROPERTIES dcb $00,$40,$00,$40,$40,$40,$80,$C0,$00,$00
!Freespace = $128000 Header LoROM ; ====================================================== ; Patch Code + RATS Tag ; ====================================================== org $008F7E JSL MainCode NOP #2 ;=========================== org !Freespace !CodeSize = Ending-Routine db "STAR" dw !CodeSize-$01 dw !CodeSize-$01^$FFFF Routine: ;=========================== MainCode: STX $0F13 ; restore STA $0F14 ; hacked code ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; !HAMMER = $3C ;Sprite number of Hammer !BOOMERANG = $3B ;Sprite number of Boomerang !EXTRA_BITS = $7FAB10 !NEW_SPRITE_NUM = $7FAB9E !RAM_IsDucking = $73 !RAM_OnYoshi = $187A !RAM_MarioXPos = $94 !RAM_MarioXPosHi = $95 !RAM_MarioYPos = $96 !RAM_MarioYPosHi = $97 !RAM_SpriteYHi = $14D4 !RAM_SpriteXHi = $14E0 !RAM_SpriteYLo = $D8 !RAM_SpriteXLo = $E4 !RAM_MarioDir = $76 !RAM_SpriteDir = $157C ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; LDA $19 ;\If Mario's powerup CMP #$01 ;|is Big BEQ GETPOWER ;|then continue LDA #$00 ;|but if he gets hit or gets another powerup STA $0DC6 ;/then reset the powerup !RAM to Zero. GETPOWER: LDA $7F8820 CMP #$0D BCC NoAdjust LDA #$00 ; Initialize !RAM the first time STA $7F8820 NoAdjust: BEQ CanShoot DEC STA $7F8820 BRA RETURN CanShoot: LDA $19 ; Only shoot if Big Mario CMP #$01 BNE RETURN LDA !RAM_IsDucking ORA !RAM_OnYoshi BNE RETURN LDA $16 ;\If holding down AND #$40 ;|the button BEQ RETURN ;|don't shoot more projectiles BIT $15 ;|But if pressing once BVC RETURN ;/fire one projectile LDA $0DC6 ;\ If the bit is not set CMP #$00 ;| for the powerups BEQ RETURN ;/then do nothing. LDA $0DC6 ;\If the first bit is set CMP #$01 ;|for the powerup BEQ HAMMER_GEN ;/Then generate hammers. LDA $0DC6 ;\If the second bit is set CMP #$02 ;|for the powerup BEQ BOOM_GEN ;/then generate boomerangs. RETURN: RTL HAMMER_GEN: STZ $09 LDY #$0B LOOP: LDA $14C8,y BEQ NEXT PHX TYX LDA $7FAB9E,x PLX CMP #!HAMMER BNE NEXT INC $09 LDA $09 CMP #$02 BEQ NOFIRE NEXT: DEY BPL LOOP LDA #$06 ;make fireball sound STA $1DFC JSL $02A9DE ; \ get an index to an unused sprite slot, return if all slots full BMI RETURN2 ; / after: Y has index of sprite being generated LDA #$0C STA $7F8820 LDA #$01 ; \ set sprite status for new sprite STA $14C8,y ; / PHX ; \ before: X must have index of sprite being generated TYX ; | routine clears *all* old sprite values... LDA #!HAMMER ; Store custom sprite number STA !NEW_SPRITE_NUM,x ; | JSL $07F7D2 ; | ...and loads in new values for the 6 main sprite tables JSL $0187A7 ; / get table values for custom sprite LDA #$08 STA !EXTRA_BITS,x PLX PHX LDA #$3f STA $13E0 LDA #$0f STA $149C TYX LDA !RAM_MarioXPos STA !RAM_SpriteXLo,x LDA !RAM_MarioXPosHi STA !RAM_SpriteXHi,x LDA !RAM_MarioYPos CLC ADC #$08 STA !RAM_SpriteYLo,x LDA !RAM_MarioYPosHi ADC #$00 STA !RAM_SpriteYHi,x LDA !RAM_MarioDir EOR #$01 STA !RAM_SpriteDir,x PLX LDA #$4E ; \ set timer until change direction STA $1540,y ; / NOFIRE: RETURN2: RTL BOOM_GEN: STZ $09 LDY #$0B loop2: LDA $14C8,y BEQ next2 PHX TYX LDA $7FAB9E,x PLX CMP #!BOOMERANG BNE next2 INC $09 LDA $09 CMP #$02 BEQ nofire2 next2: DEY BPL loop2 LDA #$06 ;make fireball sound STA $1DFC JSL $02A9DE ; \ get an index to an unused sprite slot, return if all slots full BMI RETURN3 ; / after: Y has index of sprite being generated LDA #$0C STA $7F8820 LDA #$01 ; \ set sprite status for new sprite STA $14C8,y ; / PHX ; \ before: X must have index of sprite being generated TYX ; | routine clears *all* old sprite values... LDA #!BOOMERANG STA !NEW_SPRITE_NUM,x JSL $07F7D2 ; | ...and loads in new values for the 6 main sprite tables JSL $0187A7 ; get table values for custom sprite LDA #$08 STA !EXTRA_BITS,x PLX PHX LDA #$3F STA $13E0 LDA #$0F STA $149C TYX LDA !RAM_MarioXPos STA !RAM_SpriteXLo,x LDA !RAM_MarioXPosHi STA !RAM_SpriteXHi,x LDA !RAM_MarioYPos CLC ADC #$08 STA !RAM_SpriteYLo,x LDA !RAM_MarioYPosHi ADC #$00 STA !RAM_SpriteYHi,x LDA !RAM_MarioDir EOR #$01 STA !RAM_SpriteDir,x PLX LDA #$4E ; \ set timer until change direction STA $1540,y ; / nofire2: RETURN3: RTL Ending: