Views: 854,280,558
18 users online: ageVerrly, Ayami, Counterfeit, DoodleMyNoodle, Exodustx0, ForthRightMC, Janno27, Jern,  KevinM,  Lazy, Losoall, Lunartoad, MiracleWater, NerDose, orka-bln, PokerFace, singlepat, WhiteYoshiEgg - Guests: 114 - Bots: 66 Users: 47,147 (2,481 active)
Latest: Jardeson
Tip: The lowest row of 16x16 tiles in a level do not appear. Avoid having a low platform that looks like a bottomless pit.Not logged in.
LDA $77 returns 00 always?
Forum Index - SMW Hacking - SMW Hacking Help - ASM & Related Topics - LDA $77 returns 00 always?
Pages: « 1 »
Ok so I have an ASM that wants to check if you bonk your head so I want to read $77 and check if the up bit is set but when I run my code the accumulator is always set to 0 when I do a LDA $77 no matter what the actual value of $77 is, I checked the memory in real time and even when standing on the ground the value is always 04 in the memory as it should be but the accumulator still always returns 00 for some reason.

At this point I have the code running all the time and even on the ground it returns 00 which confuses me.
What's the context of your code, is it uberASM? Also, what are you doing after loading the RAM address into the accumulator? Since you checked the RAM in real time and it's updating, LDA $77 should get whatever is the current value of that into the accumulator, and chances are you're mistreating that value somehow (i.e. overwriting the accumulator). Try storing it to some free RAM right after loading it and check if it's working (if you haven't done so already).

I'm basically trying to have diagonal up pipes, so far the code is just a custom block I put in with GPS, after some testing with someone else I figured that code is ran after the STZ $77 and before it sets the value every frame.

That is the case except in one edge case when I hit the slope helper block in the middle of the 2 slope ceiling blocks in which case $77 is 08 as expected at that moment and then it does what I want.

For reference I'm just throwing the value in the coin counter which does increment my coins as it should when it works.

I'm guessing I'm gonna need to learn uberASM to just store the value somewhere else for what I need.

EDIT : I was also trying to debug this with the block on the ground and just being in the block which is why I had the code with the 04 that was just to try to know why $77 wasn't working which then always returned 00 no matter what I did

EDIT 2: fixed my problem by hijacking some code to read the value when I needed to

Yeah, you can't expect $77 to work correctly in blocks. After all, that value is being calculated during the block code (it can't know if Mario's hitting a ceiling if it doesn't know if the block is solid or not yet, for instance). Patch would definitely be the way to go if you need to check it in a way that the block offsets don't already handle.

Professional frame-by-frame time wizard. YouTube - Twitter - SMW Glitch List - SMW Randomizer
Yeah makes sense, just still new to all this so didn't know if someone already worked with that or anything, patch works fine so there's that, thanks for answering though.
Actually, $77 is usable or more specifically, a backup of $77, stored at $8F. It's used a couple times in block such as on door which you can only enter when you aren't blocked in any way (which typically translates to "you stand on the grond").

Edit: Hold on, I confused two addresses. Ignore what I wrote.

Okay, my layout looks ugly.
From what I can read about 8F and testing that's a backup of 72 which is the "in the air" flag which basically tell you if you'Re going up, down, or are standing on the ground.

I can't really use that 'cause that changes to same values whether or not you bonk somewhere or are just at the top of your jump.

Unless I'm missing something ehre?
My fault, I confused the blocked flags with the in-air flag.

Okay, my layout looks ugly.
Pages: « 1 »
Forum Index - SMW Hacking - SMW Hacking Help - ASM & Related Topics - LDA $77 returns 00 always?

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

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


Follow Us On

  • YouTube
  • Twitch
  • Twitter


  • Super Mario Bros. X Community
  • Mario Fan Games Galaxy