Announcement

Collapse
No announcement yet.

POGA tools + Bug Invasion --- Python and 4DGL code bundle

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • POGA tools + Bug Invasion --- Python and 4DGL code bundle

    Hi, anyone here with POGA still? Anyway here come set of tools I programmed to improve 4DGL developmen cycle. They are written in python + PIL (Python Image Library). In the bundle are also same 4DGL support libraries. Python first:

    Sprites - point it to the directory, it takes all png files with 4 color palette and 16x16 pixels and compiles them into sprites.inc (and creates constants of course)
    Shooter - converts "sshot.00x" raw files (created by disp_BlitPixelsToMedia) into png files
    Palettario - it's palettes manager - click on field and set color, click on empty (black colored) field to copy that color; right click to clear field.
    easy

    All previous tools saves their last state to tool directory and to directory they are pointed to also in TOOL_NAME.save.cPickle. To use save in pointed dir just overwrite save in tool dir.
    easy


    Now the 4DGL part:

    fat32.lib - as name suggests it is support for fat32 file system. it is highly simplified so you cannot create files or delete them, just write to them and read them.
    functions :

    fat32init () - replaces media_Init()
    returns:
    0 - no card
    -1 - unusable card format (even some fat32-formated cards can return this)
    1 - ok and ready

    fat32format( callback_function ) - it formats sd card to bare fat32 (one FAT table, 2GB hardcoded).
    returns:
    0 - failure
    1 - ok
    callback accepts 2 arguments:
    id - id of action just in progress (viz source code of fat32format)
    n - progress, mostly 0 or percentage in case of FAT writing phase

    fat32file (fn11) - finds file on sd card and sets media pointer to its location, fn11 nust be in upper case and formated like 'SSHOT 001' for sshot.001 file
    (8 chars of filename - padded with spaces and tree chars of extension). Don't create+rename files on SD card prepareprepare files of neede size outside
    and upload ready-to-use files to formated card later
    returns:
    0 - file not found
    1 - ok

    fat32indexfile (fn8, n) - handy function to use with bunch of files (screenshot slots for example)
    fn8 is just 8 chars long space-padded file name (like above but without extension part)
    n - is index of file and is recognized throught extension: 0 for .000 file, 1 for .001 etc .. anything up to 999

    contains one global variable:
    _fat32_root - it is lo word of sector where root dir starts and is mantained with fat32init function

    core.lib - simply container for usefull support functions. it contains onlz one function at this time and it is:
    joy () - this function with very pleasurable name is used to do joystick things. it returns value of just pressed button and then forgets it
    so in another call it returns 0 even if button is still pressed - usefull toy
    returns: 0, UP, DOWN, LEFT, RIGHT, BTNA, BTNB


    And finally the pinacle of everything ever done with this fantastic bunch of scripts:


    Bug Invasion is tech demo for this bundle. It took me aprox. week to create - everything was made form scratch including grafics. It is more or less playable also - wich is good bonus. Some screen shot are attached bellow - they were made by POGA tools of course

    To play the game just compile main.4dg in bugs folder it will include everything needed from another files and engine folder.
    Attached Files
    Last edited by JJ; 2 July 2014, 10:37 AM.

  • #2
    Ok. Indentation in my post is totally broken now. So much time and care, but daemon of bad-formating got me

    Comment


    • #3
      Try using the indent tool which is built into the editor, rather than the BB-Codes you appear to be trying to use. Click the A button top right and use what is built into the editor.
      James

      Comment


      • #4
        I've used build-in tools only

        Comment


        • #5
          This looks great, hopefully it will bring other PoGa users out of the woodwork and contributing their creations.
          Mark

          Comment


          • #6
            Thanks, looking forward to some interesting code-fu to read before bedtime

            Comment

            Working...
            X