Language…
11 users online:  Atari2.0, Cristian Cardoso, Danik2343, Green, Hammerer, howardadam1126, marvisjj, Oskise, SpacePea,  Telinc1, tOaO - Guests: 229 - Bots: 311
Users: 64,795 (2,377 active)
Latest user: mathew

New Block Help

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)