#include "src/lib/wcpu/wcpu.h"\r
#include "src/lib/16render.h"\r
\r
+//TODO: known issues the array dependent mv stuff and player arrays\r
+\r
global_game_variables_t gvar;\r
static map_t map;\r
player_t *player;\r
\r
//map_view_db_t pgid[4];\r
word pg;\r
-//#ifdef FADE\r
+#ifdef FADE\r
static word paloffset=0;\r
byte *dpal;\r
-//#endif\r
+#endif\r
byte *gpal;\r
byte *ptr;\r
memptr pal;\r
\r
pan.pn=0;\r
// OK, this one takes hellova time and needs to be done in farmalloc or MM_...\r
+ //USE MM AND CA AND PM WWWWWWWW\r
player = malloc(sizeof(player_t));\r
player->ent = malloc(sizeof(entity_t));\r
player->ent->spri = malloc(sizeof(struct sprite));\r
printf("chkmap ok ");\r
fprintf(stderr, "yay map loaded~~\n");\r
\r
-//goto pee;\r
// data\r
- read_vrs(&gvar, "data/spri/chikyuu.vrs", player->ent->spri->spritesheet);\r
+ printf("loading sprite\n");\r
+ read_vrs(&gvar, "data/spri/chikyuu.vrs", player->ent->spri->spritesheet); printf("sprite loaded\n");\r
\r
// input!\r
- IN_Default(0, player,ctrl_Joystick);\r
+ IN_Default(0, player,ctrl_Joystick); printf("IN_defaulted\n");\r
\r
// save the palette\r
+#ifdef FADE\r
dpal = modexNewPal();\r
modexPalSave(dpal);\r
modexFadeOff(4, dpal);\r
-\r
+#endif\r
textInit();\r
VGAmodeX(bakapee, 1, &gvar);\r
+ #ifdef MODEXZ\r
+#ifdef FADE\r
modexPalBlack(); //reset the palette~\r
-\r
+ printf("VGA\n");\r
CA_LoadFile("data/spri/chikyuu.pal", &pal, &gvar);\r
modexPalUpdate1(pal);\r
-\r
+ printf("pallette\n");\r
gpal = modexNewPal();\r
modexPalSave(gpal);\r
modexSavePalFile("data/g.pal", gpal);\r
modexPalBlack(); //so player will not see loadings~\r
+#endif\r
+\r
// setup camera and screen~\r
modexHiganbanaPageSetup(&gvar.video);\r
mv->page = &gvar.video.page[0];\r
mv->video = &gvar.video;\r
mv->pan = &pan;\r
player->ent->spri->x = player->ent->spri->y = 20;\r
+ printf("pages ok\n");\r
\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->page->data, mv->page->pagesize);\r
+#endif\r
\r
//TODO: put player in starting position of spot\r
//default player position on the viewable map\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
+ IN_initplayer(player); printf("player inited\n");\r
\r
-// #ifndef SPRITE\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->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
+#ifdef FADE\r
modexFadeOff(4, gpal);\r
+#endif\r
VGAmodeX(0, 1, &gvar);\r
Shutdown16(&gvar);\r
printf("Wrong");\r
+#ifdef FADE\r
modexFadeOn(4, dpal);\r
+#endif\r
exit(-4);\r
}\r
//animate_spri(&(player->ent->spri));\r
-// #endif\r
+ printf("spri ok\n");\r
\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
-// 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
-// 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 < vga_state.vga_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
-\r
-// modexFadeOn(4, gpal);*/\r
+#ifdef FADE\r
+ modexFadeOn(4, gpal);\r
+#endif\r
+ printf("LOOP\n");\r
while(!IN_KeyDown(sc_Escape) && player->hp>0)\r
{\r
shinku(&gvar);\r
if(IN_KeyDown(25)){ modexpdump(mv->page);\r
IN_UserInput(1,1);\r
} //p\r
+#ifdef FADE\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
+#endif\r
\r
//pan switch\r
if(IN_KeyDown(88)){panswitch=!panswitch; IN_UserInput(1,1);} //f12\r
}*/\r
\r
//9\r
+#ifdef FADE\r
if(IN_KeyDown(10)){ modexPalOverscan(rand()%56); modexPalUpdate1(dpal); IN_UserInput(1,1); }\r
//if(IN_KeyDown(11)){ modexPalOverscan(15); }\r
+#endif\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
-//pee:\r
+\r
/* fade back to text mode */\r
/* but 1st lets save the game palette~ */\r
+#ifdef FADE\r
modexPalSave(gpal);\r
modexSavePalFile("data/g.pal", gpal);\r
modexFadeOff(4, gpal);\r
+#endif\r
VGAmodeX(0, 1, &gvar);\r
Shutdown16(&gvar);\r
- printf("\nProject 16 scroll.exe. This is just a test file!\n");\r
+ printf("\nProject 16 zcroll.exe. This is just a test file!\n");\r
printf("version %s\n", VERSION);\r
printf("tx: %d ", mv->tx);\r
printf("ty: %d\n", mv->ty);\r
default: cpus = "internal error"; break;\r
}\r
printf("detected CPU type: %s\n", cpus);\r
+#ifdef FADE\r
modexFadeOn(4, dpal);\r
+#endif\r
}\r