Date : Mon, 23 Nov 2009 13:20:19 +0000
From : mlist@... (Steven Flintham)
Subject: Is there a 65Tube-style BBC emulator available
On Sat, 2009-11-21 at 19:21 +0000, Michael Firth wrote:
[Handling Escape]
> My initial thought is to do the programmatic equivalent of "stty intr
> ^[", to get a Unix SIGINT from the Escape key, which I can then use to
> generate a BBC-like Escape behaviour. The only problem is it will mean
> you can no longer exit the program using "Ctrl-C", but I may be able to
> find a way around that too...
I've got next to no experience of this kind of Unix 'text mode
interaction' programming, but that sounds like a workable approach to
me. I think you could also do it by using the curses library in nodelay
mode, stopping the emulation every (say) n thousand cycles/instructions
and calling getch() to see if a key (and specifically escape) has been
pressed. (I don't know if curses would insist on managing the display
for you, although I'd hope you can tell it not to. I think it would be
better if you could have straightforward putchar()-style output. It
would certainly be easier to implement.)
> One other big benefit you'll probably get from the RPCEmu layer is some
> emulation of BBC Graphics, which may or may not be relevant to your
> application. I'm not sure there's an easy way around that problem, short
> of writing a full BBC Emulator, and then you might as well use BeebEm.
I realise that, but for my application I prefer the having a raw Unix
text terminal with history. In principle I guess you could intercept
control characters written via OSWRCH and draw to a suitably sized
bitmap which is shown in a window. This would be easier than a real
emulator as you only have to cope with legal control sequences, but as
you say it's probably better just to use a real BBC emulator if you care
about that sort of thing.
Cheers.
Steve