home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 28 / amigaformatcd28.iso / -screenplay- / otherstuff / adoomppc_src / amipx_ppc_pragmas.h < prev    next >
C/C++ Source or Header  |  1998-04-23  |  4KB  |  154 lines

  1. #ifndef _PPCPRAGMA_AMIPX_H
  2. #define _PPCPRAGMA_AMIPX_H
  3.  
  4. #ifdef __GNUC__
  5. #ifndef _PPCINLINE__AMIPX_H
  6. #include <powerup/ppcinline/amipx.h>
  7. #endif
  8. #else
  9.  
  10. #ifndef POWERUP_PPCLIB_INTERFACE_H
  11. #include <powerup/ppclib/interface.h>
  12. #endif
  13.  
  14. #ifndef POWERUP_GCCLIB_PROTOS_H
  15. #include <powerup/gcclib/powerup_protos.h>
  16. #endif
  17.  
  18. #ifndef NO_PPCINLINE_STDARG
  19. #define NO_PPCINLINE_STDARG
  20. #endif/* SAS C PPC inlines */
  21.  
  22. #ifndef AMIPX_BASE_NAME
  23. #define AMIPX_BASE_NAME AMIPX_Library
  24. #endif /* !AMIPX_BASE_NAME */
  25.  
  26. #define    AMIPX_OpenSocket(socknum) _AMIPX_OpenSocket(AMIPX_BASE_NAME, socknum)
  27.  
  28. static __inline WORD
  29. _AMIPX_OpenSocket(void *AMIPX_Library, UWORD socknum)
  30. {
  31. struct Caos    MyCaos;
  32.     MyCaos.M68kCacheMode    =    IF_CACHEFLUSHALL;
  33. //    MyCaos.M68kStart    =    NULL;
  34. //    MyCaos.M68kSize        =    0;
  35.     MyCaos.PPCCacheMode    =    IF_CACHEFLUSHALL;
  36. //    MyCaos.PPCStart        =    NULL;
  37. //    MyCaos.PPCSize        =    0;
  38.     MyCaos.d0        =(ULONG) socknum;
  39.     MyCaos.caos_Un.Offset    =    (-0x1E);
  40.     MyCaos.a6        =(ULONG) AMIPX_Library;    
  41.     return((WORD)PPCCallOS(&MyCaos));
  42. }
  43.  
  44. #define    AMIPX_CloseSocket(socknum) _AMIPX_CloseSocket(AMIPX_BASE_NAME, socknum)
  45.  
  46. static __inline void
  47. _AMIPX_CloseSocket(void *AMIPX_Library, UWORD socknum)
  48. {
  49. struct Caos    MyCaos;
  50.     MyCaos.M68kCacheMode    =    IF_CACHEFLUSHALL;
  51. //    MyCaos.M68kStart    =    NULL;
  52. //    MyCaos.M68kSize        =    0;
  53.     MyCaos.PPCCacheMode    =    IF_CACHEFLUSHALL;
  54. //    MyCaos.PPCStart        =    NULL;
  55. //    MyCaos.PPCSize        =    0;
  56.     MyCaos.d0        =(ULONG) socknum;
  57.     MyCaos.caos_Un.Offset    =    (-0x24);
  58.     MyCaos.a6        =(ULONG) AMIPX_Library;    
  59.     PPCCallOS(&MyCaos);
  60. }
  61.  
  62. #define    AMIPX_ListenForPacket(ECB) _AMIPX_ListenForPacket(AMIPX_BASE_NAME, ECB)
  63.  
  64. static __inline WORD
  65. _AMIPX_ListenForPacket(void *AMIPX_Library, struct AMIPX_ECB *ECB)
  66. {
  67. struct Caos    MyCaos;
  68.     MyCaos.M68kCacheMode    =    IF_CACHEFLUSHALL;
  69. //    MyCaos.M68kStart    =    NULL;
  70. //    MyCaos.M68kSize        =    0;
  71.     MyCaos.PPCCacheMode    =    IF_CACHEFLUSHALL;
  72. //    MyCaos.PPCStart        =    NULL;
  73. //    MyCaos.PPCSize        =    0;
  74.     MyCaos.a0        =(ULONG) ECB;
  75.     MyCaos.caos_Un.Offset    =    (-0x2A);
  76.     MyCaos.a6        =(ULONG) AMIPX_Library;    
  77.     return((WORD)PPCCallOS(&MyCaos));
  78. }
  79.  
  80. #define    AMIPX_SendPacket(ECB) _AMIPX_SendPacket(AMIPX_BASE_NAME, ECB)
  81.  
  82. static __inline WORD
  83. _AMIPX_SendPacket(void *AMIPX_Library, struct AMIPX_ECB *ECB)
  84. {
  85. struct Caos    MyCaos;
  86.     MyCaos.M68kCacheMode    =    IF_CACHEFLUSHALL;
  87. //    MyCaos.M68kStart    =    NULL;
  88. //    MyCaos.M68kSize        =    0;
  89.     MyCaos.PPCCacheMode    =    IF_CACHEFLUSHALL;
  90. //    MyCaos.PPCStart        =    NULL;
  91. //    MyCaos.PPCSize        =    0;
  92.     MyCaos.a0        =(ULONG) ECB;
  93.     MyCaos.caos_Un.Offset    =    (-0x30);
  94.     MyCaos.a6        =(ULONG) AMIPX_Library;    
  95.     return((WORD)PPCCallOS(&MyCaos));
  96. }
  97.  
  98. #define    AMIPX_GetLocalAddr(addrarray) _AMIPX_GetLocalAddr(AMIPX_BASE_NAME, addrarray)
  99.  
  100. static __inline void
  101. _AMIPX_GetLocalAddr(void *AMIPX_Library, UBYTE addrarray[10])
  102. {
  103. struct Caos    MyCaos;
  104.     MyCaos.M68kCacheMode    =    IF_CACHEFLUSHALL;
  105. //    MyCaos.M68kStart    =    NULL;
  106. //    MyCaos.M68kSize        =    0;
  107.     MyCaos.PPCCacheMode    =    IF_CACHEFLUSHALL;
  108. //    MyCaos.PPCStart        =    NULL;
  109. //    MyCaos.PPCSize        =    0;
  110.     MyCaos.a0        =(ULONG) addrarray;
  111.     MyCaos.caos_Un.Offset    =    (-0x36);
  112.     MyCaos.a6        =(ULONG) AMIPX_Library;    
  113.     PPCCallOS(&MyCaos);
  114. }
  115.  
  116. #define    AMIPX_RelinquishControl() _AMIPX_RelinquishControl(AMIPX_BASE_NAME)
  117.  
  118. static __inline void
  119. _AMIPX_RelinquishControl(void *AMIPX_Library)
  120. {
  121. struct Caos    MyCaos;
  122.     MyCaos.M68kCacheMode    =    IF_CACHEFLUSHALL;
  123. //    MyCaos.M68kStart    =    NULL;
  124. //    MyCaos.M68kSize        =    0;
  125.     MyCaos.PPCCacheMode    =    IF_CACHEFLUSHALL;
  126. //    MyCaos.PPCStart        =    NULL;
  127. //    MyCaos.PPCSize        =    0;
  128.     MyCaos.caos_Un.Offset    =    (-0x3C);
  129.     MyCaos.a6        =(ULONG) AMIPX_Library;    
  130.     PPCCallOS(&MyCaos);
  131. }
  132.  
  133. #define    AMIPX_GetLocalTarget(addrarray, localtarget) _AMIPX_GetLocalTarget(AMIPX_BASE_NAME, addrarray, localtarget)
  134.  
  135. static __inline WORD
  136. _AMIPX_GetLocalTarget(void *AMIPX_Library, UBYTE addrarray[12], UBYTE localtarget[6])
  137. {
  138. struct Caos    MyCaos;
  139.     MyCaos.M68kCacheMode    =    IF_CACHEFLUSHALL;
  140. //    MyCaos.M68kStart    =    NULL;
  141. //    MyCaos.M68kSize        =    0;
  142.     MyCaos.PPCCacheMode    =    IF_CACHEFLUSHALL;
  143. //    MyCaos.PPCStart        =    NULL;
  144. //    MyCaos.PPCSize        =    0;
  145.     MyCaos.a0        =(ULONG) addrarray;
  146.     MyCaos.a1        =(ULONG) localtarget;
  147.     MyCaos.caos_Un.Offset    =    (-0x42);
  148.     MyCaos.a6        =(ULONG) AMIPX_Library;    
  149.     return((WORD)PPCCallOS(&MyCaos));
  150. }
  151.  
  152. #endif /* SASC Pragmas */
  153. #endif /* !_PPCPRAGMA_AMIGAGUIDE_H */
  154.