From: sparky4 Date: Wed, 19 Apr 2017 19:53:11 +0000 (-0500) Subject: p16 is being worked on a bunch by me wwww [16_ca needs huge amounts of work and I... X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=e42f649aa2ec07f95d127917fe27bc4131a63b01;p=16.git p16 is being worked on a bunch by me wwww [16_ca needs huge amounts of work and I should remember what needs to be done soon][OpenVGMFile needs to be ported to 16_snd.c]going to port rest of code to borland c some time so we can use the core components of id engine here [going to add 16_us.c eventually but the debug system and CA_ PM_ and MM_ usage is priority now]older zcroll renamed to xcroll][zcroll is now the pre menu game loop system with PROPER data usage with CAMMPM] wwww --- diff --git a/_pm_use.txt b/_pm_use.txt index 43ba6c4a..bc694e8e 100755 --- a/_pm_use.txt +++ b/_pm_use.txt @@ -1,28 +1,53 @@ +------------------------------------------------------------------------------- + ./qwolf.sh start +------------------------------------------------------------------------------- +==== 16/wf3d8086 ==== 16/wf3d8086/contigsc.c: shape = PM_GetSpritePage (shapenum); 16/wf3d8086/contigsc.c: shape = PM_GetSpritePage (shapenum); 16/wf3d8086/id_sd.c: addr = PM_GetSoundPage(page); 16/wf3d8086/id_sd.c: PM_SetPageLock(PMSoundStart + page,pml_Locked); 16/wf3d8086/id_sd.c: PM_SetPageLock(i + PMSoundStart,pml_Unlocked); +16/wf3d8086/id_sd.c: DigiNextLen = (DigiLeft >= PMPageSize)? PMPageSize : (DigiLeft % PMPageSize); +16/wf3d8086/id_sd.c: DigiLastEnd = DigiPage + ((DigiLeft + (PMPageSize - 1)) / PMPageSize); +16/wf3d8086/id_sd.c: len = (DigiLeft >= PMPageSize)? PMPageSize : (DigiLeft % PMPageSize); 16/wf3d8086/id_sd.c: PM_UnlockMainMem(); +16/wf3d8086/id_sd.c: MM_GetPtr(&list,PMPageSize); 16/wf3d8086/id_sd.c: PM_CheckMainMem(); 16/wf3d8086/id_sd.c: p = (word far *)MK_FP(PM_GetPage(ChunksInFile - 1),0); +16/wf3d8086/id_sd.c: _fmemcpy((void far *)list,(void far *)p,PMPageSize); +16/wf3d8086/id_sd.c: pg = PMSoundStart; +16/wf3d8086/id_sd.c: for (i = 0;i < PMPageSize / (sizeof(word) * 2);i++,p += 2) +16/wf3d8086/id_sd.c: pg += (p[1] + (PMPageSize - 1)) / PMPageSize; 16/wf3d8086/id_sd.c: PM_UnlockMainMem(); 16/wf3d8086/wl_act2.c: PM_UnlockMainMem (); 16/wf3d8086/wl_act2.c: PM_CheckMainMem (); +16/wf3d8086/wl_debug.c: page = &PMPages[i]; +16/wf3d8086/wl_debug.c: if (i < PMSpriteStart) +16/wf3d8086/wl_debug.c: else if (i < PMSoundStart) 16/wf3d8086/wl_debug.c: addr = PM_GetPageAddress(i); +16/wf3d8086/wl_debug.c: if (i < PMSpriteStart) +16/wf3d8086/wl_debug.c: else if (i < PMSoundStart) +16/wf3d8086/wl_debug.c: SimpleScaleShape (160, i-PMSpriteStart, 64); +16/wf3d8086/wl_debug.c: k += (DigiList[(j * 2) + 1] + (PMPageSize - 1)) / PMPageSize; +16/wf3d8086/wl_debug.c: k = (DigiList[(j * 2) + 1] + (PMPageSize - 1)) / PMPageSize; +16/wf3d8086/wl_debug.c: (i >= PMSoundStart + DigiList[j * 2]) +16/wf3d8086/wl_debug.c: && (i < PMSoundStart + DigiList[j * 2] + k) +16/wf3d8086/wl_debug.c: US_PrintUnsigned(i - PMSoundStart - DigiList[j * 2]); +16/wf3d8086/wl_debug.c: i = PMSpriteStart; +16/wf3d8086/wl_debug.c: i = PMSoundStart; 16/wf3d8086/wl_debug.c: PM_GetPage(j); 16/wf3d8086/wl_debug.c: PM_GetPage(i); +16/wf3d8086/wl_draw.c:#define DOORWALL (PMSpriteStart-8) 16/wf3d8086/wl_draw.c: *( ((unsigned *)&postsource)+1) = (unsigned)PM_GetPage(wallpic); 16/wf3d8086/wl_draw.c: *( ((unsigned *)&postsource)+1) = (unsigned)PM_GetPage(wallpic); 16/wf3d8086/wl_draw.c: *( ((unsigned *)&postsource)+1) = (unsigned)PM_GetPage(doorpage); 16/wf3d8086/wl_draw.c: *( ((unsigned *)&postsource)+1) = (unsigned)PM_GetPage(doorpage+1); 16/wf3d8086/wl_draw.c: *( ((unsigned *)&postsource)+1) = (unsigned)PM_GetPage(wallpic); 16/wf3d8086/wl_draw.c: *( ((unsigned *)&postsource)+1) = (unsigned)PM_GetPage(wallpic); - 16/wf3d8086/wl_draw.c: PM_NextFrame(); 16/wf3d8086/wl_game.c: PM_UnlockMainMem(); @@ -41,7 +66,9 @@ 16/wf3d8086/wl_main.c: PM_Startup (); 16/wf3d8086/wl_main.c: PM_UnlockMainMem (); +16/wf3d8086/wl_menu.c: StartCPMusic(MENUSONG); 16/wf3d8086/wl_menu.c: PM_CheckMainMem (); +16/wf3d8086/wl_menu.c: StartCPMusic(MENUSONG); 16/wf3d8086/wl_menu.c: PM_CheckMainMem (); 16/wf3d8086/wl_play.c: PM_CheckMainMem (); @@ -55,3 +82,4 @@ 16/wf3d8086/wolfhack.c: src = PM_GetPage(0); 16/wf3d8086/wolfhack.c: src = PM_GetPage(1); +=============== ./qwolf.sh end =============== diff --git a/bcexmm.dsk b/bcexmm.dsk index 1244a4fd..5a2cefe4 100755 Binary files a/bcexmm.dsk and b/bcexmm.dsk differ diff --git a/bcexmm.exe b/bcexmm.exe index 8241cd6c..cf48e82b 100755 Binary files a/bcexmm.exe and b/bcexmm.exe differ diff --git a/bcexmm.prj b/bcexmm.prj index 4ac8b0f3..5c9dca3b 100755 Binary files a/bcexmm.prj and b/bcexmm.prj differ diff --git a/src/exmmtest.c b/src/exmmtest.c index d668c2db..ad274c7e 100755 --- a/src/exmmtest.c +++ b/src/exmmtest.c @@ -274,9 +274,9 @@ PRINTBB; KEYP IN_ClearKey(scan); switch (scan) { - case sc_Space: - MM_ShowMemory(&gvar); - break; +// case sc_Space: +// MM_ShowMemory(&gvar); +// break; //#ifdef __WATCOMC__ case sc_O: VL_modexPalScramble(&gvar.video.palette); modexpdump(&gvar.video.page); diff --git a/src/lib/16_mm.c b/src/lib/16_mm.c index e2249abd..36b976a0 100755 --- a/src/lib/16_mm.c +++ b/src/lib/16_mm.c @@ -1257,14 +1257,18 @@ void MM_SortMem (global_game_variables_t *gvar) ===================== */ -#define MMSMPANVID +#ifdef __WATCOMC__ +//#define MMSMPANVID +#define MMSMSCANINFO +#endif void MM_ShowMemory (global_game_variables_t *gvar) { mmblocktype far *scan; - unsigned color,temp,x,y ,w,width; + unsigned color,temp,x,y ,w,q,width; sdword end,owner; - byte scratch[160],scratch0[4096],str[16]; + byte scratch[160],scratch0[4096],str[16]; + mmshowmemoryinfo_t scaninfo[MAXBLOCKS]; if(!gvar->video.page[0].width) gvar->video.page[0].sw = gvar->video.page[0].width = 320; //to prevent division by 0 //-- VL_SetLineWidth(40, gvar); @@ -1276,11 +1280,12 @@ void MM_ShowMemory (global_game_variables_t *gvar) end = -1; w = 0; - width = gvar->video.page[0].width; + width = gvar->video.page[0].width; q = 0; CA_OpenDebug (gvar); while (scan) { + scaninfo[q].scan = scan; strcpy(scratch, AARESET); if(scan->attributes & PURGEBITS) { @@ -1311,6 +1316,8 @@ void MM_ShowMemory (global_game_variables_t *gvar) end = scan->length-1; y = scan->start/width; x = scan->start%width; + scaninfo[q].x = x; + scaninfo[q].y = y; VW_Hlin(x,x+end,y,color,gvar); VL_Plot(x,y,5,gvar); for(w=(scan->start)/80;w<=end/80;w++) @@ -1374,6 +1381,7 @@ void MM_ShowMemory (global_game_variables_t *gvar) //fprintf(stdout, "%s", scratch); scan = scan->next; + q++; //if(color!=6) IN_Ack(gvar); } @@ -1415,9 +1423,68 @@ void MM_ShowMemory (global_game_variables_t *gvar) gvar->video.page[0].dx = odx; gvar->video.page[0].dy = ody; } -#else - IN_Ack(gvar); #endif +#ifdef MMSMSCANINFO + { + unsigned maxq = q; + boolean done; + ScanCode scancode; + int xpos,ypos; + word qq, ccolor = 3; + IN_Ack(gvar); +// VL_ClearVideo (8); + for (qq = 0,done = false;!done;) + { + if(scaninfo[qq].scan->attributes & PURGEBITS) + { + ccolor = 6; // dark purple = purgable + }else{ + ccolor = 2; // medium blue = non purgable + } + if(scaninfo[qq].scan->attributes & LOCKBIT) + { + ccolor = 1; // red = locked + } +/*typedef struct mmblockstruct{ + word start,length; + unsigned attributes; + memptr *useptr; // pointer to the segment start + struct mmblockstruct far *next; +} mmblocktype;*/ + //modexprint(page, x, y, t, tlsw, color, bgcolor, vidsw, const byte *str); +#define MMSMPRINTMEMINFO modexprint(&(gvar->video.page[0]), xpos, ypos, 1, 0, ccolor, 8, gvar->video.VL_Started, global_temp_status_text); ypos+=8; + VL_ShowPage(&gvar->video.page[0], 1, 0); + if(!gvar->video.VL_Started) clrscr(); + sprintf(global_temp_status_text, "block #%04u", qq); MMSMPRINTMEMINFO +// sprintf(global_temp_status_text, "%Fp", scaninfo[qq].scan->useptr); MMSMPRINTMEMINFO + sprintf(global_temp_status_text, "%04x", (unsigned)scaninfo[qq].scan->useptr); MMSMPRINTMEMINFO + sprintf(global_temp_status_text, "size: %05u", (unsigned)scan->length); MMSMPRINTMEMINFO + sprintf(global_temp_status_text, "free: %05u", (unsigned)(scaninfo[qq].scan->next->start-scaninfo[qq].scan->start)); MMSMPRINTMEMINFO + //if (scan->next && scan->next->start > end+1) free + xpos = 16; + ypos = 16;//(gvar->video.page[0].sh-(32));//8*4 + while (!(scancode = gvar->in.inst->LastScan)){} + + IN_ClearKey(scancode); + switch (scancode) + { + case sc_LeftArrow: + if(qq>0) qq--; + else qq = maxq; + break; + case sc_RightArrow: + if(qqvideo.BOFS = (byte __far *)temp; } diff --git a/src/lib/16_tdef.h b/src/lib/16_tdef.h index fe5083a5..3aeb85b1 100755 --- a/src/lib/16_tdef.h +++ b/src/lib/16_tdef.h @@ -475,6 +475,12 @@ typedef struct mmblockstruct struct mmblockstruct far *next; } mmblocktype; +typedef struct mmshowmemoryinfo +{ + word x,y; + mmblocktype far *scan; +} mmshowmemoryinfo_t; + typedef struct { dword nearheap,farheap,EMSmem,XMSmem,mainmem; diff --git a/src/lib/16_vl.c b/src/lib/16_vl.c index 12d8c4b6..dc53d947 100755 --- a/src/lib/16_vl.c +++ b/src/lib/16_vl.c @@ -1107,7 +1107,7 @@ void modexDrawChar(page_t *page, int x/*for planar selection only*/, word t, wor } } -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) { word s, o, w; word x_draw; @@ -1116,7 +1116,7 @@ void modexprint(page_t *page, sword x, sword y, word t, boolean tlsw, word col, word addrr; byte c; - switch(sw) + switch(vidsw) { case 0: printf("%s\n", str); @@ -1149,7 +1149,7 @@ void modexprint(page_t *page, sword x, sword y, word t, boolean tlsw, word col, // no need for inline assembly! // NTS: It might even be faster to just let the modexDrawChar point directly at ROM font than to copy per char! --J.C. _fmemcpy(romFontsData.l,MK_FP(s,o+(w*c))/*ROM font location*/,w/*char size*/); - modexDrawChar(page, x_draw/*for mode X planar use*/, t, col, bgcol, addrr); + modexDrawChar(page, x_draw/*for mode X planar use*/, t, color, bgcolor, addrr); x_draw += 8; /* track X for edge of screen */ addrr += 2; /* move 8 pixels over (2 x 4 planar pixels per byte) */ } diff --git a/src/lib/16_vl.h b/src/lib/16_vl.h index 64c309e7..abea3773 100755 --- a/src/lib/16_vl.h +++ b/src/lib/16_vl.h @@ -251,7 +251,7 @@ 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);