[fpc-pascal] How To Rewrite/Replace Below MEM And MEMW

nitinjain nitinmutha99 at gmail.com
Tue May 20 10:01:54 CEST 2014


Hi,
 
Could any one help on replacing or rewriting below MEM and MEMW function for
32  bit OS.

-------------------------------------------------------------

PROCEDURE draw_window_outline(top_left_x,
                              top_left_y,
                              width,
                              height,
                              style,
                              fore,
                              back      : BYTE);

VAR
   x,y    : BYTE;
   offset : INTEGER;


BEGIN
     IF (style<>255) AND (width>2) AND (height>2) THEN
     BEGIN
          offset:=(top_left_x-1)*2
                 +(top_left_y-1)*160;
          MEM[$B800:offset]:=top_left_corner[style];
          MEM[$B800:offset+1]:=back*16+fore;
          FOR x:=1 TO (width-2) DO
          BEGIN
               MEM[$B800:offset+x*2]:=horizontal[style];
               MEM[$B800:offset+x*2+1]:=back*16+fore;
          END;
          MEM[$B800:offset+(width-1)*2]:=top_right_corner[style];
          MEM[$B800:offset+(width-1)*2+1]:=back*16+fore;
          FOR y:=1 TO (height-2) DO
          BEGIN
               MEM[$B800:offset+y*160]:=vertical[style];
               MEM[$B800:offset+y*160+1]:=back*16+fore;
               MEM[$B800:offset+(width-1)*2+y*160]:=vertical[style];
               MEM[$B800:offset+(width-1)*2+y*160+1]:=back*16+fore;
          END;
          offset:=(top_left_x-1)*2
                 +(top_left_y+height-2)*160;
          MEM[$B800:offset]:=bottom_left_corner[style];
          MEM[$B800:offset+1]:=back*16+fore;
          FOR x:=1 TO (width-2) DO
          BEGIN
               MEM[$B800:offset+x*2]:=horizontal[style];
               MEM[$B800:offset+x*2+1]:=back*16+fore;
          END;
          MEMW[$B800:offset+(width-1)*2]:=bottom_right_corner[style];
          MEM[$B800:offset+(width-1)*2+1]:=back*16+fore;
     END;
END;

-----------------------------------------------------------
Regards,
Nitin



--
View this message in context: http://free-pascal-general.1045716.n5.nabble.com/How-To-Rewrite-Replace-Below-MEM-And-MEMW-tp5719283.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.



More information about the fpc-pascal mailing list