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

2014-05-20 Thread Tomas Hajny
On Tue, May 20, 2014 12:10, nitinjain wrote:
> Thanks Tomas,
>
> Yes, I have allready followd the steps which you have given in last post
> (Video Unit), but it is throwing runtime error that is: *"Program Received
> Signal SIGSEGV Segmentation fault"*.

Have you managed to identify the exact code (line) giving the SIGESGV
(e.g. in debugger or at least by compiling with -gl)? Can you post your
(crashing) fully compilable source, so that others could check and test
it?

Tomas


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


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

2014-05-20 Thread nitinjain
Thanks Tomas,

Yes, I have allready followd the steps which you have given in last post
(Video Unit), but it is throwing runtime error that is: *"Program Received
Signal SIGSEGV Segmentation fault"*. 



--
View this message in context: 
http://free-pascal-general.1045716.n5.nabble.com/How-To-Rewrite-Replace-Below-MEM-And-MEMW-tp5719283p5719289.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


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

2014-05-20 Thread Tomas Hajny
On Tue, May 20, 2014 10:01, nitinjain wrote:


Hi Nitin,

> Could any one help on replacing or rewriting below MEM and MEMW function
> for
> 32  bit OS.
 .
 .
>   MEM[$B800:offset]:=top_left_corner[style];
 .
 .

Have you already tried the recommendations discussed in a recent thread
here (including my e-mail sent on the 12th of May)?

If yes, have you faced any issues which you need to resolve (which ones)?

If not, is there something unclear in the previous e-mails which prevents
you from using those recommendations and which you would need to clarify
first?

I'd be happy to help you, but I don't think that there's much on top of
the rather straightforward translation of the Mem and MemW references to
accesses of the VideoBuf pointer provided by unit Video which I already
tried to describe. As you probably understand, the only difference between
Mem and MemW in this context is the fact that in case of MemW you address
the whole TVideoCell word element whereas in case of Mem you only change
the upper or lower byte of that word. However, your code usually updates
the two bytes one after the other anyway, so you can combine the two
following Mem[] references to one assignment to VideoBuf^[]. If you need
more, you'd need to be clearer in your needs.

Regards

Tomas


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


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

2014-05-20 Thread nitinjain
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.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal