home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 9
/
CD_ASCQ_09_1193.iso
/
maj
/
4437
/
int
/
spx_es.int
< prev
next >
Wrap
Text File
|
1993-09-16
|
2KB
|
61 lines
Unit spx_es;
{$X+,O+ }
{ SPX Library Version 2.0 Copyright 1993 Scott D. Ramsay }
{ For use with the SPX Library }
{ Allocates data to expanded or heap memory. Great for }
{ sprite data. Requires Turbo Vision unit: OBJECTS }
Interface
Uses spx_vga,spx_fnc,Objects;
const
tempbuff : pointer = nil; { Temporary buffer }
temp_size : word = 0; { Size of temporary buffer }
type
PMyEmsStream = ^TMyEmsStream;
TMyEmsStream = object(TEmsStream)
procedure Error(Code, Info: Integer);virtual;
end;
PEmsstack = ^TEmsStack;
TEmsStack = record
stack : PmyEmsStream;
maxsize, { Size of allocated mem }
flocator : longint; { Size of used mem in maxSize }
end;
{ copies data to main memory }
PDyData = ^TDyData;
TDyData = object
heapdta : pointer; { pointer to data in heap }
size : word; { size of data }
constructor init(var data;sz:word);
destructor done;virtual;
function getdata : pointer;virtual;
end;
{ copies data to ems memory(if available) or main memory }
PEmsDyData = ^TEmsDyData;
TEmsDyData = object(TDyData)
useheap : boolean; { TRUE - if using parent }
emsoff : longint; { pointer to data in stream }
emsstk : PEMSstack; { pointer to EMS data stack }
constructor init(var p:PEmsStack;var data;sz:word);
destructor done;virtual;
function getdata : pointer;virtual;
end;
var
emsok : boolean; { TRUE - if ems is active and ok }
emscode : integer; { An standard ems code error if emsok=FALSE }
function CreateEmsStack(size:longint):PEmsStack;
procedure DeleteEmsStack(var p:PEmsStack);
function AddEmsStack(var p:PemsStack;var data;size:word):boolean;
function ReadEmsStack(var p:PemsStack;position:longint;var data;size:word):boolean;
procedure ChangeTempBuffer(size:word);
procedure StackLoadVSP(fn:string;var buff;var p:PEmsStack;loadlow:boolean);
function vp(var p:PEmsDyData):pointer;
Implementation