-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAnimal Crossing GCI Save File Template.bt
515 lines (457 loc) · 16.1 KB
/
Animal Crossing GCI Save File Template.bt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
//------------------------------------------------
//--- 010 Editor v8.0.1 Binary Template
//
// File: Animal Crossing GCI Save File Template
// Authors: Cuyler
// Version: 0.1
// Purpose: Shows various save file structures for Animal Crossing GCI save files
// Category: Save File Template
// File Mask:
// ID Bytes:
// History:
// TODO: Camper
//------------------------------------------------
FSeek(0x1504);
struct MAIL {
char receipiantName[8]; // 0
char townName[8]; // 8
ushort receipiantId < format=hex >; // 0x10
ushort townId < format=hex >; // 0x12
ushort unknown1 < format=hex >; // 0x14
char senderName[8]; // 0x16
char senderTownName[8]; // 0x1E
ushort senderId < format=hex >; // 0x26
ushort senderTownId < format=hex >; // 0x28
byte eventType < format=hex >; // Unsure about this 0x2A
byte unknown2 < format=hex >; // 0x2B
ushort presentId < format=hex >; // 0x2C
byte read < format=hex >; // 0x2E
byte unknown3 < format=hex >; // 0x2F
byte senderType < format=hex >; // Don't know about this 0x30
byte stationaryItemIdLowerByte < format=hex >; // 0x31
char body[0xF8]; // 0x32
} savedLetters[160]; // struct size: 0x12A
FSeek(0xCFE0);
struct PATTERN {
char name[16];
byte palette < format=hex >;
byte unused[15] < format=hex >;
byte doublePixelDataArray[0x200] < format=hex >;
} savedPatterns[96];
FSeek(0x19C00);
struct DIARY {
byte unknownDiaryBytes[2];
struct PLAYER_ENTRIES {
struct MONTH_ENTRY {
char entry[0x3E0];
} monthEntry[12];
} playerEntries[4];
} diary;
FSeek(0x26040);
struct AC_SAVE {
struct HEADER {
int static < format=hex >;
char gameId[4];
ushort townId < format=hex >;
struct DATE {
byte second;
byte minute;
byte hour;
byte day;
byte dayOfWeek < comment=DayOfWeek >;
byte month < comment=MonthString >;
ushort year;
} lastPlayDate < comment=DateString >; // may not be "last play" date
ushort checksum < format=hex >;
int gameState < format=hex,comment="Usually 0x22. Don't mess with this." >;
byte villagerCount < format=hex,comment="This doesn't include the islander" >;
byte villagerLeavingIndex < format=hex,comment="The villager who left/is leaving. Will be 0xFF if no one is leaving." >;
ushort copyProtectionCode < format=hex,comment="Something to do with copy protection. It's set in InitGameStart_bg_make_data." >;
int headerPadding;
} header;
struct PLAYER {
char name[8];
char townName[8];
ushort playerId < format=hex >;
ushort townId < format=hex >;
byte gender < format=hex,comment=PlayerGender >;
byte faceType < format=hex >;
byte resetCount < format=hex >;
byte unknown < format=hex >;
int padding[20] < format=hex >;
struct INVENTORY {
ushort itemId[15] < format=hex >;
} inventory;
ushort padding1 < format=hex >;
int inventoryFlags < format=binary,comment="Two bits for each item. 0 = no modifier, 1 = Present, 2 = QuestItem 3 = Invalid?" >;
uint bells < format=decimal >;
uint debt < format=decimal >;
int padding3[260] < format=hex >;
ushort heldItem < format=hex >;
ushort padding4 < format=hex >;
char unknownLetterStrings[0x38] < format=hex >;
MAIL mail[10];
ushort pocketsBackgroundItem < format=hex >;
int padding5 < format=hex >;
ushort shirt < format=hex >;
int padding6[6] < format=hex >;
ushort padding7 < format=hex >;
struct BIRTHDAY {
byte month < comment=MonthString >;
byte day;
} birthday < comment=BirthdayString >;
int padding8[19] < format=hex >;
int resetCode < format=hex >;
int bitmapData[77] < format=hex >; // research this more
uint savings < format=decimal >;
int padding9[4] < format=hex >;
PATTERN pattern[8];
int padding10[34] < format=hex >; // Padding dictates unknowns.
byte tan < format=hex >;
byte padding11[3] < format=hex >;
int padding12[29] < format=hex >;
} player[4];
char townName[8];
ushort static2 < format=hex >;
ushort townId < format=hex >;
struct MESSAGEBOARD_POST {
char body[0xC0];
DATE postDate < comment=DateString >;
} messageBoardPost[15];
int messageBoardPadding;
struct HOUSE {
char ownerName[8];
char townName[8];
ushort ownerId < format=hex >;
ushort townId < format=hex >;
byte houseFlags[0x18] < format=hex >;
byte roofColor < format=hex >;
byte roofColorTomorrow < format=hex >;
ushort housePadding < format=hex >;
int housePadding2[2] < format=hex >;
struct ROOM {
struct LAYER {
ushort items[0x100] < format=hex >;
byte itemsEnabledBitmap[0x20] < format=binary >; // each byte has 8 floor spaces attributed to it.
int layerPadding[2] < format=hex >;
} layer[4];
byte carpetLowerByte < format=hex >;
byte wallpaperLowerByte < format=hex >;
byte unknown[6] < format=hex >;
} room[3];
MAIL mail[10];
struct GYROID {
struct GYROID_ITEM {
ushort itemId < format=hex >;
byte unknown < format=hex >;
byte sellType < format=hex >;
uint sellPrice < format=decimal >;
} gyroidItem[4];
char message[0x80];
} gyroid;
int gyroidPadding < format=hex >;
DATE enterDate < comment=DateString >; // may not be enter but it's a date
byte cockroachCount < format=hex >;
byte houseEndPadding[0x2F] < format=hex >;
} house[4];
struct TOWN {
struct TOWN_ACRE_ITEMS {
ushort items[256] < format=hex >;
} townAcreItems[30];
ushort townAcreId[70] < format=hex >;
} town;
int townEndPadding;
struct VILLAGER {
ushort villagerId < format=hex >;
ushort townId < format=hex >;
char townName[8];
byte speechType < format=hex >; // Usually the lower byte of the villager id. 0xFF for islanders.
byte personality < format=hex >;
ushort padding < format=hex >;
struct PLAYER_ENTRY {
char playerName[8];
char playerTownName[8];
ushort playerId < format=hex >;
ushort playerTownId < format=hex >;
DATE metDate < comment=DateString >;
char metTownName[8]; // unsure about if it's the "met" town name.
ushort metTownId < format=hex >;
byte unknown[10] < format=hex >;
byte friendship < format=hex,comment=RealFriendshipValue >;
byte playerEntryFlags < format=binary,comment="Bit 5 (0x20) is the 're-mail' flag." >;
struct ANIMAL_MAIL {
byte unknown2 < format=hex >; // from "read" in regular mail (maybe this is really flags?)
byte stationaryItemIdLowerByte < format=hex >;
ushort presentId < format=hex >;
byte unknown8 < format=hex >; // from "unknown 3" in regular mail
char letterHeader[0x18] < format=hex >;
char letterBody[0xC0] < format=hex >;
char letterFooter[0x20] < format=hex >;
byte unknown3 < format=hex >;
struct SHORT_DATE {
ushort year;
byte month < comment=MonthString >;
byte day;
} letterSentDate < comment=ShortDateString >;
} savedLetter;
int unknown4 < format=hex >;
} playerEntry[7];
byte unknownByte < format=hex >;
struct HOUSE_COORDINATES {
byte xAcre < format=hex >;
byte yAcre < format=hex >;
byte xPosition < format=hex >;
byte yPosition < format=hex >;
} houseCoordinates;
char catchphrase[10];
byte unknownByte2 < format=hex >;
byte unknownData[14] < format=hex >;
char unknownCharArray1[8]; // probably something to do with player(s)
char unknownCharArray2[8];
ushort unknownShort1 < format=hex >;
ushort unknownShort2 < format=hex >;
byte unknownData2[6] < format=hex >;
char somePlayerName[8];
char unknownCharArray3[8];
int charArrayPadding < format=hex >;
ushort shirt < format=hex >;
byte unknownData3[7] < format=hex >;
byte villagerSchedule < format=hex >;
ushort villagerPresentShirt < format=hex,comment="This may be the shirt a villager wears if given one as a presnet." >;
byte villagerRelations[15] < format=hex,comment="The villager's relationships with other villagers." >; // Not sure about this
byte unknownData4[0x89] < format=hex >;
} villager[15];
struct LAST_VILLAGER_WHO_LEFT {
ushort villagerId < format=hex >;
ushort originalTownId < format=hex >;
char originalTownName[8];
int unknown < format=hex >;
ushort shirt < format=hex >;
int unknown < format=hex >;
} lastVillagerWhoLeft;
byte unknownAfterVillagerData[0xC8] < format=hex >; // some string stuff
struct NOOKS_SHOP {
ushort items[24] < format=hex >;
byte unknownShopData[0x28] < format=hex >;
byte shopLevelUpper2Bits < format=binary,comment=ShopSize >;
byte unknownShopByte < format=hex >;
uint shopPurchaseSum < format=decimal >; // must be greater or equal to 240,000 for Nookingtons
DATE shopDate1 < comment=DateString >; // unknown date
DATE shopUpgradeDate < comment=DateString >;
int visitorHasPurchasedFlag < format=hex,comment="if set to 1, a visitor for another town has bought an item. This is required to be one for nookingtons (also must have a total sale sum of 240,000 bells)" >;
} nooksShop;
byte unknownAfterNooksShopData[0x208] < format=hex >;
ushort nativeTownFruitItemId < format=hex,comment=FruitString >;
byte unknownAfterNativeFruitData[0x12];
MAIL unknownMail[7]; // Sent mail?
byte unknownPreBuriedData[6] < format=hex >;
DATE policeStationRefreshDate < comment=DateString >;
ushort policeStationLostAndFoundItems[21] < format=hex >;
byte unknownAfterLostAndFoundData[14] < format=hex >;
byte townTuneData[8] < format=hex,comment="Each nibble represents one of the 16 tune slots." >;
byte unknownAfterTownTuneData[12] < format=hex >; // Seems to contain a short date (year, month)
byte buriedBitmap[0x3C0] < format=binary >;
DATE nextVillagerMoveInDate < comment=DateString >;
byte unknownAfterBuriedData[0x6A] < format=hex >;
byte villagersWhoLivedInYourTownBitmap[0x1F] < format=binary,comment="A bitmap of any villagers who have ever lived in your town." >; // Not 100% sure on this.
byte unknownAfterVillagerBitmapData[0x93] < format=hex >;
PATTERN ableSistersPatterns[8];
byte unknownAfterAbleSistersData[0x40] < format=hex >;
struct ISLAND {
char islandName[8];
char townName[8];
ushort staticIslandId < format=hex >;
ushort townId < format=hex >;
TOWN_ACRE_ITEMS islandAcreItems[2];
byte acreItemsPadding[0xC] < format=hex >;
ROOM islandCabana;
byte cabanaUnknownAfterData[0x238] < format=hex >;
VILLAGER islander; // Should make a custom struct. Islander's player entires can include a furniture item to customize their house.
byte islandBuriedBitmap[0x40] < format=binary >;
byte unknownIslandData[0x118] < format=hex >;
PATTERN flag;
} island;
byte unknownAfterIslandData[0x44] < format=hex >;
byte townGrassType < format=hex,comment=GrassType >;
byte unknownEndData[0x1E7B] < format=hex >;
} save;
AC_SAVE secondCopy;
// Comment functions
string GrassType(byte GrassValue)
{
switch(GrassValue)
{
case 0x00:
return "Grass Type: Triangle";
case 0x01:
return "Grass Type: Square";
case 0x02:
return "Grass Type: Circle";
default:
return "Unknown Grass Type";
}
}
string ShopSize(byte ShopValue)
{
byte realValue = ShopValue >> 6;
realValue &= 3;
switch(realValue)
{
case 0x00:
return "Shop: Nook's Cranny";
case 0x01:
return "Shop: Nook 'n' Go";
case 0x02:
return "Shop: Nookway OR Nookingtons [if visitor flag is set to 1]";
default:
return "Unknown Shop Size";
}
}
string PlayerGender(byte Gender)
{
switch(Gender)
{
case 0x00:
return "Gender: Male";
case 0x01:
return "Gender: Female";
default:
return "Invalid Gender";
}
}
string DayOfWeek(byte WeekDay)
{
switch (WeekDay)
{
case 0x00:
return "Sunday";
case 0x01:
return "Monday";
case 0x02:
return "Tuesday";
case 0x03:
return "Wednesday";
case 0x04:
return "Thursday";
case 0x05:
return "Friday";
case 0x06:
return "Saturday";
default:
return "Invalid Week Day";
}
}
string MonthString(byte Month)
{
switch (Month)
{
case 0x01:
return "January";
case 0x02:
return "February";
case 0x03:
return "March";
case 0x04:
return "April";
case 0x05:
return "May";
case 0x06:
return "June";
case 0x07:
return "July";
case 0x08:
return "August";
case 0x09:
return "September";
case 0x0A:
return "October";
case 0x0B:
return "November";
case 0x0C:
return "December";
default:
return "Invalid Month Value";
}
}
string DayString(byte Day)
{
string day;
SPrintf(day, "%d", Day);
if (Day > 10 && Day < 20)
day += "th";
else if (Day % 10 == 1)
day += "st";
else if (Day % 10 == 2)
day += "nd";
else if (Day % 10 == 3)
day += "rd";
else
day += "th";
return day;
}
string HourString(byte Hour)
{
string hour;
if (Hour == 0)
return "12";
else if (Hour > 12)
SPrintf(hour, "%d", Hour - 12);
else
SPrintf(hour, "%d", Hour);
return hour;
}
string GetAmPm(byte hour)
{
if (hour < 12)
return "AM";
else
return "PM";
}
string DateString(DATE &date)
{
string year;
string minute;
string second;
SPrintf(year, "%d", date.year);
SPrintf(minute, "%02d", date.minute);
SPrintf(second, "%02d", date.second);
return DayOfWeek(date.dayOfWeek) + ", " + MonthString(date.month) + " "
+ DayString(date.day) + ", " + year + " at " + HourString(date.hour) + ":"
+ minute + ":" + second + " " + GetAmPm(date.hour);
}
string ShortDateString(SHORT_DATE &date)
{
string year;
SPrintf(year, "%d", date.year);
return MonthString(date.month) + " " + DayString(date.day) + ", " + year;
}
string BirthdayString(BIRTHDAY &birthday)
{
return MonthString(birthday.month) + " " + DayString(birthday.day);
}
string RealFriendshipValue(byte Friendship)
{
string friendship;
if (Friendship < 1)
return "Invalid friendship level. Needs to be between 0x01 and 0x7F.";
SPrintf(friendship, "%d", Friendship - 1);
return "Real friendship level: " + friendship;
}
string FruitString(ushort FruitId)
{
switch (FruitId)
{
case 0x2800:
return "Apple";
case 0x2801:
return "Cherry";
case 0x2802:
return "Pear";
case 0x2803:
return "Peach";
case 0x2804:
return "Orange";
default:
return "Invalid Fruit Item Id (0x2800-0x2805)";
}
}