]> 4ch.mooo.com Git - 16.git/commitdiff
modified: pcxtest.exe
authorsparky4 <sparky4@cock.li>
Fri, 27 Feb 2015 22:53:20 +0000 (16:53 -0600)
committersparky4 <sparky4@cock.li>
Fri, 27 Feb 2015 22:53:20 +0000 (16:53 -0600)
modified:   scroll.exe
renamed:    src/lib/lib_head.cpp -> src/lib/lib_head.c
deleted:    src/lib/scroll.c
deleted:    src/lib/scroll.h
modified:   src/pcxtest.c
modified:   src/scroll.c
modified:   src/test2.c
modified:   test2.exe

PCXTEST.EXE [new file with mode: 0644]
pcxtest.exe
scroll.exe
src/lib/lib_head.c [moved from src/lib/lib_head.cpp with 100% similarity]
src/lib/scroll.c [deleted file]
src/lib/scroll.h [deleted file]
src/pcxtest.c
src/scroll.c
src/test2.c
test2.exe

diff --git a/PCXTEST.EXE b/PCXTEST.EXE
new file mode 100644 (file)
index 0000000..a8cd8e4
Binary files /dev/null and b/PCXTEST.EXE differ
index 28dcf319f613a76735fa7f7af89383e089ac1234..a8cd8e4921c8eb88211fe9f066d3fc65500698de 100644 (file)
Binary files a/pcxtest.exe and b/pcxtest.exe differ
index 0da8ba4d8db38acc1fdff93de08781dcda811061..fecabebcf8ccb99e8fdf259e8a8435f25e9911c1 100644 (file)
Binary files a/scroll.exe and b/scroll.exe differ
similarity index 100%
rename from src/lib/lib_head.cpp
rename to src/lib/lib_head.c
diff --git a/src/lib/scroll.c b/src/lib/scroll.c
deleted file mode 100644 (file)
index b424c8a..0000000
+++ /dev/null
@@ -1,309 +0,0 @@
-#include "src\scroll.h"
-#include "src\lib\modex16.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include "src\lib\dos_kb.h"
-#include "src\lib\wtest\wtest.c"
-
-//word far *clock= (word far*) 0x046C; /* 18.2hz clock */
-
-map_t
-allocMap(int w, int h) {
-       map_t result;
-
-       result.width =w;
-       result.height=h;
-       result.data = malloc(sizeof(byte) * w * h);
-
-       return result;
-}
-
-
-void
-initMap(map_t *map) {
-       /* just a place holder to fill out an alternating pattern */
-       int x, y;
-       int i;
-       int tile = 1;
-       map->tiles = malloc(sizeof(tiles_t));
-
-       /* create the tile set */
-       map->tiles->data = malloc(sizeof(bitmap_t));
-       map->tiles->data->width = (TILEWH*2);
-       map->tiles->data->height= TILEWH;
-       map->tiles->data->data = malloc((TILEWH*2)*TILEWH);
-       map->tiles->tileHeight = TILEWH;
-       map->tiles->tileWidth =TILEWH;
-       map->tiles->rows = 1;
-       map->tiles->cols = 2;
-
-       i=0;
-       for(y=0; y<TILEWH; y++) {
-       for(x=0; x<(TILEWH*2); x++) {
-               if(x<TILEWH)
-                 map->tiles->data->data[i] = 28;//0x24;
-               else
-                 map->tiles->data->data[i] = 0;//0x34;
-               i++;
-       }
-       }
-
-       i=0;
-       for(y=0; y<map->height; y++) {
-               for(x=0; x<map->width; x++) {
-                       map->data[i] = tile;
-                       tile = tile ? 0 : 1;
-                       i++;
-               }
-               tile = tile ? 0 : 1;
-       }
-}
-
-
-void
-mapScrollRight(map_view_t *mv, byte offset, short lp) {
-       word x, y;  /* coordinate for drawing */
-
-       /* increment the pixel position and update the page */
-       mv->page->dx += offset;
-
-       /* check to see if this changes the tile */
-       if(mv->page->dx >= mv->dxThresh ) {
-       /* go forward one tile */
-       mv->tx++;
-       /* Snap the origin forward */
-       mv->page->data += 4;
-       mv->page->dx = mv->map->tiles->tileWidth;
-       //}
-
-       /* draw the next column */
-       x= SCREEN_WIDTH + mv->map->tiles->tileWidth;
-       if(lp%4)
-               mapDrawCol(mv, mv->tx + 20 , mv->ty-1, x, mv->page->dx);
-       }
-}
-
-
-void
-mapScrollLeft(map_view_t *mv, byte offset, short lp) {
-       word x, y;  /* coordinate for drawing */
-
-       /* increment the pixel position and update the page */
-       mv->page->dx -= offset;
-
-       /* check to see if this changes the tile */
-       if(mv->page->dx == 0) {
-       /* go backward one tile */
-       mv->tx--;
-               
-       /* Snap the origin backward */
-       mv->page->data -= 4;
-       mv->page->dx = mv->map->tiles->tileWidth;
-       //}
-       /* draw the next column */
-       if(lp%4)
-               mapDrawCol(mv, mv->tx-1, mv->ty-1, 0, mv->page->dx);
-       }
-}
-
-
-void
-mapScrollUp(map_view_t *mv, byte offset, short lp) {
-       word x, y;  /* coordinate for drawing */
-
-       /* increment the pixel position and update the page */
-       mv->page->dy -= offset;
-
-       /* check to see if this changes the tile */
-       if(mv->page->dy == 0 ) {
-       /* go down one tile */
-       mv->ty--;
-       /* Snap the origin downward */
-       mv->page->data -= mv->page->width*4;
-       mv->page->dy = mv->map->tiles->tileHeight;
-       //}
-
-       /* draw the next row */
-       y= 0;
-       if(lp%3)
-               mapDrawRow(mv, mv->tx-1 , mv->ty-1, y, mv->page->dy);
-       }
-}
-
-
-void
-mapScrollDown(map_view_t *mv, byte offset, short lp) {
-       word x, y;  /* coordinate for drawing */
-
-       /* increment the pixel position and update the page */
-       mv->page->dy += offset;
-
-       /* check to see if this changes the tile */
-       if(mv->page->dy >= mv->dyThresh ) {
-       /* go down one tile */
-       mv->ty++;
-       /* Snap the origin downward */
-       mv->page->data += mv->page->width*4;
-       mv->page->dy = mv->map->tiles->tileHeight;
-       //}
-
-       /* draw the next row */
-       y= SCREEN_HEIGHT + mv->map->tiles->tileHeight;
-       if(lp%3)
-               mapDrawRow(mv, mv->tx-1 , mv->ty+15, y, mv->page->dy);
-       }
-
-}
-
-
-void
-mapGoTo(map_view_t *mv, int tx, int ty) {
-       int px, py;
-       unsigned int i;
-
-       /* set up the coordinates */
-       mv->tx = tx;
-       mv->ty = ty;
-       mv->page->dx = mv->map->tiles->tileWidth;
-       mv->page->dy = mv->map->tiles->tileHeight;
-
-       /* set up the thresholds */
-       mv->dxThresh = mv->map->tiles->tileWidth * 2;
-       mv->dyThresh = mv->map->tiles->tileHeight * 2;
-
-       /* draw the tiles */
-       modexClearRegion(mv->page, 0, 0, mv->page->width, mv->page->height, 0);
-       py=0;
-       i=mv->ty * mv->map->width + mv->tx;
-       for(ty=mv->ty-1; py < SCREEN_HEIGHT+mv->dyThresh && ty < mv->map->height; ty++, py+=mv->map->tiles->tileHeight) {
-               mapDrawWRow(mv, tx-1, ty, py);
-       i+=mv->map->width - tx;
-       }
-}
-
-
-void
-mapDrawTile(tiles_t *t, word i, page_t *page, word x, word y) {
-       word rx;
-       word ry;
-       rx = (i % t->cols) * t->tileWidth;
-       ry = (i / t->cols) * t->tileHeight;
-       modexDrawBmpRegion(page, x, y, rx, ry, t->tileWidth, t->tileHeight, t->data);
-}
-
-
-void 
-mapDrawRow(map_view_t *mv, int tx, int ty, word y, word poopoffset) {
-       word x;
-       int i;
-       poopoffset%=SPEED;
-//printf("y: %d\n", poopoffset);
-       /* the position within the map array */
-       i=ty * mv->map->width + tx;
-       for(x=poopoffset; x<(SCREEN_WIDTH+mv->dxThresh)/(poopoffset+1) && tx < mv->map->width; x+=mv->map->tiles->tileWidth, tx++) {
-       if(i>=0) {
-               /* we are in the map, so copy! */
-               mapDrawTile(mv->map->tiles, mv->map->data[i], mv->page, x, y);
-       }
-       i++; /* next! */
-       }
-}
-
-
-void 
-mapDrawCol(map_view_t *mv, int tx, int ty, word x, word poopoffset) {
-       int y;
-       int i;
-       poopoffset%=SPEED;
-//printf("x: %d\n", poopoffset);
-       /* location in the map array */
-       i=ty * mv->map->width + tx;
-
-       /* We'll copy all of the columns in the screen, 
-          i + 1 row above and one below */
-       for(y=poopoffset; y<(SCREEN_HEIGHT+mv->dyThresh)/(poopoffset+1) && ty < mv->map->height; y+=mv->map->tiles->tileHeight, ty++) {
-       if(i>=0) {
-               /* we are in the map, so copy away! */
-               mapDrawTile(mv->map->tiles, mv->map->data[i], mv->page, x, y);
-       }
-       i += mv->map->width;
-       }
-}
-
-void 
-mapDrawWRow(map_view_t *mv, int tx, int ty, word y) {
-       word x;
-       int i;
-
-       /* the position within the map array */
-       i=ty * mv->map->width + tx;
-       for(x=0; x<SCREEN_WIDTH+mv->dxThresh && tx < mv->map->width; x+=mv->map->tiles->tileWidth, tx++) {
-       if(i>=0) {
-               /* we are in the map, so copy! */
-               mapDrawTile(mv->map->tiles, mv->map->data[i], mv->page, x, y);
-       }
-       i++; /* next! */
-       }
-}
-
-void 
-mapDrawWCol(map_view_t *mv, int tx, int ty, word x) {
-       int y;
-       int i;
-
-       /* location in the map array */
-       i=ty * mv->map->width + tx;
-
-       /* We'll copy all of the columns in the screen, 
-          i + 1 row above and one below */
-       for(y=0; y<SCREEN_HEIGHT+mv->dyThresh && ty < mv->map->height; y+=mv->map->tiles->tileHeight, ty++) {
-       if(i>=0) {
-               /* we are in the map, so copy away! */
-               mapDrawTile(mv->map->tiles, mv->map->data[i], mv->page, x, y);
-       }
-       i += mv->map->width;
-       }
-}
-
-void
-animatePlayer(map_view_t *src, map_view_t *dest, /*map_view_t *top, */short d1, short d2, int x, int y, int ls, int lp, bitmap_t *bmp)
-{
-       short dire=32*d1; //direction
-       short qq; //scroll offset
-
-       if(d2==0) qq = 0;
-       else qq = ((lp)*SPEED);
-       switch (d1)
-       {
-               case 0:
-                       //up
-                       x=x-4;
-                       y=y-qq-TILEWH;
-               break;
-               case 1:
-                       // right
-                       x=x+qq-4;
-                       y=y-TILEWH;
-               break;
-               case 2:
-                       //down
-                       x=x-4;
-                       y=y+qq-TILEWH;
-               break;
-               case 3:
-                       //left
-                       x=x-qq-4;
-                       y=y-TILEWH;
-               break;
-       }
-       modexCopyPageRegion(dest->page, src->page, x-4, y-4, x-4, y-4, 28, 40);
-       if(2>ls && ls>=1) { modexDrawSpriteRegion(dest->page, x, y, 48, dire, 24, 32, bmp); }else
-       if(3>ls && ls>=2) { modexDrawSpriteRegion(dest->page, x, y, 24, dire, 24, 32, bmp); }else
-       if(4>ls && ls>=3) { modexDrawSpriteRegion(dest->page, x, y, 0, dire, 24, 32, bmp); }else
-       if(5>ls && ls>=4) { modexDrawSpriteRegion(dest->page, x, y, 24, dire, 24, 32, bmp); }
-       //TODO: mask copy //modexCopyPageRegion(dest->page, src->page, x-4, y-4, x-4, y-4, 28, 40);
-       //modexClearRegion(top->page, 66, 66, 2, 40, 0);
-       //modexCopyPageRegion(dest->page, top->page, 66, 66, 66, 66, 2, 40);
-       //turn this off if XT
-       if(detectcpu() > 0) modexWaitBorder();
-}
diff --git a/src/lib/scroll.h b/src/lib/scroll.h
deleted file mode 100644 (file)
index e749a6f..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-#ifndef SCROLL_H\r
-#define SCROLL_H\r
-
-typedef struct {
-       bitmap_t *data;
-       word tileHeight;
-       word tileWidth;
-       unsigned int rows;
-       unsigned int cols;
-} tiles_t;
-
-
-typedef struct {
-       byte    *data;
-       tiles_t *tiles;
-       int width;
-       int height;
-} map_t;
-
-
-typedef struct {
-       map_t *map;
-       page_t *page;
-       int tx; //appears to be the top left tile position on the viewable screen map
-       int ty; //appears to be the top left tile position on the viewable screen map
-       word dxThresh; //????
-       word dyThresh; //????
-} map_view_t;
-
-//TODO: make this into actor_t
-struct {
-       int x; //player exact position on the viewable map
-       int y; //player exact position on the viewable map
-       int tx; //player tile position on the viewable map
-       int ty; //player tile position on the viewable map
-       int triggerx; //player's trigger box tile position on the viewable map
-       int triggery; //player's trigger box tile position on the viewable map
-       int hp; //hitpoints of the player
-} player;
-
-
-map_t allocMap(int w, int h);
-void initMap(map_t *map);
-void mapScrollRight(map_view_t *mv, byte offset, short lp);
-void mapScrollLeft(map_view_t *mv, byte offest, short lp);
-void mapScrollUp(map_view_t *mv, byte offset, short lp);
-void mapScrollDown(map_view_t *mv, byte offset, short lp);
-void mapGoTo(map_view_t *mv, int tx, int ty);
-void mapDrawTile(tiles_t *t, word i, page_t *page, word x, word y);
-void mapDrawRow(map_view_t *mv, int tx, int ty, word y, word poopoffset);
-void mapDrawCol(map_view_t *mv, int tx, int ty, word x, word poopoffset);
-void mapDrawWRow(map_view_t *mv, int tx, int ty, word y);
-void mapDrawWCol(map_view_t *mv, int tx, int ty, word x);
-void animatePlayer(map_view_t *src, map_view_t *dest, /*map_view_t *top, */short d1, short d2, int x, int y, int ls, int lp, bitmap_t *bmp);
-
-#define TILEWH 16
-#define QUADWH (TILEWH/4)
-#define SPEED 4
-
-//place holder definitions
-#define MAPX 200
-#define MAPY 150
-#define TRIGGX 10
-#define TRIGGY 9
-//#define SWAP(a, b) tmp=a; a=b; b=tmp;
-#endif\r
index 67e351c7b6a9c89dcae285145bb6a68e31b09269..646598b9449ac6a51ba3e26d74e73ae337ba3733 100644 (file)
@@ -1,4 +1,5 @@
 #include <stdio.h>
