at myself... hahahaha - i'm dumb.
But God is not dumb and he is so loving!!
: )
ok, so this is what happened... Memblers wrote earlier, in this thread:
Memblers wrote:Just a minor point, but I would suggest to avoid doing .equ #00000000 and would do .equ 00000000 instead, then put the # in your code. I know it should work either way, but it's helpful to have your code be as clear as possible that immediate mode is being used (in addition to using all caps for defined constants, like you're doing already).
and I didn't understand what he ment by ", then put the # in your code."
Today, just a little while, ago I read these wise words from Tepples
And so in my head # started to make sense. I was running and stepping through my "game" with a break everytime there was a write to $0000 through $0002. That's where i placed the three variables
0) currControllerButtons
1) lastControllerButtons
2) newControllerButtons
that I had been watching and thinking about. For some reason the top line of the Memory box started with 0F 0F 00 and that didn't make sense. Why would it be thinking someone had pressed every direction all at the same time? And so I tried the break (same one as i mentioned earlier) to find out. And finally it all started making sense! Each line was missing a # and so that ment that it was an address from which to load the value into A!! So I quickly went to the top of my prg file to this code
Code: Select all
BUTTON_RIGHT .equ 00000001b
BUTTON_LEFT .equ 00000010b
BUTTON_DOWN .equ 00000100b
BUTTON_UP .equ 00001000b
BUTTON_START .equ 00010000b
BUTTON_SELECT equ 00100000b
BUTTON_B .equ 01000000b
BUTTON_A .equ 10000000b
and I started to add a # in front of each binary number... but quit and undid that and quickly went to my vblank file to my code where it says
Code: Select all
lda newControllerButtons ; Is the A button down?
and #BUTTON_A ;10000000b
beq @b
inc aFrame ;run only once per press.
@b: lda newControllerButtons ;Is the B button down?
and #BUTTON_B ;01000000b
and as you can see, I added a # right before each use of my constants.
"and Button_A" became
"and #Button_A".
It works better than it used to!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Memblers, I'm so sorry that I didn't write and ask you what you were trying to say! The question that remains unasked is dumb. I agree. : )