Qbasicnews.com
April 09, 2020, 07:44:04 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
 
   Home   Help Search Login Register  
Pages: 1 [2]
  Print  
Author Topic: Black box around text  (Read 5167 times)
Plasma
Na_th_an
*****
Posts: 1770


WWW
« Reply #15 on: October 29, 2003, 02:23:04 AM »

B800h is where the display buffer starts for color text modes.
Logged
Neo
Na_th_an
*****
Posts: 2150



« Reply #16 on: October 29, 2003, 06:28:06 AM »

2 bytes for each char, a char and a colour. Wasn't it? Ah yes, it was. I learned very much by analysing the Digital Reality code... Wink
Logged
TheBigBasicQ
*/-\*
*****
Posts: 4550



WWW
« Reply #17 on: October 29, 2003, 09:49:26 AM »

Quote from: "oracle"
BAD TBBQ: by posting that message you made it impossible for Neo to delete his message!! Tongue


Like you posted this message which made it impossible for me to delete my message so in turn you made it impossible for Neo to delete his message  :wink:.
Logged
ak00ma
Ancient Guru
****
Posts: 669



« Reply #18 on: October 29, 2003, 11:58:38 AM »

Try this:
Code:

SUB QQB.Font (xpos, ypos, text$, col, Bcol, Style)
xx = xpos - 1
yy = ypos
IF Style AND 4 THEN
    QQB.Font xpos - 1, ypos - 1, text$, Bcol, 0, Style - 4
END IF
FOR chr = 1 TO LEN(text$)
    xx = xx + 8
    Ptr = 8 * ASC(MID$(text$, chr, 1)) + &HE
    FOR l = 0 TO 7
        DEF SEG = &HFFA6
            BitPattern = PEEK(Ptr + l)
        DEF SEG
        IF Style AND 2 THEN
             IF BitPattern AND 1 THEN PSET (xx + (7 - (l \ 2)), yy + l), col - (7 - l) * (Style AND 1)
             IF BitPattern AND 2 THEN PSET (xx + (7 - (l \ 2)) - 1, yy + l), col - (7 - l) * (Style AND 1)
             IF BitPattern AND 4 THEN PSET (xx + (7 - (l \ 2)) - 2, yy + l), col - (7 - l) * (Style AND 1)
             IF BitPattern AND 8 THEN PSET (xx + (7 - (l \ 2)) - 3, yy + l), col - (7 - l) * (Style AND 1)
             IF BitPattern AND 16 THEN PSET (xx + (7 - (l \ 2)) - 4, yy + l), col - (7 - l) * (Style AND 1)
             IF BitPattern AND 32 THEN PSET (xx + (7 - (l \ 2)) - 5, yy + l), col - (7 - l) * (Style AND 1)
             IF BitPattern AND 64 THEN PSET (xx + (7 - (l \ 2)) - 6, yy + l), col - (7 - l) * (Style AND 1)
             IF BitPattern AND 128 THEN PSET (xx + (7 - (l \ 2)) - 7, yy + l), col - (7 - l) * (Style AND 1)
             IF Style AND 8 AND l = 7 THEN PSET (xx + (7 - (l \ 2)) - 7, yy + l), col - (7 - l) * (Style AND 1)
         ELSE
             IF BitPattern AND 1 THEN PSET (xx, yy + l), col - (7 - l) * (Style AND 1)
             IF BitPattern AND 2 THEN PSET (xx - 1, yy + l), col - (7 - l) * (Style AND 1)
             IF BitPattern AND 4 THEN PSET (xx - 2, yy + l), col - (7 - l) * (Style AND 1)
             IF BitPattern AND 8 THEN PSET (xx - 3, yy + l), col - (7 - l) * (Style AND 1)
             IF BitPattern AND 16 THEN PSET (xx - 4, yy + l), col - (7 - l) * (Style AND 1)
             IF BitPattern AND 32 THEN PSET (xx - 5, yy + l), col - (7 - l) * (Style AND 1)
             IF BitPattern AND 64 THEN PSET (xx - 6, yy + l), col - (7 - l) * (Style AND 1)
             IF BitPattern AND 128 THEN PSET (xx - 7, yy + l), col - (7 - l) * (Style AND 1)
             IF Style AND 8 AND l = 7 THEN PSET (xx - 7, yy + l), col - (7 - l) * (Style AND 1)
         END IF
    NEXT l
