Language…
12 users online:  Ahrion, autisticsceptile1993, codfish1002, eltiolavara9, Heitor Porfirio, Ice Man, koffe190, LazyRuns, Mischievous Marc, RicardoDeMelo, sinseiga, YuriGamer - Guests: 261 - Bots: 310
Users: 64,795 (2,375 active)
Latest user: mathew

Super Status Bar v2.1 (bottom line fix) by GreenHammerBro / Kaijyuu

File Name: Super Status Bar v2.1 (bottom line fix)
Submitted: 02/3/2015 09:40:20 by GreenHammerBro
Obsoletes: Super Status Bar v2.1
Authors: Kaijyuu
Tool: Asar
Requires Free Space: Yes
Bug Fix: No
Featured: No
Description: This is a status bar hack that does the following:



- Allows a non-ASM programmer to modify each and every tile in the 5 lines comprising the status bar. You can change any tile not modified by Smallhacker's Status Bar editor tool.



- (advanced version only) Allows a non-ASM programmer to move the various counters (time, score, lives, coins, ect) anywhere on the status bar with ease. Also allows one to move the item box item anywhere on the screen (does not affect where it drops).



- Allows ASM programmers to change the tiles (and properties of those tiles) in their own custom sprites/patches/ect much more easily. No longer are you limited to the old 55 tiles; now it's 160.



Comes with a compatibility and an advanced version. The compatibility version uses the old RAM addresses in addition to the new, so stuff like the newbie's custom boss should still work.

The advanced version completely bypasses the old ram addresses and a few routines along with being much faster.



Version 2.1 fixes a glitch concerning the bottom line of the status bar.



Originally posted by Kaijyuu


Originally posted by GreenHammerBro


May I submit an asar version of the super status bar patch? I already converted the metroid HP patch.


Sure.
While the updates itself seems to be working, there's a couple of problems that you must resolve before I approve it:

1.
Code
CODE_008E6F:		LDA $0F31			; \ 
	if !Enable_TIME == 1 
CODE_008E72:		STA !RAM_BAR+!TIME_OFFSET	;  | 
CODE_008E75:		LDA $0F32			;  |Copy time to $0F25-$0F27 
CODE_008E78:		STA !RAM_BAR+!TIME_OFFSET+2	;  | 
CODE_008E7B:		LDA $0F33			;  | 
CODE_008E7E:		STA !RAM_BAR+!TIME_OFFSET+4	; /
	endif


Why are you putting conditionals for disabling only partial parts of a code?
If you disable TIME for example, the LDA $0F31 will do absolutely nothing.

2.

Code
CODE_008EC6:		LDA $0F36	   ; \ Store high byte of Mario's score in $00 
CODE_008EC9:		STA $00		   ; /  
CODE_008ECB:		STZ $01		   ; Store x00 in $01 
CODE_008ECD:		LDA $0F35	   ; \ Store mid byte of Mario's score in $03 
CODE_008ED0:		STA $03		   ; / 
CODE_008ED2:		LDA $0F34	   ; \ Store low byte of Mario's score in $02 
CODE_008ED5:		STA $02		   ; / 
CODE_008ED7:		LDX #$00		
CODE_008ED9:		LDY #$00		
CODE_008EDB:		JSR CODE_009012   
CODE_008EDE:		LDX #$00				; \  
CODE_008EE0:		LDA !RAM_BAR+!SCORE_OFFSET,X		;  | 
CODE_008EE3:		BNE CODE_008EEF				;  |
	if !Enable_SCORE
CODE_008EE5:		LDA #$FC				;  |Replace all leading zeroes in the score with spaces 
CODE_008EE7:		STA !RAM_BAR+!SCORE_OFFSET,X		;  |
	endif 
CODE_008EEA:		INX					;  | 
			INX
CODE_008EEB:		CPX #$0C				;  | 
CODE_008EED:		BNE CODE_008EE0				;  | 
CODE_008EEF:		LDA $0DB3				; Get current player 
CODE_008EF2:		BEQ CODE_008F1D				; If player is Mario, branch to $8F1D 
CODE_008EF4:		LDA $0F39				; \ Store high byte of Luigi's score in $00 
CODE_008EF7:		STA $00					; /  
CODE_008EF9:		STZ $01					; Store x00 in $01 
CODE_008EFB:		LDA $0F38				; \ Store mid byte of Luigi's score in $03 
CODE_008EFE:		STA $03					; /  
CODE_008F00:		LDA $0F37				; \ Store low byte of Luigi's score in $02 
CODE_008F03:		STA $02					; /  
CODE_008F05:		LDX #$00		
CODE_008F07:		LDY #$00		
CODE_008F09:		JSR CODE_009012	 
CODE_008F0C:		LDX #$00				; \  
CODE_008F0E:		LDA !RAM_BAR+!SCORE_OFFSET,X	     	;  | 
CODE_008F11:		BNE CODE_008F1D	   			;  |
	if !Enable_SCORE
