/* Project 16 Source Code~\r
- * Copyright (C) 2012-2017 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover\r
+ * Copyright (C) 2012-2022 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover\r
*\r
* This file is part of Project 16.\r
*\r
#define MODEX16_H\r
\r
#include "src/lib/16_head.h"\r
+#include "src/lib/16_tail.h"\r
//#include "src/lib/planar.h"\r
//#include "src/lib/modex16/16planar.h"\r
#include "src/lib/16text.h"\r
\r
/* -======================= Constants & Vars ==========================- */\r
extern byte far* VGA; /* The VGA Memory */\r
+extern byte far gamepal;\r
+extern byte far corepal; //core palette used universally\r
#define SCREEN_SEG 0xa000\r
#define VIDEO_INT 0x10\r
#define SET_MODE 0x00\r
#define HIGH_ADDRESS 0x0C\r
#define LOW_ADDRESS 0x0D\r
#define VRETRACE 0x08\r
-//#define INPUT_STATUS_1 0x03da defined in 16_head\r
-#define STATUS_REGISTER_1 INPUT_STATUS_1\r
+//#define INPUT _STATUS_1 defined in 16_head\r
+//#define STATUS_REGISTER_1 0x03da\r
+\r
+#define STATUS_REGISTER_1 0x3da\r
+\r
#define ATR_INDEX AC_INDEX\r
#define ATR_OVERSCAN 17\r
#define DISPLAY_ENABLE 0x01\r
void modexFlashOff(word fade, byte *palette);\r
\r
/* palette loading and saving */\r
+void VL_SetPalette (byte far *palette, video_t *v);\r
void modexPalSave(byte *palette);\r
-//byte *modexNewPal();\r
+byte *modexNewPal();\r
void modexLoadPalFile(char *filename, byte *palette);\r
+static void loadPcxStage1(FILE *file, bitmap_t *result);\r
+void loadPcxPalette(FILE *file, bitmap_t *result);\r
+bitmap_t bitmapLoadPcx(char *filename);\r
+tileset_t bitmapLoadPcxTiles(char *filename, word twidth, word theight);\r
+void oldDrawBmp(byte far* page, int x, int y, bitmap_t *bmp, byte sprite);\r
+void modexDrawBmp(page_t *page, int x, int y, bitmap_t *bmp);\r
+void modexDrawBmpRegion(page_t *page, int x, int y, int rx, int ry, int rw, int rh, bitmap_t *bmp);\r
+void modexDrawSprite(page_t *page, int x, int y, bitmap_t *bmp);\r
+void modexDrawSpriteRegion(page_t *page, int x, int y, int rx, int ry, int rw, int rh, bitmap_t *bmp);\r
+void modexDrawBmpPBuf(page_t *page, int x, int y, planar_buf_t *bmp); /*pbuf version*/\r
+void modexDrawBmpPBufRegion(page_t *page, int x, int y, int rx, int ry, int rw, int rh, planar_buf_t *bmp);\r
+void modexDrawSpritePBuf(page_t *page, int x, int y, planar_buf_t *bmp);\r
+void modexDrawSpritePBufRegion(page_t *page, int x, int y, int rx, int ry, int rw, int rh, planar_buf_t *bmp);\r
void VL_LoadPalFile(const char *filename, byte *palette, global_game_variables_t *gvar);\r
void VL_LoadPalFileCore(byte *palette, global_game_variables_t *gvar);\r
-void VL_LoadPalFilewithoffset(const char *filename, byte *palette, word o, global_game_variables_t *gvar);\r
-void VL_UpdatePaletteWrite(byte *palette, word o, global_game_variables_t *gvar);\r
+void VL_SetCorePal(global_game_variables_t *gvar);\r
+void VLL_LoadPalFilewithoffset(const char *filename, byte *palette, word o, word palsize, global_game_variables_t *gvar);\r
+void VL_UpdatePaletteWrite(byte *palette, word o, word palsize, global_game_variables_t *gvar);\r
void VL_PaletteSync(global_game_variables_t *gvar);\r
void modexSavePalFile(char *filename, byte *palette);\r
#define MenuFadeIn() VL_FadeIn(0,255,&gamepal,10)\r
/* utility functions */\r
void modexPalUpdate(byte *p);\r
void VL_modexPalScramble(byte *p);\r
-word modexPalOverscan(word col);\r
+word VL_modexPalOverscan(byte *p, word col);\r
void VL_ColorBorder (int color, video_t *v);\r
void VL_Plot (int x, int y, int color, global_game_variables_t *gvar);\r
void VL_Hlin (unsigned x, unsigned y, unsigned width, unsigned color, global_game_variables_t *gvar);\r
void modexprint(page_t *page, sword x, sword y, word t, boolean tlsw, word color, word bgcolor, boolean vidsw, const byte *str);\r
void modexprintbig(page_t *page, word x, word y, word t, word col, word bgcol, const byte *str);\r
void VL_modexPrintTextBox(global_game_variables_t *gvar);\r
-void modexpdump(page_t *pee);\r
+void VL_print(const byte *str, nibble pagenum, global_game_variables_t *gvar);\r
+void modexpdump(nibble pagenum, global_game_variables_t *gvar);\r
void VL_PatternDraw(video_t *video, word pn, boolean sw, boolean allsw);\r
void modexWaitBorder();\r
void modexWaitBorder_start();\r