]> 4ch.mooo.com Git - 16.git/commitdiff
ok! wwww
authorsparky4 <sparky4@cock.li>
Sat, 8 Aug 2015 20:39:48 +0000 (15:39 -0500)
committersparky4 <sparky4@cock.li>
Sat, 8 Aug 2015 20:39:48 +0000 (15:39 -0500)
modified:   16.exe
modified:   bakapi.exe
modified:   exmmtest.exe
modified:   fontgfx.exe
modified:   maptest.exe
modified:   palettec.exe
modified:   pcxtest.exe
modified:   scroll.exe
modified:   src/exmmtest.c
modified:   src/fontgfx.c
modified:   src/lib/16_ca.c
modified:   src/lib/16_head.h
modified:   src/lib/16_mm.c
modified:   src/lib/16_mm.h
modified:   src/lib/modex16.c
modified:   test.exe
modified:   test2.exe

17 files changed:
16.exe
bakapi.exe
exmmtest.exe
fontgfx.exe
maptest.exe
palettec.exe
pcxtest.exe
scroll.exe
src/exmmtest.c
src/fontgfx.c
src/lib/16_ca.c
src/lib/16_head.h
src/lib/16_mm.c
src/lib/16_mm.h
src/lib/modex16.c
test.exe
test2.exe

diff --git a/16.exe b/16.exe
index d045861962f5036193a4cf088b0704b68d3cdc1e..3d3f27977d3fd336b2bbb07502dcc9bc46899663 100644 (file)
Binary files a/16.exe and b/16.exe differ
index e1c1f69d4d3888c58b7f4be6464892f2e74ecae1..4975fc13e23fe2852d37c4d0cd6da1ec6ce9951f 100644 (file)
Binary files a/bakapi.exe and b/bakapi.exe differ
index 64f660ace47e5e1e43485bc2e4cac9faa46a35d7..6f9a4af50e8b04c9ca6b44f41b54ab702c203a7a 100644 (file)
Binary files a/exmmtest.exe and b/exmmtest.exe differ
index 0b932c07c0f67fd4a2bed43ad10da41a0c3df933..cd80b9da77b33b0c6276cc7d883bd32e9bb57d28 100644 (file)
Binary files a/fontgfx.exe and b/fontgfx.exe differ
index 6ad044742c1f2f004d59b12f8934ab7d33cead6e..6d95e77e771cbd10f2b7ee67031b73afd4e1ce86 100644 (file)
Binary files a/maptest.exe and b/maptest.exe differ
index b38c6f72cf81684a53b614438a9bc79fbd7f91b1..4576367883ffe4b0f9aca69a2b0cf21dd61dd0a5 100644 (file)
Binary files a/palettec.exe and b/palettec.exe differ
index 87b9f8e48325762dc514a33ec6f4795174bfc2fb..d39c22f06dcd211c321b02cffc829b2864e72dee 100644 (file)
Binary files a/pcxtest.exe and b/pcxtest.exe differ
index 1e15ab21b8a82ea217b77896f7da9744d85b198b..de253902ef897ff94f8c41e6ca627f9299d11340 100644 (file)
Binary files a/scroll.exe and b/scroll.exe differ
index 4d8ca6c177549bd4b63fce1383c24f55a6ab032f..8e5b2283607f656e41e33329faef7a0a3ed1bf65 100644 (file)
@@ -87,12 +87,12 @@ main(int argc, char *argv[])
        //screen.width += (16*2);\r
        //screen.height += (16*2);\r
 \r
-       printf("main()=%Fp      start MM\n", *argv[0]);\r
+//     printf("main()=%Fp      start MM\n", *argv[0]);\r
        MM_Startup(&mm, &mmi);\r
        //PM_Startup();\r
        //PM_UnlockMainMem();\r
        CA_Startup(&gvar);\r
-       printf("                done!\n");\r
+//     printf("                done!\n");\r
        printf("&main()=        %Fp\n", *argv[0]);\r
        printf("bigbuffer=      %Fp\n", bigbuffer);\r
        printf("&bigbuffer=     %Fp\n", &bigbuffer);\r
