From: sparky4 Date: Tue, 23 Dec 2014 20:23:38 +0000 (-0600) Subject: modified: makefile X-Git-Url: http://4ch.mooo.com/gitweb/?p=16.git;a=commitdiff_plain;h=a6eadf5caebd181c24e3c210f3e5dc0b2e50b9c4 modified: makefile modified: scroll.exe modified: src/scroll.c --- diff --git a/makefile b/makefile index a6a4be18..0a47caf6 100644 --- a/makefile +++ b/makefile @@ -1,10 +1,10 @@ -FLAGS=-0 -d2 -SRC=src\ +FLAGS=-0 -d2 +SRC=src\ SRCLIB=$(SRC)lib\ all: test.exe pcxtest.exe test2.exe scroll.exe scroll.exe: scroll.obj modex16.obj dos_kb.obj bitmap.obj - wcl $(FLAGS) scroll.obj modex16.obj dos_kb.obj bitmap.obj + wcl $(FLAGS) scroll.obj modex16.obj dos_kb.obj bitmap.obj 16\lib\x\modex.lib scroll.obj: $(SRC)scroll.c wcl $(FLAGS) -c $(SRC)scroll.c test.exe: test.obj modex16.obj bitmap.obj diff --git a/scroll.exe b/scroll.exe index 43479f22..ba9037f2 100644 Binary files a/scroll.exe and b/scroll.exe differ diff --git a/src/scroll.c b/src/scroll.c index d382bff2..b91adf7d 100644 --- a/src/scroll.c +++ b/src/scroll.c @@ -2,13 +2,14 @@ #include #include #include "src\lib\dos_kb.h" +#include "16\lib\x\modex.h" #include "src\lib\wtest\wtest.c" #include "src\lib\ems.c" -//word far *clock= (word far*) 0x046C; /* 18.2hz clock */ - -int emmhandle,ist; - +//word far *clock= (word far*) 0x046C; /* 18.2hz clock */ + +int emmhandle,ist; + typedef struct { bitmap_t *data; word tileHeight; @@ -45,7 +46,7 @@ typedef struct { int setx; //NOT USED YET! player sprite sheet set on the image x int sety; //NOT USED YET! player sprite sheet set on the image y word q; //loop variable - word d; //direction + word d; //direction bitmap_t data; //supposively the sprite sheet data int hp; //hitpoints of the player } actor_t; @@ -68,15 +69,15 @@ void animatePlayer(map_view_t *src, map_view_t *dest, /*map_view_t *top, */sword //#define LOOPMAX (TILEWH/SPEED) //place holder definitions -#define MAPX 40 -#define MAPY 30 +#define MAPX 200 +#define MAPY 150 #define TRIGGX 10 -#define TRIGGY 9 - +#define TRIGGY 9 + void main() { bitmap_t ptmp;//, npctmp; // player sprite const char *cpus; - static int persist_aniframe = 0; /* gonna be increased to 1 before being used, so 0 is ok for default */ + static int persist_aniframe = 0; /* gonna be increased to 1 before being used, so 0 is ok for default */ page_t screen, screen2, screen3; map_t map; map_view_t mv, mv2, mv3; @@ -85,52 +86,52 @@ void main() { byte *ptr; actor_t player; //actor_t npc0; - - if(isEMS() || checkEMS()){ printf("%d\n", coretotalEMS()); emmhandle = mallocEMS(coretotalEMS()); } + + if(isEMS() || checkEMS()){ printf("%d\n", coretotalEMS()); emmhandle = mallocEMS(coretotalEMS()); } /* create the map */ map = allocMap(MAPX,MAPY); //20x15 is the resolution of the screen you can make maps smaller than 20x15 but the null space needs to be drawn properly - //if(isEMS()) printf("%d tesuto\n", coretotalEMS()); + //if(isEMS()) printf("%d tesuto\n", coretotalEMS()); initMap(&map); mv.map = ↦ mv2.map = ↦ - mv3.map = ↦ - + mv3.map = ↦ + /* draw the tiles */ ptr = map.data; /* data */ ptmp = bitmapLoadPcx("ptmp.pcx"); // load sprite - //npctmp = bitmapLoadPcx("ptmp1.pcx"); // load sprite - - /*if(isEMS()) - { - XMOVE mm; - mm.length=sizeof(map); - mm.sourceH=0; - mm.sourceOff=(long)↦ - mm.destH=emmhandle; - mm.destOff=1; - //halp! - ist = move_emem(&mm); - printf("%d\n", coretotalEMS()); - if(!ist){ dealloc_emem(emmhandle); exit(5); } - //printf("%d\n", emmhandle); - } - - if(isEMS()) - { - XMOVE mm; - mm.length=emmhandle; - mm.sourceH=0; - mm.sourceOff=(long)&ptmp; - mm.destH=emmhandle; - mm.destOff=0; - //halp! - ist = move_emem(&mm); - printf("%d\n", coretotalEMS()); - if(!ist){ dealloc_emem(emmhandle); exit(5); } - //printf("%d\n", emmhandle); - } + //npctmp = bitmapLoadPcx("ptmp1.pcx"); // load sprite + + /*if(isEMS()) + { + XMOVE mm; + mm.length=sizeof(map); + mm.sourceH=0; + mm.sourceOff=(long)↦ + mm.destH=emmhandle; + mm.destOff=1; + //halp! + ist = move_emem(&mm); + printf("%d\n", coretotalEMS()); + if(!ist){ dealloc_emem(emmhandle); exit(5); } + //printf("%d\n", emmhandle); + } + + if(isEMS()) + { + XMOVE mm; + mm.length=emmhandle; + mm.sourceH=0; + mm.sourceOff=(long)&ptmp; + mm.destH=emmhandle; + mm.destOff=0; + //halp! + ist = move_emem(&mm); + printf("%d\n", coretotalEMS()); + if(!ist){ dealloc_emem(emmhandle); exit(5); } + //printf("%d\n", emmhandle); + } */ /* save the palette */ pal = modexNewPal(); @@ -495,7 +496,7 @@ void main() { modexFadeOff(4, ptmp.palette); modexPalBlack(); modexLeave(); - setkb(0); + setkb(0); //system("mem /E /P"); printf("Project 16 scroll.exe\n"); printf("tx: %d\n", bg->tx); @@ -512,18 +513,18 @@ void main() { printf("player.d: %d\n", player.d); printf("temporary player sprite 0: http://www.pixiv.net/member_illust.php?mode=medium&illust_id=45556867\n"); printf("temporary player sprite 1: http://www.pixiv.net/member_illust.php?mode=medium&illust_id=44606385\n"); - printf("\n"); - //xmsfree(&map); - //xmsfree(bg); - //xmsfree(spri); - //xmsfree(mask); - //xmsreport(); - if(isEMS()) - { - printf("%d\n", get_emem()); - printf("%d\n", coretotalEMS()); - dealloc_emem(emmhandle); - printf("%d\n", coretotalEMS()); + printf("\n"); + //xmsfree(&map); + //xmsfree(bg); + //xmsfree(spri); + //xmsfree(mask); + //xmsreport(); + if(isEMS()) + { + printf("%d\n", get_emem()); + printf("%d\n", coretotalEMS()); + dealloc_emem(emmhandle); + printf("%d\n", coretotalEMS()); } switch(detectcpu()) { @@ -544,21 +545,21 @@ allocMap(int w, int h) { result.width =w; result.height=h; - result.data = malloc(sizeof(byte) * w * h); + result.data = malloc(sizeof(byte) * w * h); //result.data = (byte *)alloc_emem(((int)sizeof(byte) * w * h)/1024); - /*if(isEMS() || checkEMS()) - { - XMOVE mm; - //emmhandle = mallocEMS(coretotalEMS());//alloc_emem((int)sizeof(map)) - mm.length=sizeof(result); - mm.sourceH=0; - mm.sourceOff=ptr2long(&result); - mm.destH=emmhandle; - mm.destOff=0; - ist = move_emem(&mm); - if(!ist){ dealloc_emem(emmhandle); exit(5); } - printf("%d\n", coretotalEMS()); - }*/ + /*if(isEMS() || checkEMS()) + { + XMOVE mm; + //emmhandle = mallocEMS(coretotalEMS());//alloc_emem((int)sizeof(map)) + mm.length=sizeof(result); + mm.sourceH=0; + mm.sourceOff=ptr2long(&result); + mm.destH=emmhandle; + mm.destOff=0; + ist = move_emem(&mm); + if(!ist){ dealloc_emem(emmhandle); exit(5); } + printf("%d\n", coretotalEMS()); + }*/ return result; } @@ -571,19 +572,19 @@ initMap(map_t *map) { int tile = 1; //if(!isEMS() || !checkEMS()) map->tiles = malloc(sizeof(tiles_t)); - //else + //else // map->tiles = (tiles_t *)alloc_emem(sizeof(tiles_t)); /* create the tile set */ //if(!isEMS() || !checkEMS()) map->tiles->data = malloc(sizeof(bitmap_t)); - //else + //else // map->tiles->data = (bitmap_t *)alloc_emem(sizeof(bitmap_t)); map->tiles->data->width = (TILEWH*2); map->tiles->data->height= TILEWH; //if(!isEMS() || !checkEMS()) map->tiles->data->data = malloc((TILEWH*2)*TILEWH); - //else + //else // map->tiles->data->data = (byte *)alloc_emem((TILEWH*2)*TILEWH); map->tiles->tileHeight = TILEWH; map->tiles->tileWidth =TILEWH; @@ -737,6 +738,7 @@ mapDrawTile(tiles_t *t, word i, page_t *page, word x, word y) { word ry; rx = (i % t->cols) * t->tileWidth; ry = (i / t->cols) * t->tileHeight; + //mxPutTile(t->data, x, y, t->tileWidth, t->tileHeight); modexDrawBmpRegion(page, x, y, rx, ry, t->tileWidth, t->tileHeight, t->data); }