Language…
8 users online: crocodileman94, isaix, Jordan, Maw,  patcdr, Rudi_Schrausch, Shiki_Makiro, underway - Guests: 263 - Bots: 351
Users: 64,795 (2,377 active)
Latest user: mathew

Posts by Flat5Games

Flat5Games's Profile → Posts

Thank you all! I have it working now.

I actually only want it to work if you hit it from below. Like a question block.

I was concerned about the sound effect portion of the code. It works fine as is because if you hit it from below, you immediately fall back down away from the block.

Are there any safe guards that I should include just in case the player somehow touches the block for more than a frame?
I am getting this error when trying to add patch:

centerscroll.asm:120: error: Unknown function. [if and(equal(0,0),notequal(0,0))]

Any idea why this is happening?
Ok. The latest version of Asar allowed me to add patch.

However, now that the patch is added, my game crashes when trying to load a level.

I'm using the following patches:

retry v2.06a
Manual Player palette Updater
nuke_statusbar
I have been using Stear and yychr to remap sprites, and that has been working fine.

However, I am trying to figure how to remap sprites manually with a patch so that I can do it on a level by level basis using UberASM.

The problem is I keep running into walls trying to figure it out.

The info that I have found is the following:

1. The 'T' bit in YXPPCCCT dictates if the sprite is in SP1 and SP2 OR SP3 and SP4.

2. Tiles 00-7F: SP1 (SP3 if the "Use second graphics page" is checked)
Tiles 80-FF: SP2 (SP4 if the "Use second graphics page" is checked)

