CD_OUT_SRC/EMMC.H
2021-09-03 17:50:32 +02:00

47 lines
1.6 KiB
C
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*== Typedefs ========================================================*/
typedef unsigned char BYTE; /*nos construimos un byte*/
typedef unsigned int WORD;
typedef BYTE BOOL; /*como BOOLEAN en Pascal*/
/*== Macros ==========================================================*/
/*-- MK_FP crea de una direcci¢n de segmento y Offset un -------------*/
/*-- puntero FAR a un objeto -------*/
#ifdef MK_FP /*¨ya se defini¢ MK_FP?*/
#undef MK_FP
#endif
#define MK_FP(seg, ofs) ((void far *) ((unsigned long) (seg)<<16|(ofs)))
/*-- PAGE_ADR devuelve un puntero a la p gina f¡sica X dentro del ----*/
/*-- Page-Frame de la memoria EMS ----*/
#define PAGE_ADR(x) ((void *) MK_FP(ems_frame_seg() + ((x) << 10), 0))
/*== Constantes ======================================================*/
#define TRUE 1 /*Constantes para el trabajo con BOOL*/
#define FALSE 0
#define EMS_INT 0x67 /*n£mero de interrupci¢n para acceder a la EMM*/
#define EMS_ERR -1 /*se devuelve en caso de error*/
/*== variables globales===============================================*/
extern BYTE emm_ec; /*aqu¡ se guardan los c¢digos de error EMM*/
BOOL ems_inst(void);
int ems_num_page(void);
int ems_free_page(void);
WORD ems_frame_seg(void);
int ems_alloc(int pages);
BOOL ems_map(int handle, int logp, BYTE physp);
BOOL ems_free(int handle);
BYTE ems_version(void);
BOOL ems_save_map(int handle);
BOOL ems_restore_map(int handle);
void print_err(void);