[Coco] Extended basic 1.1 command?

Harry Hurst hhos at st-tel.net
Tue Nov 20 20:21:23 EST 2012


>
> Charlie,
> You have to use PEEKs in CB & CEB for the firebuttons.
> "BUT=PEEK(&HFF00) OR &H80"
> "IF BUT=&HFF"  = no button
> "IF BUT = &HFE" = right button
> "IF BUT = &HFD" = left button
>

That doesn't make sense to me. According to the schematic, the buttons are
attached to bits 0 and 1. You would want to mask out all the other bits
with an AND 3, right? The joystick schematic shows the other side of the
button is tied to the ground buss, so,

"BUT=PEEK(&HFF00) AND 3"      masking out the garbage
"IF BUT = 0"  = both buttons    both are 0, both are pressed
"IF BUT = 2" = right button    bit 0 is low. That's the right joystick
"IF BUT = 1" = left button    bit 1 is low. That's the left joystick
"IF BUT = 3" = no buttons    both are high. No buttons

HH




More information about the Coco mailing list