]> 4ch.mooo.com Git - 16.git/commitdiff
modified exmmtest.exe to display graphix
authorsparky4 <sparky4@cock.li>
Sun, 19 Jul 2015 17:59:28 +0000 (12:59 -0500)
committersparky4 <sparky4@cock.li>
Sun, 19 Jul 2015 17:59:28 +0000 (12:59 -0500)
modified:   16.exe
modified:   exmmtest.exe
modified:   fontgfx.exe
modified:   fonttes0.exe
modified:   maptest.exe
modified:   miditest.exe
modified:   palettec.exe
modified:   pcxtest.exe
modified:   src/exmmtest.c
modified:   src/lib/16_mm.c
modified:   src/lib/16_mm.h
modified:   src/lib/modex16.c
modified:   src/lib/modex16.h
modified:   test.exe
modified:   test2.exe

15 files changed:
16.exe
exmmtest.exe
fontgfx.exe
fonttes0.exe
maptest.exe
miditest.exe
palettec.exe
pcxtest.exe
src/exmmtest.c
src/lib/16_mm.c
src/lib/16_mm.h
src/lib/modex16.c
src/lib/modex16.h
test.exe
test2.exe

diff --git a/16.exe b/16.exe
index 01c5a5dbf118c7917a5328ff5f67c694e95b444c..7c6d3b2abeb050a9ada4c18194cdfe5fcdbf0937 100644 (file)
Binary files a/16.exe and b/16.exe differ
index 81f8adca85b40e0894d44e4a5d220f48fb205f49..dda4760f6a0e1c9b2d755ac26da235798a56c796 100644 (file)
Binary files a/exmmtest.exe and b/exmmtest.exe differ
index 467876eb56bdcbf0feebc4daf45dd7e086893e33..9e1cf4c849bf50f7009342de4618bbfe74234d44 100644 (file)
Binary files a/fontgfx.exe and b/fontgfx.exe differ
index a344db5487ed9e49e52b87ccb3c06c9773040569..ba35e19f9a930c21f4edd4eb1474ed199afed13e 100644 (file)
Binary files a/fonttes0.exe and b/fonttes0.exe differ
index a80241dcd3f8c66258bdfac9bab2016a5a908342..5653055346a2de29ac5f7d9bd88633fffa2211dc 100644 (file)
Binary files a/maptest.exe and b/maptest.exe differ
index f595dbe1ac176c67db125ac2da6dacb12e0017f2..1cf5b3dbed31e993c6f0e791168aa369afc203f2 100644 (file)
Binary files a/miditest.exe and b/miditest.exe differ
index 218d24ce8a9ddad62d80e4f25ccf20cb94892aad..119186852495951e291fcc1407b07db724b7a3e2 100644 (file)
Binary files a/palettec.exe and b/palettec.exe differ
index 11c81339b8a167364c648ba9059ca1401e6aa7d9..5200e0d6f1e0c1eadbf3aba55b6ebbfe20c1fad5 100644 (file)
Binary files a/pcxtest.exe and b/pcxtest.exe differ
index 00d01bf119415c556c5922d06f89fb92c85ab4d5..8cd440f558bc2a19146c380cd7f806983c662aac 100644 (file)
@@ -24,6 +24,7 @@
 */
 #include "src/lib/16_ca.h"
 #include "src/lib/16_mm.h"
+#include "src/lib/modex16.h"
 
 void
 main(int argc, char *argv[])
@@ -33,6 +34,7 @@ main(int argc, char *argv[])
        __segment segu;
        char *bakapee;
        word baka;
+       page_t screen;
 
        bakapee = malloc(64);
 //     memset(bakapee, 0, 64);
@@ -41,6 +43,13 @@ main(int argc, char *argv[])
        if(argv[1]) bakapee = argv[1];
        else bakapee = "data/koishi~~.pcx";
 
+       textInit();\r
+
+       /* setup camera and screen~ */\r
+       screen = modexDefaultPage();\r
+       screen.width += (16*2);\r
+       screen.height += (16*2);
+
        printf("start!\n");
        MM_Startup(&mm, &mmi);
        printf("done!\n");
@@ -51,8 +60,12 @@ main(int argc, char *argv[])
        //MM_GetPtr(&bigbuffer, mmi.nearheap, &mm, &mmi);
        //hmm functions in cache system use the buffered stuff
        printf("size of big buffer~=%u\n", _bmsize(segu, bigbuffer));
