Banner
Views: 807,386,553
Time:
6 users online: Aguni, Daizo Dee Von, JamesD28,  KevinM, lion, sinseiga - Guests: 42 - Bots: 208 Users: 42,358 (1,945 active)
Latest: CrispyMWHC
Tip: If you set the upper tile of the door to act like the lower tile, two-tile-high doors can be entered even while riding Yoshi.Not logged in.
Help with custom sprite
Forum Index - SMW Hacking - SMW Hacking Help - ASM & Related Topics - Help with custom sprite
Pages: « 1 »
I am trying to make a generator that shows level message 1 if the extra bit is clear and level message 2 if the extra bit is set.
For some reason it always displays message 2. I have read through the code several times but can't find what I did wrong. The code is pretty short so I just pasted it in the post.
I saved some of the data to $58 since the RAM map said it was unused. I don't know if you're supposed to do that...

I'm also pretty new to ASM, so maybe I am missing something really basic...
Code
dcb "INIT"

	RTL


dcb "MAIN"

	LDA $7FAB10,x
	AND #$04		;Checks if the extra bit is set, determing weither message 1 or 2 should show
	BNE Message2

;Message1:

	LDA $58
	AND #$01		;Checks if message 1 has already been shown
	BNE MessageShown
	LDA #$01
	STA $1426		;Spawns a message box containing message 1
	LDA #$01
	TSB $58			;Sets bit 1, flagging that message 1 has already been shown
	RTL

Message2:

	LDA $58
	AND #$02		;Checks if message 2 has already been shown
	BNE MessageShown
	LDA #$02
	STA $1426		;Spawns a message box containing message 2
	LDA #$02
	TSB $58			;Sets bit 2, flagging that message 2 has already been shown
	RTL

MessageShown:

	RTL

We’re looking for level designers to work on Extra Mario World!
Generators don't actually have an extra bit -- only regular custom sprites use them.
Originally posted by MarioE
Generators don't actually have an extra bit -- only regular custom sprites use them.


So I was missing something really simple... Thanks a lot, I was going crazy over this :D

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

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

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


Total queries: 7

Menu

Follow Us On

  • YouTube
  • Twitch
  • Twitter

Affiliates

  • Super Mario Bros. X Community
  • ROMhacking.net
  • Mario Fan Games Galaxy