Points of Required Attention™
Please chime in on a proposed restructuring of the ROM hacking sections.
Views: 89,455,395
Main | FAQ | Uploader | IRC chat | Radio | Memberlist | Active users | Latest posts | Calendar | Stats | Online users | Search 09-21-24 03:26 AM
Guest: Register | Login

0 users currently in ROM Hacking | 2 guests

Main - ROM Hacking - Can I get a little SMB1 hacking help please? New thread | New reply


Googie
Posted on 03-30-16 08:26 PM Link | Quote | ID: 162961


Giant Red Paratroopa
Level: 78

Posts: 1195/1407
EXP: 4230005
Next: 152221

Since: 02-19-07
From: Brooklyn, NY

Last post: 156 days
Last view: 156 days
Where are the offsets located where I can make the Buzzy Beetle go back and forth like the red Koopa Troopa? This is for the hack Super Luigi: The Forgotten Adventure, thank you...

____________________
My Linktree

Quick Curly
Posted on 03-30-16 11:11 PM Link | Quote | ID: 162963


Giant Red Paratroopa
Level: 78

Posts: 1356/1443
EXP: 4225197
Next: 157029

Since: 06-15-08
From: Earth

Last post: 169 days
Last view: 34 days
Just to point out, there's a pinned General SMB1/SMB2J Hacking Thread, similar to the General SMB3 Hacking Thread, that barely gets used, but can be used for asking general questions, sharing hacks and the like. This helps prevent so many individual threads being created for the same game. Thank you in advance.

As for your question, since I've never actually hacked SMB1, I referred to the SMBDis source code by doppelganger.

Here is the relevant information that I used to find what you're looking for. First, the enemy IDs.

;enemy object constants 
BuzzyBeetle = $02
RedKoopa = $03

There's a section labelled as "LandEnemyProperly". There's a branch part labelled "ChkForRedKoopa".

ChkForRedKoopa:
lda Enemy_ID,x ;check for red koopa troopa $03
cmp #RedKoopa

In a hex editor, searching for "B516C903" leads to ROM offset 0x060F2 ($E0E2 in RAM).

E0E2:B5 16     LDA $16,X
E0E4:C9 03 CMP #$03

As a test, I changed the 03 at ROM offset 0x060F5 from 03 to 02 (for the Buzzy Beetle).

Following this change, all of the Red Koopas that I encountered dropped off the first ledges that they came across.
In addition, in 8-1, I watched as a Buzzy Beetle turned back around and continued walking in the opposite direction instead of dropping off the ledge that it approached.

Now, the issue here is changing the code to do what you want with the space available. Depending on what you want specifically could affect how effortless or involved implementing it will be.

For example, do you want only Buzzy Beetles to not drop off ledges?
Do you want both Buzzy Beetles and Red Koopas to not drop off ledges?
Would you possibly like no enemies to drop off ledges, and all walking enemies will move back and forth?

If your answer is only Buzzy Beetles, the above 1-byte change works from what I tested.
There is another jump to "ChkForRedKoopa" identified in the disassembly at 0x06007 in the ROM ($DFF7 in RAM), but I don't know if there's any negative effect to switching the affected enemy. My guess would be that there shouldn't be.

DFF7:4C E2 E0  JMP $E0E2

If you would like no enemies to ever fall from walking, then change the following:

0x060F4-0x060F7 (0x4)
C9 03 D0 04
to
EA EA EA EA

Playing through the original game, Goombas, Green Koopas, Red Koopas, Buzzy Beetles, etc. all move back and forth and never drop down.
The only issue I found with this change as it relates to the original game is if an enemy is placed to start out in midair, like the initial starting positions of quite a few Goombas, it will remain in the air in that spot. Not really a big deal if you place your enemies on actual ground or other objects that they can walk around on.

