[fpc-pascal] Pointers

Steve Williams stevewilliams at kromestudios.com
Thu Jul 28 02:31:47 CEST 2005


Daniel Franzini wrote:
> BEGIN
>   InitGraph;
>     Screen := MEM[$A000];   { Set up the screen buffer pointer }
> <-----------here is the error
>   WHILE NOT KeyPressed DO
>     SetPixel(
>        RANDOM(320),     { Random X (Range 0-319)     }
>        RANDOM(200),     { Random Y (Range 0-199)     }
>        RANDOM(256));    { Random Color (Range 0-255) } 
>   CloseGraph;
> END.
> 
> </code>
> 
> the fact is that i want Screen to point to an specific memory area
> (0xA000) for writing to the display directly...but i can't figure out
> how to make this
> 
> i've tried the following options
> 
> @Screen := $A000; -> mode13h.pas(34,5) Error: Can't assign values to an address
> Screen := MEM[$A000]; -> mode13h.pas(34,15) Error: Identifier not found "MEM"

Have you tried

   Screen := ScreenBufferPtr($a000);


-- 
Sly


This message and its attachments may contain legally privileged or confidential information. This message is intended for the use of the individual or entity to which it is addressed. If you are not the addressee indicated in this message, or the employee or agent responsible for delivering the message to the intended recipient, you may not copy or deliver this message or its attachments to anyone. Rather, you should permanently delete this message and its attachments and kindly notify the sender by reply e-mail. Any content of this message and its attachments, which does not relate to the official business of the sending company must be taken not to have been sent or endorsed by the sending company or any of its related entities. No warranty is made that the e-mail or attachment(s) are free from computer virus or other defect.


More information about the fpc-pascal mailing list