home *** CD-ROM | disk | FTP | other *** search
- /* This source file is part of the LynxLib miscellaneous library by
- Robert Fischer, and is Copyright 1990 by Robert Fischer. It costs no
- money, and you may not make money off of it, but you may redistribute
- it. It comes with ABSOLUTELY NO WARRANTY. See the file LYNXLIB.DOC
- for more details.
- To contact the author:
- Robert Fischer \\80 Killdeer Rd \\Hamden, CT 06517 USA
- (203) 288-9599 fischer-robert@cs.yale.edu */
-
- #ifndef SYSVAR_H
- #define SYSVAR_H
-
- /* #ifndef STDDEF_H
- #include <stddef.h>
- #endif Not needed, 'cause TOSMEM.H does this for you */
-
- #ifndef TOSMEM_H
- #include <tosmem.h>
- #endif
-
- /* ------------------------------------- */
- /* Structures used with system variables */
- /* ------------------------------------- */
-
- typedef struct _bcb {
- struct _bcb *b_link; /* -> next BCB */
- WORD b_neg1; /* Init to -1 */
- WORD b_private[5]; /* Don't touch */
- char *b_bufr; /* -> cache buffer */
- BYTE b_space[512]; /* the cache buffer */
- } BCB;
-
- typedef struct cookie {
- LONG c;
- LONG v;
- } COOKIE;
-
- /*-------------------------------------------------------*/
- /* System variable locations */
- /* Copyright 1988 by Robert Fischer */
- /*-------------------------------------------------------*/
-
- /* BIOS variable locations */
- #define ETV_TIMER *( (func **)0x400L )
- #define ETV_CRITIC *( (func **)0x404L )
- #define ETV_TERM *( (func **)0x408L )
- #define ETV_XTRA ( (func **)0x40CL )
- #define MEMVALID *( (LONG *)0x420L )
- #define M_MVALID 0x752019F3
- #define MEMCNTLR *( (BYTE *)0x424L )
- #define RESVALID *( (LONG *)0x426L )
- #define M_RESVALID 0x31415926
- #define RES_VECTOR *( (func **)0x42AL )
- #define PHYSTOP ( (char *)0x42EL )
- #define MEMBOT ( (char *)0x432L )
- #define MEMTOP ( (char *)0x436L )
- #define MEMVAL2 *( (LONG *)0x43AL )
- #define M_MVAL2 0x237698AA
- #define FLOCK *( (WORD *)0x43EL )
- #define SEEKRATE *( (WORD *)0x440L )
- #define SEEK_6 0x0
- #define SEEK_12 0x1
- #define SEEK_2 0x2
- #define SEEK_3 0x3
- #define TIMR_MS *( (WORD *)0x442L )
- #define FVERIFY *( (WORD *)0x444L )
- #define DO_VERIFY 0x1
- #define DONT_VERIFY 0x0
- #define BOOTDEV *( (WORD *)0x446L )
- #define PALMODE *( (WORD *)0x448L )
- #define NTSC 0x0
- #define SSHIFTMD *( (BYTE *)0x44CL )
- #define V_BASE_AD *( (char **)0x44EL ) /* Base of screen */
- #define VBLSEM *( (WORD *)0x452L )
- #define NVBLS *( (WORD *)0x454L )
- #define VBLQUEUE (*( (func ***)0x456L ))
- #define COLORPTR ( (PALETTE)0x45AL )
- #define SCREENPT *( (char **)0x45EL ) /* Screen you should tweak */
- #define VBCLOCK *( (LONG *)0x462L )
- #define FRCLOCK *( (LONG *)0x466L )
- #define HDV_INIT *( (func **)0x46AL )
- #define SWV_VEC *( (func **)0x46EL )
- #define HDV_BPB *( (func **)0x472L )
- #define HDV_RW *( (func **)0x476L )
- #define HDV_BOOT *( (func **)0x47AL )
- #define HDV_MEDIACH *( (func **)0x47EL )
- #define CMDLOAD *( (WORD *)0x482L )
- #define CONTERM *( (BYTE *)0x484L )
- #define BELL 1
- #define KEY_REPEAT 2
- #define KEY_CLICK 4
- #define KEY_KBSHIFT 8
- #define THEMD *( (BYTE **)0x48EL )
- #define SAVPTR ( (LONG *)0x4A2L )
- #define NFLOPS *( (WORD *)0x4A6L )
- #define SAVCONTEXT ( (char *)0x4AEL )
- #define BUFL ( (BCB **)0x4B2 )
- #define HZ_200 *( (LONG *)0x4BAL )
- #define THE_ENV *( (char **)0x4BEL )
- #define DRVBITS *( (LONG *)0x4C2L )
- #define DSKBUFP ( (BYTE *)0x4C6L ) /* 1000-byte buffer */
- #define PRT_CNT *( (WORD *)0x4EEL )
- #define SYSBASE (*( (OS_HEADER **)0x4F2L ))
- #define CURPROC *(SYSBASE->run)
- #define SHELL_P *( (func **)0x4F6L )
- #define END_OS *( (char **)0x4FAL )
- #define EXEC_OS *( (BASEPAGE **)0x4FEL )
- #define ALTHELP *( (func **)0x502L )
- #define P_COOKIES *( (COOKIE **)0x5A0L )
-
- /* BIOS variable locations, but just as numbers (for peek, etc.) */
- #define etv_timer 0x400L
- #define etv_critic 0x404L
- #define etv_term 0x408L
- #define etv_xtra 0x40CL
- #define memvalid 0x420L
- #define memcntlr 0x424L
- #define resvalid 0x426L
- #define res_vector 0x42AL
- #define phystop 0x42EL
- #define membot 0x432L
- #define memtop 0x436L
- #define memval2 0x43AL
- #define flock 0x43EL
- #define seekrate 0x440L
- #define timr_ms 0x442L
- #define fverify 0x444L
- #define bootdev 0x446L
- #define palmode 0x448L
- #define sshiftmd 0x44CL
- #define v_base_ad 0x44EL
- #define vblsem 0x452L
- #define nvbls 0x454L
- #define vblqueue 0x456L
- #define colorptr 0x45AL
- #define screenpt 0x45EL
- #define vbclock 0x462L
- #define frclock 0x466L
- #define hdv_init 0x46AL
- #define swv_vec 0x46EL
- #define hdv_bpb 0x472L
- #define hdv_rw 0x476L
- #define hdv_boot 0x47AL
- #define hdv_mediach 0x47EL
- #define cmdload 0x482L
- #define conterm 0x484L
- #define themd 0x48EL
- #define savptr 0x4A2L
- #define nflops 0x4A6L
- #define savcontext 0x4AEL
- #define bufl 0x4B2L
- #define hz_200 0x4BAL
- #define the_env 0x4BEL
- #define drvbits 0x4C2L
- #define dskbufp 0x4C6L
- #define prt_cnt 0x4EEL
- #define sysbase 0x4F2L
- #define curproc 0x4F6L
- #define end_os 0x4FAL
- #define exec_os 0x4FEL
- #define althelp 0x502L
- #define p_cookies 0x5a0L
-
- /* Really really low memory hardware variables */
- #define BUS_ERROR *( (func **)0x08L )
- #define ADDR_ERROR *( (func **)0x0CL )
- #define ILLEGAL_INSTR *( (func **)0x10L )
- #define DIVIDE_ZERO *( (func **)0x14L )
- #define LINEA_VEC *( (func **)0x28L )
- #define LINEF_VEC *( (func **)0x2CL )
- #define VBLANK *( (func **)0x70L )
- #define GEMDOS_VEC *( (func **)0x84L )
- #define BIOS_VEC *( (func **)0xB4L )
- #define XBIOS_VEC *( (func **)0xB8L )
- #define HARD_PAL ((WORD *)0xFFFF8240L)
- #define HARD_REZ
-
- /* Undocumented variables, TOS 1.0 */
- #define GEMDOSMPB (*((MPB*)0x56ec)) /* GEMDOS init MPB */
-
- #endif
-