Shop OBEX P1 Docs P2 Docs Learn Events
wordfill verses array.word — Parallax Forums

wordfill verses array.word

mike goettlingmike goettling Posts: 31
edited 2007-05-03 17:11 in Propeller 1
I am having an issue with wordfill command verses array.word
I am using chips VGA_Tile_Driver_Demo2 - Archive [noparse][[/noparse]Date 2006[noparse][[/noparse]1].11.22 Time 02.13].zip
when you print a charactor to the screen it uses

·k := color << 1 + c & 1
····· i := $200 + (c & $FE) + k << 10
····· array.word[noparse][[/noparse]row * cols + col] := i
····· array.word[noparse][[/noparse](row + 1) * cols + col] := i | 1

array is······· long·· array[noparse][[/noparse]tiles/2]

i am trying to do a block clear of space of display memory


wordfill(array1[noparse][[/noparse]0],spacetile,1)·

this clears the top half of the first letter on screen.

wordfill(array1[noparse][[/noparse]0],spacetile,1)

skips the second leter and erase the top of the third letter.

i need to be able to get to the second charactor to start the block fill.

i know that it problem is related to the array is set to a long.

just showing this code for simplisty to test to se if it works

Comments

  • Paul BakerPaul Baker Posts: 6,351
    edited 2007-05-03 03:06
    The issue is that array is a variable type LONG, so when you index the array you are incrementing by longs (+4) so you will hit only every other character. So instead reindex using the .word casting:

    wordfill(array1.word[noparse][[/noparse]0],spacetile,1) 'clear the top half of the first char 
    wordfill(array1.word[noparse][[/noparse]1],spacetile,1) 'clear the top half of the second char
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.

  • mike goettlingmike goettling Posts: 31
    edited 2007-05-03 15:44
    that did not work.

    i made a mistake in that it should have been array instead of array1
    i removed the one but it did not help till i added the @

    this is what seems to work.

    wordfill(@array.word[noparse][[/noparse]0],spacetile,1)·············· 'clear the top half of the first char
    wordfill(@array.word[noparse][[/noparse]1],spacetile,1)·············· 'clears the top half of the second char

    you pointed me in the right dir

    thanks
  • Paul BakerPaul Baker Posts: 6,351
    edited 2007-05-03 15:54
    Sorry my code wasn't spot on, but I'm glad I was at least able to point you in the proper direction.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • mike goettlingmike goettling Posts: 31
    edited 2007-05-03 17:11
    works well
Sign In or Register to comment.