2 * Functions for handling modex and doing other basic graphics stuff.
\r
9 /* -========================== Types & Macros ==========================- */
\r
10 #define PAGE_OFFSET(x,y) ((y<<6)+(y<<4)+(x>>2))
\r
11 #define PLANE(x) (1<< (x&3))
\r
12 typedef byte far* page_t;
\r
13 #define SELECT_ALL_PLANES() outpw(0x03c4, 0xff02)
\r
15 /* -============================ Functions =============================- */
\r
18 void modexShowPage(page_t page);
\r
19 void modexPanPage(page_t *page, int dx, int dy);
\r
20 void modexSelectPlane(byte plane);
\r
21 void modexClearRegion(page_t page, int x, int y, int w, int h, byte color);
\r
23 /* -======================= Constants & Vars ==========================- */
\r
24 extern byte far* VGA; /* The VGA Memory */
\r
25 #define VIDEO_INT 0x10
\r
26 #define SET_MODE 0x00
\r
27 #define VGA_256_COLOR_MODE 0x13
\r
28 #define TEXT_MODE 0x03
\r
29 #define SCREEN_WIDTH 320
\r
30 #define SCREEN_HEIGHT 240
\r
31 #define PAGE_SIZE (word)(SCREEN_WIDTH/4 * SCREEN_HEIGHT)
\r
33 #define SC_INDEX 0x03c4
\r
34 #define SC_DATA 0x03c5
\r
35 #define CRTC_INDEX 0x03d4
\r
36 #define CRTC_DATA 0x03d5
\r
37 #define MISC_OUTPUT 0x03c2
\r
38 #define HIGH_ADDRESS 0x0C
\r
39 #define LOW_ADDRESS 0x0D
\r
40 #define VRETRACE 0x08
\r
41 #define INPUT_STATUS_1 0x03da
\r
42 #define DISPLAY_ENABLE 0x01
\r
43 #define MAP_MASK 0x02
\r