Shop OBEX P1 Docs P2 Docs Learn Events
Custom character creation — Parallax Forums

Custom character creation

TCTC Posts: 1,019
edited 2014-03-07 06:55 in Propeller 1
Hello all,

I am working with a Noritake display and I would like to make some custom characters, but Noritake has it's own format for the characters. On a standard display (HD44780 for example), each BITE of character data is arranged in rows. So, a custom character for a standard display needs 8 BYTES for a 5x8 character. But the Noritake displays use a different format. Starting at the upper most left character pixel, going from left to right, and down each row storing each 8-bits. Storing 5 BYTES for a 5x8 character.

Here is an example of what I am trying to explain.
5x8-custom-character-conversion.jpg


What I would like to know is if anyone might have an idea how to use the prop to convert from a standard 5x8 format, to the Noritake 5x8 format? I don't want to have to reformat custom characters that others have created and posted on websites. And take advantage of custom character generators.

Thanks
TC

Comments

  • AribaAriba Posts: 2,690
    edited 2014-03-04 05:03
    This can work. It's not tested and maybe a bit slow:
    VAR
      byte standard[8]
      byte noritake[5]
    
    PUB convert : i | p
     repeat i from 0 to 4           'clear all pixels
       noritake[i] := 0
     repeat i from 0 to 39          'copy every single pixel 
       p := standard[i/5] >> (i//5) & 1
       noritake[i/8] |= p << (i//8)
    

    Andy
  • TCTC Posts: 1,019
    edited 2014-03-04 05:13
    Ariba wrote: »
    This can work. It's not tested and maybe a bit slow:
    VAR
      byte standard[8]
      byte noritake[5]
    
    PUB convert : i | p
     repeat i from 0 to 4           'clear all pixels
       noritake[i] := 0
     repeat i from 0 to 39          'copy every single pixel 
       p := standard[i/5] >> (i//5) & 1
       noritake[i/8] |= p << (i//8)
    

    Andy

    Wonderful, I will give it a try later. Thank you.
  • TCTC Posts: 1,019
    edited 2014-03-04 15:44
    I just had the chance to test it, It works great. Thank you
  • ericballericball Posts: 774
    edited 2014-03-07 06:55
    Untested
    VAR
      byte standard[8]
      byte noritake[5]
    PUB convert
      noritake[0] := standard[0]><5 | standard[1]><5<<5
      noritake[1] := standard[1]><5>>3 | standard[2]><5<<2 | standard[3]><5<<7
      noritake[2] := standard[3]><5>>1 | standard[4]><5<<4
      noritake[3] := standard[4]><5>>4 | standard[5]><5<<1 | standard[6]><5<<6
      noritake[4] := standard[6]><5>>2 | standard[7]><5<<3
    
Sign In or Register to comment.