Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
cprint and cfprint text mode routines
#11
(09-23-2023, 08:22 PM)bplus Wrote: Interesting how you did checking on/off with subs!

But you left out comparing to standard way with Color + Locate + Print

I am weighing the cost of extra lines of code for subs and ease of typing one line instead of 3 with standard 3 maybe try good ole CLP sub:

Sub CLP(fg, bg, row, col, text$)
color fg, bg
locate row, col
print text$;
end sub

Remember though, part of the idea here is: "without altering global color values or background colors".

For the "not alter global colors", you could:
OFG = _DEFAULTCOLOR
OBG = _BACKGROUNDCOLOR
....stuff
COLOR OFG, OBG
END SUB

But to maintain background colors, you'd need to get POINT (x, y)....

Which ends up with what's going on in these routines, but with _Mem commands.
Reply
#12
Well darn. I watch a movie with my wife, take a nap and take a look at the forum before working on making the routines a little faster...and the work has been done while I slept!  Thank you.

There a few other routines related to this I'm also working on that I can see how to speed up.
Reply
#13
Ha! best way to do "work". But is it work?
b = b + ...
Reply
#14
(09-23-2023, 10:01 PM)James D Jarvis Wrote: Well darn. I watch a movie with my wife, take a nap and take a look at the forum before working on making the routines a little faster...and the work has been done while I slept!  Thank you.

There a few other routines related to this I'm also working on that I can see how to speed up.

The best way to speed something up is to remove as much of it as possible from your loops.  Look at the math in your loops with those MEMPUT statements, and then look at mine.  See the difference in number of calculations we end up doing?
Reply
#15
Quote:Remember though, part of the idea here is: "without altering global color values or background colors".

Oops yes OK but honestly I don't see why. If I had a color, locate and print text line why would I do it the long way ever again ;-)) In screen 0 that's all you can do is print Text or _PutImages with hardware?
b = b + ...
Reply




Users browsing this thread: 3 Guest(s)