Language…
8 users online: Brian94, Brutapode89, Klug, Metal-Yoshi94,  Nanako, ShadowMistressYuko, TheOrangeToad, Tsquare07 - Guests: 233 - Bots: 288
Users: 64,795 (2,377 active)
Latest user: mathew

Official Hex/ASM/Etc. Help Thread

  • Pages:
  • 1
  • 2
  • 3
  • 4
  • 5
  • 136
  • 137
  • 138
  • 139
  • 140
  • 141
  • 142
  • 143
  • 144
  • 145
  • 146
  • 418
  • 419
  • 420
Originally posted by Monster
Certain states other than 8 tend to not work. If you want your sprite stunnable by the cape, you should code your own "stunned" state within state 8.

Honestly I just suggest killing it when cape'd.


I think you misunderstood, or maybe I worded it badly.
What I'm trying to accomplish is the sprite's death, but instead my sprite is running through this glitchy stun routine that I can't trace.
*opens up old sprite*

The following dies to a cape by falling off the screen.

http://img691.imageshack.us/img691/8074/diestocape.png


I'm not certain what combo of settings is required to die to a cape, but this works.
Thank you Kaijyuu, this actually helped solve my problem. I had previously tried both checking and unchecking the Don't Use Default Interaction With Mario (that was actually the one bit that really confused the heck out of me in Iceguy's tut), but for some reason, never tried unchecking Can Be Jumped On.

Fixed! And I have now created my first working sprite! Hooray!
Another problem with my layer 2 boss. Is there a way to flip Layer 2 horizontally? I'm guessing not, so what I'm doing is I have an x-flipped version of my boss on the next screen on Layer 2, and I flip it by setting the Layer 2 hi byte ($1467) to 1 to face right, or 0 to face left. I set this byte every time the boss hits the ground. It flips ok, but after flipping twice (facing right, then left again) large parts of it disappear. The blocks are still there and are solid, but only the tiles in the rightmost column are visible. However, once it faces right again, it is normal. Here's some screenshots (glitched graphics are on purpose to avoid spoilers):

Facing left initially:


Facing right:


Facing left again:


What is causing this, an how do I fix it?
No, I don't know of any way to flip layer 2 (not counting some funny mode7/hdma tricks).
May I suggest LDA $1467 EOR #$01 STA $1467 instead of whatever flipping code you have right now?
<blm> zsnes users are the flatearthers of emulation
Use a vertical level. Tiles then won't disappear with your method.


And yeah, no way to flip an entire layer unless you edit the tilemap or use mode7.
Thanks, I didn't know that EOR flips a byte from 0 to 1 and vice versa, which is cool, but the boss flips to face the player depending on which side of it you are on. I just tried EORing it anyway, and it flips it back and forth every time it lands, but tiles still disappear when it faces left. This is the routine with the flipping code fwiw:

Code
;When hit ground, stop and trigger earthquake and stun Mario
Earthquake:
LDA #EarthquakeTime  ;\ make an earthquake
STA ShakeTimer       ;|
LDA #$09             ;|
STA PlaySound        ;/
INC BossStatus       ;\ Increment Status to 2
JSR BossPosition     ;| Get boss Position relative to Layer 1
CMP MarioX           ;| If A is less than MarioX, Mario is to the left of the boss, else he's right of it
BCS FaceLeft         ;/
LDA #$01             ;\ Make boss face right
BRA Earthquake1      ;|
FaceLeft:            ;|
LDA #$00             ;/ Make boss face left
Earthquake1:
STA Layer2XHi        ;\ Store the direction boss should face
STZ TimerStatus      ;/ and set TimerStatus to 0
LDA $77              ;\ If Mario is on the ground
AND #$04             ;| stun mario from the earthquake
BEQ EarthquakeReturn ;|
LDA #EarthquakeTime  ;|
STA StunTimer        ;|
EarthquakeReturn:    ;|
RTS                  ;/


Edit: I'll try using a vertical level.

Edit: A vertical seems to be working. It isn't completely set up yet, but I can see the boss moving, and it looks normal no matter what direction it faces. Thanks! Edit: boss fight ported completely to a vertical level.
I'm a little confused about the adresses handeling Mario's x and y position when looking at the ram map.

What seperates: ($7E,$80), ($94,$96) and ($D1,$D3)?
Waluigi needs his own game, he doesn't even have character!
...
Currently working on Waluigi's Treasure Hunt.
$7E-81:

Mario's position on the screen. Quite literally this is his position on the level - the layer 1 scrolling. Good for use if you want say, a sprite to move in relation to him (since sprite graphics must be placed in relation to the screen).


$94-97:

Mario's position next frame.

$D1-D3:

Mario's position this frame.


$D1-D3 and $94-97 are intimately related. Say you want to know if mario will go through something next frame (like, if you wanted to calculate if mario were to go through the side of an object). If mario's position this frame is outside of the object, but next frame inside, you know there's collision and can set mario's position and state accordingly.

It can be used for more things than just platforms and walls, too. If at any time you want to know if Mario's passing through a line (and not just touching it), you check these.


If you just want to move mario, you should edit $94-97. The next frame his position ($D1-D3) will be set to this value, and $94-97 will be updated to a new value based on his speed.
THanks.

I've got another question, how would you easiest multiply/divide a negative (80-FF) value, without making it positive?
Waluigi needs his own game, he doesn't even have character!
...
Currently working on Waluigi's Treasure Hunt.
I'd say tick an EOR #$FF INC A before and after it.
<blm> zsnes users are the flatearthers of emulation
Originally posted by RAM Map
$7E:1DF9 4 bytes I/O SPC700 I/O Ports (Write values to play music/SFX)

If I want to play SFX 0A (get mushroom) how complicated would this be? Would this just be

LDA #$0A
STA $7E1DF9
RTS

or is there more to it than that? The 4 bytes worries me.
No, that's all there is to it. ;) The other four addresses are used for different sound effects / music.


 
How can I change the sound bank used for Dragon Coins?
It should be right after the sound effect it uses

at x7558, you should see this see this:

A9 1C 8D F9 1D

Which translates to:

LDA #$1C ; the sound effect #
STA $1DF9 ; the sound bank


Simply change the F9 1D to FC 1D or FA 1D, depending on the sound bank you wanna use
Yeah, I need help spawning a feather from a block. I want to spawn it as though it was hit from a ? block, but it just floats downwards like when dropped from the item box. Sprite state when spawned is #$08, just like when spawned from a block judging from all.log, and Y speed is #$D0, so I don't know what the problem is.
How would I go about making a block display 2 messages, one after another? I already tried using the code from Dispari's NPCs v 3.0, but I either left out some crucial things or it's incompatible with blocks.


 
Eh... unlikely to work with a block if you want to display two. There's no way you could do that without a timer.


EDIT: With some trickery you might be able to do it with two.

First block would display the first messsage, and set a timer.
Second block would be invisible and surround the first far enough that mario could not escape it before the second message would display.
The second block would decrement the timer and eventually display the second message and reset the timer completely.


EDITEDIT: Alternatively you could do the timer with something like levelasm instead of a second block.
Alright, I guess I have to use an NPC then. Thanks for the answer.


 
How to make the camera shows the lower Map16Tiles like in SMB3?
  • Pages:
  • 1
  • 2
  • 3
  • 4
  • 5
  • 136
  • 137
  • 138
  • 139
  • 140
  • 141
  • 142
  • 143
  • 144
  • 145
  • 146
  • 418
  • 419
  • 420