EXEC = &
16.exe &
bakapi.exe &
- $(TESTEXEC)
+ $(TESTEXEC) &
+ $(UTILEXEC)
#!ifdef __LINUX__
#EXEC += $(SPRIUTILEXEC)
unsigned int bufsz;\r
int fd;\r
//nibble i;\r
- char *bakapee1,*bakapee2;\r
+ //char *bakapee1,*bakapee2;\r
+ char bakapee1[64] = FILENAME_1;\r
+ char bakapee2[64] = FILENAME_2;\r
\r
boolean anim=1,noanim=0,zerostoppause=1;\r
\r
- bakapee1=malloc(64);\r
- bakapee2=malloc(64);\r
+// bakapee1=mALLoc(64);\r
+// bakapee2=mALLoc(64);\r
\r
- if (argc < 2) {\r
+ if (argc >= 2) {\r
+/* if (argc < 2) {\r
//fprintf(stderr,"drawvrl <VRL file> <palette file>\n palette file optional\n");\r
bakapee1 = FILENAME_1;//"data/aconita.vrl";\r
bakapee2 = FILENAME_2;//"data/aconita.pal";\r
\r
}else{\r
if(argv[1]) bakapee1 = argv[1];\r
- if(argv[2]) bakapee2 = argv[2];\r
+ if(argv[2]) bakapee2 = argv[2];*/\r
+ if(argv[1]){ strcpy(bakapee1, argv[1]);//bakapee1[] = *argv[1];\r
+ if(argv[2]) strcpy(bakapee2, argv[2]); }//bakapee2[] = argv[2]; }\r
}\r
\r
fd = open(bakapee1,O_RDONLY|O_BINARY);\r
return 1;\r
}\r
VGAmodeX(1, 1, &gvar);\r
- modexPalUpdate0(gvar.video.palette);\r
+ VL_modexPalScramble(gvar.video.palette);\r
\r
/* load color palette */\r
VL_LoadPalFile(bakapee2, &gvar.video.palette);\r
buffer = NULL;\r
free(buffer);\r
bufsz = 0;\r
- free(bakapee1);\r
- free(bakapee2);\r
+// free(bakapee1); free(bakapee2);\r
printf("\nProject 16 0.exe. This is just a test file!\n");\r
printf("version %s\n", VERSION);\r
//SCROLLEXITMESG;\r
#include "src/lib/16_ca.h"\r
#include "src/lib/16_mm.h"\r
#include "src/lib/16_hc.h"\r
-//#include "src/lib/16_vl.h"\r
#include "src/lib/16_dbg.h"\r
\r
#pragma hdrstop\r
\r
#define KEYP IN_Shutdown(&gvar); printf("\n\npress any key to continue!\n"); getch(); IN_Startup(&gvar);\r
\r
-#define BBUFNAME bigbuffer//gvar.ca.tinf[0]\r
-#define INITBBUF static memptr BBUFNAME;\r
+#define BBUFNAME gvar.mm.bufferseg//bigbuffer\r
+//#define INITBBUF static memptr BBUFNAME;\r
#define BBUFPTR MEMPTR BBUFNAME\r
\r
#ifdef __BORLANDC__\r
-#define BBUF (memptr *)BBUFPTR//\r
+#define BBUF (memptr *)BBUFPTR\r
#define BBUFSTRING (memptr *)BBUFNAME\r
#endif\r
#ifdef __WATCOMC__\r
}\r
#endif\r
\r
+#ifdef __16_PM__\r
+#ifdef __DEBUG_PM__\r
+ dbg_debugpm=1; //debug pm\r
+#endif\r
+#endif\r
+#ifdef __DEBUG_CA__\r
+ dbg_debugca=1;\r
+#endif\r
+#ifdef __DEBUG_MM__\r
+ dbg_debugmm=1;\r
+#endif\r
+\r
+//===========================================================================//\r
+\r
+//=======================================//\r
\r
+// main\r
\r
+//=======================================//\r
void\r
main(int argc, char *argv[])\r
{\r
byte w;\r
-#ifndef NOVID\r
+ #ifndef NOVID\r
boolean done;\r
ScanCode scan;\r
-#endif\r
+ #endif\r
static global_game_variables_t gvar;\r
-#ifdef INITBBUF\r
+ #ifdef INITBBUF\r
INITBBUF\r
-#endif\r
+ #endif\r
+#if 0\r
//#ifdef __WATCOMC__\r
-// __segment sega;\r
-//#endif\r
- char *bakapee1,*bakapee2;\r
+ __segment sega;\r
+#endif\r
+ char bakapee1[64] = "data/koishi~.pcx";\r
+ char bakapee2[64] = "data/test.map";\r
word baka;\r
\r
-#ifdef __BORLANDC__\r
- argc=argc;\r
-#endif\r
- //file name //\r
- bakapee1 = malloc(24);\r
- bakapee2 = malloc(24);\r
- //file name //\r
+ #ifdef __BORLANDC__\r
+ argc=argc;\r
+ #endif\r
\r
-#ifdef __16_PM__\r
-#ifdef __DEBUG_PM__\r
- dbg_debugpm=1; //debug pm\r
-#endif\r
-#endif\r
+ #ifdef PRINTBBDUMP\r
+ //0000PRINTBB; KEYP\r
+ #endif\r
\r
-#ifdef __DEBUG_CA__\r
- dbg_debugca=1;\r
-#endif\r
-#ifdef PRINTBBDUMP\r
-//0000PRINTBB; KEYP\r
-#endif\r
- if(argv[1]){ bakapee1 = argv[1];\r
- if(argv[2]) bakapee2 = argv[2]; }\r
+ if(argv[1]){ strcpy(bakapee1, argv[1]);//bakapee1[] = *argv[1];\r
+ if(argv[2]) strcpy(bakapee2, argv[2]); }//bakapee2[] = argv[2]; }\r
+#if 0\r
else{\r
//{ printf("filename!: "); scanf("%[^\n]", &bakapee); }\r
- bakapee1 = "data/koishi~.pcx";\r
- bakapee2 = "data/test.map";\r
+ strcpy(bakapee1, "data/koishi~.pcx"); //bakapee1 = "data/koishi~.pcx";\r
+ strcpy(bakapee2, "data/test.map"); //bakapee2 = "data/test.map";\r
}\r
-#ifndef NOVID\r
- Startup16(&gvar);\r
+#endif\r
+ printf("bakapee1[%s]\n", bakapee1);\r
+ printf("bakapee2[%s]\n", bakapee2);\r
+ KEYP\r
\r
+ #ifndef NOVID\r
+ Startup16(&gvar);\r
// save the palette\r
-#ifdef __WATCOMC__\r
+ #ifdef __WATCOMC__\r
modexPalSave(&gvar.video.dpal); modexFadeOff(4, &gvar.video.dpal); //modexPalBlack();\r
-#endif\r
-#else //NOVID\r
+ #endif\r
+ #else //NOVID\r
//printf("main()=%Fp start MM\n", *argv[0]);\r
- MM_Startup(&gvar); //printf("ok\n");\r
-#ifdef __16_PM__\r
-#ifdef __DEBUG_PM__\r
- if(dbg_debugpm>0)\r
- {\r
-#endif\r
- PM_Startup(&gvar); PM_CheckMainMem(&gvar); PM_UnlockMainMem(&gvar);\r
-//0000 printf("PM Started\n"); KEYP\r
-#ifdef __DEBUG_PM__\r
- }\r
-#endif\r
-#endif\r
+ MM_Startup(&gvar);\r
+ #ifdef __16_PM__\r
+ #ifdef __DEBUG_PM__\r
+ if(dbg_debugpm>0)\r
+ {\r
+ #endif //__DEBUG_PM__\r
+ PM_Startup(&gvar); PM_CheckMainMem(&gvar); PM_UnlockMainMem(&gvar);\r
+ //0000printf("PM Started\n"); KEYP\r
+ #ifdef __DEBUG_PM__\r
+ }\r
+ #endif //__DEBUG_PM__\r
+ #endif //__16_PM__\r
+ #endif //elsed NOVID\r
\r
-#endif //NOVID\r
-#ifdef __DEBUG_MM__\r
- dbg_debugmm=0;\r
-#endif\r
CA_Startup(&gvar);\r
-// printf(" done!\n");\r
-#ifdef PRINTBBDUMP\r
-//0000\r
+ #ifdef PRINTBBDUMP\r
+ //0000\r
PRINTBB; KEYP\r
-#endif\r
-#ifdef __DEBUG_MM__\r
- dbg_debugmm=1;\r
-#endif\r
+ #endif\r
\r
w=0;\r
-#ifdef FILEREADLOAD\r
-#ifdef FILEREAD\r
+ #ifdef FILEREADLOAD\r
+ #ifdef FILEREAD\r
for(;w<2;w++)\r
{\r
// printf("size of big buffer~=%u\n", _bmsize(segu, BBUF));\r
if(CA_ReadFile(bakapee2, BBUFPTR, &gvar)) baka=1; else baka=0;\r
printf("====================================read end===================================\n");\r
}\r
-#endif\r
+ #endif //FILEREAD\r
if(w==0)\r
{\r
printf("======================================load=====================================\n");\r
if(CA_LoadFile(bakapee1, BBUFPTR, &gvar)) baka=1; else baka=0;\r
printf("====================================load end===================================\n");\r
}\r
-//#ifdef __WATCOMC__\r
-// printf("\nsize of big buffer~=%u\n", _bmsize(sega, BBUF));\r
-//#endif\r
-#ifdef BUFFDUMP\r
+ //#ifdef __WATCOMC__\r
+ // printf("\nsize of big buffer~=%u\n", _bmsize(sega, BBUF));\r
+ //#endif\r
+ #ifdef BUFFDUMP\r
printf("contents of the buffer\n[\n%s\n]\n", BBUFSTRING);\r
-#endif// #else\r
-#ifdef PRINTBBDUMP\r
+ #endif// #else\r
+ #ifdef PRINTBBDUMP\r
PRINTBB;\r
-#endif\r
+ #endif\r
\r
-//endif // BUFFDUMP\r
+ //endif // BUFFDUMP\r
\r
//printf("dark purple = purgable\n");\r
//printf("medium blue = non purgable\n");\r
// DebugMemory_(&gvar, 1);\r
if(baka) printf("\nyay!\n");\r
else printf("\npoo!\n");\r
-#ifdef BUFFDUMPPAUSE\r
+ #ifdef BUFFDUMPPAUSE\r
KEYP\r
-#endif\r
-#ifdef FILEREAD\r
+ #endif\r
+ #ifdef FILEREAD\r
}\r
-#endif\r
-#ifndef BUFFDUMPPAUSE\r
- KEYP\r
-#endif\r
-#endif //filereadload\r
+ #endif\r
+ #endif //filereadload\r
\r
#ifdef __WATCOMC__\r
#ifndef NOVID\r
//printf("bakapee1=%s\n", bakapee1);\r
//printf("bakapee2=%s\n", bakapee2);\r
MM_FreePtr(BBUFPTR, &gvar);\r
-#ifndef NOVID\r
+ #ifndef NOVID\r
Shutdown16(&gvar);\r
-#else\r
-#ifdef __16_PM__\r
-#ifdef __DEBUG_PM__\r
- if(dbg_debugpm>0)\r
-#endif\r
- PM_Shutdown(&gvar);\r
-#endif\r
+ #else //novid\r
+ #ifdef __16_PM__\r
+ #ifdef __DEBUG_PM__\r
+ if(dbg_debugpm>0)\r
+ #endif //__DEBUG_PM__\r
+ PM_Shutdown(&gvar);\r
+ #endif //__16_PM__\r
CA_Shutdown(&gvar);\r
MM_Shutdown(&gvar);\r
-#endif //NOVID\r
+ #endif //NOVID\r
IN_Shutdown(&gvar);\r
- free(bakapee1); free(bakapee2);\r
printf("========================================\n");\r
- printf("near= %Fp ", gvar.mm.nearheap);\r
- printf("far= %Fp", gvar.mm.farheap);\r
+ printf("near= %Fp ", gvar.mm.nearheap);\r
+ printf("far= %Fp", gvar.mm.farheap);\r
printf("\n");\r
- printf("&near= %Fp ", &(gvar.mm.nearheap));\r
- printf("&far= %Fp", &(gvar.mm.farheap));\r
+ printf("&near= %Fp ", &(gvar.mm.nearheap));\r
+ printf("&far= %Fp", &(gvar.mm.farheap));\r
printf("\n");\r
-#ifdef EXMMVERBOSE\r
- printf("bigb= %Fp ", BBUF);\r
- //printf("bigbr= %04x", BBUF);\r
+ #ifdef EXMMVERBOSE\r
+ printf("bigb= %Fp ", BBUF);\r
+ //printf("bigbr= %04x", BBUF);\r
//printf("\n");\r
- printf("&bigb=%Fp ", BBUFPTR);\r
- //printf("&bigb=%04x", BBUFPTR);\r
+ printf("&bigb=%Fp ", BBUFPTR);\r
+ //printf("&bigb=%04x", BBUFPTR);\r
printf("\n");\r
-#endif\r
+ #endif\r
printf("========================================\n");\r
\r
-#ifdef EXMMVERBOSE__\r
+ #ifdef EXMMVERBOSE__\r
printf("coreleft(): %u\n", _memavl());\r
printf("farcoreleft(): %lu\n", (dword)HC_farcoreleft());\r
-#endif\r
+ #endif\r
#ifdef __WATCOMC__\r
//this is far printf("Total free: %lu\n", (dword)(HC_GetFreeSize()));\r
//super buggy printf("HC_coreleft(): %u\n", HC_coreleft());\r
#endif\r
printf(".exe. This is just a test file!\n");\r
printf("version %s\n", VERSION);\r
+\r
+//end of program\r
+\r
+\r
#if defined(__DEBUG__) && ( defined(__DEBUG_PM__) || defined(__DEBUG_MM__) )\r
#ifdef __DEBUG_MM__\r
printf("debugmm: %u\t", dbg_debugmm);\r
#define pokeb(segm,ofs,value) (peekb((segm),(ofs)) = (byte)(value))\r
#define poke(segm,ofs,value) (peek((segm),(ofs)) = (word)(value))\r
\r
-#define inportb(port) inp(port)\r
-#define inport(port) inpw(port)\r
-#define outportb(port, val) outp(port, val)\r
-#define outport(port, val) outpw(port, val)\r
+#define inportb(port) inp(port)\r
+#define inport(port) inpw(port)\r
+#define outportb(port, val) outp(port, val)\r
+#define outport(port, val) outpw(port, val)\r
\r
-//#define asm __asm\r
+#define asm __asm\r
#define getvect _dos_getvect\r
#define setvect _dos_setvect\r
\r
}\r
\r
void\r
-modexPalUpdate0(byte *p)\r
+//modexPalUpdate0(byte *p)\r
+VL_modexPalScramble(byte *p)\r
{\r
int i;\r
//modexWaitBorder();\r
\r
/* utility functions */\r
void modexPalUpdate(byte *p);\r
-void modexPalUpdate0(byte *p);\r
+void VL_modexPalScramble(byte *p);\r
word modexPalOverscan(word col);\r
void VL_Plot (int x, int y, int color, ofs_t *ofs);\r
void VL_Hlin (unsigned x, unsigned y, unsigned width, unsigned color, ofs_t *ofs);\r
\r
#include "src/lib/16_vl.h"\r
\r
-void\r
-main(int argc, char *argv[])\r
+void main(int argc, char *argv[])\r
{\r
static global_game_variables_t gvar;\r
- char *bakapee;\r
+ char bakapee[64] = "data\default.pal";\r
+\r
+ if(argv[1]) strcpy(bakapee, argv[1]);\r
\r
- bakapee = malloc(64);\r
- if(argv[1]) bakapee = argv[1];\r
- else bakapee = "data/default.pal";\r
\r
VGAmodeX(1, 1, &gvar);\r
\r
modexSavePalFile(bakapee, &(gvar.video.palette));\r
\r
VGAmodeX(0, 1, &gvar);\r
- free(bakapee);\r
-\r
}\r
#include "src/lib/16_vl.h"\r
#include "src/lib/bakapee.h"\r
\r
-char *bakapee;\r
word i;\r
\r
-void\r
-main(int argc, char *argv[])\r
+void main(int argc, char *argv[])\r
{\r
static global_game_variables_t gvar;\r
- bakapee = malloc(64);\r
- if(argv[1]) bakapee = argv[1];\r
- else bakapee = "data/default.pal";\r
+ char bakapee[64] = "data\default.pal";\r
+\r
+ if(argv[1]) strcpy(bakapee, argv[1]);\r
+\r
+\r
modexPalSave(&(gvar.video.palette));\r
+ VL_modexPalScramble(&(gvar.video.palette));\r
VGAmodeX(1, 1, &gvar);\r
gvar.video.page[0] = modexDefaultPage(&gvar.video.page[0]);\r
modexPalBlack();\r
modexPalUpdate(&(gvar.video.palette));\r
modexFadeOn(1, &(gvar.video.palette));\r
modexpdump(&gvar.video.page[0]);\r
- getch();\r
+// getch();\r
VGAmodeX(0, 0, &gvar);\r
modexPalUpdate(&(gvar.video.palette));\r
/*for(i=0;i<768;i++)\r
{\r
printf("%02X ", pal[i]);\r
}*/\r
- free(bakapee);\r
}\r
void main(int argc, char *argv[])\r
{\r
static global_game_variables_t gvar;\r
- char *bakapee1,*bakapee1p;\r
struct glob_game_vars *ggvv;\r
// sword bakapee;\r
// if(argv[1]) bakapee = atoi(argv[1]);\r
// else bakapee = 1;\r
+ //char *bakapee1,*bakapee1p;\r
+ char bakapee1[64] = FILENAME_1;\r
+ char bakapee1p[64] = FILENAME_1P;\r
\r
Startup16(&gvar);\r
\r
- bakapee1=malloc(64);\r
- bakapee1p=malloc(64);\r
+// bakapee1=mALLoc(64);\r
+// bakapee1p=mALLoc(64);\r
ggvv=&gvar;\r
\r
- if (argc < 2) {\r
+ if (argc >= 2) {\r
+/* if (argc < 2) {\r
//fprintf(stderr,"drawvrl <VRL file> <palette file>\n palette file optional\n");\r
bakapee1 = FILENAME_1;\r
bakapee1p = FILENAME_1P;\r
\r
}else{\r
if(argv[1]) bakapee1 = argv[1];\r
- if(argv[2]) bakapee1p = argv[2];\r
+ if(argv[2]) bakapee1p = argv[2];*/\r
+ if(argv[1]){ strcpy(bakapee1, argv[1]);\r
+ if(argv[2]) strcpy(bakapee1p, argv[2]); }\r
}\r
\r
// OK, this one takes hellova time and needs to be done in farmalloc or MM_...\r
#ifdef FADE\r
modexFadeOff(4, &gvar.video.palette);\r
#endif\r
- Quit(&gvar, "Wrong ID for sprite");\r
+ Quit (&gvar, "Wrong ID for sprite");\r
#ifdef FADE\r
modexFadeOn(4, &gvar.video.dpal);\r
#endif\r
if(gvar.player[0].enti.q == (TILEWH/(gvar.player[0].enti.speed))+1 && gvar.player[0].info.dir != 2 && (gvar.player[0].enti.triggerx == 5 && gvar.player[0].enti.triggery == 5)){ gvar.player[0].enti.hp--; }\r
//debugging binds!\r
\r
- if(gvar.in.inst->Keyboard[24]){ modexPalUpdate0(&gvar.video.palette); /*paloffset=0;*/ modexpdump(gvar.mv[0].page); IN_UserInput(1, &gvar); } //o\r
- if(gvar.in.inst->Keyboard[22]){ modexPalUpdate0(&gvar.video.palette); } //u\r
+ if(gvar.in.inst->Keyboard[24]){ VL_modexPalScramble(&gvar.video.palette); /*paloffset=0;*/ modexpdump(gvar.mv[0].page); IN_UserInput(1, &gvar); } //o\r
+ if(gvar.in.inst->Keyboard[22]){ VL_modexPalScramble(&gvar.video.palette); } //u\r
\r
TAIL_FUNCTIONKEYFUNCTIONS\r
TAIL_FUNCTIONKEYDRAWJUNK\r
{\r
if(gvar.in.inst->Keyboard[sc_J])\r
{\r
- bakapee1=FILENAME_1;\r
- bakapee1p=FILENAME_1P;\r
+// bakapee1=FILENAME_1;\r
+// bakapee1p=FILENAME_1P;\r
+ strcpy(bakapee1, FILENAME_1);\r
+ strcpy(bakapee1p, FILENAME_1P);\r
gvar.player[0].enti.overdraww=0;\r
}\r
if(gvar.in.inst->Keyboard[sc_K])\r
{\r
- bakapee1=FILENAME_2;\r
- bakapee1p=FILENAME_2P;\r
+// bakapee1=FILENAME_2;\r
+// bakapee1p=FILENAME_2P;\r
+ strcpy(bakapee1, FILENAME_2);\r
+ strcpy(bakapee1p, FILENAME_2P);\r
gvar.player[0].enti.overdraww=2;\r
}\r
//read_vrs(&gvar, bakapee1, gvar.player[0].enti.spri->spritesheet);\r
#endif\r
if(gvar.in.inst->Keyboard[sc_R]){ modexPalOverscan(rand()%56); } //r\r
\r
- if((gvar.player[0].enti.q==1) && !(gvar.player[0].enti.x%TILEWH==0 && gvar.player[0].enti.y%TILEWH==0)) Quit(&gvar, "PLAYER OFF THE RAILS!");//break; //incase things go out of sync!\r
+ if((gvar.player[0].enti.q==1) && !(gvar.player[0].enti.x%TILEWH==0 && gvar.player[0].enti.y%TILEWH==0)) Quit (&gvar, "PLAYER OFF THE RAILS!");//break; //incase things go out of sync!\r
}\r
\r
/* fade back to text mode */\r