::: Area #102 (BBC Echo) Message: #1297 (Read 1 time, has 0 replies, 1968 bytes) Date : Sun May 31 13:38:34 1998 From : Jonathan Graham Harston of fidonet#2:254/27 To : All Subject: Subject: Running a BBC Without A Keyboard JGH> I added the above code to HADFS, blew an EPROM and plugged it in. JGH> Switched on the machine without the keyboard... HADFS Startup banner JGH> appeared, and then sat there again, apparently waiting for Shift to JGH> be pressed. On pressing reset, it continues ok. So, there's just JGH> the Power-On Reset bit to solve. Oh, of course. I've called the NoKeyboardCheck routine /after/ trying to print the startup banners, so of course it going to hang. Quick tweek from: .Serv1 JSR StartupDisplay JSR CheckNoKeyboard to: .Serv1 JSR CheckNoKeyboard JSR StartupDisplay and it works. Shift/Ctrl pausing must be disabled /BEFORE/ any text is output. As an aside, the routine I'm suggesting checks if Osbyte255 is zero. If there is no keyboard, Osbyte255 will be zero, but that does not mean that if Osbyte255 if zero there is no keyboard. You could do *FX255,0 and then press Break which is a handy way of testing the routines, and checking for it is sufficiently robust for the use it's being used for. To /actually/ check for the presence of a keyboard you should do something that effectively does an INKEY on /all/ keys from -1 to -128. If /all/ return -1 (ie, pressed), then there is no keyboard. It's not possible for all keys to claim to be pressed when there is a keyboard plugged in (unless you have 70 fingers! 8) ). In Basic, it would be: DEFFNKeyboardPresent Key%=0 REPEAT Key%=Key-1 UNTIL (INKEY Key%)=0 OR Key%<-128 =Key%=-128 -- J.G.Harston (JGH BBC PD Library) 70 Camm Street, Walkley, SHEFFIELD S6 3TR BBC+Master / Z80+6502 / CoPro+Tubes / Econet+SJ / Devolution / Transport / Planning / Highways http://homepages.nildram.co.uk/~amilton/walkley.htm jgh@arcade.demon.co.uk (( Anti-UCE address added by Arcade, not by me )) --- ARCbbs RISC OS [1.64á32c] * Origin: Arcade - The Definitive Acorn BBS +44 181 655 4412 (2:254/27)