Romhacking.net

Romhacking => ROM Hacking Discussion => Topic started by: kirb1993 on March 28, 2019, 08:07:18 pm

Title: my super mario bros. 1 rom hacking questions
Post by: kirb1993 on March 28, 2019, 08:07:18 pm
how do i make it so that whenever you collect a super mushroom, it kills you instead of turning you into big mario?
Title: Re: a question about hacking super mario bros. 1
Post by: sics on March 29, 2019, 09:06:47 pm
 Recently in another post Eden.GT shared a pack with patches to modify all kinds of things in the SMB1 :thumbsup:

I'm just going to dump this to you here- out of the bunch it contains a patch that changes the display of lives so that exceeding 9, it will be 10. It will correctly display the number of lives up to 99, in which it will proceed to A0, B0, and so on.

(https://orig00.deviantart.net/1614/f/2019/087/8/c/download_by_terwilf-dd39bcf.gif) 100+ IPS patches.zip (https://www.dropbox.com/s/8etf3dia6z7ktkl/100%2B%20IPS%20patches.zip?dl=0)

I believe every sprite and enemy has been coded in SMB so that the very last bottom pixels will be stuck on the first pixels of solid BG tiles.
Title: Re: a question about hacking super mario bros. 1
Post by: kirb1993 on March 29, 2019, 09:37:52 pm
Recently in another post Eden.GT shared a pack with patches to modify all kinds of things in the SMB1 :thumbsup:
whoa! cool!
Title: Re: a question about hacking super mario bros. 1
Post by: sics on March 30, 2019, 12:14:15 pm
(http://www.bwass.org/bucket/poyo.gif)

Poyo! :thumbsup:
Title: another smb1 rom hacking question
Post by: kirb1993 on April 07, 2019, 01:08:07 am
in super mario bros. utility, is it possible to change an enemy like a goomba into a block like a brick block?
Title: Re: another smb1 rom hacking question
Post by: Metal64 on April 07, 2019, 08:25:17 pm
in super mario bros. utility, is it possible to change an enemy like a goomba into a block like a brick block?

No
Title: Re: another smb1 rom hacking question
Post by: Eden.GT on April 11, 2019, 06:31:52 am
If you're changing the sprite, just use a tile editor like YY-CHR.
Title: super mario bros. rom hacking question #3
Post by: kirb1993 on April 13, 2019, 08:13:15 pm
i have just one more question.

can you re-route a pipe so it'll go to world 1-2 (for example) instead of going into the bonus room?
Title: Re: a question about hacking super mario bros. 1
Post by: KingMike on April 14, 2019, 01:59:02 am
Can you please ask all your Super Mario Bros. questions in a single thread?
Title: Re: a question about hacking super mario bros. 1
Post by: kirb1993 on April 14, 2019, 04:04:56 pm
Can you please ask all your Super Mario Bros. questions in a single thread?

yeah, okay.
Title: Re: super mario bros. rom hacking question #3
Post by: NesDraug on April 15, 2019, 02:04:34 am
i have just one more question.

can you re-route a pipe so it'll go to world 1-2 (for example) instead of going into the bonus room?


(https://66.media.tumblr.com/ef8e58ad3e5ce71f37ae920b937fd09f/tumblr_ppznf8KsZI1y1nex7o1_1280.jpg)

If Mario walks over this blue middle square (available in the enemies section) he will be teleported to the given place next time he goes down a (can enter) pipe.
To my knowledge you can't create new "teleporters" so you have to find the ones in the game and work with what you got.
Title: Re: super mario bros. rom hacking question #3
Post by: kirb1993 on April 15, 2019, 11:47:41 pm

(https://66.media.tumblr.com/ef8e58ad3e5ce71f37ae920b937fd09f/tumblr_ppznf8KsZI1y1nex7o1_1280.jpg)

If Mario walks over this blue middle square (available in the enemies section) he will be teleported to the given place next time he goes down a (can enter) pipe.
To my knowledge you can't create new "teleporters" so you have to find the ones in the game and work with what you got.

that's pretty cool!
Title: Re: my super mario bros. 1 rom hacking questions
Post by: NesDraug on April 16, 2019, 02:32:57 am
But now I got a question. Is there a way to make Bowser throw less hammers? Like just two at a time?
Title: Re: my super mario bros. 1 rom hacking questions
Post by: kirb1993 on April 21, 2019, 03:16:20 pm
another question i have:
is it possible for me to make it so that small mario can throw fireballs? and no, the glitch does not count as an answer.
Title: Re: my super mario bros. 1 rom hacking questions
Post by: Psyklax on April 21, 2019, 06:46:05 pm
another question i have:
is it possible for me to make it so that small mario can throw fireballs? and no, the glitch does not count as an answer.

For the love of God, it's possible to change every byte in Super Mario Bros and turn it into Donkey Kong. :D The question isn't "is it possible" but "how do I do it". I know how I would do it... but I won't. :D

I'll explain at least. You said in another of your threads that you don't know what ASM hacking means. It's assembly hacking: assembly is the language that the game is written in (technically machine code, but whatever). By hacking the code, you can do anything. So how would I do what you ask? Well, I'd set a breakpoint in the debugger for the controller 1 input (at $4016) and hold B when I'm fire Mario, and see how the game checks the B input. What the game will presumably do is say "okay, you pushed B. Are you fire Mario? If so, go to the fire shooting routine, if not just carry on". What you need to do is find that instruction and change it so that it goes to the fire shooting routine in any situation. How? Ah, that's where the assembly lies. :)

Oh what do you know, it's in the SMB disassembly as the ProcFireball_Bubble routine:
https://gist.github.com/1wErt3r/4048722 (https://gist.github.com/1wErt3r/4048722)
It does pretty much what I just said.

If none of this makes sense to you, welcome to ROM hacking! :D Just give it some patience, and you'll get it eventually.

Hey, this SMB disassembly is fun. It tells you a lot of things. Here's a Game Genie code I just made which makes water bubbles all the time for no reason:
OZYLPV

And hey, here's another Game Genie code that lets you shoot fireballs whenever you want:
OZZUPV
Oh wait, that's what you wanted to do. Damn... :) Well, you'll notice that you turn big when you do them because small Mario obviously has no sprites for shooting fireballs. Anyway, enjoy!
Title: Re: my super mario bros. 1 rom hacking questions
Post by: DanielFA on April 22, 2019, 09:36:04 am
Hi!

Someone asked a question on another forum that I asked myself last year when I was playing the 256W hack of SMB1 (NES): How to make underwater blocks hittable? Well, after taking a look to doppelganger's disassembly, I found yesterday the answer:

Code: [Select]
AreaType = $074E ; $00 for underwater, $01 for overground, $02 for underground and $03 for castle
Here is where the exception for underwater levels is made:

Code: [Select]
0DCDA AC 4E 07       ldy AreaType
0DCDD F0 13          beq NYSpd

Therefore, the BEQ will always branch to another place when the level has AreaType=$00 preventing the block hitting. But you can fool the process redirecting it to another RAM address where you put the value $01 (overground level). You can make this without editing the disassembly and reassembling it simply by using cheat codes on your emulator or altering the ROM on a hex editor. You only need to find a free address! For example, in the original SMB (NES version) $E432=$FF is not used, so make it $01 and change $DCDA-$DCDC to $AC $32 $E4. This is a quick test on an altered world 1-1 (with a cheat code that forces $074E=$00):

(https://i.postimg.cc/kGztYk2S/Underwater-Hitting-1.gif) (https://i.postimg.cc/cJhtGKK0/Underwater-Hitting-2.gif)

Here you have a FCEUX cheat file for the NES version (FDS version has different addresses): Underwater Hitting (https://anonfile.com/NeMba8h2n0/Super_Mario_Bros._1_USA_cht)  ;)

Edit:

Recently in another post Eden.GT shared a pack with patches to modify all kinds of things in the SMB1

After downloading it I found he fixed the same thing as me but simply NOPing that part of the code! :-[
Title: Re: my super mario bros. 1 rom hacking questions
Post by: DanielFA on November 06, 2019, 08:52:34 am
Hi again!

I love the SMB2J gameplay but find the graphics awful, specially the ground tiles, so decided to copy the tiles from SMB1. But a problem arose in worlds 8-2 and 8-3 where there are platforms made by the 'cloud ledge' tiles:

(https://i.postimg.cc/zvysLjQ7/SMB2-Cloud-Mush-Ledge-1.png)

Editing the graphics gives this:

(https://i.postimg.cc/qqW92KVT/SMB2-Cloud-Mush-Ledge-2.png)

OK, changing the palette assigned for the now 'mushroom ledge' tiles I can get this:

(https://i.postimg.cc/YqWcMdYq/SMB2-Cloud-Mush-Ledge-3.png)

But in SMB1 they have a stem and they should look like this (edited image):

(https://i.postimg.cc/Njq3MRk8/SMB2-Cloud-Mush-Ledge-4.png)

This obviously is a ASM task, so I took smb2jdis, made free space following ShaneM's explanation and got a new fully functional ROM with room for the desired code. Both SMB1 and SMB2J have a similar ledge object subroutine:

Code: [Select]
MushroomLedge:                       ;[SMB1]
          jsr ChkLrgObjLength        ;get shroom dimensions
          sty $06                    ;store length here for now
          bcc EndMushL
          lda AreaObjectLength,x     ;divide length by 2 and store elsewhere
          lsr
          sta MushroomLedgeHalfLen,x
          lda #$19                   ;render start of mushroom
          jmp NoUnder

EndMushL: lda #$1b                   ;if at the end, render end of mushroom
          ldy AreaObjectLength,x
          beq NoUnder
          lda MushroomLedgeHalfLen,x ;get divided length and store where length
          sta $06                    ;was stored originally
          ldx $07
          lda #$1a
          sta MetatileBuffer,x       ;render middle of mushroom
          cpy $06                    ;are we smack dab in the center?
          bne MushLExit              ;if not, branch to leave
          inx
          lda #$4f
          sta MetatileBuffer,x       ;render stem top of mushroom underneath the middle
          lda #$50

AllUnder: inx
          ldy #$0f                   ;set $0f to render all way down
          jmp RenderUnderPart        ;now render the stem of mushroom

NoUnder:  ldx $07                    ;load row of ledge
          ldy #$00                   ;set 0 for no bottom on this part
          jmp RenderUnderPart

MushLExit: rts                       ;and leave

And:

Code: [Select]
CloudLedge:                          ;[SMB2J]
          jsr ChkLrgObjLength        ;get cloud dimensions
          sty $06                    ;store length here for now ($06 = $0006 → Internal RAM)
          bcc EndCloud
          lda AreaObjectLength,x     ;divide length by 2 and store elsewhere (AreaObjectLength = $0730 → Internal RAM)
          lsr
          sta MushroomLedgeHalfLen,x ;(MushroomLedgeHalfLen = $0736 → Internal RAM)
          lda #$8a                   ;render start of cloud (#$8a = 138 → Numerical Value)
          jmp NoUnder

EndCloud: lda #$8c                   ;if at the end, render end of cloud (#$8c = 140 → Numerical Value)
          ldy AreaObjectLength,x
          beq NoUnder
          lda MushroomLedgeHalfLen,x ;get divided length and store where length
          sta $06                    ;was stored originally ($06 = $0006 → Internal RAM)
          ldx $07                    ;($07 = $0007 → Internal RAM)
          lda #$8b                   ;(#$8b = 139 → Numerical Value)
          sta MetatileBuffer,x       ;render middle of cloud (MetatileBuffer = $06a1 → Internal RAM)
          rts

AllUnder: inx
          ldy #$0f                   ;set $0f to render all way down (#$0f = 15 → Numerical Value)
          jmp RenderUnderPart        ;now render the support of the tree ledge

NoUnder:  ldx $07                    ;load row of ledge ($07 = $0007 → Internal RAM)
          ldy #$00                   ;set 0 for no bottom on this part (#$00 = 0 → Numerical Value)
          jmp RenderUnderPart

The other subroutines they call are the same in both games so I added the stem drawing part from one game to the other, assembled the code and got a valid ROM. I started it on FCEUX and played until 4-4 without any problem but when the FDS tried to open 5-1, it got stuck 'forever'...

What do you think?

Have I made something wrong adding the code and the BIOS can't read the level data? I had the same loading problem in the original ROM when using the 'unlimited time' and 'max lives' cheats. Oh, the game gets stuck when loading worlds A/D too... Just FYI, I managed to add new code on SMB1 but on the NES version, the FDS specific format confuses me a lot!

Here is a patch for the original ROM: SMB2_4.ips (http://"https://anonfile.com/T1u0X3g4nc/SMB2_4_ips")
Title: Re: my super mario bros. 1 rom hacking questions
Post by: Cyneprepou4uk on November 07, 2019, 03:52:00 pm
Bytes have been shifted. After you complete 4-4 and screen goes black, set execute breakpoint at $611C in both original and hack roms, and see for yourself how code goes from here. And your patch link sucks by the way.
Title: Re: my super mario bros. 1 rom hacking questions
Post by: DanielFA on November 07, 2019, 04:45:24 pm
Thank you for answering! I'll try what you've said. About the link, yeah, now I see it's broken...  :-[
Title: Re: my super mario bros. 1 rom hacking questions
Post by: DanielFA on November 22, 2019, 08:58:25 am
After you complete 4-4 and screen goes black, set execute breakpoint at $611C in both original and hack roms, and see for yourself how code goes from here

I did what you said and got this:

(https://i.postimg.cc/CMm8xBGv/611C.png)

Running the hacked ROM from there takes to a dead end. If I look into $D2A0 in both ROM's:

(https://i.postimg.cc/dDc3xFMx/D29F-1.png)

Now I don't know what to do but will try by myself. However, if someone wants to help me, this is the patch: SMB2JH (https://drive.google.com/open?id=1tdw8ZtltWM8edwGbZcfiy22pHbU5dQ6v) I've patched the original FDS version:

Quote
ROM MD5       4E6C35327CA16B1466A714C228D2BBED       
ROM SHA-1     32071EEB6EA8BAED1817D08B96A8E64DD5D85F0B
ROM CRC32     DB1A13E2   

:angel:
Title: Re: my super mario bros. 1 rom hacking questions
Post by: Cyneprepou4uk on November 28, 2019, 09:07:59 pm
Quote
Now I don't know what to do

Edit code without shifting half of the disk. How's that for an idea?  >:D
Title: Re: my super mario bros. 1 rom hacking questions
Post by: DanielFA on March 03, 2020, 01:13:31 pm
Yeah, that's a good idea!!! ;D