If you want both Buzzy Beetles and Red Koopas to not drop off ledges, I figure that you would have to do two checks/compares, one for a Buzzy Beetle (02) and one for a Red Koopa (03, the compare seen above that already exists). How you would fit this into the original game's code, I haven't bothered to work around yet since I was primarily focused on just finding the specific code relevant to your hopeful solution. So, here it is. Potentially shifting around sections of code to fit the appropriate branches in and making use of available free space that I haven't bothered to check for either is more work than I'm really motivated to look into right now. However, again, hopefully the above information is helpful and enough to get you and possibly anyone else willing to help you out started.

Also, I didn't know about "Super Luigi: The Forgotten Adventure". Hopefully you'll be able to complete your project. Best of luck, as always.

Googie
Posted on 03-31-16 12:30 AM Link | Quote | ID: 162964


Giant Red Paratroopa
Level: 78

Posts: 1196/1407
EXP: 4230005
Next: 152221

Since: 02-19-07
From: Brooklyn, NY

Last post: 156 days
Last view: 156 days
Thanks QC, I forgot about the General SMB1/SMB2J Hacking Thread. *facepalm*

And thanks for the find, I'm gonna get to it right now. Yeah, a guy on Facebook reached out to me and asked me if I can finish Super Luigi for his five year old daughter, that got me motivated.
I'm up to editing World 2-4 now, here's a sneak peek. He was really impressed with my You Tube video, also.

____________________
My Linktree

Quick Curly
Posted on 03-31-16 06:35 PM (rev. 2 of 04-01-16 02:03 AM) Link | Quote | ID: 162976


Giant Red Paratroopa
Level: 78

Posts: 1359/1443
EXP: 4225197
Next: 157029

Since: 06-15-08
From: Earth

Last post: 169 days
Last view: 34 days
You're welcome.

I forgot about that YouTube video, but I remember watching it before, now that I watched it again. The music is catchy and the levels look fun.

After my previous post, I thought of another possible implementation. The branch could be changed from a BNE (Branch on Not Equal) to a BEQ (Branch on EQual). In this case, you could modify the value to one enemy that would fall off ledges, while all of the other enemies will continuously walk back and forth.

When I thought about it, seeing a Green Koopa not falling off the ledge just doesn't seem right. He's not supposed to know any better!

So, I implemented the change to test it out. The Koopa's ID value is 00.

$E0E2:B5 16     LDA $16,X
$E0E4:C9 00 CMP #$00
$E0E6:F0 04 BEQ $E0EC

Change the following:

0x060F5-0x060F6 (0x2)
03 D0
to
00 F0

Green Koopas fall. Other enemies don't. However, if you stomp on a flying Red Paratroopa, it will stay in the sky in the spot that you stomped it.



I guess that "ChkForDemoteKoopa" (starting at 0x59C3 in the ROM, $D9B3 in RAM) could maybe somehow be modified to make demoted Red Koopas fall so that regular Red Koopas could still walk back and forth if they're already on the ground? I don't know. In the original game, the demoted Red Koopas would still fall, and regular Red Koopas would still walk back and forth.

Maybe the way to go is to do two compare checks. However, searching through the disassembly for "unused" space, there aren't enough free consecutive bytes in any spot to make a jump to shifted code to fit both checks in together. Reassembling the entire modified ROM might be the easiest way to squeeze it in without having to shift and modify everything else just because.

Again, SMB1 isn't my hacking game. Sorry. I don't really feel like doing any serious overhaul work to get it working.

EDIT: Actually, I continued thinking after I posted earlier, and I had another thought. You mentioned that "Super Luigi: The Forgotten Adventure" is going to be 4 worlds long. The original game reuses some data sets for levels to save space, and while your levels will likely all use unique data sets, I'm guessing that you should still have some free space left over. You could potentially use that free space to insert any necessary code. Therefore, with the appropriate jump(s), you could make use of that free space to fit in code with two compare checks for only Buzzy Beetles and Red Koopas. Just another possible idea and thought.

Main - ROM Hacking - Can I get a little SMB1 hacking help please? New thread | New reply

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

Page rendered in 0.064 seconds. (342KB of memory used)
MySQL - queries: 54, rows: 77/80, time: 0.058 seconds.