--- /dev/null
+\r
+ == default ==\r
+\r
+ USED block at 2e770016 of size 6146\r
+ USED block at 2e771818 of size 20\r
+ USED block at 2e77182c of size 66\r
+ USED block at 2e77186e of size 50\r
+ USED block at 2e7718a0 of size 50\r
+ USED block at 2e7718d2 of size 50\r
+ USED block at 2e771904 of size 50\r
+ USED block at 2e771936 of size 50\r
+ USED block at 2e771968 of size 50\r
+ USED block at 2e77199a of size 50\r
+ USED block at 2e7719cc of size 50\r
+ USED block at 2e7719fe of size 50\r
+ USED block at 2e771a30 of size 50\r
+ USED block at 2e771a62 of size 50\r
+ USED block at 2e771a94 of size 50\r
+ FREE block at 2e771ac6 of size 29618\r
+ USED block at 2e778e78 of size 1202\r
+ USED block at 2e77932a of size 1202\r
+ USED block at 2e7797dc of size 1202\r
+ USED block at 2e779c8e of size 136\r
+ USED block at 2e779d16 of size 22\r
+ FREE block at 2e779d2c of size 8202\r
+ERROR - bad node in heap\r
+\r
+ == near ==\r
+\r
+ FREE block at 1e76f9a6 of size 12\r
+ FREE block at 1e76f9b2 of size 320\r
+ FREE block at 1e76faf2 of size 52\r
+ FREE block at 1e76fb26 of size 20\r
+ FREE block at 1e76fb3a of size 20\r
+ FREE block at 1e76fb4e of size 20\r
+ FREE block at 1e76fb62 of size 20\r
+ FREE block at 1e76fb76 of size 20\r
+ FREE block at 1e76fb8a of size 1138\r
+OK - end of heap\r
+\r
+ == far ==\r
+\r
+ FREE block at 2e770016 of size 6146\r
+ FREE block at 2e771818 of size 20\r
+ FREE block at 2e77182c of size 66\r
+ FREE block at 2e77186e of size 50\r
+ FREE block at 2e7718a0 of size 50\r
+ FREE block at 2e7718d2 of size 50\r
+ FREE block at 2e771904 of size 50\r
+ FREE block at 2e771936 of size 50\r
+ FREE block at 2e771968 of size 50\r
+ FREE block at 2e77199a of size 50\r
+ FREE block at 2e7719cc of size 50\r
+ FREE block at 2e7719fe of size 50\r
+ FREE block at 2e771a30 of size 50\r
+ FREE block at 2e771a62 of size 50\r
+ FREE block at 2e771a94 of size 50\r
+ FREE block at 2e771ac6 of size 29618\r
+ FREE block at 2e778e78 of size 1202\r
+ FREE block at 2e77932a of size 1202\r
+ FREE block at 2e7797dc of size 1202\r
+ FREE block at 2e779c8e of size 136\r
+ FREE block at 2e779d16 of size 22\r
+ FREE block at 2e779d2c of size 8202\r
+ERROR - bad node in heap\r
+\r
+Memory Type Total Used Free\r
+---------------- -------- -------- --------\r
+Default 48416 10596 37820\r
+Near 1622 484 1138\r
+Far 48416 10596 37820\r
+---------------- -------- -------- --------\r
+HC_coreleft = 1136\r
+HC_farcoreleft = 417792\r
+HC_GetFreeSize = 37820\r
+HC_GetNearFreeSize = 1138\r
+HC_GetFarFreeSize = 37820\r
+memavl = 1136\r
+stackavail = 31484\r
# serial output is plain text ASCII.
DEBUGSERIAL=1
-DELLOGFILE=1
+DELLOGFILE=0
#192x144
#wwww will add these
/* setup camera and screen~ */\r
modexHiganbanaPageSetup(&gvar);\r
ZC_MVSetup(&gvar.mv, &map, &gvar);\r
- ZC_ShowMV(&gvar.mv, gvar.video.sp, 0);\r
+ //ZC_ShowMV(&gvar.mv, gvar.video.sp, 0);\r
+ VL_ShowPage(&gvar.video.page[gvar.video.sp], 0, 0);\r
\r
// VL_PatternDraw(video_t *video, word pn, boolean sw, boolean allsw);\r
VL_PatternDraw(&gvar.video, 0/*gvar.video.sp*/, 0, 1);\r
\r
//===========================================================================//\r
\r
- ZC_ShowMV(&gvar.mv, 0, 0);\r
+ //ZC_ShowMV(&gvar.mv, 0, 0);\r
+ VL_ShowPage(&gvar.video.page[gvar.video.sp], 0, 0);\r
if(!noanim) {\r
/* another handy "demo" effect using VGA write mode 1.\r
* we can take what's on screen and vertically squash it like an old analog TV set turning off. */\r
#endif\r
#endif//profile\r
\r
+#ifdef SHOWMEMINFO\r
#ifdef __BORLANDC__\r
unlink("meminfo.16b");\r
gvar->handle.showmemhandle = open("meminfo.16b", O_CREAT | O_WRONLY | O_TEXT);\r
unlink("meminfo.16w");\r
gvar->handle.showmemhandle = open("meminfo.16w", O_CREAT | O_WRONLY | O_TEXT);\r
#endif\r
+#endif\r
\r
\r
#ifndef NOMAPS\r
#ifdef PROFILE\r
close(gvar->handle.profilehandle);\r
#endif\r
+#ifdef SHOWMEMINFO\r
close(gvar->handle.showmemhandle);\r
+#endif\r
\r
close(gvar->ca.file.maphandle);\r
close(gvar->ca.file.grhandle);\r
typedef union REGPACK regs_t;\r
#endif\r
\r
-#define INPUT_STATUS_1 0x03da\r
-\r
// local function //\r
long int filesize(FILE *fp);\r
void clrstdin();\r
}\r
\r
\r
+//==========================================================================\r
+\r
+/*\r
+===================\r
+=\r
+= MM_Reset\r
+=\r
+===================\r
+*/\r
+\r
+void MM_Reset (global_game_variables_t *gvar)\r
+{\r
+// //has to be 16\r
+// if(sizeof(mmblocktype)!=16)\r
+// return;\r
+\r
+#ifdef __BORLANDC__\r
+ strcpy(gvar->handle.datadumpfilename, "mmdump.16b");\r
+#endif\r
+#ifdef __WATCOMC__\r
+ strcpy(gvar->handle.datadumpfilename, "mmdump.16w");\r
+#endif\r
+}\r
+\r
+\r
//==========================================================================\r
\r
/*\r
if(gvar->mm.mmstarted)\r
MM_Shutdown (gvar);\r
\r
- //has to be 16\r
- if(sizeof(mmblocktype)!=16)\r
- return;\r
+ MM_Reset (gvar);\r
\r
gvar->mm.mmstarted = true;\r
gvar->mm.bombonerror = true;\r
#ifdef __BORLANDC__\r
free(gvar->mm.nearheap);\r
#endif\r
-#ifdef __BORLANDC__\r
- dumpfile = fopen ("mmdump.16b","w");\r
-#endif\r
-#ifdef __WATCOMC__\r
- dumpfile = fopen ("mmdump.16w","w");\r
-#endif\r
- if (!dumpfile){\r
- printf("MM_DumpData: Couldn't open MMDUMP.16!\n");\r
- return;\r
- }\r
+ dumpfile = fopen (gvar->handle.datadumpfilename, "w");\r
+ if (!dumpfile)\r
+ Quit (gvar, "MM_DumpData: Couldn't open MMDUMP.16!\n");\r
\r
lowest = -1;\r
do\r
\r
} while (lowest != 0xffff);\r
\r
- fclose(dumpfile);\r
- printf("MMDUMP.16 created.\n");\r
+ fclose (dumpfile);\r
+//00 printf ("MMDUMP.16 created.\n");\r
}\r
\r
//==========================================================================\r
void MML_UseSpace (unsigned segstart, unsigned seglength, global_game_variables_t *gvar);\r
void MML_ClearBlock (global_game_variables_t *gvar);\r
\r
+void MM_Reset (global_game_variables_t *gvar);\r
void MM_Startup (global_game_variables_t *gvar);\r
void MM_Shutdown (global_game_variables_t *gvar);\r
\r
if (pagenum >= gvar->pm.fi.ChunksInFile)\r
Quit (gvar, "PM_GetPage: Invalid page request");\r
\r
-//#ifdef __DEBUG_2__ // for debugging\r
+#ifdef __DEBUG_2__ // for debugging\r
__asm {\r
mov dx,STATUS_REGISTER_1\r
in al,dx\r
mov al,10 // bright green\r
out dx,al\r
}\r
-//#endif\r
+#endif\r
\r
if (!(result = PM_GetPageAddress(pagenum, gvar)))\r
{\r
}\r
gvar->pm.PMPages[pagenum].lastHit = gvar->pm.PMFrameCount;\r
\r
-//#ifdef __DEBUG_2__ // for debugging\r
+#ifdef __DEBUG_2__ // for debugging\r
__asm{\r
mov dx,STATUS_REGISTER_1\r
in al,dx\r
mov al,0x20 // normal\r
out dx,al\r
}\r
-//#endif\r
+#endif\r
\r
return(result);\r
}\r
if(gvar.in.inst->Keyboard[sc_F4]){ turboXT(12); IN_UserInput(1, &gvar); } \\r
if(gvar.in.inst->Keyboard[68/*sc_F10*/]){ gvar.kurokku.fpscap=!gvar.kurokku.fpscap; IN_UserInput(1, &gvar); } \\r
if(gvar.in.inst->Keyboard[sc_F8]){ gvar.video.vga_state.bgps=!gvar.video.vga_state.bgps; IN_UserInput(1, &gvar); } \\r
- if(gvar.in.inst->Keyboard[sc_F7]){ ZC_ShowMV(&gvar.mv, 0, 1); IN_UserInput(1, &gvar); } \\r
- if(gvar.in.inst->Keyboard[sc_F6]){ ZC_ShowMV(&gvar.mv, 0, 0); IN_UserInput(1, &gvar); } \\r
+ if(gvar.in.inst->Keyboard[sc_F7]){ VL_ShowPage(&gvar.video.page, 0, 1); IN_UserInput(1, &gvar); } \\r
+ if(gvar.in.inst->Keyboard[sc_F6]){ VL_ShowPage(&gvar.video.page, 0, 0); IN_UserInput(1, &gvar); } \\r
if(gvar.in.inst->Keyboard[sc_T]){ gvar.video.vga_state.rss=!gvar.video.vga_state.rss; IN_UserInput(1, &gvar); } \\r
if(gvar.in.inst->Keyboard[sc_P]){ modexpdump(0, &gvar); IN_UserInput(1, &gvar); } \\r
if(gvar.in.inst->Keyboard[sc_Y]){ dbg_delayanimation=!dbg_delayanimation; IN_UserInput(1, &gvar); } \\r
if(gvar.in.inst->Keyboard[sc_Q]){ VL_modexPrintTextBox(&gvar); IN_UserInput(1, &gvar); } \\r
if(gvar.in.inst->Keyboard[sc_W]){ VL_MemToScreen((byte __far *)&gvar, 64, 64, 16, 16, &gvar); IN_UserInput(1, &gvar); } \\r
if(gvar.in.inst->Keyboard[sc_LBrkt]){ ShowPalVal (&gvar); IN_UserInput(1, &gvar); } \\r
- if(gvar.in.inst->Keyboard[sc_M]){ MM_ShowMemory(&gvar); IN_UserInput(1, &gvar); } \\r
+ if(gvar.in.inst->Keyboard[sc_M]){ MM_ShowMemory(&gvar); MM_DumpData (&gvar); IN_UserInput(1, &gvar); } \\r
RFDEBUGFUNCTIONS\r
//FIZZLEFADEFUNCTION\r
\r
ZC_panPageManual(&gvar.mv, &gvar.player, 0);\r
\r
#define FUNCTIONKEYSHOWMV \\r
- if(gvar.in.inst->Keyboard[1+1]){ gvar.video.sp=0; ZC_ShowMV(&gvar.mv, 0, 0); } \\r
- if(gvar.in.inst->Keyboard[2+1]){ gvar.video.sp=1; ZC_ShowMV(&gvar.mv, 0, 0); } \\r
- if(gvar.in.inst->Keyboard[3+1]){ gvar.video.sp=2; ZC_ShowMV(&gvar.mv, 0, 1); } \\r
- if(gvar.in.inst->Keyboard[4+1]){ gvar.video.sp=3; ZC_ShowMV(&gvar.mv, 0, 1); }\r
+ if(gvar.in.inst->Keyboard[1+1]){ gvar.video.sp=0; VL_ShowPage(&gvar.video.page, 0, 0); } \\r
+ if(gvar.in.inst->Keyboard[2+1]){ gvar.video.sp=1; VL_ShowPage(&gvar.video.page, 0, 0); } \\r
+ if(gvar.in.inst->Keyboard[3+1]){ gvar.video.sp=2; VL_ShowPage(&gvar.video.page, 0, 1); } \\r
+ if(gvar.in.inst->Keyboard[4+1]){ gvar.video.sp=3; VL_ShowPage(&gvar.video.page, 0, 1); }\r
\r
#define TAIL_FUNCTIONKEYDRAWJUNK \\r
FUNCTIONKEYSHOWMV \\r
{\r
int profilehandle,debughandle,showmemhandle;\r
int heaphandle;\r
+ byte datadumpfilename[12];\r
} loghandle_t;\r
\r
typedef struct\r
#include "src/lib/16_head.h"\r
#include "src/lib/wcpu/16_wcpu.h"\r
\r
-#define FPSVALUE 60\r
+#define FPSVALUE 30\r
\r
clock_t start_timer(global_game_variables_t *gv);\r
double elapsed_timer(global_game_variables_t *gv);\r
low_address = LOW_ADDRESS | (offset << 8);\r
\r
/* wait for appropriate timing and then program CRTC */\r
-//+=+= while ((inp(INPUT_STATUS_1) & DISPLAY_ENABLE));\r
+//+=+= while ((inp(STATUS_REGISTER_1) & DISPLAY_ENABLE));\r
outpw(CRTC_INDEX, high_address);\r
outpw(CRTC_INDEX, low_address);\r
outp(CRTC_INDEX, 0x13);\r
outp(CRTC_DATA, crtcOffset);\r
\r
/* wait for one retrace */\r
-//+=+= while (!(inp(INPUT_STATUS_1) & VRETRACE));\r
+//+=+= while (!(inp(STATUS_REGISTER_1) & VRETRACE));\r
\r
/* do PEL panning here */\r
outp(AC_INDEX, 0x33);\r
low_address = LOW_ADDRESS | (offset << 8);\r
\r
// wait for appropriate timing and then program CRTC\r
- if(vsync) while ((inp(INPUT_STATUS_1) & DISPLAY_ENABLE));\r
+ if(vsync) while ((inp(STATUS_REGISTER_1) & DISPLAY_ENABLE));\r
outpw(CRTC_INDEX, high_address);\r
outpw(CRTC_INDEX, low_address);\r
outp(CRTC_INDEX, 0x13);\r
outp(CRTC_DATA, crtcOffset);\r
\r
// wait for one retrace\r
- if(vsync) while (!(inp(INPUT_STATUS_1) & VRETRACE));\r
+ if(vsync) while (!(inp(STATUS_REGISTER_1) & VRETRACE));\r
\r
// do PEL panning here\r
outp(AC_INDEX, 0x33);\r
\r
void\r
modexWaitBorder() {\r
- while(inp(INPUT_STATUS_1) & 8) {\r
+ while(inp(STATUS_REGISTER_1) & 8) {\r
// spin\r
}\r
\r
- while(!(inp(INPUT_STATUS_1) & 8)) {\r
+ while(!(inp(STATUS_REGISTER_1) & 8)) {\r
//spin\r
}\r
}\r
void\r
modexWaitBorder_start()\r
{\r
- while(inp(INPUT_STATUS_1) & 8) {\r
+ while(inp(STATUS_REGISTER_1) & 8) {\r
// spin\r
}\r
\r
void\r
modexWaitBorder_end()\r
{\r
- while(!(inp(INPUT_STATUS_1) & 8)) {\r
+ while(!(inp(STATUS_REGISTER_1) & 8)) {\r
// spin\r
}\r
\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
-Subproject commit bd7aef78dacba681d641b637b31a93682e1109e0
+Subproject commit 0fa03eb420bf0215c0da701a477efe512472691d
//panning page\r
void ZC_panPageManual(map_view_t *pip, player_t *player, word pn)\r
{\r
-#define SHOWMVFUN_ ZC_ShowMV(pip, 0, 0);\r
+#define SHOWMVFUN_ VL_ShowPage(pip[0].page, 0, 0);//ZC_ShowMV(pip, 0, 0);\r
switch(player[pn].enti.d)\r
{\r
//right movement\r
//pip[0].ty = pip[1].ty = ty;\r
}\r
\r
+//#if 0\r
+//for backwards compatibility with code i am lazy ww\r
void ZC_ShowMV(map_view_t *moo, boolean vsync, boolean sr)\r
{\r
VL_ShowPage(moo[0].page, vsync, sr);\r
void ZC_panPageManual(map_view_t *pip, player_t *player, word pn);\r
void ZC_MVSetup(map_view_t *pip, map_t *map, global_game_variables_t *gv);\r
void ZC_MVInit(map_view_t *pip, int tx, int ty);\r
-void ZC_ShowMV(map_view_t *moo, boolean vsync, boolean sr);\r
+//void ZC_ShowMV(map_view_t *moo, boolean vsync, boolean sr);\r
void near mapScrollRight(map_view_t *mv, player_t *player, word id, word plid);\r
void near mapScrollLeft(map_view_t *mv, player_t *player, word id, word plid);\r
void near mapScrollUp(map_view_t *mv, player_t *player, word id, word plid);\r
if(gvar.in.inst->Keyboard[25]){ modexpdump(gvar.video.sp, &gvar); IN_UserInput(1, &gvar); }//p\r
if(gvar.in.inst->Keyboard[sc_I]){ drawboxesmodex(&gvar.video.page[gvar.video.sp]); IN_UserInput(1, &gvar); }//i\r
if(gvar.in.inst->Keyboard[sc_O]){ copyboxesmodex(&gvar.video.page, !gvar.video.sp); IN_UserInput(1, &gvar); }//o\r
- //VL_ShowPage(&gvar.video.page[gvar.video.sp], 0, 0);\r
- ZC_ShowMV(&gvar.mv, 0, 0);\r
+ VL_ShowPage(&gvar.video.page[gvar.video.sp], 0, 0);\r
+ //ZC_ShowMV(&gvar.mv, 0, 0);\r
}\r
\r
endclk = *clockw;\r
#include "src/lib/scroll16.h"\r
#include "src/lib/16_timer.h"\r
//#include "src/lib/16_dbg.h"\r
+//HC_heapdump\r
\r
#ifdef __DEBUG__\r
+#define SCROLLEXEDEBUG\r
boolean\r
dbg_nointest=1;\r
#endif\r
static global_game_variables_t gvar;\r
struct glob_game_vars *ggvv;\r
\r
-// static entity_t enti;\r
-\r
char bakapee[64] = FILENAME_1;\r
char bakapeep[64] = FILENAME_1P;\r
// char bakapee3[64] = FILENAME_3;\r
//----gvar.player[0].enti.spri.spritesheet = malloc(sizeof(struct vrs_container));\r
\r
// create the map\r
-// fprintf(stderr, "testing map load~ ");\r
+ #ifdef SCROLLEXEDEBUG\r
+ strcpy(gvar.handle.datadumpfilename, "xcroll1.16w"); MM_DumpData (&gvar);\r
+ fprintf(stderr, "testing map load~ ");\r
+ #endif\r
CA_loadmap("data/test.map", &map, &gvar);\r
#ifndef NOMAPLOAD\r
chkmap(&map, 0);\r
-// initMap(&map);\r
-// printf("chkmap ok ");\r
-// fprintf(stderr, "yay map loaded~~\n");\r
#else\r
chkmap(&map, 1);\r
- //initMap(&map);\r
#endif\r
+ //initMap(&map);\r
+ #ifdef SCROLLEXEDEBUG\r
+ printf("chkmap ok\n");\r
+// fprintf(stderr, "yay map loaded~~\n");\r
+ strcpy(gvar.handle.datadumpfilename, "xcroll2.16w"); MM_DumpData (&gvar);\r
+ #endif\r
+\r
// data\r
+ #ifdef SCROLLEXEDEBUG\r
+ fprintf(stderr, "VRS_LoadVRS~ ");\r
+ strcpy(gvar.handle.datadumpfilename, "xcroll3.16w"); MM_DumpData (&gvar);\r
+ #endif\r
VRS_LoadVRS(bakapee, &gvar.player[0].enti, &gvar);\r
+ #ifdef SCROLLEXEDEBUG\r
+ printf("VRS load OK~\n");\r
+ strcpy(gvar.handle.datadumpfilename, "xcroll4.16w"); MM_DumpData (&gvar);\r
+ #endif\r
+ strcpy(gvar.handle.datadumpfilename, "xcroll.16w");\r
\r
// input!\r
IN_Default(0, &gvar.player[0],ctrl_Keyboard1, &gvar);\r
modexSavePalFile("data/g.pal", &gvar.video.palette);\r
modexFadeOff(4, &gvar.video.palette);\r
#endif\r
+ #ifdef SCROLLEXEDEBUG\r
+ MM_Reset(&gvar); MM_DumpData (&gvar);\r
+ HC_heapdump (&gvar);\r
+ #endif\r
Shutdown16(&gvar);\r
printf("\nProject 16 xcroll.exe. This is just a test file!\n");\r
printf("version %s\n", VERSION);\r