From: Jonathan Campbell Date: Thu, 21 Apr 2016 14:27:33 +0000 (-0700) Subject: Merge remote-tracking branch 'upstream/master' X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=afebb0aa9e93ca48e0955877d5cbd883e650d35f;hp=7cbfb3d1f53e33107205d1d8a5ed215898246504;p=16.git Merge remote-tracking branch 'upstream/master' --- diff --git a/.gitignore b/.gitignore index aa3c9906..61aa5c76 100755 --- a/.gitignore +++ b/.gitignore @@ -17,8 +17,8 @@ makefile~ README~ TODO~ LICENCE~ -*.map -#*.MAP +*.mah +*.MAH !modex.lib img !.git/config diff --git a/16/v2/source/MAPED/MIKMOD.LIB b/16/v2/source/MAPED/MIKMOD.LIB deleted file mode 100755 index 0f55de95..00000000 Binary files a/16/v2/source/MAPED/MIKMOD.LIB and /dev/null differ diff --git a/16/x/MODEX.LIB b/16/x/MODEX.LIB deleted file mode 100755 index 1e7d573d..00000000 Binary files a/16/x/MODEX.LIB and /dev/null differ diff --git a/16/x/modex.lib b/16/x/modex.lib deleted file mode 100755 index 1e7d573d..00000000 Binary files a/16/x/modex.lib and /dev/null differ diff --git a/16/x_/MODEX.LIB b/16/x_/MODEX.LIB deleted file mode 100755 index 0e11c5c0..00000000 Binary files a/16/x_/MODEX.LIB and /dev/null differ diff --git a/16/x_/modex.lib b/16/x_/modex.lib deleted file mode 100755 index 0e11c5c0..00000000 Binary files a/16/x_/modex.lib and /dev/null differ diff --git a/makefile b/makefile index 57a260fb..ee23f2f2 100755 --- a/makefile +++ b/makefile @@ -82,7 +82,8 @@ DOSLIBOBJ = adlib.$(OBJ) 8254.$(OBJ) 8259.$(OBJ) dos.$(OBJ) cpu.$(OBJ) GFXLIBOBJS = modex16.$(OBJ) bitmap.$(OBJ) planar.$(OBJ) 16text.$(OBJ) bakapee.$(OBJ) scroll16.$(OBJ) 16render.$(OBJ) 16planar.$(OBJ) $(DOSLIBLIBS) -DOSLIBLIBS=$(DOSLIBDIR)$(DIRSEP)hw$(DIRSEP)cpu$(DIRSEP)dos86h$(DIRSEP)cpu.lib $(DOSLIBDIR)$(DIRSEP)hw$(DIRSEP)dos$(DIRSEP)dos86h$(DIRSEP)dos.lib $(DOSLIBDIR)$(DIRSEP)hw$(DIRSEP)vga$(DIRSEP)dos86h$(DIRSEP)vga.lib $(DOSLIBDIR)$(DIRSEP)hw$(DIRSEP)vga$(DIRSEP)dos86h$(DIRSEP)vgatty.lib +DOSLIBLIBS=$(DOSLIBDIR)$(DIRSEP)hw$(DIRSEP)cpu$(DIRSEP)dos86h$(DIRSEP)cpu.lib $(DOSLIBDIR)$(DIRSEP)hw$(DIRSEP)dos$(DIRSEP)dos86h$(DIRSEP)dos.lib $(DOSLIBDIR)$(DIRSEP)hw$(DIRSEP)vga$(DIRSEP)dos86h$(DIRSEP)vga.lib +#$(DOSLIBDIR)$(DIRSEP)hw$(DIRSEP)vga$(DIRSEP)dos86h$(DIRSEP)vgatty.lib TESTEXEC = exmmtest.exe test.exe pcxtest.exe pcxtest2.exe test2.exe palettec.exe maptest.exe fmemtest.exe fonttest.exe fontgfx.exe scroll.exe vgmtest.exe inputest.exe palettel.exe planrpcx.exe # tsthimem.exe @@ -96,23 +97,23 @@ all: $(EXEC) joytest.exe vrs #game and bakapi executables # 16.exe: 16.$(OBJ) mapread.$(OBJ) jsmn.$(OBJ) $(16LIBOBJS) gfx.lib - wcl $(FLAGS) $(16FLAGS) 16.$(OBJ) mapread.$(OBJ) jsmn.$(OBJ) $(16LIBOBJS) gfx.lib -fm=16.map + wcl $(FLAGS) $(16FLAGS) 16.$(OBJ) mapread.$(OBJ) jsmn.$(OBJ) $(16LIBOBJS) gfx.lib -fm=16.mah bakapi.exe: bakapi.$(OBJ) gfx.lib $(DOSLIBLIBS) - wcl $(FLAGS) $(BAKAPIFLAGS) bakapi.$(OBJ) gfx.lib $(DOSLIBLIBS) -fm=bakapi.map + wcl $(FLAGS) $(BAKAPIFLAGS) bakapi.$(OBJ) gfx.lib $(DOSLIBLIBS) -fm=bakapi.mah #modex.lib # #Test Executables! # scroll.exe: scroll.$(OBJ) mapread.$(OBJ) jsmn.$(OBJ) $(16LIBOBJS) gfx.lib - wcl $(FLAGS) scroll.$(OBJ) mapread.$(OBJ) jsmn.$(OBJ) $(16LIBOBJS) gfx.lib -fm=scroll.map + wcl $(FLAGS) scroll.$(OBJ) mapread.$(OBJ) jsmn.$(OBJ) $(16LIBOBJS) gfx.lib -fm=scroll.mah scroll.$(OBJ): $(SRC)scroll.c wcl $(FLAGS) -c $(SRC)scroll.c # NOTE: dos86h = 16-bit huge memory model. memory model must match! tesuto.exe: tesuto.$(OBJ) $(DOSLIBLIBS) 16_head.$(OBJ) gfx.lib -# %write tmp.cmd option quiet option map=tesuto.map $(DOSLIB_LDFLAGS_DOS16H) file tesuto.obj name tesuto.exe +# %write tmp.cmd option quiet option map=tesuto.mah $(DOSLIB_LDFLAGS_DOS16H) file tesuto.obj name tesuto.exe # %write tmp.cmd library $(DOSLIBDIR)$(DIRSEP)hw$(DIRSEP)cpu$(DIRSEP)dos86h$(DIRSEP)cpu.lib # %write tmp.cmd library $(DOSLIBDIR)$(DIRSEP)hw$(DIRSEP)dos$(DIRSEP)dos86h$(DIRSEP)dos.lib # @wlink @tmp.cmd @@ -121,22 +122,22 @@ tesuto.$(OBJ): $(SRC)tesuto.c wcl $(FLAGS) $(WCLQ) -c $(SRC)tesuto.c test.exe: test.$(OBJ) gfx.lib 16_in.$(OBJ) 16_head.$(OBJ) - wcl $(FLAGS) test.$(OBJ) gfx.lib 16_in.$(OBJ) 16_head.$(OBJ) -fm=test.map + wcl $(FLAGS) test.$(OBJ) gfx.lib 16_in.$(OBJ) 16_head.$(OBJ) -fm=test.mah test2.exe: test2.$(OBJ) gfx.lib - wcl $(FLAGS) test2.$(OBJ) gfx.lib -fm=test2.map + wcl $(FLAGS) test2.$(OBJ) gfx.lib -fm=test2.mah fonttest.exe: fonttest.$(OBJ) $(16LIBOBJS) gfx.lib - wcl $(FLAGS) fonttest.$(OBJ) $(16LIBOBJS) gfx.lib -fm=fonttest.map + wcl $(FLAGS) fonttest.$(OBJ) $(16LIBOBJS) gfx.lib -fm=fonttest.mah #fonttes0.exe: fonttes0.$(OBJ) $(16LIBOBJS) # wcl $(FLAGS) fonttes0.$(OBJ) $(16LIBOBJS) fontgfx.exe: fontgfx.$(OBJ) $(16LIBOBJS) gfx.lib $(DOSLIBLIBS) - wcl $(FLAGS) fontgfx.$(OBJ) $(16LIBOBJS) gfx.lib $(DOSLIBLIBS) -fm=fontgfx.map + wcl $(FLAGS) fontgfx.$(OBJ) $(16LIBOBJS) gfx.lib $(DOSLIBLIBS) -fm=fontgfx.mah inputest.exe: inputest.$(OBJ) $(16LIBOBJS) - wcl $(FLAGS) inputest.$(OBJ) $(16LIBOBJS) -fm=inputest.map + wcl $(FLAGS) inputest.$(OBJ) $(16LIBOBJS) -fm=inputest.mah #sountest.exe: sountest.$(OBJ) $(16LIBOBJS) # wcl $(FLAGS) sountest.$(OBJ) $(16LIBOBJS) @@ -145,7 +146,7 @@ inputest.exe: inputest.$(OBJ) $(16LIBOBJS) # wcl $(FLAGS) miditest.$(OBJ) $(16LIBOBJS) $(DOSLIBEXMMOBJ) midi.$(OBJ) tsthimem.exe: tsthimem.$(OBJ) $(16LIBOBJS) $(DOSLIBEXMMOBJ) - wcl $(FLAGS) tsthimem.$(OBJ) $(16LIBOBJS) $(DOSLIBEXMMOBJ) -fm=tsthimem.map + wcl $(FLAGS) tsthimem.$(OBJ) $(16LIBOBJS) $(DOSLIBEXMMOBJ) -fm=tsthimem.mah #testemm.exe: testemm.$(OBJ) $(16LIBOBJS) $(DOSLIBEXMMOBJ) # wcl $(FLAGS) testemm.$(OBJ) $(16LIBOBJS) $(DOSLIBEXMMOBJ) @@ -154,22 +155,22 @@ tsthimem.exe: tsthimem.$(OBJ) $(16LIBOBJS) $(DOSLIBEXMMOBJ) # wcl $(FLAGS) testemm0.$(OBJ) $(16LIBOBJS) $(DOSLIBEXMMOBJ) pcxtest.exe: pcxtest.$(OBJ) gfx.lib - wcl $(FLAGS) pcxtest.$(OBJ) gfx.lib -fm=pcxtest.map + wcl $(FLAGS) pcxtest.$(OBJ) gfx.lib -fm=pcxtest.mah palettec.exe: palettec.$(OBJ) gfx.lib #$(16LIBOBJS) - wcl $(FLAGS) palettec.$(OBJ) gfx.lib -fm=palettec.map #$(16LIBOBJS) + wcl $(FLAGS) palettec.$(OBJ) gfx.lib -fm=palettec.mah #$(16LIBOBJS) palettel.exe: palettel.$(OBJ) gfx.lib #$(16LIBOBJS) - wcl $(FLAGS) palettel.$(OBJ) gfx.lib -fm=palettel.map #$(16LIBOBJS) + wcl $(FLAGS) palettel.$(OBJ) gfx.lib -fm=palettel.mah #$(16LIBOBJS) pcxtest2.exe: pcxtest2.$(OBJ) gfx.lib - wcl $(FLAGS) pcxtest2.$(OBJ) gfx.lib -fm=pcxtest2.map + wcl $(FLAGS) pcxtest2.$(OBJ) gfx.lib -fm=pcxtest2.mah planrpcx.exe: planrpcx.$(OBJ) gfx.lib - wcl $(FLAGS) planrpcx.$(OBJ) gfx.lib -fm=planrpcx.map + wcl $(FLAGS) planrpcx.$(OBJ) gfx.lib -fm=planrpcx.mah maptest.exe: maptest.$(OBJ) mapread.$(OBJ) jsmn.$(OBJ) $(16LIBOBJS) gfx.lib - wcl $(FLAGS) maptest.$(OBJ) mapread.$(OBJ) jsmn.$(OBJ) $(16LIBOBJS) gfx.lib -fm=maptest.map + wcl $(FLAGS) maptest.$(OBJ) mapread.$(OBJ) jsmn.$(OBJ) $(16LIBOBJS) gfx.lib -fm=maptest.mah #maptest0.exe: maptest0.$(OBJ) fmapread.$(OBJ) farjsmn.$(OBJ) # wcl $(FLAGS) $(MFLAGS) maptest0.$(OBJ) fmapread.$(OBJ) farjsmn.$(OBJ) @@ -181,14 +182,14 @@ maptest.exe: maptest.$(OBJ) mapread.$(OBJ) jsmn.$(OBJ) $(16LIBOBJS) gfx.lib # wcl $(FLAGS) $(MFLAGS) emsdump.$(OBJ) memory.$(OBJ) fmemtest.exe: fmemtest.$(OBJ) $(16LIBOBJS) - wcl $(FLAGS) fmemtest.$(OBJ) $(16LIBOBJS) -fm=fmemtest.map + wcl $(FLAGS) fmemtest.$(OBJ) $(16LIBOBJS) -fm=fmemtest.mah exmmtest.exe: exmmtest.$(OBJ) $(16LIBOBJS) - wcl $(FLAGS) exmmtest.$(OBJ) -fm=exmmtest.map $(16LIBOBJS) + wcl $(FLAGS) exmmtest.$(OBJ) -fm=exmmtest.mah $(16LIBOBJS) vgmtest.exe: vgmtest.$(OBJ) vgmsnd.lib $(16LIBOBJS) - wcl $(FLAGS) vgmtest.$(OBJ) vgmsnd.lib -fm=vgmtest.map $(16LIBOBJS) - #====wcl -mc vgmtest.$(OBJ) $(VGMSNDOBJ) -fm=vgmtest.map + wcl $(FLAGS) vgmtest.$(OBJ) vgmsnd.lib -fm=vgmtest.mah $(16LIBOBJS) + #====wcl -mc vgmtest.$(OBJ) $(VGMSNDOBJ) -fm=vgmtest.mah # @@ -435,8 +436,8 @@ clean: .symbolic # @$(REMOVECOMMAND) *.smp @$(REMOVECOMMAND) *.SMP @$(REMOVECOMMAND) *.hed - @$(REMOVECOMMAND) *.MAP - @$(REMOVECOMMAND) *.map + @$(REMOVECOMMAND) *.MAH + @$(REMOVECOMMAND) *.mah @$(REMOVECOMMAND) *.err #@cd $(DOSLIB) #@./buildall.sh clean @@ -497,6 +498,7 @@ reinitlibs: .symbolic @wmake -h initlibs initlibs: .symbolic + @cp git_con.fig .git/config @cp git_modu.les .gitmodules @cd $(SRCLIB) @git clone https://github.com/joncampbell123/doslib.git diff --git a/src/16.c b/src/16.c index 27c17a58..990a2115 100755 --- a/src/16.c +++ b/src/16.c @@ -55,26 +55,28 @@ main(int argc, char *argv[]) //screen = modexDefaultPage(); engi_stat = ENGI_RUN; - //textInit(); + textInit(); /* save the palette */ dpal = modexNewPal(); modexPalSave(dpal); - modexFadeOff(4, dpal); +// modexFadeOff(4, dpal); //printf("pal load\n"); //gpal = modexNewPal(); /*modexPalSave(gpal); modexSavePalFile("data/g.pal", gpal);*/ - printf("wwww loop wwww\n"); +//0000 printf("wwww loop wwww\n"); VGAmodeX(1, 1, &gvar); - modexPalBlack(); //so player will not see loadings~ +// modexPalBlack(); //so player will not see loadings~ IN_Startup(); IN_Default(0,&player,ctrl_Joystick); //modexprint(&screen, 32, 32, 1, 2, 0, "a", 1); + start_timer(&gvar); while(ENGI_EXIT != engi_stat) { IN_ReadControl(0,&player); if(IN_KeyDown(sc_Escape)) engi_stat = ENGI_EXIT; + shinku(&gvar); } switch(detectcpu()) { @@ -88,5 +90,5 @@ main(int argc, char *argv[]) printf("version %s\n", VERSION); printf("detected CPU type: %s\n", cpus); IN_Shutdown(); - modexFadeOn(4, dpal); +// modexFadeOn(4, dpal); } diff --git a/src/16.h b/src/16.h index b12b1a7d..bb870326 100755 --- a/src/16.h +++ b/src/16.h @@ -27,7 +27,9 @@ #include "src/lib/16_in.h" #include "src/lib/modex16.h" #include "src/lib/wcpu/wcpu.h" -#include "src/lib/planar.h" +//#include "src/lib/planar.h" +#include "src/lib/scroll16.h" +#include "src/lib/16_timer.h" typedef enum { ENGI_EXIT, diff --git a/src/fontgfx.c b/src/fontgfx.c index 50427a3a..90e6a869 100755 --- a/src/fontgfx.c +++ b/src/fontgfx.c @@ -28,13 +28,11 @@ #include #include #include -#include global_game_variables_t gvar; void main(int argc, char near *argv[]) { - struct vga_mode_params cm; //JMOJI static byte e; //word ri; @@ -96,7 +94,6 @@ IIIIIII BBBBBBBBB MMMM M MMMM\n\ gvar.video.page[0].width += (16*2); gvar.video.page[0].height += (16*2); modexShowPage(&gvar.video.page[0]); - vga_read_crtc_mode(&cm); // NTS: We're in Mode-X now. printf() is useless. Do not use printf(). Or INT 10h text printing. Or DOS console output. //modexprint(16, 16, 1, 15, "wwww"); //getch(); @@ -119,11 +116,13 @@ IIIIIII BBBBBBBBB MMMM M MMMM\n\ } sprintf(pee, "%zc", e); modexprint(&gvar.video.page[0], chx, chy, 1, 0, colpee, &e); - chx+=9; + chx+=8; colpee++; if(colpee>=32+24) colpee=32; } getch(); + modexprint(&gvar.video.page[0], gvar.video.page[0].width - (8*16)/*HACK: The rose ASCII is too wide for 320x240 so offset it to make sure the petals are visible*/, 8, 1, 45, 0, &rose); + getch(); //modexprint(100, 100, 1, 47, 0, "wwww"); // modexprint(0, 0, 1, 0, colpee, &rose); //++++ modexprint(&gvar.video.page[0], 0, 0, 0, 0, colpee, &ibmlogo); @@ -136,6 +135,4 @@ IIIIIII BBBBBBBBB MMMM M MMMM\n\ printf("\n%s\n", rose); //printf("\nh=%d\n", '8'); // printf("\n%c\n", e); - printf("cm.offset=%d\n", cm.offset); - printf("vga_state.vga_stride=%d\n", vga_state.vga_stride); } diff --git a/src/lib/16_timer.c b/src/lib/16_timer.c index c8416c79..0b5cf416 100755 --- a/src/lib/16_timer.c +++ b/src/lib/16_timer.c @@ -29,7 +29,7 @@ clock_t start_timer(global_game_variables_t *gv) gv->kurokku.clock_start = *clockw; gv->kurokku.clock = clockw; gv->kurokku.frames_per_second = 60; - gv->pee = _nmalloc(sizeof(byte)*2); + gv->pee = _nmalloc(sizeof(byte)*16); //turn this off if XT switch(detectcpu()) { diff --git a/src/lib/16text.c b/src/lib/16text.c index 95b307ef..81b71d98 100755 --- a/src/lib/16text.c +++ b/src/lib/16text.c @@ -31,6 +31,8 @@ static void getRomFontAddr(char fontNum, int index) { word fontOff; __asm { + PUSH AX + PUSH BX PUSH BP MOV AX, 0x1130 ;I can haz font info plz? MOV BH, fontNum ; where ur fontNum @@ -40,6 +42,8 @@ static void getRomFontAddr(char fontNum, int index) { POP BP ;u can haz ur frame back! MOV fontSeg, AX ;Storage MOV fontOff, BX ;Storage + POP BX + POP AX } romFonts[index].seg = fontSeg; romFonts[index].off = fontOff; diff --git a/src/lib/doslib b/src/lib/doslib index 9990f0ad..ef2fcb68 160000 --- a/src/lib/doslib +++ b/src/lib/doslib @@ -1 +1 @@ -Subproject commit 9990f0adb22b4fed2598c8733172d131d1a412f2 +Subproject commit ef2fcb68ef3c2f9ab023bd455acf488fda73c6eb diff --git a/src/lib/modex16.c b/src/lib/modex16.c index cab13766..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; @@ -880,8 +883,10 @@ byte modexgetPixel(page_t *page, int x, int y) void modexprint(page_t *page, word x, word y, word t, word col, word bgcol, const byte *str) { word s, o, w; + word x_draw = x; word addr = (word) romFontsData.l; word addrq = (page->width/4) * y + (x / 4) + ((word)page->data); + word addrr = addrq; byte c; s=romFonts[t].seg; @@ -892,36 +897,23 @@ void modexprint(page_t *page, word x, word y, word t, word col, word bgcol, cons for(; *str != '\0'; str++) { c = (*str); - if((c=='\n'/* || c=="\ -"*/) || romFontsData.chw ->=page->width) + if(c=='\n') { - romFontsData.chw=0; - y+=romFonts[t].charSize; + x = x_draw; + romFontsData.chw = 0; + addrq += (page->width / 4) * 8; + addrr = addrq; + y += 8; continue; } - //load the letter 'A' - __asm { - MOV DI, addr - MOV SI, o - MOV ES, s - SUB AH, AH - MOV AL, c ; the letter - MOV CX, w - MUL CX - ADD SI, AX ;the address of charcter - L1: MOV AX, ES:SI - MOV DS:DI, AX - INC SI - INC DI - DEC CX - JNZ L1 - } -//TODO: OPTIMIZE THIS!!!! - modexDrawCharPBuf(page, x/*for mode X planar use*/, y/*redunant, remove*/, t, col, bgcol, addrq); - addrq += 2; /* move 8 pixels over (2 x 4 planar pixels per byte) */ - //if(!q) getch(); + // 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+(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) */ } } @@ -1030,7 +1022,7 @@ void modexcls(page_t *page, byte color, byte *Where) _fmemset(Where, color, page->width*(page->height)/4); } -/*void +void modexWaitBorder() { while(inp(INPUT_STATUS_1) & 8) { // spin @@ -1039,7 +1031,7 @@ modexWaitBorder() { while(!(inp(INPUT_STATUS_1) & 8)) { // spin } -}*/ +} void bios_cls() { VGA_ALPHA_PTR ap; diff --git a/src/lib/modex16.h b/src/lib/modex16.h index f85eb055..98551f48 100755 --- a/src/lib/modex16.h +++ b/src/lib/modex16.h @@ -180,7 +180,7 @@ void modexprint(page_t *page, word x, word y, word t, word col, word bgcol, cons void modexprintbig(page_t *page, word x, word y, word t, word col, word bgcol, const byte *str); void modexpdump(page_t *pee); void modexcls(page_t *page, byte color, byte *Where); -//void modexWaitBorder(); +void modexWaitBorder(); void bios_cls(); #endif diff --git a/src/lib/modex16/16render.c b/src/lib/modex16/16render.c index 8e6fa436..77598fa5 100755 --- a/src/lib/modex16/16render.c +++ b/src/lib/modex16/16render.c @@ -435,14 +435,15 @@ modexDrawSpritePBufRegion(page_t *page, int x, int y, } } -void modexDrawCharPBuf(page_t *page, int x/*for planar selection only*/, int y/*redundant, remove*/, word t, word col, word bgcol, word addr) +void modexDrawChar(page_t *page, int x/*for planar selection only*/, word t, word col, word bgcol, word addr) { /* vertical drawing routine by joncampbell123. * * optimize for VGA mode X planar memory to minimize the number of times we do I/O write to map mask register. * so, we enumerate over columns (not rows!) to draw every 4th pixel. bit masks are used because of the font bitmap. - * + * * NTS: addr defines what VGA memory address we use, "x" is redundant except to specify which of the 4 pixels we select in the map mask register. */ + word rows = romFonts[t].charSize; word drawaddr; word colm, row; byte fontbyte; @@ -455,7 +456,7 @@ void modexDrawCharPBuf(page_t *page, int x/*for planar selection only*/, int y/* for (colm=0;colm < 4;colm++) { drawaddr = addr; modexSelectPlane(PLANE(plane)); - for (row=0;row < 8;row++) { + for (row=0;row < rows;row++) { fontbyte = romFontsData.l[row]; vga_state.vga_graphics_ram[drawaddr ] = (fontbyte & m1) ? col : bgcol; vga_state.vga_graphics_ram[drawaddr+1] = (fontbyte & m2) ? col : bgcol; diff --git a/src/lib/modex16/16render.h b/src/lib/modex16/16render.h index abf8f1f5..f45fd76d 100755 --- a/src/lib/modex16/16render.h +++ b/src/lib/modex16/16render.h @@ -36,6 +36,6 @@ void modexDrawBmpPBuf(page_t *page, int x, int y, planar_buf_t *bmp); /*pbuf ver void modexDrawBmpPBufRegion(page_t *page, int x, int y, int rx, int ry, int rw, int rh, planar_buf_t *bmp); void modexDrawSpritePBuf(page_t *page, int x, int y, planar_buf_t *bmp); void modexDrawSpritePBufRegion(page_t *page, int x, int y, int rx, int ry, int rw, int rh, planar_buf_t *bmp); -void modexDrawCharPBuf(page_t *page, int x, int y, word t, word col, word bgcol, word addr); +void modexDrawChar(page_t *page, int x/*for planar selection only*/, word t, word col, word bgcol, word addr); #endif diff --git a/src/lib/scroll16.c b/src/lib/scroll16.c index e9a9fc15..1780d960 100755 --- a/src/lib/scroll16.c +++ b/src/lib/scroll16.c @@ -586,22 +586,26 @@ void mapDrawWCol(map_view_t *mv, int tx, int ty, word x) //setkb(0); }*/ +unsigned char shinku_fps_indicator_page = 0; + /* sync */ -void shinku(map_view_t *pip, global_game_variables_t *gv) +void shinku(global_game_variables_t *gv) { - //float t; //modexCopyPageRegion(pip[1].page, pip[2].page, 16, 16, 16, 16, (14*8)+4, 8+4); if(elapsed_timer(gv) >= (1.0 / gv->kurokku.frames_per_second)) { - word x = (16); - word y = (8+16); - word col = 15; + word x = (16) + gv->video.page[shinku_fps_indicator_page].dx; // follow the screen + word y = (16) + gv->video.page[shinku_fps_indicator_page].dy; // follow the screen + 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", gv->pee); - //modexprint(pip[1].page, 16, 16, 1, 15, 0, gv->pee); +// printf("%s\n", gv->pee); + //FIXME PLEASE!! + modexprint(&(gv->video.page[shinku_fps_indicator_page]), 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; } @@ -615,8 +619,8 @@ void shinku(map_view_t *pip, global_game_variables_t *gv) break; case 1: //turn this off if XT - //modexWaitBorder(); - vga_wait_for_vsync(); + modexWaitBorder(); + //vga_wait_for_vsync(); gv->kurokku.frames_per_second=60; break; } diff --git a/src/lib/scroll16.h b/src/lib/scroll16.h index 77065af9..d3711b5e 100755 --- a/src/lib/scroll16.h +++ b/src/lib/scroll16.h @@ -37,7 +37,6 @@ #include #include #include -#include //#define SPRITE //#define TILERENDER @@ -79,7 +78,9 @@ void near mapDrawCol(map_view_t *mv, int tx, int ty, word x, player_t *p, word p void mapDrawWRow(map_view_t *mv, int tx, int ty, word y); void mapDrawWCol(map_view_t *mv, int tx, int ty, word x); //void qclean(); -void shinku(map_view_t *pip, global_game_variables_t *gv); +void shinku(global_game_variables_t *gv); void near animatePlayer(map_view_t *pip, player_t *player, word playnum, sword scrollswitch); +extern unsigned char shinku_fps_indicator_page; + #endif /*__SCROLL16_H_*/ diff --git a/src/scroll.c b/src/scroll.c index b1b9d5ae..d13d7d01 100755 --- a/src/scroll.c +++ b/src/scroll.c @@ -134,7 +134,7 @@ void main(int argc, char *argv[]) modexFadeOff(4, dpal); #endif - //textInit(); + textInit(); VGAmodeX(bakapee, 1, &gvar); // printf("%dx%d\n", gvar.video.page[0].sw, gvar.video.page[0].sh); #ifdef FADE @@ -194,6 +194,7 @@ void main(int argc, char *argv[]) #endif modexShowPage(mv[1].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); #ifdef MODEX #ifdef FADE @@ -202,7 +203,7 @@ void main(int argc, char *argv[]) #endif while(!IN_KeyDown(sc_Escape) && player[0].hp>0) { - shinku(mv, &gvar); + shinku(&gvar); IN_ReadControl(0,&player); //top left corner & bottem right corner of map veiw be set as map edge trigger since maps are actually square //to stop scrolling and have the player position data move to the edge of the screen with respect to the direction diff --git a/ud.sh b/ud.sh index dd8c64f3..e2869033 100755 --- a/ud.sh +++ b/ud.sh @@ -1,2 +1,6 @@ +rm pcx2vrl +rm pcxsscut +rm vrl2vrs +rm vrsdump git pull wmake -h uplibs