@@ -130,14 +130,14 @@ main(int argc, char *argv[])
        MM_DumpData(&mm);\r
        //++++modexLeave();\r
        MM_Report(&mm, &mmi);\r
-       printf("                stop!\n");\r
+//     printf("                stop!\n");\r
 #ifdef FILERL\r
        MM_FreePtr(&bigbuffer, &mm);\r
 #endif\r
        //PM_Shutdown();\r
        CA_Shutdown(&gvar);\r
        MM_Shutdown(&mm);\r
-       printf("                done!\n");\r
+//     printf("                done!\n");\r
 #ifdef FILERL\r
        free(bakapee);\r
        if(baka) printf("\nyay!\n");\r
index d6599e6027cc6ce7a694289daf6099eaf549e0d1..4fc08ee98b3b790a05a050578988751c5e2e5384 100644 (file)
@@ -65,8 +65,8 @@ IIIIIII  BBBBBBBBB    MMMM    M    MMMM\n\
        modexEnter();\r
        /* setup camera and screen~ */\r
        screen = modexDefaultPage();\r
-       screen.width += (16*2);\r
-       screen.height += (16*2);\r
+       //screen.width += (16*2);\r
+       //screen.height += (16*2);\r
 //++++ modexShowPage(&screen);\r
        //modexprint(16, 16, 1, 15, "wwww");\r
        //getch();\r
