Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- '$INCLUDE: 'QBX.BI'
- DIM InRegs AS RegTypeX, OutRegs AS RegTypeX
- DIM FontPtr AS LONG, BytePtr AS LONG
- DEFINT A-Z
- SCREEN 13
- 'INT 10h function AX=1130h will return a pointer to a font table
- 'BH=3 is the table for 8x8 base characters (0-127)
- 'BH=4 is the table for 8x8 extended characters (128-255)
- InRegs.ax = &H1130: InRegs.bx = &H300
- CALL InterruptX(&H10, InRegs, OutRegs)
- 'On Return:
- ' CX = bytes per character of on-screen font (not requested font)
- ' DL = rows (less 1)
- ' ES:BP = pointer to table
- LOCATE 2
- PRINT "Bytes per character: " + HEX$(OutRegs.CX)
- PRINT "Rows per character: " + HEX$(OutRegs.DX + 1)
- PRINT "Font table at address: " + HEX$(OutRegs.ES) + ":" + HEX$(OutRegs.BP)
- DEF SEG = OutRegs.ES: FontPtr = OutRegs.BP
- DIM FontTable(7, 127) AS STRING * 1
- TestString$ = "AaBbCc1234$"
- StrPtr& = SADD(TestString$)
- FOR CharNum = 0 TO LEN(TestString$) - 1
- DEF SEG = SSEG(TestString$)
- Char = PEEK(StrPtr& + CharNum)
- PRINT CHR$(Char)
- BytePtr = FontPtr + (Char * 127)
- FOR ByteNum = 0 TO 8
- DEF SEG = OutRegs.ES
- Byte = PEEK(BytePtr + ByteNum)
- PSET (X + 0, Y), Byte AND 1
- PSET (X + 1, Y), (Byte AND 2) \ 2 'WHY NO SHR :(
- PSET (X + 2, Y), (Byte AND 4) \ 4
- PSET (X + 3, Y), (Byte AND 8) \ 5
- PSET (X + 4, Y), (Byte AND 16) \ 16
- PSET (X + 5, Y), (Byte AND 32) \ 32
- PSET (X + 6, Y), (Byte AND 64) \ 64
- PSET (X + 7, Y), (Byte AND 128) \ 128
- Y = Y + 1
- NEXT ByteNum
- Y = 0: X = X + 8
- SLEEP
- NEXT CharNum
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement