Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ASCII Graphics Challenge! :P
#5
Thanks, Neo Smile

Really cool routines. This library is really interesting. Adosorken, I love text mode stuff, if ya wanna I could try to help you providing some functions Wink I've seen the "future plans" section and I can provide the 512 characters mode and the extended text resolutions, as well as the custom character set loader.

---

This is my little set of routines to use the 512 characters mode and to load the customized char maps into VGA memory:

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

To use it you just do this:

Code:
BlockBitPlane2
LoadCharInMap "charset1.fnt", 0
LoadCharInMap "charset2.fnt", 1
SelectMaps 0, 1
UnBlockBitPlane2

... where charset1.fnt and charset2.fnt are standard 4096 bytes text-mode font files (all the 256 characters, 16 bytes each).

Now remember that with colour 0-7 you print with the charset1 font and with colour 8-15 you print with the charset2 font, so adjust your palettes.

If you, reader, don't know what the heck the 512 characters mode is, check this demo Right-click -> Save as

---

Edited once more: I can't work with the enhaced SVGA text modes 'cause my card doesn't seem to support them. I just call the interrupt and it does... nothing Tongue :o
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply


Messages In This Thread
ASCII Graphics Challenge! :P - by adosorken - 12-18-2003, 11:43 AM
ASCII Graphics Challenge! :P - by wildcard - 12-18-2003, 03:58 PM
ASCII Graphics Challenge! :P - by na_th_an - 12-18-2003, 05:25 PM
ASCII Graphics Challenge! :P - by Neo - 12-18-2003, 05:38 PM
ASCII Graphics Challenge! :P - by na_th_an - 12-18-2003, 06:35 PM
ASCII Graphics Challenge! :P - by Anonymous - 12-18-2003, 08:20 PM
ASCII Graphics Challenge! :P - by adosorken - 12-18-2003, 08:32 PM
ASCII Graphics Challenge! :P - by na_th_an - 12-18-2003, 09:05 PM
ASCII Graphics Challenge! :P - by adosorken - 12-18-2003, 09:27 PM
ASCII Graphics Challenge! :P - by barok - 12-19-2003, 04:07 AM
ASCII Graphics Challenge! :P - by Rhiannon - 12-19-2003, 05:01 AM
ASCII Graphics Challenge! :P - by oracle - 12-19-2003, 05:42 AM
ASCII Graphics Challenge! :P - by relsoft - 12-19-2003, 07:49 AM
ASCII Graphics Challenge! :P - by relsoft - 01-09-2004, 11:39 AM
ASCII Graphics Challenge! :P - by adosorken - 01-09-2004, 05:13 PM
ASCII Graphics Challenge! :P - by KiZ - 01-09-2004, 07:17 PM
ascii raycast - by ravenxau - 03-31-2004, 04:14 PM
ASCII Graphics Challenge! :P - by Spotted Cheetah - 04-03-2004, 04:01 AM
ASCII is NOT dead - by Pc72 - 04-05-2004, 01:46 AM
ASCII Graphics Challenge! :P - by Rhiannon - 04-05-2004, 04:07 AM
ASCII Graphics Challenge! :P - by speedlemon - 04-05-2004, 05:20 AM
ASCII Graphics Challenge! :P - by Spotted Cheetah - 04-05-2004, 09:37 PM
ASCII Graphics Challenge! :P - by adosorken - 04-11-2004, 07:02 AM
ASCII Graphics Challenge! :P - by Spotted Cheetah - 04-13-2004, 04:47 AM

Forum Jump:


Users browsing this thread: 2 Guest(s)