@@ -75,7 +75,7 @@ IIIIIII  BBBBBBBBB    MMMM    M    MMMM\n\
        colpee=32;\r
        for(e=0x00; e<=0xFE; e++)\r
        {\r
-               if(chx+8>(SCREEN_WIDTH/2)-16)\r
+               if(chx+8>(screen.width/2))\r
                {\r
                        chx=0;\r
                        chy+=8;\r
index abeffbfd76abf954c813be979346408af8b49f63..f134df8b5bada37ec067d8c893849b7f847c3c22 100644 (file)
@@ -1083,6 +1083,8 @@ void CA_Startup(global_game_variables_t *gvar)
        unlink("profile.16");\r
        gvar->handle.profilehandle = open("profile.16", O_CREAT | O_WRONLY | O_TEXT);\r
 #endif\r
+       unlink("debug0.16");\r
+       gvar->handle.showmemhandle = open("debug0.16", O_CREAT | O_WRONLY | O_TEXT);\r
 /*++++\r
 // MDM begin - (GAMERS EDGE)\r
 //\r
@@ -1144,6 +1146,7 @@ void CA_Shutdown(global_game_variables_t *gvar)
 #ifdef PROFILE\r
        close(gvar->handle.profilehandle);\r
 #endif\r
+       close(gvar->handle.showmemhandle);\r
 /*++++\r
        close(maphandle);\r
        close(grhandle);\r
index 665c4fb23e3490338e195bda7bf0e597474789ab..8baff16a12b6609d806963747dc3440bf6a435ae 100644 (file)
@@ -179,6 +179,7 @@ typedef void _seg * memptr;
 \r
 typedef struct\r
 {\r
+       int showmemhandle;\r
        int                     profilehandle,debughandle;\r
        int heaphandle;\r
 } handle_t;\r
index 78f00337ac37398ad8372feb26e1361ee2969b0b..a9bcd0c1d5f12115943508a884d3e481878b5345 100644 (file)
@@ -1252,10 +1252,8 @@ void MM_SortMem(mminfo_t *mm)
                MM_SetLock(&(memptr)audiosegs[playing],false);*/
 }
 
-
 //==========================================================================
 
-//****#if 0
 /*
 =====================
 =
@@ -1267,12 +1265,12 @@ void MM_SortMem(mminfo_t *mm)
 void MM_ShowMemory(global_game_variables_t *gvar,/*page_t *page, */mminfo_t *mm)
 {
        mmblocktype huge *scan;
-//++++ word color;
+       //byte color;
        word temp;
        long    end,owner;
-//++++ word chx,chy;
-       byte    scratch[160],str[16];
-
+       word chx,chy;
+       byte    scratch[160],scratch0[4096],str[16];
+       byte d = "#";
 //**** VW_SetDefaultColors();
 //**** VW_SetLineWidth(40);
 //++++mh       temp = bufferofs;
@@ -1280,28 +1278,24 @@ void MM_ShowMemory(global_game_variables_t *gvar,/*page_t *page, */mminfo_t *mm)
 //**** VW_SetScreen (0,0);
 
        scan = mm->mmhead;
-
        end = -1;
 
 CA_OpenDebug (gvar);
-
-//++++ chx=0;
+       chx=0;
 //++++ chy=0;
-
        while(scan)
        {
-/*++++         if(scan->attributes & PURGEBITS)
-                       color = 5;              // dark purple = purgable
+               if(scan->attributes & PURGEBITS)
+                       strcpy(scratch0, AAMAGENTA);            // dark purple = purgable
                else
-                       color = 9;              // medium blue = non purgable
+                       strcpy(scratch0, AABLUE);               // medium blue = non purgable
                if(scan->attributes & LOCKBIT)
-                       color = 12;             // red = locked*/
+                       strcpy(scratch0, AARED);                // red = locked
                if(scan->start<=end)
                {
-                       //printf(");
                        write(gvar->handle.debughandle,"\nMM_ShowMemory: Memory block order currupted!\n",strlen("\nMM_ShowMemory: Memory block order currupted!\n"));
                        //modexprint(&page, chx, chy, 1, 0, 24, "\nMM_ShowMemory: Memory block order currupted!\n");
-                       return;
+                       break;
                }
                end = scan->start+scan->length-1;
 //++++         chy = scan->start/320;
@@ -1311,32 +1305,45 @@ CA_OpenDebug (gvar);
                                //{
 //++++                                 modexClearRegion(page, chx, chy, 4, 4, color);
                                //}
-
 //++++         VW_Hlin(scan->start,(unsigned)end,0,color);
-
+               for(chx=scan->start;chx>=(word)end;chx++)
+               {
+                       strcat(scratch0,&d);
+               }
+               strcat (scratch0,AAWHITE); strcat(scratch0,&d);
 //++++         VW_Plot(scan->start,0,15);
 //++++                         modexClearRegion(page, chx, chy, 4, 4, 15);
-               if(scan->next->start > end+1)
 //++++                 VW_Hlin(end+1,scan->next->start,0,0);   // black = free
+               if(scan->next->start > end+1)
+               {
+                       strcat(scratch0,AABLACK);
+                       for(chx=end+1;chx>=(word)scan->next->start;chx++)
+                       {
+                               strcat(scratch0,&d);
+                       }
+               }
                        //for(chx=scan->next->start;chx+4>=(word)end+1;chx+=4)
                        //{
-//++++                         chx+=scan->next->start;
-//++++                         modexClearRegion(page, chx, chy, 4, 4, 2);
+//                             chx+=scan->next->start;
+//                             modexClearRegion(page, chx, chy, 4, 4, 2);
                        //}
                                        //modexhlin(page, end+1,scan->next->start, chy, 0);
-
-/*
-               end = scan->length-1;
-               y = scan->start/320;
+/*             y = scan->start/320;
                x = scan->start%320;
                VW_Hlin(x,x+end,y,color);
                VW_Plot(x,y,15);
-               if (scan->next && scan->next->start > end+1)
-                       VW_Hlin(x+end+1,x+(scan->next->start-scan->start),y,0); // black = free
-*/
-
-//****#if 0
-//printf("\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0");  //bug!
+               if (scan->next && scan->next->start > end+1)
+               {
+                       //write(gvar->handle.showmemhandle,AABLACK,strlen(AABLACK));
+                       //for(chx=scan->start;chx>=(word)end;chx++)
+                       //{
+                               //write(gvar->handle.showmemhandle,"_",1);
+                       //}
+                       //write(gvar->handle.showmemhandle,"\n",strlen("\n"));
+               strcat(scratch0,AABLACK); strcat(scratch0,0x10);
+               }*/
+//++++                 VW_Hlin(x+end+1,x+(scan->next->start-scan->start),y,0); // black = free
+write(gvar->handle.showmemhandle,scratch0,strlen(scratch0));
 strcpy(scratch,"Seg:");
 ultoa (scan->start,str,16);
 strcat (scratch,str);
@@ -1352,7 +1359,6 @@ write(gvar->handle.debughandle,scratch,strlen(scratch));
 //modexprint(page, chx, chy, 1, 0, 24, &scratch);
 //++++chy+=4;
 //fprintf(stdout, "%s", scratch);
-//****#endif
 
                scan = scan->next;
        }
@@ -1363,7 +1369,6 @@ CA_CloseDebug (gvar);
 //**** VW_SetLineWidth(64);
 //++++mh       bufferofs = temp;
 }
