#include "src/lib/16_timer.h"\r
#include "src/lib/wcpu/wcpu.h"\r
\r
-//#define FADE\r
-#define MODEX //this is for mode x initiating\r
-\r
//word far *clock= (word far*) 0x046C; /* 18.2hz clock */\r
//bitmap_t *p;\r
global_game_variables_t gvar;\r
fprintf(stderr, "yay map loaded~~\n");\r
\r
/* draw the tiles */\r
-#ifdef MODEX\r
ptr = map.data;\r
//mappalptr = map.tiles->btdata->palette;\r
\r
pp = planar_buf_from_bitmap(&p);\r
printf("done!\n");*/\r
\r
-#endif\r
/* input! */\r
IN_Default(0,&player,ctrl_Joystick);\r
//IN_Default(1,&player,ctrl_Joystick);\r
\r
/* save the palette */\r
-#ifdef MODEX\r
-#ifdef FADE\r
dpal = modexNewPal();\r
modexPalSave(dpal);\r
modexFadeOff(4, dpal);\r
-#endif\r
\r
textInit();\r
VGAmodeX(bakapee, 1, &gvar);\r
// printf("%dx%d\n", gvar.video.page[0].sw, gvar.video.page[0].sh);\r
-#ifdef FADE\r
modexPalBlack(); //reset the palette~\r
-#endif\r
-#endif\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
// printf("\n====\n");\r
// printf("0 paloffset= %d\n", paloffset/3);\r
// printf("====\n\n");\r
-#ifdef MODEX\r
-#ifdef FADE\r
+\r
gpal = modexNewPal();\r
modexPalSave(gpal);\r
modexSavePalFile("data/g.pal", gpal);\r
modexPalBlack(); //so player will not see loadings~\r
-#endif\r
-#endif\r
\r
/* setup camera and screen~ */\r
modexHiganbanaPageSetup(&gvar.video);\r
// }\r
modexClearRegion(mv[3].page, 0, 128, 24, 36, 15);\r
\r
-#ifdef MODEX\r
-#ifdef FADE\r
modexFadeOn(4, gpal);\r
-#endif\r
-#endif\r
while(!IN_KeyDown(sc_Escape) && player[0].hp>0)\r
{\r
shinku(&gvar);\r
if(IN_KeyDown(25)){ modexpdump(mv[0].page); modexpdump(mv[1].page);\r
IN_UserInput(1,1);\r
} //p\r
-#ifdef MODEX\r
-#ifdef FADE\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("1paloffset = %d\n", paloffset/3);\r
- modexPalUpdate(map.tiles->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
-#endif\r
-#endif\r
+\r
//pan switch\r
if(IN_KeyDown(88)){panswitch=!panswitch; IN_UserInput(1,1);} //f12\r
if(IN_KeyDown(87)) //f11\r
\r
/* fade back to text mode */\r
/* but 1st lets save the game palette~ */\r
-#ifdef MODEX\r
-#ifdef FADE\r
modexPalSave(gpal);\r
modexSavePalFile("data/g.pal", gpal);\r
modexFadeOff(4, gpal);\r
-#endif\r
VGAmodeX(0, 1, &gvar);\r
-#endif\r
Shutdown16(&gvar);\r
printf("\nProject 16 scroll.exe. This is just a test file!\n");\r
printf("version %s\n", VERSION);\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("palette offset: %d\n", paloffset/3);\r
-//++++ printf("Total used: %zu\n", oldfreemem-GetFreeSize());\r
-//++++ printf("Total free: %zu\n", GetFreeSize());\r
-//not used now printf("temporary player sprite 0: http://www.pixiv.net/member_illust.php?mode=medium&illust_id=45556867\n");\r
-//not used now printf("temporary player sprite 1: http://www.pixiv.net/member_illust.php?mode=medium&illust_id=44606385\n");\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
default: cpus = "internal error"; break;\r
}\r
printf("detected CPU type: %s\n", cpus);\r
-#ifdef MODEX\r
-#ifdef FADE\r
modexFadeOn(4, dpal);\r
-#endif\r
-#endif\r
}\r