Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Printing an updated screenful in one go
#4
(01-14-2021, 09:00 PM)boriel Wrote:
(01-12-2021, 09:43 PM)worcestersource Wrote: I've been experimenting this evening.

Curiously, making a big string full of control codes crashed when it got to so many lines. PRINTing it was also quite slow.

So, I've had a look at putchars() and paint() - thanks Britlion. I set up a pair of arrays and loop through this, putting a character to the screen, then its attribute, one at a time. This is much improved in terms of performance.

I think I'm starting to get somewhere. The array is probably a bit wasteful of memory, so I'm thinking I could construct the starting point to the screen, using putChars() and paint(), scroll it and fill in the gaps with putchars() and paint().

Sorry for rambling publicly!

Steve

Sorry, but I didn't understand what you're trying to achieve.
Also, yes, printing an entire screen is slow, use putchar. PRINT is a very generic routine (hence slow, because it has many features to emulate to be compatible with that of the Sinclair BASIC). Putchar just puts a char at a given coordinate. That's why it's faster. For example:
Code:
PRINT BOLD 1; "HELLO"
prints in BOLD letters (useful for score points, etc to make ROM fonts fancier without wasting memory); ITALIC 1 uses italic.

Not sure what you mean with arrays as a waste of memory: arrays take the amount of memory needed to store their information
Perhaps you mean to encode (i.e. compress) the information needed or use a different data structure? IMHO if you're using bits you're already compressing "columns" in bits so you're gaining x8 in size.

There are scroll routines (pixel by pixel and cell by cell).
Reply


Messages In This Thread
RE: Printing an updated screenful in one go - by boriel - 01-14-2021, 09:14 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)