X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Flib%2F16_vl.h;h=ffe684eeb508dc8848e0f6a33cac8dd69fb08789;hb=a565be31ce92d6168ae6983042da75b0b683e52b;hp=a152cc35b764570791bad7c9340f06fd00d8d9d0;hpb=23c4d02d9d36e5c5aa030fa5d1413d1558fc8af0;p=16.git diff --git a/src/lib/16_vl.h b/src/lib/16_vl.h index a152cc35..ffe684ee 100755 --- a/src/lib/16_vl.h +++ b/src/lib/16_vl.h @@ -1,5 +1,5 @@ /* Project 16 Source Code~ - * Copyright (C) 2012-2017 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover + * Copyright (C) 2012-2019 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover * * This file is part of Project 16. * @@ -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 @@ -158,6 +164,7 @@ void VGAWRITEMODE(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 */ @@ -168,18 +175,18 @@ void VL_Startup (global_game_variables_t *gvar), 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); +//void VL_vgaSetMode(byte mode); byte VL_vgaGetMode(void); extern void TL_VidInit(global_game_variables_t *gvar); 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); @@ -195,13 +202,15 @@ 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, global_game_variables_t *gvar); void VL_LoadPalFileCore(byte *palette, global_game_variables_t *gvar); -void VL_LoadPalFilewithoffset(const char *filename, byte *palette, word o, global_game_variables_t *gvar); -void VL_UpdatePaletteWrite(byte *palette, word o, 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) @@ -213,12 +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); -void VL_MemToScreen (byte far *source, int width, int height, int x, int y, 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); @@ -249,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 VL_modexPrintTextBox(global_game_variables_t *gvar); -void modexpdump(page_t *pee); +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