-//****#endif
 
 //==========================================================================
 
@@ -1383,8 +1388,7 @@ void MM_DumpData(mminfo_t *mm)
        byte    lock,purge;
        FILE    *dumpfile;
 
-
-       //++++free(mm->nearheap);
+       free(mm->nearheap);
        dumpfile = fopen ("mmdump.16","w");
        if (!dumpfile){
                printf("MM_DumpData: Couldn't open MMDUMP.16!\n");
index 2e01230268ee5830f61615d6a210fe389b11afd4..1ecca330b45812c2304f129ec5326b4ebb256ed5 100644 (file)
 
 #define FREEBLOCK(x) {*x->useptr=NULL;x->next=mm->mmfree;mm->mmfree=x;mm->endid--;}
 
+#define AAMAGENTA      "\x1b[35;35m"
+#define AABLUE         "\x1b[34;34m"
+#define AARED          "\x1b[31;31m"
+#define AABLACK        "\x1b[40;40m"
+#define AAWHITE                "\x1b[37;37m"
+#define AARESET        "\x1b[0m"
 
 #define SAVENEARHEAP   0x200           // space to leave in data segment
 #define SAVEFARHEAP    0//x400                 // space to leave in far heap
index e5550b4c130f4a969a514d6df63c9f2393d35988..b1e6d51f79ef370366d443ed08c7330a6a048226 100644 (file)
 byte far* VGA=(byte far*) 0xA0000000;   /* this points to video memory. */\r
 \r
 static void fadePalette(sbyte fade, sbyte start, word iter, byte *palette);\r
-static byte tmppal[PAL_SIZE];
+static byte tmppal[PAL_SIZE];\r
 int old_mode;\r
-
-/////////////////////////////////////////////////////////////////////////////
-//                                                                                                                                                                                                                                             //
-// setvideo() - This function Manages the video modes                                                                                          //
-//                                                                                                                                                                                                                                             //
-/////////////////////////////////////////////////////////////////////////////
-void VGAmodeX(sword vq)
-{
-       union REGS in, out;
-
-       if(!vq)
-       { // deinit the video
-               // change to the video mode we were in before we switched to mode 13h
-               modexLeave();
-               in.h.ah = 0x00;
-               in.h.al = old_mode;
-               int86(0x10, &in, &out);
-
-       }
-       else if(vq==1)
-       { // init the video
-               // get old video mode
-               in.h.ah = 0xf;
-               int86(0x10, &in, &out);
-               old_mode = out.h.al;
-               // enter mode
-               modexEnter();
-       }
-}
+\r
+/////////////////////////////////////////////////////////////////////////////\r
+//                                                                                                                                                                                                                                             //\r
+// setvideo() - This function Manages the video modes                                                                                          //\r
+//                                                                                                                                                                                                                                             //\r
+/////////////////////////////////////////////////////////////////////////////\r
+void VGAmodeX(sword vq)\r
+{\r
+       union REGS in, out;\r
+\r
+       if(!vq)\r
+       { // deinit the video\r
+               // change to the video mode we were in before we switched to mode 13h\r
+               modexLeave();\r
+               in.h.ah = 0x00;\r
+               in.h.al = old_mode;\r
+               int86(0x10, &in, &out);\r
+\r
+       }\r
+       else if(vq==1)\r
+       { // init the video\r
+               // get old video mode\r
+               in.h.ah = 0xf;\r
+               int86(0x10, &in, &out);\r
+               old_mode = out.h.al;\r
+               // enter mode\r
+               modexEnter();\r
+       }\r
+}\r
 \r
 static void\r
 vgaSetMode(byte mode)\r
@@ -677,7 +677,7 @@ modexPalWhite() {
 }\r
 \r
 \r
-/* utility */
+/* utility */\r
 void\r
 modexPalUpdate(bitmap_t *bmp, word *i, word qp, word aqoffset)\r
 {\r
@@ -970,15 +970,15 @@ no... wait.... no wwww
 }\r
 \r
 void modexputPixel(page_t *page, int x, int y, byte color)\r
-{
+{\r
        word pageOff = (word) page->data;\r
         /* Each address accesses four neighboring pixels, so set\r
            Write Plane Enable according to which pixel we want\r
            to modify.  The plane is determined by the two least\r
-           significant bits of the x-coordinate: */
-       //modexSelectPlane(PLANE(x));\r
-       outp(SC_INDEX, 0x02);\r
-       outp(SC_DATA, 0x01 << (x & 3));\r
+           significant bits of the x-coordinate: */\r
+       modexSelectPlane(PLANE(x));\r
+       //outp(SC_INDEX, 0x02);\r
+       //outp(SC_DATA, 0x01 << (x & 3));\r
 \r
        /* The offset of the pixel into the video segment is\r
           offset = (width * y + x) / 4, and write the given\r
@@ -989,7 +989,7 @@ void modexputPixel(page_t *page, int x, int y, byte color)
 }\r
 \r
 byte modexgetPixel(page_t *page, int x, int y)\r
-{
+{\r
        word pageOff = (word) page->data;\r
        /* Select the plane from which we must read the pixel color: */\r
        outpw(GC_INDEX, 0x04);\r
@@ -997,63 +997,63 @@ byte modexgetPixel(page_t *page, int x, int y)
 \r
        return VGA[(unsigned)((page->width/4) * y) + (x / 4) + pageOff];\r
 \r
-}
-
-void modexhlin(page_t *page, word xl, word xh, word y, word color)
-{
-       word x;
-       word yy=0;
-
-       for(x=0;x<xh*4;x+=4)
-       {
-               if(x+4>=SCREEN_WIDTH-1){ x=0; yy+=4; }
-               modexClearRegion(page, x+xl, y+yy, 4, 4, color);
-       }
-       //modexputPixel(page, x+xl, y, color);
+}\r
+\r
+void modexhlin(page_t *page, word xl, word xh, word y, word color)\r
+{\r
+       word x;\r
+       word yy=0;\r
+\r
+       for(x=0;x<xh*4;x+=4)\r
+       {\r
+               if(x+4>=SCREEN_WIDTH-1){ x=0; yy+=4; }\r
+               modexClearRegion(page, x+xl, y+yy, 4, 4, color);\r
+       }\r
+       //modexputPixel(page, x+xl, y, color);\r
 }\r
 \r
 void modexprint(page_t *page, word x, word y, word t, word col, word bgcol, const byte *str)\r
-{
-       word i, s, o, w, j, xp;
+{\r
+       word i, s, o, w, j, xp;\r
        byte l[1024];\r
-       word addr = (word) l;
-       word chw=0;
-       byte c;
-
+       word addr = (word) l;\r
+       word chw=0;\r
+       byte c;\r
+\r
        switch(t)\r
        {\r
-               case 0:
+               case 0:\r
                        w=14;\r
                break;\r
-               case 1:
+               case 1:\r
                        w=8;\r
                break;\r
-               case 2:
+               case 2:\r
                        w=8;\r
                break;\r
-               case 3:
+               case 3:\r
                        w=16;\r
                break;\r
-               default:
+               default:\r
                        t=3;\r
                        w=16;\r
                break;\r
-       }
+       }\r
 \r
        s=romFonts[t].seg;\r
-       o=romFonts[t].off;
+       o=romFonts[t].off;\r
 \r
        for(; *str != '\0'; str++)\r
-       {
-       c = (*str);
-       if((c=='\n'/* || c=="\
-"*/) || chw
->=page->width)
-       {
-               chw=0;
-               y+=w;
-               continue;
-       }
+       {\r
+       c = (*str);\r
+       if((c=='\n'/* || c=="\\r
+"*/) || chw\r
+>=page->width)\r
+       {\r
+               chw=0;\r
+               y+=w;\r
+               continue;\r
+       }\r
        //load the letter 'A'\r
        __asm {\r
                MOV DI, addr\r
@@ -1070,64 +1070,64 @@ void modexprint(page_t *page, word x, word y, word t, word col, word bgcol, cons
                INC DI\r
                DEC CX\r
                JNZ L1\r
-       }
+       }\r
 \r
-               for(i=0; i<w; i++)
+               for(i=0; i<w; i++)\r
                {\r
-                       j=1<<8;
+                       j=1<<8;\r
                        xp=0;\r
-                       while(j)
-                       {
-                               modexputPixel(page, x+xp+chw, y+i, l[i] & j ? col:bgcol);
-                               xp++;
-                               j>>=1;
-                       }
+                       while(j)\r
+                       {\r
+                               modexputPixel(page, x+xp+chw, y+i, l[i] & j ? col:bgcol);\r
+                               xp++;\r
+                               j>>=1;\r
+                       }\r
                }\r
                chw += xp;\r
        }\r
-}
-
+}\r
+\r
 void modexprintbig(page_t *page, word x, word y, word t, word col, word bgcol, const byte *str)\r
-{
-       word i, s, o, w, j, xp;
+{\r
+       word i, s, o, w, j, xp;\r
        byte l[1024];\r
-       word addr = (word) l;
-       word chw=0;
-       byte c;
-
+       word addr = (word) l;\r
+       word chw=0;\r
+       byte c;\r
+\r
        switch(t)\r
        {\r
-               case 0:
+               case 0:\r
                        w=14;\r
                break;\r
-               case 1:
+               case 1:\r
                        w=8;\r
                break;\r
-               case 2:
+               case 2:\r
                        w=8;\r
                break;\r
-               case 3:
+               case 3:\r
                        w=16;\r
                break;\r
-               default:
+               default:\r
                        t=3;\r
                        w=16;\r
                break;\r
-       }
+       }\r
 \r
        s=romFonts[t].seg;\r
-       o=romFonts[t].off;
+       o=romFonts[t].off;\r
 \r
        for(; *str != '\0'; str++)\r
-       {
-       c = (*str);
-       if((c=='\n'/* || c=="\
-"*/)/* || chw>=page->width*/)
-       {
-               chw=0;
-               y+=w;
-               continue;
-       }
+       {\r
+       c = (*str);\r
+       if((c=='\n'/* || c=="\\r
+"*/)/* || chw>=page->width*/)\r
+       {\r
+               chw=0;\r
+               y+=w;\r
+               continue;\r
+       }\r
        //load the letter 'A'\r
        __asm {\r
                MOV DI, addr\r
@@ -1144,19 +1144,19 @@ void modexprintbig(page_t *page, word x, word y, word t, word col, word bgcol, c
                INC DI\r
                DEC CX\r
                JNZ L1\r
-       }
+       }\r
 \r
-               for(i=0; i<w; i++)
+               for(i=0; i<w; i++)\r
                {\r
-                       j=1<<8;
+                       j=1<<8;\r
                        xp=0;\r
-                       while(j)
-                       {
-                               //modexputPixel(page, x+xp+chw, y+i, l[i] & j ? col:bgcol);
-                               modexClearRegion(page, (x+xp+chw)*8, (y+i)*8, 8, 8, l[i] & j ? col:bgcol);
-                               xp++;
-                               j>>=1;
-                       }
+                       while(j)\r
+                       {\r
+                               //modexputPixel(page, x+xp+chw, y+i, l[i] & j ? col:bgcol);\r
+                               modexClearRegion(page, (x+xp+chw)*8, (y+i)*8, 8, 8, l[i] & j ? col:bgcol);\r
+                               xp++;\r
+                               j>>=1;\r
+                       }\r
                }\r
                chw += xp;\r
        }\r
index c2fb85a4e9814abed3519ecfeb4cd381c82e8e46..e14a2a4441743fd28bced6beb5ede83436f73c42 100644 (file)
Binary files a/test.exe and b/test.exe differ
index 1c8b210fe493d32b1d2c95417864f860d4bcad37..618ccf2c43f8e2f070ffc0b516a8a7d45db15874 100644 (file)
Binary files a/test2.exe and b/test2.exe differ