/*
	This is some experimental code by Shadowlord (SL).
*/

#ifndef MEMH
#define MEMH
#ifndef MEMCPP
#define EXP extern
#else
#define EXP 
#endif
//#define needed_conventional_mem	66000
//#define needed_conventional_mem	20480
//20480 works, but we don't really need any - we'll ask for 1024.
#define needed_conventional_mem 1024

EXP int XmsInit();
EXP int XmsMalloc(long bytes);
EXP void XmsFreeAll();
EXP void far * UmbMalloc(long bytes);
EXP void * NeedConventional(int handle);
EXP int DoneConventional(int handle);
EXP unsigned long GetXMS_U8(int handle, unsigned long pos);
EXP int XmsFree(unsigned int handle);
EXP void PushMirror(int handle);
EXP void PopMirror(int handle);
EXP void FreeMirror(int handle);
EXP int AllocMirror(void far* address, unsigned long bytes);


	/*
	extern unsigned int h_p_background;
	extern unsigned int h_n_offsets_map;
	extern unsigned int h_n_globes_map;
	extern unsigned int h_s_background;
	extern unsigned int h_p_surfacemap;
	extern unsigned int h_objectschart;
	extern unsigned int h_pvfile;
	extern unsigned int h_adapted;
	
	//And these are the ones that don't get allocated, but are aliases for other things.
	ruinschart    = (unsigned char far  *) objectschart; // oc alias
	txtr          = (unsigned char huge *) p_background; // txtr alias
	digimap2      = (unsigned long far *) &n_globes_map[gl_bytes]; // font alias
	
	*/
#endif