'*****************************************************************************
'* INT 10H AH=01h (CGA BIOS) SET CURSOR SIZE
'* Params: CH - top line
'*         CL - bottom line  
'*****************************************************************************

protected function Exec as boolean

//variables
dim lnTop as byte, lnBottom as byte, Port as word

//mask
lnTop=cpu.CH and 0x1F : lnBottom=cpu.CL and 0x1F

//write to mem
mem.Byte(0x460)=lnTop : mem.Byte(0x461)=lnBottom

//write to controller
Port=mem.Word(0x463) 'controller port
pc.WritePort(Port,0xA) : pc.WritePort(Port+1,lnTop)
pc.WritePort(Port,0xB) : pc.WritePort(Port+1,lnBottom)

//success
result=true : end