Author Topic: Field files PC and me (question by a noob)  (Read 1793 times)

SmasherHell

  • *
  • Posts: 9
    • View Profile
Field files PC and me (question by a noob)
« on: 2007-04-21 02:51:32 »
I read the wiki about field file and started trying to code a palette viewer...(just a test to learn programming ^^)

well i've extracted md1stin (first field), uncompressed it and opened it with a hex editor (file is 426 902 bytes) :

00 00 09 00 00 00 2A 00 00 00 47 4A 00 00 71 4A
00 00 97 4F 00 00 A7 69 00 00 41 6E 00 00 29 9D
00 00 5D 9D 00 00 45 A0 00 00

This is offset 0x00 to 0x29

Wiki says offset 0x12 palette section pointer : 97 4F 00 00, I assume section start at offset 0x00004F97 (If I'm not right, it means that section pointer points out of the file...

I make a test with the Camera Matrix Section to see i i'm rights:
offset 0x0A : 47 4A 00 00 (pointer)
I go to offset 0x4A47 to check if data length match the szie
offset 0x4A47 :  26 00 00 00 (assuming it's 0x00000026 cause 0x26000000 will be more than the file size)
0x26 is 38 in dec, size of camera matrix
offset 0x474A0000...out of the file...

Then I go to offset 0x4F97 and start reading

0c 1a 00 00 0c 1a 00 00 00 00 e0 01 00 01 0d 00
85 0c 64 08 63 08 83 08 84 08 a5 08 a5 0c c5 0c
c6 10 e6 10 e7 14 e6 14 e7 10 c6 0c 07 15 84 0c
c5 10 e6 0c 07 19 28 19

0c 1a 00 00 : 4 bytes : section length (6668 bytes)
0c 1a : 2 bytes : section length (including these offset, or else it would be less than 0x1a0c)
00 00 : 2 bytes : unknown
00 : 1 bytes : unknown
00 E0 01 00 : 4 bytes : number of color in palettes...
Where is the problem?...well 1E000 colors, it means 245760 bytes... (16 bits by color)

I can't figure out if i'm too stupid to read the wiki, or if the wiki is wrong and need an update...

Sorry for my bad english...

* Edit
I think i've found out the problem =)
« Last Edit: 2007-04-22 20:29:54 by SmasherHell »