Banner
Views: 779,213,791
Time:
13 users online: 7 Up, Aguni_, Darolac, Green Jerry, Hinalyte, Lloyd,  Manofer,  Ninja Boy, Pitchin Luigi, RollingRigatonis, rvx, Sancles,  Tob - Guests: 36 - Bots: 215 Users: 40,847 (1,670 active)
Latest: Mr.Shohai
Tip: $5.27Not logged in.
Coin counter help
Forum Index - SMW Hacking - SMW Hacking Help - ASM & Related Topics - Coin counter help
Pages: « 1 »
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.

We’re looking for level designers to work on Extra Mario World!
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 :)

We’re looking for level designers to work on Extra Mario World!
Pages: « 1 »
Forum Index - SMW Hacking - SMW Hacking Help - ASM & Related Topics - Coin counter help

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

Copyright © 2005 - 2019 - SMW Central
Legal Information - Privacy Policy - Link To Us


Total queries: 7

Menu

Follow Us On

  • YouTube
  • Twitch
  • Twitter

Affiliates

  • Talkhaus
  • SMBX Community
  • GTx0
  • Super Luigi Bros
  • ROMhacking.net
  • MFGG
  • Gaming Reinvented