#define MODEX //this is for mode x initiating
//word far *clock= (word far*) 0x046C; /* 18.2hz clock */
-
+//bitmap_t *p;
global_game_variables_t gvar;
static map_t map;
player_t player[MaxPlayers];
-//page_t screen, gvar.video.page[1], gvar.video.page[2];
map_view_t mv[4];
-bitmap_t p;
//word pn=0; //i forgot ww
-static planar_buf_t huge *pp;
+//static planar_buf_t huge *pp;
float t;
sword bakapee;
pan_t pan;
pan.pn=1;
//player[0].data = &pp;
- printf("starting timer ");
+ //printf("starting timer ");
start_timer(&gvar);
- printf("ok\n");
+ //printf("ok\n");
// atexit(qclean());
//mappalptr = map.tiles->btdata->palette;
/* data */
- //++++p = bitmapLoadPcx("data/ptmp.pcx"); // load sprite
+ player[0].data = malloc(48*128); //TODO use exmm
+ *player[0].data = bitmapLoadPcx("data/chikyuu.pcx"); // load sprite
//npctmp = bitmapLoadPcx("ptmp1.pcx"); // load sprite
/* create the planar buffer */
// printf("Total used @ before palette initiation: %zu\n", oldfreemem-GetFreeSize());
//++++ player[0].data.offset=(paloffset/3);
//++++ modexPalUpdate1(&player[0].data, &paloffset, 0, 0);
- //modexPalUpdate1(p.palette);
+ modexPalUpdate1(player[0].data->palette);
//++++0000 modexPalUpdate1(map.tiles->btdata->palette);
//printf(" %d\n", sizeof(ptmp->data));
//printf("1: %d\n", paloffset);
mv[i].video = &gvar.video;
mv[i].pan = &pan;
}
+
/* set up paging */
//TODO: LOAD map data and position the map in the middle of the screen if smaller then screen
mapGoTo(mv, 0, 0);
- modexCopyPageRegion(mv[1].page, mv[0].page, 0, 0, 0, 0, mv[1].page->width, mv[1].page->height);
+ //_fmemcpy(mv[1].page->data, mv[0].page->data, mv[0].page->pagesize);
//TODO: put player in starting position of spot
//default player position on the viewable map
//IN_initplayer(&player, 1);
#ifndef SPRITE
- modexClearRegion(mv[1].page, player[0].x-4, player[0].y-TILEWH, 24, 32, 15);
+ modexClearRegion(mv[0].page, player[0].x, player[0].y-TILEWH, 16, 32, 15);
+ //modexClearRegion(mv[1].page, player[0].x, player[0].y-TILEWH, 16, 32, 15);
#else
- //PBUFSFUN(mv[1].page, player[0].x-4, player[0].y-TILEWH, 24, 64, 24, 32, PLAYERBMPDATA);
- PBUFSFUN(mv[1].page, player[0].x-4, player[0].y-TILEWH, 24, 64, 24, 32, &pp);
+ //PBUFSFUN(mv[1].page, player[0].x, player[0].y-TILEWH, 16, 64, 24, 32, PLAYERBMPDATA);
+ PBUFSFUN(mv[0].page, player[0].x, player[0].y-TILEWH, 16, 64, 16, 32, player[0].data);
#endif
if(!pageflipflop) modexShowPage(mv[1].page);
- else modexShowPage(mv[(gvar.video.p)].page);
- shinku_fps_indicator_page = 1; // we're on page 1 now, shinku(). follow along please or it will not be visible.
- //modexClearRegion(mv[2].page, 0, 0, mv[2].page->width, mv[2].page->height, 1);
+ else modexShowPage(mv[0].page);//!(gvar.video.p)
+ shinku_fps_indicator_page = 0; // we're on page 1 now, shinku(). follow along please or it will not be visible.
+
+ /* buffer pages */
+// modexClearRegion(mv[2].page, 0, 0, mv[2].page->width, mv[2].page->height, 47);
+// modexClearRegion(mv[3].page, 0, 0, mv[3].page->width, mv[3].page->height, 45);
+// {
+// unsigned int k,j,o;
+// /* fill screen with a distinctive pattern */
+// for (k=0;k < vga_state.vga_width;k++) {
+// o = k >> 2;
+// vga_write_sequencer(0x02/*map mask*/,1 << (k&3));
+// for (j=0;j < vga_state.vga_height;j++,o += vga_state.vga_stride)
+// vga_state.vga_graphics_ram[o] = (k^j)&15; // VRL samples put all colors in first 15!
+// }
+// }
+ modexClearRegion(mv[3].page, 0, 128, 24, 36, 15);
+
#ifdef MODEX
#ifdef FADE
modexFadeOn(4, gpal);
}
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--; }
//debugging binds!
- if(IN_KeyDown(2)){ modexShowPage(mv[0].page); pan.pn=0; IN_UserInput(1,1); }
- if(IN_KeyDown(3)){ modexShowPage(mv[1].page); pan.pn=1; IN_UserInput(1,1); }
- if(IN_KeyDown(4)){ modexShowPage(mv[2].page); pan.pn=2; IN_UserInput(1,1); }
- if(IN_KeyDown(4+1)){ modexShowPage(mv[3].page); pan.pn=3; IN_UserInput(1,1); }
+ if(IN_KeyDown(2)){ modexShowPage(mv[0].page); pan.pn=0; }
+ if(IN_KeyDown(3)){ modexShowPage(mv[1].page); pan.pn=1; }
+ if(IN_KeyDown(4)){ modexShowPage(mv[2].page); pan.pn=2; }
+ if(IN_KeyDown(4+1)){ modexShowPage(mv[3].page); pan.pn=3; }
if(IN_KeyDown(25)){ modexpdump(mv[0].page); modexpdump(mv[1].page);
IN_UserInput(1,1);
} //p
#ifdef FADE
if(IN_KeyDown(24)){ modexPalUpdate0(gpal); paloffset=0; modexpdump(mv[0].page); modexpdump(mv[1].page); IN_UserInput(1,1); }
if(IN_KeyDown(22)){
- paloffset=0; modexPalBlack(); modexPalUpdate(&player[0].data, &paloffset, 0, 0);
+ paloffset=0; modexPalBlack(); modexPalUpdate(player[0].data, &paloffset, 0, 0);
printf("1paloffset = %d\n", paloffset/3);
modexPalUpdate(map.tiles->data, &paloffset, 0, 0);
printf("2paloffset = %d\n", paloffset/3);
gvar.kurokku.fpscap=!gvar.kurokku.fpscap;
IN_UserInput(1,1);
}
+ if(IN_KeyDown(67)) //f9
+ {
+ modexClearRegion(mv[1].page, 0, 0, mv[1].page->width, mv[1].page->height, 2);
+ modexClearRegion(mv[2].page, 0, 0, mv[2].page->width, mv[2].page->height, 3);
+ modexClearRegion(mv[3].page, 0, 0, mv[3].page->width, mv[3].page->height, 4);
+ modexClearRegion(mv[3].page, 0, 0, 20, 36, 15);
+ //IN_UserInput(1,1);
+ }
+ if(IN_KeyDown(66)) //f8
+ {
+// modexDrawSprite(mv[0].page, 16, 16, p);
+ modexDrawSprite(mv[0].page, 32+48, 16, (player[0].data));
+ }
//TODO fmemtest into page
/*if(IN_KeyDown(4+1)) //4
{
VGAmodeX(0, 1, &gvar);
#endif
IN_Shutdown();
- printf("Project 16 scroll.exe. This is just a test file!\n");
+ printf("\nProject 16 scroll.exe. This is just a test file!\n");
printf("version %s\n", VERSION);
- printf("tx: %d\n", mv[0].tx);
+ printf("tx: %d ", mv[0].tx);
printf("ty: %d\n", mv[0].ty);
- printf("player.x: %d", player[0].x); printf(" player.y: %d\n", player[0].y);
+ printf("\n");
+ printf("player vars:\n");
+ printf(" x: %d", player[0].x); printf(" y: %d\n", player[0].y);
//if(player[0].hp==0) printf("%d wwww\n", player[0].y+8);
//else printf("\nplayer[0].y: %d\n", player[0].y);
- printf("player.tx: %d", player[0].tx); printf(" player.ty: %d\n", player[0].ty);
- printf("player.triggx: %d", player[0].triggerx); printf(" player.triggy: %d\n", player[0].triggery);
- printf("player.hp: %d", (player[0].hp)); printf(" player.q: %d", player[0].q); printf(" player.info.dir: %d", player[0].info.dir); printf(" player.d: %d ", player[0].d);
- printf("pdir=%d\n", player[0].pdir);
- printf("tile data value at player trigger position: %d\n", mv[0].map->data[(player[0].triggerx-1)+(map.width*(player[0].triggery-1))]);
+ printf(" tx: %d", player[0].tx); printf(" ty: %d\n", player[0].ty);
+ printf(" triggx: %d", player[0].triggerx); printf(" triggy: %d\n", player[0].triggery);
+ 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);
+ printf(" pdir=%d\n", player[0].pdir);
+ 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))]);
// printf("palette offset: %d\n", paloffset/3);
//++++ printf("Total used: %zu\n", oldfreemem-GetFreeSize());
//++++ printf("Total free: %zu\n", GetFreeSize());
//not used now printf("temporary player sprite 0: http://www.pixiv.net/member_illust.php?mode=medium&illust_id=45556867\n");
//not used now printf("temporary player sprite 1: http://www.pixiv.net/member_illust.php?mode=medium&illust_id=44606385\n");
- printf("Virtual Screen: %dx", gvar.video.page[0].width); printf("%d\n", gvar.video.page[0].height);
+ printf("Virtual Screen: %dx", gvar.video.page[0].width); printf("%d ", gvar.video.page[0].height);
printf("Screen: %dx", gvar.video.page[0].sw); printf("%d\n", gvar.video.page[0].sh);
- printf("virtual tile resolution: %dx", gvar.video.page[0].tilesw); printf("%d\n", gvar.video.page[0].tilesh);
- printf("tile resolution: %dx", gvar.video.page[0].tw); printf("%d \n", gvar.video.page[0].th);
+ printf("virtual tile resolution: %dx", gvar.video.page[0].tilesw); printf("%d ", gvar.video.page[0].tilesh);
+ printf("tile resolution: %dx", gvar.video.page[0].tw); printf("%d\n", gvar.video.page[0].th);
printf("middle tile position: %dx", gvar.video.page[0].tilemidposscreenx); printf("%d\n", gvar.video.page[0].tilemidposscreeny);
modexprintmeminfo(&gvar.video);
- printf("mv[%u].tx: %d", pan.pn, mv[pan.pn].tx); printf(" mv[%u].ty: %d ", pan.pn, mv[pan.pn].ty); printf("gvar.video.p=%u\n", gvar.video.p);
- //printf("player[1].q: %d", player[1].q); printf(" player[1].d: %d\n", player[1].d);
+ //printf("mv[%u].tx: %d", pan.pn, mv[pan.pn].tx); printf(" mv[%u].ty: %d ", pan.pn, mv[pan.pn].ty);
+ printf("gvar.video.p=%u ", gvar.video.p); printf("gvar.video.r=%u ", gvar.video.r);
+ printf("pageflipflop=%u\n", pageflipflop);
+ //0000printf("\ngvar.video.tickclk=%f\n", gvar.video.tickclk);
+ //0000printf("gvar.video.clk=%f", gvar.video.clk);
printf("\n");
//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]);