mx = motion_Right,my = motion_Down;*/\r
\r
if(!inpu.Keyboard[def->left] && !inpu.Keyboard[def->right]){
- \r
- if((inpu.Keyboard[def->up] && !inpu.Keyboard[def->down] && player[playnum].info.dir == 2))// || player[playnum].info.dir == 0)\r
+ if((inpu.Keyboard[def->up] && !inpu.Keyboard[def->down] && player[playnum].info.dir == 2) || player[playnum].info.dir == 0)\r
my = motion_Up;\r
- if((inpu.Keyboard[def->down] && !inpu.Keyboard[def->up] && player[playnum].info.dir == 2))// || player[playnum].info.dir == 4)\r
+ if((inpu.Keyboard[def->down] && !inpu.Keyboard[def->up] && player[playnum].info.dir == 2) || player[playnum].info.dir == 4)\r
my = motion_Down;\r
\r
}else if(!inpu.Keyboard[def->up] && !inpu.Keyboard[def->down]){\r
- if((inpu.Keyboard[def->left] && !inpu.Keyboard[def->right] && player[playnum].info.dir == 2))// || player[playnum].info.dir == 1)\r
+ if((inpu.Keyboard[def->left] && !inpu.Keyboard[def->right] && player[playnum].info.dir == 2) || player[playnum].info.dir == 1)\r
mx = motion_Left;\r
- if((inpu.Keyboard[def->right] && !inpu.Keyboard[def->left] && player[playnum].info.dir == 2))// || player[playnum].info.dir == 3)\r
+ if((inpu.Keyboard[def->right] && !inpu.Keyboard[def->left] && player[playnum].info.dir == 2) || player[playnum].info.dir == 3)\r
mx = motion_Right;\r
}\r
if (inpu.Keyboard[def->button0])\r
word speed; //player speed!\r
bitmap_t data; //supposively the sprite sheet data\r
sword hp; //hitpoints of the player
- word persist_aniframe; /* gonna be increased to 1 before being used, so 0 is ok for default */\r
+ sword persist_aniframe; /* gonna be increased to 1 before being used, so 0 is ok for default */\r
CursorInfo info;\r
ControlType Controls;
} player_t;\r
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;
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;
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;
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;
{
word rx;
word ry;
- word textx;
- word texty;
+ word textx=0;
+ word texty=0;
//if(i==0) i=2;
if(i==0)
{
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;
#include "src/lib/mapread.h"
#include "src/lib/wcpu/wcpu.h"
+//#define FADE
+
//word far *clock= (word far*) 0x046C; /* 18.2hz clock */
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));
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);
// 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();
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
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);
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
/* 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");
default: cpus = "internal error"; break;
}
printf("detected CPU type: %s\n", cpus);
+#ifdef FADE
modexFadeOn(4, dpal);
+#endif
}