From: sparky4 Date: Sun, 19 Jul 2015 17:59:28 +0000 (-0500) Subject: modified exmmtest.exe to display graphix X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=9ffe77d9a59bd77df9ab71eb98e82c97a1fa6076;p=16.git modified exmmtest.exe to display graphix 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 --- diff --git a/16.exe b/16.exe index 01c5a5db..7c6d3b2a 100644 Binary files a/16.exe and b/16.exe differ diff --git a/exmmtest.exe b/exmmtest.exe index 81f8adca..dda4760f 100644 Binary files a/exmmtest.exe and b/exmmtest.exe differ diff --git a/fontgfx.exe b/fontgfx.exe index 467876eb..9e1cf4c8 100644 Binary files a/fontgfx.exe and b/fontgfx.exe differ diff --git a/fonttes0.exe b/fonttes0.exe index a344db54..ba35e19f 100644 Binary files a/fonttes0.exe and b/fonttes0.exe differ diff --git a/maptest.exe b/maptest.exe index a80241dc..56530553 100644 Binary files a/maptest.exe and b/maptest.exe differ diff --git a/miditest.exe b/miditest.exe index f595dbe1..1cf5b3db 100644 Binary files a/miditest.exe and b/miditest.exe differ diff --git a/palettec.exe b/palettec.exe index 218d24ce..11918685 100644 Binary files a/palettec.exe and b/palettec.exe differ diff --git a/pcxtest.exe b/pcxtest.exe index 11c81339..5200e0d6 100644 Binary files a/pcxtest.exe and b/pcxtest.exe differ diff --git a/src/exmmtest.c b/src/exmmtest.c index 00d01bf1..8cd440f5 100644 --- a/src/exmmtest.c +++ b/src/exmmtest.c @@ -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(); + + /* setup camera and screen~ */ + screen = modexDefaultPage(); + screen.width += (16*2); + 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); diff --git a/src/lib/16_mm.c b/src/lib/16_mm.c index 1ae9e65a..9e980b67 100644 --- a/src/lib/16_mm.c +++ b/src/lib/16_mm.c @@ -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); diff --git a/src/lib/16_mm.h b/src/lib/16_mm.h index 984f932c..f7457aa5 100644 --- a/src/lib/16_mm.h +++ b/src/lib/16_mm.h @@ -25,6 +25,7 @@ #include //#include #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); diff --git a/src/lib/modex16.c b/src/lib/modex16.c index 3efba94c..10c5e9c8 100644 --- a/src/lib/modex16.c +++ b/src/lib/modex16.c @@ -961,14 +961,23 @@ void modexputPixel(page_t *page, int x, int y, byte color) } -byte modexgetPixel(int x, int y) -{ +byte modexgetPixel(page_t *page, int x, int y) +{ + word pageOff = (word) page->data; /* Select the plane from which we must read the pixel color: */ outpw(GC_INDEX, 0x04); outpw(GC_INDEX+1, x & 3); - return VGA[(unsigned)((SCREEN_WIDTH/4) * y) + (x / 4) + 0]; + return VGA[(unsigned)((SCREEN_WIDTH/4) * y) + (x / 4) + pageOff]; +} + +void modexhlin(page_t *page, word xl, word xh, word y, word color) +{ + word x; + + for(x=0;x