[cc65] Fast multi-key keyboard input on C64?

From: Stefan Wessels <swessels1email.com>
Date: 2010-11-29 01:00:01
Hi,

2 Questions:

1)
I want to read the keyboard in a "raw" state.  I also need to be able to tell if multiple keys are down or not (direction and jump, for example).

Is the only way to do this to use the row/column checks on the CIA ports ($DC00 & DC01)?  Using cgetc, as well as looking at location 197 doesn't work - only 1 key pressed.  

Interestingly enough, kbhit() with cgetc() doesn't give a continuos stream, even when I put values in 650, 651 & 652.  The following illustrates:

#include <conio.h>

int main()
{
	char key;
	int i;
	
	*(char*)650 = 0x80;
	*(char*)651 = 0x01;
	*(char*)652 = 0x01;
	
	while(1)
	{
		key = 0x20;
		if(kbhit())
			key = cgetc() ;
		*(char*)0x400 = key;
		
		for(i = 0; i < 100; i++);
	}
	return 0;
}

This code has the key you are holding down (let's say 'Q') "flash" in the corner.  Without the for loop, you don't even see the character at all - it's put and replaced with a space before you see it (which seems odd - I would have expected a flash in sync with a raster scan at least sometimes?  Am I missing something again?).


2) 
I once found web pages that had all the 6502 code listed that made up the routines like cgetc and showed what pusheax looked like, etc.  It was awesome.  I haven't been able to find this again.  Can someone please point me in the right direction?  I don't know if it was on the cc65 site or if someone else had done it.  Looked like ca65html generated pages, if I remember correctly.

Thank you
Stefan

----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Mon Nov 29 01:00:37 2010

This archive was generated by hypermail 2.1.8 : 2010-11-29 01:00:40 CET