Qbasicnews.com
Zeros without diagonal line - Printable Version

+- Qbasicnews.com (http://qbasicnews.com/newforum)
+-- Forum: QBasic (http://qbasicnews.com/newforum/forum-4.html)
+--- Forum: QB Discussion & Programming Help (http://qbasicnews.com/newforum/forum-11.html)
+--- Thread: Zeros without diagonal line (/thread-445.html)



Zeros without diagonal line - aX*s - 03-17-2003

This probably has been asked before, but how do I make 'zeros' appear onscreen without the diagonal line through them?

Thanks!


Zeros without diagonal line - red_Marvin - 03-17-2003

As far as I know, you have to write your own font routine
or download a library that don't use the regular font:
The built in BIOS font.


Zeros without diagonal line - na_th_an - 03-17-2003

I wrote this function which loads a font file (4096 bytes) and activates it thru' a BIOS call:

Code:
SUB LoadAndSetFont (file$)
    DIM font%(2047)
    DIM r AS RegTypeX
    f% = FREEFILE
    OPEN file$ FOR BINARY AS #f%
    FOR i% = 0 TO 2047: GET #f%, , font%(i%): NEXT i%
    CLOSE #f%
    r.ax = &H1100
    r.bx = 16 * 256 + 0
    r.cx = 255
    r.dx = 0
    r.es = VARSEG(font%(0))
    r.bp = VARPTR(font%(0))
    CALL INTERRUPTX(&H10, r, r)
END SUB

Of course you'll need a 4KB font file. Those fonts file just contains each one of the 256 characters, each one described with 16 bytes (text mode chars are 8x16 pixels, so you need one byte for each row), in ASCII order.


Zeros without diagonal line - Hexadecimal Disaster - 03-18-2003

*laughs* *remembering good 'ol days*

Did you know how many lines of code were necessary to achieve the same thing in AtariBASIC? [Image: unhappy.gif] I had to understand r6502 machine code just to change several characters!




Oooh... I'm feeling old today... [Image: buck.gif]


Zeros without diagonal line - na_th_an - 03-19-2003

Smile In the ZX Spectrum it was so easy. You just loaded the new character set at a memory location and then poked positions 23606 and 23607 with that address in little endian Tongue