Author Topic: ASCII characters  (Read 262 times)

Offline johnno56

  • Forum Resident
  • Posts: 897
  • Live long and prosper.
ASCII characters
« 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
Logic is the beginning of wisdom.

Online FellippeHeitor

  • QB64 Developer
  • Forum Resident
  • Posts: 2411
  • LET IT = BE
    • QB64.org
Re: ASCII characters
« Reply #1 on: September 18, 2020, 06:50:51 AM »
Yes.

Let me find Cobalt's post with the code, one moment.

Online FellippeHeitor

  • QB64 Developer
  • Forum Resident
  • Posts: 2411
  • LET IT = BE
    • QB64.org
Re: ASCII characters
« Reply #2 on: September 18, 2020, 06:53:19 AM »

Online FellippeHeitor

  • QB64 Developer
  • Forum Resident
  • Posts: 2411
  • LET IT = BE
    • QB64.org
Re: ASCII characters
« Reply #3 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.

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 2782
    • Steve’s QB64 Archive Forum
Re: ASCII characters
« Reply #4 on: September 18, 2020, 10:33:33 AM »
From my testing, you can PSET letters faster than you can PRINT them.  ;)
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline STxAxTIC

  • Library Staff
  • Forum Resident
  • Posts: 856
  • Savage
    • WFBarnes
Re: ASCII characters
« Reply #5 on: September 18, 2020, 10:47:17 AM »
I was completely ignorant to this, haha. Makes sense though from a perspective of unified graphics.

Offline bplus

  • Forum Resident
  • Posts: 5300
  • B+ Knot again!
Re: ASCII characters
« Reply #6 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
« Last Edit: September 18, 2020, 01:20:39 PM by bplus »

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 2782
    • Steve’s QB64 Archive Forum
Re: ASCII characters
« Reply #7 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
« Last Edit: September 18, 2020, 02:21:09 PM by SMcNeill »
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline johnno56

  • Forum Resident
  • Posts: 897
  • Live long and prosper.
Re: ASCII characters
« Reply #8 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*
Logic is the beginning of wisdom.