forum.getinpulse.com
http://www.getinpulse.com/hack/forum/

Flip clock (Day 19)
http://www.getinpulse.com/hack/forum/viewtopic.php?f=7&t=282
Page 1 of 1

Author:  hudson [ Thu May 12, 2011 6:28 pm ]
Post subject:  Flip clock (Day 19)



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;

Author:  hudson [ Sat May 14, 2011 7:32 am ]
Post subject:  Re: Flip clock (Day 19)

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.

Page 1 of 1 All times are UTC - 8 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/