Banner
Views: 559,517,257
Time: 2017-08-20 08:03:27 AM
13 users online: AntiDuck, Chihaya, DPhoenix29, Face, o Ladida, Magiluigi, MarioFanGamer, Paperdomo101, RussianMan, SuperMario198, o tcdw, tmauri, VilelaBot - Guests: 30 - Bots: 181Users: 32,221 (1,483 active)
Latest: Plok
Tip: Keep in mind that the maximum size for an ExAnimation ExGFX file is 16 by 13 tiles, rather than 16 by 8 tiles like you would expect.Not logged in.
Essential components of an ASM patch
Forum Index - SMW Hacking - SMW Hacking Help - ASM & Related Topics - Essential components of an ASM patch
Pages: « 1 »
I was trying to modify Noobish Noobsicle's high-jump patch to more closely simulate the SMB2 high-jump, and I got confused, so I decided to try making my own.
I ended up with this:
Code
header
lorom

org $1281C5

LDA $60		;
CMP #$90	;
BEQ flash	;
LDA $73		;
BNE label	;
LDA $77		;
AND $04		;
BNE label	;
INC $60		;

flash:
LDA #$01	;
STA $149B	;
DEC $60		;
LDA $7B		;
BNE label	;
LDA $15		;
AND $80		;
BEQ jump	;

label:
STZ $60
BRA return

jump:
LDA $7D		;
BEQ return	;
STZ $60		;
LDA #$90	;
STA $7D		;

return:

RTL

And it has no visible effects.
I'm pretty sure I have the actual code right, so I'm guessing there's something REALLY important I don't have, some essential component to all ASM patches that makes it work.
Is that the case?
Is $1281C5 free space? If so, that code is never actually run. You can't just magically insert code in the ROM and assume it's executed.

Instead, you'd have to hijack an existing routine to jump to your custom code. This tutorial should be helpful to you.

--------------------


 
You can try using my hi-jump patch. It's closer to SMB2 iirc
I tried your hi-jump patch, and I got an error:
Originally posted by cmd
error: hijump.asm: line 47: positive branch too long, exceeded bounds [BEQ ReturntA]

I also attempted to make the one I put together work, and it just killed my ROM. Except when I forgot that the debugger removed my ROM's header, then it killed the crap out of the "Mario Start!" screen. I'm guessing all this failure is because I picked the wrong routine to hijack ($008FE8 is where I put the JSL), unless it's because I did it wrong.
Code
!freeRAM = $7E0060	;Hi-jump ram
!freeRAM2 = $7E0664	;used for disabling making sound after you are already charged

What's those 7E/00 doing there? Change to !freeRAM = $60 and !freeRAM2 = $0664

that should fix the long branch problem. (It only says those errors when the branch exceeds 7F or 80 depending on if it's going back or skipping)
I change my layout every 4-5 months

Jiggles!
Unless your branching within ram, I don't see what that would have to do with it. It's more likely that your code crosses a bank boundary.
Jiggles the Catgirl!Stranded
One of these days I will come up with a good sig. But not today.
New blog! Read read read!
  • It does no harm to fix it
  • Fixing it makes the code faster and smaller (probably not noticable, but those tiny improvements stack)
  • If the branch is only a few bytes too long, it will fix it (not likely in this case, but as I said earlier, there's other reasons to do this)
  • KilloZapit, please read this a few more times


--------------------
<MercuryPenny> NEW MEME!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Jiggles!
Originally posted by Alcaro
  • It does no harm to fix it
  • Fixing it makes the code faster and smaller (probably not noticable, but those tiny improvements stack)
  • If the branch is only a few bytes too long, it will fix it (not likely in this case, but as I said earlier, there's other reasons to do this)
  • KilloZapit, please read this a few more times


Seriously? You actually went there?

It's kind of a pity that the most common retort to that last point would automatically invoke godwin's law. Maybe I can think of a better one. Oh wait I got one! How about that it's an ad hominem attack and has no place in an actual argument.

Anyway, I know the difference between your and you're. Half the world knows the difference. I think it's fair to say that anyone who doesn't use "ur" is probably aware somewhere at the back of his mind that there is a difference. So why do people mess it up so much? Well here is an idea: Maybe because half the time, people try and focus on the content of the message then details about spelling and grammar, and just forget.

And yes, sometimes people's spelling and grammar can be so bad they are almost impossible to understand. Sometimes. But here is something you might want to think about: Did you konw taht poelpe can rceongzie msot wrods as lnog as the frist and lsat lteters are in the rgiht palce? It's ture.

Regardless, my point is not that it's a bad idea, but that it's unlikely to have much to do with the actual problem. And that point still stands.

TL;DR: Please do not patronize my attempt to contribute without actually debating my point. It makes me grumpy.

Edit: Though, to be be fair, that code optimization might help the problem is a valid point, but the post made it look like using long addresses is the direct cause, which it is not.
Jiggles the Catgirl!Stranded
One of these days I will come up with a good sig. But not today.
New blog! Read read read!
Okay...
Well, I tried making that modification, and it worked.
I also decided after applying it that it'd be cool to be able to do a hi-spin-jump, so I made a minor modification and it still works perfectly. Thanks!
(On the subject of grammar, yeah, it'd be nice if the internet as a whole would use correct grammar, but not only do I not really care too much about the grammar of others, but it's a futile effort anyway. Note the correct "it's." You're not going to catch me making that sort of mistake too often. Unless they're intentional mistakes made for an ironic effect. And yes, I'm stretching this out to flaunt my ability to avoid grammatical mistakes.)
Pages: « 1 »
Forum Index - SMW Hacking - SMW Hacking Help - ASM & Related Topics - Essential components of an ASM patch

The purpose of this site is not to distribute copyrighted material, but to honor one of our favourite games.

Copyright © 2005 - 2017 - SMW Central
Legal Information - Privacy Policy - Link To Us


Total queries: 23

Menu

Follow Us On

  • Facebook
  • Twitter
  • YouTube

Affiliates

  • Talkhaus
  • SMBX Community
  • GTx0
  • Super Luigi Bros
  • ROMhacking.net
  • MFGG
  • Gaming Reinvented