Qbasicnews.com

Full Version: Zeros without diagonal line
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
This probably has been asked before, but how do I make 'zeros' appear onscreen without the diagonal line through them?

Thanks!
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.
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.
*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]
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