Language…
11 users online: crocodileman94, Darolac, howardadam1126, isaix, Jordan, Maw, obiet,  patcdr, Shiki_Makiro, SpacePea, underway - Guests: 258 - Bots: 380
Users: 64,795 (2,377 active)
Latest user: mathew

Official Hex/ASM/Etc. Help Thread

  • Pages:
  • 1
  • 2
  • 3
  • 4
  • 5
  • 308
  • 309
  • 310
  • 311
  • 312
  • 313
  • 314
  • 315
  • 316
  • 317
  • 318
  • 418
  • 419
  • 420
The tables for Mario's acceleration on the rom map list each part as 2 bytes, but the tables they are inside in the all.log file are much larger. Do I need to worry about these other numbers?
</div></div>
Originally posted by Yoshi Master
I have an issue with Romi's Ptooie sprite. It acts normal, but when I kick a shell at it, it will sometimes die and other times not. This happens with both the pipe and walking ptooies.


You could try to mark the "Don't interact with other sprites" box if you want some consistency, because the porblem could be with the Ptooie's hitbox.

Anyway, how can I make a sprite use a diferent tilemap when it's facing a certain direction?
LDA $7E0DBF
CMP #$32 ;Compares the value. 50 = 32 in hexadecimal.
BEQ equal
RTS
equal:
LDA #$08
STA $7E0071
LDA $7E0DBF
CMP #$32
BEQ reset
RTS
reset: ;If he has 50 coins, set back to zero.
LDA #$00
STA $7E0DBF

:T If Mario has 50 coins, he'll fly to a bonus level. Just wanted to share.


Currently Playing: Kirby's Dream Land 3 (SNES) Just Beaten: Super Mario Sunshine
Find me on other sites! SMW Central - Nintendo Age - Colors! 3D - Miiverse - DeviantART
Quick question about the controller: how can I check if the A button is pressed? I only managed to check for B:
Code
LDA $16
AND #$80
BEQ return
LDA $18
AND #$80
BNE return

Changing the last line to "BEQ return" doesn't work. Looks easy, but I'm pretty much new to asm and I can't figure it out.
From what the RAM map says, apparently $16 only covers B, not A. So try just erasing the first three lines altogether.

Code
LDA $18
AND #$80
BNE .PressedA


Code
LDA $16
AND #$80
BNE .PressedB


Alternatively, saving a bit of space and time:

Code
LDA $18
BMI .PressedA


Code
LDA $16
BMI .PressedB


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

I'm working on a hack! Check it out here. Progress: 64/95 levels.
@Storm Kyleis: I were actually going to assume you wanted to check when both A and B are pressed.
Not sure if you want that, but if my assumptions are right, maybe this could fit your case:

Code
LDA $17		;\ Check if A
AND $16		; | and B are pressed (toghether)
BPL nopress	;/ if not, branch
*code*		; else, do stuff
nopress:


Originally posted by Dakress
Anyway, how can I make a sprite use a diferent tilemap when it's facing a certain direction?

Most sprites keep track of their direction using $157C,x (#$00 = Right; #$01 = Left), so you can probably take advantage from that one in your GFX routine.
If you're looking for an X-flip instead, you just need to use $157C,x to index a YXPPCCCT properties table containing two values, one of which has the X flip bit set (6th), depending on which direction needs horizontal flipping.

@RonaldCoLtd: this is not exactly the correct place for that, next time you can try here.
That code could also use a lot of optimization, such as loading from RAM mirrors for $7E0071 ($71) and $7E0DBF ($0DBF), instead of pointing directly to the WRAM bank. See how much smaller it can be:

Code
LDA $0DBF		;\ If coins == 50
CMP #50			; |
BNE return		;/ branch away
LDA #$08		;\ Else send the player to the yoshi bonus game thing
STA $71			;/
STZ $0DBF		; And get away the coins
return:			;
RTS			;


I hope you can learn something from this, I didn't feel like overanalizing >_>
I only wanted A to be checked, sorry for not being clear enough. Imamelia's solution worked perfectly, thanks.
Originally posted by Lui37
@Storm Kyleis: I were actually going to assume you wanted to check when both A and B are pressed.
Not sure if you want that, but if my assumptions are right, maybe this could fit your case:

Code
LDA $17		;\ Check if A
AND $16		; | and B are pressed (toghether)
BPL nopress	;/ if not, branch
*code*		; else, do stuff
nopress:


Originally posted by Dakress
Anyway, how can I make a sprite use a diferent tilemap when it's facing a certain direction?

Most sprites keep track of their direction using $157C,x (#$00 = Right; #$01 = Left), so you can probably take advantage from that one in your GFX routine.
If you're looking for an X-flip instead, you just need to use $157C,x to index a YXPPCCCT properties table containing two values, one of which has the X flip bit set (6th), depending on which direction needs horizontal flipping.

@RonaldCoLtd: this is not exactly the correct place for that, next time you can try
here.
That code could also use a lot of optimization, such as loading from RAM mirrors for $7E0071 ($71) and $7E0DBF ($0DBF), instead of pointing directly to the WRAM bank. See how much smaller it can be
Code
LDA $0DBF		;\ If coins == 50
CMP #50			; |
BNE return		;/ branch away
LDA #$08		;\ Else send the player to the yoshi bonus game thing
STA $71			;/
STZ $0DBF		; And get away the coins
return:			;
RTS			;


I hope you can learn something from this, I didn't feel like overanalizing >_>



Haha, thanks. I'm trying to figure out all the RAM addresses and some opcodes.


Currently Playing: Kirby's Dream Land 3 (SNES) Just Beaten: Super Mario Sunshine
Find me on other sites! SMW Central - Nintendo Age - Colors! 3D - Miiverse - DeviantART
Is there another program way for to edit the ROM Hex's, since HxD wont work on my computer?
If no editor works, perhaps this could help.
Should be easier than it seems, plus you can keep track of all your edits and stuff.
I'm trying to use the Horizontal proximity check code from the Code Library thread in a sprite, but it doesn't seem to account for the high byte when doing the check, and my sprites keep reacting as though they're close to Mario when they're actually across the screen from him.

Is there some way I can make the math use 16 bit numbers to calculate the distance instead of 8?
I don't know if that's really what you want...

<blm> zsnes users are the flatearthers of emulation
Thanks

I'm not sure if I'm using it properly though, now they seem to be triggering whenever Mario is to the left of the sprites.

EDIT: Actually, if I use it as written, it just crashes the game. It seems to be assembling wrong, and using the opcode for the next command as part of the ADC.


Replace ADC #!Proximity with ADC.w #!Proximity.

You may also want to set the proximity to something nonzero.
<blm> zsnes users are the flatearthers of emulation
Alright, doesn't crash anymore, and I changed the value (I never changed it from the original code, but again, I have no idea if I'm doing this right) But now it just does nothing. Am I supposed to be using this along side of, or instead of the old proximity code?

Sorry for asking dumb questions...
That's what I thought, but since I don't entirely understand it, I wasn't sure. I still can't get it to work and I'm not really sure why...
  • Pages:
  • 1
  • 2
  • 3
  • 4
  • 5
  • 308
  • 309
  • 310
  • 311
  • 312
  • 313
  • 314
  • 315
  • 316
  • 317
  • 318
  • 418
  • 419
  • 420