-       MM_ShowMemory(&mm);
-       MM_Report(&mm, &mmi);
+       getch();
+       modexEnter();
+       MM_ShowMemory(&screen, &mm);
+       getch();
+       MM_Report(&screen, &mm, &mmi);
+       modexLeave();
        printf("stop!\n");
        MM_FreePtr(&bigbuffer, &mm);
        MM_Shutdown(&mm);
index 1ae9e65ab9f94e24f706f0eded02541424963b6a..9e980b670e39cb2b99bb34611de98606acf44e24 100644 (file)
@@ -670,11 +670,11 @@ void MM_Startup(mminfo_t *mm, mminfotype *mmi)
                MML_SetupEMS(mm);                                       // allocate space
                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!
                //TODO: EMS4! AND EMS 3.2 MASSIVE DATA HANDLMENT!
-               MML_UseSpace(mm->EMSpageframe,(mm->EMSpagesmapped)*0x4000lu, mm);
+               MML_UseSpace(mm->EMSpageframe,(MAPPAGES)*0x4000lu, mm);
 //printf("EMS3\n");
                MM_MapEMS(mm);                                  // map in used pages
 //printf("EMS4\n");
-               mmi->EMSmem = (mm->EMSpagesmapped)*0x4000lu;
+               mmi->EMSmem = (MAPPAGES)*0x4000lu;
        }
 
 //
@@ -1069,11 +1069,12 @@ void MM_SortMem(mminfo_t *mm)
 =====================
 */
 
