]> 4ch.mooo.com Git - 16.git/commitdiff
p16 is being worked on a bunch by me wwww [16_ca needs huge amounts of work and I...
authorsparky4 <sparky4@cock.li>
Wed, 19 Apr 2017 19:53:11 +0000 (14:53 -0500)
committersparky4 <sparky4@cock.li>
Wed, 19 Apr 2017 19:53:11 +0000 (14:53 -0500)
_pm_use.txt
bcexmm.dsk
bcexmm.exe
bcexmm.prj
src/exmmtest.c
src/lib/16_mm.c
src/lib/16_tdef.h
src/lib/16_vl.c
src/lib/16_vl.h

index 43ba6c4ad5c5d00b154defac6a61d29e7f0e6dca..bc694e8efb08ed4aedec35cf6bb78f0e9f04ba1b 100755 (executable)
@@ -1,28 +1,53 @@
+-------------------------------------------------------------------------------\r
+                                       ./qwolf.sh start\r
+-------------------------------------------------------------------------------\r
+==== 16/wf3d8086 ====\r
 16/wf3d8086/contigsc.c:        shape = PM_GetSpritePage (shapenum);\r
 16/wf3d8086/contigsc.c:        shape = PM_GetSpritePage (shapenum);\r
 \r
 16/wf3d8086/id_sd.c:   addr = PM_GetSoundPage(page);\r
 16/wf3d8086/id_sd.c:   PM_SetPageLock(PMSoundStart + page,pml_Locked);\r
 16/wf3d8086/id_sd.c:           PM_SetPageLock(i + PMSoundStart,pml_Unlocked);\r
+16/wf3d8086/id_sd.c:           DigiNextLen = (DigiLeft >= PMPageSize)? PMPageSize : (DigiLeft % PMPageSize);\r
+16/wf3d8086/id_sd.c:   DigiLastEnd = DigiPage + ((DigiLeft + (PMPageSize - 1)) / PMPageSize);\r
+16/wf3d8086/id_sd.c:   len = (DigiLeft >= PMPageSize)? PMPageSize : (DigiLeft % PMPageSize);\r
 16/wf3d8086/id_sd.c:   PM_UnlockMainMem();\r
+16/wf3d8086/id_sd.c:   MM_GetPtr(&list,PMPageSize);\r
 16/wf3d8086/id_sd.c:   PM_CheckMainMem();\r
 16/wf3d8086/id_sd.c:   p = (word far *)MK_FP(PM_GetPage(ChunksInFile - 1),0);\r
+16/wf3d8086/id_sd.c:   _fmemcpy((void far *)list,(void far *)p,PMPageSize);\r
+16/wf3d8086/id_sd.c:   pg = PMSoundStart;\r
+16/wf3d8086/id_sd.c:   for (i = 0;i < PMPageSize / (sizeof(word) * 2);i++,p += 2)\r
+16/wf3d8086/id_sd.c:           pg += (p[1] + (PMPageSize - 1)) / PMPageSize;\r
 16/wf3d8086/id_sd.c:   PM_UnlockMainMem();\r
 \r
 16/wf3d8086/wl_act2.c: PM_UnlockMainMem ();\r
 16/wf3d8086/wl_act2.c: PM_CheckMainMem ();\r
 \r
+16/wf3d8086/wl_debug.c:                page = &PMPages[i];\r
+16/wf3d8086/wl_debug.c:                if (i < PMSpriteStart)\r
+16/wf3d8086/wl_debug.c:                else if (i < PMSoundStart)\r
 16/wf3d8086/wl_debug.c:                addr = PM_GetPageAddress(i);\r
+16/wf3d8086/wl_debug.c:                        if (i < PMSpriteStart)\r
+16/wf3d8086/wl_debug.c:                        else if (i < PMSoundStart)\r
+16/wf3d8086/wl_debug.c:                                SimpleScaleShape (160, i-PMSpriteStart, 64);\r
+16/wf3d8086/wl_debug.c:                                        k += (DigiList[(j * 2) + 1] + (PMPageSize - 1)) / PMPageSize;\r
+16/wf3d8086/wl_debug.c:                                        k = (DigiList[(j * 2) + 1] + (PMPageSize - 1)) / PMPageSize;\r
+16/wf3d8086/wl_debug.c:                                                (i >= PMSoundStart + DigiList[j * 2])\r
+16/wf3d8086/wl_debug.c:                                        &&      (i < PMSoundStart + DigiList[j * 2] + k)\r
+16/wf3d8086/wl_debug.c:                                        US_PrintUnsigned(i - PMSoundStart - DigiList[j * 2]);\r
+16/wf3d8086/wl_debug.c:                        i = PMSpriteStart;\r
+16/wf3d8086/wl_debug.c:                        i = PMSoundStart;\r
 16/wf3d8086/wl_debug.c:                                PM_GetPage(j);\r
 16/wf3d8086/wl_debug.c:                        PM_GetPage(i);\r
 \r
+16/wf3d8086/wl_draw.c:#define DOORWALL (PMSpriteStart-8)\r
 16/wf3d8086/wl_draw.c:         *( ((unsigned *)&postsource)+1) = (unsigned)PM_GetPage(wallpic);\r
 16/wf3d8086/wl_draw.c:         *( ((unsigned *)&postsource)+1) = (unsigned)PM_GetPage(wallpic);\r
 16/wf3d8086/wl_draw.c:         *( ((unsigned *)&postsource)+1) = (unsigned)PM_GetPage(doorpage);\r
 16/wf3d8086/wl_draw.c:         *( ((unsigned *)&postsource)+1) = (unsigned)PM_GetPage(doorpage+1);\r
 16/wf3d8086/wl_draw.c:         *( ((unsigned *)&postsource)+1) = (unsigned)PM_GetPage(wallpic);\r
 16/wf3d8086/wl_draw.c:         *( ((unsigned *)&postsource)+1) = (unsigned)PM_GetPage(wallpic);\r
-\r
 16/wf3d8086/wl_draw.c: PM_NextFrame();\r
 \r
 16/wf3d8086/wl_game.c: PM_UnlockMainMem();\r
@@ -41,7 +66,9 @@
 16/wf3d8086/wl_main.c: PM_Startup ();\r
 16/wf3d8086/wl_main.c: PM_UnlockMainMem ();\r
 \r
+16/wf3d8086/wl_menu.c:                         StartCPMusic(MENUSONG);\r
 16/wf3d8086/wl_menu.c:                         PM_CheckMainMem ();\r
+16/wf3d8086/wl_menu.c:                         StartCPMusic(MENUSONG);\r
 16/wf3d8086/wl_menu.c:                         PM_CheckMainMem ();\r
 \r
 16/wf3d8086/wl_play.c:         PM_CheckMainMem ();\r
@@ -55,3 +82,4 @@
 \r
 16/wf3d8086/wolfhack.c:        src = PM_GetPage(0);\r
 16/wf3d8086/wolfhack.c:        src = PM_GetPage(1);\r
+===============                ./qwolf.sh end          ===============\r
index 1244a4fd62b3b5f88e8c6c5ca90ff61888d35afa..5a2cefe499af011a3d91d2edfa20246c7f2209d6 100755 (executable)
Binary files a/bcexmm.dsk and b/bcexmm.dsk differ
index 8241cd6c3288721d9537d05de33d70fbb151e0d0..cf48e82b69377284885f0d7ba8eda40abc742248 100755 (executable)
Binary files a/bcexmm.exe and b/bcexmm.exe differ
index 4ac8b0f3143c414fd0b579c479590239bd710f94..5c9dca3b18571442b51bdbb0ca9a10723455aaf9 100755 (executable)
Binary files a/bcexmm.prj and b/bcexmm.prj differ
index d668c2db7cdbffe4d7c96343ae063ee8f767c1c9..ad274c7ef1f3242ae54f9d1385041657e628aea4 100755 (executable)
@@ -274,9 +274,9 @@ PRINTBB; KEYP
                IN_ClearKey(scan);\r
                switch (scan)\r
                {\r
-                       case sc_Space:\r
-                               MM_ShowMemory(&gvar);\r
-                       break;\r
+//                     case sc_Space:\r
+//                             MM_ShowMemory(&gvar);\r
+//                     break;\r
 //#ifdef __WATCOMC__\r
                        case sc_O:\r
                                VL_modexPalScramble(&gvar.video.palette); modexpdump(&gvar.video.page);\r
index e2249abd0ec9c4daae564e16f5a608bdb73fef7c..36b976a01ed5a9427c4fd46b749ebbb3fd38c39d 100755 (executable)
@@ -1257,14 +1257,18 @@ void MM_SortMem (global_game_variables_t *gvar)
 =====================\r
 */\r
 \r
-#define MMSMPANVID\r
+#ifdef __WATCOMC__\r
+//#define MMSMPANVID\r
+#define MMSMSCANINFO\r
+#endif\r
 \r
 void MM_ShowMemory (global_game_variables_t *gvar)\r
 {\r
        mmblocktype far *scan;\r
-       unsigned color,temp,x,y         ,w,width;\r
+       unsigned color,temp,x,y         ,w,q,width;\r
        sdword  end,owner;\r
-       byte    scratch[160],scratch0[4096],str[16];\r
+       byte            scratch[160],scratch0[4096],str[16];\r
+       mmshowmemoryinfo_t scaninfo[MAXBLOCKS];\r
 \r
        if(!gvar->video.page[0].width) gvar->video.page[0].sw = gvar->video.page[0].width = 320;        //to prevent division by 0\r
 //--   VL_SetLineWidth(40, gvar);\r
@@ -1276,11 +1280,12 @@ void MM_ShowMemory (global_game_variables_t *gvar)
 \r
        end = -1; w = 0;\r
 \r
-       width = gvar->video.page[0].width;\r
+       width = gvar->video.page[0].width; q = 0;\r
 \r
        CA_OpenDebug (gvar);\r
        while (scan)\r
        {\r
+               scaninfo[q].scan = scan;\r
                strcpy(scratch, AARESET);\r
                if(scan->attributes & PURGEBITS)\r
                {\r
@@ -1311,6 +1316,8 @@ void MM_ShowMemory (global_game_variables_t *gvar)
                end = scan->length-1;\r
                y = scan->start/width;\r
                x = scan->start%width;\r
+               scaninfo[q].x = x;\r
+               scaninfo[q].y = y;\r
                VW_Hlin(x,x+end,y,color,gvar);\r
                VL_Plot(x,y,5,gvar);\r
                for(w=(scan->start)/80;w<=end/80;w++)\r
@@ -1374,6 +1381,7 @@ void MM_ShowMemory (global_game_variables_t *gvar)
 //fprintf(stdout, "%s", scratch);\r
 \r
                scan = scan->next;\r
+               q++;\r
 //if(color!=6) IN_Ack(gvar);\r
        }\r
 \r
@@ -1415,9 +1423,68 @@ void MM_ShowMemory (global_game_variables_t *gvar)
                gvar->video.page[0].dx = odx;\r
                gvar->video.page[0].dy = ody;\r
        }\r
-#else\r
-       IN_Ack(gvar);\r
 #endif\r
+#ifdef MMSMSCANINFO\r
+       {\r
+               unsigned                maxq = q;\r
+               boolean                 done;\r
+               ScanCode                scancode;\r
+               int xpos,ypos;\r
+               word qq, ccolor = 3;\r
+               IN_Ack(gvar);\r
+//             VL_ClearVideo (8);\r
+               for (qq = 0,done = false;!done;)\r
+               {\r
+                       if(scaninfo[qq].scan->attributes & PURGEBITS)\r
+                       {\r
+                               ccolor = 6;             // dark purple = purgable\r
+                       }else{\r
+                               ccolor = 2;             // medium blue = non purgable\r
+                       }\r
+                       if(scaninfo[qq].scan->attributes & LOCKBIT)\r
+                       {\r
+                               ccolor = 1;             // red = locked\r
+                       }\r
+/*typedef struct mmblockstruct{\r
+       word    start,length;\r
+       unsigned        attributes;\r
+       memptr          *useptr;        // pointer to the segment start\r
+       struct mmblockstruct far *next;\r
+} mmblocktype;*/\r
+                       //modexprint(page, x, y, t, tlsw, color, bgcolor, vidsw, const byte *str);\r
+#define MMSMPRINTMEMINFO modexprint(&(gvar->video.page[0]), xpos, ypos, 1, 0, ccolor, 8, gvar->video.VL_Started, global_temp_status_text); ypos+=8;\r
+                       VL_ShowPage(&gvar->video.page[0], 1, 0);\r
+                       if(!gvar->video.VL_Started) clrscr();\r
+                       sprintf(global_temp_status_text, "block #%04u", qq); MMSMPRINTMEMINFO\r
+//                     sprintf(global_temp_status_text, "%Fp", scaninfo[qq].scan->useptr); MMSMPRINTMEMINFO\r
+                       sprintf(global_temp_status_text, "%04x", (unsigned)scaninfo[qq].scan->useptr); MMSMPRINTMEMINFO\r
+                       sprintf(global_temp_status_text, "size: %05u", (unsigned)scan->length); MMSMPRINTMEMINFO\r
+                       sprintf(global_temp_status_text, "free: %05u", (unsigned)(scaninfo[qq].scan->next->start-scaninfo[qq].scan->start)); MMSMPRINTMEMINFO\r
+                       //if (scan->next && scan->next->start > end+1) free\r
+                       xpos = 16;\r
+                       ypos = 16;//(gvar->video.page[0].sh-(32));//8*4\r
+                       while (!(scancode = gvar->in.inst->LastScan)){}\r
+\r
+                       IN_ClearKey(scancode);\r
+                       switch (scancode)\r
+                       {\r
+                               case sc_LeftArrow:\r
+                                       if(qq>0) qq--;\r
+                                       else    qq = maxq;\r
+                               break;\r
+                               case sc_RightArrow:\r
+                                       if(qq<maxq) qq++;\r
+                                       else qq = 0;\r
+                               break;\r
+                               case sc_Escape:\r
+                                       done = true;\r
+                               break;\r
+                       }\r
+               }\r
+       }\r
+#endif\r
+\r
+       IN_Ack(gvar);\r
 \r
        gvar->video.BOFS = (byte __far *)temp;\r
 }\r
index fe5083a54074cadba5c02e42e2c8db730bdf5e60..3aeb85b1f529dc7a943190c6a3463ff2eb06a1c2 100755 (executable)
@@ -475,6 +475,12 @@ typedef struct mmblockstruct
        struct mmblockstruct far *next;\r
 } mmblocktype;\r
 \r
+typedef struct mmshowmemoryinfo\r
+{\r
+       word x,y;\r
+       mmblocktype far *scan;\r
+} mmshowmemoryinfo_t;\r
+\r
 typedef struct\r
 {\r
        dword   nearheap,farheap,EMSmem,XMSmem,mainmem;\r
index 12d8c4b6e125dacc4a6632d167a6623bb74915d7..dc53d947ba18e67c1f629c689fdb0be349f31301 100755 (executable)
@@ -1107,7 +1107,7 @@ void modexDrawChar(page_t *page, int x/*for planar selection only*/, word t, wor
        }\r
 }\r
 \r
-void modexprint(page_t *page, sword x, sword y, word t, boolean tlsw, word col, word bgcol, boolean sw, const byte *str)\r
+void modexprint(page_t *page, sword x, sword y, word t, boolean tlsw, word color, word bgcolor, boolean vidsw, const byte *str)\r
 {\r
        word s, o, w;\r
        word x_draw;\r
@@ -1116,7 +1116,7 @@ void modexprint(page_t *page, sword x, sword y, word t, boolean tlsw, word col,
        word addrr;\r
        byte c;\r
 \r
-       switch(sw)\r
+       switch(vidsw)\r
        {\r
                case 0:\r
                        printf("%s\n", str);\r
@@ -1149,7 +1149,7 @@ void modexprint(page_t *page, sword x, sword y, word t, boolean tlsw, word col,
                        // no need for inline assembly!\r
                        // NTS: It might even be faster to just let the modexDrawChar point directly at ROM font than to copy per char! --J.C.\r
                                _fmemcpy(romFontsData.l,MK_FP(s,o+(w*c))/*ROM font location*/,w/*char size*/);\r
-                               modexDrawChar(page, x_draw/*for mode X planar use*/, t, col, bgcol, addrr);\r
+                               modexDrawChar(page, x_draw/*for mode X planar use*/, t, color, bgcolor, addrr);\r
                                x_draw += 8; /* track X for edge of screen */\r
                                addrr += 2; /* move 8 pixels over (2 x 4 planar pixels per byte) */\r
                        }\r
index 64c309e7738cff773fbc44fe1ad8211c040567b0..abea3773a42963c2472a515ad2dbda23324e5e92 100755 (executable)
@@ -251,7 +251,7 @@ static inline byte modexreadPixel(page_t *page, int x, int y, word addr)
 #endif\r
 \r
 void modexDrawChar(page_t *page, int x/*for planar selection only*/, word t, word col, word bgcol, word addr);\r
-void modexprint(page_t *page, sword x, sword y, word t, boolean tlsw, word col, word bgcol, boolean sw, const byte *str);\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