home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / OSK / CMDS / memacs400_src.lzh / MEMACS400 / SRC / gsscsz.c < prev    next >
Text File  |  1996-04-24  |  2KB  |  65 lines

  1. /* gsscsz.c */
  2.  
  3. #include <types.h>
  4. #include <machine/reg.h>
  5. #include <winfo.h>
  6.  
  7. short fontszx, fontszy;
  8.  
  9. /* Get Screen Info */
  10. _gs_scsz(path, xsize, ysize)
  11. int path, *xsize, *ysize;
  12. {
  13.     WINFO winf;
  14.     struct {
  15.         short gn, bn, xsz, ysz, cpx, cpy, attr;
  16.     } finf;
  17.     
  18.     if (_gs_winfo(path,&winf) == -1)
  19.         return (-1);
  20.  
  21.     if (_gs_finfo(path,&finf) == -1)
  22.         return (-1);
  23.  
  24.     fontszx = finf.xsz;
  25.     fontszy = finf.ysz;
  26.     
  27.     *xsize = ((winf.w_wa_xmax + 1) / finf.xsz);
  28.     *ysize = ((winf.w_wa_ymax + 1) / finf.ysz);
  29.  
  30.     return(0);
  31. }
  32.  
  33. #asm
  34.  
  35. _gs_winfo:
  36.     link    a5,#0               this is for debuggers' frame links
  37.     movem.l d1-d2/a0,-(sp)      this is for _sysret
  38. * the first parameter is always in D0
  39.     move.w  d0,d0               just for fun; this is passed path
  40. * the second parameter is always in D1
  41.     move.l  d1,a0               ss_winfo wants packet address in A0
  42. * D1 must contain the StatCall number
  43.     move.w  #161,d1             DS_WInfo this time
  44. * now we can do the system call
  45.     os9     I$GetStt
  46. * if carry is set, _sysret will stick a -1 in D0 (return value)
  47.     bra     _sysret
  48.  
  49. _gs_finfo:
  50.     link    a5,#0               this is for debuggers' frame links
  51.     movem.l d1-d2/a0,-(sp)      this is for _sysret
  52. * the first parameter is always in D0
  53.     move.w  d0,d0               just for fun; this is passed path
  54. * the second parameter is always in D1
  55.     move.l  d1,a0               ss_winfo wants packet address in A0
  56. * D1 must contain the StatCall number
  57.     move.w  #177,d1             DS_FontInfo this time
  58. * now we can do the system call
  59.     os9     I$GetStt
  60. * if carry is set, _sysret will stick a -1 in D0 (return value)
  61.     bra     _sysret
  62.  
  63. #endasm
  64.  
  65.