/* * Ts.h - Copyright 1990 D.W.Reisig * * # date by Comment * -- --------- ----- --------------------- * 0 29-Oct-89 DWR Created for Tracksalve * 1 10-Apr-90 DWR TrackSalve 1.3 * */ #define exit(i) XCEXIT(i) #define TSSEMAPHORENAME "TrackSalve Data Hook" #define TD_VERSION1_2 33 #define TD_REVISION1_2 127 #define TD_VERSION1_3 34 #define TD_REVISION1_3 1 #define PUBCLR (MEMF_PUBLIC|MEMF_CLEAR) /* Program return codes */ #define ZERO 0 #define WARN 5 #define ERROR 10 #define FAIL 20 /* Secondary result codes */ #define E_CMDLINE -41 #define E_ALLOCMEM -42 #define E_INTUITION -43 #define E_RTAG -44 #define E_TD_VERSION -45 #define E_LOSTPC -47 /*-- The findable structure. We put it in the semaphore list. */ struct TSHook{ struct SignalSemaphore TSH_Semaphore; struct TSControl *TSH_TSControl; ULONG TSH_Version; }; /*-- The UnitData structure contains data of interest for a Trackdisk unit task. */ struct TrackSalveBN{ struct bltnode TSBN_bltnode; UWORD TSBN_Pad; APTR TSBN_P0; APTR TSBN_P1; APTR TSBN_P2; APTR TSBN_P3; APTR TSBN_Unit; UWORD TSBN_C0; UWORD TSBN_C1; }; struct UnitData{ struct IOExtTD UD_TDReq; struct TSControl *UD_TSControl; char *UD_ReturnTD; APTR UD_Userdata; APTR UD_CopySect; UBYTE UD_Cmd0; UBYTE UD_Cmd1; UWORD UD_SavedL; UWORD UD_SavedD; UWORD UD_Motor; struct TrackSalveBN UD_BlitNode; }; /*-- The global control structure. It contains data concerning shared items between all TD-tasks. */ struct TSControl{ struct TSHook *TSC_TSHook; struct UnitData *TSC_UnitData[NUMUNITS]; struct UnitData TSC_UDAlloc[NUMUNITS]; struct Resident *TSC_TDTag; ULONG TSC_TDCodeSize; struct Resident *TSC_TSTag; char *TSC_TSCode; ULONG TSC_TSCodeSize; char *TSC_Buffer; UBYTE TSC_InUse; UBYTE TSC_Salve; UBYTE TSC_Verify; UBYTE TSC_AvailUnits; struct SignalSemaphore TSC_OwnBuffer; struct Library *TSC_IntuBase; ULONG TSC_Size; }; /* Bits of the UD_Command, UD_PreCmd and UNIT_pad */ #define B_VERIFY0 0 #define B_VERIFY1 1 #define B_READONLY 2 #define B_NOCLICK 3 #define B_SALVE 4 #define B_UPDATE 5 #define B_RAM 6 #define B_TERM 7 #define F_READONLY (1<