SPR檔案格式解說 by Gratia Huang

※轉載請註明出處,不要把我的名字去掉,謝謝。

這裡所說的SPR檔是RO所使用的圖檔格式,解開 data.grf 可以在 data\sprite\ 下找到很多.spr檔,另有程式可以觀看或轉換SPR檔為BMP,請自行參考首頁整理的表格
 
在此以咬花為例說明SPR檔案格式,請自備UltraEdut、CView一類可編輯HEX碼的程式。咬花SPR檔所在:
data\sprite\學撮餌葬\陴\陴_粒濟.spr (男)
data\sprite\學撮餌葬\罹\罹_粒濟.spr (女)


(若以IE觀看,游標移到色塊上會浮現說明)
000000: 53 50 01 02 03 00 00 00 0C 00 0A 00 65 00 00 05 |
000010: 5F 4F 4E 00 02 43 44 00 04 5F 49 49 4A 5F 43 45 | 
000020: 43 00 01 4F 4E 4C 5F 35 4B 4A 4E 45 00 02 4F 49 |
000030: 4A 35 31 31 34 35 45 00 03 4F 49 49 35 31 31 33 |
000040: 34 4F 4F 00 02 5F 4C 49 34 33 32 33 5F 4B 4B 5F |
000050: 00 02 5F 4F 4C 35 35 5F 4F 4B 4B 5F 00 04 4F 4B |
000060: 34 4F 5F 5F 5F 00 05 4F 49 4A 4B 4F 00 08 4F 4F |
000070: 5F 00 05 0A 00 0A 00 55 00 00 02 5F 4F 4E 00 06 |
000080: 5F 49 49 4A 5F 00 02 43 44 00 01 5F 35 34 4A 45 |
000090: 4E 43 45 44 4F 35 31 31 34 45 45 45 44 00 01 4F |
0000a0: 35 31 31 33 45 4F 4F 00 02 5F 34 33 32 33 5F 4B |
0000b0: 5F 00 03 4C 35 35 5F 4F 4B 5F 00 03 4F 4B 4F 5F |
0000c0: 5F 5F 00 04 4F 49 4B 4F 00 07 4F 5F 00 06 0A 00 |
0000d0: 0A 00 44 00 00 02 5F 4E 00 07 5F 49 4A 5F 00 06 |
0000e0: 5F 35 34 5F 00 05 4F 33 31 34 34 45 44 44 44 44 |
0000f0: 4F 33 31 34 33 45 45 45 45 00 01 5F 34 33 34 4B |
000100: 5F 00 05 4C 35 35 4B 5F 00 05 4F 4B 4F 5F 00 06 |
000110: 4C 49 4F 00 08 4F 00 07 C8 F8 D3 00 FF FF FF 00 |
000120: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |
000130: 00 00 00 00 00 00 00 00 FF F4 BC 00 FF E1 B6 00 |
000140: E8 C7 A5 00 D1 B0 94 00 BA 99 83 00 A3 81 71 00 |
000150: 91 6A 63 00 82 53 53 00 00 00 00 00 00 00 00 00 |
000160: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |
000170: 00 00 00 00 00 00 00 00 00 00 00 00 01 01 01 00 |
000180: 02 02 02 00 03 02 02 00 04 03 03 00 05 04 04 00 |
000190: 03 02 02 00 00 00 00 00 00 00 00 00 00 00 00 00 |
0001a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |
0001b0: 00 00 00 00 00 00 00 00 ED ED FF 00 CE CC E0 00 |
0001c0: AF A7 C1 00 95 8B A7 00 7A 6F 8C 00 64 5E 77 00 |
0001d0: 47 43 59 00 29 27 3B 00 FF DE C4 00 FA BB AB 00 |
0001e0: F4 98 92 00 E9 7E 7A 00 CB 62 66 00 B2 46 51 00 |
0001f0: 8C 35 3E 00 6E 25 2D 00 00 00 00 00 00 00 00 00 |
000200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |
000210: 55 50 6B 00 00 00 00 00 FF FF C0 00 DE E6 AB 00 |
000220: C0 D6 96 00 9B B5 7E 00 7E 94 66 00 5F 74 51 00 |
000230: 40 54 3B 00 29 37 25 00 FF FB C8 00 FD E3 B2 00 |
000240: FB CB 9C 00 EE B3 85 00 DA 97 73 00 C5 7A 60 00 |
000250: AB 69 57 00 91 51 4E 00 00 00 00 00 00 00 00 00 |
000260: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |
000270: 00 00 00 00 00 00 00 00 FF F0 E5 00 EC CA C6 00 |
000280: D8 A6 A2 00 C8 8E 8C 00 B8 74 7C 00 9E 5C 66 00 |
000290: 7E 41 51 00 5C 25 3B 00 FF E5 A3 00 FB C5 8B 00 |
0002a0: F7 A5 72 00 F2 85 59 00 ED 64 47 00 BE 43 30 00 |
0002b0: 8F 22 18 00 61 00 00 00 00 00 00 00 00 00 00 00 |
0002c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |
0002d0: 00 00 00 00 00 00 00 00 DE B3 A2 00 C3 9B 8F 00 |
0002e0: AF 86 7F 00 99 72 6F 00 83 5E 5F 00 6D 49 4F 00 |
0002f0: 54 36 40 00 3B 23 31 00 FF F3 EB 00 EE DF D7 00 |
000300: DC CB C3 00 CA B7 AF 00 B8 A3 9B 00 A9 8F 8B 00 |
000310: 99 7B 7B 00 89 67 6B 00 F7 F0 E5 00 FF E1 CF 00 |
000320: FF C6 B2 00 F6 AE 9F 00 DC 90 84 00 BD 73 6B 00 |
000330: 9E 56 52 00 82 3F 3B 00 D6 F0 B5 00 B8 D8 A5 00 |
000340: 9A BF 94 00 80 A3 87 00 66 86 74 00 4C 68 64 00 |
000350: 31 4A 54 00 16 2B 43 00 00 00 00 00 00 00 00 00 |
000360: 00 00 00 00 00 00 00 00 3B 12 0F 00 00 00 00 00 |
000370: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |
000380: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |
000390: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |
0003a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |
0003b0: 00 00 00 00 00 00 00 00 FF E5 B5 00 F3 C8 9E 00 |
0003c0: E6 AA 86 00 D3 8C 6E 00 B3 72 59 00 9E 5E 49 00 |
0003d0: 7A 41 32 00 55 25 1A 00 00 00 00 00 00 00 00 00 |
0003e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |
0003f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |
000400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |
000410: 00 00 00 00 00 00 00 00 FF DE BF 00 EB C4 A8 00 |
000420: D7 AA 91 00 C3 90 7A 00 AE 76 62 00 8E 5E 4B 00 |
000430: 6E 46 34 00 4E 2E 1C 00 F0 D1 DC 00 D6 B8 C7 00 |
000440: BD 9F B0 00 A3 87 99 00 88 6F 82 00 6E 57 6A 00 |
000450: 53 3F 53 00 38 27 3B 00 00 00 00 00 01 00 00 00 |
000460: 02 01 01 00 03 02 01 00 04 02 02 00 05 03 02 00 |
000470: 06 04 03 00 08 05 04 00 FF FF CB 00 FF DE AC 00 |
000480: FF C0 8C 00 EB A1 71 00 CF 85 5C 00 B2 69 47 00 |
000490: 8D 4E 39 00 67 34 29 00 00 00 00 00 00 00 00 00 |
0004a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |
0004b0: 00 00 00 00 00 00 00 00 FF FF DE 00 E7 E6 C8 00 |
0004c0: CF CC B2 00 B7 B2 9C 00 9F 98 85 00 84 7D 71 00 |
0004d0: 69 62 5D 00 4D 46 48 00 00 00 00 00 00 00 00 00 |
0004e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |
0004f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |
000500: 00 00 00 00 00 00 00 00 00 00 00 00 00 FF 00 00 |
000510: FF 00 00 00 C8 DA C7 00                         |
Frame1
Frame1(12x10)
Frame2
Frame2(10x10)
Frame3
Frame3(10x10)
【HEX碼說明】:
53 50 01 02:SPR檔Header
03 00 00 00:Fream張數,咬花有3張
(不確定是否4Byte皆表Fream數,但未發現例外)
0C 00 0A 00:咬花第一張圖的大小為 12x10
65 00:像素資料長101Bytes,10110=6516,以2Byte長度存成65 00
像素資料部分只有背景色壓縮,其餘不壓縮。
例如 00 05──→背景色 5 pixel;
   5F 4F 4E →   

※Fream2、Fream3部分類推。

調色盤部分固定長度為256x4=1024Bytes
一個顏色4Bytes記 RR GG BB 00。
(data.grf 中 data\palette\ 下的所有.pal檔格式亦為如此,可以直接COPY來覆蓋。例如你現在編輯的是 4_罹.spr,拿 該葬4_罹_4.pal的資料來覆蓋 4_罹.spr 的調色盤,就會看到頭髮變成綠色的)
咬花這段調色盤可具現化如下:

00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF

2style.net