home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Fred Fish Collection 1.5
/
ffcollection-1-5-1992-11.iso
/
ff_disks
/
200-299
/
ff246.lzh
/
Ty
/
projectsdir
/
segha.c
< prev
next >
Wrap
C/C++ Source or Header
|
1989-09-14
|
2KB
|
52 lines
/*************************************************************************
*** segha.c (JJB TEMPLAR) ***
*** Date begun: 18/8/89. ***
*** Last modified: 18/8/89. ***
*************************************************************************/
/*** Something cunning, or a mass of GURUs? ***
*************************************************************************/
#include <exec/types.h>
#include <libraries/dos.h>
#include <libraries/dosextens.h>
#include <workbench/startup.h>
#include <proto/exec.h>
#include <proto/dos.h>
#include <string.h>
extern struct WBStartup *WBenchMsg;
extern struct DOSBase *DOSBase;
extern BPTR far myseg; /* What to return for mLoadSeg */
extern __fptr far realLoadSeg; /* Thank you for __fptr Lattice! */
extern __fptr far realUnLoadSeg;
extern void mLoadSeg();
extern void mUnLoadSeg();
void onseg() /*=======================================================*/
{
return;
if (!WBenchMsg) return; /* Do nothing if not from WB */
myseg = WBenchMsg->sm_Segment;
Disable();
realLoadSeg = SetFunction(DOSBase,-0x0096,mLoadSeg);
realUnLoadSeg = SetFunction(DOSBase,-0x009c,mUnLoadSeg);
Enable();
}
void offseg() /*======================================================*/
{
return;
if (!WBenchMsg) return; /* Nothing from WB */
Disable();
SetFunction(DOSBase,-0x009c,realUnLoadSeg);
SetFunction(DOSBase,-0x0096,realLoadSeg);
Enable();
}