From: Jonathan Campbell Date: Thu, 21 Apr 2016 14:00:04 +0000 (-0700) Subject: fix updated code to copy the char, not NUL char (doh!) X-Git-Url: http://4ch.mooo.com/gitweb/?p=16.git;a=commitdiff_plain;h=d31b48962de4f4384cca54f92db59ccc0bb06fbc fix updated code to copy the char, not NUL char (doh!) fix modex VGA init to set .width and .height page members. shinku()'s fps indicator works now! --- diff --git a/src/lib/modex16.c b/src/lib/modex16.c index 20c468e2..5db7bf48 100755 --- a/src/lib/modex16.c +++ b/src/lib/modex16.c @@ -95,6 +95,9 @@ void modexEnter(sword vq, boolean cmem, global_game_variables_t *gv) /* width and height */ gv->video.page[0].sw = vga_state.vga_width = 320; // VGA lib currently does not update this gv->video.page[0].sh = vga_state.vga_height = 240; // VGA lib currently does not update this + /* virtual width and height. match screen, at first */ + gv->video.page[0].height = gv->video.page[0].sh; + gv->video.page[0].width = gv->video.page[0].sw; // mode X BYTE mode cm.word_mode = 0; @@ -907,7 +910,7 @@ void modexprint(page_t *page, word x, word y, word t, word col, word bgcol, cons // load the character into romFontsData.l // no need for inline assembly! // NTS: It might even be faster to just let the modexDrawChar point directly at ROM font than to copy per char! --J.C. - _fmemcpy(romFontsData.l,MK_FP(s,o)/*ROM font location*/,w/*char size*/); + _fmemcpy(romFontsData.l,MK_FP(s,o+(w*c))/*ROM font location*/,w/*char size*/); modexDrawChar(page, x_draw/*for mode X planar use*/, t, col, bgcol, addrr); x_draw += 8; /* track X for edge of screen */ addrr += 2; /* move 8 pixels over (2 x 4 planar pixels per byte) */ diff --git a/src/lib/scroll16.c b/src/lib/scroll16.c index ac3bf7ab..24837c4b 100755 --- a/src/lib/scroll16.c +++ b/src/lib/scroll16.c @@ -594,14 +594,15 @@ void shinku(global_game_variables_t *gv) { word x = (16); word y = (16); - word col = 1; + word col = 7; word bgcol = 0; - word type = 1; + word type = 0; + //t=(((*(gv->clock))-gv->clock_start) /18.2); sprintf(gv->pee, "%f fps", (double)gv->kurokku.tiku/ticktock(gv)); - printf("%s\n", gv->pee); +// printf("%s\n", gv->pee); //FIXME PLEASE!! - modexprint(&(gv->video.page[0]), 200, 200, type, col, bgcol, gv->pee); + modexprint(&(gv->video.page[0]), x, y, type, col, bgcol, gv->pee); //++++ modexprint(&(gv->video.page[0]), x, y, type, col, bgcol, gv->pee); //(gv->clock_start)=*(gv->clock); gv->kurokku.tiku=0;