57 users online:  Anorakun, autisticsceptile1993, Batata Douce,  bebn legg, Blizzard Buffalo, Carld923, cheat-master30, codfish1002, Darolac,  Deeke, Eduard, ekic, EvanEMV, everything_is_worth_a_try,  Falconpunch, game eeg, gridatttack, h.carrell, hendog30_, Idunno, Infinity,  KevinM, KiloMinimo,  Koopster, l337f00l, levelengine, LOLRyan2006 the Goombud, Lotica, lx5, Mr. MS, MrDeePay, Murphmario, nathew, NewPointless, NikSik1, OEO6, Picsa,  Pinci, PipoOnTour, pisca_mb, PokerFace, rosysunrise_, RPG Hacker, Rykon-V73, SammmUuU, SamuelBergy,  Teows, TheBiob, TheMorganah,  Tob, Ultima, WhiteYoshiEgg, Wyatt, xamexer,  xHF01x, yoshikirby43, Young Boi - Guests: 92 - Bots: 57 Users: 45,721 (3,348 active)
Latest user: game eeg
Not logged in.
Super Status Bar + Ceiling Generator
Forum Index - Sunken Ghost Ship - C3 Museum - Fall 2009 - Super Status Bar + Ceiling Generator
Pages: « 1 2 »
i definitely using the status bar one. As for the celing one, it depends on how my hack's been progressing. Both may be useful to be soon *me downloadz it*

--------------------
I've learned the collective intelligence of the human race amounts to roughly that of a bar of soap.
In other news, why am I here.
Originally posted by Ultimaximus
wow, this is amazing! The ceiling generator will definately have a place in all the levels of my hack, and the status bar editor will be extremely useful, and essentially obsoletes Smallhacker's! I must ask, can it move the score counter?

1. I didn't include functionality to change any of the tiles editable by smallhacker's tool. I figure the GUI interface of that tool > tables of hex in my patch :)
2. The advanced version already moves the score counter to a new RAM address. Moving it exactly where you want on the bar itself isn't exactly easy, though.


WARNING: Wall of text and ASM incoming.

Code
CODE_008ED7:        LDX #$28                
CODE_008ED9:        LDY #$00                
CODE_008EDB:        JSR CODE_009012   ; go to very important subroutine
CODE_008EDE:        LDX #$00                ; \  
CODE_008EE0:        LDA !RAM_BAR+238,X             ;  | 
CODE_008EE3:        BNE CODE_008EEF           ;  | 
CODE_008EE5:        LDA #$FC                ;  |Replace all leading zeroes in the score with spaces 
CODE_008EE7:        STA !RAM_BAR+238,X             ;  | 
CODE_008EEA:        INX                       ;  | 
		INX
CODE_008EEB:        CPX #$0C                ;  | 
CODE_008EED:        BNE CODE_008EE0           ;  | 
....
CODE_008F05:        LDX #$28                
CODE_008F07:        LDY #$00                
CODE_008F09:        JSR CODE_009012   ; go to very important subroutine
CODE_008F0C:        LDX #$00                ; \  
CODE_008F0E:        LDA !RAM_BAR+238,X             ;  | 
CODE_008F11:        BNE CODE_008F1D           ;  | 
CODE_008F13:        LDA #$FC                ;  |Replace all leading zeroes in the score with spaces 
CODE_008F15:        STA !RAM_BAR+238,X             ;  | 
CODE_008F18:        INX                       ;  | 
		INX
CODE_008F19:        CPX #$0C                ;  |
....

CODE_009012:        SEP #$20                  ; 8 bit A ; Accum (8 bit) 
		LDA #$00
CODE_009014:        STA !RAM_BAR+198,X             
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+198,X    
		INC A
		STA !RAM_BAR+198,x         
CODE_009037:        BRA CODE_009017  

Quite obviously, I just copy/pasted the routine and made the needed edits. So, you could follow this advice and apply these changes as hex edits instead of modifying my patch if you don't want to use it (but then you'd still be limited to the original 55 tiles).

Anyway, for whatever reason, Nintendo decided to always upload Mario's score and overwrite it if Luigi was playing. You'll have to make some edits twice to not screw up the score counter majorly if playing as luigi.

Before you make any changes, you must know that my table is interleaved. That means each tile takes up two bytes in ram; 1 for the tile number, 1 for the properties. Any tile changes MUST be done to even numbered addresses.

