X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fscroll16.c;h=cb014fd06bf126206eedaa47b6c2b776be4bfeae;hb=330b72f5c3a57ed0a17636059df12e0195a5c3cd;hp=b94e768a77c1a8d4813111caa3e2bdae39c36cf3;hpb=fb97121f7d0be4408d8e2ed98a2f7b10b852a915;p=16.git diff --git a/src/lib/scroll16.c b/src/lib/scroll16.c index b94e768a..cb014fd0 100755 --- a/src/lib/scroll16.c +++ b/src/lib/scroll16.c @@ -362,7 +362,7 @@ initMap(map_t *map) { void near mapScrollRight(map_view_t *mv, player_t *player, word id, word plid) { - word x, y; /* coordinate for drawing */ + word x;//, y; /* coordinate for drawing */ /* increment the pixel position and update the page */ mv[id].page->dx += player[plid].speed; @@ -392,7 +392,7 @@ void near mapScrollRight(map_view_t *mv, player_t *player, word id, word plid) void near mapScrollLeft(map_view_t *mv, player_t *player, word id, word plid) { - word x, y; /* coordinate for drawing */ + word x;//,y; /* coordinate for drawing */ /* decrement the pixel position and update the page */ mv[id].page->dx -= player[plid].speed; @@ -422,7 +422,7 @@ void near mapScrollLeft(map_view_t *mv, player_t *player, word id, word plid) void near mapScrollUp(map_view_t *mv, player_t *player, word id, word plid) { - word x, y; /* coordinate for drawing */ + word y;//x, /* coordinate for drawing */ /* decrement the pixel position and update the page */ mv[id].page->dy -= player[plid].speed; @@ -451,7 +451,7 @@ void near mapScrollUp(map_view_t *mv, player_t *player, word id, word plid) void near mapScrollDown(map_view_t *mv, player_t *player, word id, word plid) { - word x, y; /* coordinate for drawing */ + word y;//x, /* coordinate for drawing */ /* increment the pixel position and update the page */ mv[id].page->dy += player[plid].speed; @@ -594,7 +594,7 @@ sword chkmap(map_t *map, word q) //TODO: player position here void mapGoTo(map_view_t *mv, int tx, int ty) { - int px, py; + int py;//px, unsigned int i; /* set up the coordinates */ @@ -634,8 +634,7 @@ mapDrawTile(tiles_t *t, word i, page_t *page, word x, word y) { word rx; word ry; - word textx=0; - word texty=0; + //word textx=0, texty=0; //if(i==0) i=2; if(i==0) { @@ -761,8 +760,8 @@ void shinku(global_game_variables_t *gv) { word x = (0) + gv->video.page[/*!*/(gv->video.p)].dx; // follow the screen word y = (0) + gv->video.page[/*!*/(gv->video.p)].dy; // follow the screen - word w = 64, h = 8, col = 7, bgcol = 0, type = 1; - byte o,o2,i; + word col = 7, bgcol = 0, type = 1;//w = 64, h = 8, + //byte o,o2,i; //modexCopyPageRegion(pip[1].page, pip[2].page, 16, 16, 16, 16, (14*8)+4, 8+4); /* block copy to visible RAM from offscreen */ // vga_setup_wm1_block_copy(); @@ -774,9 +773,16 @@ void shinku(global_game_variables_t *gv) // vga_restore_rm0wm0(); if(elapsed_timer(gv) >= (1.0 / gv->kurokku.frames_per_second)) { - sprintf(gv->pee, "%.0f fps", (double)gv->kurokku.tiku/ticktock(gv)); + // NTS: For some bizarre reason, gv->pee is not initialized, but the pointer is not NULL even + // though it should be. Instead it's NULL as a near pointer but contains a non-null + // segment value, so testing against NULL doesn't work. It is initialized properly if + // you call start_timer() though which uses near malloc. Rather than fight with that, + // I decided it would be better to declare a temp buffer statically and sprintf to that. + // + // This fixes *** Null pointer assignment detected error message in ZCROLL.EXE on exit. + sprintf(global_temp_status_text, "%.0f fps", (double)gv->kurokku.tiku/ticktock(gv)); //modexClearRegion(&(gv->video.page[shinku_fps_indicator_page]), x, y, w, h, 45); - modexprint(&(gv->video.page[/*!*/(gv->video.p)]), x, y, type, col, bgcol, gv->pee); + modexprint(&(gv->video.page[/*!*/(gv->video.p)]), x, y, type, col, bgcol, global_temp_status_text); gv->kurokku.tiku=0; /* block copy to visible RAM from offscreen */ // vga_setup_wm1_block_copy();