It is currently Wed Jul 06, 2011 4:35 pm

All times are UTC - 8 hours




 Page 1 of 1 [ 2 posts ] 
Author Message
 Post subject: Flip clock (Day 19)
PostPosted: Thu May 12, 2011 6:28 pm 

Joined: Sun Feb 27, 2011 11:32 am
Posts: 71


I really wanted to animate the halves of each number with a vertical scaling effect, but wasn't able to finish reverse engineering the resources format in time. How is the 16-bit offset value used?
typedef struct
{
        uint8_t type; // 00 == NULL, 01 == image, 02 == font
        uint8_t unknown; // 18 == image and font, ff == NULL
        uint16_t offset; // from the offset field?  It must increment when it hits the 64k boundary
        uint8_t height;
        uint8_t width;
        uint8_t unknown2; // always 0?
} __attribute__((__packed__))
image_resource_t;


Offline
 Profile  
 
 Post subject: Re: Flip clock (Day 19)
PostPosted: Sat May 14, 2011 7:32 am 

Joined: Sun Feb 27, 2011 11:32 am
Posts: 71
hudson wrote:
I really wanted to animate the halves of each number with a vertical scaling effect, but wasn't able to finish reverse engineering the resources format in time.

Wow, was I being dense the other night. It's pretty clearly an absolute 32-bit offset in little endian mode.
typedef struct
{
   uint8_t type; // 00 == NULL, 01 == image, 02 == font
   uint32_t offset; // absolute, in little endian; can be read normally and passed directly to spiflash_read()
   uint8_t height; // in pixels
   uint8_t width; // in pixels
   uint8_t unknown2; // always 0?
} __attribute__((__packed__))
inpulse_resource_t;


The images are stored as three raw bytes in RGB order at the specified offset.


Offline
 Profile  
 
Display posts from previous:  Sort by  
 Page 1 of 1 [ 2 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: