Announcement

Collapse
No announcement yet.

FAT File Image Question

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

  • FAT File Image Question

    At the end of the Graphics Composer Manual for the old version, it explains how to inherit the .gc file through the IDE and then I should be able to reference the images by name.

    So using the new GC, I built it twice, once to my Laptop and once to the uSD. I can use the normal load/seek/image commands and get my images up with no problem. However, this seems a bit clunky compared to the other method.

    I copied the .gc to where the IDE said it needed to be and I get no errors. I can put in an image like (TitleHome.jpg(0,0) and I get no errors. I can write the program to the display with no issues. However, the images won't display. Is this functionality still available or more likely, what mistake am I making?

    It's a fairly short chunk of code so I attached it here. I put the non-working attempt last so I knew when to expect it.

    HTML Code:
    #platform "uLCD-28PT_GFX2"
    
    #inherit "4DGL_16bitColours.fnc"
    #inherit "Fat.gc"
    #MODE RUNFLASH
    
    var handle;
    var hsetup;
    var hrun;
    
    func main()
    media_Init();
    pause(1000);
    
    if( !file_Mount() )
    repeat
    print("Disk not mounted");
    pause(200);
    gfx_Cls();
    pause(200);
    until( file_Mount() );
    endif
    handle := file_Open("Fat.gci",'r');
    file_Seek(handle, 0x0000,0x5200);
    hrun:= file_Image(6,0,handle);
    pause(2000);
    
    file_Seek(handle, 0x0000,0x0000);
    hsetup:= file_Image(6,0,handle);
    pause(2000);
    gfx_Cls();
    file_Unmount();
    
    RunGrey.jpg(0, 0);
    pause(2000);
    
    endfunc
    Thanks yet again,

    Wade

  • #2


    Are you saying
    hrun:= file_Image(6,0,handle);
    hsetup:= file_Image(6,0,handle);
    work, but
    RunGrey.jpg(0, 0);
    Doesn't?

    Try moving the
    file_Unmount();

    To after it
    Mark

    Comment


    • #3


      That is correct. The normal method of seeking the file and assigning the handle display works fine. The two images are buttons that overlay each other.

      It is the RunGrey.jpg(6,0); that doesn't seem to work. I verified the spelling capitalization etc straight out of the GC file.

      I also tried the unmount command both before and after and it didn't work. One of the things I noticed in the Graphics Composer manual is that it uses underscores. I thought to avoid this issue by using no spaces. But the manual also uses an underscore in place of the dot. I tried this and got a compile error so I just assumed it was a mistake in the manual. I also considered that it might be a file name length issue since dealing with FAT16 would put restrictions on length. I assume that we are limited to an 8.3 format. My file name is only 7.3 so this shouldn't be an issue.

      Any other ideas?

      Wade

      Comment


      • #4


        Duh, the .GC file is created for 'RAW' format only, it doesn't 'switch' to FAT mode when you use GCI files.

        A note has been placed on the 'to do' list
        Mark

        Comment


        • #5


          Okay, so that I am clear,l this is a firmware/software issue and there is nothing I have done incorrectly? Before you say yes, I thought it was odd that the actual files don't ever get copied to the uSD. I get the .gci, and the .dat. There is a folder copied to my harddrive called fat.gcs.d ('fat' being my name). This folder contains all of the images. I am not sure why this folder even gets created if it is not to copy to the uSD. So this might be the problem....

          I didn't state this in my earlier post but the .dat file info matches my RunGrey.jpg as well.

          Out of curiosity, what is the second set of numbers in the DAT file. The first set is the position within the file, the second is 0 0 for every file.

          And last, I noticed as I started trying to use the FAT file system that the 8.3 file length was an issue because my initial Graphics Composer program name was much longer than 8 characters and I was never gettting anything to display but it was not giving me an error. I don't remember reading this anywhere in the manual and since you are writing a new manual for the new GC, you might want to include this info or make it more visible if it is already there.

          I lied, I have one more thing. The GC creates a lot of files. There is no method for deleting these other than through explorer. Something for your developers to consider is a way to purge a GC file so that it deletes all of the appropriate files it creates. Not critical but it would help. I am paranoid about deleing them manually and deleting one that screws me up. :-)

          Thanks again,

          Wade

          Comment


          • #6


            Okay, so that I am clear,l this is a firmware/software issue and there is nothing I have done incorrectly? Before you say yes, I thought it was odd that the actual files don't ever get copied to the uSD. I get the .gci, and the .dat. There is a folder copied to my harddrive called fat.gcs.d ('fat' being my name). This folder contains all of the images. I am not sure why this folder even gets created if it is not to copy to the uSD. So this might be the problem....

            You have done nothing incorrectly, the .GC file is created to help with locating images more easily within your program ad, as it is currently implemented, it only works for RAW images.

            The .GCI file contains all the images needed for your running program, the .DAT is only used by file_LoadImageControl and if you don't use that you don't need that file on the uSD card either.

            The fat.gcs.d folder is a collection of all the files needed to build (or rebuild) the GC project. This is to stop the possibility of accidentally deleteing a file in some other folder, somewhere that is used by the GC project and rendering it unusable.

            I didn't state this in my earlier post but the .dat file info matches my RunGrey.jpg as well.

            I hope you see it now that the .DAT is for run time and the contents of the .GC file are for compile time

            Out of curiosity, what is the second set of numbers in the DAT file. The first set is the position within the file, the second is 0 0 for every file.
            They are the 'default' X and Y positions for the image/movie. GC3 sets this, for older versions of GC you need to alter the DAT file yourself.

            And last, I noticed as I started trying to use the FAT file system that the 8.3 file length was an issue because my initial Graphics Composer program name was much longer than 8 characters and I was never gettting anything to display but it was not giving me an error. I don't remember reading this anywhere in the manual and since you are writing a new manual for the new GC, you might want to include this info or make it more visible if it is already there.
            I'm pretty sure you would have received a 'file not found' error when you attempted to open the .GCI file. We'll look at warning people about this in the new manual.

            I lied, I have one more thing. The GC creates a lot of files. There is no method for deleting these other than through explorer. Something for your developers to consider is a way to purge a GC file so that it deletes all of the appropriate files it creates. Not critical but it would help. I am paranoid about deleing them manually and deleting one that screws me up. :-)
            You wouldn't catch me deleting any file created by GC, as far as I know they are all needed.
            Mark

            Comment


            • #7


              Great info!

              Leads to a another question. I have never paid attention to the default position. If I set the default position in the GC, how does this help me in the IDE? Since I have to call out the x,y in the media_image(x,y); command. I haven't seen an option to allow it to default to "default".

              The delete question only comes up because I have created 'test' GC files to try things out as I am learning and now I want to get rid of them all. The ones I am using I will certainly keep. The others just tend to clutter. I will have to bite the bullet and delete them. :-)

              Thanks again for all the quick replies,

              Wade

              Comment


              • #8


                Leads to a another question. I have never paid attention to the default position. If I set the default position in the GC, how does this help me in the IDE? Since I have to call out the x,y in the media_image(x,y); command. I haven't seen an option to allow it to default to "default".
                The .DAT is only used by file_LoadImageControl, now look at the img_ functions, that should clear it up.

                Hopefully you've given all your test files a unique name (i.e. not confused it with test.4dg, or something else) . The new user manual is available, Chapter 5 is a summary of file types
                Mark

                Comment

                Working...
                X