Shop OBEX P1 Docs P2 Docs Learn Events
How to manipulate value in Dat section — Parallax Forums

How to manipulate value in Dat section

T ChapT Chap Posts: 4,223
edited 2012-09-02 10:58 in Propeller 1
In a DAT area, the following are listed, they represent bitmaps for the numbers 1 through 0 and are used on an LCD screen similar to a VGA display. I cannot just print the numbers using PRINT(x), since the LCD is flipped on edge 90 degrees. So I flipped the numbers and made new bitmaps, exported as .dat.

The program is out of memory using BST optimized and deleting unused. There is more work to be done so I am looking to cut the memory wherever possible. One area is below, where I need to display 4 digits across the LCD using bitmaps. All I could come up with was to use the same .dat files and just place them at different spacings along the Y. So if the number is 1234, the 1 is at y=14, the 2 is at y=10, etc. This is wasting space in DAT. So the question is, how can I call up these graphics_info bytes and modify the y number and therefore use only one section versus 4 copies?

Next question is, what options exist to park a lot of bitmaps that are called up as needed? SD card? And, can the SD card be accessed to read a la carte dat files?

Can these graphics_info bytes be move to VAR, and I could just simply modify them on the fly prior to each use? If so, I would appreciate an example of how these bytes would be translated to VAR.

Thanks.
'''password enter char 1
graphics61_info  byte   1,    2,     4,      28,  14,    0     '1
graphics62_info  byte   1,    2,     4,      28,  14,    0     '2
graphics63_info  byte   1,    2,     4,      28,  14,    0     '3
graphics64_info  byte   1,    2,     4,      28,  14,    0     '4
graphics65_info  byte   1,    2,     4,      28,  14,    0     '5
graphics66_info  byte   1,    2,     4,      28,  14,    0     '6
graphics67_info  byte   1,    2,     4,      28,  14,    0     '7
graphics68_info  byte   1,    2,     4,      28,  14,    0     '8
graphics69_info  byte   1,    2,     4,      28,  14,    0     '9
graphics70_info  byte   1,    2,     4,      28,  14,    0     '0
'''password enter char 2
graphics71_info  byte   1,    2,     4,      28,  10,    0     '1
graphics72_info  byte   1,    2,     4,      28,  10,    0     '2
graphics73_info  byte   1,    2,     4,      28,  10,    0     '3
graphics74_info  byte   1,    2,     4,      28,  10,    0     '4
graphics75_info  byte   1,    2,     4,      28,  10,    0     '5
graphics76_info  byte   1,    2,     4,      28,  10,    0     '6
graphics77_info  byte   1,    2,     4,      28,  10,    0     '7
graphics78_info  byte   1,    2,     4,      28,  10,    0     '8
graphics79_info  byte   1,    2,     4,      28,  10,    0     '9
graphics80_info  byte   1,    2,     4,      28,  10,    0     '0
'''password enter char 3
graphics81_info  byte   1,    2,     4,      28,  6,    0     '1
graphics82_info  byte   1,    2,     4,      28,  6,    0     '2
graphics83_info  byte   1,    2,     4,      28,  6,    0     '3
graphics84_info  byte   1,    2,     4,      28,  6,    0     '4
graphics85_info  byte   1,    2,     4,      28,  6,    0     '5
graphics86_info  byte   1,    2,     4,      28,  6,    0     '6
graphics87_info  byte   1,    2,     4,      28,  6,    0     '7
graphics88_info  byte   1,    2,     4,      28,  6,    0     '8
graphics89_info  byte   1,    2,     4,      28,  6,    0     '9
graphics90_info  byte   1,    2,     4,      28,  6,    0     '0
'''password enter char 4
graphics91_info  byte   1,    2,     4,      28,  2,    0     '1
graphics92_info  byte   1,    2,     4,      28,  2,    0     '2
graphics93_info  byte   1,    2,     4,      28,  2,    0     '3
graphics94_info  byte   1,    2,     4,      28,  2,    0     '4
graphics95_info  byte   1,    2,     4,      28,  2,    0     '5
graphics96_info  byte   1,    2,     4,      28,  2,    0     '6
graphics97_info  byte   1,    2,     4,      28,  2,    0     '7
graphics98_info  byte   1,    2,     4,      28,  2,    0     '8
graphics99_info  byte   1,    2,     4,      28,  2,    0     '9
graphics100_info byte   1,    2,     4,      28,  2,    0     '0

Comments

  • T ChapT Chap Posts: 4,223
    edited 2012-09-02 10:58
    PUB Configdata(b)
        byte[@graphics61_info][4] := b
        byte[@graphics62_info][4] := b
        byte[@graphics63_info][4] := b
        byte[@graphics64_info][4] := b
        byte[@graphics65_info][4] := b
        byte[@graphics66_info][4] := b
        byte[@graphics67_info][4] := b
        byte[@graphics68_info][4] := b
        byte[@graphics69_info][4] := b
        byte[@graphics70_info][4] := b
    PUB PW1(g, bbb)   '(number to display, offset in dat)
        Configdata(bbb)
        case g
             1  :  DrawBitmap(@graphic1_data, @graphics61_info)
             2  :  DrawBitmap(@graphic2_data, @graphics62_info)
             3  :  DrawBitmap(@graphic3_data, @graphics62_info)
             4  :  DrawBitmap(@graphic4_data, @graphics64_info)
             5  :  DrawBitmap(@graphic5_data, @graphics65_info)
             6  :  DrawBitmap(@graphic6_data, @graphics66_info)
             7  :  DrawBitmap(@graphic7_data, @graphics67_info)
             8  :  DrawBitmap(@graphic8_data, @graphics68_info)
             9  :  DrawBitmap(@graphic9_data, @graphics69_info)
             0  :  DrawBitmap(@graphic0_data, @graphics70_info)
    

    This is what I have come up with so far in terms of modifying the dat section.
Sign In or Register to comment.