Date : Wed, 29 Nov 1995 20:45:23 GMT0BST
From : "Tom Seddon" <T.W.Seddon@...>
Subject: Some emulator problems
Hello.
I wasn't on the old BBC emulators mailing list, but I've decided now
to plunge in and write myself an emulator. I'll be using 386
assembler and C, although at the moment I've got a 'practice' version
in 100% C up and running (slowly). I'm having a problem with my
keyboard support though... would anyone be able to help?
As I don't have 6522 support, I have a hack for OSRDCH which calls
getch(). This is not especially brilliant, but it seems to work...
except for the Esc key! My osrdch() hack is as follows:
('a' is the accumulator (unsigned char)
'c' is the carry flag (I use separate variables for each flag))
void osrdch(void)
{
int k;
k=getch();
if(k==8) k=127; //check for backspace key
c=(k==27); //set carry flag if ESC pressed
a=k;
}
This routine is called using an illegal opcode, which I have poked
into the start of the OSRDCH code at &DEC5. Unfortunately it doesn't
work properly, or more specifically the Escape key doesn't work.
Pressing Escape when at the > prompt just creates another prompt,
but not a new line (so you end up with '>>>>>'). Something similar
happens with AUTO as well.
Can anyone give any suggestions as to why this might be? If I need to
have proper keyboard emulation working before this will work that's
fine (I'll live with it), but if it's something more fundamental I'd
like to have it sorted out before I add anything else. I seem to
remember having a similar problem (I think) when I wrote a BBC
emulator on my Atari ST about 3 years ago, but I can't remember how
I fixed it or what caused it... I'd be most grateful for any help.
Thanks,
--Tom
. ** Tom Seddon ** .
/ \ E-mail: T.W.Seddon@... / \
/(o)\ /(o)\
/=====\ Remember, anything is possible... provided /=====\
/ \ you don't know what you're talking about / \
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^