Language…
3 users online: Gamet2004, h.carrell, PROX - Guests: 164 - Bots: 250
Users: 64,667 (2,403 active)
Latest user: DarthHylian

Sumo Brother Flame Fix (NMSTL compatible)

SMW Patches → Sumo Brother Flame Fix (NMSTL compatible)

Submission Details

Name: Sumo Brother Flame Fix (NMSTL compatible)
Authors: Roy, worldpeace
Added:
Version History: View
Tool: Asar
Requires Free Space: Yes
Bug Fix: Yes
Featured: No
Description: 1. Now the flame is compatible with NMSTL(sprite memory index = 10).

2. In the vanilla routine, there's a possibility that flames can overwrite OAM of other sprites when sprite memory is 0 for example.
If you set sprite memory to 10, this patch will let these cluster sprites be in empty OAM slots without overwriting. (Note that regular sprites take the first OAM slots when sprite memory is 10, flames will be behind normal sprites.)

Currently it's still possible for you to use the unmodified routine for some reasons. To use it, use a non-10 sprite memory index. (I might as well change this to be applied for all cases, after confirming there's no problem for doing so.)

No credit needed. This patch is based on the patch made by Roy.
The old description is below.
------------------------------------

This patch fixes two pretty serious bugs one might encounter with the Sumo Brother flames. One, that sometimes sprites will "warp" towards the flames when the lightning strikes the ground, and two, that the player can get hurt when he is about 8 blocks underneath the fire sea. I just happened to fix these because I stumbled upon them in my own hack.

No credit needed.
Tags: lorom needs remoderation
Comments: 2 (jump to comments)
Download 1.56 KiB | 395 downloads

Comments (2)

Vellidragon Link
Any chance of an update to this that works in SA-1 roms? The warp glitch is a very serious bug and I'm not quite sure how to make it work myself.
spooonsss Link
Here's a version for SA-1 1.40:

Code
if read1($00FFD5) == $23		; check if the rom is sa-1
	if read1($00FFD7) == $0D ; full 6/8 mb sa-1 rom
		fullsa1rom
		!fullsa1 = 1
	else
		!fullsa1 = 0
		sa1rom
	endif
	!sa1 = 1
	!SA1 = 1
	!SA_1 = 1
	!Base1 = $3000
	!Base2 = $6000
	!dp = $3000
	!addr = $6000

	!BankA = $400000
	!BankB = $000000
	!bank = $000000

	!Bank8 = $00
	!bank8 = $00

	!SprSize = $16
!maxtile_pointer_low = $61B0
else
	lorom
    assert false
endif

macro define_base2_address(name, addr)
	if !SA1 == 0
		!<name> = <addr>
	else
		!<name> = <addr>|!Base2
	endif
endmacro

%define_base2_address(cluster_num,$1892)
%define_base2_address(cluster_y_low,$1E02)
%define_base2_address(cluster_y_high,$1E2A)
%define_base2_address(cluster_x_low,$1E16)
%define_base2_address(cluster_x_high,$1E3E)



org $02DF6E ; erroneous SEC for y high position
nop

org $02F9CF
autoclean JML FixSumoFlame1 ; fix 8-block-off hitbox

org $02F937	; Draw graphics.
autoclean JML SumoFlameDraw

org $02F93C
;STZ.w !cluster_num,X		;$02F93C	| Erase the sprite.
;RTS							;$02F93F	|
;JML Test_ResetTimer

freecode

FixSumoFlame1:
	LDA $185E|!addr
	AND #$03
	TAY
	LDA !cluster_y_low,x
	JML $02F9D6

no_slot:
    PLA
done:
x_offscreen:
    SEP #$30
    PLX
    JML $02F93B

SumoFlameDraw:

LDA !cluster_x_high,x
XBA
LDA !cluster_x_low,x
REP #$20
SEC
SBC $1A
CLC
ADC #$0010
CMP.w #$0100+$10
BCS x_offscreen
; CLC
ADC #$FFF0
CMP #$0100 ; carry clear if A < $0100
SEP #$20
STA $00
LDA #$02 ; 16x16
ADC #$00 ; 9bit x postion
STA $02

STZ $04 ; high byte of Y offset


LDY #$02
PHY
.loop
SEP #$30

PLA
DEC
BMI done
PHA

ORA.w $185E|!addr			;$02F96E	||
TAY							;$02F971	||
LDA.w $02F8FC,y 			;$02F972	|| Set the tile's Y position.
BMI .loop ; CODE_02F993		;$02F975	|| If its Y offset was negative, skip the tile.
STA $03


LDX $15E9|!addr
LDA !cluster_y_high,x
XBA
LDA !cluster_y_low,x
REP #$21
; CLC
ADC $03
SEC
SBC $1C
CLC
ADC.w #$0010
CMP.w #$00E0+$10
; BCC .y_onscreen
BCS .loop

.y_onscreen:
SEP #$21
SBC #$10

REP #$11

LDX !maxtile_pointer_low+0
CPX !maxtile_pointer_low+8
BEQ no_slot

STA $400001,x ; y position
LDA $00
STA $400000,x ; x position
LDA.w $02F904,y ; SumoBroFlameTiles,y	;$02F97D	|\ Store tile number.
STA $400002,x
LDA $14						;$02F983	|\
AND.b #$04					;$02F985	||
ASL							;$02F987	||
ASL							;$02F988	||
ASL							;$02F989	|| Store YXPPCCCT, and X flip every 4 frames.
ASL							;$02F98A	||
;NOP						;$02F98B	||
ORA $64						;$02F98C	||
ORA.b #$05					;$02F98E	||| Palette to use for the Sumo Bros. flames.
STA $400003,x

; Decrement slot and store back to pointer
DEX #4
STX !maxtile_pointer_low+0

LDX !maxtile_pointer_low+2
; Now store the properties of our new sprite
LDA $02
STA $400000,x
; Decrement and store back to pointer
DEX
STX !maxtile_pointer_low+2

; End of the routine.
BRA .loop


;Test_ResetTimer:
;LDA.b #$7F					;$02DF74	|\ Set timer for the flame.
;STA.w $0F4A|!addr,X
;JML $02F93B