Skip to content
This repository has been archived by the owner on Nov 2, 2021. It is now read-only.

Latest commit

 

History

History
58 lines (39 loc) · 1.8 KB

readme.md

File metadata and controls

58 lines (39 loc) · 1.8 KB

Read Chars from the visible screen

(*
  Category: SWAG Title: SCREEN HANDLING ROUTINES
  Original name: 0105.PAS
  Description: Read Chars from the visible screen
  Author: AVONTURE CHRISTOPHE
  Date: 03-04-97  13:18
*)

{

   Read the character visible on the screen


               ╔════════════════════════════════════════╗
               ║                                        ║░
               ║          AVONTURE CHRISTOPHE           ║░
               ║              AVC SOFTWARE              ║░
               ║     BOULEVARD EDMOND MACHTENS 157/53   ║░
               ║           B-1080 BRUXELLES             ║░
               ║              BELGIQUE                  ║░
               ║                                        ║░
               ╚════════════════════════════════════════╝░
               ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░

}


Procedure ReadCar (X, Y : Word; Var Attr : Byte; Var Carac : Char);

Var
   Car      : ^char;
   Attribut : ^Byte;
   AdressP  : Word Absolute $0040:$004E; { Address of the screen page }

Begin

   New (car);  { Allocate memory for the character }

   { Get the character from the screen video memory -for the active video
     page- }

   Car := Ptr($B800,(Y*160 + X Shl 1 + AdressP Shl 12));

   Carac := car^;

   New (attribut); { Allocate memory for the character color attribute }

   { Get the color attribute of the character -for the active video page- }

   Attribut := Ptr($B800,(Y*160 + X Shl 1 + 1 + AdressP Shl 12));

   Attr := attribut^;

End;