X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=16%2Fmodex16%2FMODEX16.H;fp=16%2Fmodex16%2Fmodex16.h;h=7bd92bc1dcb5101cfe14e45a97009e2012ccbb00;hb=d274f7cdb66fd39016a2d342ed8b9d5a548c15fe;hp=4502fa08db34ae902de6d7d11b1b9b5fee254489;hpb=17c039519c1549f519a3166653d1ace911354459;p=16.git diff --git a/16/modex16/modex16.h b/16/modex16/MODEX16.H similarity index 50% rename from 16/modex16/modex16.h rename to 16/modex16/MODEX16.H index 4502fa08..7bd92bc1 100644 --- a/16/modex16/modex16.h +++ b/16/modex16/MODEX16.H @@ -7,18 +7,49 @@ #include "types.h" /* -========================== Types & Macros ==========================- */ -#define PAGE_OFFSET(x,y) ((y<<6)+(y<<4)+(x>>2)) +#define PAGE_OFFSET(x,y) (((y)<<6)+((y)<<4)+((x)>>2)) #define PLANE(x) (1<< (x&3)) typedef byte far* page_t; #define SELECT_ALL_PLANES() outpw(0x03c4, 0xff02) +typedef struct { + byte *data; + word width; + word height; + byte *palette; +} bitmap_t; /* -============================ Functions =============================- */ +/* mode switching, page, and plane functions */ void modexEnter(); void modexLeave(); void modexShowPage(page_t page); void modexPanPage(page_t *page, int dx, int dy); void modexSelectPlane(byte plane); void modexClearRegion(page_t page, int x, int y, int w, int h, byte color); +void modexDrawBmp(page_t page, int x, int y, bitmap_t *bmp, byte sprite); + +/* Palette fade and flash effects */ +void modexFadeOn(word fade, byte *palette); +void modexFadeOff(word fade, byte *palette); +void modexFlashOn(word fade, byte *palette); +void modexFlashOff(word fade, byte *palette); + +/* palette loading and saving */ +void modexPalSave(byte *palette); +byte *modexNewPal(); +void modexLoadPalFile(char *filename, byte **palette); +void modexSavePalFile(char *filename, byte *palette); + +/* fixed palette functions */ +void modexPalBlack(); +void modexPalWhite(); + +/* utility functions */ +void modexPalUpdate(byte *p); +void modexWaitBorder(); + +/* bitmap functions */ +bitmap_t modexLoadPcx(char *filename); /* -======================= Constants & Vars ==========================- */ extern byte far* VGA; /* The VGA Memory */ @@ -41,4 +72,8 @@ extern byte far* VGA; /* The VGA Memory */ #define INPUT_STATUS_1 0x03da #define DISPLAY_ENABLE 0x01 #define MAP_MASK 0x02 +#define PAL_READ_REG 0x03C7 /* Color register, read address */ +#define PAL_WRITE_REG 0x03C8 /* Color register, write address */ +#define PAL_DATA_REG 0x03C9 /* Color register, data port */ +#define PAL_SIZE (256 * 3) #endif