changeset 396:00b1c751fad7

Added WInfo
author boisy
date Mon, 26 Aug 2002 13:25:25 +0000
parents 35d038fa4f85
children 11db60dd6366
files 3rdparty/utils/winfo/defsfile 3rdparty/utils/winfo/makefile 3rdparty/utils/winfo/winfo.asm 3rdparty/utils/winfo/winfo.doc 3rdparty/utils/winfo/winfodefs 3rdparty/utils/winfo/witesta.asm 3rdparty/utils/winfo/witestb.b09
diffstat 7 files changed, 1381 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/3rdparty/utils/winfo/defsfile	Mon Aug 26 13:25:25 2002 +0000
@@ -0,0 +1,3 @@
+Level	equ	2
+	use	os9defs
+	use	scfdefs
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/3rdparty/utils/winfo/makefile	Mon Aug 26 13:25:25 2002 +0000
@@ -0,0 +1,19 @@
+include ../../../Makefile.rules
+
+DEPENDS		= ./Makefile
+
+CMDS		= witesta
+SUBS		= winfo
+
+ALLOBJS		= $(CMDS) $(SUBS)
+
+all:	$(ALLOBJS) $(DEPENDS)	
+	@$(ECHO) "*********************************************"
+	@$(ECHO) "*                                           *"
+	@$(ECHO) "*                WInfo Utility              *"
+	@$(ECHO) "*                                           *"
+	@$(ECHO) "*********************************************"
+ 
+clean:
+	$(RM) $(ALLOBJS)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/3rdparty/utils/winfo/winfo.asm	Mon Aug 26 13:25:25 2002 +0000
@@ -0,0 +1,734 @@
+         nam   WInfo
+         ttl   OS9 Level II sub to get window information - Ron Lammardo 
+
+*
+* 11/22/87 - Edition #1 - for OS9 Level II V02.00.01
+* 12/22/95 - Edition #2 - for ALL versions of OS-9 by Alan DeKok
+*
+
+         ifp1
+         use   defsfile
+         endc
+
+typelang set   sbrtn+objct
+attrev   set   reent+revision
+revision set   1
+
+         mod   Eom,Mname,Typelang,Attrev,Start,Datend
+
+mname    fcs   /WInfo/
+edition  fcb   2 edition
+
+         org   0
+         use   winfodefs
+
+         org   0
+stackadr rmb   2 stack address for return
+de       rmb   1 device table entry #
+sctype   rmb   1 screen type
+offset   rmb   2 screen start offset in block
+datimg   rmb   2 address of sys DAT image in sysprc
+datadr   rmb   2 address of sys DAT in system
+entry    rmb   2 address of currently proccessed window entry
+wnum     rmb   1 window entry number
+scrblock rmb   1 block # containing screen mem
+blockcnt rmb   1 # of blocks in screen
+wstart   rmb   2 x,y coordinates of window start on screen
+wsize    rmb   2 x,y size of window
+cwstart  rmb   2 x,y coordinates of current working area
+cwsize   rmb   2 x,y size of current working area
+paramadr rmb   2 address of window name to dump
+paramln. rmb   1
+paramln  rmb   1 size of window name to dump
+vdgadr   rmb   2 address of vdg screen
+vdgflag  rmb   1 vdg screen flag (1=yes)
+scrnaddr rmb   2 address of screen
+d$devtbl rmb   2 address of device table
+mdname   rmb   2 adress of module name
+drvnam   rmb   2 address of device driver name
+buffaddr rmb   2 address of return packet 
+buffln.  rmb   1 dummy byte
+buffln   rmb   1 length of return packet..must be > WI$size
+weaddr   rmb   2 logical address of window entry insys map  (debugging only)
+devmaddr rmb   2 device static storage entry in sys map  (debugging only)
+fgc      rmb   1 foreground color
+bgc      rmb   1 background color
+bdc      rmb   1 border color
+curx     rmb   1 x coordinate of cursor
+cury     rmb   1 y coordinate of cursor
+bpr      rmb   2 bytes per row
+stymark  rmb   1 screen type marker byte
+paltaddr rmb   2 address of palette registers
+msb      rmb   1 working field - msb for 2 digit mults
+lsb      rmb   1 working field - lsb for 2 digit mults
+lset     rmb   1 logic set #
+psetgb   rmb   2 pset group/buffer
+fontgb   rmb   2 font group/buffer
+gcurgb   rmb   2 gfx cursor group/buffer
+minidat  rmb   2 temp dat for cpymem
+bfngrp   rmb   2 buffer #/group return
+drawcrsr rmb   4 draw cursor position - xxyy
+sysdat   rmb   16 system DAT image
+devname  rmb   5 device descriptor name
+devtable rmb   9 device table entry
+devmem   equ   .   device memory copy
+sc       rmb   32 screen table
+we       rmb   64 window entry
+         rmb   32 filler so we got 128 bytes for dev memory
+datend   equ   .
+
+E$Param  equ   $38 bad Parameter error
+
+cc3io    fcs   /CC3IO/ used to compare device driver name
+
+tmpdat   fcb   0,0 mini-dat image for block 0 data fetches
+
+blnkpalt fcb   $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
+         fcb   $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
+
+stytable fcb   $01,$03,$03,$0f
+blktable fcb   1,1,0,0,2,2,4,4
+ 
+errmsg1  equ   *
+         fcc   /Requested device not in device table/
+errm1ln  equ   *-errmsg1
+errmsg2  fcc   /Requested device is not CC3IO/
+errm2ln  equ   *-errmsg2
+errmsg3  fcc   /Can not access window until written to/
+errm3ln  equ   *-errmsg3
+
+start    equ   *
+         pshs  u,dp save registers
+         tfr   s,d put in 'd' for computations
+         clrb  clear lsb
+         suba  #1 bump down page to make sure we don't conflict
+         tfr   a,dp now set direct page
+         tfr   d,u and set u register
+         sts   <stackadr save address of stack
+         leax  stackadr+2,u start adrress of bytes to init
+         ldb   #devtable end addr..# of bytes to clear
+         lda   #$ff fill character
+         lbsr  zapblock init the characters
+
+* get passed parameters
+
+         ldx   5,s # of parameters
+         cmpx  #2 do we have two params?
+         lbne  badparms no...error
+         ldx   7,s 1st param addr (window name addr)
+         stx   <paramadr save the window name addr
+         os9   F$PrsNam get end of name
+         lbcs  exit exit on error
+         clra clear msb
+         std   <paramln. save window name length
+         ldx   11,s 2nd param addr (buffer addr)
+         stx   <buffaddr save the buffer address
+         ldx   13,s 2nd param length
+         stx   <buffln. save the buffer length address
+         cmpx  #WI$Size check if buffer big enough
+         lblo  smllbuff no..send buffer to small status
+
+* clear return buffer
+
+         ldx   <buffaddr address of return buffer
+         ldb   #WI$ermsg end address to init
+         lda   #$ff fill char
+         lbsr  zapblock zap the block
+         ldb   #40 # of bytes to init
+         lda   #$20 space fill
+         lbsr  zapblock zap the message
+
+* get system process descriptor for sys DAT image
+
+         leax  tmpdat,pcr addr of sys mini-dat
+         tfr   x,d put it in d
+         ldx   #$004C Addr of dat image in system direct page
+         ldy   #2 2 bytes to get
+         pshs  u save u
+         leau  datadr,u addr of receiver
+         os9   F$CpyMem get it
+         puls  u restore u
+         lbcs  exit exit on error
+         leax  tmpdat,pcr addr of sys mini-data
+         tfr   x,d put it in d
+         ldx   datadr,u physical addr of sys DAT in sys addr map
+         pshs  u save u
+         leay  sysdat,u addr of receiver
+         sty   <datimg save it for later
+         tfr   y,u put in u for call
+         ldy   #16+16+1 16 bytes to get in image
+         os9   F$CpyMem get it
+         puls  u restore u
+         lbcs  exit and exit on error
+
+         ldx   <datimg      get ptr to system DAT image
+         lda   16+16,x      grab Level III SCF map info
+         beq   not.l3
+         sta   3,x
+         inca
+         sta   5,x
+
+* get offset in system map to device tables
+not.l3   ldy   #2 2 bytes to get
+         ldd   <datimg addr of sys DAT image
+         ldx   #D.DevTbl addr of device table addr
+         pshs  u save u
+         leau  d$devtbl,u addr of reciever
+         os9   F$Cpymem get it
+         puls  u restore u
+         lbcs  exit exit on error
+         clr   <de clear device table entry #
+         ldx   d$devtbl,u addr of device table
+         leax  -$0D,x back off one entry for increment in loop
+         stx   d$devtbl,u and save it again
+         leax  devtable,u get the addr of our copy of devtable
+         stx   <entry save the entry addr for later
+
+* just do an I$Attach instead of rooting through the device table
+
+         lda   #READ.     read-only permissions
+         ldx   <paramadr  point to window name
+         pshs  u          save for later
+         OS9   I$Attach   get U=address of device table entry
+         puls  x          kill end of device name pointer
+         lbcs  error1     exit on error
+
+         OS9   I$Detach   so link count is correct
+         exg   x,u        now U=memory, and X=ptr to device table entry
+
+         leay  devtable,u addr of reciever
+         pshs  u save u
+         tfr   y,u put reciever addr in u
+         ldy   #9 copy table entry
+         ldd   <datimg addr of sys DAT image
+         os9   F$Cpymem get it
+         puls  u restore u
+         lbcs  exit exit on error
+         leax  devtable,u
+         lda   V$USRS,x test for entry in use
+         lbeq  error3 if not in use...give out error saying so
+
+* Alan DeKok's mod: lots of code removed here
+
+* get driver name offset
+
+         ldx   <entry get device entry address
+         ldx   V$DRIV,x get driver module start addr
+         leax  M$Name,x get addr of module name
+         ldy   #2 get 2 bytes
+         ldd   <datimg addr of sys DAT image
+         pshs  u save u
+         leau  mdname,u addr of reciever
+         os9   F$CpyMem get it
+         puls  u restore u
+         lbcs  exit exit on error
+
+* now get actual driver name
+
+         ldx   <entry addr of deice entry
+         ldd   V$DRIV,x driver module start addr
+         addd  mdname,u + module offset to driver name
+         tfr   d,x put it in x so we can grab it
+         ldy   #5 5 bytes in name (CC3IO)
+         ldd   <datimg addr of sys DAT image
+         pshs  u save u
+         leau  devname,u addr of receiver
+         os9   F$CpyMem get it
+         puls  u restore u
+         lbcs  exit exit on error
+
+* we got the requested device...now see if its cc3io
+
+         ldb   #5 5 bytes to compare
+         leax  cc3io,pcr get addr of 'CC3IO'
+         leay  devname,u get addr of the driver nam
+         os9   F$CmpNam see if they're the same
+         lbcs  error2 if not-skip to next entry
+  
+* get the device static storage
+
+         ldx   <entry addr of device entry
+         ldd   V$STAT,x addr of static storage
+         tfr   d,x put in x so we can get it
+         stx   <devmaddr save device mem addr
+         ldd   <datimg addr of sys DAT image
+         ldy   #$80 bytes to get
+         pshs  u save u
+         leau  devmem,u addr of receiver
+         os9   F$CpyMem get it
+         puls  u restore u
+         lbcs  exit exit on error
+
+* get the window entry number
+
+         leax  devmem,u addr of device mem
+         lda   $35,x offset to window entry #
+         sta   wnum,u save it
+
+* check if its a vdg screen
+         
+         clr   <vdgflag else clear the flag
+         leax  devmem,u addr of device memory
+         lda   6,x offset to window type
+         anda  #$80 check the high bit
+         lbeq  vdgscrn if not set,its a vdg screen so jump
+  
+* get actual window entry
+
+         lda   wnum,u window entry #
+         ldb   #64 window entry size
+         mul  find offset
+         addd  #$1280 add it to start of window entrys
+         std   <weaddr save window entry address
+         tfr   d,x put in x so we can get it
+         ldy   #64 64 bytes to get in window entry
+         ldd   <datimg addr of sys DAT image
+         pshs  u save u
+         leau  we,u addr of receiver
+         os9   F$CpyMem get it
+         puls  u restore u
+         lbcs  exit exit on error
+
+
+* check if window ok
+ 
+         lda   we,u check msb of screen table address
+         cmpa  #$ff is it valid ???
+         lbeq  error3 send error message
+
+* get screen table entry
+
+         ldx   we,u address of screen table
+         ldy   #32 32 bytes in screen table
+         ldd   <datimg addr of sys DAT image
+         pshs  u save u
+         leau  sc,u addr of receiver
+         os9   F$CpyMem get it
+         puls  u restore u
+         lbcs  exit exit on error
+         leax  sc,u address of screen table
+         ldb   5,x border prn
+         stb   <bdc save it
+         ldb   ,x screen type
+         stb   <stymark
+
+* remove bias to get actual screen type
+
+         cmpb  #$80 
+         bls   lowtype
+         ldb   #4 4 = 16 colors possible
+         stb   <stymark make that the screen type marker
+         ldb   #$87
+         subb  ,x
+         bra   getblock
+lowtype  equ   *
+         addb  #4
+getblock equ   *
+         stb   <sctype save the screen type
+         decb decrement for indexing
+         leax  blktable,pcr address of block count table
+         lda   b,x get block count (via indexing table)
+         sta   <blockcnt save it
+         leax  sc,u address of screen table
+         lda   1,x get first block used
+         sta   <scrblock save it
+         leax  16,x address of palettes
+         stx   <paltaddr save it for later
+         leax  we,u addr of window entry
+
+* get screen start in block
+
+         leax  $34,x screen start
+         lda   ,x+ get msb
+         suba  #$80 ?????
+         ldb   ,x+ get lsb
+         std   <offset save screen offset
+         ldy   ,x++ get screen start coordinates
+         sty   <wstart save them
+         ldd   ,x++ get screen size (x,y)
+         std   <wsize save it
+         leax  we,u get start of window entry
+         leax  5,x addr of cwarea start
+         ldy   ,x++ working area start coordinates
+         sty   <cwstart save them
+         ldd   ,x++ working area size coordinates
+         std   <cwsize save them
+         cmpd  <wsize see if its same as total window size
+         beq   getbpr if it is,skip next section
+
+* adjust block offset to take change working area into account
+
+         clr   <msb clear temp area
+         lda   <cwstart x offset of area
+         lsla  multiply by 2 for attribute bytes
+         sta   <lsb save it
+         lda   <cwstart+1 y offset of area
+         lsla  multiply by 2 for attribute bytes
+         ldb   <wsize x-size of window
+         mul  mulitply
+         addd  <msb add x offset of area
+         addd  <offset add original block offset
+         std   <offset save new block offset
+
+* get # of bytes per row and cursor coordinates
+
+getbpr   equ   *
+         ldx   #$1075 address of gfx table start pointer
+         ldy   #2 # of bytes to get
+         ldd   <datimg addr of sys DAT image
+         pshs  u save u
+         leau  msb,u addr of receiver
+         os9   F$Cpymem get it
+         puls  u restore u
+         lbcs  exit exit on error
+         lda   <wnum get window entry number
+         ldb   #$12 size of gfx table entry
+         mul get the offset to start of our gfx window entry
+         addd  #1 add 1 for draw cursor start
+         ldx   <msb load addr of table start
+         leax  d,x and add offset
+         ldy   #4 get 4 bytes
+         ldd   <datimg addr of sys DAT image
+         pshs  u save u
+         leau  drawcrsr,u addr of receiver
+         os9   F$Cpymem get it
+         puls  u restore u
+         lbcs  exit exit on error
+
+         clr   <curx clear fields
+         clr   <cury
+         leax  we,u address of window entry
+         ldd   $14,x butes per row
+         std   <bpr save bytes per row
+
+* get foreground/background prn's
+
+         leay  stytable,pcr addr of screen type mask table
+         ldb   <stymark get sty marker byte
+         decb decrement for indexing
+         leay  b,y addr of mask (via indexing)
+         ldd   $16,x get fore/back palette #'s
+         anda  ,y strip of bias againt mask
+         andb  ,y
+         sta   <fgc save foreground prn
+         stb   <bgc save background prn
+
+         lda   $1A,x logic set #
+         sta   <lset save it
+         lda   $1B,x block # of font
+         ldy   $1C,x block offset of font
+         lbsr  fetchit get group/buffer of font
+         std   <fontgb save it
+         lda   $1E,x block # of pset
+         ldy   $1F,x block offset of pset
+         leay  -$20,y back off to get header start of pset
+         lbsr  fetchit get group/buffer of pset
+         std   <psetgb save it
+         lda   $28,x block # of gfx cursor
+         ldy   $29,x block offset of gfx cursor
+         lbsr  fetchit get group/buffer of gfx cursor
+         std   <gcurgb save it
+
+         ldd   $0B,x cursor logical address
+         subd  3,x subtract screen logical start
+         lbra  getcrps get x,y cursor coords
+
+* get block number and offset in block for VDG type screen
+
+vdgscrn  equ   *
+         leax  blnkpalt,pcr address of $ff's for vdg palettes
+         stx   <paltaddr save the addr
+         lda   #$ff fill char
+         sta   <fgc no palettes for vdg screen
+         sta   <bgc
+         sta   <bdc
+         lda   #1 vdgflag=1
+         sta   <vdgflag
+         sta   <blockcnt 1 block in screen
+         clra
+         clrb
+         std   <wstart window starts at 0,0
+         std   <cwstart
+         clr   <sctype  screentype = 0
+         leax  devmem,u address of device memory
+         ldd   $38,x logical screen start addr
+         std   vdgadr,u msb of vdg address
+         lsra  divide by 16
+         lsra
+         lsra
+         lsra
+         lsra  divide by 2
+         inca  add 1
+         lsla  multiply by 2
+         deca  subtract 1
+         ldx   <datimg addr of sys DAT image
+         ldb   a,x add on block # in map and get the physical block
+         stb   <scrblock save it
+         ldd   vdgadr,u get the physical screen address
+         anda  #%00011111 strip off block # bias
+         std   <offset save offset within block
+         ldd   #$2010 32 * 16 screen
+         std   <cwsize save it
+         std   <wsize save it
+         clr   <curx clear cursor offset counters
+         clr   <cury
+         ldd   #$0020 32 bytes/row
+         std   <bpr save it
+         leax  devmem,u address of device memory
+         ldd   $3C,x cursor address
+         subd  $38,x screen address
+
+getcrps  equ   *
+         cmpd  <bpr are we done getting row?
+         blo   gotycur yes..skip this
+         subd  <bpr subtract bytes/row
+         inc   <cury increment row #
+         bra   getcrps and check for more
+
+gotycur  equ   *
+         stb   <curx save y cursor pos
+         tst   <vdgflag is it vdg screen??
+         bne   savexcur yes..more processing
+         lda   <sctype get screen type to determine divisor
+         cmpa  #5 is it type 5 screen???
+         beq   gotxcur  go save x cursor position
+         lsrb  divide by two to get actual offset
+         cmpa  #8 is it type 7 screen???
+         bne   gotxcur go save x cursor position
+         lsrb  divide by two again
+
+gotxcur  equ   *
+         stb   <curx save y cursor pos
+         lbra  retbuffr go return buffer
+
+savexcur equ   *
+         leax  devmem,u address of device mem
+         lda   $37,x screen # on display
+         bne   chkmedrs if not 0 then its medium or hi res
+         tst   $45,x test med-res flag
+         lbeq  retbuffr its not hi-res gfx
+
+chkmedrs equ   *
+         ldb   #3 3 bytes per screen table entry
+         mul  get screen table offset
+         leax  $4A,x start of screen tables
+         leax  b,x offset for screen #
+         inc   <vdgflag =2 for med-res gfx
+         clr   <offset screen starts at begin of block
+         clr   <offset+1
+         lda   ,x+ get start block
+         sta   <scrblock save it
+         lda   ,x+ get block count
+         lbne  vdghires if there its a hi-res
+         ldx   #$0180 BPR for med-res vdg screen
+         stx   <bpr save it for later
+         lda   #%00010000 default mode of 1
+         leax  devmem,u get start of device mem again
+         tst   $3f,x screen mode
+         bpl   vdgtyp1 if its is..go save it
+         clra  make the mode=0
+
+vdgtyp1  equ   *
+         ora   $66,x foreground color
+         sta   <sctype thats our screen type
+         lbra  retbuffr go return buffer
+
+* hi res vdg screen
+      
+vdghires equ   *
+         sta   <blockcnt save the block count
+         lda   ,x get the screen type
+         sta   <sctype save it
+         ldy   #$2818 sizex/sizey for screen type 0,1,2
+         ldx   #$0280 BPR for screen type 0,1,2
+         cmpa  #2 is screen type <= 2
+         bls   vdgbpr if yes..go save BPR
+         ldy   #$5018 BPR for screen types 3,4
+         ldx   #$0500 BPR for screen types 3,4
+ 
+vdgbpr   equ   *
+         sty   <wsize save the size
+         sty   <cwsize same for current working size
+         stx   <bpr save the bytes per row
+         leax  devmem,u get address of device mem again
+         leax  $6B,x address of palettes
+         stx   <paltaddr save it for later
+         inc   <vdgflag =3 (hi res vdg)
+         lbra  retbuffr
+         
+* dump the screen
+
+retbuffr equ   *
+         ldx   <buffaddr address of return buffer
+         clra
+         sta   WI$stat,x status is ok (=0)
+         lda   <vdgflag
+         sta   WI$vdg,x
+         lda   <sctype
+         sta   WI$sty,x
+         lda   <scrblock
+         sta   WI$block,x
+         lda   <blockcnt
+         sta   WI$blcnt,x
+         ldd   <offset
+         std   WI$offst,x
+         lda   <wstart
+         sta   WI$cpx,x
+         lda   <wstart+1
+         sta   WI$cpy,x
+         lda   <wsize
+         sta   WI$szx,x
+         lda   <wsize+1
+         sta   WI$szy,x
+         lda   <cwstart
+         sta   WI$cwcpx,x
+         lda   <cwstart+1
+         sta   WI$cwcpy,x
+         lda   <cwsize
+         sta   WI$cwszx,x
+         lda   <cwsize+1
+         sta   WI$cwszy,x
+         lda   <curx
+         sta   WI$curx,x
+         lda   <cury
+         sta   WI$cury,x
+         ldd   <bpr
+         std   WI$bpr,x
+         leay  we,u
+         lda   $19,y
+         sta   WI$cbsw,x
+         lda   <bdc
+         sta   WI$bdprn,x
+         lda   <fgc
+         sta   WI$fgprn,x
+         lda   <bgc
+         sta   WI$bgprn,x
+         lda   <lset
+         sta   WI$Lset,x
+         ldd   <fontgb
+         sta   WI$FntGr,x
+         stb   WI$FntBf,x
+         ldd   <psetgb
+         sta   WI$PstGr,x
+         stb   WI$PstBf,x
+         ldd   <gcurgb
+         sta   WI$GcrGr,x
+         stb   WI$GcrBf,x
+         ldd   <drawcrsr
+         std   WI$DrCrx,x
+         ldd   <drawcrsr+2
+         std   WI$DrCry,x
+         lda   edition,pcr
+         sta   WI$Edtn,x
+         ldd   <weaddr
+         std   WI$weadr,x
+         ldd   <devmaddr
+         std   WI$devm,x
+         leay  WI$pregs,x addr of where to move palettes to
+         ldx   <paltaddr addr of palettes
+         ldd   #16 16 bytes to move
+         lbsr  u$movexy move it
+         bra   clrexit done so return from sub
+
+badparms equ   *
+         ldb   #E$Param bad parameter error
+         bra   exit go return it
+
+clrexit  clrb  no error..clear b reg
+exit     equ   *
+         lds   <stackadr restore stack
+         puls  u,dp restore u and dp registers
+         clra  clear carry bit
+         tstb
+         beq   return
+         coma  set carry bit
+return   equ   *
+         rts
+
+zapblock equ   *
+         sta   ,x+
+         decb
+         bne   zapblock
+         rts
+
+* fetch 2 bytes from block [a] at offset [y]+3
+
+
+
+fetchit  equ   *
+         clr   <minidat
+         sta   <minidat+1
+         bne   fetchok jump if valid block #
+         clra else clear group #
+         clrb clear buffer #
+         rts
+        
+fetchok  equ   *
+         pshs  x save x
+         leax  3,y poistion to group #
+         tfr   x,d put in d for arithmetic
+         anda  #%00011111 strip off hig order bytes
+         tfr   d,x and put back in x
+         leay  minidat,u adr of temp DAT image
+         tfr   y,d put in d for os9 call
+         ldy   #2 bytes to get
+         pshs  u save u
+         leau  bfngrp,u addr of receving field
+         os9   F$Cpymem get it
+         puls  u restore u
+         lbcs  exit exit on error
+         ldd   <bfngrp put it in d for return
+         puls  x restore x
+         rts
+
+* move [d] bytes from [x] to [y]
+ 
+u$movexy pshs  u
+         tfr   d,u
+movexy10 lda   ,x+
+         sta   ,y+
+         leau  -1,u
+         cmpu  #0
+         bne   movexy10
+         puls  u,pc
+
+error1   equ   *
+         ldb   #1 error number
+         pshs  b save error #
+         leax  errmsg1,pcr address of error msg
+         ldd   #errm1ln length of error message
+         bra   moverr go move it
+
+error2   equ   *
+         ldb   #2 error number
+         pshs  b save error #
+         leax  errmsg2,pcr address of error msg
+         ldd   #errm2ln length of error message
+         bra   moverr go move it
+
+error3   equ   *
+         ldb   #3 error number
+         pshs  b save error #
+         leax  errmsg3,pcr address of error msg
+         ldd   #errm3ln length of error message
+         bra   moverr go move it
+
+moverr   equ   *
+         ldy   <buffaddr address of return buffer
+         leay  WI$ErMsg,y address of error message
+         lbsr  u$movexy
+         puls  b
+
+storstat equ   *
+         ldy   <buffaddr address of return buffer
+         stb   WI$Stat,y  save the status byte  
+         lbra  clrexit done
+
+
+smllbuff equ   *
+         ldb   #$ff buffer too small status #
+         bra   storstat go store status # and exit
+
+
+         emod
+eom      equ   *
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/3rdparty/utils/winfo/winfo.doc	Mon Aug 26 13:25:25 2002 +0000
@@ -0,0 +1,101 @@
+  WInfo - v2.0 by Alan DeKok
+          Minor modifications to make WInfo use the I$Attach system call
+          to find the device table entry of the window in question.
+          The old WInfo rooted through system memory by hand, and used
+          a FIXED device table size which broke under NitrOS-9 v1.22
+
+          This corrected version will work properly under ANY version
+          of OS-9 or NitrOS-9, past, present, or future.
+
+          NitrOS-9 Level III patches by request of Erik Tromp, thanks!
+
+  WInfo - v1.0 copyright December,1987 by Ron Lammardo
+          Placed in the Public Domain December,1987
+          This subroutine may not be sold or used in any commercial package
+          without the permission of the author.
+
+WInfo is an OS9 Level II subroutine to return window information on any
+window in use. Although WInfo is written in ASM, it is set up to be callable
+from an ASM, Basic09, and (hopefully) C main programs. This subroutine directly
+accesses system window tables, screen tables, and device memory. As such, if a
+new level/version of OS9 were to be released, the subroutine module would
+possibly need to be re-written. However, by putting all the 'cheating' code
+into this subroutine, any applications program calling it would not need
+modification or re-assembling. To further ensure upward compatability between 
+editions of WInfo, a sizable amount of space is allocated in the return buffer 
+to allow additional fields to be added without impacting the position of 
+existing fields.
+
+ WInfo requires two parameters : a string containing the requested device
+name, and a return buffer (described below) to place the information into. To
+maintain compatability with basic09, the sizes of these two parameters along
+with the parameter count (always 2) must be passed if the calling program is
+ASM. WInfo also requires 512 bytes for its own use...ASM calling programs 
+should allow at least that much buffer space just below the stack address at
+the time of call.
+
+If WInfo encounters a system-type error, it will return with the carry bit
+set and the b register containing the appropriate error code. If a WInfo error
+condition is encountered, the first byte of the return buffer (WI$Stat) will
+contain the error number and the error message will be returned at the end of
+the buffer (WI$ErMsg). If the length of the buffer passed to WInfo is too
+small, the error status returned (WI$Stat) will be $FF with no error message,
+as the error message is normally placed at the end of the return buffer. 
+
+WInfo also returns its edition # (the byte after the module name) as part of
+the return packet (WI$Edtn). This edition # can be checked to determine if the
+correct minimum level of WInfo is being accessed by the main program. For
+example, if WInfo edition #4 is the first edition to return the # of users
+accessing a window, the main program could check the edition # to insure it
+was accessing WInfo edition #4 or higher, as any earlier edition would not
+return the needed information.
+
+Most of the return packet fields are self-explanitory, but a few might need 
+further clarification.
+
+WI$BPR - bytes per row. This is the number of bytes making up a line of
+         charactrers, not the number of bytes in 1 dot row. To get the number
+         of bytes per dot row,divide by 8.
+
+WI$Lset- Logic set # - see OS9 Level II manual page 3-21 in the winows section.
+
+WI$VDG - VDG type screen indicator. The following values are possible:
+    0 = Non-vdg type screen 
+    1 = VDG text type screen
+    2 = VDG medium-res (coco2) graphics screen - WI$Sty contains the screen
+        mode in the first 4 bits and the foreground color in the last 4 bits.
+        The modes and colors are fully described in the OS9 Level-II manual
+        pages B-5 & B-6 of the command reference.
+    3 = VDG hi-res (coco3) graphics screen - WI$Sty contains the screen type as
+        defined in the SS.AScrn Set Status call. This is the only VDG code
+        which will return valid palette information (WI$PRegs).
+
+        The following fields are never valid for VDG type screens:
+
+           WI$CBsw  - character binary switch bits
+           WI$BDPRN - Border palette register number
+           WI$FGPRN - Foreground palette register number
+           WI$BGPRN - Background palette register number
+           WI$Lset  - Logic set number
+           WI$FntGr - Active font group number
+           WI$FntBf - Active font buffer number
+           WI$PstGr - Pattern set group number
+           WI$PstBf - Pattern set buffer number
+           WI$GcrGr - Gfx cursor group number
+           WI$GcrBf - Gfx cursor buffer number
+           WI$DrCrx - Draw cursor x position
+           WI$DrCry - Draw cursor y position
+
+
+-------------------------------------------------------------------------------
+ 
+This subroutine is available for use by any and all for whatever application.
+Comments and suggestions for improvements/enhancements are greatly appreciated.
+However,due to the nature of the subroutine I would appreciate retaining
+control of any update issuances so that the edition numbers etc. stay
+controlled.
+
+Ron Lammardo
+75706,336
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/3rdparty/utils/winfo/winfodefs	Mon Aug 26 13:25:25 2002 +0000
@@ -0,0 +1,55 @@
+
+*
+*  WInfo subroutine return packet definitions
+*
+*  11/22/87 - First Edition (Ron Lammardo)
+
+WInfoBuf equ  .
+WI$Stat  rmb  1 status from WInfo call
+WI$VDG   rmb  1 VDG screen flag (1=yes)
+WI$Sty   rmb  1 screen type
+WI$Block rmb  1 first block containing window
+WI$BlCnt rmb  1 number of blocks in screen
+WI$Offst rmb  2 screen start offset within block
+WI$Cpx   rmb  1 x coordinate of window start on screen
+WI$Cpy   rmb  1 y coordinate of window start on screen
+WI$Szx   rmb  1 screen width (x coord)
+WI$Szy   rmb  1 screen hight (y coord)
+WI$CWCpx rmb  1 working area - x coordinate of window start on screen
+WI$CWCpy rmb  1 working area - y coordinate of window start on screen
+WI$CWSzx rmb  1 working area - screen width (x coord)
+WI$CWSzy rmb  1 working area - screen hight (y coord)
+WI$Curx  rmb  1 x coordinate of cursor
+WI$Cury  rmb  1 y coordinate of cursor
+WI$BPR   rmb  2 number of bytes/row
+WI$CBsw  rmb  1 character binary switch bits
+WI$FGPRN rmb  1 Foreground palette register number
+WI$BGPRN rmb  1 Background palette register number
+WI$BDPRN rmb  1 Border palette register number
+WI$Lset  rmb  1 Logic set code
+WI$FntGr rmb  1 Font group number
+WI$FntBf rmb  1 Font buffer number
+WI$PstGr rmb  1 Pattern set group number
+WI$PstBf rmb  1 Pattern set buffer number
+WI$GcrGr rmb  1 Gfx cursor group number
+WI$GcrBf rmb  1 Gfx cursor buffer number
+WI$DrCrx rmb  2 x coordinate of draw cursor
+WI$DrCry rmb  2 y coordinate of draw cursor
+WI$Edtn  rmb  1 Edition # of Winfo subroutine
+WI$WEAdr rmb  2 logical address of window entry in sys map (debug only)
+WI$Devm  rmb  2 logical address of window device static storage debug only)
+         rmb  33 reserved for future expansion
+WI$PRegs rmb  16 Palette registers
+WI$ErMsg rmb  40 Error Message
+WI$Size  equ  .-WInfobuf size of this buffer (should be $80 !!)
+
+* WI$CBsw defined as follows
+* TChr    equ  #%10000000
+* Under   equ  #%01000000
+* Bold    equ  #%00100000
+* Prop    equ  #%00010000
+* Scale   equ  #%00001000
+* Invers  equ  #%00000100
+* NoCurs  equ  #%00000010
+* Protect equ  #%00000001
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/3rdparty/utils/winfo/witesta.asm	Mon Aug 26 13:25:25 2002 +0000
@@ -0,0 +1,356 @@
+         nam   WItesta
+         ttl   Asm test of WInfo subroutine
+*
+* Witesta - copyright November,1987 by Ron Lammardo
+*  This program placed into the Public Domain as a demonstration
+*  detailing use of the WInfo subroutine from an ASM
+*  calling program
+*
+* Syntax : Witesta <device name>
+*
+         ifp1
+         use   defsfile
+         endc
+
+typelang set   prgrm+objct
+attrev   set   reent+revision
+revision set   1
+
+zeroadr  equ   *
+
+         mod   Eom,Mname,Typelang,Attrev,Start,Datend
+
+mname    fcs   /WItesta/
+         fcb   1
+         org   0
+window   rmb   2
+nameln   rmb   2
+current  rmb   2
+bytect   rmb   1
+hexbuff  rmb   6
+dispcnt  rmb   1
+         rmb   252
+         use   winfodefs
+buffer   rmb   2000
+         rmb   256
+datend   equ   .
+
+minedtn  set   1 lowest edition Winfo we can use
+
+winfo    fcc   /winfo/ subroutine module name
+         fcb   $0d
+
+errmsg1  fcb   $0d,$0a
+         fcc   /You must use WInfo edition #/
+err1sz   equ   *-errmsg1
+errmsg2  fcc   / or higher/
+         fcb   $0d
+err2sz   equ   *-errmsg2
+
+msg1     fcc   /WI$Stat   :/
+         fcb   1
+         fcc   /WI$VDG    :/
+         fcb   1
+         fcc   /WI$Sty    :/
+         fcb   1
+         fcc   /WI$Block  :/
+         fcb   1
+         fcc   /WI$BlCnt  :/
+         fcb   1
+         fcc   /WI$Offst  :/
+         fcb   2
+         fcc   /WI$Cpx    :/
+         fcb   1
+         fcc   /WI$Cpy    :/
+         fcb   1
+         fcc   /WI$Szx    :/
+         fcb   1
+         fcc   /WI$Szy    :/
+         fcb   1
+         fcc   /WI$CWCpx  :/
+         fcb   1
+         fcc   /WI$CWCpy  :/
+         fcb   1
+         fcc   /WI$CWSzx  :/
+         fcb   1
+         fcc   /WI$CWSy   :/
+         fcb   1
+         fcc   /WI$Curx   :/
+         fcb   1
+         fcc   /WI$Cury   :/
+         fcb   1
+         fcc   /WI$BPR    :/
+         fcb   2
+         fcc   /WI$CBsw   :/
+         fcb   1
+         fcc   /WI$FGPRN  :/
+         fcb   1
+         fcc   /WI$BGPRN  :/
+         fcb   1
+         fcc   /WI$BDPRN  :/
+         fcb   1
+         fcc   /WI$Lset   :/
+         fcb   1
+         fcc   /WI$FntGr  :/
+         fcb   1
+         fcc   /WI$FntBf  :/
+         fcb   1
+         fcc   /WI$PstGr  :/
+         fcb   1
+         fcc   /WI$PstBf  :/
+         fcb   1
+         fcc   /WI$GcrGr  :/
+         fcb   1
+         fcc   /WI$GcrBf  :/
+         fcb   1
+         fcc   /WI$DrCrx  :/
+         fcb   2
+         fcc   /WI$DrCry  :/
+         fcb   2
+         fcc   /WI$Edtn   :/
+         fcb   1
+         fcc   /WI$WEAdr  :/
+         fcb   2
+         fcc   /WI$Devm   :/
+         fcb   2
+         fcc   /           /
+         fcb   5
+palreg   fcc   /WI$PRegs  :/
+         fcb   16
+
+spaces   fcc   /                / 
+creturn  fcb   $0d
+
+
+start    equ   *
+         stx   <window address of command line parameter start
+         subd  #1 back off 1 for <cr>
+         std   <nameln save the length of the device name
+         pshs  a,b,u,x save all registers
+
+* attempt link to subroutine
+
+         lda   #sbrtn+objct module type for link
+         leax  winfo,pcr module name for link
+         os9   F$Link link to the module
+         bcc   pshparms go push params if link succesful
+         cmpb  #E$MNF see if its module not found error
+         lbne  exit if not..exit
+
+* attempt load & link of subroutine
+         
+         lda   #sbrtn+objct module type for link
+         leax  winfo,pcr module name for link
+         os9   F$Load load/link to the module
+         lbcs  exit ...exit on error
+
+pshparms equ   *
+         puls  a,b,u,x return registers
+         ldx   #wi$size size of return buffer
+         pshs  x put on stack
+         leax  winfobuf,u param2 (return buffer)
+         pshs  x put on stack
+         ldx   <nameln  size of param 1
+         pshs  x put on stack
+         ldx   <window address of param 1 (window name)
+         pshs  x put on stack
+         ldx   #0002 paramcount
+         pshs  x put on stack
+         jsr   ,y jump to the subroutine
+
+* return from subroutine
+*
+* normally we'd check for carry set and WI$Stat,
+* but here we want to display status messages
+*
+
+         lda   #sbrtn+objct module type 
+         leax  winfo,pcr module name 
+         os9   F$UnLoad unlink/remove the module
+         lbcs  exit ...exit on error
+
+         lda   #minedtn lowest edition WInfo that this prgm can use
+         cmpa  WI$Edtn,u check with edition # returned
+         lbhi  lowedtn go display message if edition to low
+         leay  winfobuf,u
+         sty   <current
+         leax  msg1,pcr
+         clr   dispcnt
+prtloop  equ   *
+         ldy   #11
+         lda   #1
+         os9   i$write
+         leax  11,x
+         ldb   ,x+
+         stb   <bytect
+         cmpb  #2
+         bne   checkhi
+         ldy   <current
+         ldd   ,y++
+         sty   <current
+         bra   printit
+checkhi  cmpb  #1
+         bne   prtpalet
+         ldy   <current
+         clra
+         ldb   ,y+
+         sty   <current
+printit  equ   *
+         leay  hexbuff,u
+         lbsr  u$gethex
+         pshs  x
+         tfr   y,x
+         ldy   #4
+         ldb   <bytect
+         cmpb  #2
+         beq   print010
+         ldd   #$2020
+         std   ,x
+print010 lda   #1
+         os9   i$write
+         lbcs  exit
+         ldy   #8
+         tst   <dispcnt
+         beq   printsp
+         clr   <dispcnt
+         leax  creturn,pcr
+         ldy   #1
+         bra   prntfill
+printsp  leax  spaces,pcr
+         inc   <dispcnt
+prntfill equ   *
+         lda   #1
+         os9   I$writln
+         lbcs  exit
+         puls  x
+         bra   prtloop
+
+prtpalet equ   *
+         ldy   <current
+         leay  wi$pregs,u skip filler bytes
+         sty   <current
+         pshs  x
+         leax  creturn,pcr
+         ldy   #8
+         lda   #1
+         os9   i$writln
+         leax  palreg,pcr
+         ldy   #11
+         lda   #1
+         os9   i$write
+         lbcs  exit
+         puls  x
+nocr     equ   *
+         ldb   #8
+prt010   pshs  b
+         ldy   <current
+         ldd   ,y++
+         sty   <current
+         leay  hexbuff,u
+         lbsr  u$gethex
+         ldd   2,y
+         std   3,y
+         lda   #$20
+         sta   2,y
+         sta   5,y
+         tfr   y,x
+         ldy   #6
+         lda   #1
+         os9   i$write
+         lbcs  exit
+         puls  b
+         decb
+         beq   prtmsg
+         cmpb  #4
+         bne   prt010
+         pshs  b
+         leax  creturn,pcr
+         ldy   #8
+         lda   #1
+         os9   i$writln
+         leax  spaces,pcr
+         ldy   #11
+         lda   #1
+         os9   i$write
+         lbcs  exit
+         puls  b
+         bra   prt010
+
+prtmsg   equ   *
+         leax  hexbuff,u
+         lda   #$0d
+         sta   ,x
+         ldy   #1
+         lda   #1
+         os9   i$writln
+         ldx   <current
+         ldy   #40
+         lda   #1
+         os9   i$write
+
+
+clrexit  clrb
+exit     os9   F$exit
+
+
+
+lowedtn  equ   *
+         leax  errmsg1,pcr
+         ldy   #err1sz
+         lda   #2
+         os9   I$Write
+         lbcs  exit
+         ldb   #minedtn
+         leay  hexbuff,u
+         lbsr  U$Gethex
+         leax  2,y
+         ldy   #2
+         lda   #2
+         os9   I$Write
+         lbcs  exit
+         leax  errmsg2,pcr
+         ldy   #err2sz
+         lda   #2
+         os9   I$Writln
+         bcs   exit
+         bra   clrexit
+ 
+**********************************************************************
+*                                                                     *
+* U$gethex - converts binary integer to hexidecimal                   *
+*                                                                     *
+* Entry: y=address of 4 byte string for hexidecimal number            *
+*        d=integer to convert                                         *
+*                                                                     *
+* Exit:  y=same as entry                                              *
+*                                                                     *
+***********************************************************************
+U$GetHex equ   *
+         pshs  y
+         pshs  b
+         bsr   u$gth010
+         puls  a
+         bsr   u$gth010
+         puls  y,pc
+u$gth010 pshs  a
+         lsra
+         lsra
+         lsra
+         lsra
+         bsr   u$gth020
+         puls  a
+         anda  #$0f
+         bsr   u$gth020
+         rts
+u$gth020 adda  #$30
+         cmpa  #$3a
+         blt   u$gth030
+         adda  #$7
+u$gth030 sta   ,y+
+         rts
+
+
+
+         emod
+eom      equ   *
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/3rdparty/utils/winfo/witestb.b09	Mon Aug 26 13:25:25 2002 +0000
@@ -0,0 +1,113 @@
+PROCEDURE witestb
+
+(* Witestb
+(* Copyright November 1987 by Ron Lammardo
+(* This program placed into the Public Domain as demonstration
+(* detailing use of the WInfo subroutine from a Basic09 calling 
+(* program
+(* 
+
+TYPE winf=buff1(7):BYTE; buff2(10):BYTE; bpr:INTEGER; buff3(11):
+BYTE; drcrx,drcry:INTEGER; edtn:BYTE; weadr,devm:INTEGER; filler:
+STRING[33]; pregs(16):BYTE; ermsg:STRING[40]
+DIM wi:winf
+DIM wname:STRING[32]
+DIM minedition:BYTE
+DIM indx1:INTEGER
+PRINT 
+INPUT "Window name :",wname
+PRINT 
+RUN winfo(wname,wi)
+IF wi.buff1(1)=$FF THEN 
+PRINT "The Buffer size is to small for WInfo"
+END 
+ENDIF 
+minedition=1
+IF wi.edtn<minedition THEN 
+
+PRINT "You must have WInfo edition #"; 
+PRINT USING "h2"; minedition; 
+PRINT " or higher"
+PRINT 
+END 
+ENDIF 
+PRINT "WI$Stat   :  "; 
+PRINT USING "h2"; wi.buff1(1); 
+PRINT "        WI$VDG    :  "; 
+PRINT USING "h2"; wi.buff1(2)
+PRINT "WI$Sty    :  "; 
+PRINT USING "h2"; wi.buff1(3); 
+PRINT "        WI$Block  :  "; 
+PRINT USING "h2"; wi.buff1(4)
+PRINT "WI$BlCnt  :  "; 
+PRINT USING "h2"; wi.buff1(5); 
+PRINT "        WI$Offst  :"; 
+PRINT USING "h4"; wi.buff1(6)*256+wi.buff1(7)
+PRINT "WI$Cpx    :  "; 
+PRINT USING "h2"; wi.buff2(1); 
+PRINT "        WI$Cpy    :  "; 
+PRINT USING "h2"; wi.buff2(2)
+PRINT "WI$Szx    :  "; 
+PRINT USING "h2"; wi.buff2(3); 
+PRINT "        WI$Szy    :  "; 
+PRINT USING "h2"; wi.buff2(4)
+PRINT "WI$CWCpx  :  "; 
+PRINT USING "h2"; wi.buff2(5); 
+PRINT "        WI$CWCpy  :  "; 
+PRINT USING "h2"; wi.buff2(6)
+PRINT "WI$CWSzx  :  "; 
+PRINT USING "h2"; wi.buff2(7); 
+PRINT "        WI$CWSzy  :  "; 
+PRINT USING "h2"; wi.buff2(8)
+PRINT "WI$Curx   :  "; 
+PRINT USING "h2"; wi.buff2(9); 
+PRINT "        WI$Cury   :  "; 
+PRINT USING "h2"; wi.buff2(10)
+PRINT "WI$BPR    :"; 
+PRINT USING "h4"; wi.bpr; 
+PRINT "        WI$CBsw   :  "; 
+PRINT USING "h2"; wi.buff3(1)
+PRINT "WI$FGPRN  :  "; 
+PRINT USING "h2"; wi.buff3(2); 
+PRINT "        WI$BGPRN  :  "; 
+PRINT USING "h2"; wi.buff3(3)
+PRINT "WI$BDPRN  :  "; 
+PRINT USING "h2"; wi.buff3(4); 
+PRINT "        WI$Lset   :  "; 
+PRINT USING "h2"; wi.buff3(5)
+PRINT "WI$FntGr  :  "; 
+PRINT USING "h2"; wi.buff3(6); 
+PRINT "        WI$FntBf  :  "; 
+PRINT USING "h2"; wi.buff3(7)
+PRINT "WI$PstGr  :  "; 
+PRINT USING "h2"; wi.buff3(8); 
+PRINT "        WI$PstBf  :  "; 
+PRINT USING "h2"; wi.buff3(9)
+PRINT "WI$GcrGr  :  "; 
+PRINT USING "h2"; wi.buff3(10); 
+PRINT "        WI$GcrBf  :  "; 
+PRINT USING "h2"; wi.buff3(11)
+PRINT "WI$DrCrx  :"; 
+PRINT USING "h4"; wi.drcrx; 
+PRINT "        WI$DrCry  :"; 
+PRINT USING "h4"; wi.drcry
+PRINT "WI$Edtn   :  "; 
+PRINT USING "h2"; wi.edtn; 
+PRINT "        WI$WEAdr  :"; 
+PRINT USING "h4"; wi.weadr
+PRINT "WI$Devm   :"; 
+PRINT USING "h4"; wi.devm
+PRINT "WI$PRegs  :"; 
+FOR indx1=1 TO 16
+PRINT USING "h2"; wi.pregs(indx1); 
+PRINT " "; 
+IF indx1=8 THEN 
+PRINT 
+PRINT "           "; 
+ENDIF 
+NEXT indx1
+PRINT 
+PRINT wi.ermsg
+END 
+
+