test a VMU file

If you have any questions on programming, this is the place to ask them, whether you're a newbie or an experienced programmer. Discussion on programming in general is also welcome. We will help you with programming homework, but we will not do your work for you! Any porting requests must be made in Developmental Ideas.
Post Reply
User avatar
JMD
Insane DCEmu
Insane DCEmu
Posts: 234
Joined: Wed Dec 11, 2002 6:45 am
Location: A Melody From a Past Life Keeps Pulling Me Back
Has liked: 0
Been liked: 0
Contact:

test a VMU file

Post by JMD » Sun Oct 17, 2004 2:31 pm

Hi,

I'm searching for a way to test a VMU file without load it.

Here is my pbm : I load a VMU file and want, when I save it again, be sure that the one I replace is the one I loaded.
Don't want replace another one if i changed the VMU for exemple.

Do you know how can I do that ?

Thanks.

JMD
Image
There is the theory of Möbius. A twist in the fabric of space where time becomes a loop
User avatar
JMD
Insane DCEmu
Insane DCEmu
Posts: 234
Joined: Wed Dec 11, 2002 6:45 am
Location: A Melody From a Past Life Keeps Pulling Me Back
Has liked: 0
Been liked: 0
Contact:

Post by JMD » Mon Oct 18, 2004 6:34 am

Ok, find a way : I load the header and check the CRC.

I do like this :

Code: Select all

   #include <dc/fs_vmu.h>

    // open file
    file_t   fd=fs_open("/vmu/a1/myfile",O_RDONLY);
    // read header and cast as a file header
    uint8            data[128];
    fs_read(fd,&data,128);
    vmu_hdr_t *hdr = (vmu_hdr_t *)&data;;
     // read CRC
    uint16   int_crc = hdr->crc;
    printf("CRC = %i\n", int_crc);
    
    // close file
    fs_close(fd); 
    
Image
There is the theory of Möbius. A twist in the fabric of space where time becomes a loop
Post Reply