[Coco] Extended basic 1.1 command?

William Astle lost at l-w.ca
Tue Nov 20 23:31:20 EST 2012


On 12-11-20 09:12 PM, Arthur Flexser wrote:
> The ECB manual method would be equivalent to ORing with $80.  They
> assume bits 2-6 to be ones, as they should be if no key is down.  But
> bit 7 might be a zero, since that's the joystick comparator.

Because basic leaves FF02 set to $FF after scanning the keyboard, the 
value in FF00 will not change at all when keys are pressed. The joystick 
buttons are not attached to any bits in FF02 so the relevant bits in 
FF00 will go to 0 regardless of the value in FF00. Thus, you can assume 
that using PEEK() on FF00 will only return the joystick button status 
and the comparator value.

Now, if you're messing with the PIA yourself (in asm), you can't rely on 
the above, but basic polls the keyboard between every command so you 
can't change FF02 with a POKE in basic.

>
> Art
>
> On Tue, Nov 20, 2012 at 9:59 PM, Bill Pierce <ooogalapasooo at aol.com> wrote:
>>
>> Looking further into the matter, I think the reason the &H80 is there instead of the other values mentioned is that the program I stole the code from, "CocoDraw" from the Oct, 86 Rainbow, allowed you to press the shift keys with the buttons to "shift" the cursor 4 pixels left or right for more precision of the cursor. So you may very well be right about the other methods. In any case, the "OR&H80" does work.
>>
>> On the other hand, the ECB manual states to "Peek(65280)" ($FF00) and if the value is 255 or 127 (not OR), no button. If the value is 254 or 126 then it's the right button. If the value is 253 or 125 then it's the left button.
>>
>> Bill P
>>
>> Music from the Tandy/Radio Shack Color Computer 2 & 3
>> https://sites.google.com/site/dabarnstudio/
>> Bill Pierce
>> ooogalapasooo at aol.com
>>
>>
>>
>>
>> -----Original Message-----
>> From: Harry Hurst <hhos at st-tel.net>
>> To: coco <coco at maltedmedia.com>
>> Sent: Tue, Nov 20, 2012 9:05 pm
>> Subject: Re: [Coco] Extended basic 1.1 command?
>>
>>
>>> Oops, I get it now:  bit 7 is the joystick comparator bit and must be
>>> forced to one;  bits 2-6 should already be ones if no keys are down.
>>> Right?
>>>
>>
>> Bits 2-7 don't matter in this case. They all have to be forced to either 0
>> (AND 3) or 1 (OR &HFC) before you can determine the values on the button
>> bits, 0 and 1. To do otherwise leaves too many possibilities open, and
>> invites, if not disaster then at least a headache. If you wanted to also
>> check some of the other bits you could PIA0= PEEK(&HFF00) and then BUT=
>> PIA0 AND 3. Then the other bits are still there in PIA0 when you are done
>> processing the buttons.
>>
>> HH
>>
>>
>> --
>> Coco mailing list
>> Coco at maltedmedia.com
>> http://five.pairlist.net/mailman/listinfo/coco
>>
>>
>>
>> --
>> Coco mailing list
>> Coco at maltedmedia.com
>> http://five.pairlist.net/mailman/listinfo/coco
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> http://five.pairlist.net/mailman/listinfo/coco
>




More information about the Coco mailing list