Author Topic: Redefine Characters  (Read 4256 times)

0 Members and 1 Guest are viewing this topic.

Offline johnno56

  • Forum Resident
  • Posts: 1270
  • Live long and prosper.
    • View Profile
Redefine Characters
« on: January 21, 2019, 05:42:22 pm »
A quick question:

Does QB64 have the ability to redefine ascii characters? I know the Microbee and the Amstrad could change characters. I think the purpose was that it is quicker to display a character than to plot an 8x8 graphic. (maybe not 'today', but back when the CPU's were 4mhz, speed was everything)

I need more coffee...

J
Logic is the beginning of wisdom.

FellippeHeitor

  • Guest
Re: Redefine Characters
« Reply #1 on: January 21, 2019, 05:48:28 pm »

Offline johnno56

  • Forum Resident
  • Posts: 1270
  • Live long and prosper.
    • View Profile
Re: Redefine Characters
« Reply #2 on: January 21, 2019, 10:39:59 pm »
There are some fine examples amongst that lot, thank you.

But from those examples, strictly speaking, I would probably guess that no, qb64 does not seem to have the ability and I'm ok with that. These days, with machines being WAY faster than the machines of the 80's-90's, scanning; modifying and plotting a character is 'normal' and seems to take little to no time to display the results.

But, wouldn't it be cool, if the ascii character could be tweaked and printed as ac ascii character? Ah the memories.

J

ps: Again. Thank you for the examples...
Logic is the beginning of wisdom.

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: Redefine Characters
« Reply #3 on: January 21, 2019, 11:46:50 pm »
My thoughts are no one wanted to bother putting this feature in QB64. Atari BASIC even had the ability to make your own 8x8 characters back in the 1980s. The ATARI statements probably poked the pixels into memory. I do recall you had to pick an ASCII character, and reassign it to your custom character. So print CHR$(1) could be made into a frame character by blacking out all the outside pixels of the 8x8 character matrix.

Pete
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

FellippeHeitor

  • Guest
Re: Redefine Characters
« Reply #4 on: January 22, 2019, 06:29:04 am »
There are some fine examples amongst that lot, thank you.

But from those examples, strictly speaking, I would probably guess that no, qb64 does not seem to have the ability and I'm ok with that

Cobalt’s example at https://www.qb64.org/forum/index.php?topic=498.msg3460#msg3460 does exactly what you asked for.

Of course it’s not the same technique of yore.

But it’s definitely the same desired result.

The guy who made the request in that thread even got to make a full game with custom ascii characters after some time (not sure if it’s in the same thread).

Offline johnno56

  • Forum Resident
  • Posts: 1270
  • Live long and prosper.
    • View Profile
Re: Redefine Characters
« Reply #5 on: January 22, 2019, 06:34:29 am »
Pete,

You could be right. After all, keying in all those character definitions back then, ended up being tedious especially if there were a lot of them. But back then, that's what had to be done, for the sake of speed. But I do miss the experience...

J
Logic is the beginning of wisdom.

Offline Cobalt

  • QB64 Developer
  • Forum Resident
  • Posts: 878
  • At 60 I become highly radioactive!
    • View Profile
Re: Redefine Characters
« Reply #6 on: January 22, 2019, 11:29:08 am »
Fellippe, is right. That code I posted is how QB64 changes the 'original' BIOS font. That example uses data from a file but you could easily Rube Goldberg it to have to individually do each character one at a time if you wanted.

Even in Qb45 there wasn't a command to change the characters, you had to PEEK and POKE stuff so it was a routine upon itself. and if it was more of a main stream thing to do I would say we should introduce a couple of commands to make it simpler in QB64 but then how many people mess with the BIOS font anyway? 3 commands, _FONTFILE : loads an entire 256 Character set, _FONTCHAR : Changes an individual character, and _FONT :which we already have to restore the original set (_FONT 16(or 8))
Granted after becoming radioactive I only have a half-life!

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Redefine Characters
« Reply #7 on: January 22, 2019, 11:51:38 am »
Hi Cobalt,

You know about _LOADFONT, right?

http://qb64.org/wiki/LOADFONT

Offline Cobalt

  • QB64 Developer
  • Forum Resident
  • Posts: 878
  • At 60 I become highly radioactive!
    • View Profile
Re: Redefine Characters
« Reply #8 on: January 22, 2019, 12:14:32 pm »
Hi Cobalt,

You know about _LOADFONT, right?

http://qb64.org/wiki/LOADFONT

that doesn't change the BIOS font though.
Granted after becoming radioactive I only have a half-life!

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Redefine Characters
« Reply #9 on: January 22, 2019, 12:34:54 pm »
Hi Cobalt,

You know about _LOADFONT, right?

http://qb64.org/wiki/LOADFONT

that doesn't change the BIOS font though.

Ah, so you want the new commands just for the BIOS font?

Offline PMACKAY

  • Forum Regular
  • Posts: 188
  • LIFE is Temporary
    • View Profile
Re: Redefine Characters
« Reply #10 on: January 23, 2019, 01:39:52 am »
redefined chars are cool. i use them in my own games (qb64)... much faster to display... just limitations on colours... but either way cool
« Last Edit: January 23, 2019, 05:32:49 am by PMACKAY »
MackyWhite

Offline johnno56

  • Forum Resident
  • Posts: 1270
  • Live long and prosper.
    • View Profile
Re: Redefine Characters
« Reply #11 on: January 23, 2019, 05:34:30 am »
Do you have a sample piece of code that I could pick apart? I would be interested to see how you use the characters...

J
Logic is the beginning of wisdom.

Offline PMACKAY

  • Forum Regular
  • Posts: 188
  • LIFE is Temporary
    • View Profile
Re: Redefine Characters
« Reply #12 on: January 23, 2019, 05:54:43 am »
https://www.qb64.org/forum/index.php?topic=638.0

download my faceblock program... its on the forum... nice puzzle all in screen mode 0 using only redefined characters. quiet simple to pull apart and make you own bios characters.. 256ascii set

the link above should be corect.. also the whole title is ascii also.. with music and scrolling text.. (screen 0)
MackyWhite