Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Screen 13 small fonts
#11
It doesn't work for me, fb identifies "DEF SEG" as an error.
Reply
#12
hmm, same here... :-?
Itch-Five Design - Your source for free, well designed, web design.
- - - - - - - - - - - - -
Quote:I use QB religiously. Too bad I'm an athiest.
Reply
#13
Because that is a QB program.
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#14
Quote:Because that is a QB program.

Oh... that would make sense, maybe I'll try it in qb then.
Reply
#15
Was that post necessary?
Reply
#16
It's QB projects forum, isn't? Big Grin
Antoni
Reply
#17
Quote:It's QB projects forum, isn't? Big Grin
Oh, the irony! :lol:
\__/)
(='.'=) Copy bunny into your signature to
(")_(") help him gain world domination.
Reply
#18
Quote:Torahteen: He's speaking about Screen 13, not console.

Even so, there is no way to change the default fonts used by the QBasic or FreeBasic "PRINT" statment :wink:.
quote="Deleter"]judging gameplay, you can adaquately compare quake 4 with pong[/quote]
Reply
#19
I guess it being in QB Projects does make sense, I'm so use to fb now, I forgot about QB for a while, then the quicklaunch and that post reminded me. Anyway back on topic, I guess the only ture way would be to make your own font in sprites, and just put them where there needed.
Reply
#20
Quote:
Antoni Gual Wrote:Torahteen: He's speaking about Screen 13, not console.

Even so, there is no way to change the default fonts used by the QBasic or FreeBasic "PRINT" statment :wink:.

Yeah, there is in QBasic Smile You can play with the VGA BIOS to do some nice stuff with your charset in text mode. You can even use two charsets at the same time. I sent some code which did some nice tricks to lurah from ASCII world, I dunno if they have uploaded it yet Smile

Check http://usuarios.lycos.es/firstqbasicforu...nadya.html -> It's text mode. Just peek at the sources Smile This thingo replaces the font for another one which contains small 1 bit tiles I can use to build "graphics" with.

Loading 2 charsets at a time is also possible:


Code:
DECLARE SUB LoadCharInMap (file$, Map%)
DECLARE SUB BlockBitPlane2 ()
DECLARE SUB UnBlockBitPlane2 ()
DECLARE SUB SelectMaps (Map0%, Map1%)
DECLARE SUB OutPortW (dir%, a%)
'$INCLUDE: 'QB.BI'

SUB BlockBitPlane2
    EgaVgaSequencer% = &H3C4
    EgaVgaGraphCtr% = &H3CE
    OutPortW EgaVgaSequencer%, &H100
    OutPortW EgaVgaSequencer%, &H402
    OutPortW EgaVgaSequencer%, &H704
    OutPortW EgaVgaSequencer%, &H300
    OutPortW EgaVgaGraphCtr%, &H204
    OutPortW EgaVgaGraphCtr%, &H5
    OutPortW EgaVgaGraphCtr%, &H6
END SUB

SUB LoadCharInMap (file$, Map%)
    d$ = CHR$(0)
    aBase% = &H4000 * Map%
    DEF SEG = &HA000
    f% = FREEFILE
    OPEN file$ FOR BINARY AS #f%
    FOR i% = 0 TO 255
        FOR j% = 0 TO 15
            GET #f%, , d$
            POKE aBase% + j%, ASC(d$)
        NEXT j%
        aBase% = aBase% + 32
    NEXT i%
    CLOSE #f%
    DEF SEG
END SUB

SUB OutPortW (dir%, a%)
    OUT dir%, a% AND 255
    OUT dir% + 1, a% \ 256
END SUB

SUB SelectMaps (Map0%, Map1%)
    DIM Regs AS RegType
    DIM OutPortWs AS RegType
    ' Bytes:
    Map0% = Map0% AND 255
    Map1% = Map1% AND 255
    ' Acceso a los registros
    Regs.ax = &H1103
    b% = (Map0% AND 3) + (Map0% AND 4) * 4
    c% = (Map1% AND 3) * 4 + (Map1% AND 4) * 8
    bc% = b% + c%
    Regs.bx = bc%
    INTERRUPT &H10, Regs, OutPortWs
END SUB

SUB UnBlockBitPlane2
    EgaVgaSequencer% = &H3C4
    EgaVgaGraphCtr% = &H3CE
    OutPortW EgaVgaSequencer%, &H100
    OutPortW EgaVgaSequencer%, &H302
    OutPortW EgaVgaSequencer%, &H304
    OutPortW EgaVgaSequencer%, &H300
    OutPortW EgaVgaGraphCtr%, &H4
    OutPortW EgaVgaGraphCtr%, &H1005
    OutPortW EgaVgaGraphCtr%, &HE06
END SUB

You use them with those 4Kb character files, I mean those who are just a raw copy of the 256 chars with 16 bytes per char, one per scanline per char (8x16 pixels per char text mode, i.e. the common VGA 80x25 text mode 03h). This is the modus operandi:

Code:
BlockBitPlane2
LoadCharInmap "font0.fnt", 0
LoadCharInmap "font1.fnt", 1
SelectMaps 0, 1
UnBlockBitPlane2

I can't remember the details (I have to look for the docs I read to figure this out), but all you have to know is that you have (I think to remember) four char maps 0 to 3. You have to block bitplane 2 using the BlockBitPlane2 sub, then load the chars in the maps you want (0,1,2 or 3), then you call to SelectMaps to select two maps (again 0,1,2 or 3) to be active, and then you unblock bitplane 2 using the UnBlockBitPlane2 sub.

To print using one or another character map, you use bit 3 from the colour attribute. If it is 0 you print the first selected char map. If it is 1, you print the second one.

Take a look at the "normal" colour attribute byte. It is set up this way:

Code:
bit 7 6 5 4 3 2 1 0
    F B B B F F F F

F = blink bit
BBB = background colour, 0 to 7 (3 bits)
FFFF = foreground colour, 0 to 15 (4 bits)

Using this tweak, the colour attribute byte is set up this way:

Code:
bit 7 6 5 4 3 2 1 0
    F B B B C F F F

F = blink bit
BBB = background colour, 0 to 7 (3 bits)
C = charset selector bit (0 = font 0, 1 = font 1)
FFF = foreground colour, 0 to 7 (3 bits)

That means that you no longer have 16 colours, but 8. That way, to print a red A over blue background using font 0 you use COLOR 2, 1 (i.e. 00010010) and to print that red A over blue background using font 1 you use COLOR 10, 1 (i.e. 00011010). Odd but cool Big Grin

--

I'm thinking on creating and formatting a nice article for QBExpress and for the QBN FAQ. When I find the time I'll gather my routines together Smile
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)