]> 4ch.mooo.com Git - 16.git/commitdiff
modex16.c lookings....
authorsparky4 <sparky4@cock.li>
Mon, 15 Jun 2015 17:10:56 +0000 (12:10 -0500)
committersparky4 <sparky4@cock.li>
Mon, 15 Jun 2015 17:10:56 +0000 (12:10 -0500)
modified:   Project 16.bfproject
modified:   maptest.exe
modified:   pcxtest.exe
modified:   scroll.exe
modified:   src/lib/modex16.c
modified:   src/lib/modex16.h
modified:   src/pcxtest.c
modified:   src/scroll.c
modified:   test.exe
modified:   test2.exe

Project 16.bfproject
maptest.exe
pcxtest.exe
scroll.exe
src/lib/modex16.c
src/lib/modex16.h
src/pcxtest.c
src/scroll.c
test.exe
test2.exe

index 25e1576d20da0abf1d5238a2b8ffdc24ac30343f..c5b969ddbbb321c729b99e3a744b5a19c6ae637a 100644 (file)
@@ -2,8 +2,8 @@ c2e.convert_special: 0
 e2c.convert_num: 0
 openfiles: /dos/z/16/doc/project.txt:138:0:0:
 openfiles: /dos/z/16/src/palettec.c:179:0:0:
-openfiles: /dos/z/16/src/pcxtest.c:1431:1432:0:
-openfiles: /dos/z/16/src/scroll.c:20126:19524:1:
+openfiles: /dos/z/16/src/pcxtest.c:141:0:0:
+openfiles: /dos/z/16/src/scroll.c:20776:19775:0:
 openfiles: /dos/z/16/src/fmemtest.c:116:0:0:
 openfiles: /dos/z/16/src/emmtest.c:732:0:0:
 openfiles: /dos/z/16/src/emsdump.c:456:0:0:
@@ -11,17 +11,17 @@ openfiles: /dos/z/16/src/maptest.c:463:0:0:
 openfiles: /dos/z/16/src/maptest0.c:366:0:0:
 openfiles: /dos/z/16/src/test.c:0:0:0:
 openfiles: /dos/z/16/src/test2.c:0:0:0:
-openfiles: /dos/z/16/src/lib/planar.h:602:0:0:
+openfiles: /dos/z/16/src/lib/modex16.c:2794:2497:1:
+openfiles: /dos/z/16/src/lib/modex16.h:1062:586:0:
+openfiles: /dos/z/16/src/lib/planar.h:131:0:0:
 openfiles: /dos/z/16/src/lib/PLANAR.C:0:0:0:
 openfiles: /dos/z/16/src/lib/bitmap.c:1152:604:0:
 openfiles: /dos/z/16/src/lib/bitmap.h:257:0:0:
-openfiles: /dos/z/16/src/lib/modex16.c:24171:23610:0:
-openfiles: /dos/z/16/src/lib/modex16.h:3028:2369:0:
-openfiles: /dos/z/16/src/lib/dos_kb.c:3264:2598:0:
+openfiles: /dos/z/16/src/lib/dos_kb.c:3264:2448:0:
 openfiles: /dos/z/16/src/lib/dos_kb.h:0:0:0:
 openfiles: /dos/z/16/src/lib/mapread.c:2265:1988:0:
 openfiles: /dos/z/16/src/lib/mapread.h:584:0:0:
-openfiles: /dos/z/16/src/lib/fmapread.c:5968:5101:0:
+openfiles: /dos/z/16/src/lib/fmapread.c:5968:4626:0:
 openfiles: /dos/z/16/src/lib/fmapread.h:436:0:0:
 openfiles: /dos/z/16/src/lib/exmm/memory.c:308:99:0:
 openfiles: /dos/z/16/src/lib/exmm/memory.h:0:0:0:
@@ -47,7 +47,7 @@ c2e.convert_iso: 0
 opendir: file:///dos/z/16/src/lib
 wrap_text_default: 0
 bookmarks_filename_mode: 1
-ssearch_text: panswitch
+ssearch_text: modexShowPage()
 snr_casesens: 0
 view_blocks: 1
 name: Project 16