CODE_008F13:		LDA #$FC				;  |Replace all leading zeroes in the score with spaces 
CODE_008F15:		STA !RAM_BAR+!SCORE_OFFSET,X	     	;  |
	endif
CODE_008F18:		INX		       			;  | 
			INX
CODE_008F19:		CPX #$0C				;  | 
CODE_008F1B:		BNE CODE_008F0E	   			; /  


Code
CODE_009012:		SEP #$20		  ; 8 bit A ; Accum (8 bit)
	if !Enable_SCORE
			LDA #$00
CODE_009014:		STA !RAM_BAR+!SCORE_OFFSET,X
	endif     
CODE_009017:		REP #$20		  ; 16 bit A ; Accum (16 bit) 
CODE_009019:		LDA $02		   
CODE_00901B:		SEC		       
CODE_00901C:		SBC DATA_008FFC,Y       
CODE_00901F:		STA $06		   
CODE_009021:		LDA $00		   
CODE_009023:		SBC DATA_008FFA,Y       
CODE_009026:		STA $04		   
CODE_009028:		BCC CODE_009039	   
CODE_00902A:		LDA $06		   
CODE_00902C:		STA $02		   
CODE_00902E:		LDA $04		   
CODE_009030:		STA $00		   
CODE_009032:		SEP #$20		  ; 8 bit A ; Accum (8 bit) 
CODE_009034:		LDA !RAM_BAR+!SCORE_OFFSET,X  
	if !Enable_SCORE  
			INC A
			STA !RAM_BAR+!SCORE_OFFSET,x
	endif	 
CODE_009037:		BRA CODE_009017	   

CODE_009039:		INX   
			INX		    
CODE_00903A:		INY		       
CODE_00903B:		INY		       
CODE_00903C:		INY		       
CODE_00903D:		INY		       
CODE_00903E:		CPY #$18		
CODE_009040:		BNE CODE_009012	   
CODE_009042:		SEP #$20		  ; 8 bit A ; Accum (8 bit) 
Return009044:      	RTS       


I *really* need some explanation here.
Do you have any idea of how many cycles wasted if the user disable the score?

3.
Code
CODE_008F49:		LDA $0DBE				; \  
CODE_008F4C:		INC A		     			;  |Get amount of lives in decimal 
CODE_008F4D:		JSR HexToDec				; /
		if !Enable_LIVES == 1
CODE_008F58:		STA !RAM_BAR+!LIVES_OFFSET+2	       	; /
CODE_008F50:		TXA		       			; \  
CODE_008F51:		BNE CODE_008F55	   			;  |If 10s is 0, replace with space 
CODE_008F53:		LDA #$FC				;  |
CODE_008F55:		STA !RAM_BAR+!LIVES_OFFSET	      	; \ Write lives to status bar
		endif


Same for here. Why?

4.

Code
CODE_008F73:		LDA $0DBF     				; \ Get amount of coins in decimal
		if !Enable_COINS == 1
CODE_008F76:		JSR HexToDec	    			; /  
CODE_008F7E:		STA !RAM_BAR+!COINS_OFFSET+2	       	; \ Write coins to status bar 
			TXA
			BNE CODE_008F81
CODE_008F7C:		LDA #$FC				;  | 
CODE_008F81:		STA !RAM_BAR+!COINS_OFFSET	       	; /
		endif


another isolated LDA.

5.

Code
CODE_008F86:		LDX $0DB3	       			; Load Character into X 
CODE_008F89:		STZ $00		   
CODE_008F8B:		STZ $01		   
CODE_008F8D:		STZ $03		   
CODE_008F8F:		LDA $0F48,X	     
CODE_008F92:		STA $02		   
CODE_008F94:		LDX #$00		
CODE_008F96:		LDY #$10		
CODE_008F98:		JSR CODE_009051	 
CODE_008F9B:		LDX #$00		
CODE_008F9D:		LDA !RAM_BAR+!STARS_OFFSET,X	     
CODE_008FA0:		BNE CODE_008FAF	   
CODE_008FA2:		LDA #$FC
		if !Enable_STARS == 1	
