X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Flib%2F16_vl.h;h=6ac00f2865da989cdee8b5d4a2b856399193c63d;hb=b8c9d5fcb2b66420bc673f54b14cc5d0ea5283ed;hp=962593c702d0c7389e6baa508834aa4a051b6284;hpb=946dfbe9b29be3a3b180c37e0b414a938e867dc6;p=16.git diff --git a/src/lib/16_vl.h b/src/lib/16_vl.h index 962593c7..6ac00f28 100755 --- a/src/lib/16_vl.h +++ b/src/lib/16_vl.h @@ -26,6 +26,7 @@ #define MODEX16_H #include "src/lib/16_head.h" +#include "src/lib/16_tail.h" //#include "src/lib/planar.h" //#include "src/lib/modex16/16planar.h" #include "src/lib/16text.h" @@ -67,6 +68,8 @@ typedef union /* -======================= Constants & Vars ==========================- */ extern byte far* VGA; /* The VGA Memory */ +extern byte far gamepal; +extern byte far corepal; //core palette used universally #define SCREEN_SEG 0xa000 #define VIDEO_INT 0x10 #define SET_MODE 0x00 @@ -125,8 +128,11 @@ extern byte far* VGA; /* The VGA Memory */ #define HIGH_ADDRESS 0x0C #define LOW_ADDRESS 0x0D #define VRETRACE 0x08 -//#define INPUT_STATUS_1 0x03da defined in 16_head -#define STATUS_REGISTER_1 INPUT_STATUS_1 +//#define INPUT _STATUS_1 defined in 16_head +//#define STATUS_REGISTER_1 0x03da + +#define STATUS_REGISTER_1 0x3da + #define ATR_INDEX AC_INDEX #define ATR_OVERSCAN 17 #define DISPLAY_ENABLE 0x01 @@ -151,29 +157,36 @@ extern byte far* VGA; /* The VGA Memory */ // // VGA hardware routines // - -void VGAMAPMASK(byte x); -void VGAWRITEMODE(byte x); -void VGAREADMAP(byte x); +void VGAWRITEMODE(byte x), + VGAMAPMASK(byte x), + VGAREADMAP(byte x), + VGABITMASK(byte x); #define VW_Hlin(x,z,y,c,q) VL_Hlin(x,y,(z)-(x)+1,c,q) #define VW_Vlin(y,z,x,c,q) VL_Vlin(x,y,(z)-(y)+1,c,q) +#define PALPROGRAMSNEWPAGE gvar.video.page[0] = modexDefaultPage(&gvar.video.page[0], &gvar);// modexFadeOn(4, &gvar.video.palette); /* -============================ Functions =============================- */ /* mode switching, page, and plane functions */ -void VGAmodeX(sword vq, boolean cmem, global_game_variables_t *gv); -void modexEnter(sword vq, boolean cmem, global_game_variables_t *gv); -byte vgaGetMode(); +void VL_Startup (global_game_variables_t *gvar), + VL_Shutdown (global_game_variables_t *gvar), + VL_SetVGAPlaneMode (global_game_variables_t *gvar), + VL_ClearVideo (byte color), + VL_DePlaneVGA (), + VGAmodeX(sword vq, boolean cmem, global_game_variables_t *gv), + modexEnter(sword vq, boolean cmem, global_game_variables_t *gv); +//void VL_vgaSetMode(byte mode); +byte VL_vgaGetMode(void); extern void TL_VidInit(global_game_variables_t *gvar); -void modexLeave(); +void modexLeave(void); void modexsetBaseXMode(); -page_t modexDefaultPage(page_t *p); +page_t modexDefaultPage(page_t *p, global_game_variables_t *gvar); page_t modexNextPage(page_t *p); page_t modexNextPageFlexibleSize(page_t *p, word x, word y); void modexCalcVmemRemain(video_t *video); void VL_Initofs(video_t *video); -void modexHiganbanaPageSetup(video_t *video); -//void modexShowPage(page_t *page); +void modexHiganbanaPageSetup(global_game_variables_t *gvar); +void modexShowPage(page_t *page);//for 0croll.exe void VL_ShowPage(page_t *page, boolean vsync, boolean sr); void modexPanPage(page_t *page, int dx, int dy); void modexSelectPlane(byte plane); @@ -189,12 +202,16 @@ void modexFlashOn(word fade, byte *palette); void modexFlashOff(word fade, byte *palette); /* palette loading and saving */ +void VL_SetPalette (byte far *palette, video_t *v); void modexPalSave(byte *palette); //byte *modexNewPal(); void modexLoadPalFile(char *filename, byte *palette); -void VL_LoadPalFile(const char *filename, byte *palette); -void VL_LoadPalFilewithoffset(const char *filename, byte *palette, word o); -void VL_UpdatePaletteWrite(byte *palette, word o); +void VL_LoadPalFile(const char *filename, byte *palette, global_game_variables_t *gvar); +void VL_LoadPalFileCore(byte *palette, global_game_variables_t *gvar); +void VL_SetCorePal(global_game_variables_t *gvar); +void VLL_LoadPalFilewithoffset(const char *filename, byte *palette, word o, word palsize, global_game_variables_t *gvar); +void VL_UpdatePaletteWrite(byte *palette, word o, word palsize, global_game_variables_t *gvar); +void VL_PaletteSync(global_game_variables_t *gvar); void modexSavePalFile(char *filename, byte *palette); #define MenuFadeIn() VL_FadeIn(0,255,&gamepal,10) @@ -205,11 +222,13 @@ void modexPalWhite(); /* utility functions */ void modexPalUpdate(byte *p); void VL_modexPalScramble(byte *p); -word modexPalOverscan(word col); -void VL_Plot (int x, int y, int color, ofs_t *ofs); -void VL_Hlin (unsigned x, unsigned y, unsigned width, unsigned color, ofs_t *ofs); -void VL_Vlin (int x, int y, int height, int color, ofs_t *ofs); -void VL_Bar (int x, int y, int width, int height, int color, ofs_t *ofs); +word VL_modexPalOverscan(byte *p, word col); +void VL_ColorBorder (int color, video_t *v); +void VL_Plot (int x, int y, int color, global_game_variables_t *gvar); +void VL_Hlin (unsigned x, unsigned y, unsigned width, unsigned color, global_game_variables_t *gvar); +void VL_Vlin (int x, int y, int height, int color, global_game_variables_t *gvar); +void VL_Bar (int x, int y, int width, int height, int color, global_game_variables_t *gvar); +void VL_MemToScreen (byte far *source, int width, int height, int x, int y, global_game_variables_t *gvar); void modexputPixel(page_t *page, int x, int y, byte color); byte modexgetPixel(page_t *page, int x, int y); @@ -240,16 +259,17 @@ static inline byte modexreadPixel(page_t *page, int x, int y, word addr) #endif void modexDrawChar(page_t *page, int x/*for planar selection only*/, word t, word col, word bgcol, word addr); -void modexprint(page_t *page, sword x, sword y, word t, boolean tlsw, word col, word bgcol, boolean sw, const byte *str); +void modexprint(page_t *page, sword x, sword y, word t, boolean tlsw, word color, word bgcolor, boolean vidsw, const byte *str); void modexprintbig(page_t *page, word x, word y, word t, word col, word bgcol, const byte *str); -void modexpdump(page_t *pee); -void modexcls(page_t *page, byte color, byte *Where); +void VL_modexPrintTextBox(global_game_variables_t *gvar); +void VL_print(const byte *str, nibble pagenum, global_game_variables_t *gvar); +void modexpdump(nibble pagenum, global_game_variables_t *gvar); void VL_PatternDraw(video_t *video, word pn, boolean sw, boolean allsw); void modexWaitBorder(); void modexWaitBorder_start(); void modexWaitBorder_end(); void VL_WaitVBL(word num); -void VL_SetLineWidth (unsigned width, ofs_t *ofs); +void VL_SetLineWidth (unsigned width, global_game_variables_t *gvar); void VL_PrintmodexmemInfo(video_t *v); #endif