home *** CD-ROM | disk | FTP | other *** search
- '─ Area: F-QUICKBASIC ─────────────────────────────────────────────────────────
- ' Msg#: 375 Date: 18 Apr 94 15:20:00
- ' From: Saul Ansbacher Read: Yes Replied: No
- ' To: Howard Hull Jr Mark:
- ' Subj: Fast Character Printing
- '──────────────────────────────────────────────────────────────────────────────
- 'HHJ> I need a quick way to put characters on the current page in
- 'HHJ>screen mode 0. I've looked into a few memory swapping utils but they
- 'HHJ>didn't do what I needed them to do.
-
- 'HHJ> I know that the address of the color screen if &HB000 or
- 'HHJ>something like that. And that the individual screen positions are
- 'HHJ>accessable at certain offsets. So by poking information at those offsets
- 'HHJ>I can change the characters and attributes, but I just can't figure out
- 'HHJ>a quick meathod to do this.
-
- DECLARE SUB PrintRC (Strg$, Row, Col, Fg, Bg)
-
- CLS
- PrintRC "Hello silly people", 12, 1, 13, 1
- END
-
- SUB PrintRC (Strg$, Row, Col, Fg, Bg)
- Attr = Fg + Bg * 16
- DEF SEG = &HB800 ' B000 for monochrome systems
- Offset = (Row - 1) * 160 + (Col - 1) * 2
- FOR i = 1 TO LEN(Strg$)
- POKE Offset, ASC(MID$(Strg$, i, 1)): Offset = Offset + 1
- POKE Offset, Attr: Offset = Offset + 1
- NEXT
- DEF SEG
- END SUB
-
- 'The Strg$ can be any thing even non printable chars like chr(12) and
- 'things, it's really nice code. The day I needed to make just such a
- 'thing I came home and it was in my QWK packet, thanks to Matt Hart for
- 'posting it...
-
-