home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / programming / oslib / examples / c / ex0 < prev    next >
Encoding:
Text File  |  1993-11-01  |  1.2 KB  |  55 lines

  1. /*56 instructions*/
  2.  
  3. #include <kernel.h>
  4.  
  5. #include "colourtrans.h"
  6. #include "font.h"
  7. #include "os.h"
  8. #include "pdriver.h"
  9.  
  10. _kernel_oserror *x (int page, char *t)
  11.  
  12. {  bool more;
  13.    os_box req;
  14.    _kernel_oserror *oserror = NULL;
  15.    _kernel_swi_regs swi_regs;
  16.    
  17.    swi_regs.r [0] = 1;
  18.    swi_regs.r [1] = (int) &req;
  19.    swi_regs.r [2] = page;
  20.    swi_regs.r [3] = (int) NULL;
  21.  
  22.    if ((oserror = _kernel_swi (PDriver_DrawPage, &swi_regs, &swi_regs)) !=
  23.          NULL)
  24.       goto finish;
  25.  
  26.    while (more)
  27.    {  swi_regs.r [0] = os_COLOUR_BLACK;
  28.       swi_regs.r [3] = colourtrans_SET_FG;
  29.       swi_regs.r [4] = os_ACTION_OVERWRITE;
  30.  
  31.       if ((oserror = _kernel_swi (ColourTrans_SetGCOL, &swi_regs, &swi_regs))
  32.             != NULL)
  33.          goto finish;
  34.  
  35.       swi_regs.r [1] = (int) t;
  36.       swi_regs.r [2] = NONE;
  37.       swi_regs.r [3] = 0;
  38.       swi_regs.r [4] = 0;
  39.  
  40.       if ((oserror = _kernel_swi (Font_Paint, &swi_regs, &swi_regs)) != NULL)
  41.          goto finish;
  42.  
  43.       swi_regs.r [1] = (int) &req;
  44.  
  45.       if ((oserror = _kernel_swi (PDriver_GetRectangle, &swi_regs,
  46.             &swi_regs)) != NULL)
  47.          goto finish;
  48.  
  49.       more = swi_regs.r [0];
  50.    }
  51.  
  52. finish:
  53.   return oserror;
  54. }
  55.