QB64.org Forum

Active Forums => QB64 Discussion => Topic started by: johnno56 on September 18, 2020, 06:27:58 am

Title: ASCII characters
Post by: johnno56 on September 18, 2020, 06:27:58 am
A quick question.

Does QB64 have the ability to temporarily redefine acsii characters? The old BBC Micro, Amstrad and I think the ZX Spectrum could redefine an 8x8 character. I think it was done that way because it would have been quicker to "print" a character than plot 64 pixels... I could be wrong... Just need to know if QB64 can do the same? If so how?

J
Title: Re: ASCII characters
Post by: FellippeHeitor on September 18, 2020, 06:50:51 am
Yes.

Let me find Cobalt's post with the code, one moment.
Title: Re: ASCII characters
Post by: FellippeHeitor on September 18, 2020, 06:53:19 am
There: https://www.qb64.org/forum/index.php?topic=2911.0
Title: Re: ASCII characters
Post by: FellippeHeitor on September 18, 2020, 08:54:01 am
Although cumbersome, it ends up being more practical to just use PRINT instead of PSET in a loop. However, just so you know, PRINT does use PSET internally anyway. That means there's likely no increase in performance at all.
Title: Re: ASCII characters
Post by: SMcNeill on September 18, 2020, 10:33:33 am
From my testing, you can PSET letters faster than you can PRINT them.  ;)
Title: Re: ASCII characters
Post by: STxAxTIC on September 18, 2020, 10:47:17 am
I was completely ignorant to this, haha. Makes sense though from a perspective of unified graphics.
Title: Re: ASCII characters
Post by: bplus on September 18, 2020, 11:24:21 am
Character Editor:

Create your own set of characters from ASCII, they are drawn so can scale sizes. Code can be adapted to 8X8 if anyone interested.
https://www.qb64.org/forum/index.php?topic=498.msg3498#msg3498

and it wouldn't be hard at all to devise a special "print" command for them!

and it wouldn't be hard to devise special Color command for them either.

;-)) EDIT: I suppose it doesn't inspire confidence if I don't know how to spell ASCII
Title: Re: ASCII characters
Post by: SMcNeill on September 18, 2020, 02:07:21 pm
https://qb64.freeforums.net/thread/37/custom-routines-supports-textures-shading

In the demo above, we map characters to a graphic array, and PSET them to screen, according to our textures, shading, or whatnot — and it’s quite a bit faster than PRINT or _PRINTSTRING.  QB64’s PRINT is a very slow processing command, from my experience.

https://i.ibb.co/SmMSc76/Custom-Text2-08-01-09-20-07.jpg
Title: Re: ASCII characters
Post by: johnno56 on September 18, 2020, 06:37:57 pm
Thanks guys. So, that is a 'yes', to redefining ASCII characters?  Cool

Steve, back in the mid-80's when I owned an Amstrad, CPU's were maybe 3 to 4 mhz. Watching how painfully slow it drew circles (not filled), printing then was faster... Back then, if I wanted multiple colours, each colour would be layered... slowed the beast down a bit, but coloured none the less... I miss my old Amstrad... *sigh*