Posts: 42
Threads: 14
Joined: Dec 2004
What are some other ways to print text on the screen without using PRINT? The program I am making requires the speed to print text in several different places without have to LOCATE the area because that way is too slow.
Posts: 2,765
Threads: 138
Joined: Nov 2002
pictures?
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Posts: 3,522
Threads: 189
Joined: Dec 2003
DEF SEG = &HB800
And then POKE X+Y*ScrWidth, chrasciivalue
Actually, I think every second byte is the color value, not sure though.
Posts: 3,279
Threads: 170
Joined: Nov 2003
Quote:Actually, I think every second byte is the color value, not sure though.
Indeed it is.
I'd knock on wood, but my desk is particle board.
Posts: 6,419
Threads: 74
Joined: Mar 2002
Quote:DEF SEG = &HB800
And then POKE X+Y*ScrWidth, chrasciivalue
Actually, I think every second byte is the color value, not sure though.
In fact it is
POKE 2*x + 160*y, charascii and
POKE 2*x+1 + 160*y, charattribute.
Posts: 42
Threads: 14
Joined: Dec 2004
Is there a way similar to that for printing strings? I need an alterative way of printing because doing LOCATE then PRINT is not applicable in my program. I know theres a method using ASM called FastPrint in Pete's QBasic Site but it is very hard to understand, since the article was written in the 80's.
Posts: 3,279
Threads: 170
Joined: Nov 2003
Once you understand how strings work, you should be able to figure it out on your own how to use that technique.
I'd knock on wood, but my desk is particle board.
Posts: 480
Threads: 24
Joined: Mar 2003
edit: I re-read the original post and see now that the problem is speed.
Out of curiosity, how would LOCATE + PRINT be not applicable in a program? I'm sure it's possible, I just can't think of anything off the top of my head. If you are concerned about relocating the cursor, you can always store the current cursor position and reset them after printing.
*peace*
Meg.
Posts: 3,522
Threads: 189
Joined: Dec 2003
Jotz, are you using Screen 0? If not, DEF SEG = &HB800 wont work.
But screen 0 should be fast enough to use locate: print
Posts: 42
Threads: 14
Joined: Dec 2004
I am making a level editing program in SCREEN 0. What I did was make an array of strings for each row. Then whenever a block was placed on the map, it would redraw the row it was on. I added a "draw mode" so that when you move the cursor, it will automatically place the blocks. When I do the draw mode, you can sometimes see the cursor on the left printing the row blink. By the way, I am using FreeBasic, but I don't think that would make much of a difference.
I understand how to POKE text onto the screen. Would it be faster to print each block individually using POKE? Unless there is a way to POKE strings, that would be awesome. Also, the thing I didn't understand was the ASM tutorial on FastPrint:
http://www.petesqbsite.com/sections/tuto...tprint.txt