| www.retrosoftware.co.uk http://www.retrosoftware.co.uk/forum/ |
|
| Problem with OSByte 121 http://www.retrosoftware.co.uk/forum/viewtopic.php?f=73&t=826 |
Page 1 of 1 |
| Author: | DaveF [ Tue May 07, 2013 11:17 pm ] |
| Post subject: | Problem with OSByte 121 |
Hi, I've got the following: Code: 10 DIM R 3 20 PROCasm 30 MODE 7 40 REPEAT 50 !R=USR(keyScan) 60 PRINT TAB(0,1) R?1 70 UNTIL FALSE 80 END 90 DEFPROCasm 100 FOR P=0 TO 2 STEP 2 110 P%=&900 120 [OPT P 130 .keyScan 140 LDA #121 150 LDX #0 160 JSR &FFF4 170 RTS 180 ] 190 NEXT P 200 ENDPROC The problem I'm having is while I get most keys back as expected (eg Z gives me 97), some keys such as U return 5, while CTRL and SHIFT don't do anything at all. Printing out the values at &EC and &ED also works as expected, although I've no idea if these locations work across all the BBC micros. I realise I'm probably doing something daft but can't fathom it tonight! EDIT That's interesting - Just tried it on the emulator here and pressing U gives me 53, yet on my real BBC at home it was 5... Weird |
|
| Author: | DaveF [ Wed May 08, 2013 10:16 pm ] |
| Post subject: | Re: Problem with OSByte 121 |
Well, here I am again, tried again on the OS X emulator and get the same results; works as expected. Having tried again on my real BBC, I still get 5 for the U key which baffles me. Everything works OK if I use OS_Byte 122 (ie X=16 on entry). I'm probably not understanding the documentation for OS_Byte 121, but it's strange that there's different results though between my real BBC and the emulators. Still, I do have a workaround so progress can continue |
|
| Author: | RichTW [ Thu May 09, 2013 10:14 pm ] |
| Post subject: | Re: Problem with OSByte 121 |
That's pretty weird... have you changed the startup links on the front of the keyboard? 5 means bit 4 of that (which controls disc drive timings), but I can't imagine why it might be overridden by pressing other keys on the keyboard (unless it's some kind of short circuit thing, like the way that pressing certain combinations of keys simultaneously acts as if a different key were pressed). Anyway, I think it's probably safest using OSBYTE 122, and then checking for SHIFT and CTRL specially (as I think they're handled as a special case in the OS anyway). Redefine keys option huh? You really are ahead of me |
|
| Author: | sweh [ Fri May 10, 2013 1:39 am ] |
| Post subject: | Re: Problem with OSByte 121 |
DaveF wrote: Having tried again on my real BBC, I still get 5 for the U key which baffles me. You should be getting &35 - which is ASCII for "5". Seems a coincidence... What do you get from Code: 10A%=121 20X%=0 30REPEAT 40PRINT ~(USR &FFF4 AND &FF00)/256 50UNTIL 0 I get 35 when I press 'U' on a real beeb and BeebEm |
|
| Author: | DaveF [ Fri May 10, 2013 2:09 pm ] |
| Post subject: | Re: Problem with OSByte 121 |
Cheers guys Interesting - I do have a RetroClinic BBC, so that might have some weirdness going on. I'll have another go tonight with it. I'll end up using OSByte 122 anyway I think, but it would be nice to get to the bottom of it. |
|
| Author: | DaveF [ Fri May 10, 2013 9:36 pm ] |
| Post subject: | Re: Problem with OSByte 121 |
sweh wrote: What do you get from Code: 10A%=121 20X%=0 30REPEAT 40PRINT ~(USR &FFF4 AND &FF00)/256 50UNTIL 0 Just the same, ie 5 My BBC is a Retroclinic one, I wonder if anything has gone on with that, there's extra LEDs on the front for PWR, USB1, USB2 and IDE. However, I know nothing about hardware stuff so I don't know if anything would make a difference. |
|
| Author: | sweh [ Sat May 11, 2013 12:43 pm ] |
| Post subject: | Re: Problem with OSByte 121 |
DaveF wrote: sweh wrote: What do you get from Code: 10A%=121 20X%=0 30REPEAT 40PRINT ~(USR &FFF4 AND &FF00)/256 50UNTIL 0 Just the same, ie 5 My BBC is a Retroclinic one, I wonder if anything has gone on with that, there's extra LEDs on the front for PWR, USB1, USB2 and IDE. However, I know nothing about hardware stuff so I don't know if anything would make a difference. I can't see it being a hardware issue, 'cos then the "U" key wouldn't be working, normally, to let you type in that listing Maybe one of the ROMs you've got plugged in is stealing OSB121 and breaking it? Maybe worth unplugging everything except the OS and BASIC and seeing how that works... |
|
| Author: | jgharston [ Mon May 13, 2013 10:26 pm ] |
| Post subject: | Re: Problem with OSByte 121 |
DaveF wrote: The problem I'm having is while I get most keys back as expected (eg Z gives me 97), some keys such as U return 5, while CTRL and SHIFT don't do anything at all. You can't read anything from row 0 (Shift, Ctrl, keyboard links) as OSBYTE 121 and 122 select a column and see if the interrupt line is set. Row 0 does not generate an interrupt - otherwise if any keyboard link was set there would be continuous interrupts.OSBYTE 121 and 122 are almost identical, the code is essentially: osbyte121: LDX #16 osbyte121: etc. (except that OSBYTE 121 vectors via KEYV). Real hardware will return the key values on page 142 and 143 in the Advanced BBC User Guide. |
|
| Page 1 of 1 | All times are UTC [ DST ] |
| Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |
|