\r
boolean coll_check(int x, int y, int dx, int dy, map_view_t *map_v){\r
// Assume everything crosses at most 1 tile at once\r
- return dx && crossable_tile(x + dx, map_v) || dy && crossable_tile(y + dy, map_v);\r
+ return dx && 1;//crossable_tile(x + dx, map_v) || dy && crossable_tile(y + dy, map_v);\r
}\r
\r
-boolean walk(entity_t *ent, map_view_t *map_v)\r
-{\r
+boolean walk(entity_t *ent, map_view_t *map_v){\r
+ return 1;\r
int dx = 1;\r
int dy = 1;\r
- switch(ent->d)\r
- {\r
+ switch(ent->d){\r
case STOP:\r
- return;\r
+ return 0;\r
case LEFT:\r
dx = -dx;\r
case RIGHT:\r
// Start animation\r
// Mark next tile as occupied\r
// Mark this tile as vacant\r
- return true;\r
+ return 1;\r
}\r
- return false;\r
+ return 0;\r
}\r
\r
void player_walk(player_t *player, map_view_t *map_v){\r
+ int dx, dy;\r
if(walk(player->ent, map_v) && boundary_check(map_v->tx, map_v->ty, dx, dy, map_v->map->width - 2*map_v->page->tilesw, map_v->map->height - 2*map_v->page->tilesh)){\r
mapScroll(map_v, player);\r
// (Un)load stuff?\r
}\r
}\r
\r
+void mapGoTo(map_view_t *mv, int tx, int ty)\r
+{\r
+ return;\r
+}\r
\r
void near mapScroll(map_view_t *mv, player_t *player){\r
word x, y; /* coordinate for drawing */\r
\r
sword chkmap(map_t *map, word q)\r
{\r
+ /*\r
// bitmap_t bp;\r
static byte x[(MAPW*MAPH)+1] =\r
{ 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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 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, \\r
-1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \\r
-1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 1, 2, 3, 4 };*/\r
//check for failed to load map\r
if((map->width == map->height == 0) && (q>0))\r
{\r
map->tiles->cols = 1;\r
map->tiles->debug_text = true;\r
}\r
- else map->tiles->debug_text = false;\r
+ else map->tiles->debug_text = false;*/\r
return 0;\r
}\r
\r
//TODO: player position here\r
-void mapGoTo(map_view_t *mv, int tx, int ty)\r
-{\r
- int px, py;\r
- unsigned int i;\r
-\r
- /* set up the coordinates */\r
- mv->tx = tx;\r
- mv->ty = ty;\r
- mv->page->delta = 0;\r
-\r
- /* set up the thresholds */\r
- mv->dxThresh = mv->map->tiles[0]->tileWidth * 2;\r
- mv->dyThresh = mv->map->tiles[0]->tileHeight * 2;\r
-\r
- /* draw the tiles */\r
- modexClearRegion(mv->page, 0, 0, mv->page->width, mv->page->height, 0);\r
- py=0;\r
- i=mv->ty * mv->map->width + mv->tx;\r
-/* for(ty=mv[0].ty-1; py < mv[0].page->sh+mv->dyThresh && ty < mv[0].map->height; ty++, py+=mv[0].map->tiles->tileHeight) {\r
- mapDrawWRow(&mv[0], tx-1, ty, py);\r
- i+=mv->map->width - tx;\r
- }\r
- if(!pageploop) modexCopyPageRegion(mv[1].page, mv[0].page, 0, 0, 0, 0, mv[0].page->width, mv[0].page->height);\r
-// {\r
-// unsigned int k,j,o;\r
-// // fill screen with a distinctive pattern \r
-// for (k=0;k < vga_state.vga_width;k++) {\r
-// o = k >> 2;\r
-// vga_write_sequencer(0x02/*map mask*//*,1 << (k&3));\r
-// for (j=0;j < (mv[0].page->height)+(mv[1].page->height)+(mv[2].page->height)+(mv[3].page->height);j++,o += vga_state.vga_stride)\r
-// vga_state.vga_graphics_ram[o] = (k^j)&15; // VRL samples put all colors in first 15!\r
-// }\r
-// }\r
- modexCopyPageRegion(mv[3].page, mv[0].page, 0, 0, 0, 0, 24, 32);*/\r
-}\r
\r
void near\r
mapDrawTile(tiles_t *t, word i, page_t *page, word x, word y)\r
gv->kurokku.frames_per_second=60;\r
break;\r
}\r
+ /*\r
if(pageflipflop){\r
- if(gv->video.r){\r
- if(!pageploop) modexCopyPageRegion(&(gv->video.page[(gv->video.p)]), &(gv->video.page[(!gv->video.p)]), 0, 0, 0, 0, gv->video.page[gv->video.p].width, gv->video.page[!gv->video.p].height);\r
- modexShowPage(&(gv->video.page[gv->video.p]));\r
- if(!pageploop) gv->video.p=!gv->video.p;\r
- gv->video.r=!gv->video.r;\r
- }\r
- }\r
+ if(gv->video.r){\r
+ if(!pageploop) modexCopyPageRegion(&(gv->video.page[(gv->video.p)]), &(gv->video.page[(!gv->video.p)]), 0, 0, 0, 0, gv->video.page[gv->video.p].width, gv->video.page[!gv->video.p].height);\r
+ modexShowPage(&(gv->video.page[gv->video.p]));\r
+ if(!pageploop) gv->video.p=!gv->video.p;\r
+ gv->video.r=!gv->video.r;\r
+ }\r
+ }*/\r
}\r
\r
void near animatePlayer(map_view_t *pip, player_t *player, sword scrollswitch)\r
break;\r
}\r
//x-=4;\r
- y-=pip->map->tiles->tileHeight;\r
+ //y-=pip->map->tiles->tileHeight;\r
switch (player->d)\r
{\r
case 0:\r
*\r
*/\r
\r
-#include "src/lib/scroll16.h"\r
+#include "src/lib/zcroll16.h"\r
#include "src/lib/16_timer.h"\r
#include "src/lib/wcpu/wcpu.h"\r
\r
-//word far *clock= (word far*) 0x046C; /* 18.2hz clock */\r
-//bitmap_t *p;\r
global_game_variables_t gvar;\r
static map_t map;\r
-player_t player[MaxPlayers];\r
-map_view_t mv[4];\r
-//word pn=0; //i forgot ww\r
+player_t *player;\r
+map_view_t *mv;\r
float t;\r
sword bakapee;\r
pan_t pan;\r
//debugswitches\r
boolean panswitch=0,baka=0;\r
//extern boolean pageflipflop=1;\r
- unsigned int i;\r
- const char *cpus;\r
- //static int persist_aniframe = 0; /* gonna be increased to 1 before being used, so 0 is ok for default */\r
+unsigned int i;\r
+const char *cpus;\r
+//static int persist_aniframe = 0; /* gonna be increased to 1 before being used, so 0 is ok for default */\r
\r
- //map_view_db_t pgid[4];\r
- word pg;\r
+//map_view_db_t pgid[4];\r
+word pg;\r
//#ifdef FADE\r
- static word paloffset=0;\r
- byte *dpal;\r
+static word paloffset=0;\r
+byte *dpal;\r
//#endif\r
- byte *gpal;\r
- byte *ptr;\r
- byte *mappalptr;\r
+byte *gpal;\r
+byte *ptr;\r
+memptr pal;\r
\r
void main(int argc, char *argv[])\r
{\r
byte *mesg=malloc(sizeof(dword));\r
+ int i;\r
\r
if(argv[1]) bakapee = atoi(argv[1]);\r
else bakapee = 1;\r
\r
Startup16(&gvar);\r
\r
- pan.pn=1;\r
+ pan.pn=0;\r
+ player = malloc(sizeof(player_t));\r
+ player->ent = malloc(sizeof(entity_t));\r
+ player->ent->spri = malloc(sizeof(struct sprite));\r
+ player->ent->spri->spritesheet = malloc(sizeof(struct vrs_container));\r
\r
- /* create the map */\r
+ // create the map \r
fprintf(stderr, "testing map load~ ");\r
loadmap("data/test.map", &map);\r
chkmap(&map, 0);\r
printf("chkmap ok ");\r
fprintf(stderr, "yay map loaded~~\n");\r
\r
- /* draw the tiles */\r
- ptr = map.data;\r
- //mappalptr = map.tiles->btdata->palette;\r
+ // data \r
+ read_vrs(&gvar, "data/spri/chikyuu.vrs", player->ent->spri->spritesheet);\r
\r
- /* data */\r
- if(CA_LoadFile("data/spri/chikyuu.vrs", &(player[0].gr), &gvar)) baka=1; else baka=0;\r
+ // input! \r
+ IN_Default(0, player,ctrl_Joystick);\r
\r
- /* create the planar buffer */\r
-////++++ (player[0].data) = *planar_buf_from_bitmap(&p);\r
- /*++++printf("load pee!! ");\r
- pp = planar_buf_from_bitmap(&p);\r
- printf("done!\n");*/\r
-\r
- /* input! */\r
- IN_Default(0,&player,ctrl_Joystick);\r
- //IN_Default(1,&player,ctrl_Joystick);\r
-\r
- /* save the palette */\r
+ // save the palette \r
dpal = modexNewPal();\r
modexPalSave(dpal);\r
modexFadeOff(4, dpal);\r
\r
textInit();\r
VGAmodeX(bakapee, 1, &gvar);\r
-// printf("%dx%d\n", gvar.video.page[0].sw, gvar.video.page[0].sh);\r
modexPalBlack(); //reset the palette~\r
\r
-// printf("Total used @ before palette initiation: %zu\n", oldfreemem-GetFreeSize());\r
-//++++ player[0].data.offset=(paloffset/3);\r
-//++++ modexPalUpdate1(&player[0].data, &paloffset, 0, 0);\r
- modexPalUpdate1(player[0].data->palette);\r
-//++++0000 modexPalUpdate1(map.tiles->btdata->palette);\r
- //printf(" %d\n", sizeof(ptmp->data));\r
- //printf("1: %d\n", paloffset);\r
-//++++ map.tiles->data->offset=(paloffset/3);\r
- //XTmodexPalUpdate(map.tiles->data, &paloffset, 0, 0);\r
-// printf("\n====\n");\r
-// printf("0 paloffset= %d\n", paloffset/3);\r
-// printf("====\n\n");\r
+ CA_LoadFile("data/spri/chikyuu.pal", &pal, &gvar);\r
+ modexPalUpdate1(pal);\r
\r
gpal = modexNewPal();\r
modexPalSave(gpal);\r
modexSavePalFile("data/g.pal", gpal);\r
modexPalBlack(); //so player will not see loadings~\r
-\r
- /* setup camera and screen~ */\r
+ // setup camera and screen~\r
modexHiganbanaPageSetup(&gvar.video);\r
- for(i=0;i<gvar.video.num_of_pages;i++)\r
- {\r
- mv[i].page = &gvar.video.page[i];\r
- mv[i].map = ↦\r
- mv[i].video = &gvar.video;\r
- mv[i].pan = &pan;\r
- }\r
+ mv->page = &gvar.video.page[0];\r
+ mv->map = ↦\r
+ mv->video = &gvar.video;\r
+ mv->pan = &pan;\r
+ player->ent->spri->x = player->ent->spri->y = 20;\r
\r
- /* set up paging */\r
+ // set up paging\r
//TODO: LOAD map data and position the map in the middle of the screen if smaller then screen\r
mapGoTo(mv, 0, 0);\r
- //_fmemcpy(mv[1].page->data, mv[0].page->data, mv[0].page->pagesize);\r
+ //_fmemcpy(mv[1].page->data, mv->page->data, mv->page->pagesize);\r
\r
//TODO: put player in starting position of spot\r
//default player position on the viewable map\r
- player[0].tx = mv[0].tx + mv[0].page->tilemidposscreenx;\r
- player[0].ty = mv[0].ty + mv[0].page->tilemidposscreeny;\r
- IN_initplayer(&player, 0);\r
+ player->tx = mv->tx + mv->page->tilemidposscreenx;\r
+ player->ty = mv->ty + mv->page->tilemidposscreeny;\r
+ IN_initplayer(player);\r
//IN_initplayer(&player, 1);\r
\r
#ifndef SPRITE\r
- modexClearRegion(mv[0].page, player[0].x, player[0].y-TILEWH, 16, 32, 15);\r
- //modexClearRegion(mv[1].page, player[0].x, player[0].y-TILEWH, 16, 32, 15);\r
+ modexClearRegion(mv->page, player->x, player->y-TILEWH, 16, 32, 15);\r
+ //modexClearRegion(mv[1].page, player->x, player->y-TILEWH, 16, 32, 15);\r
#else\r
- //PBUFSFUN(mv[1].page, player[0].x, player[0].y-TILEWH, 16, 64, 24, 32, PLAYERBMPDATA);\r
- PBUFSFUN(mv[0].page, player[0].x, player[0].y-TILEWH, 16, 64, 16, 32, player[0].data);\r
+ //PBUFSFUN(mv[1].page, player->x, player->y-TILEWH, 16, 64, 24, 32, PLAYERBMPDATA);\r
+// PBUFSFUN(mv->page, player->x, player->y-TILEWH, 16, 64, 16, 32, player->data);\r
+ i = set_anim_by_id(player->ent->spri, 11);\r
+ print_anim_ids(player->ent->spri);\r
+ if (i == -1)\r
+ {\r
+ modexFadeOff(4, gpal);\r
+ VGAmodeX(0, 1, &gvar);\r
+ Shutdown16(&gvar);\r
+ printf("Wrong");\r
+ modexFadeOn(4, dpal);\r
+return;\r
+ }\r
+return;\r
+ //animate_spri(&(player->ent->spri));\r
#endif\r
\r
- if(!pageflipflop) modexShowPage(mv[1].page);\r
- else modexShowPage(mv[0].page);//!(gvar.video.p)\r
- shinku_fps_indicator_page = 0; // we're on page 1 now, shinku(). follow along please or it will not be visible.\r
+ modexShowPage(mv->page);//!(gvar.video.p)\r
+ shinku_fps_indicator_page = 0; // we're on page 1 now, shinku(). follow along please or it will not be visible.\r
\r
- /* buffer pages */\r
+ // buffer pages \r
// modexClearRegion(mv[2].page, 0, 0, mv[2].page->width, mv[2].page->height, 47);\r
// modexClearRegion(mv[3].page, 0, 0, mv[3].page->width, mv[3].page->height, 45);\r
// {\r
// unsigned int k,j,o;\r
-// /* fill screen with a distinctive pattern */\r
+// // fill screen with a distinctive pattern \r
// for (k=0;k < vga_state.vga_width;k++) {\r
// o = k >> 2;\r
// vga_write_sequencer(0x02/*map mask*/,1 << (k&3));\r
// vga_state.vga_graphics_ram[o] = (k^j)&15; // VRL samples put all colors in first 15!\r
// }\r
// }\r
- modexClearRegion(mv[3].page, 0, 128, 24, 36, 15);\r
\r
- modexFadeOn(4, gpal);\r
- while(!IN_KeyDown(sc_Escape) && player[0].hp>0)\r
+// modexFadeOn(4, gpal);*/\r
+ while(!IN_KeyDown(sc_Escape) && player->hp>0)\r
{\r
shinku(&gvar);\r
- //top left corner & bottem right corner of map veiw be set as map edge trigger since maps are actually square\r
- //to stop scrolling and have the player position data move to the edge of the screen with respect to the direction\r
- //when player[0].tx or player[0].ty == 0 or player[0].tx == 20 or player[0].ty == 15 then stop because that is edge of map and you do not want to walk of the map\r
+ //top left corner & bottem right corner of map veiw be set as map edge trigger since maps are actually square\r
+ //to stop scrolling and have the player position data move to the edge of the screen with respect to the direction\r
+ //when player->tx or player->ty == 0 or player->tx == 20 or player->ty == 15 then stop because that is edge of map and you do not want to walk of the map\r
\r
- //player movement\r
- IN_ReadControl(0,&player);\r
- if(!panswitch){\r
- walk(mv, player, 0);\r
- }else{\r
- panpagemanual(mv, player, 0);\r
- //printf(" player[0].q: %d", player[0].q); printf(" player[0].d: %d\n", player[0].d);\r
- }\r
+ //player movement\r
+ IN_ReadControl(player);\r
+ if(!panswitch){\r
+ walk(player->ent, mv);\r
+ }\r
\r
- //the scripting stuff....\r
- //if(((player[0].triggerx == TRIGGX && player[0].triggery == TRIGGY) && IN_KeyDown(0x1C))||(player[0].tx == 5 && player[0].ty == 5))\r
- if(((mv[0].map->data[(player[0].triggerx-1)+(map.width*(player[0].triggery-1))] == 0) && IN_KeyDown(0x1C))||(player[0].tx == 5 && player[0].ty == 5))\r
- {\r
- short i;\r
- for(i=800; i>=400; i--)\r
+ //the scripting stuff....\r
+/* if(((mv->map->data[(player->triggerx-1)+(map.width*(player->triggery-1))] == 0) && IN_KeyDown(0x1C))||(player->tx == 5 && player->ty == 5))\r
{\r
- sound(i);\r
+ short i;\r
+ for(i=800; i>=400; i--)\r
+ {\r
+ sound(i);\r
+ }\r
+ nosound();\r
+ }\r
+ if(player->q == (TILEWH/(player->speed))+1 && player->info.dir != 2 && (player->triggerx == 5 && player->triggery == 5)){ player->hp--; }\r
+*/ //debugging binds!\r
+ if(IN_KeyDown(2)){ modexShowPage(mv->page); pan.pn=0; }\r
+ if(IN_KeyDown(25)){ modexpdump(mv->page);\r
+ IN_UserInput(1,1);\r
+ } //p\r
+ if(IN_KeyDown(24)){ modexPalUpdate0(gpal); paloffset=0; modexpdump(mv->page); IN_UserInput(1,1); }\r
+ if(IN_KeyDown(22)){\r
+ printf("2paloffset = %d\n", paloffset/3);\r
+ IN_UserInput(1,1);\r
}\r
- nosound();\r
- }\r
- if(player[0].q == (TILEWH/(player[0].speed))+1 && player[0].info.dir != 2 && (player[0].triggerx == 5 && player[0].triggery == 5)){ player[0].hp--; }\r
- //debugging binds!\r
- if(IN_KeyDown(2)){ modexShowPage(mv[0].page); pan.pn=0; }\r
- if(IN_KeyDown(3)){ modexShowPage(mv[1].page); pan.pn=1; }\r
- if(IN_KeyDown(4)){ modexShowPage(mv[2].page); pan.pn=2; }\r
- if(IN_KeyDown(4+1)){ modexShowPage(mv[3].page); pan.pn=3; }\r
- if(IN_KeyDown(25)){ modexpdump(mv[0].page); modexpdump(mv[1].page);\r
- IN_UserInput(1,1);\r
- } //p\r
- if(IN_KeyDown(24)){ modexPalUpdate0(gpal); paloffset=0; modexpdump(mv[0].page); modexpdump(mv[1].page); IN_UserInput(1,1); }\r
- if(IN_KeyDown(22)){\r
- paloffset=0; modexPalBlack(); modexPalUpdate(player[0].data, &paloffset, 0, 0);\r
- printf("2paloffset = %d\n", paloffset/3);\r
- modexpdump(mv[0].page); modexpdump(mv[1].page);\r
- IN_UserInput(1,1);\r
- }\r
\r
- //pan switch\r
- if(IN_KeyDown(88)){panswitch=!panswitch; IN_UserInput(1,1);} //f12\r
- if(IN_KeyDown(87)) //f11\r
- {\r
- pageflipflop=!pageflipflop;\r
- IN_UserInput(1,1);\r
-// VGAmodeX(0, 0, &gvar);\r
-// IN_Shutdown();\r
-// __asm\r
-// {\r
-// mov ah,31h\r
-// int 21h\r
-// }\r
- }\r
- if(IN_KeyDown(68)) //f10\r
- {\r
- gvar.kurokku.fpscap=!gvar.kurokku.fpscap;\r
- IN_UserInput(1,1);\r
- }\r
- if(IN_KeyDown(67)) //f9\r
- {\r
- modexClearRegion(mv[1].page, 0, 0, mv[1].page->width, mv[1].page->height, 2);\r
- modexClearRegion(mv[2].page, 0, 0, mv[2].page->width, mv[2].page->height, 3);\r
- modexClearRegion(mv[3].page, 0, 0, mv[3].page->width, mv[3].page->height, 4);\r
- modexClearRegion(mv[3].page, 0, 0, 20, 36, 15);\r
- //IN_UserInput(1,1);\r
- }\r
- if(IN_KeyDown(66)) //f8\r
- {\r
-// modexDrawSprite(mv[0].page, 16, 16, p);\r
- modexDrawSprite(mv[0].page, 32+48, 16, (player[0].data));\r
- }\r
- //TODO fmemtest into page\r
- /*if(IN_KeyDown(4+1)) //4\r
- {\r
- pg=1;\r
- SELECT_ALL_PLANES();\r
- _fmemset(((mv[pg].page->data+4)+(16*(mv[pg].page->width/4))), 15, 4);\r
- }*/\r
+ //pan switch\r
+ if(IN_KeyDown(88)){panswitch=!panswitch; IN_UserInput(1,1);} //f12\r
+ if(IN_KeyDown(87)) //f11\r
+ {\r
+ pageflipflop=!pageflipflop;\r
+ IN_UserInput(1,1);\r
+ }\r
+ if(IN_KeyDown(68)) //f10\r
+ {\r
+ gvar.kurokku.fpscap=!gvar.kurokku.fpscap;\r
+ IN_UserInput(1,1);\r
+ }\r
+ if(IN_KeyDown(67)) //f9\r
+ {\r
+ modexClearRegion(mv->page, 0, 0, mv->page->width, mv->page->height, 2);\r
+ }\r
+ if(IN_KeyDown(66)) //f8\r
+ {\r
+ // modexDrawSprite(mv->page, 16, 16, p);\r
+ modexDrawSprite(mv->page, 32+48, 16, (player->data));\r
+ }\r
+ //TODO fmemtest into page\r
+ /*if(IN_KeyDown(4+1)) //4\r
+ {\r
+ pg=1;\r
+ SELECT_ALL_PLANES();\r
+ _fmemset(((mv[pg].page->data+4)+(16*(mv[pg].page->width/4))), 15, 4);\r
+ }*/\r
\r
- //9\r
- if(IN_KeyDown(10)){ modexPalOverscan(rand()%56); modexPalUpdate1(dpal); IN_UserInput(1,1); }\r
- //if(IN_KeyDown(11)){ modexPalOverscan(15); }\r
- if((player[0].q==1) && !(player[0].x%TILEWH==0 && player[0].y%TILEWH==0)) break; //incase things go out of sync!\r
+ //9\r
+ if(IN_KeyDown(10)){ modexPalOverscan(rand()%56); modexPalUpdate1(dpal); IN_UserInput(1,1); }\r
+ //if(IN_KeyDown(11)){ modexPalOverscan(15); }\r
+ if((player->q==1) && !(player->x%TILEWH==0 && player->y%TILEWH==0)) break; //incase things go out of sync!\r
+ player->hp = 0;\r
}\r
\r
/* fade back to text mode */\r
Shutdown16(&gvar);\r
printf("\nProject 16 scroll.exe. This is just a test file!\n");\r
printf("version %s\n", VERSION);\r
- printf("tx: %d ", mv[0].tx);\r
- printf("ty: %d\n", mv[0].ty);\r
+ printf("tx: %d ", mv->tx);\r
+ printf("ty: %d\n", mv->ty);\r
printf("\n");\r
printf("player vars:\n");\r
- printf(" x: %d", player[0].x); printf(" y: %d\n", player[0].y);\r
- //if(player[0].hp==0) printf("%d wwww\n", player[0].y+8);\r
- //else printf("\nplayer[0].y: %d\n", player[0].y);\r
- printf(" tx: %d", player[0].tx); printf(" ty: %d\n", player[0].ty);\r
- printf(" triggx: %d", player[0].triggerx); printf(" triggy: %d\n", player[0].triggery);\r
- printf(" hp: %d", (player[0].hp)); printf(" q: %d", player[0].q); printf(" player.info.dir: %d", player[0].info.dir); printf(" player.d: %d ", player[0].d);\r
- printf(" pdir=%d\n", player[0].pdir);\r
- printf(" tile data value at player trigger position: %d\n\n", mv[0].map->data[(player[0].triggerx-1)+(map.width*(player[0].triggery-1))]);\r
+ printf(" x: %d", player->x); printf(" y: %d\n", player->y);\r
+ //if(player->hp==0) printf("%d wwww\n", player->y+8);\r
+ //else printf("\nplayer->y: %d\n", player->y);\r
+ printf(" tx: %d", player->tx); printf(" ty: %d\n", player->ty);\r
+ printf(" triggx: %d", player->triggerx); printf(" triggy: %d\n", player->triggery);\r
+ printf(" hp: %d", (player->hp)); printf(" q: %d", player->q); printf(" player.info.dir: %d", player->info.dir); printf(" player.d: %d ", player->d);\r
+ printf(" pdir=%d\n", player->pdir);\r
+ printf(" tile data value at player trigger position: %d\n\n", mv->map->data[(player->triggerx-1)+(map.width*(player->triggery-1))]);\r
printf("Virtual Screen: %dx", gvar.video.page[0].width); printf("%d ", gvar.video.page[0].height);\r
printf("Screen: %dx", gvar.video.page[0].sw); printf("%d\n", gvar.video.page[0].sh);\r
printf("virtual tile resolution: %dx", gvar.video.page[0].tilesw); printf("%d ", gvar.video.page[0].tilesh);\r
//0000printf("\ngvar.video.tickclk=%f\n", gvar.video.tickclk);\r
//0000printf("gvar.video.clk=%f", gvar.video.clk);\r
printf("\n");\r
- //printf("map.width=%d map.height=%d map.data[0]=%d\n", mv[0].map->width, mv[0].map->height, mv[0].map->data[0]);\r
+ //printf("map.width=%d map.height=%d map.data[0]=%d\n", mv->map->width, mv->map->height, mv->map->data[0]);\r
\r
printf("\n");\r
switch(detectcpu())\r