Hey all,
I've been working on a 68k based hardware project for a while as a hobby. I have been trying to implement a button function but I'm having trouble figuring out a way to do it.
The problem I'm currently having with my code is that if the button is held down, the option I want is repeatedly changed every time the program loops around again so I kinda hacked it with multiple btst. Also, with my current code the option changes the first time the button is pushed.
What I want is to press the button, the LCD displays an option (eg "Hello World!"), click the button again, the option changes (eg "Goodbye World"), save that state when the screen is exited. If the state was "Goodbye" and I press the button from some other menu, I want it to say "Goodbye" and not change on the button push entry. Any advice? Here is my current rough code:
Code:
ButtonTest
btst #5,($FFE1AA).w
bne next
rts
next
bchg #0,($FFF0).w
tst ($FFF0).w
beq bye
movea.l #heyworld,a1
bsr LCD_Output
bra rts
bye
movea.l #byeworld,a1
bsr LCD_Output
rts
btst #5,($FFE1AA).w
bne rts
rts
heyworld
dc.b ' Hello '
dc.b ' World! '
byeworld
dc.b ' Goodbye '
dc.b ' World! '