[Coco] strange behaviour

Roger Taylor rtaylor at bayou.com
Wed Jun 16 15:03:40 EDT 2004


At 07:15 AM 6/16/2004, you wrote:

>On 15-Jun-04, at 10:59 PM, Roger Taylor wrote:
>
>>The only place you seem to be setting ___ungetched_char is when you clear 
>>it with clra/sta, yet you're checking it for a character upon entry into 
>>the code.
>
>That part, believe it or not, is correct. It gets set elsewhere, in 
>another assembly routine. The part that really seems to be giving me 
>trouble is this:
>
>read_key:
>         jsr     [0xA000]  ; call POLCAT
>         beq     read_key
>
>where the routine will stay in a loop even if I press a key. The BASIC 
>manual says that Z will be 1 upon finding no key pressed, but 0 if it is 
>pressed. But my code doesn't seem to be reacting that way.

Just replace that with jsr [40960] and see what happens.  There's also a 
STDIN/STDOUT variable at address 111 that should be set to 0 for the 
screen/keyboard.  I'm not sure about STDIN but I know that this is the 
STDOUT variable address.

And then, where is the code that sets ___ungetched_char with a 
keycode?  You're checking ___ungetched_char for a keycode at the top of 
your routine.  How and where is this variable getting set???




----------
Roger Taylor






More information about the Coco mailing list