NEXT chr

END SUB
Logged

B 4 EVER
andy
Senior Member
**
Posts: 175



WWW
« Reply #19 on: October 29, 2003, 12:18:58 PM »

Thanks, its amazing that something so simple takes so much code.
Logged

eminiscing about trapezoids in conjunction with stratospherical parabolas:

No questions asked.

www.stickskate.com
ak00ma
Ancient Guru
****
Posts: 669



« Reply #20 on: October 29, 2003, 12:57:20 PM »

With my code you can even print text italic and bold
Logged

B 4 EVER
KiZ
__/--\__
*****
Posts: 2879


WWW
« Reply #21 on: October 29, 2003, 01:31:55 PM »

Quote from: "TheBigBasicQ"
Quote from: "oracle"
BAD TBBQ: by posting that message you made it impossible for Neo to delete his message!! Tongue


Like you posted this message which made it impossible for me to delete my message so in turn you made it impossible for Neo to delete his message  :wink:.


 :rotfl:
Logged
andy
Senior Member
**
Posts: 175



WWW
« Reply #22 on: October 31, 2003, 04:54:06 PM »

Thanks again plasma, but how does it work. I see that your drawing, each character ata a time and each line at atime, but it just doesn't make snse to me. And what does DEF SEG do?
Logged

eminiscing about trapezoids in conjunction with stratospherical parabolas:

No questions asked.

www.stickskate.com
Plasma
Na_th_an
*****
Posts: 1770


WWW
« Reply #23 on: October 31, 2003, 06:04:53 PM »

Character data for the default fonts (8x8, 8x16, and sometimes 8x14) is stored in ROM. For 8x8 it's accessable at F000:FA6E.

The font is stored one bit for each pixel. Since there's 8 pixels in a row, each row takes a byte. There's 8 rows in a character (in 8x8, for 8x16 there's 16 rows), so one character is 8 bytes. The characters are in order from 0 to 255.

My function just checks to see what bits are set in a row and translates them to pixels, then moves on to the next row.

DEF SEG sets the segment used by PEEK and POKE. You have to use DEF SEG to switch the segment back and forth between ROM (F000) and the video buffer (A000).
Logged
SCM
Wandering Guru
***
Posts: 311



« Reply #24 on: November 01, 2003, 12:34:12 AM »

Where does the 8x16 data start?
Logged

hrist Jesus came into the world to save sinners, of whom I am first.(I Timothy 1:15)

For God so loved the world, that He gave His only begotten Son,
that whoever believes in Him should not perish, but have eternal life.(John 3:16)
Plasma
Na_th_an
*****
Posts: 1770


WWW
« Reply #25 on: November 01, 2003, 04:30:21 AM »

I don't think there is a fixed position for the other fonts. You can get the location by calling interrupt 10 AX=1130h though.
Logged
webberboy
Member
*
Posts: 95



WWW
« Reply #26 on: November 13, 2003, 02:07:47 AM »

check out my text program:
http://www.network54.com/Hide/Forum/message?forumid=178387&messageid=1064853048

use textmake.bas to create the color stencils for text.bas.  use text.bas to write with the different colors.  Make sure that both files and the files you create are all in the same directory, or it won't work.
Logged

url=http://webberboy.no-ip.com]Fine Hand-Crafted Pens[/url]
Pneumonoultramicroscopicsilicovolcanoconiosis:  Noun, A hypothetical, invented disease of the lungs, caused by inhaling mineral or metallic dust, such as silicon and quartzite, over a long period.]
Pages: 1 [2]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!