supplierdeeply

Memory browser mod

  • 0 Replies
  • 1026 Views
*

Offline srsa_4c

  • ******
  • 3118
  • Publish
    Memory browser mod
    « on: 15 / July / 2011, 21:24:56 »
    Advertisements
    I was a bit dissatisfied with CHDK's default memory browser. Therefore I hacked together a mod (based on the original plus some other CHDK code), which is (I think) more fun to use. To be honest, I haven't done much research, so there may exist something similar.
    I'm not really a programmer, and if I do code, it's usually not c. The code could be better (I'm sure, there's a lot to optimize), but it works. It may have some bugs however.
    It's currently a drop-in replacement for /core/gui-debug.c
    It uses the same configuration value as its predecessor, but has the ability to save more settings (to a separate file).
    It's also not intended to be part of an end user distribution, only for development/porting.

    The following keys are in use: display, set, up/down/left/right, half-shoot.

    The display key is used for navigation through the program functions (there's six of them).

    (1)

     At start, the "STOP" sign is highlighted (red background). The following keys are active: up/down, left/right, set. Pressing up/down changes to the next/previous memory block (dump mode, see later). The left/right keys change the starting address by the amount selected by "step". Pressing set activates the continous refresh mode ("STOP" changes to "LIVE"), pressing set again changes back.

    (2)

     A press on "disp(lay)" key highlights the cursor: it allows to select either the (starting) address, or one of the 32 displayed values. The up/down/left/right keys can be used for navigation.

    (3)

     Another press on display key activates the (starting) address editing mode. The highlight is placed to the first digit of "address". The left and right keys can be used to select a digit, up/down increases or decreases it. As the effect is instant, be sure not to enter addresses, which are not "safe". The set key is a shortcut here, it takes directly to buffer-handling mode (later).

    (4)

     The next press on display key takes to display mode selection. It defaults to no memory access (NoAccess), the other modes are single value display (Sngl) and dump display (Dmp). In single mode, only the address's content is visible. In dump mode, 4*8 dwords are displayed, starting from address. There's also an ASCII display, but it's placed under the hex display (because of size constraints). If the cursor (2) was used to select a value in the dump, that value is displayed at the bottom of the screen, in decimal (32, 16 and 8 bit-wide).
    The left/right keys can be used here, their effect is instant, be sure not to have an invalid address, when you enable memory access.

    (5)

     The next press on display key activates "step"-size editing. It's similar to the address-editing mode, but the set key is not active.

    (6)

     The last stop is the buffer-handling. The up/down keys can be used to select a buffer out of the 14 available (right edge of the display). The selected buffer's content is displayed after "Buf.:". The selected buffer can be used to save a value (the one that's selected with the cursor), or to restore an address (saved earlier). The left/right keys can be used to choose "Stor" (store) or "Recl" (recall), the set key executes the chosen operation.

    The next keypress on disp(lay) takes again to (1), and so on.

    Important to note, that the "half-shoot" key causes the contents of the buffers to be saved. When saved, the values are restored on the next start of the program.

    Some known problems:
    - Static parts, text disappear, when the Canon firmware decides to do a refresh.
    - The memory displayed is not buffered, the values are not "sampled" at the same time. This can become obvious, when (in LIVE mode) a constantly changing area is displayed, see an example at the pictures I provided (selected hex and decimal values do not match).

    Mod1:
    - Bugfix (cursor drawing problem solved), some redundancy removed, possibility to show screen refreshes

    Have fun!
    « Last Edit: 17 / July / 2011, 18:53:37 by srsa_4c »

     

    Related Topics