header
lorom
;;;;;;;;;;;;;;;
org $00F179
CMP #$04 ; #$04 = All switch blocks, #$03 = exclude red, #$02 = exclude blue and red, #$01 = exclude yellow, blue and red, #$00 = No switch blocks.
; Other values not recommendable.
;;;;;;;;;;;;;;;
org $00F187
AND PlaceToSmashFrom,x ; New table
;;;;;;;;;;;;
org $00F18F
LDA TileToGen,x ; More new tables...
STA $07 ; <--
LDA BounceGraphic,x ; Here...
STA $04 ; <--
LDA PowerUp,x ; and here.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
org $37B000 ; POINT TO FREE SPACE!!!!
!CodeSize = Ending-PlaceToSmashFrom
db "STAR"
dw !CodeSize-$01
dw !CodeSize-$01^$FFFF
PlaceToSmashFrom: ; DO NOT REMOVE LABEL
db $0C,$08,$0C,$08,$0C,$0F,$08,$08
db $08,$08,$08,$08,$08,$08,$08,$08
db $08,$08,$08,$08,$08,$08,$08,$08
db $08,$03,$03,$08,$08,$08,$08,$08
db $08,$04,$08,$08,$08,$08
TileToGen:
db $0E,$13,$0E,$0D,$0E,$10,$0D,$0D
db $0D,$0D,$0A,$0D,$0D,$0C,$0D,$0D
db $0D,$0D,$0B,$0D,$0D,$16,$0D,$0D
db $0D,$11,$11,$12,$0D,$0D,$0D,$0E
db $0F,$0C,$0D,$0D,$0D,$0D
BounceGraphic:
db $01,$05,$01,$02,$01,$01,$00,$00
db $00,$00,$00,$00,$00,$06,$02,$02
db $02,$02,$02,$02,$02,$02,$02,$02
db $02,$03,$03,$04,$02,$02,$02,$01
db $01,$07
db $11 ; Green switch block bounce sprite (green turn block)
db $10 ; Yellow switch block bounce sprite (yellow turn block)
db $10 ; Blue slot. (Could be replaced with a custom bounce graphics if you use Kaijyuu's custom bounce graphics patch.)
db $10 ; Red slot.
PowerUp:
db $80,$00,$00,$1E,$00,$00,$05,$09
db $06,$81,$0E,$0C,$14,$00,$05,$09
db $06,$07,$0E,$0C,$16,$18,$1A,$1A
db $00,$09,$00,$00,$FF,$0C,$0A,$00
db $00,$00
db $08 ; Green switch block powerup (feather)
db $02 ; Yellow switch block powerup (mushroom)
db $06 ; Blue switch block powerup (star)
db $04 ; Red switch block powerup (flower)
Ending: ; DO NOT REMOVE LABEL
---------------------------------
- FULL POWERUP SWITCH BLOCK PATCH
- MADE BY: FUZZYFREAK/ROY
---------------------------------
---------------
VERSION 1.2
---------------
Q: And what will THIS do?
A: The same as version 1.0. >_> Fixed it back now Kaijyuu made a custom bounce block graphics patch.
---------------
VERSION 1.1
---------------
Q: What will this patch do?
A: Everything the old patch did, except for a few tiny things.
The bounce sprites (the blocks that appear when you hit the switch blocks) used to be ?-blocks in my old patch.
In version 1.1, each switch block has a turn block with each its own palette.
Credit goes to Boing mostly for this, because he discovered that there were actually bounce sprites with these palettes.
---------------
VERSION 1.0
---------------
Q: What will this patch do?
A: It will replace old tables with new tables and a few hex edits so that the blue and red switch blocks can now spawn powerups too.
Blue is for the star powerup, red for the fire flower. This can be changed.
Recommendable values:
- 02 = Mushroom
- 04 = Instant fire flower
- 05 = Fire flower if not small, mushroom if small.
- 06 = Star
- 07 = Star if already star, coin if no star.
- 08 = Feather
- 09 = Feather if not small, mushroom if small.
- 0A = 1UP
- 0B = 1UP if not small, mushroom if small.
- 0C = Coin
- 10 = Vine
- 11 = Vine if not small, mushroom if small.
- 18 = Yoshi Egg
- 1A = Koopa Shell
There are more but either I didn't bother enough to look through them or they're not recommendable. Feel free to experiment.
Q: I want the red block to be excluded, is this possible?
A: Yes. You should see something at org $00F179. If you want to keep blue but get rid of red, just change CMP #$04 to CMP #$03.
Q: I want the blue block only to be excluded.
A: Well, that takes a little more than just changing CMP #$04. You'll have to do that yourself.
Q: Credit needed?
A: No, it's really a simple patch which took me less than 15 minutes to code.
;=================================================
; SPRITES INIT JSL
;=================================================
print "INIT ",pc
RTL
;=================================================
; SPRITES MAIN JSL
;=================================================
print "MAIN ",pc
PHB
PHK
PLB
JSR CANDLES_MAIN_THING
PLB
RTL
;=================================================
; SPRITES MAIN CODE
;=================================================
RETURN_MAIN:
RTS
CANDLES_MAIN_THING:
JSR SUB_GFX ; Sprites GFX
LDA #$01
STA $0DAE
TABLE1 dcb $0C,$1C
TABLE2 dcb $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 TABLE1,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 TABLE2,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 ; /
LDA $15A0,x
ORA $186C,x
BNE Return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; INIT and MAIN JSL targets
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
dcb "INIT"
JSR SPRITE_INIT_ROUTINE
RTL
dcb "MAIN"
JSR SPRITE_MAIN_ROUTINE
RTL
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; SPRITE_ROUTINE
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
SPRITE_INIT_ROUTINE:
STZ $0F6A
STZ $0F6B
RTS
SPRITE_MAIN_ROUTINE:
LDA $15 ;\Gucken ob A/B gedrückt wurde
AND #$80 ;/
BNE ABPressed
LDA $14 ;\
AND #$3F ;|nur alle 4 frames neue random zahl
BNE NoRandom ;/
Random:
LDA $0F6B ;\
AND #$03
TAY
LDA MarioPosA,y ;|setze Mario position
STA $96 ;|
LDA MarioPosB,y ;|
STA $97 ;|
INC $0F6B ;/
RTS
ABPressed:
LDA #$00
STA $14C8,x
NoRandom:
RTS
MarioPosA:
db $E0,$10,$40,$70 ;
MarioPosB:
db $00,$01,$01,$01 ;]
LDA $1933
LSR A
ROR A
STA $08
LDX #$03 ; Richtung in die das Bounce sprite geht... glaube ich
LDA $873A,x
STA $16B1,y ; Block Bounce Sprite YSpeed Table
LDA $873E,x
STA $16B5,y ; Block Bounce Sprite XSpeed Table
TXA
ORA $08 ; seems useless too
STA $16C9,y ; Block Bounce Sprite ? Table
JSR SpriteBlockInteract
RTS