From: sparky4 Date: Mon, 3 Aug 2015 17:13:53 +0000 (-0500) Subject: Signed-off-by: sparky4 X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=9a8a5d6ba7fe341288dd42aab1bc33de2da1b9d7;p=16.git Signed-off-by: sparky4 --- diff --git a/makefile b/makefile index 75805bc0..55ed3f26 100644 --- a/makefile +++ b/makefile @@ -30,7 +30,7 @@ OFLAGS=-obmiler -out -oh -ei -zp8 -0 -fpi87 -onac -ol+ -ok####x FLAGS=$(OFLAGS) $(CFLAGS) $(DFLAGS) $(ZFLAGS) DOSLIBEXMMOBJ = himemsys.$(OBJ) emm.$(OBJ) -DOSLIBOBJ = adlib.$(OBJ) midi.$(OBJ) 8254.$(OBJ) 8259.$(OBJ) dos.$(OBJ) cpu.$(OBJ) +DOSLIBOBJ = adlib.$(OBJ) 8254.$(OBJ) 8259.$(OBJ) dos.$(OBJ) cpu.$(OBJ) 16LIBOBJS = bakapee.$(OBJ) 16_in.$(OBJ) 16_mm.$(OBJ) wcpu.$(OBJ) 16_head.$(OBJ) scroll16.$(OBJ) 16_ca.$(OBJ) timer.$(OBJ) kitten.$(OBJ) GFXLIBOBJS = modex16.$(OBJ) bitmap.$(OBJ) planar.$(OBJ) 16text.$(OBJ) @@ -82,8 +82,8 @@ inputest.exe: inputest.$(OBJ) 16.lib sountest.exe: sountest.$(OBJ) 16.lib wcl $(FLAGS) sountest.$(OBJ) 16.lib -miditest.exe: miditest.$(OBJ) 16.lib $(DOSLIBEXMMOBJ) - wcl $(FLAGS) miditest.$(OBJ) 16.lib $(DOSLIBEXMMOBJ) +miditest.exe: miditest.$(OBJ) 16.lib $(DOSLIBEXMMOBJ) midi.$(OBJ) + wcl $(FLAGS) miditest.$(OBJ) 16.lib $(DOSLIBEXMMOBJ) midi.$(OBJ) tsthimem.exe: tsthimem.$(OBJ) 16.lib $(DOSLIBEXMMOBJ) wcl $(FLAGS) tsthimem.$(OBJ) 16.lib $(DOSLIBEXMMOBJ) diff --git a/scroll.exe b/scroll.exe index 456b5b81..d360c998 100644 Binary files a/scroll.exe and b/scroll.exe differ diff --git a/src/lib/16_in.h b/src/lib/16_in.h index be4d81e4..eecfae59 100644 --- a/src/lib/16_in.h +++ b/src/lib/16_in.h @@ -214,8 +214,8 @@ typedef struct 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 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 + int sheetsetx; //NOT USED YET! player sprite sheet set on the image x + int sheetsety; //NOT USED YET! player sprite sheet set on the image y word d; //direction!! wwww word q; //loop variable word speed; //player speed! diff --git a/src/lib/scroll16.c b/src/lib/scroll16.c index eb19f8f5..c72532f0 100644 --- a/src/lib/scroll16.c +++ b/src/lib/scroll16.c @@ -397,12 +397,27 @@ sword chkmap(map_t *map, word q) { // bitmap_t bp; static byte x[(MAPW*MAPH)+1] = { 1, 2, 3, 4, 0, 3, 3, 3, 3, 3, 3, 3, 3, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 6, 7, 8, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 9, 10, 11, 12, 4, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 13, 14, 15, 16, 0, 1, 1, 1, 5, 8, 1, 11, 11, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 4, 0, 0, 0, 0, 0, 8, 8, 1, 11, 11, 3, 1, 1, 1, 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*1, 2, 3, 4, 0, 3, 3, 3, 3, 3, 3, 3, 3, 4, 1, 1, 1, 1, 1, 1, \ +5, 6, 7, 8, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \ +9, 10, 11, 12, 4, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \ +13, 14, 15, 16, 0, 1, 1, 1, 5, 8, 1, 11, 11, 1, 1, 1, 1, 1, 1, 1, \ +0, 0, 4, 0, 0, 0, 0, 0, 8, 8, 1, 11, 11, 3, 1, 1, 1, 1, 1, 1, \ +1, 1, 1, 1, 0, 0, 0, 0, 8, 8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \ +1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \ +1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, \ +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \ +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \ +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, \ +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \ +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, \ +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \ +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 1, 2, 3, 4 };*/ //check for failed to load map if((map->width == map->height == 0) || (q>0)) { //initiate a null map! - map->width=MAPW; - map->height=MAPH; + map->width=MAPW;///2; + map->height=MAPH;///2; // map->data = malloc(((map->width*map->height)+1)*sizeof(byte)); map->data = &x; map->tiles = malloc(sizeof(tiles_t)); @@ -588,7 +603,7 @@ void shinku(page_t *page, global_game_variables_t *gv) { pee = malloc(sizeof(double)); sprintf(pee, "%f", ((*gv->clock) /18.2)); - modexprint(page, x, y, type, col, bgcol, pee); +//++++ modexprint(page, x, y, type, col, bgcol, pee); //sprintf(pee, "%f", /*gv->tiku/*/time_in_seconds(gv)); //modexprint(page, x, y+8, type, col, bgcol, pee); } @@ -598,7 +613,11 @@ void animatePlayer(map_view_t *pip, player_t *player, word playnum, sword scroll { sword x = player[playnum].x; sword y = player[playnum].y; - sword dire=32; //direction +#ifdef SPRITE + word dire=32; //direction +#else + word dire=8; //direction +#endif sword qq; //scroll offset word ls = player[playnum].persist_aniframe; @@ -631,11 +650,19 @@ void animatePlayer(map_view_t *pip, player_t *player, word playnum, sword scroll x-=qq; break; } + #ifdef SPRITE +#ifdef BMPTYPE +#define FRAME1 oldDrawBmp(VGA, x, y, &player[playnum].data, 1); +#define FRAME2 oldDrawBmp(VGA, x, y, &player[playnum].data, 1); +#define FRAME3 oldDrawBmp(VGA, x, y, &player[playnum].data, 1); +#define FRAME4 oldDrawBmp(VGA, x, y, &player[playnum].data, 1); +#else #define FRAME1 modexDrawSpriteRegion(pip[1].page, x, y, 48, dire, 24, 32, &player[playnum].data); #define FRAME2 modexDrawSpriteRegion(pip[1].page, x, y, 24, dire, 24, 32, &player[playnum].data) #define FRAME3 modexDrawSpriteRegion(pip[1].page, x, y, 0, dire, 24, 32, &player[playnum].data); #define FRAME4 modexDrawSpriteRegion(pip[1].page, x, y, 24, dire, 24, 32, &player[playnum].data); +#endif #else #define FRAME1 modexClearRegion(pip[1].page, x, y, 24, 32, 2+dire); #define FRAME2 modexClearRegion(pip[1].page, x, y, 24, 32, 1+dire); diff --git a/src/lib/scroll16.h b/src/lib/scroll16.h index 078b27a3..82cd0ade 100644 --- a/src/lib/scroll16.h +++ b/src/lib/scroll16.h @@ -32,6 +32,7 @@ #include "src/lib/timer.h" //#define SPRITE +//#define BMPTYPE typedef struct { map_t *map; diff --git a/src/scroll.c b/src/scroll.c index b8065566..ab6bedd4 100644 --- a/src/scroll.c +++ b/src/scroll.c @@ -62,20 +62,17 @@ void main() // atexit(qclean()); /* create the map */ - //printf("Total used @ before map load: %zu\n", oldfreemem-GetFreeSize()); - printf("Total free @ before map load: %zu\n", GetFreeSize()); - printf("Total near free @ before map load: %zu\n", GetNearFreeSize()); - printf("Total far free @ before map load: %zu\n", GetFarFreeSize()); + //0000printf("Total used @ before map load: %zu\n", oldfreemem-GetFreeSize()); +//0000 printf("Total free @ before map load: %zu\n", GetFreeSize()); +//0000 printf("Total near free @ before map load: %zu\n", GetNearFreeSize()); +//0000 printf("Total far free @ before map load: %zu\n", GetFarFreeSize()); // getch(); //0000 fprintf(stderr, "testing~\n"); -// loadmap("data/test.map", &map); +//++++ loadmap("data/test.map", &map); map.width=0; map.height=0; chkmap(&map, 1); //0000 fprintf(stderr, "yay map loaded~~\n"); -//---- map = allocMap(map.width,map.height); //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()); -//---- initMap(&map); mv[0].map = ↦ mv[1].map = ↦ mv[2].map = ↦ @@ -85,7 +82,7 @@ void main() mappalptr = map.tiles->data->palette; /* data */ //0000 printf("Total used @ before image loading: %zu\n", oldfreemem-GetFreeSize()); - player[0].data = bitmapLoadPcx("data/ptmp.pcx"); // load sprite +//++++ player[0].data = bitmapLoadPcx("data/ptmp.pcx"); // load sprite //npctmp = bitmapLoadPcx("ptmp1.pcx"); // load sprite /* create the planar buffer */ @@ -188,7 +185,7 @@ void main() while(!IN_KeyDown(sc_Escape) && player[0].hp>0) { sprintf(mesg, "%lu", gvar.tiku); - modexprint(mv[1].page, 16, 16, 1, 15, 0, mesg); +//++++ modexprint(mv[1].page, 16, 16, 1, 15, 0, mesg); shinku(mv[1].page, &gvar); IN_ReadControl(0,&player); //top left corner & bottem right corner of map veiw be set as map edge trigger since maps are actually square @@ -367,7 +364,7 @@ void main() #endif VGAmodeX(0); IN_Shutdown(); - printf("Project 16 scroll.exe\n"); + printf("Project 16 scroll.exe. This is just a test file!\n"); printf("tx: %d\n", bg->tx); printf("ty: %d\n", bg->ty); printf("player[0].x: %d", player[0].x); printf(" player[0].y: %d\n", player[0].y); @@ -377,25 +374,19 @@ void main() printf("player[0].triggx: %d", player[0].triggerx); printf(" player[0].triggy: %d\n", player[0].triggery); printf("player[0].hp: %d", (player[0].hp)); printf(" player[0].q: %d", player[0].q); printf(" player[0].info.dir: %d", player[0].info.dir); printf(" player[0].d: %d\n", player[0].d); printf("tile data value at player trigger position: %d\n", bg->map->data[(player[0].triggerx-1)+(map.width*(player[0].triggery-1))]); - printf("palette offset: %d\n", paloffset/3); +// printf("palette offset: %d\n", paloffset/3); //++++ printf("Total used: %zu\n", oldfreemem-GetFreeSize()); //++++ printf("Total free: %zu\n", GetFreeSize()); - 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("Screen: %dx", screen.width); printf("%d\n", screen.height); - printf("Screen2: %dx", screen2.width); printf("%d\n", screen2.height); - printf("map: %dx%d\n", map.width, map.height); - printf("\n"); - printf("player[0].persist_aniframe: %d\n", player[0].persist_aniframe); +//not used now printf("temporary player sprite 0: http://www.pixiv.net/member_illust.php?mode=medium&illust_id=45556867\n"); +//not used now printf("temporary player sprite 1: http://www.pixiv.net/member_illust.php?mode=medium&illust_id=44606385\n"); +// printf("Screen: %dx", screen.width); printf("%d\n", screen.height); +// printf("Screen2: %dx", screen2.width); printf("%d\n", screen2.height); +// printf("map: %dx%d\n", map.width, map.height); +// printf("\n"); // printf("player[0].info.x: %d", player[0].info.xaxis); printf(" player[0].info.y: %d\n", player[0].info.yaxis); // printf("player[0].info.tx: %d", player[0].info.x); printf(" player[0].info.ty: %d\n", player[0].info.y); //printf("map.width=%d map.height=%d map.data[0]=%d\n", bg->map->width, bg->map->height, bg->map->data[0]); - //xmsfree(&map); - //xmsfree(bg); - //xmsfree(spri); - //xmsfree(mask); - //xmsreport(); - //emmclose(emmhandle); + switch(detectcpu()) { case 0: cpus = "8086/8088 or 186/88"; break; diff --git a/tsthimem.exe b/tsthimem.exe index 282bd13e..8a00b50c 100644 Binary files a/tsthimem.exe and b/tsthimem.exe differ