Points of Required Attention™
Please chime in on a proposed restructuring of the ROM hacking sections.
Views: 88,478,720
Main | FAQ | Uploader | IRC chat | Radio | Memberlist | Active users | Latest posts | Calendar | Stats | Online users | Search 04-24-24 08:19 PM
Guest: Register | Login

0 users currently in ROM Hacking | 1 guest | 2 bots

Main - ROM Hacking - SMB 1 Music Data Information New thread | New reply


GameGenie81
Posted on 10-05-08 07:25 AM (rev. 2 of 10-05-08 08:18 AM) Link | Quote | ID: 91732


Koopa
Level: 24

Posts: 81/100
EXP: 78085
Next: 40

Since: 08-15-07
From: Milwaukie, OR

Last post: 5432 days
Last view: 5385 days
When I enter a cloud level in Super Mario Bros., the resulting syntaxes in the ROM code I discovered are:


ChkAreaType:
$9106: AC 4E 07 - LDY $074E = #$01
$9109: AD 43 07 - LDA $0743 = #$03
$910C: F0 02 - BEQ $9110
$910E: A0 04 - LDY #$04
StoreMusic:
$9110: B9 E7 90 - LDA $90E7,Y @ $90E7 = #$02
$9113: 85 FB - STA $FB
ExitGetM:
$9115: 60 - RTS


Why does the RAM address that points to "CloudTypeOverride" have a result of #$03 that is stored in the A register; which follows the previous RAM instruction that points to "AreaType" which retains the then-current result that is #$01, or "GroundMusic," in the Y register?


____________________
We are a nation with no geographic boundaries, bound together through our beliefs. We are like-minded individuals, sharing a common vision, pushing toward a world rid of color lines.

Dan
Posted on 10-05-08 11:44 AM Link | Quote | ID: 91739


Goomba
Level: 14

Posts: 23/28
EXP: 11734
Next: 1337

Since: 02-20-07

Last post: 5552 days
Last view: 4496 days
Why don't you just create one thread with all your Super Mario Bros questions in it?

GameGenie81
Posted on 10-05-08 07:09 PM Link | Quote | ID: 91753


Koopa
Level: 24

Posts: 82/100
EXP: 78085
Next: 40

Since: 08-15-07
From: Milwaukie, OR

Last post: 5432 days
Last view: 5385 days
Posted by Dan
Why don't you just create one thread with all your Super Mario Bros questions in it?


That's a clever idea.

Now to copy my original post to that...

~Ben

____________________
We are a nation with no geographic boundaries, bound together through our beliefs. We are like-minded individuals, sharing a common vision, pushing toward a world rid of color lines.

Kawa
Posted on 10-05-08 08:22 PM Link | Quote | ID: 91759


CHIKKN NI A BAAZZKIT!!!
80's Cheerilee is best pony
Level: 138

Posts: 1279/5344
EXP: 30940903
Next: 722078

Since: 02-20-07
From: The Netherlands

Last post: 4496 days
Last view: 2632 days
Why does this thread make me want to facepalm? What's stopping you from using just this thread? The name? Contact an admin to rename it.

____________________
Wife make lunch - Shampoo
Opera - give it a spin
Spare some of your free time?
<GreyMaria> I walked around the Lake so many goddamn times that my sex drive was brutally murdered
Kawa rocks — byuu

frantik
Posted on 10-06-08 02:12 AM Link | Quote | ID: 91776


Red Koopa
Level: 28

Posts: 105/139
EXP: 127388
Next: 3950

Since: 10-09-07

Last post: 4487 days
Last view: 4481 days


Why does the RAM address that points to "CloudTypeOverride" have a result of #$03 that is stored in the A register


because there was a STA CloudTypeOverride when the accumulator was 4 somewhere else in the program? your question isn't very clear as to what you're trying to get at

the code checks to see if cloud type override is 0. if it's not, Y is set to a different value to cause the offset used in B9 E7 90 - LDA $90E7,Y @ $90E7 = #$02 to be different and load the different music

look at the smbdisassebly's comments for insight into the code it's very complete

GameGenie81
Posted on 10-06-08 03:55 AM Link | Quote | ID: 91780


Koopa
Level: 24

Posts: 84/100
EXP: 78085
Next: 40

Since: 08-15-07
From: Milwaukie, OR

Last post: 5432 days
Last view: 5385 days
Posted by frantik


Why does the RAM address that points to "CloudTypeOverride" have a result of #$03 that is stored in the A register


because there was a STA CloudTypeOverride when the accumulator was 4 somewhere else in the program? your question isn't very clear as to what you're trying to get at

the code checks to see if cloud type override is 0. if it's not, Y is set to a different value to cause the offset used in B9 E7 90 - LDA $90E7,Y @ $90E7 = #$02 to be different and load the different music

look at the smbdisassebly's comments for insight into the code it's very complete


The next two instructions after the CloudTypeOverride instruction are:
$910C: BEQ StoreMusic
$910E: LDY #$04 (CloudMusic)

If the level is not a cloud type, then skip to StoreMusic.

____________________
We are a nation with no geographic boundaries, bound together through our beliefs. We are like-minded individuals, sharing a common vision, pushing toward a world rid of color lines.

frantik
Posted on 10-06-08 08:25 AM (rev. 2 of 10-06-08 08:26 AM) Link | Quote | ID: 91796


Red Koopa
Level: 28

Posts: 106/139
EXP: 127388
Next: 3950

Since: 10-09-07

Last post: 4487 days
Last view: 4481 days
yes, and if the level is cloud type, set y to 4 before proceeding to store music...

here's some pseudo code of the asm, but it's not particularly tricky or anything

ChkAreaType:
Y = area type; - sets y to level type
A = Cloud type override; - checks to see if cloud level
if (A == 0) goto Storemusic: - if not cloud level, store music, else
Y = 4; - set y to 4
Storemusic:
A = valueAtMemoryLocation(0x90e7 + Y); - load music type number
$FB = A; - store in $FB which is used by music loading routine to determine song type)
return;

Main - ROM Hacking - SMB 1 Music Data Information New thread | New reply

Acmlmboard 2.1+4δ (2023-01-15)
© 2005-2023 Acmlm, blackhole89, Xkeeper et al.

Page rendered in 0.030 seconds. (341KB of memory used)
MySQL - queries: 62, rows: 89/89, time: 0.016 seconds.