3. In the ROM map I have found addresses for tilemap info for various sprites. Ex. ($02B92D is Torpedo Ted's face)

My problem is that when I look at these addresses in a hex editor, I can't make any correlation between the values at these addresses and the tile's position in the sprite page.

Any help would be appreciated. I'm sure that I'm going about this wrong.
I have been using Stear and yychr to remap sprites, and that has been working fine.

However, I am trying to figure how to remap sprites manually with a patch so that I can do it on a level by level basis using UberASM.

The problem is I keep running into walls trying to figure it out.

The info that I have found is the following:

1. The 'T' bit in YXPPCCCT dictates if the sprite is in SP1 and SP2 OR SP3 and SP4.

2. Tiles 00-7F: SP1 (SP3 if the "Use second graphics page" is checked)
Tiles 80-FF: SP2 (SP4 if the "Use second graphics page" is checked)

3. In the ROM map I have found addresses for tilemap info for various sprites. Ex. ($02B92D is Torpedo Ted's face)

My problem is that when I look at these addresses in a hex editor, I can't make any correlation between the values at these addresses and the tile's position in the sprite page.

Any help would be appreciated. I'm sure that I'm going about this wrong.
Yes. I have been told that using a sprite disassembly is the way to go. This is mainly a learning experiment for me. I really would like to understand this.

I still don't get it. I made the following patch:

Code
org $02B92C
db #$E2


According to Lunar Magic, The dolphin's head is #$E2. But in the game, Torpedo Ted's head is not a dolphin at all! It is a garbled mess.

What am I missing here?
So is this just not doable at runtime?

This is my UberASM:

Code
load:

	pushpc
	
	;Torpedo Ted (hand closed)
	org $029E66
	db #$CA
	;Torpedo Ted (hand open)
	org $029E6A
	db #$EA
	;Torpedo Ted (face)
	org $02B92D
	db #$C6
	;Torpedo Ted (propeller 1)
	org $02B937
	db #$C8
	;Torpedo Ted (propeller 2)
	org $02B93F
	db #$E6
	;Torpedo Ted (propeller 3)
	org $02B943
	db #$C8

	;Spiny1
	org $019BCE
	db #$CC
	;Spiny2
	org $019BCF
	db #$EC
	;Spiny3
	org $019BD0
	db #$CC
	
	pullpc


I get the following error:

105_uber.asm: error: empty assembled file.
Ok. I admit defeat. I will use disassemblies like literally everyone has been telling me to do.

I'm not having any problem inserting the sprites. They work as intended.

However, I do not see where in this .asm file I can edit the tilemapping.

Code
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Torpedo Launcher disassembly, based on 1524's code, modified by Davros, optimized by
;; Blind Devil
;;
;; Description: A disassembly of SMW's sprite CA, which can spawn a configurable sprite.
;;
;; Note that spawned sprites other than Torpedo Teds won't behave properly - you will have
;; to workaround that, or modify sprite codes somehow to include a "being launched" behavior.
;;
;; Extra Bit options:
;; clear: spawn normal sprite
;; set: spawn custom sprite
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;Sprite to spawn
!NormSpr = $44
!CustSpr = $BF

;Other defines
!ShowArm = 1		;change this to 0 if you don't want it to display the arm.
!IgnorePlayer = 1	;change this to 0 if you don't want the launcher to spawn sprites when the player is near.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; sprite code JSL
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                    
                    print "INIT ",pc        
                    print "MAIN ",pc
                    PHB                     
                    PHK                     
                    PLB                     
                    JSR SPRITE_CODE_START   
                    PLB                     
                    RTL      

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; main torpedo ted launcher code
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

SPRITE_CODE_START:
		LDA #$50		;if necessary, restore timer to 50

if !IgnorePlayer
		CLC			;clear carry - ignore mario
else
		SEC			;set carry - don't ignore mario
endif
		%ShooterMain()          ; \ check if time to shoot, return if not. (Y now contains new sprite index)
		BCS RETURN              ; /

		    LDA $1783|!Base2,x      ;load shooter extra bits
		    AND #$40                ;check if set
		    BNE SpawnCustom	    ;if set, spawn custom sprite.

                    LDA #$08                ; \ set sprite status for new sprite
                    STA !14C8,y             ; /
                    LDA #!NormSpr	    ; \ set sprite number for new sprite
                    STA !9E,y		    ; /
		    PHX
		    TYX
                    JSL $07F7D2|!BankB
		    PLX
		    BRA +		    ;branch ahead

SpawnCustom:
		    PHX
		    TYX
                    LDA #$01                ; \ set sprite status for new sprite
                    STA !14C8,x             ; /
                    LDA #!CustSpr	    ; \ set sprite number for new sprite
                    STA !7FAB9E,x	    ; /
                    JSL $07F7D2|!BankB	    ;  | ...and loads in new values for the 6 main sprite tables
                    JSL $0187A7|!BankB
                    LDA #$88                ; \ mark as initialized
                    STA !7FAB10,x           ; /
		    PLX

+
                    LDA $179B|!Base2,x      ; \ set x position for new sprite
                    STA !E4,y		    ;  |
                    LDA $17A3|!Base2,x	    ;  |
                    STA !14E0,y		    ; /
                    LDA $178B|!Base2,x	    ; \ set y position for new sprite
                    STA !D8,y		    ;  |
                    LDA $1793|!Base2,x	    ;  |
                    STA !14D4,y             ; /
                    PHX                     ; \ before: X must have index of sprite being generated
                    TYX                     ;  | routine clears *all* old sprite values...

                    %SubHorzPos()	    ;  |
                    TYA                     ;  |
                    STA !157C,x             ;  |

                    LDA #$30                ;  |
                    STA !1540,x             ;  |
                    PLX                     ;  |

if !ShowArm
		    JSR SUB_HAND
endif

RETURN:
		    RTS

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; display hand for torpedo ted launcher
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

if !ShowArm
SUB_HAND:           LDY #$07                ; \ find a free slot to display effect
FINDFREE:           LDA $170B|!Base2,y      ;  |
                    BEQ FOUNDONE            ;  |
                    DEY                     ;  |
                    BPL FINDFREE            ;  |
                    RTS                     ; / return if no slots open

FOUNDONE:           LDA #$08                ; \ set effect graphic to hand graphic
                    STA $170B|!Base2,y      ; /
                    LDA $179B|!Base2,x      ; \
                    CLC                     ;  |
                    ADC #$08                ;  |
                    STA $171F|!Base2,y      ;  |
                    LDA $17A3|!Base2,x      ;  |
                    ADC #$00                ;  |
                    STA $1733|!Base2,y      ;  |
                    LDA $178B|!Base2,x      ;  |
                    SEC                     ;  |
                    SBC #$09                ;  |
                    STA $1715|!Base2,y      ;  |
                    LDA $1793|!Base2,x      ;  |
                    SBC #$00                ;  |
                    STA $1729|!Base2,y      ;  |
                    LDA #$90                ;  |
                    STA $176F|!Base2,y      ;  |
		    LDA #$00		    ;  |
                    STA $1747|!Base2,y      ; /
                    RTS                     ; return
endif
I want the launcher to lower and shoot the torpedo much quicker. I would also like the launcher to notice Mario from farther away.

Here is the .asm file from the disassembly.

Code
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Torpedo Launcher disassembly, based on 1524's code, modified by Davros, optimized by
;; Blind Devil
;;
;; Description: A disassembly of SMW's sprite CA, which can spawn a configurable sprite.
;;
;; Note that spawned sprites other than Torpedo Teds won't behave properly - you will have
;; to workaround that, or modify sprite codes somehow to include a "being launched" behavior.
;;
;; Extra Bit options:
;; clear: spawn normal sprite
;; set: spawn custom sprite
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;Sprite to spawn
!NormSpr = $44
!CustSpr = $00

;Other defines
!ShowArm = 0		;change this to 0 if you don't want it to display the arm.
!IgnorePlayer = 1	;change this to 0 if you don't want the launcher to spawn sprites when the player is near.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; sprite code JSL
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                    
                    print "INIT ",pc        
                    print "MAIN ",pc
                    PHB                     
                    PHK                     
                    PLB                     
                    JSR SPRITE_CODE_START   
                    PLB                     
                    RTL      

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; main torpedo ted launcher code
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

SPRITE_CODE_START:
		LDA #$50		;if necessary, restore timer to 50

if !IgnorePlayer
		CLC			;clear carry - ignore mario
else
		SEC			;set carry - don't ignore mario
endif
		%ShooterMain()          ; \ check if time to shoot, return if not. (Y now contains new sprite index)
		BCS RETURN              ; /

		    LDA $1783|!Base2,x      ;load shooter extra bits
		    AND #$40                ;check if set
		    BNE SpawnCustom	    ;if set, spawn custom sprite.

                    LDA #$08                ; \ set sprite status for new sprite
                    STA !14C8,y             ; /
                    LDA #!NormSpr	    ; \ set sprite number for new sprite
                    STA !9E,y		    ; /
		    PHX
		    TYX
                    JSL $07F7D2|!BankB
		    PLX
		    BRA +		    ;branch ahead

SpawnCustom:
		    PHX
		    TYX
                    LDA #$01                ; \ set sprite status for new sprite
                    STA !14C8,x             ; /
                    LDA #!CustSpr	    ; \ set sprite number for new sprite
                    STA !7FAB9E,x	    ; /
                    JSL $07F7D2|!BankB	    ;  | ...and loads in new values for the 6 main sprite tables
                    JSL $0187A7|!BankB
                    LDA #$88                ; \ mark as initialized
                    STA !7FAB10,x           ; /
		    PLX

+
                    LDA $179B|!Base2,x      ; \ set x position for new sprite
                    STA !E4,y		    ;  |
                    LDA $17A3|!Base2,x	    ;  |
                    STA !14E0,y		    ; /
                    LDA $178B|!Base2,x	    ; \ set y position for new sprite
                    STA !D8,y		    ;  |
                    LDA $1793|!Base2,x	    ;  |
                    STA !14D4,y             ; /
                    PHX                     ; \ before: X must have index of sprite being generated
                    TYX                     ;  | routine clears *all* old sprite values...

                    %SubHorzPos()	    ;  |
                    TYA                     ;  |
                    STA !157C,x             ;  |

                    LDA #$30                ;  |
                    STA !1540,x             ;  |
                    PLX                     ;  |

if !ShowArm
		    JSR SUB_HAND
endif

RETURN:
		    RTS

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; display hand for torpedo ted launcher
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

if !ShowArm
SUB_HAND:           LDY #$07                ; \ find a free slot to display effect
FINDFREE:           LDA $170B|!Base2,y      ;  |
                    BEQ FOUNDONE            ;  |
                    DEY                     ;  |
                    BPL FINDFREE            ;  |
                    RTS                     ; / return if no slots open

FOUNDONE:           LDA #$08                ; \ set effect graphic to hand graphic
                    STA $170B|!Base2,y      ; /
                    LDA $179B|!Base2,x      ; \
                    CLC                     ;  |
                    ADC #$08                ;  |
                    STA $171F|!Base2,y      ;  |
                    LDA $17A3|!Base2,x      ;  |
                    ADC #$00                ;  |
                    STA $1733|!Base2,y      ;  |
                    LDA $178B|!Base2,x      ;  |
                    SEC                     ;  |
                    SBC #$09                ;  |
                    STA $1715|!Base2,y      ;  |
                    LDA $1793|!Base2,x      ;  |
                    SBC #$00                ;  |
                    STA $1729|!Base2,y      ;  |
                    LDA #$90                ;  |
                    STA $176F|!Base2,y      ;  |
		    LDA #$00		    ;  |
                    STA $1747|!Base2,y      ; /
                    RTS                     ; return
endif
If this is at all possible I would like assistance on making this much more light weight.

This is what I would like:

-I don't need sprites for the new powerups.
-I don't need custom blocks for the new powerups
-I just want, for instance, level 105 to start Mario in the frog suit by default.

What are the bare necessities that I would need to make this happen?

...if possible at all
Yeah, I have it working the way I would like it to using UberASM.

My question is what stuff can I leave out since I'm not using the sprites and blocks?

There are several gamemode UberASM files that are inserted.
Then you insert "powerup_gfx.asm" and "powerup.asm".

Is there any of this that I could leave out?

I'm new to ASM, so It is very difficult for me to decipher what is essential and what is not.
Has anyone figured out how to get this patch to work with the instant retry patch? I'm using version 2.06a btw.
I have the custom powerups patch working as intended on a clean ROM.

When I add the retry patch, the game will no longer load. I hear the Nintendo Presents sound, but the screen is black. Then nothing happens.

Are these completely incompatible? I have seen hacks with these powerups and a retry system, so I assume it's possible.

Any help would be appreciated.
@obersteiner86 Thanks for trying! I haven't had any luck either. I know it's possible though. The hack Lord Pickle World uses both instant retry and the Propeller powerup. I just can't figure what the conflict between the two patches is.
I have removed the portrait of mario and the life counter from the OW.

Now it looks odd, because the level title is not centered.

How can I center my level titles or just move them all to the left some?
I have recently added LX5's custom powerups patch.

This apparently conflicts with the custom Mario palette patch that I had working.

Is anyone here familiar enough with the custom powerups patch to know how to fix this?

LX5's patch is so massive and complicated that I have no clue where to start.
I am in the process of writing my first patch, and I am getting strange results. I want any damage whatsoever to kill Mario even if he has a powerup.
For some reason when Mario touches enemy, he shoots into the air like he does on death, and the death jingle plays.
Then he goes into the powerdown animation and he never dies.

Could someone please help me figure out what I am doing wrong?

Code
!instakill = $7FB400 	;You may need to change this address if it is already being used. 
			;If this address contains any value other than #$00, then instakill is active.
			;You may use UberASM to set this value on a level by level basis.

org $00F5D5
autoclean JSL Hijack

freecode

Hijack:
LDA !instakill
BNE KillMario 				;KillMario subroutine
LDA $19					;Powerup status
BEQ KillMario				;KillMario subroutine
RTL

KillMario:
JSL $00F606
AHH!!! Thanks!

Switching to JML totally fixed it.

Something is wrong with my UberASM now I think. Every level kills Mario instantly no matter which Level ASM is loaded.

Here are my two *.asm files:

instakill_off.asm

Code
load:
	LDA #$00
	STA $7EB400
	rtl


instakill_on.asm

Code
load:
	LDA #$01
	STA $7EB400
	rtl


Does anyone see anything wrong with this?
@WhiteYoshiEgg Thanks for catching that! That was definitely unintentional.

Thanks everyone for your help! My first patch ever official works as intended.

Last question for someone. I chose $7FB400 because it was an address that was used in a different patch, so obviously I need to choose a new address to store the instakill flag at.

Is there a document somewhere that shows where all the freeram addresses are?