'*****************************************************************************
'* INT 10H AH=0Dh (VGA BIOS) READ PIXEL
'* Params: CX - X coord
'*         DX - Y coord
'* Result: AL - Color
'*****************************************************************************

use module "Tools" 'cga tools

protected function Exec as boolean

//params
dim x as word=cpu.CX, y as word=cpu.DX, color as byte
dim page as byte=mem.Byte(0x462) : if page>7 then exit(false)

result=ReadPixel(Page,x,y,color) : if not(result) then exit(false)
cpu.AL=color

end