+#include <dos.h>
 #include <string.h>\r
 #include "src\lib\modex16.h"\r
 #include "src\lib\bitmap.h"
@@ -69,7 +70,7 @@ void main() {
     modexPalUpdate(bmp.palette);\r
 \r
     /* clear and draw one sprite and one bitmap */\r
-    modexClearRegion(&page, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 1);\r
+    //modexClearRegion(&page, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 1);\r
 \r
     /* non sprite comparison */
     /*start = *clock;\r
@@ -100,9 +101,10 @@ void main() {
     for(i=0; i<100 ;i++) {\r
       modexDrawSprite(&page, 20, 20, &bmp);\r
     }*/
+    _fmemset(MK_FP(0xA000, 0), (int)p->plane, SCREEN_WIDTH*(SCREEN_HEIGHT*2));
        while(!kbhit())
        {
-               DrawPBuf(&page, 0, 0, p, 0);
+               //DrawPBuf(&page, 0, 0, p, 0);
        }
     modexLeave();\r
 
index 3831ed2ba4cb52d5c663733aa0e3674558a9f35d..9af84ef74b562c45002a2285b3867548b7e07f22 100644 (file)
@@ -1,6 +1,7 @@
 #include "src\lib\modex16.h"\r
 #include <stdio.h>\r
-#include <stdlib.h>\r
+#include <stdlib.h>
+#include <string.h>\r
 #include "src\lib\dos_kb.h"\r
 #include "16\lib\x\modex.h"\r
 #include "src\lib\wtest\wtest.c"\r
@@ -225,7 +226,8 @@ void main() {
        modexClearRegion(spri->page, 5*16, 5*16, 16, 16, 255);\r
        modexClearRegion(bg->page, 5*16, 5*16, 16, 16, 255);\r
 \r
-       modexShowPage(spri->page);\r
+       modexShowPage(spri->page);
+       //_fmemset(bg->page, (int)p, 16);\r
        while(!keyp(1) && player.hp>0)\r
        {\r
        //top left corner & bottem right corner of map veiw be set as map edge trigger since maps are actually square\r
@@ -522,7 +524,17 @@ void main() {
                nosound();\r
        }\r
        if(player.q == (TILEWH/SPEED)+1 && player.d > 0 && (player.triggerx == 5 && player.triggery == 5)){ player.hp--; }\r
-       //if(keyp(0x0E)) while(1){ if(xmsmalloc(24)) break; }\r
+       //if(keyp(0x0E)) while(1){ if(xmsmalloc(24)) break; }
+       if(keyp(87))
+       {
+               modexLeave();\r
+               setkb(0);
+               __asm
+               {
+                       mov ah,31h
+                       int 21h
+               }
+       }\r
        }\r
 \r
        /* fade back to text mode */\r
index 7759156e0b01178c8a8197b281cc4176a3556c16..8a844d4ac4da9ff892f6d4db3b343a70f6d6881c 100644 (file)
@@ -31,7 +31,7 @@ void main() {
        bmp.data[i] = color;\r
     }*/\r
 
-       bmp = bitmapLoadPcx("data/46113319.pcx");
+       bmp = bitmapLoadPcx("data/koishi^^.pcx");
 \r
     /* create the planar buffer */\r
     p = planar_buf_from_bitmap(&bmp);\r
index 5dc62ad4e780645ba2df28eb01045a9756150bbb..d9952813f01fee5f08002b2561dac0e3dbfb8b5f 100644 (file)
Binary files a/test2.exe and b/test2.exe differ