// GKPROC.SR Initiallize keyboard handler for GYPSY
get "BRAVO.DF";
// Incoming Procedures
external [
DisableInterrupts
EnableInterrupts
CreateKeyboard
swat;
array;
movestack;
loadcore;
move;
hplay
];
// Incoming Statics
external
[
linkCursorToMouse
Saved335
begofopsys
diskBitTable
diskBTsize
lastSN
LASTSN1
LASTSN2
BITTABLE
stackroot
ozone
]
// Outgoing Procedures
external [
initkbd
boot
getchar
endofkeystream
];
// Outgoing Statics
external [
SavedFinish
SavedKeyProcess
cominstream
];
// Local Statics
static [
SavedFinish
SavedKeyProcess
cominstream
];
manifest [
AdrAdrFinish=#353 //Holds address of finish code
bootCommand=#100000 // arg of StartIO to boot
KeyProcess=12
interruptVector = #500
keystreaml = 50;
]
let initkbd() be
[
cominstream = table [
0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;
0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;
0;0;0;0;0;0;0;0;0;0;
] ;
SavedKeyProcess = @(interruptVector+KeyProcess+1)
SavedFinish=@AdrAdrFinish //Save finish code
@AdrAdrFinish=boot+4 //On finish, try recovery
let stackspace = table [
0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0 ]
// ** begin GYPSY addition
let repeatable = table [ // see GKBD.SR for RKE explanation
// 0; 1; #2; 0; 0 // LF key
// 2; 1; #2; 0; 0 // DEL key
0; 0; #1; 0; 0 // BS key
1; 0; #1; 0; 0 // top blank key
] // also must mark "rept" in table of GKBD.SR
let lrepeatable = 10 ; // **
// ** END GYPSY ADDITION
CreateKeyboard(KeyProcess, stackspace,100, cominstream,keystreaml,
repeatable,lrepeatable) // **
linkCursorToMouse = true
]
and boot() be
[
let StartIO = table [ #61004 ; #1401 ] ;
StartIO(bootCommand)
swat("boot failed, please push manual boot button. ")
]
and getchar() = valof
[
let proc = cominstream >> STREAM.gets
resultis proc(cominstream)
]
and endofkeystream() = valof
[
let proc = cominstream >> STREAM.endof
resultis proc(cominstream)
]