Browse Source

tosunits: some more work on TOS bindings

git-svn-id: trunk@37788 -
Károly Balogh 7 years ago
parent
commit
775e83435e
3 changed files with 102 additions and 8 deletions
  1. 35 6
      packages/tosunits/src/aes.pas
  2. 65 2
      packages/tosunits/src/vdi.pas
  3. 2 0
      packages/tosunits/src/xbios.pas

+ 35 - 6
packages/tosunits/src/aes.pas

@@ -94,6 +94,27 @@ const
   HSLIDE  = $800;  { Window has a horizontal slider. }
   SMALLER = $4000; { Window has an iconifier. }
 
+{ messages as used by evnt_mesag() }
+const
+  WM_REDRAW     = $0014;
+  WM_TOPPED     = $0015;
+  WM_CLOSED     = $0016;
+  WM_FULLED     = $0017;
+  WM_ARROWED    = $0018;
+  WM_HSLID      = $0019;
+  WM_VSLID      = $001a;
+  WM_SIZED      = $001b;
+  WM_MOVED      = $001c;
+  WM_NEWTOP     = $001d;
+  WM_UNTOPPED   = $001e;
+  WM_ONTOP      = $001f;
+  WM_OFFTOP     = $0020;
+  WM_BOTTOMED   = $0021;
+  WM_ICONIFY    = $0022;
+  WM_UNICONIFY  = $0023;
+  WM_ALLICONIFY = $0024;
+  WM_TOOLBAR    = $0025;
+
 { message flags as used by evnt_multi() }
 const
   MU_KEYBD  = $0001; { Keyboard event }
@@ -141,8 +162,9 @@ function fsel_input(fs_iinpath: pchar; fs_iinsel: pchar; fs_iexbutton: psmallint
 function fsel_exinput(fs_einpath: pchar; fs_einsel: pchar; fs_eexbutton: psmallint; elabel: pchar): smallint;
 
 function wind_create(kind: smallint; x, y, w, h: smallint): smallint;
-function wind_delete(handle: smallint): smallint;
 function wind_open(handle: smallint; x, y, w, h: smallint): smallint;
+function wind_close(wi_clhandle: smallint): smallint;
+function wind_delete(handle: smallint): smallint;
 function wind_update(wi_ubegend: smallint): smallint;
 procedure wind_new;
 
@@ -487,11 +509,6 @@ begin
   wind_create:=crys_if($64);
 end;
 
-function wind_delete(handle: smallint): smallint;
-begin
-  _intin[0]:=handle;
-  wind_delete:=crys_if($67);
-end;
 
 function wind_open(handle: smallint; x, y, w, h: smallint): smallint;
 begin
@@ -503,6 +520,18 @@ begin
   wind_open:=crys_if($65);
 end;
 
+function wind_close(wi_clhandle: smallint): smallint;
+begin
+  _intin[0]:=wi_clhandle;
+  wind_close:=crys_if($66);
+end;
+
+function wind_delete(handle: smallint): smallint;
+begin
+  _intin[0]:=handle;
+  wind_delete:=crys_if($67);
+end;
+
 function wind_update(wi_ubegend: smallint): smallint;
 begin
   _intin[0]:=wi_ubegend;

+ 65 - 2
packages/tosunits/src/vdi.pas

@@ -138,8 +138,14 @@ procedure vdi;
 procedure vdi_str_to_pchar(src: psmallint; des: pchar; len: smallint);
 function pchar_str_to_vdi(src: pchar; des: psmallint): longint;
 
+procedure v_opnwk(work_in: psmallint; handle: psmallint; work_out: psmallint);
+procedure v_clswk(handle: smallint);
+
 procedure v_pline(handle: smallint; count: smallint; pxyarray: psmallint);
 
+procedure v_opnvwk(work_in: psmallint; handle: psmallint; work_out: psmallint);
+procedure v_clsvwk(handle: smallint);
+
 procedure v_get_pixel(handle: smallint; x: smallint; y: smallint;
                       pel: psmallint; index: psmallint);
 
@@ -195,9 +201,38 @@ begin
   pchar_str_to_vdi:=len-1;
 end;
 
+procedure v_opnwk(work_in: psmallint; handle: psmallint; work_out: psmallint);
+begin
+  // _intin[0..15] = work_in[0..15];
+  move(work_in^,_intin,16*sizeof(smallint));
+
+  _contrl[0]:=1;
+  _contrl[1]:=0;
+  _contrl[3]:=16;
+  _contrl[6]:=0;
+
+  vdi;
+
+  handle^:=_contrl[6];
+  // work_out[0..44] = intout[0..44];
+  // work_out[45..56] = ptsout[0..11];
+  move(_intout,work_out[0],45*sizeof(smallint));
+  move(_ptsout,work_out[45],12*sizeof(smallint));
+end;
+
+procedure v_clswk(handle: smallint);
+begin
+  _contrl[0]:=2;
+  _contrl[1]:=0;
+  _contrl[3]:=0;
+  _contrl[6]:=handle;
+
+  vdi;
+end;
+
 procedure v_pline(handle: smallint; count: smallint; pxyarray: psmallint);
 begin
-  //  _ptsin[0..2*count-1] = pxyarray[0..2*count-1];
+  // _ptsin[0..2*count-1] = pxyarray[0..2*count-1];
   move(pxyarray^,_ptsin,count*2*sizeof(smallint));
 
   _contrl[0]:=6;
@@ -208,6 +243,35 @@ begin
   vdi;
 end;
 
+procedure v_opnvwk(work_in: psmallint; handle: psmallint; work_out: psmallint);
+begin
+  // _intin[0..10] = work_in[0..10];
+  move(work_in^,_intin,11*sizeof(smallint));
+
+  _contrl[0]:=100;
+  _contrl[1]:=0;
+  _contrl[3]:=11;
+  _contrl[6]:=handle^;
+
+  vdi;
+
+  handle^:=_contrl[6];
+  // work_out[0..44] = intout[0..44];
+  // work_out[45..56] = ptsout[0..11];
+  move(_intout,work_out[0],45*sizeof(smallint));
+  move(_ptsout,work_out[45],12*sizeof(smallint));
+end;
+
+procedure v_clsvwk(handle: smallint);
+begin
+  _contrl[0]:=101;
+  _contrl[1]:=0;
+  _contrl[3]:=0;
+  _contrl[6]:=handle;
+
+  vdi;
+end;
+
 procedure v_get_pixel(handle: smallint; x: smallint; y: smallint;
                       pel: psmallint; index: psmallint);
 begin
@@ -226,5 +290,4 @@ begin
 end;
 
 
-
 end.

+ 2 - 0
packages/tosunits/src/xbios.pas

@@ -19,6 +19,8 @@ interface
 { The API description of this file is based on the information available
   online at: http://toshyp.atari.org }
 
+function xbios_getrez: longint; syscall 14 4;
+
 function xbios_random: longint; syscall 14 17;
 
 implementation