From: sparky4 Date: Fri, 31 Jul 2015 03:44:56 +0000 (-0500) Subject: PEE!!! X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=84fa53074a01907f4d3908255df5886d8361cd24;p=16.git PEE!!! modified: 16.exe modified: inputest.exe modified: scroll.exe modified: sountest.exe modified: src/lib/16_in.c modified: src/lib/16_in.h modified: src/lib/scroll16.c modified: src/scroll.c --- diff --git a/16.exe b/16.exe index 3cdce8ac..14810f35 100644 Binary files a/16.exe and b/16.exe differ diff --git a/inputest.exe b/inputest.exe index 81d917fd..c9ce4abe 100644 Binary files a/inputest.exe and b/inputest.exe differ diff --git a/scroll.exe b/scroll.exe index 53216d30..c35387ab 100644 Binary files a/scroll.exe and b/scroll.exe differ diff --git a/sountest.exe b/sountest.exe index 4577d0d3..40741b6f 100644 Binary files a/sountest.exe and b/sountest.exe differ diff --git a/src/lib/16_in.c b/src/lib/16_in.c index b2f31362..fd812ff0 100644 --- a/src/lib/16_in.c +++ b/src/lib/16_in.c @@ -851,16 +851,15 @@ register KeyboardDef *def; mx = motion_Right,my = motion_Down;*/ if(!inpu.Keyboard[def->left] && !inpu.Keyboard[def->right]){ - - if((inpu.Keyboard[def->up] && !inpu.Keyboard[def->down] && player[playnum].info.dir == 2))// || player[playnum].info.dir == 0) + if((inpu.Keyboard[def->up] && !inpu.Keyboard[def->down] && player[playnum].info.dir == 2) || player[playnum].info.dir == 0) my = motion_Up; - if((inpu.Keyboard[def->down] && !inpu.Keyboard[def->up] && player[playnum].info.dir == 2))// || player[playnum].info.dir == 4) + if((inpu.Keyboard[def->down] && !inpu.Keyboard[def->up] && player[playnum].info.dir == 2) || player[playnum].info.dir == 4) my = motion_Down; }else if(!inpu.Keyboard[def->up] && !inpu.Keyboard[def->down]){ - if((inpu.Keyboard[def->left] && !inpu.Keyboard[def->right] && player[playnum].info.dir == 2))// || player[playnum].info.dir == 1) + if((inpu.Keyboard[def->left] && !inpu.Keyboard[def->right] && player[playnum].info.dir == 2) || player[playnum].info.dir == 1) mx = motion_Left; - if((inpu.Keyboard[def->right] && !inpu.Keyboard[def->left] && player[playnum].info.dir == 2))// || player[playnum].info.dir == 3) + if((inpu.Keyboard[def->right] && !inpu.Keyboard[def->left] && player[playnum].info.dir == 2) || player[playnum].info.dir == 3) mx = motion_Right; } if (inpu.Keyboard[def->button0]) diff --git a/src/lib/16_in.h b/src/lib/16_in.h index 9b3e9db9..e092c1d4 100644 --- a/src/lib/16_in.h +++ b/src/lib/16_in.h @@ -220,7 +220,7 @@ typedef struct word speed; //player speed! bitmap_t data; //supposively the sprite sheet data sword hp; //hitpoints of the player - word persist_aniframe; /* gonna be increased to 1 before being used, so 0 is ok for default */ + sword persist_aniframe; /* gonna be increased to 1 before being used, so 0 is ok for default */ CursorInfo info; ControlType Controls; } player_t; diff --git a/src/lib/scroll16.c b/src/lib/scroll16.c index fa0061de..c5fe5feb 100644 --- a/src/lib/scroll16.c +++ b/src/lib/scroll16.c @@ -34,6 +34,7 @@ void walk(map_view_t *pip, player_t *player, word pn) if(pip[0].tx >= 0 && pip[0].tx+20 < pip[0].map->width && player[pn].tx == pip[0].tx + 10 && !(pip[0].map->data[(player[pn].tx)+(pip[0].map->width*(player[pn].ty-1))] == 0))//!(player[pn].tx+1 == TRIGGX && player[pn].ty == TRIGGY)) //collision detection! { + modexprint(pip[1].page, 320, (player[pn].q*8), 1, player[pn].q, 0, (byte *)player[pn].q); if(player[pn].q<=(TILEWH/(player[pn].speed))) { INC_PER_FRAME; @@ -71,6 +72,7 @@ void walk(map_view_t *pip, player_t *player, word pn) if(pip[0].tx > 0 && pip[0].tx+20 <= pip[0].map->width && player[pn].tx == pip[0].tx + 10 && !(pip[0].map->data[(player[pn].tx-2)+(pip[0].map->width*(player[pn].ty-1))] == 0))//!(player[pn].tx-1 == TRIGGX && player[pn].ty == TRIGGY)) //collision detection! { + modexprint(pip[1].page, 320, (player[pn].q*8), 1, player[pn].q, 0, (byte *)player[pn].q); if(player[pn].q<=(TILEWH/(player[pn].speed))) { INC_PER_FRAME; @@ -108,6 +110,7 @@ void walk(map_view_t *pip, player_t *player, word pn) if(pip[0].ty >= 0 && pip[0].ty+15 < pip[0].map->height && player[pn].ty == pip[0].ty + 8 && !(pip[0].map->data[(player[pn].tx-1)+(pip[0].map->width*(player[pn].ty))] == 0))//!(player[pn].tx == TRIGGX && player[pn].ty+1 == TRIGGY)) //collision detection! { + modexprint(pip[1].page, 320, (player[pn].q*8), 1, player[pn].q, 0, (byte *)player[pn].q); if(player[pn].q<=(TILEWH/(player[pn].speed))) { INC_PER_FRAME; @@ -145,6 +148,7 @@ void walk(map_view_t *pip, player_t *player, word pn) if(pip[0].ty > 0 && pip[0].ty+15 <= pip[0].map->height && player[pn].ty == pip[0].ty + 8 && !(pip[0].map->data[(player[pn].tx-1)+(pip[0].map->width*(player[pn].ty-2))] == 0))//!(player[pn].tx == TRIGGX && player[pn].ty-1 == TRIGGY)) //collision detection! { + modexprint(pip[1].page, 320, (player[pn].q*8), 1, player[pn].q, 0, (byte *)player[pn].q); if(player[pn].q<=(TILEWH/(player[pn].speed))) { INC_PER_FRAME; @@ -434,8 +438,8 @@ mapDrawTile(tiles_t *t, word i, page_t *page, word x, word y) { word rx; word ry; - word textx; - word texty; + word textx=0; + word texty=0; //if(i==0) i=2; if(i==0) { @@ -453,12 +457,13 @@ mapDrawTile(tiles_t *t, word i, page_t *page, word x, word y) modexDrawBmpRegion(page, x, y, rx, ry, t->tileWidth, t->tileHeight, (t->data)); break; case 1: + modexClearRegion(page, x, y, t->tileWidth, t->tileHeight, ((word)(t->debug_data))); //currently the over scan color! //modexprintbig(page, x, y, 1, 15, 0, (t->debug_data)); /*for(texty=0; texty<2; texty++) { for(textx=0; textx<2; textx++) {*/ - modexprint(page, x+(textx*8), y+(texty*8), 1, (word)(t->debug_data), 0, (t->debug_data)); +// modexprint(page, x+(textx*8), y+(texty*8), 1, (word)(t->debug_data), 0, (t->debug_data)); /* } }*/ break; diff --git a/src/scroll.c b/src/scroll.c index 6e6dc032..9afbbcd8 100644 --- a/src/scroll.c +++ b/src/scroll.c @@ -24,6 +24,8 @@ #include "src/lib/mapread.h" #include "src/lib/wcpu/wcpu.h" +//#define FADE + //word far *clock= (word far*) 0x046C; /* 18.2hz clock */ void main() @@ -42,7 +44,9 @@ void main() map_view_t mv[3]; map_view_t *bg, *spri, *mask;//, *tmp; //map_view_db_t pgid[4]; +#ifdef FADE byte *dpal, *gpal; +#endif byte *ptr; byte *mappalptr; byte *mesg=malloc(sizeof(dword)); @@ -94,13 +98,17 @@ void main() IN_Default(0,&player,ctrl_Joystick); /* save the palette */ +#ifdef FADE dpal = modexNewPal(); modexPalSave(dpal); modexFadeOff(4, dpal); +#endif textInit(); VGAmodeX(1); +#ifdef FADE modexPalBlack(); //reset the palette~ +#endif // printf("Total used @ before palette initiation: %zu\n", oldfreemem-GetFreeSize()); //++++ player[0].data.offset=(paloffset/3); //++++ modexPalUpdate(&player[0].data, &paloffset, 0, 0); @@ -111,10 +119,12 @@ void main() // printf("\n====\n"); // printf("0 paloffset= %d\n", paloffset/3); // printf("====\n\n"); +#ifdef FADE gpal = modexNewPal(); modexPalSave(gpal); modexSavePalFile("data/g.pal", gpal); modexPalBlack(); //so player will not see loadings~ +#endif /* setup camera and screen~ */ screen = modexDefaultPage(); @@ -163,12 +173,13 @@ void main() modexShowPage(spri->page); // printf("Total used @ before loop: %zu\n", oldfreemem-GetFreeSize()); modexClearRegion(mv[2].page, 0, 0, mv[2].page->width, mv[2].page->height, 1); -//++++ modexFadeOn(4, gpal); - modexFadeOn(4, dpal); +#ifdef FADE + modexFadeOn(4, gpal); +#endif while(!IN_KeyDown(sc_Escape) && player[0].hp>0) { sprintf(mesg, "%lu", tiku); - modexprint(mv[1].page, 0, 0, 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 @@ -310,6 +321,7 @@ void main() if(IN_KeyDown(3)){ modexShowPage(spri->page); panpagenum=1; } if(IN_KeyDown(4)){ modexShowPage(mask->page); panpagenum=2; } if(IN_KeyDown(25)){ pdump(bg->page); pdump(spri->page); } //p +#ifdef FADE if(IN_KeyDown(24)){ modexPalUpdate0(gpal); paloffset=0; pdump(bg->page); pdump(spri->page); } if(IN_KeyDown(22)){ paloffset=0; modexPalBlack(); modexPalUpdate(&player[0].data, &paloffset, 0, 0); @@ -317,6 +329,7 @@ void main() modexPalUpdate(map.tiles->data, &paloffset, 0, 0); printf("2paloffset = %d\n", paloffset/3); pdump(bg->page); pdump(spri->page); } +#endif //pan switch //if(IN_KeyDown(88)){if(!panswitch) panswitch++; else panswitch--; } //f12 //TSR @@ -338,9 +351,11 @@ void main() /* fade back to text mode */ /* but 1st lets save the game palette~ */ +#ifdef FADE modexPalSave(gpal); modexSavePalFile("data/g.pal", gpal); modexFadeOff(4, gpal); +#endif VGAmodeX(0); IN_Shutdown(); printf("Project 16 scroll.exe\n"); @@ -377,5 +392,7 @@ void main() default: cpus = "internal error"; break; } printf("detected CPU type: %s\n", cpus); +#ifdef FADE modexFadeOn(4, dpal); +#endif }