Shop OBEX P1 Docs P2 Docs Learn Events
Need to shrink VGA64_TMPEngine — Parallax Forums

Need to shrink VGA64_TMPEngine

lmclarenlmclaren Posts: 104
edited 2011-12-03 22:34 in Propeller 1
Hi,
I am using http://obex.parallax.com/objects/655/ for the display on my Coffee Roaster.

I don't use any cursors or mouse pointers.

Is it possible to remove the mouse / pointer functionality and reduce the memory footprint?

I am completely out of memory and need to try to recover some, as the video uses the most out of all the objects I am starting with it.

I have had a good look but it seems to be tightly integrated and I don't understand how it works.

Lee

Comments

  • kuronekokuroneko Posts: 3,623
    edited 2011-12-02 20:10
    Have you tried compiling with bst and unused-code-removal switched on?
  • lmclarenlmclaren Posts: 104
    edited 2011-12-02 20:17
    Not yet, I am still going through the program and optomising it, eg, removing floating point and replacing with basic math etc. The VGA64 is a third of my memory, if I can save even 10% I am a long way towards what I need. I will use bst when I get a bit closer though.

    thanks

    Lee
  • kuronekokuroneko Posts: 3,623
    edited 2011-12-02 20:19
    Your call. I was just thinking that automatic dead code removal may (initially) be easier than diving into unknown code and potentially removing the wrong bit :) I'd just try it now to get an idea what can be saved.

    Note that bst chokes on #-1 in the CONstant section, just replace it with #$FFFFFFFF.
  • lmclarenlmclaren Posts: 104
    edited 2011-12-02 23:06
    Thanks Kuroneko,

    BST helps a lot, I would still like more though :).
    Am I right in thinking that the mouse / pointer code would not be removed from the VGA object even if it was not being used, by the looks of things it will still be called to display the cursor, even though it is off the screen.

    Lee
  • kuronekokuroneko Posts: 3,623
    edited 2011-12-02 23:12
    Yup, DAT sections stay untouched. Not sure it would amount to that much although the code image nearly fills the cog. The biggest chunks sit in the chroma/luma buffers (1200 longs/1200 words). I assume you really need this kind of resolution (i.e. something VGA_Text can't give you)?

    What one could do (haven't checked yet) is to overlay screen buffer and cog image so you get an extra ~280 longs worth (PASM image is only needed once).

    Change the variable section to something like:
    ' //////////////////////Variable Array////////////////////////////////////////////////////////////////////////
    
    [COLOR="orange"]chromaBuffer_tail       long    0[1_200-(@chromaBuffer_tail-@chromaBuffer)/4][/COLOR]    ' Display chroma buffer.
    lumaBuffer              word    0[1_200]                                         ' Display luma buffer.
    mouseCache              long    0[64]                                            ' Mouse overlay display buffer.
    printColor              long    0                                                ' Print cursor color control.
    

    And the start of the cog image to:
    ' //////////////////////Initialization////////////////////////////////////////////////////////////////////////
    
    [COLOR="orange"]chromaBuffer[/COLOR]
    initialization          mov     vcfg,                 videoState                 ' Setup video hardware.
                            mov     frqa,                 frequencyState             '
    
    The only drawback is that you can't restart the driver without reboot from EEPROM.
  • lmclarenlmclaren Posts: 104
    edited 2011-12-03 03:39
    Thanks Kuroneko,

    I will test in the morning. Bst pulled a third out of the memory usage. I am going through and optomising the code, removing some waste. Got a bit lazy and was using float to div by 100 and display with a decimal point.

    best regards
    Lee
  • lmclarenlmclaren Posts: 104
    edited 2011-12-03 22:34
    Thanks again Kuroneko,

    Worked well.

    best regards
    Lee
Sign In or Register to comment.