home *** CD-ROM | disk | FTP | other *** search
/ GEMini Atari / GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso / zip / program / lynxlib.zoo / sysvar.h < prev    next >
C/C++ Source or Header  |  1990-12-22  |  7KB  |  182 lines

  1. /* This source file is part of the LynxLib miscellaneous library by
  2. Robert Fischer, and is Copyright 1990 by Robert Fischer.  It costs no
  3. money, and you may not make money off of it, but you may redistribute
  4. it.  It comes with ABSOLUTELY NO WARRANTY.  See the file LYNXLIB.DOC
  5. for more details.
  6. To contact the author:
  7.     Robert Fischer \\80 Killdeer Rd \\Hamden, CT   06517   USA
  8.     (203) 288-9599     fischer-robert@cs.yale.edu                 */
  9.  
  10. #ifndef SYSVAR_H
  11. #define SYSVAR_H
  12.  
  13. /* #ifndef STDDEF_H
  14. #include <stddef.h>
  15. #endif       Not needed, 'cause TOSMEM.H does this for you */
  16.  
  17. #ifndef TOSMEM_H
  18. #include <tosmem.h>
  19. #endif
  20.  
  21. /* ------------------------------------- */
  22. /* Structures used with system variables */
  23. /* ------------------------------------- */
  24.  
  25. typedef struct _bcb {
  26.     struct _bcb *b_link;            /* -> next BCB */
  27.     WORD        b_neg1;             /* Init to -1 */
  28.     WORD        b_private[5];       /* Don't touch */
  29.     char        *b_bufr;            /* -> cache buffer */
  30.     BYTE        b_space[512];       /* the cache buffer */
  31. } BCB;
  32.  
  33. typedef struct cookie {
  34.     LONG c;
  35.     LONG v;
  36. } COOKIE;
  37.  
  38. /*-------------------------------------------------------*/
  39. /* System variable locations                             */
  40. /* Copyright 1988 by Robert Fischer                      */
  41. /*-------------------------------------------------------*/
  42.  
  43. /* BIOS variable locations */
  44. #define ETV_TIMER       *( (func **)0x400L )
  45. #define ETV_CRITIC      *( (func **)0x404L )
  46. #define ETV_TERM        *( (func **)0x408L )
  47. #define ETV_XTRA        ( (func **)0x40CL )
  48. #define MEMVALID        *( (LONG *)0x420L )
  49. #define     M_MVALID    0x752019F3
  50. #define MEMCNTLR        *( (BYTE *)0x424L )
  51. #define RESVALID        *( (LONG *)0x426L )
  52. #define     M_RESVALID  0x31415926
  53. #define RES_VECTOR      *( (func **)0x42AL )
  54. #define PHYSTOP         ( (char *)0x42EL )
  55. #define MEMBOT          ( (char *)0x432L )
  56. #define MEMTOP          ( (char *)0x436L )
  57. #define MEMVAL2         *( (LONG *)0x43AL )
  58. #define     M_MVAL2     0x237698AA
  59. #define FLOCK           *( (WORD *)0x43EL )
  60. #define SEEKRATE        *( (WORD *)0x440L )
  61. #define     SEEK_6  0x0
  62. #define     SEEK_12 0x1
  63. #define     SEEK_2  0x2
  64. #define     SEEK_3  0x3
  65. #define TIMR_MS         *( (WORD *)0x442L )
  66. #define FVERIFY         *( (WORD *)0x444L )
  67. #define     DO_VERIFY   0x1
  68. #define     DONT_VERIFY 0x0
  69. #define BOOTDEV         *( (WORD *)0x446L )
  70. #define PALMODE         *( (WORD *)0x448L )
  71. #define     NTSC        0x0
  72. #define SSHIFTMD        *( (BYTE *)0x44CL )
  73. #define V_BASE_AD       *( (char **)0x44EL )        /* Base of screen */
  74. #define VBLSEM          *( (WORD *)0x452L )
  75. #define NVBLS           *( (WORD *)0x454L )
  76. #define VBLQUEUE        (*( (func ***)0x456L ))
  77. #define COLORPTR        ( (PALETTE)0x45AL )
  78. #define SCREENPT        *( (char **)0x45EL )    /* Screen you should tweak */
  79. #define VBCLOCK         *( (LONG *)0x462L )
  80. #define FRCLOCK         *( (LONG *)0x466L )
  81. #define HDV_INIT        *( (func **)0x46AL )
  82. #define SWV_VEC         *( (func **)0x46EL )
  83. #define HDV_BPB         *( (func **)0x472L )
  84. #define HDV_RW          *( (func **)0x476L )
  85. #define HDV_BOOT        *( (func **)0x47AL )
  86. #define HDV_MEDIACH     *( (func **)0x47EL )
  87. #define CMDLOAD         *( (WORD *)0x482L )
  88. #define CONTERM         *( (BYTE *)0x484L )
  89. #define     BELL        1
  90. #define     KEY_REPEAT  2
  91. #define     KEY_CLICK   4
  92. #define     KEY_KBSHIFT 8
  93. #define THEMD           *( (BYTE **)0x48EL )
  94. #define SAVPTR          ( (LONG *)0x4A2L )
  95. #define NFLOPS          *( (WORD *)0x4A6L )
  96. #define SAVCONTEXT      ( (char *)0x4AEL )
  97. #define BUFL            ( (BCB **)0x4B2 )
  98. #define HZ_200          *( (LONG *)0x4BAL )
  99. #define THE_ENV         *( (char **)0x4BEL )
  100. #define DRVBITS         *( (LONG *)0x4C2L )
  101. #define DSKBUFP         ( (BYTE *)0x4C6L )  /* 1000-byte buffer */
  102. #define PRT_CNT         *( (WORD *)0x4EEL )
  103. #define SYSBASE         (*( (OS_HEADER **)0x4F2L ))
  104. #define CURPROC         *(SYSBASE->run)
  105. #define SHELL_P         *( (func **)0x4F6L )
  106. #define END_OS          *( (char **)0x4FAL )
  107. #define EXEC_OS         *( (BASEPAGE **)0x4FEL )
  108. #define ALTHELP         *( (func **)0x502L )
  109. #define P_COOKIES        *( (COOKIE **)0x5A0L )
  110.  
  111. /* BIOS variable locations, but just as numbers (for peek, etc.) */
  112. #define etv_timer       0x400L
  113. #define etv_critic      0x404L
  114. #define etv_term        0x408L
  115. #define etv_xtra        0x40CL
  116. #define memvalid        0x420L
  117. #define memcntlr        0x424L
  118. #define resvalid        0x426L
  119. #define res_vector      0x42AL
  120. #define phystop         0x42EL
  121. #define membot          0x432L
  122. #define memtop          0x436L
  123. #define memval2         0x43AL
  124. #define flock           0x43EL
  125. #define seekrate        0x440L
  126. #define timr_ms         0x442L
  127. #define fverify         0x444L
  128. #define bootdev         0x446L
  129. #define palmode         0x448L
  130. #define sshiftmd        0x44CL
  131. #define v_base_ad       0x44EL
  132. #define vblsem          0x452L
  133. #define nvbls           0x454L
  134. #define vblqueue        0x456L
  135. #define colorptr        0x45AL
  136. #define screenpt        0x45EL
  137. #define vbclock         0x462L
  138. #define frclock         0x466L
  139. #define hdv_init        0x46AL
  140. #define swv_vec         0x46EL
  141. #define hdv_bpb         0x472L
  142. #define hdv_rw          0x476L
  143. #define hdv_boot        0x47AL
  144. #define hdv_mediach     0x47EL
  145. #define cmdload         0x482L
  146. #define conterm         0x484L
  147. #define themd           0x48EL
  148. #define savptr          0x4A2L
  149. #define nflops          0x4A6L
  150. #define savcontext      0x4AEL
  151. #define bufl            0x4B2L
  152. #define hz_200          0x4BAL
  153. #define the_env         0x4BEL
  154. #define drvbits         0x4C2L
  155. #define dskbufp         0x4C6L
  156. #define prt_cnt         0x4EEL
  157. #define sysbase         0x4F2L
  158. #define curproc         0x4F6L
  159. #define end_os          0x4FAL
  160. #define exec_os         0x4FEL
  161. #define althelp         0x502L
  162. #define p_cookies        0x5a0L
  163.  
  164. /* Really really low memory hardware variables */
  165. #define BUS_ERROR       *( (func **)0x08L )
  166. #define ADDR_ERROR      *( (func **)0x0CL )
  167. #define ILLEGAL_INSTR   *( (func **)0x10L )
  168. #define DIVIDE_ZERO     *( (func **)0x14L )
  169. #define LINEA_VEC       *( (func **)0x28L )
  170. #define LINEF_VEC       *( (func **)0x2CL )
  171. #define VBLANK          *( (func **)0x70L )
  172. #define GEMDOS_VEC      *( (func **)0x84L )
  173. #define BIOS_VEC        *( (func **)0xB4L )
  174. #define XBIOS_VEC       *( (func **)0xB8L )
  175. #define HARD_PAL    ((WORD *)0xFFFF8240L)
  176. #define HARD_REZ
  177.  
  178. /* Undocumented variables, TOS 1.0 */
  179. #define GEMDOSMPB   (*((MPB*)0x56ec))   /* GEMDOS init MPB */
  180.  
  181. #endif
  182.