Banner
Views: 931,710,932
Time:
6 users online: bucko, codfish1002,  Devazure, musicalman, OEO6,  Tahixham - Guests: 87 - Bots: 340 Users: 52,014 (2,081 active)
Latest: Ewan.petidog890
Tip: Make sure your overworld's aesthetic, and the levels within, are coherent.
Not logged in.
New Block Help
Forum Index - SMW Hacking - SMW Hacking Help - ASM & Related Topics - New Block Help
Pages: « 1 » Link
Hello everyone. I have a block that I'm trying to code. The bug that I found is that when you have an equal amount of coins, it will not add one to the counter like it is ment to do. Can someone help? Here is my ASM file.

http://bin.smwcentral.net/u/25363/Drums.asm

^Copy this because I have trouble with links.

Edit: I might be able to test further if there is some sort of sleep command. If there is one, you should tell me.
Hack testing information: (Hover here)
...Continued: (Hover here)
Can you explain what you're even trying to do with this block? I honestly can't comprehend it...
I'm trying to add coins to the counter until it reaches the value in !Coins. And if the value is smaller, it should wrap around.
Hack testing information: (Hover here)
...Continued: (Hover here)
I assume you want to increase the coins once per frame (otherwise you could just do LDA !Coins : STA $0DBF). In this case, you could do:

Code
	LDA !Coins
	SEC
	SBC $0DBF
	BPL +
	ADC #$64
+	STA $13CC
Where would I put that block of code?
Hack testing information: (Hover here)
...Continued: (Hover here)
Well, it seems like you're trying to start a drumroll when the block starts giving coins and stopping the drumroll when the block's done. To do this, you'll need uberASM as well. In the block, you would have this:
Code
MarioBelow:
	LDA !Coins
	SEC
	SBC $0DBF
	BPL +
	ADC #$64
+	STA $13CC

	LDA #$11
	STA $1DFC
	STA !free_ram
	RTL

In uberASM, you would have this:

Code
level105:
	LDA $13CC
	BNE +
	LDA !free_ram
	BEQ +
	INC
	STA $1DFC
	STZ !free_ram
+	RTS

This is untested, but I'm pretty sure it should work.
My brain is dying. #smw{x_x} Can you explain what lines of code do what and what UberASM is?

Edit: Okay. I give up on ASM. I can't find tutorials, and when I ask a simple question, everyone stops responding. If anyone can point me to a good tutorial that can explain all functions, I won't give up. But for now, goodbye ASM community.
Hack testing information: (Hover here)
...Continued: (Hover here)
Alright, sure. UberASM is mainly used for code to always run during a level.

Code
MarioBelow:
	LDA !Coins
	SEC
	SBC $0DBF	; Find !Coins - $0DBF
	BPL +		; If this is positive, then this is exactly the value we need
	ADC #$64	; Otherwise, add 100 more coins to make it positive
+	STA $13CC	; And tell the game to start giving these coins

	LDA #$11
	STA $1DFC	; Start the drumroll sound
	STA !free_ram	; Set the block flag saying that we've started giving out coins
	RTL


Code
level105:
	LDA $13CC
	BNE +		; Are we still giving out coins? If so, return
	LDA !free_ram
	BEQ +		; Have we set the block flag? If not, return
	INC
	STA $1DFC	; Since we set this value to #$11, we're storing #$12 by incrementing A
	STZ !free_ram	; Reset the block flag
+	RTS
Thanks for trying to help. However, I'm not going to code again unless I have a tutorial. Thank you for your help, MarioE. You have been very helpful. #smw{<_<}

Edit: I found a tutorial. Hello, ASM community! Let me study a bit and I'll be good! #smw{^_^}

Have a nice day.
Hack testing information: (Hover here)
...Continued: (Hover here)
Pages: « 1 » Link
Forum Index - SMW Hacking - SMW Hacking Help - ASM & Related Topics - New Block Help

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

Copyright © 2005 - 2021 - 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
  • sm64romhacks