source: abuse/trunk/src/imlib/emm.hpp @ 124

Last change on this file since 124 was 124, checked in by Sam Hocevar, 14 years ago
  • Get rid of ugly tabs and trailing spaces everywhere.
File size: 1.3 KB
Line 
1/*
2 *  Abuse - dark 2D side-scrolling platform game
3 *  Copyright (c) 1995 Crack dot Com
4 *
5 *  This software was released into the Public Domain. As with most public
6 *  domain software, no warranty is made or implied by Crack dot Com or
7 *  Jonathan Clark.
8 */
9
10#ifndef __EMM_H_
11#define __EMM_H_
12#include "system.h"
13#ifdef __DOS            // this stuff is DOS specific, don't include
14            // on other systems
15#include "linked.hpp"
16
17class emblock : public linked_node
18{
19public :
20  unsigned beg,end;
21  int emhandle;
22  emblock *nextblk;
23} ;
24
25
26class expandedmm
27{
28public :
29  unsigned frame_ad;
30  long frmsz;
31  linked_list allocblks,freeblks;
32  expandedmm();
33
34  emblock *alloc(unsigned size);
35  void free(emblock *block);
36  void free_all();
37  long avail() { return frmsz; }
38  void set(emblock *block, char *dat);
39  void get(emblock *block, char *dat);
40  ~expandedmm() { free_all(); }
41} ;
42
43extern expandedmm epmem;
44extern int  emm_avail;
45int      EMM_detect();
46int      EMM_num_free_pages();
47int      EMM_version();
48int      EMM_num_active_handles();
49long     EMM_free_memory();
50int      EMM_alloc(int pages);  // remeber pages are 16K, 16384 bytes
51        // returns handle or -1
52int      EMM_free(int handle);   // returns true for success
53unsigned EMM_frame_address();
54void     EMM_map_page(int handle);
55
56#endif
57#endif
58
Note: See TracBrowser for help on using the repository browser.