@@ -77,39 +77,39 @@ recent_files: file:///dos/z/16/src/emstest.c
 recent_files: file:///dos/z/16/src/lib/exmm/x.bat
 recent_files: file:///dos/z/16/src/lib/jsmn/jsmn.c
 recent_files: file:///dos/z/16/src/lib/jsmn/jsmn.h
-recent_files: file:///dos/z/16/src/lib/modex16.c
+recent_files: file:///dos/z/16/src/scroll.c
 recent_files: file:///dos/z/16/doc/project.txt
 recent_files: file:///dos/z/16/src/palettec.c
+recent_files: file:///dos/z/16/src/emmtest.c
 recent_files: file:///dos/z/16/src/pcxtest.c
 recent_files: file:///dos/z/16/src/fmemtest.c
-recent_files: file:///dos/z/16/src/emmtest.c
 recent_files: file:///dos/z/16/src/emsdump.c
 recent_files: file:///dos/z/16/src/maptest.c
-recent_files: file:///dos/z/16/src/scroll.c
 recent_files: file:///dos/z/16/src/maptest0.c
 recent_files: file:///dos/z/16/src/test.c
 recent_files: file:///dos/z/16/src/test2.c
 recent_files: file:///dos/z/16/src/lib/planar.h
 recent_files: file:///dos/z/16/src/lib/PLANAR.C
-recent_files: file:///dos/z/16/src/lib/bitmap.c
-recent_files: file:///dos/z/16/src/lib/bitmap.h
-recent_files: file:///dos/z/16/src/lib/modex16.h
 recent_files: file:///dos/z/16/src/lib/dos_kb.c
 recent_files: file:///dos/z/16/src/lib/dos_kb.h
-recent_files: file:///dos/z/16/src/lib/mapread.c
 recent_files: file:///dos/z/16/src/lib/mapread.h
-recent_files: file:///dos/z/16/src/lib/fmapread.c
 recent_files: file:///dos/z/16/src/lib/fmapread.h
-recent_files: file:///dos/z/16/src/lib/exmm/memory.h
+recent_files: file:///dos/z/16/src/lib/fmapread.c
+recent_files: file:///dos/z/16/src/lib/bitmap.c
+recent_files: file:///dos/z/16/src/lib/bitmap.h
+recent_files: file:///dos/z/16/src/lib/mapread.c
 recent_files: file:///dos/z/16/src/lib/exmm/emmsize.h
 recent_files: file:///dos/z/16/src/lib/exmm/emmret.h
+recent_files: file:///dos/z/16/src/lib/exmm/memory.c
 recent_files: file:///dos/z/16/src/lib/jsmn/farjsmn.c
+recent_files: file:///dos/z/16/src/lib/lib_head.h
 recent_files: file:///dos/z/16/src/lib/jsmn/farjsmn.h
+recent_files: file:///dos/z/16/src/lib/exmm/memory.h
+recent_files: file:///dos/z/16/makefile
 recent_files: file:///dos/z/16/src/lib/lib_head.c
-recent_files: file:///dos/z/16/src/lib/lib_head.h
-recent_files: file:///dos/z/16/src/lib/exmm/memory.c
 recent_files: file:///dos/z/16/src/lib/types.h
-recent_files: file:///dos/z/16/makefile
+recent_files: file:///dos/z/16/src/lib/modex16.c
+recent_files: file:///dos/z/16/src/lib/modex16.h
 snr_replacetype: 0
 savedir: file:///dos/z/16/src/lib
 spell_check_default: 1
@@ -121,21 +121,21 @@ snr_escape_chars: 0
 htmlbar_view: 0
 spell_lang: en
 ssearch_dotmatchall: 0
