home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 2 / DATAFILE_PDCD2.iso / utilities2 / desklib / !DeskLib / h / SWI < prev    next >
Encoding:
Text File  |  1992-03-23  |  2.4 KB  |  66 lines

  1. /*
  2.     ####             #    #     # #
  3.     #   #            #    #       #          The FreeWare C library for 
  4.     #   #  ##   ###  #  # #     # ###             RISC OS machines
  5.     #   # #  # #     # #  #     # #  #   ___________________________________
  6.     #   # ####  ###  ##   #     # #  #                                      
  7.     #   # #        # # #  #     # #  #    Please refer to the accompanying
  8.     ####   ### ####  #  # ##### # ###    documentation for conditions of use
  9.     ________________________________________________________________________
  10.  
  11.     File:    SWI.h
  12.     Author:  Copyright © 1992 Jason Williams
  13.     Version: 1.00 (22 Mar 1992)
  14.     Purpose: Generic SWI call veneer function
  15. */
  16.  
  17.  
  18. #ifndef __dl_swi_h
  19. #define __dl_swi_h
  20.  
  21. #ifndef __dl_core_h
  22. #include "Core.h"
  23. #endif
  24.  
  25. /*
  26.  *  SWI
  27.  *  This function provides a general-purpose SWI call veneer.
  28.  *  It is not meant to be the most efficient SWI caller, but the most
  29.  *  general one. If you require faster SWI handling than this function
  30.  *  provides, then you will need to construct an assembler veneer for the SWI
  31.  *  (see WimpSWIs library source for examples)
  32.  *
  33.  *  Call it specifying the number of arguments you are passing in,
  34.  *                     the number of arguments you want passed back,
  35.  *                     the SWI number to call (X or normal),
  36.  *                     and a list of parameters...
  37.  * Parameters:
  38.  *   The SWI list in should be a list of integers, exactly the number
  39.  *   specified as "numregsin". These will be passed to the SWI as registers
  40.  *   0, 1, 2, ... A maximum of 6 such registers can be specified.
  41.  *
  42.  *   The SWI list out should be a list of pointers to result variables
  43.  *   they will be assigned the register results from the SWI, in order.
  44.  *   Pass in a NULL pointer for any of these if the result is to be ignored
  45.  *
  46.  * Examples:
  47.  *   SWI(0, 0, SWI_Hourglass_On);
  48.  *   SWI(1, 0, SWI_Hourglass_Percentage, 33);
  49.  *   SWI(0, 0, SWI_XHourglass_Smash);
  50.  *
  51.  *   { int ramsprites, romsprites;
  52.  *     \* Read rom sprite and ram sprite pool base addresses: *\
  53.  *     SWI(0, 2, SWI_Wimp_BaseOfSprites, &romsprites, &ramsprites)
  54.  *
  55.  *     \* Read ram sprite base ONLY *\
  56.  *     SWI(0, 2, SWI_Wimp_BaseOfSprites, NULL, &ramsprites)
  57.  *   }
  58.  *
  59.  *   -- See Hourglass.h for examples of how to make low-level SWI calls
  60.  *      look nice in your calling code without the extra expense of another
  61.  *      function call.
  62.  */
  63. os_error *SWI(int numregsin, int numregsout, int swicode, ... );
  64.  
  65. #endif
  66.