X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Ffontgfx.c;h=6f792549977414bca2ca599b5b1457b3efcf8623;hb=a565be31ce92d6168ae6983042da75b0b683e52b;hp=08968076a82c4e3f110448e45e8a228200d16ce0;hpb=4a133bcbccc48ae5f9e2edb3e9db5fad3e01bb83;p=16.git diff --git a/src/fontgfx.c b/src/fontgfx.c index 08968076..6f792549 100755 --- a/src/fontgfx.c +++ b/src/fontgfx.c @@ -1,5 +1,5 @@ /* Project 16 Source Code~ - * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123 + * Copyright (C) 2012-2019 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover * * This file is part of Project 16. * @@ -21,24 +21,21 @@ */ #include #include -#include "lib/types.h" +#include "src/lib/16_t.h" //#include "lib/16text.h" -#include "lib/modex16.h" +#include "src/lib/16_vl.h" #include #include #include -#include - -global_game_variables_t gvar; void main(int argc, char near *argv[]) { - struct vga_mode_params cm; + static global_game_variables_t gvar; //JMOJI static byte e; //word ri; - byte pee[2]; + byte pee[6]; // must be large enough for sprintf("%zc",...) and sprintf("%u",(byte value)) static byte ibmlogo[]="IIIIIII BBBBBBBBB MMMMM MMMMM\n\ IIIIIII BBBBBBBBBBB MMMMMM MMMMMM\n\ III BBB BBB MMMMMM MMMMMM\n\ @@ -67,8 +64,7 @@ IIIIIII BBBBBBBBB MMMM M MMMM\n\ ,'___...---~~~\n\ "; // static byte *rosa; -// static word chx;//, chy, colpee; - static word z; + static word chx, chy, colpee, addr; textInit(); // DOSLIB: check our environment @@ -92,63 +88,47 @@ IIIIIII BBBBBBBBB MMMM M MMMM\n\ return; } VGAmodeX(1, 1, &gvar); -// __asm{ -// mov AH,12H -// mov BL,30h -// mov AL,04h -// int 10 -// mov ax,1123h -// int 10h -// ;mov ax,1112h ; load 8x8 character set into RAM -// ;int 10h -// } /* setup camera and screen~ */ gvar.video.page[0] = modexDefaultPage(&gvar.video.page[0]); gvar.video.page[0].width += (16*2); gvar.video.page[0].height += (16*2); - //modexShowPage(&gvar.video.page[0]); + modexShowPage(&gvar.video.page[0]); + // 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(); -// chx=0; -// chy=0; -// colpee=32; - bios_cls(); + chx=0; + chy=0; + colpee=32; /* position the cursor to home */ - vga_moveto(0,0); - vga_sync_bios_cursor(); - for(e=0x00, z=0; e<=0xFE; e++, z++) +// vga_moveto(0,0); +// vga_sync_bios_cursor(); + for(e=0x00; e<=0xFE; e++) { - //if(chx+8>(gvar.video.page[0].width/2)) - if((z)+1>16) + if(chx+8>(gvar.video.page[0].width/2)) { -// chx=0; -// chy+=8; -// sprintf(pee,"%u", colpee); -// modexprint(&gvar.video.page[0], 200, 200, 1, 47, 0, &pee, 1); - z=0; - printf("\n"); + chx=0; + chy+=8; + sprintf(pee,"%u", colpee); + modexprint(&gvar.video.page[0], 200, 200, 1, 47, 0, &pee); //getch(); } - printf("%zc", e); -// modexprint(&gvar.video.page[0], chx, chy, 1, 0, colpee, &e, 1); -// chx+=9; -// colpee++; -// if(colpee>=32+24) colpee=32; + sprintf(pee, "%zc", e); + modexprint(&gvar.video.page[0], chx, chy, 1, 0, colpee, &e); + chx+=8; + colpee++; + if(colpee>=32+24) colpee=32; } - //modexprint(100, 100, 1, 47, 0, "wwww"); 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); // modexprintbig(&gvar.video.page[0], 0, 0, 1, colpee, 0, "IBM"); // modexprint(0, 0, 1, 0, colpee, ROSE); //++++ getch(); - vga_read_crtc_mode(&cm); VGAmodeX(0, 1, &gvar); -// rosa=malloc(sizeof(ROSE)); -// (*rosa)=(byte)ROSE; 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); }