Banner
Views: 837,786,866
Time:
28 users online:  Anorakun, brium1, Centipede, Coolmario,  E-man38, everything_is_worth_a_try, h.carrell, imamelia,  Koopster, LadiesMan217, Lsh0426,  Major Flare, marathonx, MasterMario97, Matheus2653, Murphmario, NewPointless,  patcdr, quietmason, RollingRigatonis, S.N.N., Sancles,  Sinc-X, Slash Chen, Ufo, Vhack, Von Fahrenheit, westslasher2 - Guests: 72 - Bots: 65 Users: 45,805 (3,389 active)
Latest: paker19603
Summer C3 2020 Content Spotlight
Deeke's Art Request Thread!
Not logged in.
How to check if mario is touching the ground
Forum Index - SMW Hacking - SMW Hacking Help - ASM & Related Topics - How to check if mario is touching the ground
Pages: « 1 »
How do I check if Mario is currently touching the ground when using a custom block? I wanted to use this part of the RAM Map:

$7E:0077 1 byte Player Player Position Status (0=In Air, 1=Right Edge In Air, 2=Left Edge In Air, 3=On Ground, 4=Left Edge On Ground, 5=Right Edge On Ground)

But this byte never contains any value. It never changes. So what else can I use?
I think it would be

Code
LDA $77
CMP #$03


This code loads what's currently in $0077 and compares it to 03 (mario on ground).

If you want a block to react different ways if the value in $0077 is or isn't 03, then use BEQ If equal, branch to ____ ) or BNE (If not equal, branch to ___ )

Schwa's ASM tutorial and the RAM Map should help you with the rest of what you want to do, whatever it is
That really doesn't work too well. Use $72 intead. It would be #$00 if on the ground.
Originally posted by BZM
I think it would be

Code
LDA $77
CMP #$03


This code loads what's currently in $0077 and compares it to 03 (mario on ground).

If you want a block to react different ways if the value in $0077 is or isn't 03, then use BEQ If equal, branch to ____ ) or BNE (If not equal, branch to ___ )

Schwa's ASM tutorial and the RAM Map should help you with the rest of what you want to do, whatever it is


This is basically what I did, but it doesn't work. The value never changes no matter what I do.

Originally posted by Learn

That really doesn't work too well. Use $72 intead. It would be #$00 if on the ground.


$7E:0072 1 byte Misc. Mario flying flag

Isn't that the "flying with a cape" flag?

What I want is a "mario is touching the ground and can jump" kind of flag.

EDIT: Just tested this. It works - seems to be 00 when touching the ground, 11 when going up in a jump and 36 while falling down. Not exactly sure why it does that, but hey, it works.

Thanks!
Pages: « 1 »
Forum Index - SMW Hacking - SMW Hacking Help - ASM & Related Topics - How to check if mario is touching the ground

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


Menu

Follow Us On

  • YouTube
  • Twitch
  • Twitter

Affiliates

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