Language…
5 users online: fsvgm777, JezJitzu, KoJi, Pink Gold Peach, sempf 84 - Guests: 263 - Bots: 399
Users: 64,795 (2,377 active)
Latest user: mathew

Coin counter help

I'm trying to make a generator that subtracts 1 coin from Mario every x frames, and kill him when it reaches 0. I've been trying for some time now but can't get it to work.

This is my current code:
Code
	LDA 0DBF		;Loads coin counter
	BNE HasCoins
	JSL 00F606		;Kills Mario if he has 0 coins
	RTL

HasCoins:

	LDA $14
	CMP #$FA		;Branches every 250 frames (5sec)
	BEQ DecreaseCoins
	RTL

DecreaseCoins:

	DEC 0DBF		;Takes a coin
	RTL


I can't seem to find what's wrong. When testing the generator it does nothing. Doesn't subtract coins and doesn't kill Mario.

allow shy guy emojis in post footers you cowards!
You forgot the $ in front of 0DBF twice. ($0DBF)
And in front of the kill routine (JSL $00F606)
Also, I think 1 sekond = 60 frames. As emulators run with 60 FPS
Anime statistic on MyAnimeList:
400 animes completed ✓
6000 episodes completed ✓
100 Days completed ✓
... what even am I doing with my life?
Oh... I can't believe I even made a mistake like that...
Thanks for pointing it out :)

allow shy guy emojis in post footers you cowards!