-searchlist: (*bmp)=bitmapLoadPcx("data/font.pcx");(*bmp)=bitmapLoadPcx("data/font.pcx");
-searchlist: modexDraws
-searchlist: reg
-searchlist: animate
-searchlist: SelectPlane
-searchlist: modexClearRegion(page_t *page, int x, int y, int w, int h, byte  color) {
-searchlist: cla
-searchlist: clear
-searchlist: trigg
-searchlist: memset
-searchlist: font
-searchlist: word text_mask[16] = {\n\t0x0002, 0x0102, 0x0202, 0x0302,\r\n\t0x0402, 0x0502, 0x0602, 0x0702,\r\n\t0x0802, 0x0902, 0x0A02, 0x0B02,\r\n\t0x0C02, 0x0D02, 0x0E02, 0x0F02\n};
 searchlist: 0x3C4
 searchlist: SC_INDEX
 searchlist: panswitch
+searchlist: ++++
+searchlist: !!
+searchlist: drawbmp
+searchlist: move
+searchlist: next
+searchlist: bg
+searchlist: newde
+searchlist: default
+searchlist: (1)
+searchlist: map
+searchlist: screen,
+searchlist: modexShowPage()
 autocomplete: 1
 outputb_show_all_output: 0
 bookmarks_show_mode: 0
index 1c90823ea085c686a94e52ed8d6d91ea41b29ce7..4bddfea81b53f80e8060dba35a863008fe74cbb1 100644 (file)
Binary files a/maptest.exe and b/maptest.exe differ
index 56ec4451bd3cf213d573e7165964e80d6bdc37d2..da40e7ab0934d6736485171515cb053a266fd54d 100644 (file)
Binary files a/pcxtest.exe and b/pcxtest.exe differ
index 4551490e71f730734aace7550f1deb1fd72e1289..e446180dd08c2a8136cb87853cd21f97b58ffda5 100644 (file)
Binary files a/scroll.exe and b/scroll.exe differ
index 876f37cab8855e4acc82793b4aec9d4cb4313a3b..ba09a8344ff415efa95240c1be388fba916baceb 100644 (file)
@@ -117,6 +117,21 @@ modexNextPage(page_t *p) {
     return result;
 }
 
+//next page with defined dimentions~
+page_t
+modexNextPage0(page_t *p, word x, word y)
+{
+       page_t result;
+
+       result.data = p->data + (p->width/4)*p->height;  /* compute the offset */
+       result.dx = 0;
+       result.dy = 0;
+       result.width = x;
+       result.height = y;
+
+    return result;
+}
+
 
 void
 modexShowPage(page_t *page) {
@@ -221,6 +236,28 @@ modexClearRegion(page_t *page, int x, int y, int w, int h, byte  color) {
 }
 
 
+void\r
+oldDrawBmp(byte far* page, int x, int y, bitmap_t *bmp, byte sprite)
+{\r
+       byte plane;\r
+       word px, py;\r
+       word offset;\r
+\r
+       /* TODO Make this fast.  It's SLOOOOOOW */\r
+       for(plane=0; plane < 4; plane++) {\r
+               modexSelectPlane(PLANE(plane+x));\r
+               for(px = plane; px < bmp->width; px+=4) {\r
+                       offset=px;\r
+                       for(py=0; py<bmp->height; py++) {\r
+                       if(!sprite || bmp->data[offset])\r
+                               page[PAGE_OFFSET(x+px, y+py)] = bmp->data[offset];\r
+                       offset+=bmp->width;\r
+                       }\r
+               }\r
+       }\r
+}
+
+
 void
 modexDrawBmp(page_t *page, int x, int y, bitmap_t *bmp) {
     /* draw the region (the entire freakin bitmap) */
index 6a497ae50f6d527c3f011befc3af19e47c1f9724..bc23ee3e4b614465013cbc41cad1d53d8ee430ce 100644 (file)
@@ -36,10 +36,12 @@ void modexEnter();
 void modexLeave();
 page_t modexDefaultPage();
 page_t modexNextPage(page_t *p);
+page_t modexNextPage0(page_t *p, word x, word y);
 void modexShowPage(page_t *page);
 void modexPanPage(page_t *page, int dx, int dy);
 void modexSelectPlane(byte plane);
 void modexClearRegion(page_t *page, int x, int y, int w, int h, byte color);
+void oldDrawBmp(byte far* page, int x, int y, bitmap_t *bmp, byte sprite);
 void modexDrawBmp(page_t *page, int x, int y, bitmap_t *bmp);
 void modexDrawBmpRegion(page_t *page, int x, int y, int rx, int ry, int rw, int rh, bitmap_t *bmp);
 void modexDrawPlanarBuf(page_t *page, int x, int y, planar_buf_t *bmp);
index ea8bfdf0b6cfd53be4d4659b0abca6a69f57cc01..7e10a95850cbd677f2819d33fcf85c9edbcfa3b7 100644 (file)
@@ -7,26 +7,6 @@
 \r
 word far* clockw= (word far*) 0x046C; /* 18.2hz clock */\r
 \r
-void\r
-oldDrawBmp(byte far* page, int x, int y, bitmap_t *bmp, byte sprite) {\r
-       byte plane;\r
-       word px, py;\r
-       word offset;\r
-\r
-       /* TODO Make this fast.  It's SLOOOOOOW */\r
-       for(plane=0; plane < 4; plane++) {\r
-       modexSelectPlane(PLANE(plane+x));\r
-       for(px = plane; px < bmp->width; px+=4) {\r
-               offset=px;\r
-               for(py=0; py<bmp->height; py++) {\r
-               if(!sprite || bmp->data[offset])\r
-                 page[PAGE_OFFSET(x+px, y+py)] = bmp->data[offset];\r
-               offset+=bmp->width;\r
-               }\r
-       }\r
-       }\r
-}
-\r
 /*
 void\r
 DrawPBuf(page_t *page, int x, int y, planar_buf_t *p, byte sprite)
@@ -67,7 +47,7 @@ void main() {
 //     bmp = bitmapLoadPcx("data/chikyuu.pcx");
        bmp = bitmapLoadPcx("data/koishi^^.pcx");
 //     bmp = bitmapLoadPcx("16/PCX_LIB/chikyuu.pcx");
-//0000 p = planar_buf_from_bitmap(&bmp);\r
+       p = planar_buf_from_bitmap(&bmp);\r
        modexEnter();\r
 \r
        /* fix up the palette and everything */\r
@@ -77,7 +57,7 @@ void main() {
        modexClearRegion(&page, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 1);\r
 \r
        /* non sprite comparison */
-       /*0000start = *clockw;\r
+       start = *clockw;\r
        for(i=0; i<100 ;i++) {\r
                oldDrawBmp(VGA, 20, 20, &bmp, 0);\r
        }\r
@@ -107,7 +87,7 @@ void main() {
        for(i=0; i<100 ;i++) {\r
 //0000         modexDrawSprite(&page, 20, 20, &bmp);
                modexDrawSprite(&page, 0, 0, &bmp);\r
-       }*/
+       }
        //_fmemset(MK_FP(0xA000, 0), (int)p->plane, SCREEN_WIDTH*(SCREEN_HEIGHT*2));
        modexDrawBmp(&page, 0, 0, &bmp);
        while(!kbhit())
@@ -119,12 +99,12 @@ void main() {
        printf("\n%d\n", sizeof(p->plane));
        printf("%d\n", sizeof(bmp));
 
-       /*for(i=0; i<(320*240); i++)
+       for(i=0; i<(320*240); i++)
        {
                fprintf(stdout, "%d", bmp.data[i]);
                if(i%320==0) fprintf(stdout, "\n");
-       }*/\r
-//0000 printf("CPU to VGA: %f\n", t1);\r
-//0000 printf("VGA to VGA: %f\n", t2);\r
+       }\r
+       printf("CPU to VGA: %f\n", t1);\r
+       printf("VGA to VGA: %f\n", t2);\r
        return;\r
 }\r
index 8134a31c71759e5185d8c6c774e24add09c94105..6546d4decfd92894da3b8befc3f6132e027be028 100644 (file)
@@ -191,8 +191,9 @@ void main() {
        screen.height += (TILEWH*2)+QUADWH;\r
        mv.page = &screen;\r
        screen2 = modexNextPage(mv.page);\r
-       mv2.page = &screen2;\r
-       screen3 = screen2;\r
+       mv2.page = &screen2;
+       screen3 = modexNextPage0(mv2.page, 352, 176);   //(352*176)+1024 is the remaining amount of memory left wwww
+       //screen3 = modexNextPage0(mv2.page, 320, 192); //(352*176)+1024 is the remaining amount of memory left wwww
        mv3.page = &screen3;\r
 \r
        /* set up paging */\r
@@ -532,8 +533,10 @@ void main() {
                        {
                                bg->page->dx++;
                                spri->page->dx++;
+                               mask->page->dx++;
                                modexShowPage(bg->page);
                                modexShowPage(spri->page);
+                               modexShowPage(mask->page);
                                panq++;\r
                        } else { panq = 1; pand = 0; }\r
        }\r
@@ -545,8 +548,10 @@ void main() {
                        {\r
                                bg->page->dx--;
                                spri->page->dx--;
+                               mask->page->dx--;
                                modexShowPage(bg->page);
                                modexShowPage(spri->page);
+                               modexShowPage(mask->page);
                                panq++;\r
                        } else { panq = 1; pand = 0; }\r
        }\r
@@ -558,8 +563,10 @@ void main() {
                        {\r
                                bg->page->dy--;
                                spri->page->dy--;
+                               mask->page->dy--;
                                modexShowPage(bg->page);
                                modexShowPage(spri->page);
+                               modexShowPage(mask->page);
                                panq++;\r
                        } else { panq = 1; pand = 0; }\r
        }\r
@@ -571,12 +578,17 @@ void main() {
                        {\r
                                bg->page->dy++;
                                spri->page->dy++;
+                               mask->page->dy++;
                                modexShowPage(bg->page);
-                               modexShowPage(spri->page);\r
+                               modexShowPage(spri->page);
+                               modexShowPage(mask->page);\r
                                panq++;\r
                        } else { panq = 1; pand = 0; }\r
        }
-}\r
+}
+
+       //the scripting stuf....
+\r
        //if(((player.triggerx == TRIGGX && player.triggery == TRIGGY) && keyp(0x1C))||(player.tx == 5 && player.ty == 5))
        if(((bg->map->data[(player.triggerx-1)+(map.width*(player.triggery-1))] == 0) && keyp(0x1C))||(player.tx == 5 && player.ty == 5))\r
        {\r
@@ -587,10 +599,14 @@ void main() {
                }\r
                nosound();\r
        }\r
-       if(player.q == (TILEWH/SPEED)+1 && player.d > 0 && (player.triggerx == 5 && player.triggery == 5)){ player.hp--; }\r
+       if(player.q == (TILEWH/SPEED)+1 && player.d > 0 && (player.triggerx == 5 && player.triggery == 5)){ player.hp--; }
+       //debugging binds!\r
        //if(keyp(0x0E)) while(1){ if(xmsmalloc(24)) break; }
+       if(keyp(2)) modexShowPage(bg->page);
+       if(keyp(3)) modexShowPage(spri->page);
+       if(keyp(4)) modexShowPage(mask->page);
        if(keyp(0x44)){ bputs(spri->page, player.x+(TILEWH*2), player.y+(TILEWH*2), "wwww"); }  //f10
-       if(keyp(25)){ pdump(bg); pdump(spri); }\r
+       if(keyp(25)){ pdump(bg); pdump(spri); } //p\r
        if(keyp(24)){ modexPalUpdate0(gpal); paloffset=0; pdump(bg); pdump(spri); }\r
        if(keyp(22)){\r
        paloffset=0; modexPalBlack(); modexPalUpdate(&ptmp, &paloffset, 0, 0);\r
@@ -599,9 +615,9 @@ void main() {
        printf("2paloffset      =       %d\n", paloffset/3);\r
         pdump(bg); pdump(spri); }
        //pan switch\r
-       if(keyp(88)){if(!panswitch) panswitch++; else panswitch--; }
+       if(keyp(88)){if(!panswitch) panswitch++; else panswitch--; }    //f12
        //TSR\r
-       if(keyp(87))\r
+       if(keyp(87))    //f11\r
        {\r
                modexLeave();\r
                setkb(0);\r
@@ -648,7 +664,7 @@ void main() {
        //xmsreport();\r
        //emmclose(emmhandle);
        printf("%Fp\n", bios_8x8_font());
-       printf("%c\n", *bios_8x8_font());\r
+       //printf("%c\n", *bios_8x8_font());\r
        switch(detectcpu())\r
        {\r
                case 0: cpus = "8086/8088 or 186/88"; break;\r
index 53112b7a07a1a218d7222448897fb321101330a7..13eadb07f503668bc69c1bc138a33ea71241cfe2 100644 (file)
Binary files a/test.exe and b/test.exe differ
index 246a3d0a84bbacf012ce3e0c02c2672eadc29b1b..bfc3938a8a9fecc9364d6a65a6eeba298a59fa25 100644 (file)
Binary files a/test2.exe and b/test2.exe differ