For what you should actually do:
- LDX #$28 before the subroutine call helps determine the starting offset.
- The 3 !RAM_BAR+198,x in the subroutine are actually where it is drawn on the status bar.
- Don't ask me why Nintendo didn't do LDX #$00 and !RAM_BAR+238,x (or rather their original equivalents) instead of this silliness.
- If you wanted it at, say, the top middle-ish of the screen, you'd use LDX #$00 and !RAM_BAR+32,x within the subroutine. (Remember you have to change the LDX before Luigi's score is written as well) Just after the subroutine call, you would also have to change the !RAM_BAR+238,x parts to !RAM_BAR+32,x. (Again you have to change Luigi's as well as Mario's)
- The !RAM_BAR's would be exchanged with the original RAM addresses if you're modifying the original code instead of my patch. Also, most of the x offset numbers are doubled (LDX #$28 was LDX #$14 in the original code). Fundamentally they're the same, so you should have no issues.

Things of note:
xkas, for some stupid reason, uses decimal numbers for !ADDRESS+number. This can get confusing, especially here, because x is a hex number (x28), and +198 is a decimal number. I spent 5 mins looking at my spreadsheet included with the patch wondering why it pointed to the center of the item box (number 226) instead of where the score counter is (number 238).


....All that was probably really confusing. To help alleviate some confusion as to where tiles are in the table, I included a spreadsheet with the patch that shows the hex, decimal, and original RAM offset (where applicable) of all tiles. If you don't know where the hell $0F15 (or whatever) is now, you can just open it up and see that the equivalent hex offset is x126, so the new address would be $7FA0126 (if you use the default free RAM assigned in the patch).

Still I suspect most people will be confused by the interleaving and sheer number of RAM they'd be working with (320 addresses). Once you wrap your head around it though, it makes a lot more sense than Nintendo's table simply because it doesn't skip any tiles.
Wow, a ceiling generator? Never thought of that. And another status bar editor...this is some good stuff, hoping to see some of this in action soon.

--------------------
My Youtube Channel
Originally posted by Kaijyuu
I figure the GUI interface of that tool > tables of hex in my patch

Are you fucking kidding me? D:
Sorry that I have a high(er) opinion of your tool D:

Your tool makes my computer run at a crawl, but at least I can see what tiles I'm placing :P
I tried making that ceiling generator into a levelASM, inserting it into the code for 105 in the levelcode.asm but it didn't work. The level is a vertical level btw.

level105:
LDA $97
BPL CEILING_RETURN
LDY #$00
LDA $19
BEQ CEILING_2
LDA $73
BNE CEILING_2
LDY #$01
CEILING_2:
LDA CEILING_TABLE,y
CMP $96
BCC CEILING_RETURN
INC A
STA $96
LDA $7D
EOR #$FF
INC A
CMP #$10
BCC CEILING_1
LDA #$10
CEILING_1:
STA $7D
LDA #$01
STA $1DF9
CEILING_RETURN:
RTS
CEILING_TABLE:
db $E8,$F0
level106:

Anything wrong there?

--------------------
I own a community of TF2 servers!

ASMT - A new revolutionary ASM system, aka 65c816 ASseMbly Thing
SMWCP - SMW Central Presents a Product- tion long name

frog

http://esolangs.org/wiki/MarioLANG
Ah, forgot to account for something there.


Add this:

Code
level105:
PHB
PHK
PLB

;code

CEILING_RETURN:
PLB
RTS


Levelasm sucks like that.
Quote
xkas, for some stupid reason, uses decimal numbers for !ADDRESS+number


It uses decimal because you didn't put the prefix to signify that it's a hex value ($). The dollar sign in say LDA $80 isn't the magic character to signify an address, the absence of the '#' character signifies that it's an address. The dollar sign just specifies it's a hex value.

Code
LDA 128 ;the following 3 are 100% identical
LDA $80
LDA %10000000

;----

LDA !RAM_BAR+198,X  ;as are these 3
LDA !RAM_BAR+$C6,x
LDA !RAM_BAR+%11000110,x


Use whatever notation looks best in source, it all looks the same after it gets assembled.
Learn something new everyday :D Thanks!

- goes to update patch
I now have this in levelcode

Originally posted by huh
level105:
PHB
PHK
PLB
CEILING_RETURN:
PLB
RTS
CEILING:
LDA $97
BPL CEILING_RETURN
LDY #$00
LDA $19
BEQ CEILING_2
LDA $73
BNE CEILING_2
LDY #$01
CEILING_2:
LDA CEILING_TABLE,y
CMP $96
BCC CEILING_RETURN
INC A
STA $96
LDA $7D
EOR #$FF
INC A
CMP #$10
BCC CEILING_1
LDA #$10
CEILING_1:
STA $7D
LDA #$01
STA $1DF9
CEILING_TABLE:
db $E8,$F0
level106:


It doesn't seem to work. Adding the lines you showed me gave me an error saying the ceiling return is already accounted for so I removed the bottom one.

--------------------
I own a community of TF2 servers!

ASMT - A new revolutionary ASM system, aka 65c816 ASseMbly Thing
SMWCP - SMW Central Presents a Product- tion long name

frog

http://esolangs.org/wiki/MarioLANG
Put it back, delte the CEILING_RETURN: and PLB at the top, and put the PLB right below the CEILING_RETURN: at the bottom.

The ;code part was supposed to signify the rest of the code xD
This is getting kind of frustrating. This time I did that and...

It worked!
Lol. That's why I hate those code boxes. Why do people use them?

Also - thanks!

--------------------
I own a community of TF2 servers!

ASMT - A new revolutionary ASM system, aka 65c816 ASseMbly Thing
SMWCP - SMW Central Presents a Product- tion long name

frog

http://esolangs.org/wiki/MarioLANG
Pages: « 1 2 »
Forum Index - Sunken Ghost Ship - C3 Museum - Fall 2009 - Super Status Bar + Ceiling Generator