-void MM_ShowMemory(mminfo_t *mm)
+void MM_ShowMemory(page_t *page, mminfo_t *mm)
 {
        mmblocktype huge *scan;
        unsigned color,temp;
        long    end,owner;
+       word chx,chy;
        char    scratch[160],str[16];
 
 //**** VW_SetDefaultColors();
@@ -1088,6 +1089,9 @@ void MM_ShowMemory(mminfo_t *mm)
 
 //CA_OpenDebug ();
 
+       chx=0;
+       chy=0;
+
        while(scan)
        {
                if(scan->attributes & PURGEBITS)
@@ -1098,18 +1102,24 @@ void MM_ShowMemory(mminfo_t *mm)
                        color = 12;             // red = locked
                if(scan->start<=end)
                {
-                       printf("\nMM_ShowMemory: Memory block order currupted!\n");
+                       //printf("\nMM_ShowMemory: Memory block order currupted!\n");
+                       modexprint(&page, chx, chy, 1, 0, 24, "\nMM_ShowMemory: Memory block order currupted!\n");
                        return;
                }
                end = scan->start+scan->length-1;
+//++++                         modexhlin(page, scan->start, (unsigned)end, chy, color);
 //++++         VW_Hlin(scan->start,(unsigned)end,0,color);
+//void VW_Plot(unsigned x, unsigned y, unsigned color);
+//void VW_Hlin(unsigned xl, unsigned xh, unsigned y, unsigned color);
+
 //++++         VW_Plot(scan->start,0,15);
+//++++                         modexputPixel(page, scan->start, chy, 15);
                if(scan->next->start > end+1)
 //++++                 VW_Hlin(end+1,scan->next->start,0,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!
-strcpy(scratch,"Location:");
+strcpy(scratch,"Seg:");
 ultoa (scan->start,str,16);
 strcat (scratch,str);
 strcat (scratch,"\tSize:");
@@ -1121,7 +1131,9 @@ ultoa (owner,str,16);
 strcat (scratch,str);
 strcat (scratch,"\n");
 //++++write (debughandle,scratch,strlen(scratch));
-fprintf(stdout, "%s", scratch);
+modexprint(page, chx, chy, 1, 0, 24, &scratch);
+chy+=8;
+//fprintf(stdout, "%s", scratch);
 //****#endif
 
                scan = scan->next;
@@ -1209,11 +1221,11 @@ dword MM_TotalFree(mminfo_t *mm)
 =====================
 */
 
-void MM_Report(mminfo_t *mm, mminfotype *mmi)
+void MM_Report(page_t *page, mminfo_t *mm, mminfotype *mmi)
 {
        if(MML_CheckForEMS())
        {
-               printf("EMM %x available\n", mm->EMSVer);
+               printf("EMM v%x.%x available\n", mm->EMSVer>>4,mm->EMSVer&0x0F);
                printf("totalEMSpages=%u\n", mm->totalEMSpages);
                printf("freeEMSpages=%u\n", mm->freeEMSpages);
                printf("EMSpageframe=%x\n", mm->EMSpageframe);
index 984f932c00adc443128e5d90d383296b316a8f8a..f7457aa5401dd287f0583dc8e7bc31bdf86f32c7 100644 (file)
@@ -25,6 +25,7 @@
 #include <malloc.h>
 //#include <bios.h>
 #include "src/lib/16_head.h"
+#include "src/lib/modex16.h"
 //++++mh       #include "src/lib/16_in.h"
 
 #ifdef __DEBUG__               // 1 == Debug/Dev  ;  0 == Production/final
@@ -111,6 +112,7 @@ extern void         (* XMSaddr) (void);             // far pointer to XMS driver
 #define BASEATTRIBUTES 0       // unlocked, non purgable
 
 #define MAXUMBS                12
+#define MAPPAGES               4/*mm->EMSpagesmapped*/
 
 typedef struct mmblockstruct
 {
@@ -175,10 +177,10 @@ void MM_FreePtr(memptr *baseptr, mminfo_t *mm);
 void MM_SetPurge(memptr *baseptr, int purge, mminfo_t *mm);
 void MM_SetLock(memptr *baseptr, boolean locked, mminfo_t *mm);
 void MM_SortMem(mminfo_t *mm);
-void MM_ShowMemory(mminfo_t *mm);
+void MM_ShowMemory(page_t *page, mminfo_t *mm);
 dword MM_UnusedMemory(mminfo_t *mm);
 dword MM_TotalFree(mminfo_t *mm);
-void MM_Report(mminfo_t *mm, mminfotype *mmi);
+void MM_Report(page_t *page, mminfo_t *mm, mminfotype *mmi);
 //int MM_EMSVer(void);
 void MM_BombOnError(boolean bomb, mminfo_t *mm);
 void MM_GetNewBlock(mminfo_t *mm);
index 3efba94c6286bb39f1286f7c237eb5f1bd23bb67..10c5e9c8a1ea165958f1926037e29383089ad935 100644 (file)
@@ -961,14 +961,23 @@ void modexputPixel(page_t *page, int x, int y, byte color)
 \r
 }\r
 \r
-byte modexgetPixel(int x, int y)\r
-{\r
+byte modexgetPixel(page_t *page, int x, int y)\r
+{
+       word pageOff = (word) page->data;\r
        /* Select the plane from which we must read the pixel color: */\r
        outpw(GC_INDEX, 0x04);\r
        outpw(GC_INDEX+1, x & 3);\r
 \r
-       return VGA[(unsigned)((SCREEN_WIDTH/4) * y) + (x / 4) + 0];\r
+       return VGA[(unsigned)((SCREEN_WIDTH/4) * y) + (x / 4) + pageOff];\r
 \r
+}
+
+void modexhlin(page_t *page, word xl, word xh, word y, word color)
+{
+       word x;
+
+       for(x=0;x<xh;x++)
+       modexputPixel(page, x+xl, y, color);
 }\r
 \r
 void modexprint(page_t *page, word x, word y, word t, word col, word bgcol, const byte *str)\r
index 122e11e3cc8197050d09ea38479e9b1ea9a75161..30802c9a076d75e34f2bcf190cc1f8c3317a79e5 100644 (file)
@@ -94,6 +94,8 @@ void modexPalUpdate1(byte *p);
 void modexPalUpdate0(byte *p);
 void chkcolor(bitmap_t *bmp, word *q, word *a, word *aa, word *z, word *i/*, word *offset*/);
 void modexputPixel(page_t *page, int x, int y, byte color);
+byte modexgetPixel(page_t *page, int x, int y);
+void modexhlin(page_t *page, word xl, word xh, word y, word color);
 void modexprint(page_t *page, word x, word y, word t, word col, word bgcol, const byte *str);
 void modexprintbig(page_t *page, word x, word y, word t, word col, word bgcol, const byte *str);
 void modexWaitBorder();
index 3121770bd7322c8a71dce548b9e6409a9fe5bedc..ff36674ac599ee67aa3b3e06d8b056a823d8c2fd 100644 (file)
Binary files a/test.exe and b/test.exe differ
index dd3b21a184ee8d8364b3efad7440f46bd644f838..49f7b7e46d052e76d3449ae0830871c0b9734f0a 100644 (file)
Binary files a/test2.exe and b/test2.exe differ