home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #3 / amigamamagazinepolishissue1998.iso / szachy / gnu / amyboard-3.2.pl2 / amiga / amyboard.h < prev    next >
C/C++ Source or Header  |  1995-05-23  |  4KB  |  151 lines

  1. /**
  2. *** amyboard.h -- Include file for AmyBoard (Amiga XBoard)
  3. *** Copyright 1995, Jochen Wiedmann
  4. ***
  5. *** ------------------------------------------------------------------------
  6. *** This program is free software; you can redistribute it and/or modify
  7. *** it under the terms of the GNU General Public License as published by
  8. *** the Free Software Foundation; either version 2 of the License, or
  9. *** (at your option) any later version.
  10. ***
  11. *** This program is distributed in the hope that it will be useful,
  12. *** but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. *** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. *** GNU General Public License for more details.
  15. ***
  16. *** You should have received a copy of the GNU General Public License
  17. *** along with this program; if not, write to the Free Software
  18. *** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19. *** ------------------------------------------------------------------------
  20. ***
  21. *** See the file ChangeLog for a revision history.
  22. ***/
  23.  
  24. #ifndef _AMYBOARD_H
  25. #define _AMYBOARD_H
  26.  
  27. #include <stdlib.h>
  28. #include <stdio.h>
  29. #include <string.h>
  30. #include <stdarg.h>
  31. #include <errno.h>
  32.  
  33. #include <libraries/mui.h>
  34. #include <proto/muimaster.h>
  35. #include <proto/exec.h>
  36. #include <proto/dos.h>
  37. #include <clib/alib_protos.h>
  38. #include <clib/macros.h>
  39.  
  40. #include "args.h"
  41. #include "common.h"
  42. #include "frontend.h"
  43. #include "backend.h"
  44.  
  45.  
  46. /**
  47. ***  Compiler specific stuff
  48. **/
  49. #if defined(_DCC)
  50.  
  51. #define _REG(r,arg) __ ## r arg
  52. #define _SAVEDS_FUNC(rslt, name) __geta4 rslt name
  53. #define _HOOK_FUNC(rslt,name,arg1, arg2,arg3) \
  54.   _SAVEDS_FUNC(rslt, name) (_REG(a0,arg1), _REG(a2,arg2), _REG(a1,arg3))
  55.  
  56. #elif defined(__SASC)
  57.  
  58. #define _REG(r,arg) register __ ## r arg
  59. #define SAVEDS_FUNC(rslt, name) __saveds __asm rslt name
  60. #define _HOOK_FUNC(rslt,name,arg1,arg2,arg3) \
  61.   _SAVEDS_FUNC(rslt, name) (_REG(a0,arg1), _REG(a2,arg2), _REG(a1,arg3))
  62.  
  63. #elif defined(__GNUC__)
  64.  
  65. #define ___PUSH(a) "movel\t" #a ",sp@-\n"
  66. #define ___POP(a)  "movel\tsp@+," #a "\n"
  67. #ifndef SMALL_DATA
  68. #define __REGP(functype,funcname,pushlist,popval) \
  69.   __asm(".even\n" ".globl _" #funcname "\n" "_" #funcname ":\n" \
  70.    pushlist "jbsr\t___" #funcname "\n" "addw\t#" #popval ",sp\n" \
  71.    "rts\n"); functype __##funcname
  72. #else
  73. #define __REGP(functype,funcname,pushlist,popval) \
  74.   __asm(".even\n" ".globl _" #funcname "\n" "_" #funcname ":\n" ___PUSH(a4) \
  75.    pushlist "jbsr\t_geta4\n" "jbsr\t___" #funcname "\n" "addw\t#" \
  76.    #popval ",sp\n" ___POP(a4) "rts\n"); functype __##funcname
  77. #endif
  78. #define _SAVEDS_FUNC(rslt,name) __REGP(rslt,name, ,0)
  79. #define _HOOK_FUNC(rslt,name,arg1,arg2,arg3) \
  80.   extern rslt name (arg1, arg2, arg3); \
  81.   __REGP(rslt,name,___PUSH(a1)___PUSH(a2)___PUSH(a0),12) (arg1,arg2,arg3)
  82.  
  83. #else
  84. #error "Don't know how to handle your compiler."
  85. #endif
  86.  
  87.  
  88.  
  89. /**
  90. ***  Amiga specific application data
  91. **/
  92. typedef struct
  93. { STRPTR icsWindow;
  94.   LONG childPriority;
  95.   LONG childStack;
  96. } AmigaAppData;
  97. extern AmigaAppData amigaAppData;
  98.  
  99.  
  100.  
  101. /**
  102. ***  childio.c prototypes
  103. **/
  104. extern ULONG pipeSignals;
  105. extern VOID DoInputCallback(ULONG);
  106. extern VOID PipesInit(VOID);
  107. extern VOID PipesClose(VOID);
  108.  
  109.  
  110. /**
  111. ***  time.c prototypes
  112. **/
  113. extern ULONG timeSignals;
  114. extern VOID TimeCallback(ULONG);
  115. extern VOID TimeInit(VOID);
  116. extern VOID TimeClose(VOID);
  117.  
  118.  
  119. /**
  120. ***  muiclass.c prototypes and Tag ID's
  121. **/
  122. extern APTR XBoardObject(Tag, ...);
  123. extern VOID MuiClassInit(VOID);
  124. extern VOID MuiClassClose(VOID);
  125. extern VOID CloseMuiWindow(Object *);
  126.  
  127.  
  128. #define MUI_XBOARD_BASE (TAG_USER | (86 << 16))
  129.  
  130. #define MUIM_XBoard_DrawPosition            (MUI_XBOARD_BASE | 0x00)
  131.  
  132. #define MUIA_XBoard_BitmapDirectory         (MUI_XBOARD_BASE | 0x40)
  133. #define MUIA_XBoard_SquareWidth             (MUI_XBOARD_BASE | 0x42)
  134. #define MUIA_XBoard_SquareHeight            (MUI_XBOARD_BASE | 0x43)
  135. #define MUIA_XBoard_FlipView                (MUI_XBOARD_BASE | 0x44)
  136. #define MUIA_XBoard_ShowCoords              (MUI_XBOARD_BASE | 0x45)
  137. #define MUIA_XBoard_LightSquarePen          (MUI_XBOARD_BASE | 0x46)
  138. #define MUIA_XBoard_DarkSquarePen           (MUI_XBOARD_BASE | 0x47)
  139. #define MUIA_XBoard_WhitePiecePen           (MUI_XBOARD_BASE | 0x48)
  140. #define MUIA_XBoard_BlackPiecePen           (MUI_XBOARD_BASE | 0x49)
  141. #define MUIA_XBoard_AlwaysPromoteToQueen    (MUI_XBOARD_BASE | 0x4a)
  142. #define MUIA_XBoard_EditPosition            (MUI_XBOARD_BASE | 0x4b)
  143.  
  144.  
  145. #ifdef DEBUG
  146. extern VOID iprintf(char *, ...);
  147. extern VOID kprintf(char *, ...);
  148. #endif
  149.  
  150. #endif
  151.