CODE_008FA4:		STA !RAM_BAR+!STARS_OFFSET,X	     
CODE_008FA7:		STA !RAM_BAR+!STARS_OFFSET-$40,X
		endif	     
CODE_008FAA:		INX		    
			INX   
CODE_008FAB:		CPX #$02		
CODE_008FAD:		BNE CODE_008F9D	   
CODE_008FAF:		LDA !RAM_BAR+!STARS_OFFSET,X	     
CODE_008FB2:		ASL		       
CODE_008FB3:		TAY		       
CODE_008FB4:		LDA DATA_008E06,Y
		if !Enable_STARS == 1
CODE_008FB7:		STA !RAM_BAR+!STARS_OFFSET-$40,X
CODE_008FBA:		LDA DATA_008E07,Y       
CODE_008FBD:		STA !RAM_BAR+!STARS_OFFSET,X
		endif
CODE_008FC0:		INX	 
			INX	      
CODE_008FC1:		CPX #$04		
CODE_008FC3:		BNE CODE_008FAF   


Lot of code not within if too.

6.
Code
CODE_008FC8:		LDA $0DB3	       
CODE_008FCB:		BEQ CODE_008FD8	   
CODE_008FCD:		LDY #$04      
			LDX #$08	  
CODE_008FCF:		LDA DATA_008DF5,Y
		if !Enable_NAME == 1   
CODE_008FD2:		STA !RAM_BAR+!NAME_OFFSET,X	     
CODE_008FD5:		DEY	 
			DEX
			DEX	     
CODE_008FD6:		BPL CODE_008FCF
		endif   


Same history, same solution.

7.
Code
CODE_008FD8:		LDA $1422	       
CODE_008FDB:		CMP #$05		
CODE_008FDD:		BCC CODE_008FE1	   
CODE_008FDF:		LDA #$00		
CODE_008FE1:		DEC A		     
CODE_008FE2:		STA $00		   
CODE_008FE4:		LDX #$00		
CODE_008FE6:		LDY #!TILE_EMPTY		
CODE_008FE8:		LDA $00		   
CODE_008FEA:		BMI CODE_008FEE	   
CODE_008FEC:		LDY #!TILE_FULL		
CODE_008FEE:		TYA
		if !Enable_DRAGON == 1	       
CODE_008FEF:		STA !RAM_BAR+!DRAGON_OFFSET,X
		endif     
CODE_008FF2:		DEC $00		   
CODE_008FF4:		INX	      
			INX	 
CODE_008FF5:		CPX #$08		
CODE_008FF7:		BNE CODE_008FE6 


Yeah, if the user disable dragon coins too, that will be lot of precious time dropped off. Did you know the SNES can only around 44745 cycles per frame? Discounting NMI, WRAM refreshes, etc, probably the real value is under 30000 cycles. So technically you will wasting around 1 to 2% of the CPU doing absolutely nothing if you disable all of the defines. That's not acceptable for a SNES game.

8.
Code
	!RAM_BAR	= $7FA000	;>Free ram for status bar (needs $140 (320 decimal) bytes)

;These numbers below are DMA that you should change also if you change the free ram above.
;The pairs of digits must corrospond with the pairs in !RAM_BAR. Here is a reference:
;$AABBCC

	!DMA_FirstPair	= $7F		;>this is digit A
	!DMA_SeconPair	= $A0		;>this is digit B
	!DMA_ThirdPair	= $00		;>this is digit C


You can bit shift the !RAM_BAR define, you don't need to make the !DMA_... defines.

In other words:

Code
DMA_BAR:		db	$01,$18,!RAM_BAR,!RAM_BAR>>8,!RAM_BAR>>16,$40,$01



Now for most noticeable readme issues:
(They're not removal reasons but it would be good to you fix)

9.
Quote

HOW DO I USE IT?

First and foremost, make a backup of your ROM. Always do this before applying any
patch whatsoever. Next, open up the .ASM file. Change the freespace number to
something that's freespace.


It's on asar now, there shouldn't be any freespace. Be sure to check your readme to avoid possible confusion with the users.

10.

Quote
* "SuperStatusBar_Compatibilityv2" -> Inferior of ASSB, but compatable with
many codes.


It should be compatible here. It would be better if you completely redo your phrase, but that's not really required.




That's all. Fix it and it should be good enough.