diff options
Diffstat (limited to 'src')
33 files changed, 3842 insertions, 671 deletions
diff --git a/src/battle_anim_mons.c b/src/battle_anim_mons.c index 3f4a35475..688009519 100644 --- a/src/battle_anim_mons.c +++ b/src/battle_anim_mons.c @@ -1815,7 +1815,7 @@ void SetBattlerSpriteYOffsetFromYScale(u8 spriteId) { int var = 64 - GetBattlerYDeltaFromSpriteId(spriteId) * 2; u16 matrix = gSprites[spriteId].oam.matrixNum; - int var2 = (var << 8) / gOamMatrices[matrix].d; + int var2 = SAFE_DIV(var << 8, gOamMatrices[matrix].d); if (var2 > 128) var2 = 128; @@ -1828,7 +1828,7 @@ void SetBattlerSpriteYOffsetFromOtherYScale(u8 spriteId, u8 otherSpriteId) { int var = 64 - GetBattlerYDeltaFromSpriteId(otherSpriteId) * 2; u16 matrix = gSprites[spriteId].oam.matrixNum; - int var2 = (var << 8) / gOamMatrices[matrix].d; + int var2 = SAFE_DIV(var << 8, gOamMatrices[matrix].d); if (var2 > 128) var2 = 128; diff --git a/src/battle_arena.c b/src/battle_arena.c index 0ffba4910..11c918225 100644 --- a/src/battle_arena.c +++ b/src/battle_arena.c @@ -774,7 +774,8 @@ void BattleArena_DeductMindPoints(u8 battler, u16 stringId) } } -void sub_81A586C(u8 battler) // Unused. +// Unused +static void UpdateHPAtStart(u8 battler) { u16 *hpAtStart = gBattleStruct->arenaStartHp; diff --git a/src/battle_factory_screen.c b/src/battle_factory_screen.c index 8c056da1b..7b0af774a 100644 --- a/src/battle_factory_screen.c +++ b/src/battle_factory_screen.c @@ -529,7 +529,7 @@ static const union AnimCmd * const sAnims_Select_Pokeball[] = sAnim_Select_Pokeball_Moving, }; -static const union AffineAnimCmd gUnknown_0861050C[] = +static const union AffineAnimCmd sAffineAnim_Select_MonPicBg_Opening[] = { AFFINEANIMCMD_FRAME(5, 5, 0, 0), AFFINEANIMCMD_FRAME(0, 0, 0, 1), @@ -545,7 +545,7 @@ static const union AffineAnimCmd gUnknown_0861050C[] = AFFINEANIMCMD_END, }; -static const union AffineAnimCmd gUnknown_0861056C[] = +static const union AffineAnimCmd sAffineAnim_Select_MonPicBg_Closing[] = { AFFINEANIMCMD_FRAME(128, 5, 0, 0), AFFINEANIMCMD_FRAME(0, 0, 0, 1), @@ -559,7 +559,7 @@ static const union AffineAnimCmd gUnknown_0861056C[] = AFFINEANIMCMD_END, }; -static const union AffineAnimCmd gUnknown_086105BC[] = +static const union AffineAnimCmd sAffineAnim_Select_MonPicBg_Open[] = { AFFINEANIMCMD_FRAME(256, 256, 0, 0), AFFINEANIMCMD_END, @@ -567,9 +567,9 @@ static const union AffineAnimCmd gUnknown_086105BC[] = static const union AffineAnimCmd * const sAffineAnims_Select_MonPicBgAnim[] = { - gUnknown_0861050C, - gUnknown_0861056C, - gUnknown_086105BC, + sAffineAnim_Select_MonPicBg_Opening, + sAffineAnim_Select_MonPicBg_Closing, + sAffineAnim_Select_MonPicBg_Open, }; static const struct SpriteTemplate sSpriteTemplate_Select_Pokeball = @@ -780,7 +780,7 @@ static const union AnimCmd * const sAnims_Swap_Pokeball[] = sAnim_Swap_Pokeball_Moving, }; -static const union AffineAnimCmd gUnknown_08610768[] = +static const union AffineAnimCmd sAffineAnim_Swap_MonPicBg_Opening[] = { AFFINEANIMCMD_FRAME(5, 5, 0, 0), AFFINEANIMCMD_FRAME(0, 0, 0, 1), @@ -796,7 +796,7 @@ static const union AffineAnimCmd gUnknown_08610768[] = AFFINEANIMCMD_END, }; -static const union AffineAnimCmd gUnknown_086107C8[] = +static const union AffineAnimCmd sAffineAnim_Swap_MonPicBg_Closing[] = { AFFINEANIMCMD_FRAME(128, 5, 0, 0), AFFINEANIMCMD_FRAME(0, 0, 0, 1), @@ -810,7 +810,7 @@ static const union AffineAnimCmd gUnknown_086107C8[] = AFFINEANIMCMD_END, }; -static const union AffineAnimCmd gUnknown_08610818[] = +static const union AffineAnimCmd sAffineAnim_Swap_MonPicBg_Open[] = { AFFINEANIMCMD_FRAME(256, 256, 0, 0), AFFINEANIMCMD_END, @@ -818,9 +818,9 @@ static const union AffineAnimCmd gUnknown_08610818[] = static const union AffineAnimCmd * const sAffineAnims_Swap_MonPicBgAnim[] = { - gUnknown_08610768, - gUnknown_086107C8, - gUnknown_08610818, + sAffineAnim_Swap_MonPicBg_Opening, + sAffineAnim_Swap_MonPicBg_Closing, + sAffineAnim_Swap_MonPicBg_Open, }; static const struct SpriteTemplate sSpriteTemplate_Swap_Pokeball = diff --git a/src/battle_pike.c b/src/battle_pike.c index ccb52fda2..ed89f5ed9 100644 --- a/src/battle_pike.c +++ b/src/battle_pike.c @@ -57,8 +57,8 @@ static void GetRoomType(void); static void SetInWildMonRoom(void); static void ClearInWildMonRoom(void); static void SavePikeChallenge(void); -static void nullsub_76(void); -static void nullsub_124(void); +static void PikeDummy1(void); +static void PikeDummy2(void); static void GetRoomInflictedStatus(void); static void GetRoomInflictedStatusMon(void); static void HealOneOrTwoMons(void); @@ -488,8 +488,8 @@ static void (* const sBattlePikeFunctions[])(void) = [BATTLE_PIKE_FUNC_SET_IN_WILD_MON_ROOM] = SetInWildMonRoom, [BATTLE_PIKE_FUNC_CLEAR_IN_WILD_MON_ROOM] = ClearInWildMonRoom, [BATTLE_PIKE_FUNC_SAVE] = SavePikeChallenge, - [BATTLE_PIKE_FUNC_NULL_9] = nullsub_76, - [BATTLE_PIKE_FUNC_NULL_10] = nullsub_124, + [BATTLE_PIKE_FUNC_DUMMY_1] = PikeDummy1, + [BATTLE_PIKE_FUNC_DUMMY_2] = PikeDummy2, [BATTLE_PIKE_FUNC_GET_ROOM_STATUS] = GetRoomInflictedStatus, [BATTLE_PIKE_FUNC_GET_ROOM_STATUS_MON] = GetRoomInflictedStatusMon, [BATTLE_PIKE_FUNC_HEAL_ONE_TWO_MONS] = HealOneOrTwoMons, @@ -715,12 +715,12 @@ static void SavePikeChallenge(void) TrySavingData(SAVE_LINK); } -static void nullsub_76(void) +static void PikeDummy1(void) { } -static void nullsub_124(void) +static void PikeDummy2(void) { } diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 43c554e88..96c849cbc 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -258,7 +258,7 @@ static void Cmd_trysetperishsong(void); static void Cmd_rolloutdamagecalculation(void); static void Cmd_jumpifconfusedandstatmaxed(void); static void Cmd_furycuttercalc(void); -static void Cmd_happinesstodamagecalculation(void); +static void Cmd_friendshiptodamagecalculation(void); static void Cmd_presentdamagecalculation(void); static void Cmd_setsafeguard(void); static void Cmd_magnitudedamagecalculation(void); @@ -510,7 +510,7 @@ void (* const gBattleScriptingCommandsTable[])(void) = Cmd_rolloutdamagecalculation, //0xB3 Cmd_jumpifconfusedandstatmaxed, //0xB4 Cmd_furycuttercalc, //0xB5 - Cmd_happinesstodamagecalculation, //0xB6 + Cmd_friendshiptodamagecalculation, //0xB6 Cmd_presentdamagecalculation, //0xB7 Cmd_setsafeguard, //0xB8 Cmd_magnitudedamagecalculation, //0xB9 @@ -8471,7 +8471,7 @@ static void Cmd_furycuttercalc(void) } } -static void Cmd_happinesstodamagecalculation(void) +static void Cmd_friendshiptodamagecalculation(void) { if (gBattleMoves[gCurrentMove].effect == EFFECT_RETURN) gDynamicBasePower = 10 * (gBattleMons[gBattlerAttacker].friendship) / 25; diff --git a/src/battle_tower.c b/src/battle_tower.c index 1bf4b737c..b1e5d7817 100644 --- a/src/battle_tower.c +++ b/src/battle_tower.c @@ -878,12 +878,8 @@ static const u16 sFrontierTrainerIdRangesHard[][2] = {FRONTIER_TRAINER_JAXON, FRONTIER_TRAINER_GRETEL}, // 200 - 299 }; -// Trainer IDs? Don't make sense as part of previous array, min/max relationship reversed and never accessed -static const u16 sUnused_085DFA1A[][2] = -{ - {179, 141}, // FRONTIER_TRAINER_ALISON - FRONTIER_TRAINER_KAYDEN - {200, 183}, // FRONTIER_TRAINER_JAXON - FRONTIER_TRAINER_HUNTER -}; +// Unknown, unused data +static const u16 sUnused[] = { 179, 141, 200, 183 }; static const u8 sBattleTowerPartySizes[FRONTIER_MODE_COUNT] = { diff --git a/src/battle_util.c b/src/battle_util.c index 2bf06f331..6e1202bd1 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -3949,7 +3949,7 @@ u8 GetMoveTarget(u16 move, u8 setTarget) return targetBattler; } -static bool32 IsNotEventLegalMewOrDeoxys(u8 battlerId) +static bool32 IsMonEventLegal(u8 battlerId) { if (GetBattlerSide(battlerId) == B_SIDE_OPPONENT) return TRUE; @@ -3970,7 +3970,7 @@ u8 IsMonDisobedient(void) if (GetBattlerSide(gBattlerAttacker) == B_SIDE_OPPONENT) return 0; - if (IsNotEventLegalMewOrDeoxys(gBattlerAttacker)) // only if species is Mew or Deoxys + if (IsMonEventLegal(gBattlerAttacker)) // only false if illegal Mew or Deoxys { if (gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER && GetBattlerPosition(gBattlerAttacker) == 2) return 0; diff --git a/src/cable_club.c b/src/cable_club.c index 8b321d670..1d8c6e53d 100644 --- a/src/cable_club.c +++ b/src/cable_club.c @@ -904,7 +904,7 @@ static void Task_StartWirelessCableClubBattle(u8 taskId) { struct LinkPlayer *player = (struct LinkPlayer *)gBlockRecvBuffer[i]; gLinkPlayers[i] = *player; - sub_800B524(&gLinkPlayers[i]); + ConvertLinkPlayerName(&gLinkPlayers[i]); ResetBlockReceivedFlag(i); } tState = 4; diff --git a/src/data/items.h b/src/data/items.h index e4e7e0fbc..fc7792186 100644 --- a/src/data/items.h +++ b/src/data/items.h @@ -2250,7 +2250,7 @@ const struct Item gItems[] = .name = _("SOOTHE BELL"), .itemId = ITEM_SOOTHE_BELL, .price = 100, - .holdEffect = HOLD_EFFECT_HAPPINESS_UP, + .holdEffect = HOLD_EFFECT_FRIENDSHIP_UP, .description = sSootheBellDesc, .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, diff --git a/src/data/party_menu.h b/src/data/party_menu.h index daf3f4f6c..a4a030e3f 100644 --- a/src/data/party_menu.h +++ b/src/data/party_menu.h @@ -543,7 +543,7 @@ static const struct WindowTemplate sLevelUpStatsWindowTemplate = .baseBlock = 0x2E9, }; -static const struct WindowTemplate sUnusedWindowTemplate_08615978 = +static const struct WindowTemplate sUnusedWindowTemplate1 = { .bg = 2, .tilemapLeft = 2, @@ -554,7 +554,7 @@ static const struct WindowTemplate sUnusedWindowTemplate_08615978 = .baseBlock = 0x1DF, }; -static const struct WindowTemplate sUnusedWindowTemplate_08615980 = +static const struct WindowTemplate sUnusedWindowTemplate2 = { .bg = 2, .tilemapLeft = 0, @@ -669,7 +669,7 @@ static const u8 *const sDescriptionStringTable[] = [PARTYBOX_DESC_DONT_HAVE] = gText_DontHave, }; -static const u16 sUnused_08615B94[] = +static const u16 sUnusedData[] = { 0x0108, 0x0151, 0x0160, 0x015b, 0x002e, 0x005c, 0x0102, 0x0153, 0x014b, 0x00ed, 0x00f1, 0x010d, 0x003a, 0x003b, 0x003f, 0x0071, 0x00b6, 0x00f0, 0x00ca, 0x00db, 0x00da, 0x004c, 0x00e7, 0x0055, 0x0057, 0x0059, 0x00d8, 0x005b, 0x005e, 0x00f7, 0x0118, 0x0068, diff --git a/src/data/pointillism_points.h b/src/data/pointillism_points.h new file mode 100644 index 000000000..708f5c02e --- /dev/null +++ b/src/data/pointillism_points.h @@ -0,0 +1,3210 @@ +#define GET_POINT_OFFSET_DL(bits) (((bits) >> 0) & 1) +#define GET_POINT_COLOR_TYPE(bits) (((bits) >> 1) & 3) +#define GET_POINT_DELTA(bits) (((bits) >> 3) & 7) + +#define PT(x, y, delta, colorType, offsetDownLeft) x, y, (delta << 3) | (colorType << 1) | offsetDownLeft + +static const u8 sPointillismPoints[][3] = { + PT( 0, 29, 3, 2, FALSE), + PT(14, 30, 3, 1, TRUE), + PT( 0, 1, 6, 1, FALSE), + PT(46, 30, 6, 3, TRUE), + PT(10, 34, 3, 3, TRUE), + PT( 5, 38, 5, 3, FALSE), + PT(18, 23, 3, 3, FALSE), + PT(26, 3, 2, 0, TRUE), + PT( 5, 17, 3, 0, FALSE), + PT( 5, 39, 5, 3, TRUE), + PT(26, 63, 2, 1, FALSE), + PT(34, 63, 2, 3, FALSE), + PT(43, 47, 5, 3, FALSE), + PT(17, 2, 5, 2, TRUE), + PT(35, 13, 5, 0, FALSE), + PT(23, 12, 3, 0, TRUE), + PT(47, 14, 2, 1, TRUE), + PT(48, 24, 4, 0, FALSE), + PT(45, 40, 4, 1, FALSE), + PT( 1, 3, 3, 0, TRUE), + PT(14, 42, 5, 1, TRUE), + PT(34, 21, 4, 2, TRUE), + PT(34, 10, 4, 3, FALSE), + PT(57, 6, 4, 1, TRUE), + PT(22, 7, 5, 3, TRUE), + PT(34, 58, 3, 1, TRUE), + PT(59, 54, 6, 2, TRUE), + PT(10, 43, 4, 2, FALSE), + PT(54, 9, 2, 1, FALSE), + PT(28, 47, 4, 1, TRUE), + PT(46, 56, 5, 2, FALSE), + PT( 5, 42, 4, 0, FALSE), + PT( 7, 20, 6, 1, FALSE), + PT(49, 8, 2, 3, TRUE), + PT(26, 36, 5, 2, TRUE), + PT(34, 10, 2, 3, FALSE), + PT(27, 38, 5, 1, TRUE), + PT(41, 22, 2, 0, TRUE), + PT(53, 8, 2, 2, FALSE), + PT(30, 8, 2, 2, FALSE), + PT( 5, 49, 2, 2, FALSE), + PT(56, 49, 2, 3, TRUE), + PT(52, 51, 2, 1, FALSE), + PT(17, 9, 3, 3, TRUE), + PT(40, 61, 6, 1, FALSE), + PT(53, 3, 3, 3, FALSE), + PT(60, 43, 5, 3, FALSE), + PT(16, 1, 2, 3, TRUE), + PT( 3, 62, 4, 1, FALSE), + PT(23, 24, 6, 2, FALSE), + PT( 8, 41, 3, 0, TRUE), + PT( 3, 36, 5, 0, FALSE), + PT(61, 51, 5, 3, TRUE), + PT(49, 36, 3, 0, TRUE), + PT(27, 24, 4, 3, FALSE), + PT( 7, 13, 4, 2, TRUE), + PT(45, 63, 2, 1, FALSE), + PT(47, 21, 4, 2, TRUE), + PT(41, 15, 2, 1, FALSE), + PT( 7, 44, 2, 1, FALSE), + PT(44, 11, 4, 3, FALSE), + PT(18, 26, 2, 3, FALSE), + PT( 0, 11, 5, 3, TRUE), + PT(22, 53, 4, 2, FALSE), + PT(31, 28, 4, 1, FALSE), + PT(41, 51, 4, 3, TRUE), + PT(59, 48, 2, 3, TRUE), + PT(17, 6, 6, 2, TRUE), + PT(62, 49, 5, 3, TRUE), + PT(17, 58, 4, 2, TRUE), + PT(42, 2, 3, 0, TRUE), + PT(51, 24, 6, 2, TRUE), + PT(42, 32, 4, 0, TRUE), + PT(46, 50, 3, 1, TRUE), + PT(59, 31, 4, 1, TRUE), + PT(57, 41, 5, 1, FALSE), + PT(46, 49, 5, 0, TRUE), + PT(42, 14, 5, 2, TRUE), + PT(45, 0, 3, 3, TRUE), + PT(56, 40, 3, 1, TRUE), + PT(20, 59, 5, 1, TRUE), + PT(46, 4, 4, 3, FALSE), + PT(54, 48, 2, 0, TRUE), + PT(59, 33, 5, 2, TRUE), + PT(43, 63, 3, 1, TRUE), + PT(32, 19, 6, 0, TRUE), + PT(51, 12, 6, 0, FALSE), + PT(34, 43, 5, 1, TRUE), + PT(22, 2, 3, 3, FALSE), + PT(28, 18, 3, 2, FALSE), + PT(15, 60, 6, 3, FALSE), + PT(56, 16, 5, 2, TRUE), + PT(24, 47, 5, 2, TRUE), + PT(53, 59, 2, 0, TRUE), + PT(55, 49, 2, 1, TRUE), + PT(19, 61, 5, 3, TRUE), + PT(30, 44, 6, 1, TRUE), + PT(46, 55, 2, 1, FALSE), + PT(60, 31, 6, 1, TRUE), + PT(50, 42, 4, 3, TRUE), + PT(13, 59, 3, 2, FALSE), + PT(53, 42, 4, 3, TRUE), + PT( 9, 61, 4, 3, TRUE), + PT(18, 11, 3, 0, FALSE), + PT(12, 21, 3, 2, TRUE), + PT(32, 1, 3, 2, FALSE), + PT( 8, 59, 3, 2, FALSE), + PT(18, 55, 6, 1, TRUE), + PT(21, 3, 5, 2, FALSE), + PT(42, 59, 6, 0, TRUE), + PT(15, 4, 6, 2, TRUE), + PT( 8, 23, 6, 1, TRUE), + PT(56, 61, 5, 1, FALSE), + PT(47, 53, 2, 3, FALSE), + PT(16, 53, 2, 3, FALSE), + PT(35, 19, 5, 2, FALSE), + PT(47, 6, 4, 0, FALSE), + PT(39, 58, 4, 2, FALSE), + PT( 0, 28, 5, 1, FALSE), + PT( 3, 57, 3, 2, TRUE), + PT(40, 7, 3, 1, FALSE), + PT(32, 10, 6, 3, TRUE), + PT( 7, 53, 5, 2, TRUE), + PT(21, 47, 5, 2, FALSE), + PT(16, 44, 4, 1, TRUE), + PT(63, 41, 2, 2, FALSE), + PT(42, 33, 6, 3, FALSE), + PT(52, 26, 5, 2, FALSE), + PT(28, 61, 6, 1, TRUE), + PT(56, 43, 4, 1, FALSE), + PT(53, 40, 3, 3, TRUE), + PT(61, 15, 3, 2, FALSE), + PT(30, 62, 3, 1, TRUE), + PT(12, 62, 3, 3, TRUE), + PT(43, 49, 5, 2, FALSE), + PT(50, 57, 2, 0, TRUE), + PT( 5, 9, 2, 0, TRUE), + PT( 4, 56, 5, 1, FALSE), + PT(50, 0, 2, 3, FALSE), + PT(19, 11, 6, 0, TRUE), + PT(52, 42, 2, 1, TRUE), + PT(44, 34, 4, 0, TRUE), + PT(57, 47, 2, 2, TRUE), + PT(55, 40, 3, 3, FALSE), + PT( 7, 59, 5, 2, TRUE), + PT(17, 3, 5, 0, FALSE), + PT(45, 48, 3, 3, FALSE), + PT(49, 17, 2, 0, TRUE), + PT(35, 1, 3, 3, FALSE), + PT(61, 49, 6, 2, FALSE), + PT(28, 2, 6, 2, FALSE), + PT(33, 14, 4, 2, TRUE), + PT(61, 7, 2, 3, TRUE), + PT(51, 21, 2, 0, FALSE), + PT(41, 50, 6, 1, FALSE), + PT(24, 31, 6, 0, FALSE), + PT(45, 59, 6, 0, FALSE), + PT(39, 62, 2, 3, FALSE), + PT(49, 21, 2, 1, FALSE), + PT(48, 37, 2, 3, TRUE), + PT(51, 6, 6, 2, FALSE), + PT( 0, 41, 3, 0, FALSE), + PT(60, 3, 2, 1, FALSE), + PT(44, 12, 2, 0, TRUE), + PT( 9, 48, 6, 0, FALSE), + PT(16, 14, 2, 0, TRUE), + PT(39, 22, 3, 1, TRUE), + PT(12, 59, 5, 3, FALSE), + PT(43, 51, 3, 3, FALSE), + PT(19, 45, 5, 2, TRUE), + PT(17, 36, 5, 0, TRUE), + PT(52, 62, 5, 1, TRUE), + PT(36, 30, 4, 0, TRUE), + PT(39, 26, 5, 2, TRUE), + PT( 4, 57, 2, 3, FALSE), + PT(62, 51, 4, 3, FALSE), + PT(27, 46, 4, 2, TRUE), + PT(12, 6, 3, 0, TRUE), + PT(37, 25, 3, 0, FALSE), + PT(29, 51, 6, 1, TRUE), + PT(29, 40, 5, 2, TRUE), + PT(28, 16, 5, 1, FALSE), + PT(31, 53, 3, 3, FALSE), + PT(52, 2, 2, 0, FALSE), + PT(43, 58, 2, 2, FALSE), + PT(13, 11, 2, 2, TRUE), + PT(12, 44, 2, 0, FALSE), + PT(55, 58, 3, 0, TRUE), + PT( 6, 19, 2, 3, TRUE), + PT(36, 16, 4, 2, TRUE), + PT(36, 4, 3, 3, FALSE), + PT( 0, 53, 6, 2, FALSE), + PT(58, 0, 6, 3, TRUE), + PT(60, 7, 3, 1, FALSE), + PT(43, 40, 6, 3, FALSE), + PT(52, 57, 5, 3, TRUE), + PT(40, 9, 3, 3, TRUE), + PT(56, 49, 6, 0, FALSE), + PT(22, 37, 6, 0, TRUE), + PT(24, 40, 6, 0, TRUE), + PT(24, 12, 4, 1, FALSE), + PT( 6, 57, 5, 2, TRUE), + PT(61, 32, 4, 2, FALSE), + PT(46, 39, 4, 0, TRUE), + PT(62, 24, 3, 0, FALSE), + PT(21, 60, 4, 2, FALSE), + PT( 6, 27, 4, 3, FALSE), + PT(21, 14, 4, 1, FALSE), + PT(10, 13, 3, 3, TRUE), + PT(24, 22, 6, 2, FALSE), + PT(16, 40, 4, 0, TRUE), + PT(32, 17, 2, 0, TRUE), + PT(54, 50, 2, 2, TRUE), + PT(59, 46, 4, 2, FALSE), + PT(31, 45, 2, 1, FALSE), + PT(54, 46, 4, 0, FALSE), + PT(11, 23, 6, 1, TRUE), + PT(38, 3, 3, 3, TRUE), + PT( 8, 25, 6, 0, TRUE), + PT(42, 24, 4, 2, TRUE), + PT(53, 45, 5, 2, TRUE), + PT(48, 56, 3, 0, FALSE), + PT(28, 37, 2, 2, FALSE), + PT(28, 34, 5, 0, FALSE), + PT( 8, 35, 4, 0, TRUE), + PT(38, 30, 6, 0, FALSE), + PT(25, 15, 2, 2, TRUE), + PT(16, 47, 4, 1, FALSE), + PT(18, 2, 4, 2, TRUE), + PT(60, 1, 3, 2, TRUE), + PT(14, 20, 3, 0, FALSE), + PT(13, 24, 2, 3, TRUE), + PT(34, 11, 6, 0, TRUE), + PT(19, 52, 4, 0, TRUE), + PT(15, 45, 6, 3, FALSE), + PT(57, 31, 4, 2, TRUE), + PT(24, 16, 3, 3, TRUE), + PT(45, 32, 4, 0, FALSE), + PT(25, 11, 6, 0, TRUE), + PT(51, 19, 2, 2, FALSE), + PT(46, 17, 4, 0, TRUE), + PT(45, 10, 6, 3, TRUE), + PT( 7, 21, 3, 1, TRUE), + PT(50, 4, 6, 1, FALSE), + PT( 6, 24, 3, 1, TRUE), + PT(19, 36, 2, 1, FALSE), + PT(54, 34, 2, 3, FALSE), + PT(29, 41, 3, 2, FALSE), + PT(53, 23, 4, 0, TRUE), + PT(54, 23, 5, 1, TRUE), + PT(53, 50, 3, 0, TRUE), + PT(42, 15, 5, 3, FALSE), + PT(16, 0, 6, 2, FALSE), + PT( 2, 14, 5, 0, FALSE), + PT(49, 50, 6, 1, FALSE), + PT(59, 5, 4, 0, FALSE), + PT(54, 38, 2, 1, FALSE), + PT(52, 6, 6, 2, FALSE), + PT(30, 49, 6, 1, FALSE), + PT(53, 5, 6, 2, FALSE), + PT(30, 19, 2, 2, TRUE), + PT(21, 20, 5, 2, FALSE), + PT(41, 28, 3, 0, FALSE), + PT(36, 36, 2, 1, FALSE), + PT(34, 41, 3, 0, FALSE), + PT(52, 54, 6, 0, FALSE), + PT(30, 1, 4, 1, TRUE), + PT(12, 60, 4, 2, FALSE), + PT(10, 61, 2, 3, FALSE), + PT(39, 30, 4, 1, TRUE), + PT(21, 2, 2, 1, FALSE), + PT(17, 25, 5, 1, FALSE), + PT(29, 49, 2, 2, TRUE), + PT( 3, 59, 5, 1, FALSE), + PT(33, 25, 5, 2, FALSE), + PT(10, 35, 2, 0, TRUE), + PT(37, 17, 3, 1, FALSE), + PT(26, 10, 6, 2, FALSE), + PT(59, 11, 6, 1, TRUE), + PT(33, 11, 6, 3, TRUE), + PT( 1, 49, 5, 0, FALSE), + PT(53, 29, 4, 3, TRUE), + PT(44, 48, 6, 0, TRUE), + PT(46, 57, 5, 2, TRUE), + PT(48, 5, 5, 2, FALSE), + PT(18, 42, 5, 1, TRUE), + PT(57, 34, 4, 0, FALSE), + PT(21, 52, 3, 2, FALSE), + PT(28, 1, 2, 2, TRUE), + PT(32, 22, 4, 1, FALSE), + PT(19, 4, 3, 0, FALSE), + PT(30, 19, 2, 0, FALSE), + PT(37, 51, 2, 2, TRUE), + PT(57, 3, 6, 0, TRUE), + PT(63, 54, 3, 0, FALSE), + PT(20, 35, 2, 0, FALSE), + PT(47, 30, 3, 3, TRUE), + PT(31, 23, 5, 2, FALSE), + PT( 2, 22, 6, 0, TRUE), + PT(32, 24, 6, 0, FALSE), + PT(46, 24, 6, 3, TRUE), + PT(59, 14, 6, 0, FALSE), + PT(16, 57, 4, 2, FALSE), + PT(38, 57, 3, 3, FALSE), + PT(48, 38, 5, 3, FALSE), + PT(18, 1, 2, 2, FALSE), + PT(55, 42, 5, 3, FALSE), + PT(33, 6, 3, 2, TRUE), + PT(42, 22, 6, 1, FALSE), + PT( 9, 56, 3, 2, FALSE), + PT( 7, 34, 2, 3, TRUE), + PT(59, 45, 2, 2, TRUE), + PT( 7, 30, 5, 3, FALSE), + PT(27, 46, 3, 2, TRUE), + PT( 4, 9, 6, 0, FALSE), + PT(48, 45, 6, 3, TRUE), + PT(45, 52, 4, 2, FALSE), + PT(24, 36, 4, 2, TRUE), + PT(14, 45, 4, 3, FALSE), + PT(35, 10, 2, 3, FALSE), + PT(18, 45, 2, 0, TRUE), + PT(33, 40, 5, 3, FALSE), + PT(15, 1, 4, 0, TRUE), + PT( 1, 49, 2, 1, FALSE), + PT(63, 27, 3, 3, FALSE), + PT(33, 37, 5, 1, TRUE), + PT(38, 24, 2, 1, TRUE), + PT(21, 45, 6, 2, FALSE), + PT(35, 33, 6, 3, FALSE), + PT(14, 46, 3, 2, FALSE), + PT(20, 34, 3, 2, FALSE), + PT(44, 11, 5, 0, FALSE), + PT(26, 24, 4, 0, TRUE), + PT(33, 7, 3, 1, FALSE), + PT(36, 38, 5, 0, TRUE), + PT(43, 10, 6, 2, FALSE), + PT(62, 39, 6, 1, TRUE), + PT(18, 52, 3, 1, TRUE), + PT(31, 1, 5, 1, FALSE), + PT(46, 6, 4, 1, TRUE), + PT(47, 31, 2, 2, FALSE), + PT(24, 6, 4, 3, FALSE), + PT(49, 31, 5, 1, TRUE), + PT(34, 38, 5, 3, FALSE), + PT(30, 21, 2, 3, FALSE), + PT(32, 34, 5, 0, FALSE), + PT(21, 55, 2, 1, FALSE), + PT(37, 4, 5, 2, FALSE), + PT(31, 4, 5, 3, FALSE), + PT(12, 19, 3, 0, FALSE), + PT( 7, 11, 6, 3, FALSE), + PT(29, 28, 5, 1, FALSE), + PT(48, 34, 3, 2, FALSE), + PT(46, 18, 5, 3, TRUE), + PT(43, 33, 3, 3, FALSE), + PT(22, 56, 6, 0, FALSE), + PT( 4, 2, 2, 3, FALSE), + PT( 5, 20, 4, 0, FALSE), + PT(56, 60, 6, 1, TRUE), + PT(33, 27, 5, 3, TRUE), + PT(20, 42, 4, 3, TRUE), + PT(56, 20, 3, 1, TRUE), + PT(43, 31, 5, 1, TRUE), + PT(41, 43, 4, 2, TRUE), + PT(39, 54, 4, 0, TRUE), + PT(17, 34, 3, 1, TRUE), + PT(41, 3, 3, 1, TRUE), + PT(24, 36, 5, 0, FALSE), + PT(33, 45, 6, 3, FALSE), + PT(60, 44, 4, 2, FALSE), + PT(51, 23, 3, 3, TRUE), + PT(42, 58, 4, 0, TRUE), + PT(10, 35, 6, 3, TRUE), + PT( 0, 11, 4, 0, TRUE), + PT(17, 56, 3, 0, TRUE), + PT(15, 14, 3, 2, FALSE), + PT(31, 15, 6, 3, TRUE), + PT(60, 16, 6, 3, TRUE), + PT(56, 49, 6, 2, TRUE), + PT( 7, 21, 5, 0, FALSE), + PT(30, 46, 3, 0, TRUE), + PT(38, 16, 6, 1, TRUE), + PT(61, 53, 5, 3, TRUE), + PT(58, 4, 6, 2, FALSE), + PT(13, 24, 3, 1, FALSE), + PT( 1, 45, 2, 2, TRUE), + PT(61, 26, 2, 3, TRUE), + PT(23, 63, 6, 1, FALSE), + PT(11, 33, 2, 0, TRUE), + PT(30, 38, 5, 1, TRUE), + PT(13, 25, 4, 2, FALSE), + PT(46, 4, 3, 1, TRUE), + PT(27, 51, 4, 0, FALSE), + PT(21, 33, 3, 2, TRUE), + PT(31, 4, 4, 0, TRUE), + PT(15, 18, 3, 3, TRUE), + PT(45, 42, 6, 1, FALSE), + PT( 3, 55, 3, 3, TRUE), + PT(53, 7, 4, 3, TRUE), + PT(36, 31, 6, 0, TRUE), + PT(47, 48, 2, 2, TRUE), + PT( 6, 0, 4, 2, FALSE), + PT(11, 34, 3, 1, FALSE), + PT(12, 59, 5, 0, TRUE), + PT(20, 26, 2, 3, TRUE), + PT(55, 32, 4, 2, TRUE), + PT(63, 38, 6, 3, TRUE), + PT(58, 62, 2, 0, FALSE), + PT(34, 4, 2, 0, TRUE), + PT(40, 18, 3, 2, FALSE), + PT( 3, 46, 5, 3, FALSE), + PT(14, 56, 5, 0, FALSE), + PT( 1, 41, 4, 1, FALSE), + PT(30, 51, 3, 0, TRUE), + PT( 6, 33, 4, 3, TRUE), + PT(51, 25, 3, 1, FALSE), + PT( 2, 5, 2, 3, TRUE), + PT(17, 17, 5, 2, FALSE), + PT(31, 38, 3, 3, FALSE), + PT(57, 31, 5, 0, FALSE), + PT(46, 47, 2, 1, FALSE), + PT(34, 52, 2, 1, TRUE), + PT(59, 38, 5, 3, TRUE), + PT(52, 0, 2, 2, FALSE), + PT(16, 49, 2, 0, TRUE), + PT(29, 45, 5, 1, FALSE), + PT( 8, 8, 6, 3, TRUE), + PT(21, 24, 6, 2, FALSE), + PT( 4, 43, 4, 2, FALSE), + PT(47, 30, 4, 3, TRUE), + PT(34, 42, 4, 2, FALSE), + PT( 7, 20, 4, 2, TRUE), + PT( 1, 39, 3, 0, TRUE), + PT(41, 10, 5, 0, TRUE), + PT(61, 28, 5, 3, TRUE), + PT(13, 31, 3, 2, FALSE), + PT(36, 61, 6, 1, FALSE), + PT(54, 29, 4, 2, FALSE), + PT(20, 33, 2, 3, FALSE), + PT(26, 13, 5, 0, TRUE), + PT(63, 43, 5, 1, FALSE), + PT(26, 62, 6, 2, TRUE), + PT(17, 40, 3, 0, FALSE), + PT(50, 5, 2, 2, TRUE), + PT(33, 46, 6, 2, FALSE), + PT(45, 20, 5, 1, FALSE), + PT(60, 8, 6, 3, TRUE), + PT(63, 52, 3, 3, FALSE), + PT(39, 36, 3, 2, FALSE), + PT(22, 22, 6, 1, TRUE), + PT(41, 59, 3, 0, TRUE), + PT(54, 47, 3, 2, FALSE), + PT( 3, 37, 5, 2, FALSE), + PT(11, 22, 6, 3, FALSE), + PT(28, 29, 3, 1, TRUE), + PT(44, 39, 3, 1, TRUE), + PT(11, 31, 5, 1, TRUE), + PT( 8, 16, 4, 3, TRUE), + PT(63, 37, 5, 3, TRUE), + PT(51, 19, 3, 3, TRUE), + PT( 4, 49, 6, 3, TRUE), + PT(14, 47, 2, 1, FALSE), + PT( 8, 35, 4, 0, FALSE), + PT(58, 26, 3, 3, FALSE), + PT(47, 11, 3, 3, TRUE), + PT(30, 32, 3, 0, TRUE), + PT(35, 59, 2, 2, FALSE), + PT(37, 0, 4, 3, TRUE), + PT(20, 4, 4, 2, TRUE), + PT(54, 26, 5, 1, TRUE), + PT(39, 33, 2, 2, TRUE), + PT(40, 19, 5, 2, FALSE), + PT(14, 60, 6, 2, TRUE), + PT(12, 45, 5, 1, TRUE), + PT(55, 22, 2, 2, TRUE), + PT(41, 21, 3, 2, TRUE), + PT(23, 52, 6, 3, FALSE), + PT( 9, 10, 6, 0, TRUE), + PT(55, 34, 5, 0, FALSE), + PT(23, 43, 6, 2, TRUE), + PT(20, 43, 2, 1, FALSE), + PT( 8, 19, 3, 3, TRUE), + PT(49, 19, 5, 0, FALSE), + PT( 6, 7, 6, 2, TRUE), + PT(35, 58, 5, 0, TRUE), + PT(15, 36, 5, 3, FALSE), + PT( 7, 53, 4, 3, FALSE), + PT(14, 18, 2, 2, TRUE), + PT(35, 51, 5, 2, FALSE), + PT(14, 33, 4, 3, FALSE), + PT(28, 18, 4, 2, TRUE), + PT(35, 29, 5, 3, TRUE), + PT( 4, 53, 6, 1, TRUE), + PT(22, 1, 4, 2, FALSE), + PT(61, 44, 5, 3, FALSE), + PT(53, 10, 4, 2, TRUE), + PT(17, 19, 4, 2, TRUE), + PT(27, 27, 2, 2, TRUE), + PT(21, 57, 2, 0, FALSE), + PT(11, 53, 4, 2, FALSE), + PT(58, 39, 6, 0, FALSE), + PT(46, 47, 2, 2, TRUE), + PT(16, 31, 6, 2, TRUE), + PT(27, 40, 6, 2, TRUE), + PT(38, 48, 6, 3, TRUE), + PT(52, 55, 5, 1, TRUE), + PT(15, 48, 5, 0, TRUE), + PT(46, 63, 5, 1, TRUE), + PT(56, 52, 5, 1, TRUE), + PT(43, 47, 4, 2, TRUE), + PT(13, 40, 5, 1, FALSE), + PT(51, 24, 2, 0, FALSE), + PT(33, 18, 2, 0, TRUE), + PT(31, 34, 6, 2, FALSE), + PT(17, 37, 4, 1, TRUE), + PT(33, 63, 2, 0, TRUE), + PT(38, 39, 4, 2, TRUE), + PT(40, 54, 2, 1, FALSE), + PT(21, 38, 6, 1, FALSE), + PT(17, 24, 4, 2, FALSE), + PT(50, 37, 6, 3, TRUE), + PT(39, 58, 6, 1, TRUE), + PT(53, 7, 3, 2, FALSE), + PT(26, 14, 5, 1, FALSE), + PT(30, 47, 3, 3, TRUE), + PT( 0, 46, 4, 0, TRUE), + PT(27, 60, 2, 2, FALSE), + PT(47, 58, 5, 3, TRUE), + PT(62, 56, 2, 2, TRUE), + PT(26, 19, 5, 3, TRUE), + PT(41, 13, 5, 3, TRUE), + PT(55, 23, 3, 0, FALSE), + PT(48, 28, 6, 2, TRUE), + PT(21, 52, 2, 2, FALSE), + PT(40, 17, 5, 2, FALSE), + PT(44, 37, 5, 1, FALSE), + PT(32, 63, 5, 0, FALSE), + PT(12, 52, 3, 1, TRUE), + PT(48, 46, 4, 2, TRUE), + PT(55, 28, 4, 2, FALSE), + PT(31, 37, 4, 3, FALSE), + PT(12, 25, 6, 2, FALSE), + PT(24, 16, 6, 2, TRUE), + PT(10, 19, 2, 0, TRUE), + PT(37, 19, 4, 0, FALSE), + PT(19, 25, 2, 0, TRUE), + PT(32, 40, 3, 2, TRUE), + PT(62, 48, 3, 1, TRUE), + PT(35, 36, 4, 0, TRUE), + PT(13, 35, 4, 1, TRUE), + PT(29, 40, 5, 3, FALSE), + PT(45, 18, 3, 3, TRUE), + PT(14, 46, 5, 1, TRUE), + PT(11, 49, 6, 1, FALSE), + PT(36, 60, 5, 2, FALSE), + PT(19, 60, 2, 1, FALSE), + PT(40, 22, 5, 1, FALSE), + PT( 5, 12, 6, 1, FALSE), + PT(57, 11, 6, 1, FALSE), + PT(33, 4, 2, 2, FALSE), + PT(16, 49, 6, 1, FALSE), + PT(18, 31, 4, 1, TRUE), + PT(57, 46, 5, 3, FALSE), + PT(34, 61, 4, 3, TRUE), + PT(12, 30, 3, 0, FALSE), + PT(37, 0, 2, 3, TRUE), + PT( 6, 49, 2, 2, FALSE), + PT(19, 33, 3, 1, FALSE), + PT(20, 32, 6, 2, TRUE), + PT(10, 59, 4, 2, TRUE), + PT(51, 8, 5, 0, FALSE), + PT(61, 2, 6, 1, TRUE), + PT(35, 0, 2, 1, TRUE), + PT(34, 33, 5, 0, FALSE), + PT(48, 20, 5, 3, FALSE), + PT(20, 50, 6, 3, FALSE), + PT(57, 35, 3, 3, FALSE), + PT(28, 17, 6, 0, FALSE), + PT(55, 22, 6, 0, FALSE), + PT(21, 49, 3, 3, TRUE), + PT(52, 40, 5, 2, FALSE), + PT(53, 5, 5, 0, TRUE), + PT(55, 51, 5, 1, FALSE), + PT(28, 23, 5, 3, FALSE), + PT(16, 6, 2, 3, FALSE), + PT(50, 31, 5, 3, TRUE), + PT( 0, 41, 3, 3, FALSE), + PT( 4, 1, 2, 3, FALSE), + PT(59, 35, 3, 3, FALSE), + PT(27, 52, 5, 1, FALSE), + PT(48, 17, 5, 1, TRUE), + PT( 3, 0, 3, 3, TRUE), + PT(29, 55, 3, 1, FALSE), + PT(58, 24, 4, 2, TRUE), + PT(28, 22, 5, 2, FALSE), + PT( 4, 63, 6, 1, TRUE), + PT(38, 35, 5, 2, TRUE), + PT(21, 44, 4, 3, TRUE), + PT( 2, 53, 4, 3, TRUE), + PT( 7, 53, 6, 1, TRUE), + PT(26, 12, 2, 0, FALSE), + PT(40, 38, 5, 2, FALSE), + PT(47, 54, 2, 3, FALSE), + PT(55, 11, 4, 3, TRUE), + PT(27, 61, 3, 0, FALSE), + PT(39, 31, 4, 0, FALSE), + PT(43, 42, 6, 1, TRUE), + PT(11, 15, 4, 0, FALSE), + PT(53, 60, 5, 3, TRUE), + PT(51, 33, 2, 2, TRUE), + PT(45, 38, 6, 2, FALSE), + PT(31, 26, 4, 0, TRUE), + PT(47, 44, 5, 1, FALSE), + PT(26, 50, 3, 1, FALSE), + PT(59, 63, 4, 0, TRUE), + PT(19, 63, 2, 1, TRUE), + PT(15, 36, 4, 1, FALSE), + PT(20, 27, 2, 0, FALSE), + PT(33, 6, 5, 0, FALSE), + PT(37, 52, 2, 0, FALSE), + PT(46, 14, 2, 2, FALSE), + PT(60, 62, 4, 2, TRUE), + PT(22, 6, 6, 0, FALSE), + PT(11, 4, 3, 3, TRUE), + PT(62, 2, 4, 2, FALSE), + PT(12, 23, 4, 2, TRUE), + PT(43, 60, 5, 2, TRUE), + PT(21, 54, 6, 1, TRUE), + PT(24, 35, 5, 1, FALSE), + PT(29, 16, 5, 1, FALSE), + PT(53, 23, 5, 0, FALSE), + PT( 0, 55, 4, 2, FALSE), + PT(10, 59, 2, 2, TRUE), + PT(29, 11, 3, 3, TRUE), + PT(60, 49, 4, 2, TRUE), + PT(29, 15, 3, 2, TRUE), + PT(32, 19, 6, 2, FALSE), + PT(17, 43, 5, 3, FALSE), + PT(35, 12, 5, 3, FALSE), + PT(36, 2, 2, 2, FALSE), + PT(49, 22, 3, 0, TRUE), + PT(14, 35, 6, 2, TRUE), + PT(26, 16, 2, 3, FALSE), + PT(20, 4, 3, 0, TRUE), + PT(45, 39, 6, 3, TRUE), + PT(51, 2, 6, 0, TRUE), + PT( 2, 4, 2, 3, FALSE), + PT(13, 34, 4, 2, TRUE), + PT(37, 0, 2, 3, FALSE), + PT(42, 63, 4, 3, FALSE), + PT(32, 12, 2, 1, FALSE), + PT(47, 46, 6, 2, TRUE), + PT(27, 13, 4, 1, FALSE), + PT(30, 1, 6, 2, FALSE), + PT( 5, 34, 4, 0, TRUE), + PT(52, 42, 6, 1, FALSE), + PT(11, 9, 3, 2, TRUE), + PT(63, 50, 5, 3, TRUE), + PT(61, 24, 5, 2, TRUE), + PT(11, 56, 6, 3, FALSE), + PT(57, 23, 5, 0, FALSE), + PT(52, 4, 4, 2, FALSE), + PT(54, 14, 5, 1, FALSE), + PT(56, 1, 2, 2, FALSE), + PT(60, 36, 4, 1, FALSE), + PT(33, 3, 3, 0, FALSE), + PT(50, 47, 2, 1, FALSE), + PT(41, 36, 6, 0, TRUE), + PT(10, 59, 2, 1, FALSE), + PT(26, 28, 4, 0, FALSE), + PT(48, 49, 3, 1, TRUE), + PT(26, 33, 2, 0, FALSE), + PT( 5, 41, 2, 0, FALSE), + PT(38, 45, 2, 1, TRUE), + PT(22, 12, 3, 2, TRUE), + PT(43, 6, 3, 1, TRUE), + PT( 6, 18, 2, 2, FALSE), + PT(56, 15, 6, 2, TRUE), + PT(35, 58, 5, 2, FALSE), + PT( 0, 25, 6, 1, TRUE), + PT(41, 20, 5, 2, TRUE), + PT(42, 33, 5, 0, TRUE), + PT(20, 49, 2, 2, FALSE), + PT(26, 6, 3, 3, FALSE), + PT(24, 27, 5, 0, FALSE), + PT(59, 22, 5, 0, TRUE), + PT(21, 30, 2, 1, FALSE), + PT(52, 10, 2, 2, FALSE), + PT(27, 5, 4, 3, TRUE), + PT(11, 1, 4, 3, FALSE), + PT(42, 34, 6, 2, TRUE), + PT(33, 32, 3, 0, FALSE), + PT(32, 55, 2, 3, TRUE), + PT(20, 31, 2, 0, TRUE), + PT(29, 17, 4, 2, TRUE), + PT(36, 43, 5, 3, TRUE), + PT( 7, 63, 3, 3, TRUE), + PT(44, 37, 4, 2, TRUE), + PT(42, 41, 3, 0, FALSE), + PT(17, 36, 5, 0, FALSE), + PT(49, 44, 5, 1, FALSE), + PT(57, 11, 4, 3, FALSE), + PT(40, 16, 4, 3, FALSE), + PT(34, 6, 2, 3, FALSE), + PT( 9, 44, 2, 1, TRUE), + PT(52, 25, 2, 2, TRUE), + PT(58, 18, 4, 0, TRUE), + PT(29, 56, 4, 1, TRUE), + PT(18, 37, 4, 2, FALSE), + PT(33, 48, 2, 1, FALSE), + PT(55, 26, 2, 1, FALSE), + PT(36, 59, 4, 2, TRUE), + PT(50, 21, 4, 1, TRUE), + PT(13, 26, 2, 0, FALSE), + PT(22, 46, 4, 3, FALSE), + PT(29, 20, 2, 3, FALSE), + PT(62, 46, 3, 3, TRUE), + PT(10, 22, 2, 0, FALSE), + PT(29, 48, 5, 1, TRUE), + PT( 4, 58, 3, 0, TRUE), + PT( 8, 45, 5, 3, FALSE), + PT(40, 30, 6, 1, TRUE), + PT(10, 18, 5, 3, FALSE), + PT(13, 3, 5, 3, TRUE), + PT(38, 58, 3, 3, FALSE), + PT(53, 59, 5, 1, FALSE), + PT( 3, 26, 3, 0, FALSE), + PT(63, 11, 4, 3, TRUE), + PT( 4, 5, 6, 2, FALSE), + PT(54, 11, 4, 3, TRUE), + PT(59, 23, 2, 0, TRUE), + PT(13, 39, 4, 3, FALSE), + PT(44, 31, 4, 0, FALSE), + PT(38, 16, 4, 0, FALSE), + PT(37, 35, 5, 2, TRUE), + PT(55, 9, 2, 1, TRUE), + PT(20, 23, 5, 2, TRUE), + PT(46, 61, 4, 1, TRUE), + PT(29, 26, 3, 3, TRUE), + PT(33, 51, 5, 3, FALSE), + PT(40, 23, 2, 1, TRUE), + PT(38, 60, 6, 3, FALSE), + PT(20, 26, 6, 1, TRUE), + PT(50, 32, 5, 1, TRUE), + PT(25, 62, 4, 0, FALSE), + PT(12, 2, 5, 2, TRUE), + PT(60, 60, 5, 1, FALSE), + PT(48, 48, 5, 0, FALSE), + PT(37, 63, 3, 3, FALSE), + PT( 3, 23, 3, 3, FALSE), + PT(53, 17, 3, 2, FALSE), + PT(27, 20, 5, 1, FALSE), + PT(40, 58, 4, 1, TRUE), + PT(14, 31, 2, 1, FALSE), + PT(54, 33, 4, 0, FALSE), + PT( 7, 59, 2, 0, FALSE), + PT(35, 25, 6, 2, FALSE), + PT(13, 46, 3, 0, FALSE), + PT(63, 32, 4, 2, TRUE), + PT(62, 59, 2, 2, TRUE), + PT(11, 46, 2, 1, FALSE), + PT(55, 11, 4, 1, TRUE), + PT(61, 50, 3, 3, TRUE), + PT(22, 3, 4, 3, TRUE), + PT(20, 12, 4, 0, TRUE), + PT(24, 3, 6, 0, FALSE), + PT(62, 33, 2, 1, TRUE), + PT(15, 0, 6, 1, FALSE), + PT(63, 35, 2, 3, FALSE), + PT(14, 49, 3, 2, TRUE), + PT(24, 28, 3, 2, TRUE), + PT(48, 14, 3, 3, FALSE), + PT(33, 32, 4, 1, TRUE), + PT(63, 12, 3, 3, FALSE), + PT(20, 51, 4, 1, FALSE), + PT(34, 33, 2, 2, TRUE), + PT(54, 5, 3, 3, FALSE), + PT(29, 49, 2, 2, FALSE), + PT(32, 17, 6, 3, TRUE), + PT(13, 51, 3, 0, TRUE), + PT(37, 5, 6, 3, FALSE), + PT(30, 49, 4, 0, FALSE), + PT(53, 58, 5, 3, TRUE), + PT(50, 47, 6, 0, FALSE), + PT(20, 35, 5, 2, TRUE), + PT(53, 30, 5, 0, TRUE), + PT( 5, 5, 3, 1, TRUE), + PT( 9, 31, 4, 3, FALSE), + PT(47, 11, 2, 2, TRUE), + PT(21, 17, 2, 1, TRUE), + PT(41, 27, 3, 0, FALSE), + PT(28, 19, 6, 2, TRUE), + PT(52, 49, 4, 1, TRUE), + PT(39, 63, 5, 3, TRUE), + PT( 9, 48, 3, 0, TRUE), + PT(35, 18, 6, 2, FALSE), + PT( 2, 42, 4, 0, TRUE), + PT( 9, 60, 3, 2, TRUE), + PT(12, 2, 2, 0, FALSE), + PT(34, 5, 2, 3, TRUE), + PT(34, 8, 3, 1, TRUE), + PT(10, 15, 2, 2, TRUE), + PT( 2, 17, 2, 1, TRUE), + PT( 1, 33, 4, 1, FALSE), + PT(22, 57, 6, 1, TRUE), + PT(36, 56, 6, 2, FALSE), + PT(15, 30, 5, 1, TRUE), + PT(43, 21, 2, 2, TRUE), + PT(32, 34, 5, 3, FALSE), + PT(58, 63, 6, 0, TRUE), + PT(26, 39, 5, 1, TRUE), + PT(41, 52, 2, 2, FALSE), + PT(22, 57, 5, 3, TRUE), + PT(19, 62, 2, 3, FALSE), + PT(54, 33, 6, 0, FALSE), + PT( 0, 36, 5, 1, TRUE), + PT(36, 33, 6, 0, FALSE), + PT(21, 49, 2, 1, TRUE), + PT(16, 55, 4, 2, FALSE), + PT( 8, 7, 4, 1, TRUE), + PT(33, 9, 4, 2, TRUE), + PT( 5, 60, 6, 1, FALSE), + PT(25, 3, 4, 2, TRUE), + PT(15, 41, 5, 1, TRUE), + PT(22, 7, 2, 1, TRUE), + PT(62, 61, 4, 2, TRUE), + PT(54, 11, 5, 0, FALSE), + PT(46, 43, 2, 3, FALSE), + PT(12, 49, 2, 0, TRUE), + PT(48, 19, 5, 2, TRUE), + PT(38, 62, 6, 3, TRUE), + PT(41, 47, 5, 3, FALSE), + PT(21, 61, 2, 3, TRUE), + PT(28, 46, 4, 0, TRUE), + PT(51, 47, 2, 0, FALSE), + PT(13, 5, 3, 2, TRUE), + PT(28, 26, 2, 1, FALSE), + PT(14, 24, 6, 3, TRUE), + PT(27, 17, 2, 2, FALSE), + PT( 6, 20, 4, 0, TRUE), + PT(49, 14, 4, 3, TRUE), + PT(26, 3, 2, 0, FALSE), + PT( 0, 52, 6, 0, TRUE), + PT(63, 11, 3, 2, TRUE), + PT(15, 18, 3, 3, TRUE), + PT(26, 21, 2, 0, FALSE), + PT(15, 0, 4, 2, FALSE), + PT(62, 10, 5, 1, FALSE), + PT(48, 43, 4, 2, FALSE), + PT(38, 49, 2, 0, FALSE), + PT(45, 47, 5, 3, TRUE), + PT(63, 12, 2, 1, TRUE), + PT(18, 11, 2, 3, FALSE), + PT(21, 7, 3, 3, TRUE), + PT(40, 16, 6, 1, FALSE), + PT(15, 23, 2, 2, TRUE), + PT(11, 39, 6, 1, TRUE), + PT(52, 29, 2, 0, FALSE), + PT(28, 58, 2, 1, FALSE), + PT(44, 39, 6, 3, TRUE), + PT(10, 26, 6, 1, FALSE), + PT( 5, 31, 4, 0, TRUE), + PT(36, 13, 3, 3, TRUE), + PT(28, 23, 4, 2, FALSE), + PT(47, 59, 6, 1, FALSE), + PT(59, 37, 2, 0, FALSE), + PT( 3, 47, 4, 0, TRUE), + PT(12, 16, 4, 1, TRUE), + PT(14, 58, 5, 2, FALSE), + PT(51, 3, 5, 2, FALSE), + PT(18, 6, 3, 2, FALSE), + PT(42, 55, 6, 0, FALSE), + PT(63, 1, 3, 3, FALSE), + PT(53, 22, 6, 3, TRUE), + PT(44, 50, 6, 2, TRUE), + PT( 5, 17, 4, 1, FALSE), + PT(41, 9, 4, 0, FALSE), + PT(43, 13, 3, 3, TRUE), + PT(24, 13, 4, 0, FALSE), + PT(35, 57, 2, 3, FALSE), + PT(15, 58, 3, 0, FALSE), + PT(33, 53, 5, 1, TRUE), + PT(54, 38, 5, 1, TRUE), + PT(35, 5, 5, 3, TRUE), + PT(27, 8, 2, 3, TRUE), + PT(62, 9, 2, 3, FALSE), + PT(45, 58, 6, 3, TRUE), + PT(21, 53, 6, 2, TRUE), + PT(41, 10, 2, 1, FALSE), + PT( 2, 57, 3, 3, TRUE), + PT(20, 52, 6, 1, TRUE), + PT(23, 29, 3, 0, FALSE), + PT(22, 29, 3, 1, FALSE), + PT( 1, 57, 4, 1, FALSE), + PT(30, 39, 6, 3, FALSE), + PT(50, 20, 4, 3, FALSE), + PT(10, 57, 6, 3, FALSE), + PT(31, 13, 3, 3, FALSE), + PT(11, 10, 3, 0, TRUE), + PT(53, 29, 6, 2, FALSE), + PT( 3, 18, 2, 3, FALSE), + PT(12, 19, 5, 3, FALSE), + PT(12, 52, 3, 3, FALSE), + PT(16, 20, 3, 3, FALSE), + PT(35, 50, 4, 3, TRUE), + PT( 2, 16, 5, 0, TRUE), + PT(53, 24, 6, 1, TRUE), + PT(51, 29, 3, 1, FALSE), + PT(60, 21, 4, 1, TRUE), + PT(62, 63, 4, 1, FALSE), + PT(42, 2, 5, 2, FALSE), + PT(40, 10, 5, 3, TRUE), + PT(26, 6, 6, 2, TRUE), + PT(60, 23, 5, 1, TRUE), + PT( 3, 18, 2, 3, TRUE), + PT(47, 10, 4, 3, FALSE), + PT(18, 56, 2, 0, TRUE), + PT(54, 27, 4, 1, TRUE), + PT( 1, 57, 6, 2, TRUE), + PT(25, 25, 2, 3, TRUE), + PT( 9, 40, 4, 1, FALSE), + PT(30, 39, 5, 2, FALSE), + PT(53, 51, 5, 2, FALSE), + PT(39, 37, 6, 0, TRUE), + PT( 6, 49, 5, 2, TRUE), + PT(26, 57, 5, 0, FALSE), + PT(45, 4, 3, 3, FALSE), + PT(36, 62, 3, 2, FALSE), + PT(60, 48, 3, 1, TRUE), + PT(63, 62, 6, 3, TRUE), + PT(34, 54, 2, 0, TRUE), + PT( 0, 1, 3, 2, FALSE), + PT(18, 26, 2, 0, FALSE), + PT(18, 30, 5, 2, FALSE), + PT(31, 18, 5, 1, FALSE), + PT(47, 6, 3, 0, TRUE), + PT(53, 26, 3, 0, FALSE), + PT(59, 9, 6, 3, FALSE), + PT(52, 29, 2, 1, TRUE), + PT( 2, 7, 2, 0, FALSE), + PT(32, 47, 3, 2, TRUE), + PT(11, 3, 6, 1, TRUE), + PT(28, 22, 6, 0, TRUE), + PT( 5, 19, 3, 1, TRUE), + PT(41, 6, 2, 1, TRUE), + PT(48, 45, 6, 3, FALSE), + PT(42, 45, 5, 2, FALSE), + PT(25, 52, 3, 2, FALSE), + PT(15, 21, 2, 1, FALSE), + PT(54, 21, 5, 2, FALSE), + PT(58, 6, 3, 2, FALSE), + PT(18, 29, 4, 3, FALSE), + PT( 3, 56, 3, 2, TRUE), + PT( 1, 1, 5, 2, TRUE), + PT(23, 46, 2, 0, FALSE), + PT(20, 23, 3, 2, FALSE), + PT(52, 15, 5, 0, FALSE), + PT( 9, 55, 3, 1, TRUE), + PT(40, 29, 4, 3, FALSE), + PT(41, 45, 6, 3, FALSE), + PT(30, 23, 5, 0, FALSE), + PT(21, 15, 3, 2, FALSE), + PT(32, 45, 2, 0, FALSE), + PT(39, 22, 5, 3, FALSE), + PT(20, 9, 2, 1, FALSE), + PT(59, 61, 4, 0, TRUE), + PT(37, 26, 5, 2, FALSE), + PT( 0, 34, 6, 3, FALSE), + PT(13, 48, 2, 0, FALSE), + PT(23, 25, 3, 1, TRUE), + PT( 0, 59, 4, 0, TRUE), + PT(42, 40, 6, 2, FALSE), + PT(45, 15, 2, 3, FALSE), + PT(10, 48, 5, 0, FALSE), + PT( 6, 0, 4, 2, TRUE), + PT(49, 46, 5, 1, FALSE), + PT(20, 51, 5, 0, FALSE), + PT(54, 16, 5, 3, FALSE), + PT( 5, 46, 3, 0, TRUE), + PT(25, 26, 2, 2, TRUE), + PT(44, 20, 2, 3, TRUE), + PT(55, 15, 2, 1, TRUE), + PT(50, 23, 3, 1, TRUE), + PT(57, 24, 6, 1, FALSE), + PT(46, 50, 3, 3, FALSE), + PT(36, 29, 6, 0, TRUE), + PT(18, 29, 5, 1, TRUE), + PT(20, 12, 4, 3, TRUE), + PT(54, 46, 6, 1, FALSE), + PT( 6, 10, 3, 1, FALSE), + PT(40, 40, 4, 0, FALSE), + PT(58, 58, 2, 3, TRUE), + PT( 8, 39, 6, 3, FALSE), + PT(24, 26, 2, 0, FALSE), + PT(30, 38, 3, 1, TRUE), + PT(31, 51, 3, 3, TRUE), + PT(33, 23, 5, 3, TRUE), + PT( 1, 8, 4, 0, FALSE), + PT(53, 3, 3, 0, TRUE), + PT(59, 2, 4, 0, FALSE), + PT( 2, 45, 4, 1, TRUE), + PT(14, 23, 6, 1, FALSE), + PT(49, 41, 2, 0, TRUE), + PT(34, 23, 4, 1, FALSE), + PT(58, 44, 4, 1, TRUE), + PT(52, 32, 3, 0, FALSE), + PT( 0, 58, 4, 1, FALSE), + PT(37, 51, 4, 0, TRUE), + PT(51, 4, 4, 3, TRUE), + PT( 4, 24, 6, 1, FALSE), + PT(44, 12, 5, 3, TRUE), + PT(40, 20, 5, 2, FALSE), + PT(63, 48, 5, 1, TRUE), + PT(48, 33, 3, 2, TRUE), + PT( 1, 37, 6, 1, FALSE), + PT( 5, 35, 6, 2, FALSE), + PT(36, 16, 6, 0, FALSE), + PT(61, 20, 3, 1, TRUE), + PT(63, 56, 5, 3, TRUE), + PT(34, 27, 6, 1, FALSE), + PT(37, 7, 6, 3, TRUE), + PT(10, 12, 3, 2, TRUE), + PT( 3, 30, 3, 1, FALSE), + PT(15, 60, 2, 1, FALSE), + PT(17, 24, 3, 2, TRUE), + PT( 0, 53, 5, 3, TRUE), + PT(50, 24, 2, 2, FALSE), + PT(35, 48, 3, 1, TRUE), + PT(17, 61, 2, 1, FALSE), + PT(26, 22, 6, 2, TRUE), + PT(40, 5, 4, 2, FALSE), + PT(23, 61, 6, 3, TRUE), + PT(46, 9, 5, 3, FALSE), + PT(24, 29, 2, 3, TRUE), + PT(32, 31, 3, 0, FALSE), + PT(35, 44, 5, 3, TRUE), + PT(32, 63, 2, 3, FALSE), + PT(63, 41, 5, 3, FALSE), + PT(35, 59, 5, 0, TRUE), + PT(24, 57, 2, 1, TRUE), + PT(30, 50, 6, 2, TRUE), + PT(20, 29, 5, 1, FALSE), + PT(53, 1, 3, 2, TRUE), + PT(62, 59, 3, 3, FALSE), + PT(34, 30, 2, 3, FALSE), + PT(24, 34, 2, 1, FALSE), + PT(62, 41, 6, 1, TRUE), + PT(47, 20, 3, 0, TRUE), + PT(59, 7, 2, 2, TRUE), + PT( 6, 61, 5, 0, TRUE), + PT(53, 55, 4, 1, TRUE), + PT(52, 29, 5, 2, TRUE), + PT(24, 18, 3, 1, TRUE), + PT(11, 19, 4, 2, FALSE), + PT(19, 56, 3, 2, FALSE), + PT(31, 11, 3, 1, TRUE), + PT(19, 33, 3, 2, FALSE), + PT( 6, 57, 6, 1, FALSE), + PT(55, 61, 4, 3, FALSE), + PT(41, 38, 2, 2, TRUE), + PT(60, 51, 4, 3, TRUE), + PT( 0, 1, 5, 3, FALSE), + PT(21, 24, 6, 0, TRUE), + PT(13, 44, 2, 1, TRUE), + PT(39, 59, 4, 0, FALSE), + PT(45, 1, 4, 3, FALSE), + PT(35, 21, 6, 0, FALSE), + PT(36, 0, 2, 3, TRUE), + PT(55, 63, 6, 1, TRUE), + PT(37, 36, 6, 0, TRUE), + PT( 6, 59, 6, 3, TRUE), + PT( 3, 24, 3, 1, FALSE), + PT(44, 52, 2, 2, FALSE), + PT(29, 54, 3, 0, FALSE), + PT(58, 4, 4, 1, TRUE), + PT(18, 38, 2, 2, TRUE), + PT(43, 25, 3, 1, FALSE), + PT(41, 44, 6, 3, FALSE), + PT( 1, 25, 3, 2, TRUE), + PT(47, 6, 5, 1, TRUE), + PT(12, 18, 4, 3, FALSE), + PT(54, 50, 3, 2, TRUE), + PT(13, 18, 5, 0, FALSE), + PT( 3, 40, 2, 1, TRUE), + PT(41, 6, 2, 3, TRUE), + PT( 3, 56, 4, 0, TRUE), + PT(48, 44, 2, 0, FALSE), + PT(34, 0, 5, 0, FALSE), + PT(36, 59, 3, 2, FALSE), + PT(32, 62, 2, 1, TRUE), + PT( 2, 12, 3, 0, TRUE), + PT(41, 44, 3, 1, FALSE), + PT(57, 48, 4, 1, FALSE), + PT(42, 31, 4, 1, FALSE), + PT(20, 52, 5, 2, FALSE), + PT(20, 37, 3, 1, TRUE), + PT( 6, 59, 2, 2, TRUE), + PT( 6, 28, 2, 1, TRUE), + PT(21, 3, 3, 0, FALSE), + PT(30, 42, 3, 1, TRUE), + PT(23, 37, 5, 3, TRUE), + PT(28, 41, 5, 3, FALSE), + PT( 2, 50, 3, 3, FALSE), + PT(29, 40, 6, 2, TRUE), + PT(54, 3, 6, 2, FALSE), + PT(22, 61, 5, 1, FALSE), + PT(18, 13, 2, 1, TRUE), + PT(29, 45, 4, 0, TRUE), + PT(50, 23, 5, 3, FALSE), + PT(26, 21, 4, 3, FALSE), + PT(34, 47, 2, 2, TRUE), + PT(60, 14, 4, 0, FALSE), + PT(47, 39, 2, 1, TRUE), + PT( 4, 9, 6, 1, FALSE), + PT(30, 1, 6, 2, FALSE), + PT( 6, 22, 3, 3, FALSE), + PT(46, 27, 3, 2, FALSE), + PT(40, 19, 5, 1, FALSE), + PT(48, 52, 2, 1, FALSE), + PT(18, 50, 3, 0, FALSE), + PT(29, 29, 6, 2, TRUE), + PT( 7, 28, 2, 3, FALSE), + PT(45, 61, 6, 2, TRUE), + PT(28, 27, 4, 2, FALSE), + PT(33, 45, 3, 3, FALSE), + PT(16, 9, 2, 2, FALSE), + PT(61, 17, 2, 1, FALSE), + PT(37, 2, 4, 3, FALSE), + PT(35, 2, 3, 0, TRUE), + PT(25, 5, 2, 2, FALSE), + PT(11, 33, 3, 1, FALSE), + PT( 9, 2, 5, 2, FALSE), + PT(24, 40, 5, 2, TRUE), + PT(30, 16, 2, 1, FALSE), + PT(46, 24, 5, 3, FALSE), + PT(31, 2, 5, 2, FALSE), + PT(20, 23, 4, 2, FALSE), + PT(57, 8, 6, 1, FALSE), + PT(22, 20, 4, 1, FALSE), + PT(22, 40, 4, 0, TRUE), + PT(17, 16, 5, 2, FALSE), + PT(35, 54, 5, 1, TRUE), + PT(57, 33, 4, 3, FALSE), + PT(14, 6, 5, 2, TRUE), + PT(60, 62, 4, 3, FALSE), + PT(42, 27, 3, 3, TRUE), + PT( 0, 60, 6, 1, TRUE), + PT(53, 63, 2, 2, FALSE), + PT( 0, 11, 2, 0, FALSE), + PT(52, 60, 2, 3, TRUE), + PT(45, 7, 3, 3, TRUE), + PT(36, 57, 4, 3, TRUE), + PT(22, 0, 3, 2, TRUE), + PT(51, 43, 3, 3, FALSE), + PT(15, 8, 6, 0, TRUE), + PT(58, 9, 2, 1, TRUE), + PT(12, 33, 3, 2, FALSE), + PT(42, 23, 6, 2, FALSE), + PT(41, 39, 2, 0, FALSE), + PT(55, 27, 3, 0, FALSE), + PT(21, 8, 5, 3, TRUE), + PT(31, 22, 2, 1, FALSE), + PT(31, 40, 6, 2, FALSE), + PT(28, 32, 4, 1, FALSE), + PT(18, 1, 2, 1, FALSE), + PT(33, 49, 2, 0, FALSE), + PT(34, 38, 3, 3, FALSE), + PT( 1, 61, 2, 0, TRUE), + PT(30, 39, 4, 2, TRUE), + PT(61, 48, 4, 2, FALSE), + PT(29, 17, 4, 1, FALSE), + PT(54, 48, 2, 3, FALSE), + PT(31, 62, 5, 1, FALSE), + PT(60, 39, 3, 1, TRUE), + PT(31, 41, 2, 0, FALSE), + PT(30, 5, 5, 1, FALSE), + PT(10, 16, 2, 2, FALSE), + PT(31, 0, 5, 3, FALSE), + PT(11, 59, 3, 0, FALSE), + PT(10, 57, 6, 0, FALSE), + PT(55, 11, 3, 3, TRUE), + PT(29, 10, 5, 0, TRUE), + PT(62, 28, 6, 1, TRUE), + PT(19, 46, 5, 0, FALSE), + PT(39, 27, 3, 3, FALSE), + PT(29, 2, 3, 2, FALSE), + PT( 1, 37, 2, 2, FALSE), + PT(58, 16, 3, 2, FALSE), + PT(18, 5, 5, 1, FALSE), + PT(48, 32, 4, 3, FALSE), + PT(47, 46, 5, 3, FALSE), + PT( 3, 7, 4, 2, FALSE), + PT(54, 4, 5, 1, TRUE), + PT(17, 37, 5, 2, TRUE), + PT(40, 14, 5, 3, FALSE), + PT(15, 29, 2, 2, TRUE), + PT(28, 40, 6, 0, FALSE), + PT(31, 35, 4, 3, FALSE), + PT(54, 18, 6, 3, TRUE), + PT(58, 49, 2, 0, FALSE), + PT(44, 44, 5, 3, TRUE), + PT(26, 13, 2, 2, TRUE), + PT(63, 60, 6, 1, FALSE), + PT(53, 28, 2, 3, FALSE), + PT(51, 22, 5, 0, FALSE), + PT(29, 63, 4, 0, TRUE), + PT(44, 62, 5, 1, TRUE), + PT(36, 35, 5, 3, TRUE), + PT(50, 21, 5, 1, FALSE), + PT(27, 16, 6, 2, TRUE), + PT(24, 55, 2, 0, FALSE), + PT(59, 30, 2, 0, TRUE), + PT(43, 22, 4, 2, FALSE), + PT(29, 22, 4, 3, FALSE), + PT(60, 45, 2, 0, TRUE), + PT(21, 40, 5, 0, FALSE), + PT(39, 39, 4, 3, TRUE), + PT(59, 58, 2, 3, FALSE), + PT(26, 12, 3, 1, FALSE), + PT(21, 8, 4, 2, TRUE), + PT(11, 16, 4, 1, FALSE), + PT(26, 62, 2, 3, TRUE), + PT(40, 31, 3, 3, FALSE), + PT( 1, 30, 3, 3, FALSE), + PT(28, 47, 2, 0, FALSE), + PT(37, 11, 6, 2, FALSE), + PT(62, 12, 3, 1, FALSE), + PT(27, 16, 5, 1, FALSE), + PT(15, 20, 2, 3, TRUE), + PT(15, 63, 2, 3, TRUE), + PT( 3, 21, 3, 3, TRUE), + PT( 2, 54, 2, 3, TRUE), + PT(21, 29, 3, 0, FALSE), + PT( 8, 54, 2, 0, FALSE), + PT(20, 13, 5, 1, TRUE), + PT(10, 5, 3, 2, TRUE), + PT(38, 18, 3, 3, FALSE), + PT(62, 24, 3, 0, TRUE), + PT(54, 24, 6, 3, TRUE), + PT(23, 57, 5, 3, FALSE), + PT(13, 4, 3, 0, TRUE), + PT(22, 34, 2, 2, TRUE), + PT(62, 38, 3, 3, TRUE), + PT( 0, 6, 2, 3, TRUE), + PT(51, 34, 3, 2, TRUE), + PT(43, 57, 5, 1, TRUE), + PT(62, 49, 3, 2, FALSE), + PT(34, 63, 2, 1, TRUE), + PT(48, 28, 6, 0, TRUE), + PT( 7, 43, 2, 2, FALSE), + PT(50, 53, 3, 3, FALSE), + PT( 2, 7, 4, 0, FALSE), + PT(15, 59, 2, 0, TRUE), + PT(32, 7, 2, 1, FALSE), + PT(42, 48, 3, 2, TRUE), + PT(40, 56, 6, 3, FALSE), + PT(32, 1, 2, 3, TRUE), + PT(21, 32, 4, 0, TRUE), + PT(58, 27, 3, 3, FALSE), + PT(56, 18, 4, 2, FALSE), + PT( 3, 62, 3, 3, TRUE), + PT(41, 29, 2, 1, TRUE), + PT(32, 39, 3, 0, TRUE), + PT(18, 37, 4, 0, FALSE), + PT(50, 51, 5, 1, TRUE), + PT(63, 5, 6, 0, TRUE), + PT(53, 60, 5, 2, TRUE), + PT(45, 2, 5, 3, FALSE), + PT(16, 42, 2, 3, FALSE), + PT(23, 8, 6, 0, TRUE), + PT(23, 46, 5, 1, TRUE), + PT(48, 30, 2, 2, TRUE), + PT(49, 21, 4, 3, FALSE), + PT( 8, 16, 6, 1, TRUE), + PT(21, 1, 4, 3, TRUE), + PT(18, 7, 5, 3, TRUE), + PT(41, 39, 6, 2, FALSE), + PT(63, 8, 6, 0, TRUE), + PT(28, 32, 3, 1, FALSE), + PT(51, 12, 2, 1, TRUE), + PT(24, 49, 4, 2, FALSE), + PT(55, 45, 5, 3, FALSE), + PT(33, 24, 4, 2, FALSE), + PT(58, 39, 6, 0, TRUE), + PT(53, 62, 6, 0, FALSE), + PT(58, 20, 6, 1, TRUE), + PT(15, 26, 5, 2, TRUE), + PT(48, 46, 2, 0, TRUE), + PT(26, 49, 3, 2, TRUE), + PT(23, 60, 3, 0, FALSE), + PT(51, 49, 4, 1, TRUE), + PT(29, 57, 5, 2, TRUE), + PT(16, 29, 5, 3, TRUE), + PT(36, 21, 3, 2, FALSE), + PT(37, 1, 5, 1, TRUE), + PT(34, 22, 5, 3, FALSE), + PT(27, 37, 6, 2, TRUE), + PT(55, 16, 4, 3, FALSE), + PT(57, 1, 6, 3, FALSE), + PT(23, 43, 2, 2, FALSE), + PT( 9, 22, 2, 3, TRUE), + PT(32, 40, 4, 1, TRUE), + PT(38, 58, 4, 3, FALSE), + PT(39, 42, 4, 2, FALSE), + PT(54, 2, 5, 2, FALSE), + PT(41, 48, 6, 2, TRUE), + PT(54, 1, 3, 3, TRUE), + PT(40, 59, 3, 2, TRUE), + PT(35, 30, 5, 2, TRUE), + PT(17, 30, 5, 2, FALSE), + PT(47, 50, 3, 0, TRUE), + PT(63, 38, 6, 0, TRUE), + PT(56, 30, 2, 3, TRUE), + PT( 5, 24, 5, 3, FALSE), + PT( 0, 46, 2, 1, FALSE), + PT(52, 63, 6, 2, FALSE), + PT(22, 16, 5, 0, TRUE), + PT(32, 61, 6, 3, FALSE), + PT(47, 22, 4, 2, TRUE), + PT(18, 23, 2, 0, FALSE), + PT(33, 55, 6, 2, TRUE), + PT(37, 55, 5, 2, TRUE), + PT( 1, 8, 4, 3, TRUE), + PT( 3, 31, 5, 0, TRUE), + PT(13, 42, 2, 3, FALSE), + PT(58, 63, 6, 1, TRUE), + PT(43, 25, 3, 2, TRUE), + PT(42, 31, 5, 0, TRUE), + PT(40, 44, 2, 0, FALSE), + PT(40, 48, 2, 0, FALSE), + PT(57, 20, 3, 1, TRUE), + PT( 0, 24, 4, 0, TRUE), + PT(40, 12, 6, 3, TRUE), + PT(17, 16, 2, 0, TRUE), + PT(60, 51, 6, 1, FALSE), + PT(51, 54, 3, 1, FALSE), + PT(54, 0, 3, 2, FALSE), + PT(49, 27, 3, 2, TRUE), + PT(56, 29, 2, 0, FALSE), + PT(60, 57, 4, 3, TRUE), + PT(58, 63, 2, 2, FALSE), + PT(25, 18, 2, 2, FALSE), + PT(13, 31, 3, 0, FALSE), + PT( 0, 37, 3, 0, FALSE), + PT(40, 28, 6, 1, FALSE), + PT(39, 3, 3, 1, FALSE), + PT(38, 45, 5, 1, FALSE), + PT(41, 40, 4, 3, TRUE), + PT(10, 42, 3, 0, FALSE), + PT(10, 26, 6, 0, FALSE), + PT(32, 26, 5, 3, FALSE), + PT( 6, 11, 3, 2, TRUE), + PT(15, 12, 3, 2, FALSE), + PT(53, 40, 3, 2, FALSE), + PT(61, 22, 4, 1, TRUE), + PT(33, 28, 6, 0, TRUE), + PT(20, 28, 5, 3, FALSE), + PT(34, 50, 6, 2, TRUE), + PT( 9, 41, 6, 0, FALSE), + PT(32, 26, 2, 0, FALSE), + PT(49, 63, 5, 2, FALSE), + PT(10, 61, 6, 3, TRUE), + PT(11, 46, 5, 2, TRUE), + PT(31, 34, 6, 0, TRUE), + PT( 6, 7, 5, 0, TRUE), + PT(34, 23, 5, 2, TRUE), + PT(48, 17, 3, 0, FALSE), + PT(12, 25, 2, 2, TRUE), + PT( 7, 10, 6, 2, FALSE), + PT(24, 41, 4, 3, TRUE), + PT(51, 12, 6, 0, FALSE), + PT( 3, 26, 6, 3, TRUE), + PT( 6, 1, 5, 2, TRUE), + PT(15, 59, 5, 1, TRUE), + PT(17, 31, 6, 3, TRUE), + PT(43, 33, 6, 3, FALSE), + PT(63, 35, 2, 3, TRUE), + PT(23, 7, 5, 1, TRUE), + PT(43, 14, 6, 0, FALSE), + PT(17, 57, 3, 2, TRUE), + PT(41, 3, 6, 1, TRUE), + PT(48, 3, 5, 3, TRUE), + PT(60, 32, 4, 3, FALSE), + PT( 3, 34, 2, 2, FALSE), + PT(58, 40, 6, 2, TRUE), + PT( 1, 40, 5, 1, TRUE), + PT(62, 21, 3, 0, FALSE), + PT(48, 7, 2, 3, TRUE), + PT(59, 44, 6, 0, FALSE), + PT(21, 7, 5, 2, FALSE), + PT(23, 39, 3, 2, TRUE), + PT(63, 30, 6, 1, TRUE), + PT(13, 23, 2, 0, FALSE), + PT(21, 14, 6, 0, FALSE), + PT( 9, 5, 6, 0, FALSE), + PT(45, 32, 2, 2, TRUE), + PT(60, 61, 6, 0, FALSE), + PT(12, 23, 3, 2, FALSE), + PT(26, 13, 4, 2, TRUE), + PT(43, 43, 5, 1, FALSE), + PT( 2, 22, 5, 2, TRUE), + PT(23, 49, 2, 3, TRUE), + PT( 0, 8, 2, 1, TRUE), + PT(55, 53, 4, 0, TRUE), + PT(30, 28, 3, 3, TRUE), + PT(43, 50, 3, 2, FALSE), + PT(16, 42, 2, 3, FALSE), + PT(58, 51, 6, 0, TRUE), + PT(23, 43, 5, 1, FALSE), + PT(12, 61, 2, 0, TRUE), + PT(40, 10, 6, 0, FALSE), + PT(35, 10, 4, 3, FALSE), + PT(10, 20, 4, 2, FALSE), + PT(11, 15, 6, 0, FALSE), + PT(27, 30, 5, 0, TRUE), + PT( 2, 53, 5, 0, FALSE), + PT(59, 2, 2, 2, FALSE), + PT( 0, 15, 6, 2, TRUE), + PT(28, 60, 5, 3, FALSE), + PT(40, 56, 3, 0, TRUE), + PT(27, 17, 2, 1, FALSE), + PT( 9, 22, 2, 0, FALSE), + PT(46, 13, 4, 0, FALSE), + PT(61, 4, 6, 1, FALSE), + PT(22, 44, 4, 2, TRUE), + PT( 2, 61, 3, 0, FALSE), + PT(11, 19, 3, 2, FALSE), + PT(34, 42, 3, 2, FALSE), + PT(32, 39, 4, 1, FALSE), + PT( 5, 38, 4, 1, FALSE), + PT(18, 29, 5, 2, FALSE), + PT( 8, 5, 5, 3, FALSE), + PT(63, 28, 2, 3, TRUE), + PT(36, 13, 6, 1, TRUE), + PT(54, 8, 4, 2, FALSE), + PT(16, 34, 5, 0, TRUE), + PT(28, 10, 2, 0, TRUE), + PT(37, 15, 2, 0, FALSE), + PT(36, 56, 5, 3, TRUE), + PT(37, 50, 3, 3, FALSE), + PT( 6, 42, 5, 0, TRUE), + PT(62, 58, 5, 0, FALSE), + PT(52, 23, 6, 1, TRUE), + PT(24, 51, 2, 3, TRUE), + PT( 7, 20, 3, 3, TRUE), + PT(17, 23, 4, 0, FALSE), + PT(19, 14, 2, 2, FALSE), + PT(59, 28, 2, 1, FALSE), + PT(42, 19, 6, 3, TRUE), + PT(42, 53, 6, 1, FALSE), + PT(48, 2, 4, 2, TRUE), + PT( 0, 7, 3, 3, TRUE), + PT(12, 4, 5, 2, FALSE), + PT(55, 55, 6, 0, FALSE), + PT(37, 18, 4, 2, TRUE), + PT(18, 34, 4, 0, TRUE), + PT(34, 53, 6, 1, TRUE), + PT( 7, 32, 5, 2, TRUE), + PT(39, 14, 6, 0, FALSE), + PT(52, 25, 3, 1, FALSE), + PT(10, 60, 4, 2, TRUE), + PT( 7, 29, 5, 1, TRUE), + PT(49, 58, 2, 1, FALSE), + PT(26, 61, 6, 3, TRUE), + PT(22, 21, 2, 3, FALSE), + PT(57, 19, 2, 2, TRUE), + PT(45, 3, 5, 3, FALSE), + PT( 6, 57, 5, 2, FALSE), + PT(22, 0, 2, 1, TRUE), + PT(53, 42, 6, 2, TRUE), + PT(36, 1, 3, 0, FALSE), + PT(36, 55, 5, 0, FALSE), + PT(37, 27, 6, 2, FALSE), + PT(37, 25, 2, 3, TRUE), + PT(39, 47, 3, 1, TRUE), + PT(39, 13, 2, 0, FALSE), + PT(54, 60, 6, 0, FALSE), + PT(60, 51, 4, 1, TRUE), + PT(62, 39, 3, 3, FALSE), + PT(37, 45, 5, 0, TRUE), + PT(31, 18, 4, 0, TRUE), + PT(55, 50, 3, 3, TRUE), + PT(17, 33, 6, 2, TRUE), + PT(48, 12, 3, 0, TRUE), + PT(37, 61, 4, 3, FALSE), + PT(23, 2, 3, 2, TRUE), + PT(20, 46, 2, 0, TRUE), + PT(56, 19, 6, 0, FALSE), + PT(10, 43, 4, 0, FALSE), + PT(30, 16, 2, 2, TRUE), + PT(55, 48, 5, 3, FALSE), + PT(30, 4, 5, 2, FALSE), + PT(20, 52, 3, 0, TRUE), + PT( 8, 20, 3, 0, FALSE), + PT(14, 28, 6, 0, FALSE), + PT(26, 46, 3, 1, TRUE), + PT(31, 57, 6, 0, TRUE), + PT(12, 28, 5, 0, FALSE), + PT(62, 51, 4, 1, TRUE), + PT(15, 19, 2, 3, FALSE), + PT(37, 57, 5, 3, TRUE), + PT(20, 27, 3, 1, FALSE), + PT(40, 62, 4, 0, TRUE), + PT(45, 25, 2, 0, TRUE), + PT(12, 52, 6, 1, FALSE), + PT(57, 49, 3, 0, TRUE), + PT(26, 8, 6, 2, FALSE), + PT( 9, 47, 2, 0, TRUE), + PT(48, 4, 3, 2, FALSE), + PT( 2, 59, 3, 1, TRUE), + PT(51, 33, 6, 1, TRUE), + PT(56, 2, 3, 1, FALSE), + PT(49, 56, 6, 1, FALSE), + PT(31, 29, 2, 3, FALSE), + PT(23, 16, 3, 1, TRUE), + PT(50, 32, 2, 3, TRUE), + PT( 0, 51, 2, 1, FALSE), + PT(33, 15, 4, 3, TRUE), + PT(20, 25, 4, 3, TRUE), + PT(36, 44, 6, 3, TRUE), + PT(37, 5, 5, 3, TRUE), + PT(61, 37, 2, 0, TRUE), + PT(18, 48, 3, 1, FALSE), + PT(22, 3, 3, 1, FALSE), + PT(20, 9, 2, 1, TRUE), + PT( 2, 35, 4, 1, FALSE), + PT( 1, 60, 2, 0, FALSE), + PT(63, 45, 4, 1, TRUE), + PT(49, 63, 4, 1, TRUE), + PT(23, 0, 6, 1, TRUE), + PT(63, 15, 5, 3, TRUE), + PT(38, 7, 2, 2, TRUE), + PT(33, 43, 5, 1, FALSE), + PT(56, 57, 3, 3, FALSE), + PT( 9, 37, 5, 1, TRUE), + PT(59, 48, 4, 2, TRUE), + PT(18, 45, 2, 1, TRUE), + PT(50, 25, 5, 0, FALSE), + PT(36, 28, 5, 2, TRUE), + PT(53, 50, 4, 3, FALSE), + PT(13, 35, 3, 3, FALSE), + PT(29, 7, 4, 0, TRUE), + PT(11, 52, 2, 3, TRUE), + PT(45, 50, 6, 1, FALSE), + PT(58, 60, 6, 2, TRUE), + PT(26, 16, 6, 1, TRUE), + PT(26, 7, 4, 1, FALSE), + PT(59, 27, 5, 1, FALSE), + PT(51, 31, 4, 3, FALSE), + PT(14, 53, 3, 1, FALSE), + PT(59, 10, 3, 2, FALSE), + PT(17, 7, 2, 0, TRUE), + PT(13, 60, 5, 2, TRUE), + PT(30, 55, 5, 0, TRUE), + PT(17, 5, 2, 1, FALSE), + PT(21, 47, 3, 2, FALSE), + PT(36, 49, 2, 3, FALSE), + PT(43, 33, 3, 1, TRUE), + PT(35, 16, 6, 0, TRUE), + PT( 2, 20, 5, 0, TRUE), + PT(38, 32, 2, 3, FALSE), + PT(16, 23, 2, 0, FALSE), + PT(11, 15, 6, 1, TRUE), + PT( 1, 46, 2, 2, FALSE), + PT(33, 14, 6, 3, TRUE), + PT(26, 29, 5, 3, TRUE), + PT(30, 48, 4, 2, FALSE), + PT( 4, 20, 5, 2, TRUE), + PT(17, 0, 6, 0, FALSE), + PT( 8, 42, 3, 2, TRUE), + PT(29, 34, 4, 0, TRUE), + PT(36, 44, 6, 3, TRUE), + PT(36, 17, 2, 1, FALSE), + PT( 4, 46, 5, 0, FALSE), + PT(29, 24, 4, 1, TRUE), + PT(60, 22, 2, 3, FALSE), + PT(16, 23, 6, 0, TRUE), + PT(32, 33, 2, 1, FALSE), + PT(51, 62, 6, 2, FALSE), + PT( 6, 19, 2, 1, TRUE), + PT(23, 56, 5, 1, TRUE), + PT(20, 13, 2, 2, TRUE), + PT(36, 59, 5, 1, TRUE), + PT(52, 59, 3, 3, FALSE), + PT(24, 7, 6, 2, FALSE), + PT(55, 29, 3, 3, TRUE), + PT(11, 41, 4, 0, FALSE), + PT(18, 30, 3, 2, TRUE), + PT(26, 36, 4, 2, FALSE), + PT(61, 40, 4, 2, FALSE), + PT(11, 18, 6, 1, TRUE), + PT(27, 58, 4, 1, FALSE), + PT(20, 19, 5, 1, FALSE), + PT(49, 56, 2, 2, TRUE), + PT(55, 43, 5, 3, FALSE), + PT(25, 30, 5, 2, FALSE), + PT(63, 27, 5, 1, FALSE), + PT(51, 31, 6, 1, TRUE), + PT(63, 21, 5, 0, TRUE), + PT( 1, 30, 3, 0, FALSE), + PT(31, 34, 3, 0, TRUE), + PT(51, 60, 6, 2, FALSE), + PT(30, 18, 4, 1, FALSE), + PT(13, 55, 5, 2, FALSE), + PT(15, 8, 6, 0, TRUE), + PT(46, 9, 6, 3, FALSE), + PT( 1, 5, 3, 3, FALSE), + PT(28, 4, 3, 3, FALSE), + PT(12, 1, 3, 2, FALSE), + PT(41, 40, 5, 3, TRUE), + PT(57, 45, 2, 2, FALSE), + PT( 9, 34, 6, 3, FALSE), + PT( 4, 55, 6, 3, TRUE), + PT(45, 47, 6, 2, TRUE), + PT(36, 35, 3, 1, TRUE), + PT( 8, 32, 6, 1, FALSE), + PT(32, 31, 6, 2, FALSE), + PT( 2, 49, 3, 0, TRUE), + PT(24, 19, 6, 3, FALSE), + PT( 6, 43, 3, 3, FALSE), + PT(14, 27, 2, 0, FALSE), + PT(47, 14, 3, 2, FALSE), + PT(17, 56, 2, 1, TRUE), + PT( 1, 55, 3, 0, TRUE), + PT(20, 17, 4, 3, FALSE), + PT(49, 61, 6, 1, TRUE), + PT(29, 27, 6, 2, FALSE), + PT(37, 49, 5, 3, TRUE), + PT(17, 10, 5, 3, TRUE), + PT(57, 23, 3, 1, TRUE), + PT( 5, 14, 2, 1, TRUE), + PT(41, 37, 4, 1, FALSE), + PT(21, 13, 4, 0, FALSE), + PT(43, 39, 4, 0, TRUE), + PT(62, 36, 4, 3, TRUE), + PT(42, 43, 2, 3, FALSE), + PT(36, 61, 2, 2, TRUE), + PT(21, 48, 6, 0, TRUE), + PT(15, 51, 4, 2, FALSE), + PT( 6, 22, 2, 1, TRUE), + PT( 6, 49, 2, 0, FALSE), + PT(46, 63, 2, 0, FALSE), + PT( 5, 13, 5, 3, TRUE), + PT(60, 31, 3, 0, TRUE), + PT(18, 19, 4, 2, FALSE), + PT(15, 51, 6, 3, FALSE), + PT(21, 59, 6, 1, TRUE), + PT( 3, 15, 5, 1, FALSE), + PT(59, 60, 5, 2, FALSE), + PT(54, 9, 5, 0, TRUE), + PT(17, 59, 4, 3, TRUE), + PT(40, 43, 6, 0, TRUE), + PT(26, 14, 5, 3, TRUE), + PT(57, 44, 6, 0, TRUE), + PT(14, 60, 6, 2, TRUE), + PT(44, 36, 6, 1, TRUE), + PT(61, 17, 5, 1, TRUE), + PT( 7, 60, 6, 3, TRUE), + PT(20, 24, 2, 1, TRUE), + PT(29, 63, 5, 3, FALSE), + PT(48, 18, 4, 2, TRUE), + PT(38, 29, 2, 0, TRUE), + PT( 7, 17, 3, 3, FALSE), + PT(52, 1, 2, 0, TRUE), + PT(11, 57, 4, 0, TRUE), + PT(41, 2, 5, 0, TRUE), + PT(21, 16, 3, 1, FALSE), + PT(48, 31, 6, 2, TRUE), + PT(60, 43, 5, 1, FALSE), + PT(48, 59, 6, 3, FALSE), + PT(32, 26, 4, 1, TRUE), + PT(50, 36, 5, 1, TRUE), + PT(21, 32, 3, 2, FALSE), + PT(37, 61, 6, 3, FALSE), + PT(45, 20, 6, 0, TRUE), + PT(24, 35, 2, 3, TRUE), + PT(24, 5, 2, 1, TRUE), + PT(52, 48, 6, 3, TRUE), + PT(14, 57, 4, 1, TRUE), + PT(29, 31, 2, 3, TRUE), + PT( 1, 21, 5, 3, TRUE), + PT(11, 62, 3, 1, TRUE), + PT(13, 25, 5, 3, FALSE), + PT(49, 56, 3, 2, FALSE), + PT(21, 52, 2, 2, TRUE), + PT(19, 25, 5, 0, TRUE), + PT(25, 20, 4, 3, TRUE), + PT(21, 24, 4, 1, TRUE), + PT(41, 12, 4, 3, TRUE), + PT(45, 14, 2, 3, TRUE), + PT(52, 24, 2, 0, FALSE), + PT(59, 30, 5, 0, TRUE), + PT(52, 44, 4, 1, FALSE), + PT(49, 8, 2, 1, TRUE), + PT(29, 24, 3, 1, FALSE), + PT(28, 11, 5, 1, FALSE), + PT(25, 30, 3, 1, FALSE), + PT(35, 39, 2, 3, TRUE), + PT(59, 14, 6, 3, TRUE), + PT(25, 43, 2, 3, FALSE), + PT(47, 8, 4, 0, TRUE), + PT(55, 2, 4, 0, FALSE), + PT(11, 50, 6, 0, FALSE), + PT(22, 5, 6, 0, FALSE), + PT(19, 5, 3, 1, FALSE), + PT( 7, 57, 3, 0, TRUE), + PT(12, 59, 5, 1, FALSE), + PT(21, 5, 6, 0, FALSE), + PT(48, 5, 3, 0, TRUE), + PT(19, 0, 2, 1, FALSE), + PT(39, 22, 5, 1, FALSE), + PT(15, 40, 4, 3, TRUE), + PT(12, 35, 5, 3, TRUE), + PT(57, 40, 5, 1, FALSE), + PT(36, 37, 3, 3, TRUE), + PT(24, 41, 2, 2, FALSE), + PT(22, 5, 3, 1, FALSE), + PT(53, 47, 4, 3, FALSE), + PT(10, 58, 5, 0, TRUE), + PT(52, 44, 6, 3, FALSE), + PT(46, 58, 2, 2, TRUE), + PT(26, 10, 5, 2, TRUE), + PT(22, 20, 5, 3, FALSE), + PT(53, 40, 5, 1, FALSE), + PT(53, 15, 2, 0, TRUE), + PT(17, 50, 3, 0, TRUE), + PT(32, 26, 5, 0, FALSE), + PT(23, 26, 5, 0, FALSE), + PT(22, 51, 4, 2, TRUE), + PT(19, 44, 5, 0, TRUE), + PT( 9, 22, 6, 1, TRUE), + PT(29, 39, 4, 3, FALSE), + PT(21, 12, 5, 3, TRUE), + PT(34, 28, 3, 0, TRUE), + PT(41, 51, 2, 0, FALSE), + PT(45, 17, 3, 1, TRUE), + PT(22, 25, 5, 3, FALSE), + PT(13, 12, 5, 0, FALSE), + PT(55, 58, 6, 2, FALSE), + PT(42, 29, 6, 3, TRUE), + PT(48, 10, 6, 3, FALSE), + PT(36, 57, 3, 1, TRUE), + PT(57, 10, 6, 1, FALSE), + PT(17, 3, 5, 2, TRUE), + PT(50, 29, 6, 0, FALSE), + PT(56, 30, 4, 3, TRUE), + PT(46, 23, 3, 0, FALSE), + PT(22, 23, 5, 1, FALSE), + PT(54, 59, 6, 0, TRUE), + PT(23, 4, 3, 0, TRUE), + PT(58, 37, 5, 2, TRUE), + PT( 0, 54, 4, 3, TRUE), + PT(37, 18, 6, 1, TRUE), + PT( 6, 10, 2, 2, FALSE), + PT(17, 5, 5, 3, TRUE), + PT( 3, 53, 5, 3, TRUE), + PT(11, 52, 5, 0, TRUE), + PT( 0, 49, 2, 1, TRUE), + PT(39, 15, 3, 2, FALSE), + PT(29, 6, 5, 2, TRUE), + PT(28, 48, 4, 3, TRUE), + PT(47, 42, 4, 3, TRUE), + PT(22, 32, 6, 0, TRUE), + PT(51, 43, 5, 1, TRUE), + PT( 5, 48, 6, 3, FALSE), + PT(41, 35, 6, 2, TRUE), + PT(16, 22, 5, 3, TRUE), + PT(45, 32, 5, 0, TRUE), + PT(55, 19, 4, 2, FALSE), + PT(45, 14, 4, 2, TRUE), + PT( 8, 10, 3, 0, FALSE), + PT(15, 3, 3, 1, TRUE), + PT(49, 12, 6, 3, TRUE), + PT(30, 52, 6, 0, TRUE), + PT(27, 14, 4, 2, TRUE), + PT(26, 7, 6, 2, FALSE), + PT(13, 60, 6, 1, TRUE), + PT( 0, 58, 6, 3, FALSE), + PT( 4, 39, 2, 1, FALSE), + PT(35, 24, 4, 2, FALSE), + PT(13, 11, 3, 0, FALSE), + PT(49, 50, 6, 3, TRUE), + PT( 0, 13, 4, 0, TRUE), + PT(50, 16, 2, 1, FALSE), + PT(38, 13, 3, 0, TRUE), + PT(41, 36, 5, 1, TRUE), + PT(61, 33, 3, 3, TRUE), + PT(30, 27, 5, 0, FALSE), + PT(13, 18, 5, 0, FALSE), + PT(53, 30, 4, 1, TRUE), + PT(10, 46, 4, 1, FALSE), + PT(39, 39, 6, 2, TRUE), + PT( 1, 14, 4, 0, FALSE), + PT(49, 57, 5, 0, TRUE), + PT(59, 36, 6, 3, FALSE), + PT(20, 16, 6, 1, TRUE), + PT(24, 44, 4, 3, FALSE), + PT( 4, 45, 2, 2, TRUE), + PT(26, 17, 6, 3, TRUE), + PT(15, 11, 2, 2, FALSE), + PT(14, 44, 5, 2, FALSE), + PT(33, 23, 5, 2, FALSE), + PT(22, 33, 6, 2, TRUE), + PT(62, 16, 2, 0, FALSE), + PT(10, 5, 3, 3, FALSE), + PT(59, 9, 2, 1, TRUE), + PT(38, 24, 3, 3, FALSE), + PT(35, 12, 3, 1, FALSE), + PT(51, 55, 3, 3, TRUE), + PT( 9, 18, 6, 2, TRUE), + PT(61, 13, 2, 2, TRUE), + PT(54, 6, 4, 2, FALSE), + PT(51, 48, 5, 0, TRUE), + PT(59, 15, 5, 0, FALSE), + PT(52, 42, 5, 2, FALSE), + PT( 2, 18, 6, 2, TRUE), + PT( 9, 34, 6, 0, TRUE), + PT(59, 49, 3, 2, FALSE), + PT(51, 34, 4, 3, TRUE), + PT(61, 52, 2, 2, TRUE), + PT(20, 34, 5, 0, FALSE), + PT(40, 16, 3, 3, FALSE), + PT(33, 49, 2, 0, FALSE), + PT(45, 22, 4, 0, TRUE), + PT(30, 5, 6, 1, TRUE), + PT(15, 48, 6, 0, TRUE), + PT(14, 26, 6, 2, TRUE), + PT(56, 46, 5, 0, FALSE), + PT(38, 55, 3, 3, FALSE), + PT(43, 19, 6, 1, TRUE), + PT(31, 30, 6, 3, TRUE), + PT(10, 40, 4, 2, FALSE), + PT(50, 28, 3, 1, FALSE), + PT(31, 63, 3, 0, TRUE), + PT(57, 57, 5, 0, TRUE), + PT(44, 27, 2, 2, FALSE), + PT(21, 42, 2, 3, TRUE), + PT(50, 15, 4, 0, TRUE), + PT(48, 33, 3, 0, FALSE), + PT(35, 42, 4, 3, TRUE), + PT(61, 7, 2, 0, FALSE), + PT(11, 63, 5, 3, TRUE), + PT(49, 2, 5, 3, FALSE), + PT( 8, 57, 5, 3, TRUE), + PT(63, 32, 3, 0, FALSE), + PT(45, 52, 2, 0, TRUE), + PT(46, 52, 2, 0, FALSE), + PT(38, 18, 4, 1, TRUE), + PT(37, 10, 6, 3, TRUE), + PT(52, 9, 4, 2, TRUE), + PT(10, 62, 2, 3, FALSE), + PT(26, 23, 2, 0, TRUE), + PT(56, 28, 4, 0, FALSE), + PT(17, 33, 4, 3, FALSE), + PT( 5, 15, 3, 0, FALSE), + PT(38, 43, 6, 1, FALSE), + PT(10, 12, 2, 3, FALSE), + PT( 3, 41, 3, 2, TRUE), + PT(41, 59, 4, 1, TRUE), + PT(22, 27, 5, 0, TRUE), + PT( 7, 9, 2, 3, TRUE), + PT(23, 44, 3, 2, FALSE), + PT(53, 51, 6, 0, FALSE), + PT(23, 18, 3, 3, FALSE), + PT(61, 26, 5, 1, TRUE), + PT(33, 29, 2, 0, FALSE), + PT(10, 8, 2, 3, TRUE), + PT(20, 60, 6, 3, FALSE), + PT(40, 54, 6, 3, FALSE), + PT(59, 32, 3, 1, TRUE), + PT(19, 34, 3, 2, TRUE), + PT(19, 58, 2, 2, TRUE), + PT( 2, 35, 5, 2, FALSE), + PT(62, 25, 2, 2, FALSE), + PT(57, 60, 3, 1, FALSE), + PT(16, 8, 3, 3, FALSE), + PT(10, 19, 5, 0, TRUE), + PT(63, 56, 5, 2, FALSE), + PT( 7, 35, 3, 3, TRUE), + PT(25, 42, 4, 2, FALSE), + PT(20, 60, 3, 3, TRUE), + PT(13, 4, 6, 3, TRUE), + PT(26, 47, 5, 0, FALSE), + PT(42, 29, 3, 3, FALSE), + PT(17, 55, 5, 0, TRUE), + PT(40, 39, 2, 1, FALSE), + PT(13, 0, 4, 3, FALSE), + PT(10, 60, 4, 3, FALSE), + PT(31, 28, 6, 1, TRUE), + PT( 4, 58, 5, 2, FALSE), + PT(36, 61, 5, 1, TRUE), + PT(38, 49, 5, 3, TRUE), + PT(19, 28, 4, 0, TRUE), + PT(62, 18, 4, 1, TRUE), + PT(54, 10, 3, 1, FALSE), + PT(45, 30, 3, 0, TRUE), + PT( 5, 31, 3, 1, TRUE), + PT(30, 10, 3, 3, TRUE), + PT(32, 8, 4, 2, FALSE), + PT(44, 12, 6, 1, TRUE), + PT(29, 31, 2, 0, TRUE), + PT(14, 18, 2, 0, FALSE), + PT(39, 18, 3, 0, TRUE), + PT(42, 19, 6, 0, TRUE), + PT(28, 4, 6, 0, FALSE), + PT(26, 56, 3, 3, TRUE), + PT(44, 53, 4, 2, TRUE), + PT( 7, 11, 6, 1, TRUE), + PT(45, 2, 3, 1, FALSE), + PT(42, 53, 6, 2, TRUE), + PT(22, 47, 2, 2, FALSE), + PT(17, 49, 6, 1, TRUE), + PT(44, 49, 3, 3, FALSE), + PT(60, 58, 4, 3, TRUE), + PT(60, 43, 2, 1, FALSE), + PT(39, 29, 2, 1, FALSE), + PT(54, 44, 5, 1, TRUE), + PT(37, 59, 6, 2, TRUE), + PT(18, 61, 4, 3, TRUE), + PT(19, 35, 3, 0, TRUE), + PT(51, 44, 4, 3, FALSE), + PT( 9, 60, 2, 1, FALSE), + PT(21, 26, 4, 1, TRUE), + PT(33, 7, 3, 1, FALSE), + PT(34, 37, 4, 0, FALSE), + PT(25, 27, 5, 2, FALSE), + PT(58, 25, 6, 2, TRUE), + PT( 5, 38, 3, 2, TRUE), + PT(35, 34, 4, 2, TRUE), + PT(14, 30, 2, 0, TRUE), + PT(19, 48, 2, 1, FALSE), + PT(44, 34, 4, 2, TRUE), + PT(10, 29, 3, 0, FALSE), + PT(35, 62, 3, 2, TRUE), + PT( 2, 40, 4, 2, TRUE), + PT(33, 14, 4, 0, FALSE), + PT(33, 34, 6, 3, TRUE), + PT(24, 51, 4, 3, TRUE), + PT(35, 35, 6, 0, TRUE), + PT(36, 26, 3, 1, FALSE), + PT(62, 37, 4, 2, FALSE), + PT(36, 1, 3, 0, FALSE), + PT(52, 16, 4, 1, FALSE), + PT( 7, 0, 6, 3, TRUE), + PT( 6, 32, 4, 0, FALSE), + PT(58, 2, 5, 1, TRUE), + PT( 7, 44, 5, 2, FALSE), + PT( 9, 47, 5, 1, FALSE), + PT( 1, 50, 5, 2, FALSE), + PT( 0, 53, 2, 1, TRUE), + PT(43, 60, 3, 3, TRUE), + PT(54, 55, 3, 3, FALSE), + PT(32, 53, 3, 2, TRUE), + PT(12, 7, 6, 1, TRUE), + PT(22, 8, 2, 1, FALSE), + PT(63, 54, 2, 0, TRUE), + PT(11, 31, 5, 2, TRUE), + PT(33, 32, 6, 1, TRUE), + PT(23, 26, 5, 3, FALSE), + PT(22, 1, 5, 3, TRUE), + PT(47, 28, 6, 2, FALSE), + PT(41, 49, 5, 3, FALSE), + PT(59, 56, 6, 0, TRUE), + PT(13, 22, 2, 1, FALSE), + PT( 7, 41, 4, 2, FALSE), + PT(51, 60, 6, 2, FALSE), + PT(62, 30, 3, 0, FALSE), + PT(48, 2, 6, 2, FALSE), + PT(42, 52, 3, 1, TRUE), + PT(46, 35, 3, 0, FALSE), + PT(52, 0, 3, 3, TRUE), + PT(32, 14, 5, 0, FALSE), + PT(21, 51, 6, 3, TRUE), + PT(39, 53, 4, 1, TRUE), + PT(55, 62, 2, 0, TRUE), + PT(50, 46, 6, 3, FALSE), + PT(58, 2, 5, 1, TRUE), + PT( 0, 54, 3, 2, TRUE), + PT(19, 41, 2, 3, FALSE), + PT( 8, 43, 6, 3, TRUE), + PT( 8, 2, 4, 3, TRUE), + PT(50, 45, 6, 2, FALSE), + PT(48, 54, 5, 0, TRUE), + PT(46, 16, 2, 1, FALSE), + PT(60, 46, 5, 1, FALSE), + PT( 4, 51, 6, 0, FALSE), + PT(63, 1, 4, 1, FALSE), + PT(55, 20, 3, 2, TRUE), + PT(39, 0, 5, 3, TRUE), + PT(12, 57, 4, 3, FALSE), + PT(39, 4, 4, 0, TRUE), + PT(25, 8, 3, 2, TRUE), + PT( 1, 4, 3, 3, FALSE), + PT(39, 27, 5, 1, TRUE), + PT(49, 23, 3, 3, TRUE), + PT( 7, 1, 5, 2, TRUE), + PT(46, 59, 3, 3, TRUE), + PT(52, 36, 6, 0, TRUE), + PT(50, 43, 4, 2, FALSE), + PT(14, 7, 3, 3, FALSE), + PT(15, 51, 2, 0, FALSE), + PT(22, 33, 6, 1, FALSE), + PT(57, 2, 3, 1, FALSE), + PT(51, 61, 4, 1, FALSE), + PT(12, 37, 3, 1, FALSE), + PT(41, 41, 5, 0, FALSE), + PT(58, 50, 4, 3, FALSE), + PT(11, 19, 4, 1, FALSE), + PT(31, 15, 3, 2, FALSE), + PT( 4, 44, 4, 0, FALSE), + PT(57, 26, 3, 1, TRUE), + PT(26, 42, 3, 3, TRUE), + PT(36, 19, 3, 1, FALSE), + PT(49, 59, 6, 1, TRUE), + PT(57, 35, 5, 0, FALSE), + PT(49, 7, 6, 0, TRUE), + PT(31, 16, 4, 0, FALSE), + PT(41, 23, 6, 1, FALSE), + PT(38, 59, 5, 2, TRUE), + PT( 2, 60, 3, 2, FALSE), + PT(14, 0, 4, 0, FALSE), + PT(20, 62, 6, 3, TRUE), + PT( 1, 15, 5, 2, TRUE), + PT( 6, 18, 4, 3, TRUE), + PT(48, 19, 3, 0, TRUE), + PT( 0, 51, 5, 1, FALSE), + PT(12, 7, 4, 3, TRUE), + PT(17, 58, 3, 2, FALSE), + PT(21, 10, 2, 1, TRUE), + PT(31, 13, 5, 1, FALSE), + PT(55, 7, 5, 1, FALSE), + PT(52, 53, 6, 2, FALSE), + PT(40, 22, 4, 3, TRUE), + PT( 6, 2, 6, 3, FALSE), + PT( 9, 35, 6, 0, FALSE), + PT(20, 2, 5, 0, FALSE), + PT(57, 50, 6, 2, FALSE), + PT(36, 53, 2, 1, FALSE), + PT(18, 34, 4, 3, FALSE), + PT( 9, 7, 6, 1, TRUE), + PT(15, 62, 3, 3, FALSE), + PT( 0, 60, 6, 1, TRUE), + PT(16, 55, 2, 2, FALSE), + PT(58, 3, 4, 2, TRUE), + PT(45, 30, 4, 2, FALSE), + PT(54, 54, 4, 3, FALSE), + PT(31, 60, 3, 1, FALSE), + PT(55, 51, 4, 2, TRUE), + PT(35, 19, 3, 3, TRUE), + PT(51, 13, 2, 1, TRUE), + PT(37, 48, 3, 3, FALSE), + PT(23, 3, 3, 0, FALSE), + PT(24, 24, 2, 2, FALSE), + PT(48, 7, 4, 1, FALSE), + PT(62, 51, 4, 0, TRUE), + PT(20, 55, 2, 3, FALSE), + PT(22, 0, 2, 1, FALSE), + PT(44, 18, 5, 3, TRUE), + PT(37, 63, 3, 3, FALSE), + PT(36, 25, 2, 3, FALSE), + PT(22, 15, 6, 2, TRUE), + PT(45, 16, 2, 0, TRUE), + PT(36, 42, 5, 0, FALSE), + PT(25, 37, 5, 3, FALSE), + PT(12, 22, 3, 3, TRUE), + PT(56, 33, 6, 3, FALSE), + PT(61, 26, 5, 3, TRUE), + PT(59, 50, 2, 1, FALSE), + PT(54, 19, 5, 0, TRUE), + PT(14, 48, 6, 0, TRUE), + PT(25, 7, 5, 3, TRUE), + PT(37, 35, 5, 0, FALSE), + PT(32, 8, 5, 0, TRUE), + PT(42, 0, 6, 0, FALSE), + PT(48, 56, 4, 1, TRUE), + PT(30, 15, 3, 3, TRUE), + PT(59, 27, 6, 0, FALSE), + PT(58, 55, 5, 3, TRUE), + PT(57, 55, 6, 2, TRUE), + PT(57, 45, 5, 3, TRUE), + PT(31, 46, 3, 3, FALSE), + PT(26, 43, 3, 3, FALSE), + PT(20, 23, 4, 0, FALSE), + PT(47, 3, 2, 0, TRUE), + PT(29, 0, 6, 0, FALSE), + PT(23, 43, 3, 2, TRUE), + PT(53, 40, 4, 2, TRUE), + PT(59, 15, 2, 0, TRUE), + PT( 9, 4, 5, 3, FALSE), + PT(35, 17, 3, 3, FALSE), + PT(19, 55, 3, 3, FALSE), + PT(55, 55, 3, 3, FALSE), + PT( 7, 1, 6, 1, FALSE), + PT(20, 6, 6, 1, FALSE), + PT(17, 12, 5, 3, FALSE), + PT(54, 46, 4, 2, FALSE), + PT(21, 42, 3, 2, FALSE), + PT(34, 21, 6, 2, FALSE), + PT(44, 30, 6, 2, TRUE), + PT(34, 39, 6, 1, TRUE), + PT(25, 63, 5, 2, TRUE), + PT(33, 51, 2, 2, TRUE), + PT(38, 26, 2, 0, TRUE), + PT(22, 62, 2, 1, FALSE), + PT(43, 36, 2, 2, TRUE), + PT(60, 15, 5, 2, TRUE), + PT(49, 21, 6, 3, FALSE), + PT(63, 36, 3, 2, TRUE), + PT(37, 1, 6, 3, TRUE), + PT(51, 22, 3, 1, FALSE), + PT(31, 14, 2, 0, FALSE), + PT(47, 11, 2, 1, FALSE), + PT(42, 26, 4, 2, TRUE), + PT(23, 10, 6, 2, TRUE), + PT( 9, 40, 6, 2, TRUE), + PT( 2, 19, 6, 3, FALSE), + PT(52, 47, 2, 3, TRUE), + PT( 3, 4, 6, 0, TRUE), + PT(62, 38, 2, 0, TRUE), + PT(53, 51, 6, 0, TRUE), + PT(34, 23, 4, 1, TRUE), + PT(29, 5, 5, 1, TRUE), + PT(46, 39, 4, 0, FALSE), + PT( 3, 43, 3, 2, TRUE), + PT( 1, 25, 3, 3, FALSE), + PT(14, 5, 3, 0, FALSE), + PT(22, 37, 2, 3, TRUE), + PT( 2, 40, 3, 0, FALSE), + PT(25, 11, 4, 2, FALSE), + PT(62, 53, 2, 3, FALSE), + PT(46, 41, 4, 2, TRUE), + PT(62, 56, 3, 3, FALSE), + PT(58, 47, 2, 1, FALSE), + PT(20, 23, 5, 2, TRUE), + PT(17, 18, 6, 0, FALSE), + PT(21, 49, 3, 0, FALSE), + PT( 8, 11, 5, 0, TRUE), + PT(45, 0, 6, 1, TRUE), + PT(44, 6, 3, 1, FALSE), + PT(20, 28, 5, 3, FALSE), + PT( 4, 8, 2, 1, FALSE), + PT(27, 43, 5, 2, TRUE), + PT(42, 55, 6, 1, TRUE), + PT(16, 39, 5, 2, FALSE), + PT(29, 14, 6, 2, FALSE), + PT(32, 2, 2, 1, FALSE), + PT(30, 26, 5, 3, FALSE), + PT( 7, 11, 2, 0, FALSE), + PT(54, 30, 6, 1, TRUE), + PT(43, 40, 3, 1, TRUE), + PT(49, 37, 3, 3, TRUE), + PT(56, 58, 5, 3, TRUE), + PT(57, 48, 5, 3, TRUE), + PT(18, 9, 2, 2, FALSE), + PT(14, 8, 3, 0, TRUE), + PT( 0, 13, 5, 2, FALSE), + PT(27, 14, 6, 2, FALSE), + PT(17, 37, 2, 2, TRUE), + PT(12, 45, 4, 3, FALSE), + PT(54, 44, 2, 3, FALSE), + PT(49, 49, 5, 2, FALSE), + PT( 3, 26, 2, 3, FALSE), + PT(28, 50, 2, 2, FALSE), + PT(10, 62, 6, 3, FALSE), + PT(51, 27, 4, 3, TRUE), + PT(31, 50, 3, 0, FALSE), + PT(51, 38, 6, 1, TRUE), + PT(26, 19, 3, 1, FALSE), + PT(15, 52, 3, 2, FALSE), + PT(53, 44, 5, 3, TRUE), + PT(56, 3, 3, 0, FALSE), + PT(21, 15, 4, 3, TRUE), + PT(49, 41, 4, 0, FALSE), + PT(40, 14, 5, 0, FALSE), + PT(49, 44, 5, 3, FALSE), + PT(21, 25, 3, 1, TRUE), + PT(16, 3, 5, 3, TRUE), + PT(46, 42, 6, 1, FALSE), + PT(42, 39, 3, 1, TRUE), + PT(54, 4, 3, 3, FALSE), + PT(59, 4, 4, 0, TRUE), + PT( 7, 47, 3, 0, TRUE), + PT(39, 29, 3, 2, TRUE), + PT(60, 61, 5, 3, FALSE), + PT(37, 8, 6, 1, FALSE), + PT(59, 52, 5, 1, FALSE), + PT(12, 16, 2, 1, TRUE), + PT(37, 53, 3, 1, FALSE), + PT(47, 25, 5, 0, FALSE), + PT(23, 0, 5, 1, TRUE), + PT(10, 28, 2, 3, TRUE), + PT(10, 17, 3, 1, TRUE), + PT(53, 19, 6, 3, TRUE), + PT(41, 28, 5, 0, FALSE), + PT(12, 49, 6, 2, TRUE), + PT(60, 16, 3, 1, FALSE), + PT(27, 58, 5, 2, TRUE), + PT(58, 28, 3, 0, FALSE), + PT(34, 16, 5, 2, TRUE), + PT(28, 60, 2, 1, FALSE), + PT(23, 24, 5, 1, FALSE), + PT(11, 43, 5, 3, TRUE), + PT(45, 4, 5, 3, FALSE), + PT(60, 19, 4, 1, TRUE), + PT( 1, 28, 5, 3, FALSE), + PT(20, 22, 4, 1, FALSE), + PT(12, 36, 2, 1, TRUE), + PT(53, 55, 6, 2, FALSE), + PT(27, 48, 3, 3, FALSE), + PT(58, 28, 4, 0, FALSE), + PT( 6, 6, 6, 3, FALSE), + PT( 9, 21, 3, 1, FALSE), + PT(27, 26, 4, 3, TRUE), + PT(15, 51, 6, 2, TRUE), + PT(55, 6, 4, 1, TRUE), + PT(58, 18, 3, 2, TRUE), + PT( 0, 22, 5, 0, TRUE), + PT(14, 29, 6, 2, TRUE), + PT(63, 56, 2, 3, FALSE), + PT(42, 60, 6, 2, FALSE), + PT(19, 50, 2, 0, FALSE), + PT(23, 44, 6, 3, TRUE), + PT(41, 42, 3, 3, FALSE), + PT(53, 47, 5, 2, TRUE), + PT(60, 42, 2, 0, TRUE), + PT(40, 19, 4, 0, TRUE), + PT(25, 30, 6, 2, FALSE), + PT(12, 6, 5, 2, TRUE), + PT( 9, 4, 3, 2, FALSE), + PT(29, 47, 4, 3, FALSE), + PT(57, 7, 2, 3, FALSE), + PT(20, 4, 5, 2, TRUE), + PT(58, 47, 5, 3, FALSE), + PT(41, 21, 6, 2, TRUE), + PT(36, 2, 6, 3, FALSE), + PT(63, 2, 3, 1, FALSE), + PT(15, 24, 4, 2, FALSE), + PT(22, 29, 3, 0, TRUE), + PT(20, 22, 2, 0, FALSE), + PT(41, 27, 2, 1, TRUE), + PT(21, 14, 3, 0, TRUE), + PT(58, 46, 5, 1, TRUE), + PT( 8, 48, 2, 2, TRUE), + PT(53, 22, 6, 0, FALSE), + PT(46, 24, 6, 2, TRUE), + PT(59, 11, 3, 2, FALSE), + PT(58, 24, 2, 1, TRUE), + PT(41, 19, 3, 3, FALSE), + PT(32, 19, 4, 3, TRUE), + PT( 4, 29, 6, 2, FALSE), + PT( 0, 56, 3, 0, TRUE), + PT( 8, 57, 6, 1, FALSE), + PT(32, 16, 4, 3, FALSE), + PT( 8, 2, 5, 0, FALSE), + PT(63, 15, 2, 3, FALSE), + PT(48, 31, 3, 0, TRUE), + PT(32, 45, 2, 0, FALSE), + PT(56, 23, 3, 2, FALSE), + PT(24, 49, 4, 3, TRUE), + PT(51, 56, 6, 0, FALSE), + PT(22, 51, 4, 1, TRUE), + PT( 0, 1, 6, 3, FALSE), + PT(13, 2, 4, 1, TRUE), + PT(57, 4, 3, 3, TRUE), + PT(14, 48, 4, 2, FALSE), + PT( 6, 1, 5, 2, FALSE), + PT(52, 51, 6, 2, TRUE), + PT(22, 52, 5, 3, FALSE), + PT(50, 22, 4, 2, FALSE), + PT(38, 57, 6, 2, FALSE), + PT(31, 60, 3, 2, TRUE), + PT(40, 29, 6, 3, TRUE), + PT(23, 21, 5, 1, TRUE), + PT(39, 57, 6, 0, FALSE), + PT(11, 27, 3, 0, FALSE), + PT(53, 32, 5, 2, TRUE), + PT(11, 53, 3, 2, FALSE), + PT( 3, 14, 4, 0, TRUE), + PT( 6, 12, 4, 0, FALSE), + PT( 2, 24, 6, 2, FALSE), + PT(30, 54, 5, 2, TRUE), + PT(22, 12, 3, 0, TRUE), + PT(37, 9, 5, 2, FALSE), + PT(55, 5, 5, 3, FALSE), + PT(46, 43, 5, 2, FALSE), + PT(36, 26, 2, 2, FALSE), + PT(39, 4, 2, 0, FALSE), + PT(50, 56, 6, 1, TRUE), + PT(55, 21, 6, 2, TRUE), + PT(17, 63, 3, 2, TRUE), + PT(35, 35, 3, 3, TRUE), + PT(41, 63, 3, 2, TRUE), + PT(26, 60, 5, 1, TRUE), + PT(27, 44, 5, 2, FALSE), + PT(56, 59, 6, 3, FALSE), + PT( 4, 19, 6, 1, TRUE), + PT(44, 20, 2, 1, FALSE), + PT(26, 9, 3, 1, TRUE), + PT(54, 17, 4, 2, FALSE), + PT(58, 63, 2, 0, TRUE), + PT( 1, 14, 5, 1, TRUE), + PT(59, 3, 5, 1, FALSE), + PT( 8, 13, 5, 1, TRUE), + PT(43, 19, 4, 3, TRUE), + PT(58, 60, 3, 2, FALSE), + PT(58, 21, 5, 1, FALSE), + PT(36, 0, 2, 3, TRUE), + PT(62, 10, 2, 2, TRUE), + PT(12, 41, 5, 2, TRUE), + PT(31, 21, 6, 0, FALSE), + PT(53, 24, 3, 0, TRUE), + PT(61, 55, 6, 3, TRUE), + PT(18, 56, 3, 1, TRUE), + PT(59, 2, 4, 0, FALSE), + PT( 8, 33, 3, 0, TRUE), + PT(46, 54, 3, 2, TRUE), + PT(21, 61, 4, 2, FALSE), + PT(34, 12, 4, 3, TRUE), + PT(54, 63, 6, 1, TRUE), + PT(51, 18, 2, 0, TRUE), + PT(26, 25, 3, 3, TRUE), + PT(43, 36, 2, 1, FALSE), + PT(17, 42, 3, 0, FALSE), + PT(37, 50, 5, 1, FALSE), + PT(44, 26, 2, 1, FALSE), + PT(38, 6, 2, 0, FALSE), + PT(17, 41, 6, 1, TRUE), + PT(44, 9, 2, 2, FALSE), + PT(43, 18, 5, 1, TRUE), + PT(29, 3, 4, 2, FALSE), + PT( 0, 18, 2, 2, TRUE), + PT(34, 61, 4, 3, FALSE), + PT(21, 55, 3, 1, FALSE), + PT(15, 18, 6, 3, TRUE), + PT(36, 1, 3, 0, FALSE), + PT(42, 23, 2, 1, TRUE), + PT(20, 59, 5, 0, TRUE), + PT(42, 25, 6, 1, FALSE), + PT(45, 23, 2, 3, TRUE), + PT(11, 44, 6, 1, TRUE), + PT( 7, 45, 6, 2, FALSE), + PT( 7, 56, 3, 2, TRUE), + PT(31, 54, 4, 1, FALSE), + PT(17, 10, 2, 3, TRUE), + PT(20, 17, 2, 1, TRUE), + PT(42, 23, 4, 2, TRUE), + PT( 1, 58, 3, 2, FALSE), + PT(38, 39, 6, 0, FALSE), + PT(45, 59, 6, 2, TRUE), + PT(58, 48, 6, 2, FALSE), + PT( 6, 58, 3, 2, FALSE), + PT(45, 5, 2, 1, TRUE), + PT(33, 50, 2, 1, FALSE), + PT(62, 30, 5, 2, FALSE), + PT(58, 63, 5, 2, TRUE), + PT(32, 42, 6, 2, FALSE), + PT(38, 3, 3, 1, FALSE), + PT(25, 39, 5, 3, FALSE), + PT(49, 4, 4, 3, FALSE), + PT(42, 63, 6, 0, FALSE), + PT(37, 35, 5, 1, FALSE), + PT( 8, 8, 6, 2, TRUE), + PT(44, 48, 3, 3, FALSE), + PT( 8, 5, 3, 0, FALSE), + PT( 6, 9, 5, 2, TRUE), + PT(25, 0, 4, 3, TRUE), + PT(13, 16, 3, 0, TRUE), + PT(28, 0, 2, 1, TRUE), + PT(61, 11, 4, 2, FALSE), + PT(46, 31, 2, 3, FALSE), + PT(61, 24, 6, 2, FALSE), + PT(18, 30, 2, 2, TRUE), + PT(21, 57, 4, 2, TRUE), + PT(51, 15, 2, 3, TRUE), + PT(26, 28, 3, 1, TRUE), + PT(55, 41, 3, 1, TRUE), + PT(59, 56, 2, 1, FALSE), + PT(29, 34, 6, 2, FALSE), + PT(38, 10, 6, 0, TRUE), + PT(22, 45, 2, 1, TRUE), + PT(13, 32, 4, 3, TRUE), + PT(36, 29, 2, 3, FALSE), + PT(46, 43, 3, 0, FALSE), + PT(22, 42, 3, 1, TRUE), + PT(36, 23, 6, 3, FALSE), + PT( 2, 5, 5, 1, TRUE), + PT(55, 26, 2, 3, TRUE), + PT(17, 61, 5, 2, FALSE), + PT(30, 47, 4, 1, FALSE), + PT(44, 41, 3, 1, FALSE), + PT(47, 4, 4, 2, TRUE), + PT(54, 12, 6, 2, TRUE), + PT(48, 62, 2, 1, FALSE), + PT(17, 48, 6, 3, TRUE), + PT(18, 33, 5, 3, FALSE), + PT(33, 48, 2, 3, TRUE), + PT(44, 61, 4, 2, FALSE), + PT(17, 35, 2, 2, FALSE), + PT(26, 50, 2, 3, TRUE), + PT(57, 39, 3, 0, FALSE), + PT(15, 36, 3, 0, TRUE), + PT( 0, 61, 6, 3, TRUE), + PT(44, 60, 3, 2, FALSE), + PT(11, 57, 4, 1, TRUE), + PT(14, 4, 3, 3, TRUE), + PT(28, 49, 2, 2, FALSE), + PT( 0, 4, 2, 2, TRUE), + PT(38, 42, 5, 1, FALSE), + PT(32, 37, 5, 1, FALSE), + PT(11, 60, 6, 1, TRUE), + PT(17, 11, 5, 3, FALSE), + PT(55, 34, 5, 3, FALSE), + PT(14, 34, 4, 3, FALSE), + PT(24, 45, 4, 3, TRUE), + PT( 6, 12, 3, 2, FALSE), + PT(38, 24, 5, 3, TRUE), + PT(58, 1, 5, 1, FALSE), + PT(47, 49, 6, 2, FALSE), + PT(31, 52, 3, 1, FALSE), + PT(49, 5, 2, 0, FALSE), + PT(46, 23, 6, 2, FALSE), + PT(24, 34, 4, 1, TRUE), + PT(35, 33, 6, 1, FALSE), + PT( 7, 8, 4, 1, FALSE), + PT(38, 28, 4, 1, FALSE), + PT(49, 18, 5, 3, TRUE), + PT( 8, 31, 2, 0, FALSE), + PT(39, 21, 5, 1, FALSE), + PT(31, 11, 4, 3, FALSE), + PT(47, 20, 6, 2, TRUE), + PT(36, 31, 4, 3, FALSE), + PT(59, 35, 6, 1, TRUE), + PT(32, 62, 5, 2, TRUE), + PT(23, 12, 2, 2, TRUE), + PT(19, 57, 3, 1, FALSE), + PT(48, 20, 4, 2, TRUE), + PT( 9, 7, 2, 3, TRUE), + PT(56, 56, 3, 3, TRUE), + PT(41, 36, 4, 3, TRUE), + PT(23, 39, 5, 0, FALSE), + PT(27, 18, 5, 1, FALSE), + PT(43, 61, 5, 2, TRUE), + PT(25, 52, 3, 2, FALSE), + PT( 1, 29, 2, 0, FALSE), + PT( 8, 57, 2, 0, TRUE), + PT(14, 54, 3, 1, TRUE), + PT(38, 19, 2, 0, FALSE), + PT(22, 40, 3, 3, FALSE), + PT(60, 40, 2, 3, TRUE), + PT(62, 57, 6, 2, FALSE), + PT(10, 3, 5, 3, FALSE), + PT(55, 26, 2, 1, TRUE), + PT(43, 51, 4, 3, FALSE), + PT(19, 44, 4, 0, TRUE), + PT(37, 20, 2, 0, FALSE), + PT(22, 11, 6, 2, TRUE), + PT(29, 53, 6, 1, TRUE), + PT(33, 8, 6, 1, TRUE), + PT(40, 33, 3, 1, FALSE), + PT(18, 12, 3, 1, TRUE), + PT(54, 42, 3, 0, TRUE), + PT(44, 43, 4, 1, TRUE), + PT( 1, 15, 4, 3, FALSE), + PT(23, 12, 3, 0, FALSE), + PT( 9, 15, 2, 0, TRUE), + PT(43, 36, 3, 2, FALSE), + PT( 9, 9, 2, 2, TRUE), + PT(54, 8, 2, 1, TRUE), + PT(32, 57, 4, 0, TRUE), + PT( 0, 58, 3, 3, TRUE), + PT(43, 54, 6, 0, TRUE), + PT( 2, 55, 2, 1, TRUE), + PT( 4, 52, 6, 2, TRUE), + PT(55, 61, 3, 1, FALSE), + PT(23, 61, 2, 1, TRUE), + PT(43, 54, 5, 3, TRUE), + PT(19, 30, 2, 1, TRUE), + PT(62, 17, 6, 1, TRUE), + PT(39, 58, 5, 2, TRUE), + PT(30, 49, 3, 1, FALSE), + PT( 3, 3, 5, 2, TRUE), + PT(37, 55, 3, 3, TRUE), + PT(17, 1, 4, 1, FALSE), + PT(28, 18, 2, 3, TRUE), + PT(48, 58, 6, 0, FALSE), + PT(23, 29, 5, 0, TRUE), + PT(14, 19, 4, 3, TRUE), + PT(26, 46, 4, 2, FALSE), + PT(45, 0, 3, 2, FALSE), + PT(23, 40, 3, 2, TRUE), + PT( 9, 31, 5, 3, FALSE), + PT(26, 45, 4, 3, FALSE), + PT(10, 19, 6, 1, FALSE), + PT(62, 0, 4, 3, TRUE), + PT(11, 59, 6, 0, FALSE), + PT( 8, 58, 5, 2, TRUE), + PT(34, 18, 3, 3, FALSE), + PT(52, 29, 5, 1, TRUE), + PT(38, 34, 6, 2, TRUE), + PT(23, 44, 2, 3, TRUE), + PT(41, 19, 5, 2, TRUE), + PT(45, 16, 2, 0, FALSE), + PT(32, 49, 4, 1, TRUE), + PT(30, 51, 3, 0, FALSE), + PT(51, 6, 5, 2, TRUE), + PT(38, 20, 4, 3, TRUE), + PT(34, 29, 5, 1, FALSE), + PT(45, 6, 3, 0, FALSE), + PT( 7, 9, 5, 3, FALSE), + PT(33, 21, 5, 3, FALSE), + PT(33, 56, 4, 1, TRUE), + PT(53, 11, 6, 2, FALSE), + PT(36, 11, 4, 1, FALSE), + PT(30, 1, 2, 3, TRUE), + PT(11, 36, 2, 0, TRUE), + PT(23, 7, 4, 0, FALSE), + PT(20, 37, 6, 1, FALSE), + PT(26, 14, 5, 3, TRUE), + PT(53, 23, 3, 3, TRUE), + PT(12, 8, 4, 0, TRUE), + PT(48, 53, 3, 3, TRUE), + PT(12, 11, 4, 0, FALSE), + PT( 4, 16, 2, 0, TRUE), + PT(53, 17, 3, 3, FALSE), + PT(51, 61, 2, 3, FALSE), + PT(30, 43, 3, 2, TRUE), + PT(26, 25, 2, 0, FALSE), + PT( 4, 6, 4, 1, FALSE), + PT( 3, 61, 4, 2, FALSE), + PT(42, 14, 6, 2, TRUE), + PT( 3, 62, 2, 3, TRUE), + PT(11, 24, 6, 3, FALSE), + PT(61, 13, 4, 3, FALSE), + PT(53, 18, 4, 0, FALSE), + PT(31, 13, 2, 3, FALSE), + PT(35, 50, 3, 1, FALSE), + PT( 0, 61, 4, 3, FALSE), + PT(48, 25, 6, 3, FALSE), + PT(18, 14, 4, 1, TRUE), + PT( 1, 35, 5, 0, FALSE), + PT(59, 49, 2, 0, TRUE), + PT(45, 28, 6, 3, FALSE), + PT(42, 5, 2, 3, FALSE), + PT(20, 14, 6, 0, FALSE), + PT(58, 55, 3, 0, TRUE), + PT(31, 48, 4, 2, TRUE), + PT(16, 38, 5, 3, TRUE), + PT(34, 17, 3, 3, TRUE), + PT(46, 43, 3, 3, FALSE), + PT(22, 22, 4, 0, TRUE), + PT(50, 24, 6, 2, TRUE), + PT(35, 50, 3, 1, FALSE), + PT(61, 13, 3, 0, TRUE), + PT(57, 9, 4, 1, TRUE), + PT(48, 46, 4, 2, FALSE), + PT(30, 15, 4, 2, FALSE), + PT( 9, 33, 6, 0, TRUE), + PT( 5, 3, 2, 0, TRUE), + PT( 5, 34, 5, 1, FALSE), + PT( 3, 7, 6, 3, TRUE), + PT( 4, 8, 2, 1, TRUE), + PT( 5, 16, 6, 2, FALSE), + PT(55, 20, 5, 0, TRUE), + PT(10, 36, 6, 1, FALSE), + PT(52, 30, 3, 1, TRUE), + PT(18, 23, 5, 3, FALSE), + PT( 1, 2, 2, 1, TRUE), + PT(10, 12, 2, 0, TRUE), + PT( 2, 20, 2, 1, TRUE), + PT(13, 37, 4, 1, TRUE), + PT( 0, 7, 3, 1, FALSE), + PT(28, 40, 6, 2, TRUE), + PT( 8, 14, 5, 2, FALSE), + PT(27, 60, 2, 2, TRUE), + PT(28, 25, 3, 2, TRUE), + PT(50, 19, 3, 1, FALSE), + PT(28, 0, 6, 3, TRUE), + PT(34, 27, 6, 2, TRUE), + PT(57, 62, 2, 2, FALSE), + PT(50, 6, 6, 0, TRUE), + PT(23, 5, 5, 1, TRUE), + PT( 1, 15, 4, 0, FALSE), + PT(30, 15, 6, 2, FALSE), + PT(24, 3, 3, 3, TRUE), + PT(43, 0, 2, 2, FALSE), + PT(21, 58, 6, 0, FALSE), + PT(37, 48, 4, 0, TRUE), + PT(11, 0, 6, 3, TRUE), + PT(36, 55, 3, 2, TRUE), + PT(41, 33, 2, 3, FALSE), + PT(36, 15, 5, 2, FALSE), + PT(62, 21, 6, 3, FALSE), + PT(60, 45, 4, 1, TRUE), + PT(61, 60, 2, 3, TRUE), + PT(26, 28, 2, 1, TRUE), + PT(10, 41, 4, 1, FALSE), + PT(37, 63, 4, 3, FALSE), + PT(59, 57, 5, 3, TRUE), + PT(29, 8, 2, 3, FALSE), + PT(11, 25, 2, 2, FALSE), + PT(18, 1, 5, 2, FALSE), + PT(53, 17, 5, 1, FALSE), + PT( 2, 0, 2, 1, TRUE), + PT(57, 42, 6, 2, TRUE), + PT( 7, 26, 2, 0, TRUE), + PT(36, 14, 3, 3, FALSE), + PT(14, 44, 2, 2, TRUE), + PT( 8, 49, 3, 1, TRUE), + PT(33, 29, 4, 3, FALSE), + PT(29, 28, 5, 1, FALSE), + PT(29, 36, 2, 1, TRUE), + PT( 1, 0, 3, 0, FALSE), + PT(40, 42, 6, 3, TRUE), + PT(21, 15, 2, 1, TRUE), + PT(16, 50, 6, 3, FALSE), + PT(34, 19, 6, 0, TRUE), + PT(19, 5, 3, 3, FALSE), + PT(23, 53, 6, 2, TRUE), + PT(59, 14, 4, 2, FALSE), + PT(53, 58, 3, 2, TRUE), + PT(27, 54, 3, 1, TRUE), + PT( 3, 29, 4, 2, FALSE), + PT(15, 22, 6, 0, FALSE), + PT(45, 9, 4, 2, TRUE), + PT( 5, 33, 2, 1, TRUE), + PT(10, 39, 6, 3, FALSE), + PT( 4, 13, 3, 2, FALSE), + PT( 6, 62, 4, 0, TRUE), + PT(42, 39, 6, 1, TRUE), + PT(40, 14, 2, 2, TRUE), + PT(11, 23, 3, 2, TRUE), + PT(29, 50, 5, 2, TRUE), + PT( 8, 61, 5, 0, TRUE), + PT(33, 50, 2, 3, TRUE), + PT(51, 49, 4, 1, FALSE), + PT(14, 3, 4, 0, TRUE), + PT(13, 11, 2, 3, FALSE), + PT(62, 42, 5, 3, FALSE), + PT(25, 54, 5, 1, FALSE), + PT(13, 0, 2, 2, FALSE), + PT(34, 7, 6, 3, FALSE), + PT(10, 9, 2, 2, TRUE), + PT(20, 16, 4, 1, FALSE), + PT( 7, 22, 5, 2, FALSE), + PT(54, 19, 2, 2, TRUE), + PT( 9, 47, 3, 1, TRUE), + PT(32, 59, 5, 3, FALSE), + PT(58, 58, 2, 3, FALSE), + PT(13, 21, 5, 1, FALSE), + PT(57, 19, 5, 1, TRUE), + PT(11, 1, 5, 1, FALSE), + PT(19, 23, 3, 3, FALSE), + PT( 8, 23, 3, 3, FALSE), + PT(12, 15, 6, 2, FALSE), + PT(31, 49, 2, 1, FALSE), + PT( 7, 58, 3, 2, TRUE), + PT(53, 30, 2, 1, FALSE), + PT(36, 44, 2, 2, TRUE), + PT(14, 33, 3, 0, TRUE), + PT(52, 59, 6, 1, TRUE), + PT(25, 15, 5, 0, FALSE), + PT(16, 47, 5, 3, FALSE), + PT(35, 39, 6, 0, TRUE), + PT(57, 46, 3, 0, FALSE), + PT(60, 63, 4, 2, FALSE), + PT( 7, 35, 6, 0, FALSE), + PT(40, 19, 6, 2, TRUE), + PT(19, 10, 2, 0, FALSE), + PT(53, 25, 6, 1, TRUE), + PT(35, 40, 5, 0, TRUE), + PT(19, 47, 3, 1, FALSE), + PT(58, 25, 2, 2, FALSE), + PT(55, 54, 4, 3, FALSE), + PT(32, 59, 2, 2, TRUE), + PT(55, 57, 2, 0, FALSE), + PT(60, 33, 6, 2, FALSE), + PT(28, 56, 6, 0, FALSE), + PT(21, 7, 4, 3, FALSE), + PT(39, 33, 3, 0, TRUE), + PT(24, 17, 4, 1, TRUE), + PT(48, 40, 6, 3, TRUE), + PT(50, 45, 3, 3, TRUE), + PT(44, 63, 6, 0, FALSE), + PT(29, 47, 4, 3, FALSE), + PT( 1, 17, 3, 2, FALSE), + PT(59, 15, 2, 1, FALSE), + PT(42, 23, 4, 3, TRUE), + PT( 5, 0, 3, 1, TRUE), + PT(37, 28, 6, 1, FALSE), + PT( 4, 34, 5, 2, TRUE), + PT(16, 15, 4, 2, TRUE), + PT(13, 57, 6, 0, FALSE), + PT(11, 46, 4, 3, TRUE), + PT(45, 52, 2, 2, TRUE), + PT(62, 48, 6, 3, FALSE), + PT(22, 38, 5, 1, FALSE), + PT( 5, 63, 5, 1, TRUE), + PT(32, 59, 5, 3, FALSE), + PT(59, 28, 5, 3, TRUE), + PT( 1, 24, 2, 3, FALSE), + PT(22, 61, 2, 0, FALSE), + PT(10, 31, 3, 0, FALSE), + PT(23, 15, 4, 1, FALSE), + PT( 6, 19, 2, 0, TRUE), + PT(56, 33, 2, 3, TRUE), + PT(23, 10, 6, 3, TRUE), + PT(28, 25, 6, 0, FALSE), + PT(22, 56, 6, 0, TRUE), + PT(48, 16, 6, 3, FALSE), + PT(49, 47, 4, 3, FALSE), + PT(60, 27, 4, 1, TRUE), + PT(51, 47, 3, 0, TRUE), + PT(22, 53, 4, 2, TRUE), + PT(58, 24, 3, 3, TRUE), + PT(55, 1, 3, 3, FALSE), + PT(13, 24, 2, 1, FALSE), + PT(31, 28, 3, 1, TRUE), + PT( 7, 52, 5, 2, TRUE), + PT(11, 63, 6, 1, TRUE), + PT(30, 52, 3, 2, TRUE), + PT(44, 19, 5, 2, FALSE), + PT(32, 32, 2, 1, TRUE), + PT(32, 15, 6, 0, TRUE), + PT( 8, 15, 4, 2, FALSE), + PT(24, 61, 3, 2, FALSE), + PT(54, 52, 4, 3, TRUE), + PT(51, 42, 4, 2, TRUE), + PT(45, 48, 4, 3, FALSE), + PT(61, 55, 4, 3, FALSE), + PT(37, 17, 2, 0, TRUE), + PT( 3, 5, 3, 0, FALSE), + PT(16, 4, 5, 0, TRUE), + PT( 7, 46, 6, 3, FALSE), + PT(42, 41, 2, 2, TRUE), + PT(58, 14, 6, 1, TRUE), + PT(42, 6, 5, 0, TRUE), + PT(61, 1, 5, 0, TRUE), + PT(39, 14, 2, 3, FALSE), + PT(29, 40, 3, 1, TRUE), + PT(16, 51, 5, 1, TRUE), + PT(12, 20, 3, 2, TRUE), + PT(21, 63, 4, 2, TRUE), + PT(55, 35, 3, 3, FALSE), + PT( 4, 44, 3, 2, FALSE), + PT(21, 52, 5, 1, FALSE), + PT( 9, 47, 2, 2, TRUE), + PT( 2, 63, 2, 2, FALSE), + PT(25, 44, 6, 1, TRUE), + PT(57, 50, 4, 0, FALSE), + PT(42, 24, 6, 1, FALSE), + PT(23, 35, 4, 0, TRUE), + PT(11, 45, 4, 2, TRUE), + PT(36, 58, 5, 2, TRUE), + PT(49, 63, 6, 2, FALSE), + PT(24, 25, 4, 2, FALSE), + PT(30, 21, 3, 1, FALSE), + PT(23, 51, 5, 1, TRUE), + PT(35, 9, 4, 3, FALSE), + PT(27, 13, 2, 2, TRUE), + PT(54, 38, 5, 0, FALSE), + PT(58, 28, 2, 2, FALSE), + PT(12, 62, 2, 0, FALSE), + PT(24, 6, 6, 2, TRUE), + PT(55, 38, 6, 3, FALSE), + PT(33, 38, 2, 3, TRUE), + PT(61, 28, 5, 2, FALSE), + PT(22, 37, 3, 2, TRUE), + PT(30, 11, 3, 3, FALSE), + PT(29, 13, 6, 1, FALSE), + PT( 8, 31, 3, 1, TRUE), + PT(18, 28, 2, 1, FALSE), + PT(32, 42, 5, 0, FALSE), + PT( 6, 59, 6, 2, TRUE), + PT(57, 14, 3, 3, FALSE), + PT(49, 48, 5, 0, FALSE), + PT( 2, 33, 2, 2, FALSE), + PT( 6, 30, 5, 0, TRUE), + PT(22, 9, 3, 2, FALSE), + PT(39, 50, 5, 2, TRUE), + PT(57, 3, 4, 3, TRUE), + PT(41, 9, 3, 3, FALSE), + PT(27, 17, 3, 2, FALSE), + PT(40, 58, 5, 2, FALSE), + PT( 3, 3, 3, 0, FALSE), + PT(35, 9, 5, 3, TRUE), + PT(48, 23, 4, 1, TRUE), + PT(15, 37, 6, 1, TRUE), + PT( 6, 36, 6, 3, TRUE), + PT(34, 9, 6, 1, TRUE), + PT(44, 9, 5, 1, FALSE), + PT(12, 18, 5, 1, FALSE), + PT(40, 32, 2, 0, FALSE), + PT(21, 41, 6, 1, TRUE), + PT(15, 26, 2, 1, TRUE), + PT(19, 24, 6, 3, FALSE), + PT(46, 22, 2, 1, TRUE), + PT(60, 26, 2, 2, TRUE), + PT(58, 17, 6, 1, FALSE), + PT( 2, 10, 5, 2, FALSE), + PT(25, 57, 2, 0, TRUE), + PT(49, 62, 3, 2, TRUE), + PT(50, 20, 6, 1, FALSE), + PT(18, 46, 6, 2, FALSE), + PT(62, 54, 4, 1, TRUE), + PT(55, 62, 2, 2, TRUE), + PT(21, 53, 6, 2, FALSE), + PT( 1, 58, 5, 2, FALSE), + PT(38, 37, 4, 1, FALSE), + PT( 1, 43, 6, 3, TRUE), + PT(28, 61, 6, 1, TRUE), + PT(62, 16, 3, 2, FALSE), + PT(38, 51, 3, 0, TRUE), + PT( 5, 25, 2, 3, TRUE), + PT(18, 56, 3, 2, FALSE), + PT(21, 60, 6, 1, FALSE), + PT(63, 15, 6, 3, TRUE), + PT( 2, 57, 6, 1, FALSE), + PT(19, 0, 3, 2, TRUE), + PT(29, 44, 2, 0, FALSE), + PT(57, 19, 6, 0, TRUE), + PT(15, 55, 3, 0, TRUE), + PT( 9, 13, 5, 1, FALSE), + PT(32, 47, 6, 1, FALSE), + PT(59, 52, 4, 1, FALSE), + PT(38, 20, 2, 0, FALSE), + PT(36, 61, 4, 1, FALSE), + PT(11, 49, 4, 1, TRUE), + PT(47, 45, 5, 1, FALSE), + PT(48, 4, 6, 2, TRUE), + PT(25, 32, 5, 1, FALSE), + PT(22, 54, 6, 3, TRUE), + PT(20, 40, 6, 3, TRUE), + PT(17, 11, 4, 3, TRUE), + PT(29, 6, 5, 0, TRUE), + PT(53, 22, 5, 3, FALSE), + PT(36, 46, 5, 0, TRUE), + PT(54, 20, 5, 1, FALSE), + PT(33, 12, 3, 3, TRUE), + PT(63, 57, 3, 0, TRUE), + PT(39, 16, 5, 1, FALSE), + PT(30, 18, 6, 2, FALSE), + PT(16, 36, 6, 2, FALSE), + PT(29, 19, 3, 2, TRUE), + PT(23, 22, 6, 3, TRUE), + PT(39, 27, 4, 3, TRUE), + PT( 7, 36, 4, 0, TRUE), + PT(55, 33, 2, 0, TRUE), + PT(55, 40, 4, 2, FALSE), + PT(25, 2, 3, 2, FALSE), + PT(20, 18, 3, 2, TRUE), + PT(27, 36, 5, 3, FALSE), + PT(46, 58, 2, 2, TRUE), + PT(55, 52, 4, 0, TRUE), + PT(51, 45, 5, 0, TRUE), + PT(47, 30, 6, 2, FALSE), + PT(41, 60, 2, 1, FALSE), + PT( 5, 21, 4, 0, FALSE), + PT( 5, 62, 3, 0, TRUE), + PT(24, 11, 6, 0, FALSE), + PT(47, 2, 4, 3, TRUE), + PT(20, 28, 6, 2, FALSE), + PT(18, 32, 6, 0, FALSE), + PT(43, 34, 3, 1, TRUE), + PT( 6, 49, 5, 0, FALSE), + PT(21, 45, 2, 1, FALSE), + PT( 1, 14, 2, 1, TRUE), + PT(19, 12, 5, 0, FALSE), + PT( 7, 42, 2, 2, FALSE), + PT(29, 54, 2, 2, FALSE), + PT(21, 43, 4, 3, FALSE), + PT( 3, 37, 2, 2, TRUE), + PT(62, 59, 4, 0, FALSE), + PT(53, 12, 4, 2, TRUE), + PT(43, 22, 6, 2, TRUE), + PT(30, 49, 5, 2, FALSE), + PT( 6, 3, 5, 0, TRUE), + PT(36, 7, 3, 3, TRUE), + PT(50, 47, 3, 0, TRUE), + PT(37, 33, 6, 0, TRUE), + PT(34, 38, 3, 2, TRUE), + PT( 0, 27, 3, 0, FALSE), + PT(42, 36, 6, 0, TRUE), + PT(32, 6, 5, 3, TRUE), + PT(30, 50, 4, 3, FALSE), + PT(50, 57, 2, 1, FALSE), + PT(32, 1, 3, 0, TRUE), + PT(15, 21, 2, 2, TRUE), + PT(39, 16, 5, 3, FALSE), + PT( 9, 37, 3, 0, TRUE), + PT(41, 55, 6, 0, FALSE), + PT(19, 28, 3, 2, TRUE), + PT(41, 45, 4, 3, FALSE), + PT( 2, 26, 2, 3, FALSE), + PT(29, 43, 3, 2, FALSE), + PT(24, 4, 6, 2, FALSE), + PT(40, 42, 4, 0, TRUE), + PT(21, 27, 5, 3, FALSE), + PT(22, 1, 2, 0, FALSE), + PT( 5, 9, 2, 2, FALSE), + PT(34, 3, 4, 1, FALSE), + PT( 2, 27, 6, 2, FALSE), + PT(41, 42, 4, 1, TRUE), + PT(38, 54, 2, 1, TRUE), + PT(35, 61, 3, 1, FALSE), + PT(29, 16, 4, 2, FALSE), + PT(37, 43, 6, 3, TRUE), + PT(25, 36, 4, 3, FALSE), + PT(40, 19, 2, 3, FALSE), + PT(23, 20, 3, 0, TRUE), + PT(11, 47, 4, 2, TRUE), + PT(55, 52, 6, 3, TRUE), + PT(57, 33, 3, 1, TRUE), + PT(15, 61, 5, 2, TRUE), + PT(13, 16, 4, 0, FALSE), + PT( 5, 11, 5, 2, TRUE), + PT( 1, 18, 4, 2, FALSE), + PT(24, 61, 6, 1, FALSE), + PT( 9, 33, 4, 3, FALSE), + PT(26, 14, 3, 3, TRUE), + PT(48, 6, 3, 3, TRUE), + PT(11, 60, 5, 0, TRUE), + PT( 7, 62, 4, 3, TRUE), + PT(19, 30, 3, 1, FALSE), + PT(19, 7, 4, 1, TRUE), + PT(16, 52, 3, 3, FALSE), + PT(50, 23, 4, 1, TRUE), + PT(53, 22, 6, 0, TRUE), + PT(50, 46, 3, 1, TRUE), + PT(40, 14, 4, 1, FALSE), + PT(20, 58, 4, 1, TRUE), + PT(34, 3, 5, 0, TRUE), + PT(42, 16, 4, 0, FALSE), + PT(62, 60, 4, 3, TRUE), + PT(22, 32, 2, 1, FALSE), + PT(63, 36, 6, 0, TRUE), + PT(13, 46, 6, 1, FALSE), + PT(47, 23, 5, 2, TRUE), + PT(54, 59, 2, 3, TRUE), + PT(36, 35, 3, 0, FALSE), + PT(55, 29, 2, 1, TRUE), + PT(23, 58, 3, 1, FALSE), + PT(10, 61, 3, 3, FALSE), + PT( 5, 18, 2, 3, FALSE), + PT(51, 50, 4, 2, TRUE), + PT(29, 31, 5, 0, TRUE), + PT(52, 44, 4, 3, FALSE), + PT(32, 41, 6, 2, TRUE), + PT(14, 50, 2, 3, TRUE), + PT( 1, 57, 5, 2, TRUE), + PT(39, 36, 4, 1, TRUE), + PT(40, 63, 3, 0, FALSE), + PT(57, 56, 4, 2, TRUE), + PT(35, 17, 2, 0, TRUE), + PT(25, 44, 5, 0, TRUE), + PT(48, 8, 5, 0, FALSE), + PT(37, 39, 3, 2, TRUE), + PT(23, 37, 4, 0, TRUE), + PT( 9, 61, 2, 3, FALSE), + PT(27, 15, 5, 2, FALSE), + PT(27, 18, 4, 1, FALSE), + PT(40, 62, 4, 3, FALSE), + PT(52, 16, 3, 1, TRUE), + PT( 2, 52, 2, 2, TRUE), + PT(26, 41, 3, 0, TRUE), + PT(41, 17, 6, 0, TRUE), + PT(18, 39, 2, 3, TRUE), + PT(39, 39, 5, 3, TRUE), + PT(52, 39, 4, 2, FALSE), + PT( 3, 25, 6, 3, FALSE), + PT(23, 29, 6, 1, TRUE), + PT(25, 37, 3, 1, FALSE), + PT(43, 57, 2, 1, TRUE), + PT(59, 51, 3, 2, TRUE), + PT(39, 49, 6, 2, FALSE), + PT(40, 51, 6, 3, TRUE), + PT( 9, 48, 3, 1, TRUE), + PT( 3, 58, 4, 3, TRUE), + PT(25, 17, 3, 3, TRUE), + PT(11, 26, 6, 2, FALSE), + PT(61, 42, 2, 2, TRUE), + PT( 4, 36, 6, 3, FALSE), + PT(48, 35, 6, 0, FALSE), + PT(15, 34, 3, 1, TRUE), + PT(61, 61, 4, 2, FALSE), + PT(41, 29, 2, 1, FALSE), + PT(22, 25, 5, 3, FALSE), + PT( 3, 18, 2, 3, TRUE), + PT(24, 37, 6, 1, TRUE), + PT(47, 35, 3, 1, FALSE), + PT(26, 53, 4, 3, TRUE), + PT(33, 38, 3, 0, TRUE), + PT(27, 48, 3, 0, FALSE), + PT(43, 34, 5, 2, TRUE), + PT(44, 26, 6, 2, FALSE), + PT(62, 18, 3, 0, TRUE), + PT(40, 39, 2, 2, TRUE), + PT(27, 17, 2, 1, FALSE), + PT(23, 21, 2, 0, FALSE), + PT(52, 55, 4, 2, TRUE), + PT(18, 63, 2, 2, TRUE), + PT(49, 13, 6, 3, TRUE), + PT(62, 42, 5, 2, TRUE), + PT(15, 36, 4, 2, FALSE), + PT(60, 63, 3, 3, TRUE), + PT(29, 52, 2, 3, TRUE), + PT(26, 35, 3, 3, TRUE), + PT(55, 15, 2, 0, FALSE), + PT(50, 52, 6, 2, TRUE), + PT(25, 5, 4, 1, FALSE), + PT(51, 22, 6, 2, FALSE), + PT(30, 20, 3, 3, FALSE), + PT( 8, 19, 5, 0, TRUE), + PT(58, 55, 6, 0, FALSE), + PT(29, 54, 2, 2, TRUE), + PT(41, 46, 3, 2, TRUE), + PT(50, 46, 4, 1, TRUE), + PT(53, 23, 3, 2, FALSE), + PT(54, 29, 2, 1, TRUE), + PT(35, 52, 6, 2, FALSE), + PT(36, 26, 6, 3, TRUE), + PT(47, 38, 5, 3, FALSE), + PT(30, 23, 3, 1, FALSE), + PT(31, 21, 3, 3, TRUE), + PT(43, 31, 3, 0, TRUE), + PT(10, 51, 3, 1, FALSE), + PT(53, 49, 4, 2, FALSE), + PT(45, 23, 5, 2, FALSE), + PT(12, 33, 6, 3, FALSE), + PT(44, 53, 6, 2, TRUE), + PT(27, 3, 4, 3, TRUE), + PT( 1, 13, 3, 2, TRUE), + PT(28, 14, 2, 0, TRUE), + PT(17, 43, 2, 0, FALSE), + PT(37, 59, 4, 0, FALSE), + PT(31, 23, 3, 0, TRUE), + PT(32, 8, 6, 3, FALSE), + PT(19, 56, 3, 0, TRUE), + PT(27, 43, 4, 2, FALSE), + PT(11, 31, 5, 0, TRUE), + PT(39, 21, 5, 2, FALSE), + PT(55, 57, 2, 0, FALSE), + PT(58, 21, 5, 3, FALSE), + PT(47, 17, 6, 3, FALSE), + PT(36, 4, 4, 0, FALSE), + PT(59, 42, 6, 2, TRUE), + PT(39, 53, 6, 2, FALSE), + PT(13, 27, 4, 0, FALSE), + PT(16, 34, 6, 3, TRUE), + PT(31, 56, 4, 3, TRUE), + PT(49, 15, 5, 0, FALSE), + PT(40, 37, 2, 2, TRUE), + PT( 0, 29, 4, 2, TRUE), + PT(49, 40, 5, 0, FALSE), + PT(11, 58, 3, 2, TRUE), + PT(45, 19, 3, 1, TRUE), + PT( 3, 55, 5, 3, FALSE), + PT(29, 40, 3, 0, TRUE), + PT( 8, 45, 4, 1, FALSE), + PT(39, 57, 6, 1, FALSE), + PT(63, 47, 3, 2, TRUE), + PT(51, 52, 5, 0, FALSE), + PT(24, 8, 6, 0, TRUE), + PT(35, 31, 2, 1, TRUE), + PT(13, 44, 4, 1, TRUE), + PT(58, 45, 3, 1, FALSE), + PT( 2, 37, 2, 1, TRUE), + PT(32, 54, 6, 2, FALSE), + PT(18, 43, 5, 2, TRUE), + PT(53, 53, 6, 2, FALSE), + PT(35, 32, 4, 0, TRUE), + PT(58, 25, 3, 1, TRUE), + PT(31, 43, 3, 0, TRUE), + PT(53, 14, 3, 0, TRUE), + PT(38, 36, 6, 3, TRUE), + PT(24, 8, 2, 0, FALSE), + PT(12, 22, 5, 2, TRUE), + PT(31, 52, 4, 0, TRUE), + PT( 5, 56, 3, 0, TRUE), + PT(20, 33, 4, 2, FALSE), + PT(17, 49, 2, 2, FALSE), + PT(62, 56, 5, 0, TRUE), + PT(63, 8, 4, 2, TRUE), + PT(42, 31, 4, 2, TRUE), + PT(37, 6, 5, 0, FALSE), + PT(11, 30, 2, 2, FALSE), + PT(26, 56, 4, 1, FALSE), + PT(36, 24, 5, 0, TRUE), + PT(26, 17, 4, 0, FALSE), + PT(59, 58, 3, 3, FALSE), + PT(28, 38, 3, 1, FALSE), + PT( 5, 50, 3, 0, TRUE), + PT(57, 42, 6, 0, TRUE), + PT( 9, 7, 4, 2, TRUE), + PT( 5, 62, 2, 3, FALSE), + PT(52, 38, 2, 2, FALSE), + PT(27, 50, 4, 3, FALSE), + PT( 5, 8, 6, 3, TRUE), + PT(15, 3, 4, 0, FALSE), + PT(42, 57, 6, 0, TRUE), + PT( 8, 1, 3, 3, FALSE), + PT(29, 35, 6, 0, TRUE), + PT(40, 27, 5, 0, FALSE), + PT(30, 55, 2, 2, FALSE), + PT(19, 14, 5, 0, FALSE), + PT(42, 59, 6, 3, TRUE), + PT(47, 28, 5, 0, FALSE), + PT(48, 48, 3, 1, FALSE), + PT(54, 31, 2, 3, FALSE), + PT(62, 13, 2, 2, TRUE), + PT(46, 22, 3, 0, FALSE), + PT(21, 55, 4, 0, FALSE), + PT(42, 51, 6, 0, FALSE), + PT(43, 14, 4, 2, TRUE), + PT(24, 32, 2, 3, FALSE), + PT( 2, 25, 4, 2, TRUE), + PT(10, 46, 6, 0, FALSE), + PT(22, 3, 2, 0, TRUE), + PT( 4, 39, 4, 2, TRUE), + PT(27, 28, 4, 0, TRUE), + PT(41, 4, 4, 3, TRUE), + PT(61, 32, 3, 3, FALSE), + PT(40, 51, 6, 0, TRUE), + PT(30, 57, 2, 0, FALSE), + PT(49, 41, 3, 3, FALSE), + PT( 6, 37, 5, 0, FALSE), + PT(25, 59, 2, 1, FALSE), + PT(11, 27, 3, 2, FALSE), + PT(62, 55, 4, 0, FALSE), + PT(10, 55, 6, 1, TRUE), + PT( 2, 44, 4, 2, TRUE), + PT(21, 24, 2, 2, FALSE), + PT(59, 32, 3, 2, FALSE), + PT(34, 59, 3, 2, FALSE), + PT(36, 52, 6, 2, TRUE), + PT(15, 47, 6, 0, TRUE), + PT(59, 23, 6, 2, TRUE), + PT(48, 57, 6, 3, TRUE), + PT(13, 21, 2, 0, TRUE), + PT(16, 3, 3, 3, FALSE), + PT(26, 57, 6, 1, TRUE), + PT(47, 46, 5, 0, FALSE), + PT(28, 40, 6, 3, FALSE), + PT(40, 24, 3, 3, TRUE), + PT(21, 1, 6, 0, FALSE), + PT(62, 50, 5, 0, FALSE), + PT(52, 47, 4, 1, TRUE), + PT( 7, 12, 6, 3, FALSE), + PT(40, 44, 6, 2, FALSE), + PT(42, 12, 3, 3, TRUE), + PT(63, 32, 2, 1, TRUE), + PT(43, 23, 4, 3, TRUE), + PT(40, 41, 5, 1, FALSE), + PT(60, 19, 6, 3, FALSE), + PT(38, 45, 5, 1, FALSE), + PT(10, 6, 3, 3, FALSE), + PT(32, 4, 3, 1, FALSE), + PT( 2, 7, 6, 2, TRUE), + PT(14, 24, 6, 0, FALSE), + PT( 0, 52, 6, 2, FALSE), + PT(47, 20, 6, 3, TRUE), + PT(33, 48, 3, 3, TRUE), + PT(21, 55, 3, 1, TRUE), + PT(58, 11, 6, 1, FALSE), + PT(34, 34, 4, 0, TRUE), + PT(27, 53, 4, 1, TRUE), + PT(13, 3, 3, 2, FALSE), + PT(35, 59, 2, 1, TRUE), + PT(14, 29, 3, 3, TRUE), + PT(29, 63, 5, 3, FALSE), + PT(57, 39, 5, 3, FALSE), + PT(15, 56, 4, 0, FALSE), + PT(49, 60, 6, 2, TRUE), + PT(11, 15, 5, 3, FALSE), + PT( 6, 6, 5, 0, FALSE), + PT(37, 57, 4, 1, TRUE), + PT(10, 50, 2, 2, TRUE), + PT(15, 29, 4, 2, TRUE), + PT(12, 13, 6, 2, FALSE), + PT(18, 46, 4, 0, TRUE), + PT(54, 24, 3, 3, TRUE), + PT(31, 52, 3, 1, TRUE), + PT( 5, 58, 6, 3, FALSE), + PT(43, 1, 2, 3, TRUE), + PT(14, 22, 5, 1, TRUE), + PT(14, 11, 4, 3, FALSE), + PT(13, 45, 2, 0, FALSE), + PT(33, 17, 4, 3, TRUE), + PT(61, 19, 6, 1, FALSE), + PT(21, 37, 5, 1, FALSE), + PT(27, 45, 6, 2, TRUE), + PT(44, 43, 4, 3, FALSE), + PT(38, 31, 4, 0, FALSE), + PT(34, 43, 2, 1, FALSE), + PT(63, 61, 4, 3, TRUE), + PT(48, 10, 6, 3, FALSE), + PT(53, 31, 2, 3, TRUE), + PT(33, 8, 5, 0, TRUE), + PT(29, 32, 6, 1, TRUE), + PT(52, 17, 2, 3, FALSE), + PT( 5, 56, 5, 2, TRUE), +}; + +#undef PT diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c index a811901a9..6ec280fd0 100644 --- a/src/field_control_avatar.c +++ b/src/field_control_avatar.c @@ -67,7 +67,7 @@ static bool8 TryStartCoordEventScript(struct MapPosition *); static bool8 TryStartWarpEventScript(struct MapPosition *, u16); static bool8 TryStartMiscWalkingScripts(u16); static bool8 TryStartStepCountScript(u16); -static void UpdateHappinessStepCounter(void); +static void UpdateFriendshipStepCounter(void); static bool8 UpdatePoisonStepCounter(void); void FieldClearPlayerInput(struct FieldInput *input) @@ -542,7 +542,7 @@ static bool8 TryStartStepCountScript(u16 metatileBehavior) } IncrementRematchStepCounter(); - UpdateHappinessStepCounter(); + UpdateFriendshipStepCounter(); UpdateFarawayIslandStepCounter(); if (!(gPlayerAvatar.flags & PLAYER_AVATAR_FLAG_FORCED_MOVE) && !MetatileBehavior_IsForcedMovementTile(metatileBehavior)) @@ -607,14 +607,15 @@ static bool8 TryStartStepCountScript(u16 metatileBehavior) return FALSE; } -void Unref_ClearHappinessStepCounter(void) +// Unused +static void ClearFriendshipStepCounter(void) { - VarSet(VAR_HAPPINESS_STEP_COUNTER, 0); + VarSet(VAR_FRIENDSHIP_STEP_COUNTER, 0); } -static void UpdateHappinessStepCounter(void) +static void UpdateFriendshipStepCounter(void) { - u16 *ptr = GetVarPointer(VAR_HAPPINESS_STEP_COUNTER); + u16 *ptr = GetVarPointer(VAR_FRIENDSHIP_STEP_COUNTER); int i; (*ptr)++; diff --git a/src/field_door.c b/src/field_door.c index 4dcb07cca..8aeb1d491 100644 --- a/src/field_door.c +++ b/src/field_door.c @@ -357,40 +357,42 @@ static void DrawDoor(const struct DoorGraphics *gfx, const struct DoorAnimFrame } } -enum +#define tFramesHi data[0] +#define tFramesLo data[1] +#define tGfxHi data[2] +#define tGfxLo data[3] +#define tFrameId data[4] +#define tCounter data[5] +#define tX data[6] +#define tY data[7] + +// Draws a single frame of the door animation, or skips drawing to wait between frames. +// Returns FALSE when the final frame has been reached +static bool32 AnimateDoorFrame(struct DoorGraphics *gfx, struct DoorAnimFrame *frames, s16 *data) { - TD_FRAMELIST = 0, - TD_GFX = 2, - TD_FRAME = 4, - TD_COUNTER, - TD_X, - TD_Y -}; + if (tCounter == 0) + DrawDoor(gfx, &frames[tFrameId], tX, tY); -static bool32 sub_808A5F0(struct DoorGraphics *gfx, struct DoorAnimFrame *frames, s16 *taskData) -{ - if (taskData[TD_COUNTER] == 0) - DrawDoor(gfx, &frames[taskData[TD_FRAME]], taskData[TD_X], taskData[TD_Y]); - if (taskData[TD_COUNTER] == frames[taskData[TD_FRAME]].time) + if (tCounter == frames[tFrameId].time) { - taskData[TD_COUNTER] = 0; - taskData[TD_FRAME]++; - if (frames[taskData[TD_FRAME]].time == 0) + tCounter = 0; + tFrameId++; + if (frames[tFrameId].time == 0) return FALSE; else return TRUE; } - taskData[TD_COUNTER]++; + tCounter++; return TRUE; } static void Task_AnimateDoor(u8 taskId) { - u16 *taskData = gTasks[taskId].data; - struct DoorAnimFrame *frames = (struct DoorAnimFrame *)(taskData[TD_FRAMELIST] << 16 | taskData[TD_FRAMELIST + 1]); - struct DoorGraphics *gfx = (struct DoorGraphics *)(taskData[TD_GFX] << 16 | taskData[TD_GFX + 1]); + u16 *data = gTasks[taskId].data; + struct DoorAnimFrame *frames = (struct DoorAnimFrame *)(tFramesHi << 16 | tFramesLo); + struct DoorGraphics *gfx = (struct DoorGraphics *)(tGfxHi << 16 | tGfxLo); - if (sub_808A5F0(gfx, frames, taskData) == FALSE) + if (AnimateDoorFrame(gfx, frames, data) == FALSE) DestroyTask(taskId); } @@ -419,16 +421,16 @@ static s8 StartDoorAnimationTask(const struct DoorGraphics *gfx, const struct Do else { u8 taskId = CreateTask(Task_AnimateDoor, 0x50); - s16 *taskData = gTasks[taskId].data; + s16 *data = gTasks[taskId].data; - taskData[TD_X] = x; - taskData[TD_Y] = y; + tX = x; + tY = y; - taskData[TD_FRAMELIST + 1] = (u32)frames; - taskData[TD_FRAMELIST] = (u32)frames >> 16; + tFramesLo = (u32)frames; + tFramesHi = (u32)frames >> 16; - taskData[TD_GFX + 1] = (u32)gfx; - taskData[TD_GFX] = (u32)gfx >> 16; + tGfxLo = (u32)gfx; + tGfxHi = (u32)gfx >> 16; return taskId; } diff --git a/src/field_effect.c b/src/field_effect.c index 162a530ca..445827390 100644 --- a/src/field_effect.c +++ b/src/field_effect.c @@ -480,13 +480,13 @@ static const struct Subsprite sSubsprites_HofMonitorBig[] = static const struct SubspriteTable sSubspriteTable_HofMonitorBig = subsprite_table(sSubsprites_HofMonitorBig); -const union AnimCmd gSpriteAnim_855C2CC[] = +const union AnimCmd sAnim_Static[] = { ANIMCMD_FRAME(.imageValue = 0, .duration = 1), ANIMCMD_JUMP(0) }; -const union AnimCmd gSpriteAnim_855C2D4[] = +const union AnimCmd sAnim_Flicker[] = { ANIMCMD_FRAME(.imageValue = 0, .duration = 16), ANIMCMD_FRAME(.imageValue = 1, .duration = 16), @@ -499,15 +499,16 @@ const union AnimCmd gSpriteAnim_855C2D4[] = ANIMCMD_END }; -const union AnimCmd *const gSpriteAnimTable_855C2F8[] = +// Flicker on and off, for the Pokéballs / monitors during the PokéCenter heal effect +const union AnimCmd *const sAnims_Flicker[] = { - gSpriteAnim_855C2CC, - gSpriteAnim_855C2D4 + sAnim_Static, + sAnim_Flicker }; -static const union AnimCmd *const sAnimTable_HofMonitor[] = +static const union AnimCmd *const sAnims_HofMonitor[] = { - gSpriteAnim_855C2CC + sAnim_Static }; static const struct SpriteTemplate sSpriteTemplate_PokeballGlow = @@ -515,7 +516,7 @@ static const struct SpriteTemplate sSpriteTemplate_PokeballGlow = .tileTag = 0xFFFF, .paletteTag = FLDEFF_PAL_TAG_POKEBALL_GLOW, .oam = &sOam_8x8, - .anims = gSpriteAnimTable_855C2F8, + .anims = sAnims_Flicker, .images = sPicTable_PokeballGlow, .affineAnims = gDummySpriteAffineAnimTable, .callback = SpriteCB_PokeballGlow @@ -526,7 +527,7 @@ static const struct SpriteTemplate sSpriteTemplate_PokecenterMonitor = .tileTag = 0xFFFF, .paletteTag = FLDEFF_PAL_TAG_GENERAL_0, .oam = &sOam_16x16, - .anims = gSpriteAnimTable_855C2F8, + .anims = sAnims_Flicker, .images = sPicTable_PokecenterMonitor, .affineAnims = gDummySpriteAffineAnimTable, .callback = SpriteCB_PokecenterMonitor @@ -537,7 +538,7 @@ static const struct SpriteTemplate sSpriteTemplate_HofMonitorBig = .tileTag = 0xFFFF, .paletteTag = FLDEFF_PAL_TAG_HOF_MONITOR, .oam = &sOam_16x16, - .anims = sAnimTable_HofMonitor, + .anims = sAnims_HofMonitor, .images = sPicTable_HofMonitorBig, .affineAnims = gDummySpriteAffineAnimTable, .callback = SpriteCB_HallOfFameMonitor @@ -548,7 +549,7 @@ static const struct SpriteTemplate sSpriteTemplate_HofMonitorSmall = .tileTag = 0xFFFF, .paletteTag = FLDEFF_PAL_TAG_HOF_MONITOR, .oam = &sOam_32x16, - .anims = sAnimTable_HofMonitor, + .anims = sAnims_HofMonitor, .images = sPicTable_HofMonitorSmall, .affineAnims = gDummySpriteAffineAnimTable, .callback = SpriteCB_HallOfFameMonitor @@ -3853,16 +3854,8 @@ static void Task_MoveDeoxysRock(u8 taskId) case 0: data[4] = sprite->pos1.x << 4; data[5] = sprite->pos1.y << 4; - - // UB: Possible divide by zero - #ifdef UBFIX - #define DIVISOR (data[8] ? data[8] : 1); - #else - #define DIVISOR (data[8]) - #endif - - data[6] = (data[2] * 16 - data[4]) / DIVISOR; - data[7] = (data[3] * 16 - data[5]) / DIVISOR; + data[6] = SAFE_DIV(data[2] * 16 - data[4], data[8]); + data[7] = SAFE_DIV(data[3] * 16 - data[5], data[8]); data[0]++; case 1: if (data[8] != 0) diff --git a/src/fldeff_flash.c b/src/fldeff_flash.c index b2ddf3180..9c166d008 100644 --- a/src/fldeff_flash.c +++ b/src/fldeff_flash.c @@ -16,7 +16,6 @@ #include "constants/songs.h" #include "constants/map_types.h" -// structures struct FlashStruct { u8 fromType; @@ -26,7 +25,6 @@ struct FlashStruct void (*func)(void); }; -// static functions static void FieldCallback_Flash(void); static void FldEff_UseFlash(void); static bool8 TryDoMapTransition(void); @@ -42,7 +40,6 @@ static void Task_EnterCaveTransition2(u8 taskId); static void Task_EnterCaveTransition3(u8 taskId); static void Task_EnterCaveTransition4(u8 taskId); -// rodata static const struct FlashStruct sTransitionTypes[] = { {MAP_TYPE_TOWN, MAP_TYPE_UNDERGROUND, TRUE, FALSE, DoEnterCaveTransition}, @@ -64,15 +61,14 @@ static const struct FlashStruct sTransitionTypes[] = {}, }; -static const u16 gCaveTransitionPalette_White[] = INCBIN_U16("graphics/misc/cave_transition_white.gbapal"); -static const u16 gCaveTransitionPalette_Black[] = INCBIN_U16("graphics/misc/cave_transition_black.gbapal"); +static const u16 sCaveTransitionPalette_White[] = INCBIN_U16("graphics/misc/cave_transition_white.gbapal"); +static const u16 sCaveTransitionPalette_Black[] = INCBIN_U16("graphics/misc/cave_transition_black.gbapal"); -static const u16 gUnknown_085B2890[] = INCBIN_U16("graphics/misc/85B2890.gbapal"); -static const u16 gUnknown_085B28A0[] = INCBIN_U16("graphics/misc/85B28A0.gbapal"); -static const u32 gCaveTransitionTilemap[] = INCBIN_U32("graphics/misc/cave_transition_map.bin.lz"); -static const u32 gCaveTransitionTiles[] = INCBIN_U32("graphics/misc/cave_transition.4bpp.lz"); +static const u16 sCaveTransitionPalette_Enter[] = INCBIN_U16("graphics/misc/cave_transition_enter.gbapal"); +static const u16 sCaveTransitionPalette_Exit[] = INCBIN_U16("graphics/misc/cave_transition_exit.gbapal"); +static const u32 sCaveTransitionTilemap[] = INCBIN_U32("graphics/misc/cave_transition_map.bin.lz"); +static const u32 sCaveTransitionTiles[] = INCBIN_U32("graphics/misc/cave_transition.4bpp.lz"); -// text bool8 SetUpFieldMove_Flash(void) { // In Ruby and Sapphire, Registeel's tomb is opened by using Fly. In Emerald, @@ -220,10 +216,10 @@ static void Task_ExitCaveTransition1(u8 taskId) static void Task_ExitCaveTransition2(u8 taskId) { SetGpuReg(REG_OFFSET_DISPCNT, 0); - LZ77UnCompVram(gCaveTransitionTiles, (void *)(VRAM + 0xC000)); - LZ77UnCompVram(gCaveTransitionTilemap, (void *)(VRAM + 0xF800)); - LoadPalette(gCaveTransitionPalette_White, 0xE0, 0x20); - LoadPalette(gUnknown_085B28A0, 0xE0, 0x10); + LZ77UnCompVram(sCaveTransitionTiles, (void *)(VRAM + 0xC000)); + LZ77UnCompVram(sCaveTransitionTilemap, (void *)(VRAM + 0xF800)); + LoadPalette(sCaveTransitionPalette_White, 0xE0, 0x20); + LoadPalette(sCaveTransitionPalette_Exit, 0xE0, 0x10); SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG0 | BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_BG1 @@ -274,11 +270,11 @@ static void Task_ExitCaveTransition4(u8 taskId) if (count < 8) { gTasks[taskId].data[2]++; - LoadPalette(&gUnknown_085B28A0[count], 0xE0, 16 - 2 * count); + LoadPalette(&sCaveTransitionPalette_Exit[count], 0xE0, 16 - 2 * count); } else { - LoadPalette(gCaveTransitionPalette_White, 0, 0x20); + LoadPalette(sCaveTransitionPalette_White, 0, 0x20); gTasks[taskId].func = Task_ExitCaveTransition5; gTasks[taskId].data[2] = 8; } @@ -305,8 +301,8 @@ static void Task_EnterCaveTransition1(u8 taskId) static void Task_EnterCaveTransition2(u8 taskId) { SetGpuReg(REG_OFFSET_DISPCNT, 0); - LZ77UnCompVram(gCaveTransitionTiles, (void *)(VRAM + 0xC000)); - LZ77UnCompVram(gCaveTransitionTilemap, (void *)(VRAM + 0xF800)); + LZ77UnCompVram(sCaveTransitionTiles, (void *)(VRAM + 0xC000)); + LZ77UnCompVram(sCaveTransitionTilemap, (void *)(VRAM + 0xF800)); SetGpuReg(REG_OFFSET_BLDCNT, 0); SetGpuReg(REG_OFFSET_BLDALPHA, 0); SetGpuReg(REG_OFFSET_BLDY, 0); @@ -319,8 +315,8 @@ static void Task_EnterCaveTransition2(u8 taskId) | DISPCNT_OBJ_1D_MAP | DISPCNT_BG0_ON | DISPCNT_OBJ_ON); - LoadPalette(gCaveTransitionPalette_White, 0xE0, 0x20); - LoadPalette(gCaveTransitionPalette_Black, 0, 0x20); + LoadPalette(sCaveTransitionPalette_White, 0xE0, 0x20); + LoadPalette(sCaveTransitionPalette_Black, 0, 0x20); gTasks[taskId].func = Task_EnterCaveTransition3; gTasks[taskId].data[0] = 16; gTasks[taskId].data[1] = 0; @@ -335,7 +331,7 @@ static void Task_EnterCaveTransition3(u8 taskId) { gTasks[taskId].data[2]++; gTasks[taskId].data[2]++; - LoadPalette(&gUnknown_085B2890[15 - count], 0xE0, 2 * (count + 1)); + LoadPalette(&sCaveTransitionPalette_Enter[15 - count], 0xE0, 2 * (count + 1)); } else { @@ -363,7 +359,7 @@ static void Task_EnterCaveTransition4(u8 taskId) } else { - LoadPalette(gCaveTransitionPalette_Black, 0, 0x20); + LoadPalette(sCaveTransitionPalette_Black, 0, 0x20); SetMainCallback2(gMain.savedCallback); } } diff --git a/src/frontier_util.c b/src/frontier_util.c index 095c750a6..491aef936 100644 --- a/src/frontier_util.c +++ b/src/frontier_util.c @@ -2383,13 +2383,13 @@ void ClearRankingHallRecords(void) { s32 i, j, k; - // BUG: Passing 0 as a pointer instead of a pointer holding a value of 0. - #ifdef BUGFIX - u8 zero = 0; - #define ZERO (&zero) - #else + // UB: Passing 0 as a pointer instead of a pointer holding a value of 0. +#ifdef UBFIX + u8 emptyId[TRAINER_ID_LENGTH] = {0}; + #define ZERO emptyId +#else #define ZERO 0 - #endif +#endif for (i = 0; i < HALL_FACILITIES_COUNT; i++) { diff --git a/src/image_processing_effects.c b/src/image_processing_effects.c index 224de6fe1..4a56871a4 100644 --- a/src/image_processing_effects.c +++ b/src/image_processing_effects.c @@ -51,7 +51,9 @@ static u16 QuantizePixel_GrayscaleSmall(u16*); static u16 QuantizePixel_Grayscale(u16*); static u16 QuantizePixel_PrimaryColors(u16*); -extern const u8 gPointillismPoints[][3]; +#define MAX_DIMENSION 64 + +#include "data/pointillism_points.h" void ApplyImageProcessingEffects(struct ImageProcessingContext *context) { @@ -169,7 +171,7 @@ static void ApplyImageEffect_RedChannelGrayscaleHighlight(u8 highlight) static void ApplyImageEffect_Pointillism(void) { u32 i; - for (i = 0; i < 3200; i++) + for (i = 0; i < ARRAY_COUNT(sPointillismPoints); i++) AddPointillismPoints(i); } @@ -307,9 +309,9 @@ static void ApplyImageEffect_Shimmer(void) // First, invert all of the colors. pixel = gCanvasPixels; - for (i = 0; i < 64; i++) + for (i = 0; i < MAX_DIMENSION; i++) { - for (j = 0; j < 64; j++, pixel++) + for (j = 0; j < MAX_DIMENSION; j++, pixel++) { if (!IS_ALPHA(*pixel)) *pixel = QuantizePixel_Invert(pixel); @@ -317,16 +319,16 @@ static void ApplyImageEffect_Shimmer(void) } // Blur the pixels twice. - for (j = 0; j < 64; j++) + for (j = 0; j < MAX_DIMENSION; j++) { pixel = &gCanvasPixels[j]; prevPixel = *pixel; *pixel = RGB_ALPHA; - for (i = 1, pixel += 64; i < 63; i++, pixel += 64) + for (i = 1, pixel += MAX_DIMENSION; i < MAX_DIMENSION - 1; i++, pixel += MAX_DIMENSION) { if (!IS_ALPHA(*pixel)) { - *pixel = QuantizePixel_BlurHard(&prevPixel, pixel, pixel + 64); + *pixel = QuantizePixel_BlurHard(&prevPixel, pixel, pixel + MAX_DIMENSION); prevPixel = *pixel; } } @@ -335,11 +337,11 @@ static void ApplyImageEffect_Shimmer(void) pixel = &gCanvasPixels[j]; prevPixel = *pixel; *pixel = RGB_ALPHA; - for (i = 1, pixel += 64; i < 63; i++, pixel += 64) + for (i = 1, pixel += MAX_DIMENSION; i < MAX_DIMENSION - 1; i++, pixel += MAX_DIMENSION) { if (!IS_ALPHA(*pixel)) { - *pixel = QuantizePixel_BlurHard(&prevPixel, pixel, pixel + 64); + *pixel = QuantizePixel_BlurHard(&prevPixel, pixel, pixel + MAX_DIMENSION); prevPixel = *pixel; } } @@ -351,9 +353,9 @@ static void ApplyImageEffect_Shimmer(void) // The above blur causes the outline areas to darken, which makes // this inversion give the effect of light outlines. pixel = gCanvasPixels; - for (i = 0; i < 64; i++) + for (i = 0; i < MAX_DIMENSION; i++) { - for (j = 0; j < 64; j++, pixel++) + for (j = 0; j < MAX_DIMENSION; j++, pixel++) { if (!IS_ALPHA(*pixel)) *pixel = QuantizePixel_Invert(pixel); @@ -408,19 +410,19 @@ struct PointillismPoint u16 delta; }; -static void AddPointillismPoints(u16 arg0) +static void AddPointillismPoints(u16 point) { u8 i; bool8 offsetDownLeft; u8 colorType; struct PointillismPoint points[6]; - points[0].column = gPointillismPoints[arg0][0]; - points[0].row = gPointillismPoints[arg0][1]; - points[0].delta = (gPointillismPoints[arg0][2] >> 3) & 7; + points[0].column = sPointillismPoints[point][0]; + points[0].row = sPointillismPoints[point][1]; + points[0].delta = GET_POINT_DELTA(sPointillismPoints[point][2]); - colorType = (gPointillismPoints[arg0][2] >> 1) & 3; - offsetDownLeft = gPointillismPoints[arg0][2] & 1; + colorType = GET_POINT_COLOR_TYPE(sPointillismPoints[point][2]); + offsetDownLeft = GET_POINT_OFFSET_DL(sPointillismPoints[point][2]); for (i = 1; i < points[0].delta; i++) { if (!offsetDownLeft) @@ -434,7 +436,7 @@ static void AddPointillismPoints(u16 arg0) points[i].row = points[0].row - 1; } - if (points[i].column > 63 || points[i].row > 63) + if (points[i].column >= MAX_DIMENSION || points[i].row >= MAX_DIMENSION) { points[0].delta = i - 1; break; @@ -445,7 +447,7 @@ static void AddPointillismPoints(u16 arg0) for (i = 0; i < points[0].delta; i++) { - u16 *pixel = &gCanvasPixels[points[i].row * 64] + points[i].column; + u16 *pixel = &gCanvasPixels[points[i].row * MAX_DIMENSION] + points[i].column; if (!IS_ALPHA(*pixel)) { @@ -457,7 +459,7 @@ static void AddPointillismPoints(u16 arg0) { case 0: case 1: - switch (((gPointillismPoints[arg0][2] >> 3) & 7) % 3) + switch (GET_POINT_DELTA(sPointillismPoints[point][2]) % 3) { case 0: if (red >= points[i].delta) diff --git a/src/intro.c b/src/intro.c index 376176fe4..324ec6d46 100644 --- a/src/intro.c +++ b/src/intro.c @@ -1576,7 +1576,7 @@ static void Task_IntroSpinAndZoomPokeball(u8 taskId) gTasks[taskId].func = Task_IntroWaitToSetupPart3LegendsFight; } - PanFadeAndZoomScreen(0x78, 0x50, 0x10000 / gTasks[taskId].data[1], gTasks[taskId].data[0]); + PanFadeAndZoomScreen(0x78, 0x50, SAFE_DIV(0x10000, gTasks[taskId].data[1]), gTasks[taskId].data[0]); if (gIntroFrameCounter == 28) BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_WHITEALPHA); diff --git a/src/link.c b/src/link.c index 9f0ac6654..6dc5a09f3 100644 --- a/src/link.c +++ b/src/link.c @@ -41,8 +41,8 @@ struct LinkTestBGInfo { u32 screenBaseBlock; u32 paletteNum; - u32 dummy_8; - u32 dummy_C; + u32 baseChar; + u32 unused; }; static struct BlockTransfer sBlockSend; @@ -97,28 +97,26 @@ struct Link gLink; u8 gLastRecvQueueCount; u16 gLinkSavedIme; -EWRAM_DATA u8 gLinkTestDebugValuesEnabled = 0; -EWRAM_DATA u8 gUnknown_020223BD = 0; +static EWRAM_DATA u8 sLinkTestDebugValuesEnabled = 0; +static EWRAM_DATA u8 sDummyFlag = FALSE; EWRAM_DATA u32 gBerryBlenderKeySendAttempts = 0; EWRAM_DATA u16 gBlockRecvBuffer[MAX_RFU_PLAYERS][BLOCK_BUFFER_SIZE / 2] = {}; EWRAM_DATA u8 gBlockSendBuffer[BLOCK_BUFFER_SIZE] = {}; -EWRAM_DATA bool8 gLinkOpen = FALSE; +static EWRAM_DATA bool8 sLinkOpen = FALSE; EWRAM_DATA u16 gLinkType = 0; -EWRAM_DATA u16 gLinkTimeOutCounter = 0; +static EWRAM_DATA u16 sTimeOutCounter = 0; EWRAM_DATA struct LinkPlayer gLocalLinkPlayer = {}; EWRAM_DATA struct LinkPlayer gLinkPlayers[MAX_RFU_PLAYERS] = {}; -EWRAM_DATA struct LinkPlayer gSavedLinkPlayers[MAX_RFU_PLAYERS] = {}; +static EWRAM_DATA struct LinkPlayer sSavedLinkPlayers[MAX_RFU_PLAYERS] = {}; EWRAM_DATA struct { u32 status; u8 lastRecvQueueCount; u8 lastSendQueueCount; - u8 unk_06; + bool8 disconnected; } sLinkErrorBuffer = {}; static EWRAM_DATA u16 sReadyCloseLinkAttempts = 0; // never read static EWRAM_DATA void *sLinkErrorBgTilemapBuffer = NULL; -// Static ROM declarations - static void InitLocalLinkPlayer(void); static void VBlankCB_LinkError(void); static void CB2_LinkTest(void); @@ -131,7 +129,7 @@ static void LinkCB_BlockSend(void); static void LinkCB_BlockSendEnd(void); static void SetBlockReceivedFlag(u8 who); static u16 LinkTestCalcBlockChecksum(const u16 *src, u16 size); -static void LinkTest_prnthex(u32 pos, u8 a0, u8 a1, u8 a2); +static void LinkTest_PrintHex(u32 pos, u8 a0, u8 a1, u8 a2); static void LinkCB_RequestPlayerDataExchange(void); static void Task_PrintTestData(u8 taskId); @@ -160,8 +158,6 @@ static void DoSend(void); static void StopTimer(void); static void SendRecvDone(void); -// .rodata - static const u16 sWirelessLinkDisplayPal[] = INCBIN_U16("graphics/interface/wireless_link_display.gbapal"); static const u32 sWirelessLinkDisplayGfx[] = INCBIN_U32("graphics/interface/wireless_link_display.4bpp.lz"); static const u32 sWirelessLinkDisplayTilemap[] = INCBIN_U32("graphics/interface/wireless_link_display.bin.lz"); @@ -226,15 +222,13 @@ static const struct WindowTemplate sLinkErrorWindowTemplates[] = { }; static const u8 sTextColors[] = { TEXT_COLOR_TRANSPARENT, TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GREY }; -static const u8 sUnused_082ED224[] = {0x00, 0xFF, 0xFE, 0xFF, 0x00}; - -// .text +static const u8 sUnusedData[] = {0x00, 0xFF, 0xFE, 0xFF, 0x00}; bool8 IsWirelessAdapterConnected(void) { SetWirelessCommType1(); InitRFUAPI(); - if (rfu_LMAN_REQBN_softReset_and_checkID() == 0x8001) + if (rfu_LMAN_REQBN_softReset_and_checkID() == RFU_ID) { rfu_REQ_stopMode(); rfu_waitREQComplete(); @@ -251,13 +245,13 @@ void Task_DestroySelf(u8 taskId) DestroyTask(taskId); } -static void InitLinkTestBG(u8 paletteNum, u8 bgNum, u8 screenBaseBlock, u8 charBaseBlock, u16 a4) +static void InitLinkTestBG(u8 paletteNum, u8 bgNum, u8 screenBaseBlock, u8 charBaseBlock, u16 baseChar) { LoadPalette(sLinkTestDigitsPal, paletteNum * 16, 0x20); - DmaCopy16(3, sLinkTestDigitsGfx, (u16 *)BG_CHAR_ADDR(charBaseBlock) + (16 * a4), sizeof sLinkTestDigitsGfx); + DmaCopy16(3, sLinkTestDigitsGfx, (u16 *)BG_CHAR_ADDR(charBaseBlock) + (16 * baseChar), sizeof sLinkTestDigitsGfx); gLinkTestBGInfo.screenBaseBlock = screenBaseBlock; gLinkTestBGInfo.paletteNum = paletteNum; - gLinkTestBGInfo.dummy_8 = a4; + gLinkTestBGInfo.baseChar = baseChar; switch (bgNum) { case 1: @@ -274,17 +268,19 @@ static void InitLinkTestBG(u8 paletteNum, u8 bgNum, u8 screenBaseBlock, u8 charB SetGpuReg(REG_OFFSET_BG0VOFS + bgNum * 4, 0); } -void sub_80094EC(u8 paletteNum, u8 bgNum, u8 screenBaseBlock, u8 charBaseBlock) +// Unused +static void LoadLinkTestBgGfx(u8 paletteNum, u8 bgNum, u8 screenBaseBlock, u8 charBaseBlock) { LoadPalette(sLinkTestDigitsPal, paletteNum * 16, 0x20); DmaCopy16(3, sLinkTestDigitsGfx, (u16 *)BG_CHAR_ADDR(charBaseBlock), sizeof sLinkTestDigitsGfx); gLinkTestBGInfo.screenBaseBlock = screenBaseBlock; gLinkTestBGInfo.paletteNum = paletteNum; - gLinkTestBGInfo.dummy_8 = 0; + gLinkTestBGInfo.baseChar = 0; SetGpuReg(sBGControlRegs[bgNum], BGCNT_SCREENBASE(screenBaseBlock) | BGCNT_CHARBASE(charBaseBlock)); } -void LinkTestScreen(void) +// Unused +static void LinkTestScreen(void) { int i; @@ -346,10 +342,9 @@ static void InitLink(void) int i; for (i = 0; i < CMD_LENGTH; i++) - { - gSendCmd[i] = 0xEfff; - } - gLinkOpen = TRUE; + gSendCmd[i] = LINKCMD_NONE; + + sLinkOpen = TRUE; EnableSerial(); } @@ -402,7 +397,7 @@ void CloseLink(void) { LinkRfu_Shutdown(); } - gLinkOpen = FALSE; + sLinkOpen = FALSE; DisableSerial(); } @@ -413,14 +408,14 @@ static void TestBlockTransfer(u8 nothing, u8 is, u8 used) if (sLinkTestLastBlockSendPos != sBlockSend.pos) { - LinkTest_prnthex(sBlockSend.pos, 2, 3, 2); + LinkTest_PrintHex(sBlockSend.pos, 2, 3, 2); sLinkTestLastBlockSendPos = sBlockSend.pos; } for (i = 0; i < MAX_LINK_PLAYERS; i++) { if (sLinkTestLastBlockRecvPos[i] != sBlockRecv[i].pos) { - LinkTest_prnthex(sBlockRecv[i].pos, 2, i + 4, 2); + LinkTest_PrintHex(sBlockRecv[i].pos, 2, i + 4, 2); sLinkTestLastBlockRecvPos[i] = sBlockRecv[i].pos; } } @@ -435,8 +430,8 @@ static void TestBlockTransfer(u8 nothing, u8 is, u8 used) ResetBlockReceivedFlag(i); if (gLinkTestBlockChecksums[i] != 0x0342) { - gLinkTestDebugValuesEnabled = FALSE; - gUnknown_020223BD = FALSE; + sLinkTestDebugValuesEnabled = FALSE; + sDummyFlag = FALSE; } } } @@ -469,7 +464,7 @@ static void LinkTestProcessKeyInput(void) { SetCloseLinkCallback(); } - if (gLinkTestDebugValuesEnabled) + if (sLinkTestDebugValuesEnabled) { SetLinkDebugValues(gMain.vblankCounter2, gLinkCallback ? gLinkVSyncDisabled : gLinkVSyncDisabled | 0x10); } @@ -489,7 +484,7 @@ u16 LinkMain2(const u16 *heldKeys) { u8 i; - if (!gLinkOpen) + if (!sLinkOpen) { return 0; } @@ -555,10 +550,10 @@ static void ProcessRecvCmds(u8 unused) case LINKCMD_BLENDER_SEND_KEYS: gLinkPartnersHeldKeys[i] = gRecvCmds[i][1]; break; - case LINKCMD_0x5555: + case LINKCMD_DUMMY_1: gLinkDummy2 = TRUE; break; - case LINKCMD_0x5566: + case LINKCMD_DUMMY_2: gLinkDummy2 = TRUE; break; case LINKCMD_INIT_BLOCK: @@ -612,7 +607,7 @@ static void ProcessRecvCmds(u8 unused) linkPlayer->neverRead = 0; linkPlayer->progressFlags = 0; } - sub_800B524(linkPlayer); + ConvertLinkPlayerName(linkPlayer); if (strcmp(block->magic1, sASCIIGameFreakInc) != 0 || strcmp(block->magic2, sASCIIGameFreakInc) != 0) { @@ -664,22 +659,19 @@ static void BuildSendCmd(u16 command) gSendCmd[0] = LINKCMD_BLENDER_SEND_KEYS; gSendCmd[1] = gMain.heldKeys; break; - case LINKCMD_0x5555: - gSendCmd[0] = LINKCMD_0x5555; + case LINKCMD_DUMMY_1: + gSendCmd[0] = LINKCMD_DUMMY_1; break; - case LINKCMD_0x6666: - gSendCmd[0] = LINKCMD_0x6666; + case LINKCMD_SEND_EMPTY: + gSendCmd[0] = LINKCMD_SEND_EMPTY; gSendCmd[1] = 0; break; - case LINKCMD_0x7777: + case LINKCMD_SEND_0xEE: { u8 i; - - gSendCmd[0] = LINKCMD_0x7777; + gSendCmd[0] = LINKCMD_SEND_0xEE; for (i = 0; i < 5; i++) - { gSendCmd[i + 1] = 0xEE; - } break; } case LINKCMD_INIT_BLOCK: @@ -690,8 +682,8 @@ static void BuildSendCmd(u16 command) case LINKCMD_BLENDER_NO_PBLOCK_SPACE: gSendCmd[0] = LINKCMD_BLENDER_NO_PBLOCK_SPACE; break; - case LINKCMD_0xAAAB: - gSendCmd[0] = LINKCMD_0xAAAB; + case LINKCMD_SEND_ITEM: + gSendCmd[0] = LINKCMD_SEND_ITEM; gSendCmd[1] = gSpecialVar_ItemId; break; case LINKCMD_SEND_BLOCK_REQ: @@ -702,14 +694,13 @@ static void BuildSendCmd(u16 command) gSendCmd[0] = LINKCMD_READY_CLOSE_LINK; gSendCmd[1] = gReadyCloseLinkType; break; - case LINKCMD_0x5566: - gSendCmd[0] = LINKCMD_0x5566; + case LINKCMD_DUMMY_2: + gSendCmd[0] = LINKCMD_DUMMY_2; break; case LINKCMD_SEND_HELD_KEYS: if (gHeldKeyCodeToSend == 0 || gLinkTransferringData) - { break; - } + gSendCmd[0] = LINKCMD_SEND_HELD_KEYS; gSendCmd[1] = gHeldKeyCodeToSend; break; @@ -819,7 +810,7 @@ bool32 Link_AnyPartnersPlayingFRLG_JP(void) void OpenLinkTimed(void) { sPlayerDataExchangeStatus = EXCHANGE_NOT_STARTED; - gLinkTimeOutCounter = 0; + sTimeOutCounter = 0; OpenLink(); } @@ -892,7 +883,7 @@ u8 GetLinkPlayerDataExchangeStatusTimed(int minPlayers, int maxPlayers) } } } - else if (++gLinkTimeOutCounter > 600) + else if (++sTimeOutCounter > 600) { sPlayerDataExchangeStatus = EXCHANGE_TIMED_OUT; } @@ -909,9 +900,7 @@ bool8 IsLinkPlayerDataExchangeComplete(void) for (i = 0; i < GetLinkPlayerCount(); i++) { if (gLinkPlayers[i].linkType == gLinkPlayers[0].linkType) - { count++; - } } if (count == GetLinkPlayerCount()) { @@ -936,9 +925,7 @@ void ResetLinkPlayers(void) int i; for (i = 0; i <= MAX_LINK_PLAYERS; i++) - { gLinkPlayers[i] = (struct LinkPlayer){}; - } } static void ResetBlockSend(void) @@ -966,9 +953,8 @@ static bool32 InitBlockSend(const void *src, size_t size) else { if (src != gBlockSendBuffer) - { memcpy(gBlockSendBuffer, src, size); - } + sBlockSend.src = gBlockSendBuffer; } BuildSendCmd(LINKCMD_INIT_BLOCK); @@ -980,9 +966,7 @@ static bool32 InitBlockSend(const void *src, size_t size) static void LinkCB_BlockSendBegin(void) { if (++sBlockSendDelayCounter > 2) - { gLinkCallback = LinkCB_BlockSend; - } } static void LinkCB_BlockSend(void) @@ -1020,13 +1004,9 @@ void SetBerryBlenderLinkCallback(void) { gBerryBlenderKeySendAttempts = 0; if (gWirelessCommType) - { Rfu_SetBerryBlenderLinkCallback(); - } else - { gLinkCallback = LinkCB_BerryBlenderSendHeldKeys; - } } // Unused @@ -1044,9 +1024,8 @@ static void SendBerryBlenderNoSpaceForPokeblocks(void) u8 GetMultiplayerId(void) { if (gWirelessCommType == TRUE) - { return Rfu_GetMultiplayerId(); - } + return SIO_MULTI_CNT->id; } @@ -1061,18 +1040,16 @@ u8 bitmask_all_link_players_but_self(void) bool8 SendBlock(u8 unused, const void *src, u16 size) { if (gWirelessCommType == TRUE) - { return Rfu_InitBlockSend(src, size); - } + return InitBlockSend(src, size); } bool8 SendBlockRequest(u8 blockReqType) { if (gWirelessCommType == TRUE) - { return Rfu_SendBlockRequest(blockReqType); - } + if (gLinkCallback == NULL) { gBlockRequestType = blockReqType; @@ -1085,31 +1062,25 @@ bool8 SendBlockRequest(u8 blockReqType) bool8 IsLinkTaskFinished(void) { if (gWirelessCommType == TRUE) - { return IsLinkRfuTaskFinished(); - } + return gLinkCallback == NULL; } u8 GetBlockReceivedStatus(void) { if (gWirelessCommType == TRUE) - { return Rfu_GetBlockReceivedStatus(); - } + return (gBlockReceivedStatus[3] << 3) | (gBlockReceivedStatus[2] << 2) | (gBlockReceivedStatus[1] << 1) | (gBlockReceivedStatus[0] << 0); } static void SetBlockReceivedFlag(u8 who) { if (gWirelessCommType == TRUE) - { Rfu_SetBlockReceivedFlag(who); - } else - { gBlockReceivedStatus[who] = TRUE; - } } void ResetBlockReceivedFlags(void) @@ -1119,16 +1090,12 @@ void ResetBlockReceivedFlags(void) if (gWirelessCommType == TRUE) { for (i = 0; i < MAX_RFU_PLAYERS; i++) - { Rfu_ResetBlockReceivedFlag(i); - } } else { for (i = 0; i < MAX_LINK_PLAYERS; i++) - { gBlockReceivedStatus[i] = FALSE; - } } } @@ -1147,9 +1114,7 @@ void ResetBlockReceivedFlag(u8 who) void CheckShouldAdvanceLinkState(void) { if ((gLinkStatus & LINK_STAT_MASTER) && EXTRACT_PLAYER_COUNT(gLinkStatus) > 1) - { gShouldAdvanceLinkState = 1; - } } static u16 LinkTestCalcBlockChecksum(const u16 *src, u16 size) @@ -1159,92 +1124,90 @@ static u16 LinkTestCalcBlockChecksum(const u16 *src, u16 size) chksum = 0; for (i = 0; i < size / 2; i++) - { chksum += src[i]; - } + return chksum; } -static void LinkTest_prnthexchar(char a0, u8 a1, u8 a2) +static void LinkTest_PrintNumChar(char val, u8 x, u8 y) { u16 *vAddr; vAddr = (u16 *)BG_SCREEN_ADDR(gLinkTestBGInfo.screenBaseBlock); - vAddr[a2 * 32 + a1] = (gLinkTestBGInfo.paletteNum << 12) | (a0 + 1 + gLinkTestBGInfo.dummy_8); + vAddr[y * 32 + x] = (gLinkTestBGInfo.paletteNum << 12) | (val + 1 + gLinkTestBGInfo.baseChar); } -static void LinkTest_prntchar(char a0, u8 a1, u8 a2) +static void LinkTest_PrintChar(char val, u8 x, u8 y) { u16 *vAddr; vAddr = (u16 *)BG_SCREEN_ADDR(gLinkTestBGInfo.screenBaseBlock); - vAddr[a2 * 32 + a1] = (gLinkTestBGInfo.paletteNum << 12) | (a0 + gLinkTestBGInfo.dummy_8); + vAddr[y * 32 + x] = (gLinkTestBGInfo.paletteNum << 12) | (val + gLinkTestBGInfo.baseChar); } -static void LinkTest_prnthex(u32 pos, u8 a0, u8 a1, u8 a2) +static void LinkTest_PrintHex(u32 num, u8 x, u8 y, u8 length) { - char sp[32 / 2]; + char buff[16]; int i; - for (i = 0; i < a2; i++) + for (i = 0; i < length; i++) { - sp[i] = pos & 0xf; - pos >>= 4; + buff[i] = num & 0xF; + num >>= 4; } - for (i = a2 - 1; i >= 0; i--) + for (i = length - 1; i >= 0; i--) { - LinkTest_prnthexchar(sp[i], a0, a1); - a0++; + LinkTest_PrintNumChar(buff[i], x, y); + x++; } } -static void LinkTest_prntint(int a0, u8 a1, u8 a2, u8 a3) +static void LinkTest_PrintInt(int num, u8 x, u8 y, u8 length) { - char sp[32 / 2]; - int sp10; + char buff[16]; + int negX; int i; - sp10 = -1; - if (a0 < 0) + negX = -1; + if (num < 0) { - sp10 = a1; - a0 = -a0; + negX = x; + num = -num; } - for (i = 0; i < a3; i++) + for (i = 0; i < length; i++) { - sp[i] = a0 % 10; - a0 /= 10; + buff[i] = num % 10; + num /= 10; } - for (i = a3 - 1; i >= 0; i--) + for (i = length - 1; i >= 0; i--) { - LinkTest_prnthexchar(sp[i], a1, a2); - a1++; - } - if (sp10 != -1) - { - LinkTest_prnthexchar(*"\n", sp10, a2); + LinkTest_PrintNumChar(buff[i], x, y); + x++; } + + if (negX != -1) + LinkTest_PrintNumChar(*"\n", negX, y); } -static void LinkTest_prntstr(const char *a0, u8 a1, u8 a2) +static void LinkTest_PrintString(const char *str, u8 x, u8 y) { - int r6; + int xOffset; int i; - int r5; + int yOffset; - r5 = 0; - r6 = 0; - for (i = 0; a0[i] != 0; a0++) + yOffset = 0; + xOffset = 0; + for (i = 0; str[i] != 0; str++) { - if (a0[i] == *"\n") + if (str[i] == *"\n") { - r5++; - r6 = 0; + yOffset++; + xOffset = 0; } else { - LinkTest_prntchar(a0[i], a1 + r6, a2 + r5); - r6++; + LinkTest_PrintChar(str[i], x + xOffset, y + yOffset); + xOffset++; } } } @@ -1260,29 +1223,28 @@ static void LinkCB_RequestPlayerDataExchange(void) static void Task_PrintTestData(u8 taskId) { - char sp[32]; + char testTitle[32]; int i; - strcpy(sp, sASCIITestPrint); - LinkTest_prntstr(sp, 5, 2); - LinkTest_prnthex(gShouldAdvanceLinkState, 2, 1, 2); - LinkTest_prnthex(gLinkStatus, 15, 1, 8); - LinkTest_prnthex(gLink.state, 2, 10, 2); - LinkTest_prnthex(EXTRACT_PLAYER_COUNT(gLinkStatus), 15, 10, 2); - LinkTest_prnthex(GetMultiplayerId(), 15, 12, 2); - LinkTest_prnthex(gLastSendQueueCount, 25, 1, 2); - LinkTest_prnthex(gLastRecvQueueCount, 25, 2, 2); - LinkTest_prnthex(GetBlockReceivedStatus(), 15, 5, 2); - LinkTest_prnthex(gLinkDebugSeed, 2, 12, 8); - LinkTest_prnthex(gLinkDebugFlags, 2, 13, 8); - LinkTest_prnthex(GetSioMultiSI(), 25, 5, 1); - LinkTest_prnthex(IsSioMultiMaster(), 25, 6, 1); - LinkTest_prnthex(IsLinkConnectionEstablished(), 25, 7, 1); - LinkTest_prnthex(HasLinkErrorOccurred(), 25, 8, 1); + strcpy(testTitle, sASCIITestPrint); + LinkTest_PrintString(testTitle, 5, 2); + LinkTest_PrintHex(gShouldAdvanceLinkState, 2, 1, 2); + LinkTest_PrintHex(gLinkStatus, 15, 1, 8); + LinkTest_PrintHex(gLink.state, 2, 10, 2); + LinkTest_PrintHex(EXTRACT_PLAYER_COUNT(gLinkStatus), 15, 10, 2); + LinkTest_PrintHex(GetMultiplayerId(), 15, 12, 2); + LinkTest_PrintHex(gLastSendQueueCount, 25, 1, 2); + LinkTest_PrintHex(gLastRecvQueueCount, 25, 2, 2); + LinkTest_PrintHex(GetBlockReceivedStatus(), 15, 5, 2); + LinkTest_PrintHex(gLinkDebugSeed, 2, 12, 8); + LinkTest_PrintHex(gLinkDebugFlags, 2, 13, 8); + LinkTest_PrintHex(GetSioMultiSI(), 25, 5, 1); + LinkTest_PrintHex(IsSioMultiMaster(), 25, 6, 1); + LinkTest_PrintHex(IsLinkConnectionEstablished(), 25, 7, 1); + LinkTest_PrintHex(HasLinkErrorOccurred(), 25, 8, 1); + for (i = 0; i < MAX_LINK_PLAYERS; i++) - { - LinkTest_prnthex(gLinkTestBlockChecksums[i], 10, 4 + i, 4); - } + LinkTest_PrintHex(gLinkTestBlockChecksums[i], 10, 4 + i, 4); } void SetLinkDebugValues(u32 seed, u32 flags) @@ -1298,9 +1260,8 @@ u8 GetSavedLinkPlayerCountAsBitFlags(void) flags = 0; for (i = 0; i < gSavedLinkPlayerCount; i++) - { flags |= (1 << i); - } + return flags; } @@ -1311,9 +1272,8 @@ u8 GetLinkPlayerCountAsBitFlags(void) flags = 0; for (i = 0; i < GetLinkPlayerCount(); i++) - { flags |= (1 << i); - } + return flags; } @@ -1324,9 +1284,7 @@ void SaveLinkPlayers(u8 playerCount) gSavedLinkPlayerCount = playerCount; gSavedMultiplayerId = GetMultiplayerId(); for (i = 0; i < MAX_RFU_PLAYERS; i++) - { - gSavedLinkPlayers[i] = gLinkPlayers[i]; - } + sSavedLinkPlayers[i] = gLinkPlayers[i]; } // The number of players when trading began. This is frequently compared against the @@ -1349,7 +1307,7 @@ bool8 DoesLinkPlayerCountMatchSaved(void) for (i = 0; i < gSavedLinkPlayerCount; i++) { - if (gLinkPlayers[i].trainerId == gSavedLinkPlayers[i].trainerId) + if (gLinkPlayers[i].trainerId == sSavedLinkPlayers[i].trainerId) { if (gLinkType == LINKTYPE_BATTLE_TOWER) { @@ -1375,12 +1333,15 @@ bool8 DoesLinkPlayerCountMatchSaved(void) void ClearSavedLinkPlayers(void) { int i; - - // Clearly not what was meant to be written, but here it is anyway. - for (i = 0; i < 4; i++) - { - CpuSet(&gSavedLinkPlayers[i], NULL, sizeof(struct LinkPlayer)); - } + // The CpuSet loop below is incorrectly writing to NULL + // instead of sSavedLinkPlayers. + // Additionally it's using the wrong array size. +#ifdef UBFIX + memset(sSavedLinkPlayers, 0, sizeof(sSavedLinkPlayers)); +#else + for (i = 0; i < MAX_LINK_PLAYERS; i++) + CpuSet(&sSavedLinkPlayers[i], NULL, sizeof(struct LinkPlayer)); +#endif } void CheckLinkPlayersMatchSaved(void) @@ -1389,8 +1350,8 @@ void CheckLinkPlayersMatchSaved(void) for (i = 0; i < gSavedLinkPlayerCount; i++) { - if (gSavedLinkPlayers[i].trainerId != gLinkPlayers[i].trainerId - || StringCompare(gSavedLinkPlayers[i].name, gLinkPlayers[i].name) != 0) + if (sSavedLinkPlayers[i].trainerId != gLinkPlayers[i].trainerId + || StringCompare(sSavedLinkPlayers[i].name, gLinkPlayers[i].name) != 0) { gLinkErrorOccurred = TRUE; CloseLink(); @@ -1413,9 +1374,8 @@ u8 GetLinkPlayerCount_2(void) bool8 IsLinkMaster(void) { if (gWirelessCommType) - { return Rfu_IsMaster(); - } + return EXTRACT_MASTER(gLinkStatus); } @@ -1568,9 +1528,8 @@ void SetLinkStandbyCallback(void) else { if (gLinkCallback == NULL) - { gLinkCallback = LinkCB_Standby; - } + gLinkDummy1 = FALSE; } } @@ -1606,7 +1565,7 @@ static void LinkCB_StandbyForAll(void) static void CheckErrorStatus(void) { - if (gLinkOpen && EXTRACT_LINK_ERRORS(gLinkStatus)) + if (sLinkOpen && EXTRACT_LINK_ERRORS(gLinkStatus)) { if (!gSuppressLinkErrorMessage) { @@ -1620,12 +1579,12 @@ static void CheckErrorStatus(void) } } -void BufferLinkErrorInfo(u32 status, u8 lastSendQueueCount, u8 lastRecvQueueCount, bool8 unk_06) +void BufferLinkErrorInfo(u32 status, u8 lastSendQueueCount, u8 lastRecvQueueCount, bool8 disconnected) { sLinkErrorBuffer.status = status; sLinkErrorBuffer.lastSendQueueCount = lastSendQueueCount; sLinkErrorBuffer.lastRecvQueueCount = lastRecvQueueCount; - sLinkErrorBuffer.unk_06 = unk_06; + sLinkErrorBuffer.disconnected = disconnected; } void CB2_LinkError(void) @@ -1645,16 +1604,15 @@ void CB2_LinkError(void) ScanlineEffect_Stop(); if (gWirelessCommType) { - if (!sLinkErrorBuffer.unk_06) - { + if (!sLinkErrorBuffer.disconnected) gWirelessCommType = 3; - } + ResetLinkRfuGFLayer(); } SetVBlankCallback(VBlankCB_LinkError); ResetBgsAndClearDma3BusyFlags(0); InitBgsFromTemplates(0, sLinkErrorBgTemplates, ARRAY_COUNT(sLinkErrorBgTemplates)); - sLinkErrorBgTilemapBuffer = tilemapBuffer = malloc(0x800); + sLinkErrorBgTilemapBuffer = tilemapBuffer = malloc(BG_SCREEN_SIZE); SetBgTilemapBuffer(1, tilemapBuffer); if (InitWindows(sLinkErrorWindowTemplates)) { @@ -1714,14 +1672,16 @@ static void CB2_PrintErrorMessage(void) switch (gMain.state) { case 00: - if (sLinkErrorBuffer.unk_06) + // Below is only true for the RFU, so the other error + // type is inferred to be from a wired connection + if (sLinkErrorBuffer.disconnected) ErrorMsg_MoveCloserToPartner(); else ErrorMsg_CheckConnections(); break; case 02: ShowBg(0); - if (sLinkErrorBuffer.unk_06) + if (sLinkErrorBuffer.disconnected) ShowBg(1); break; case 30: @@ -1748,7 +1708,7 @@ static void CB2_PrintErrorMessage(void) { PlaySE(SE_PIN); gWirelessCommType = 0; - sLinkErrorBuffer.unk_06 = 0; + sLinkErrorBuffer.disconnected = FALSE; sub_81700F8(); } } @@ -1762,10 +1722,9 @@ static void CB2_PrintErrorMessage(void) } } } + if (gMain.state != 160) - { gMain.state++; - } } // TODO: there might be a file boundary here, let's name it @@ -1795,7 +1754,7 @@ bool8 HasLinkErrorOccurred(void) return gLinkErrorOccurred; } -void sub_800B348(void) +void LocalLinkPlayerToBlock(void) { struct LinkPlayerBlock *block; @@ -1816,11 +1775,11 @@ void LinkPlayerFromBlock(u32 who) block = (struct LinkPlayerBlock *)gBlockRecvBuffer[who_]; player = &gLinkPlayers[who_]; *player = block->linkPlayer; - sub_800B524(player); - if (strcmp(block->magic1, sASCIIGameFreakInc) != 0 || strcmp(block->magic2, sASCIIGameFreakInc) != 0) - { + ConvertLinkPlayerName(player); + + if (strcmp(block->magic1, sASCIIGameFreakInc) != 0 + || strcmp(block->magic2, sASCIIGameFreakInc) != 0) SetMainCallback2(CB2_LinkError); - } } bool8 HandleLinkConnection(void) @@ -1832,10 +1791,9 @@ bool8 HandleLinkConnection(void) { gLinkStatus = LinkMain1(&gShouldAdvanceLinkState, gSendCmd, gRecvCmds); LinkMain2(&gMain.heldKeys); + if ((gLinkStatus & LINK_STAT_RECEIVED_NOTHING) && sub_808766C() == TRUE) - { return TRUE; - } } else { @@ -1844,9 +1802,7 @@ bool8 HandleLinkConnection(void) if (sub_808766C() == TRUE) { if (r4 == TRUE || IsRfuRecvQueueEmpty() || r5) - { return TRUE; - } } } return FALSE; @@ -1855,42 +1811,34 @@ bool8 HandleLinkConnection(void) void SetWirelessCommType1(void) { if (gReceivedRemoteLinkPlayers == 0) - { gWirelessCommType = 1; - } } static void SetWirelessCommType0_Internal(void) { if (gReceivedRemoteLinkPlayers == 0) - { gWirelessCommType = 0; - } } void SetWirelessCommType0(void) { if (gReceivedRemoteLinkPlayers == 0) - { gWirelessCommType = 0; - } } u32 GetLinkRecvQueueLength(void) { if (gWirelessCommType != 0) - { return GetRfuRecvQueueLength(); - } + return gLink.recvQueue.count; } -bool32 sub_800B504(void) +bool32 IsLinkRecvQueueLengthAtLeast3(void) { if (GetLinkRecvQueueLength() > 2) - { return TRUE; - } + return FALSE; } @@ -1900,9 +1848,9 @@ u8 GetWirelessCommType(void) return gWirelessCommType; } -void sub_800B524(struct LinkPlayer *player) +void ConvertLinkPlayerName(struct LinkPlayer *player) { - player->progressFlagsCopy = player->progressFlags; + player->progressFlagsCopy = player->progressFlags; // ? Perhaps relocating for a longer name field ConvertInternationalString(player->name, player->language); } @@ -2410,9 +2358,7 @@ void ResetSendBuffer(void) for (i = 0; i < CMD_LENGTH; i++) { for (j = 0; j < QUEUE_CAPACITY; j++) - { - gLink.sendQueue.data[i][j] = 0xEFFF; - } + gLink.sendQueue.data[i][j] = LINKCMD_NONE; } } @@ -2429,9 +2375,7 @@ void ResetRecvBuffer(void) for (j = 0; j < CMD_LENGTH; j++) { for (k = 0; k < QUEUE_CAPACITY; k++) - { - gLink.recvQueue.data[i][j][k] = 0xEFFF; - } + gLink.recvQueue.data[i][j][k] = LINKCMD_NONE; } } } diff --git a/src/link_rfu_2.c b/src/link_rfu_2.c index 54f21ed9f..6366b9704 100644 --- a/src/link_rfu_2.c +++ b/src/link_rfu_2.c @@ -1697,7 +1697,7 @@ static void sub_801084C(u8 taskId) if (AreNoPlayersReceiving()) { ResetBlockReceivedFlags(); - sub_800B348(); + LocalLinkPlayerToBlock(); gTasks[taskId].data[0]++; } break; @@ -1786,7 +1786,7 @@ static void ReceiveRfuLinkPlayers(const struct SioInfo *sioInfo) for (i = 0; i < MAX_RFU_PLAYERS; i++) { gLinkPlayers[i] = sioInfo->linkPlayers[i]; - sub_800B524(gLinkPlayers + i); + ConvertLinkPlayerName(gLinkPlayers + i); } } @@ -1831,7 +1831,7 @@ static void Task_ExchangeLinkPlayers(u8 taskId) ResetBlockReceivedFlag(r4); r2 = (struct LinkPlayerBlock *)gBlockRecvBuffer[r4]; gLinkPlayers[r4] = r2->linkPlayer; - sub_800B524(gLinkPlayers + r4); + ConvertLinkPlayerName(gLinkPlayers + r4); gTasks[taskId].data[0]++; } break; @@ -1887,7 +1887,7 @@ static void sub_8010D0C(u8 taskId) case 0: if (Rfu.playerCount) { - sub_800B348(); + LocalLinkPlayerToBlock(); SendBlock(0, gBlockSendBuffer, sizeof(struct LinkPlayerBlock)); gTasks[taskId].data[0]++; } @@ -1616,6 +1616,9 @@ void ply_xcmd_0C(struct MusicPlayerInfo *mplayInfo, struct MusicPlayerTrack *tra void ply_xcmd_0D(struct MusicPlayerInfo *mplayInfo, struct MusicPlayerTrack *track) { u32 unk; +#ifdef UBFIX + unk = 0; +#endif READ_XCMD_BYTE(unk, 0) // UB: uninitialized variable READ_XCMD_BYTE(unk, 1) @@ -1657,18 +1660,12 @@ start_song: mplayInfo = &gPokemonCryMusicPlayers[i]; mplayInfo->ident++; -#define CRY ((s32)&gPokemonCrySongs + i * sizeof(struct PokemonCrySong)) -#define CRY_OFS(field) offsetof(struct PokemonCrySong, field) + gPokemonCrySongs[i] = gPokemonCrySong; - memcpy((void *)CRY, &gPokemonCrySong, sizeof(struct PokemonCrySong)); - - *(u32 *)(CRY + CRY_OFS(tone)) = (u32)tone; - *(u32 *)(CRY + CRY_OFS(part)) = CRY + CRY_OFS(part0); - *(u32 *)(CRY + CRY_OFS(part) + 4) = CRY + CRY_OFS(part1); - *(u32 *)(CRY + CRY_OFS(gotoTarget)) = CRY + CRY_OFS(cont); - -#undef CRY_OFS -#undef CRY + gPokemonCrySongs[i].tone = tone; + gPokemonCrySongs[i].part[0] = &gPokemonCrySongs[i].part0; + gPokemonCrySongs[i].part[1] = &gPokemonCrySongs[i].part1; + gPokemonCrySongs[i].gotoTarget = (u32)&gPokemonCrySongs[i].cont; mplayInfo->ident = ID_NUMBER; diff --git a/src/map_name_popup.c b/src/map_name_popup.c index 8939edd90..65192fa33 100644 --- a/src/map_name_popup.c +++ b/src/map_name_popup.c @@ -197,8 +197,8 @@ static const u8 * const gBattlePyramid_MapHeaderStrings[] = gText_Pyramid, }; -// text -bool8 sub_80D47D4(void) +// Unused +static bool8 StartMenu_ShowMapNamePopup(void) { HideStartMenu(); ShowMapNamePopup(); @@ -333,24 +333,36 @@ static void ShowMapNamePopUpWindow(void) CopyWindowToVram(GetMapNamePopUpWindowId(), 3); } -static void sub_80D4A78(u8 bg, u8 x, u8 y, u8 deltaX, u8 deltaY, u8 unused) +#define TILE_TOP_EDGE_START 0x21D +#define TILE_TOP_EDGE_END 0x228 +#define TILE_LEFT_EDGE_TOP 0x229 +#define TILE_RIGHT_EDGE_TOP 0x22A +#define TILE_LEFT_EDGE_MID 0x22B +#define TILE_RIGHT_EDGE_MID 0x22C +#define TILE_LEFT_EDGE_BOT 0x22D +#define TILE_RIGHT_EDGE_BOT 0x22E +#define TILE_BOT_EDGE_START 0x22F +#define TILE_BOT_EDGE_END 0x23A + +static void DrawMapNamePopUpFrame(u8 bg, u8 x, u8 y, u8 deltaX, u8 deltaY, u8 unused) { s32 i; - for (i = 0; i < 12; i++) - { - FillBgTilemapBufferRect(bg, 0x21D + i, i - 1 + x, y - 1, 1, 1, 0xE); - } - FillBgTilemapBufferRect(bg, 0x229, x - 1, y, 1, 1, 0xE); - FillBgTilemapBufferRect(bg, 0x22A, deltaX + x, y, 1, 1, 0xE); - FillBgTilemapBufferRect(bg, 0x22B, x - 1, y + 1 , 1, 1, 0xE); - FillBgTilemapBufferRect(bg, 0x22C, deltaX + x, y + 1, 1, 1, 0xE); - FillBgTilemapBufferRect(bg, 0x22D, x - 1, y + 2, 1, 1, 0xE); - FillBgTilemapBufferRect(bg, 0x22E, deltaX + x, y + 2, 1, 1, 0xE); - for (i = 0; i < 12; i++) - { - FillBgTilemapBufferRect(bg, 0x22F + i, i - 1 + x, y + deltaY, 1, 1, 0xE); - } + // Draw top edge + for (i = 0; i < 1 + TILE_TOP_EDGE_END - TILE_TOP_EDGE_START; i++) + FillBgTilemapBufferRect(bg, TILE_TOP_EDGE_START + i, i - 1 + x, y - 1, 1, 1, 14); + + // Draw sides + FillBgTilemapBufferRect(bg, TILE_LEFT_EDGE_TOP, x - 1, y, 1, 1, 14); + FillBgTilemapBufferRect(bg, TILE_RIGHT_EDGE_TOP, deltaX + x, y, 1, 1, 14); + FillBgTilemapBufferRect(bg, TILE_LEFT_EDGE_MID, x - 1, y + 1, 1, 1, 14); + FillBgTilemapBufferRect(bg, TILE_RIGHT_EDGE_MID, deltaX + x, y + 1, 1, 1, 14); + FillBgTilemapBufferRect(bg, TILE_LEFT_EDGE_BOT, x - 1, y + 2, 1, 1, 14); + FillBgTilemapBufferRect(bg, TILE_RIGHT_EDGE_BOT, deltaX + x, y + 2, 1, 1, 14); + + // Draw bottom edge + for (i = 0; i < 1 + TILE_BOT_EDGE_END - TILE_BOT_EDGE_START; i++) + FillBgTilemapBufferRect(bg, TILE_BOT_EDGE_START + i, i - 1 + x, y + deltaY, 1, 1, 14); } static void LoadMapNamePopUpWindowBg(void) @@ -369,7 +381,7 @@ static void LoadMapNamePopUpWindowBg(void) popUpThemeId = gRegionMapSectionId_To_PopUpThemeIdMapping[regionMapSectionId]; LoadBgTiles(GetWindowAttribute(popupWindowId, WINDOW_BG), gMapPopUp_Outline_Table[popUpThemeId], 0x400, 0x21D); - CallWindowFunction(popupWindowId, sub_80D4A78); + CallWindowFunction(popupWindowId, DrawMapNamePopUpFrame); PutWindowTilemap(popupWindowId); if (gMapHeader.weather == WEATHER_UNDERWATER_BUBBLES) LoadPalette(&gUnknown_0857F444, 0xE0, 0x20); diff --git a/src/mauville_old_man.c b/src/mauville_old_man.c index cdcde9b06..228415628 100644 --- a/src/mauville_old_man.c +++ b/src/mauville_old_man.c @@ -425,21 +425,21 @@ static void StartBardSong(bool8 useTemporaryLyrics) gTasks[taskId].tUseTemporaryLyrics = useTemporaryLyrics; } -static void sub_81206F0(void) +static void EnableTextPrinters(void) { - gUnknown_03002F84 = FALSE; + gDisableTextPrinters = FALSE; } -static void BardSong_TextSubPrinter(struct TextPrinterTemplate * printer, u16 a1) +static void BardSong_DisableTextPrinters(struct TextPrinterTemplate * printer, u16 a1) { - gUnknown_03002F84 = TRUE; + gDisableTextPrinters = TRUE; } static void sub_8120708(const u8 * src) { DrawDialogueFrame(0, 0); - AddTextPrinterParameterized(0, 1, src, 0, 1, 1, BardSong_TextSubPrinter); - gUnknown_03002F84 = TRUE; + AddTextPrinterParameterized(0, 1, src, 0, 1, 1, BardSong_DisableTextPrinters); + gDisableTextPrinters = TRUE; CopyWindowToVram(0, 3); } @@ -620,7 +620,7 @@ static void Task_BardSong(u8 taskId) else if (gStringVar4[task->tCharIndex] == CHAR_SPACE) { - sub_81206F0(); + EnableTextPrinters(); task->tCharIndex++; task->tState = 2; task->data[2] = 0; @@ -640,7 +640,7 @@ static void Task_BardSong(u8 taskId) else if (gStringVar4[task->tCharIndex] == CHAR_SONG_WORD_SEPARATOR) { gStringVar4[task->tCharIndex] = CHAR_SPACE; // restore it back to a space - sub_81206F0(); + EnableTextPrinters(); task->tCharIndex++; task->data[2] = 0; } @@ -649,7 +649,7 @@ static void Task_BardSong(u8 taskId) switch (task->data[1]) { case 0: - sub_81206F0(); + EnableTextPrinters(); task->data[1]++; break; case 1: diff --git a/src/menu_helpers.c b/src/menu_helpers.c index b31d84a1e..3fe19efcc 100644 --- a/src/menu_helpers.c +++ b/src/menu_helpers.c @@ -319,7 +319,7 @@ bool8 MenuHelpers_CallLinkSomething(void) { if (sub_81221D0() == TRUE) return TRUE; - else if (sub_800B504() != TRUE) + else if (IsLinkRecvQueueLengthAtLeast3() != TRUE) return FALSE; else return TRUE; diff --git a/src/option_menu.c b/src/option_menu.c index 64e9b6576..936aff923 100644 --- a/src/option_menu.c +++ b/src/option_menu.c @@ -75,7 +75,7 @@ static u8 ButtonMode_ProcessInput(u8 selection); static void ButtonMode_DrawChoices(u8 selection); static void DrawTextOption(void); static void DrawOptionMenuTexts(void); -static void sub_80BB154(void); +static void DrawBgWindowFrames(void); EWRAM_DATA static bool8 sArrowPressed = FALSE; @@ -228,7 +228,7 @@ void CB2_InitOptionMenu(void) DrawOptionMenuTexts(); gMain.state++; case 9: - sub_80BB154(); + DrawBgWindowFrames(); gMain.state++; break; case 10: @@ -642,25 +642,37 @@ static void DrawOptionMenuTexts(void) CopyWindowToVram(WIN_OPTIONS, 3); } -static void sub_80BB154(void) +#define TILE_TOP_CORNER_L 0x1A2 +#define TILE_TOP_EDGE 0x1A3 +#define TILE_TOP_CORNER_R 0x1A4 +#define TILE_LEFT_EDGE 0x1A5 +#define TILE_RIGHT_EDGE 0x1A7 +#define TILE_BOT_CORNER_L 0x1A8 +#define TILE_BOT_EDGE 0x1A9 +#define TILE_BOT_CORNER_R 0x1AA + +static void DrawBgWindowFrames(void) { - // bg, tileNum, x, y, width, height, pal - FillBgTilemapBufferRect(1, 0x1A2, 1, 0, 1, 1, 7); - FillBgTilemapBufferRect(1, 0x1A3, 2, 0, 0x1B, 1, 7); - FillBgTilemapBufferRect(1, 0x1A4, 28, 0, 1, 1, 7); - FillBgTilemapBufferRect(1, 0x1A5, 1, 1, 1, 2, 7); - FillBgTilemapBufferRect(1, 0x1A7, 28, 1, 1, 2, 7); - FillBgTilemapBufferRect(1, 0x1A8, 1, 3, 1, 1, 7); - FillBgTilemapBufferRect(1, 0x1A9, 2, 3, 0x1B, 1, 7); - FillBgTilemapBufferRect(1, 0x1AA, 28, 3, 1, 1, 7); - FillBgTilemapBufferRect(1, 0x1A2, 1, 4, 1, 1, 7); - FillBgTilemapBufferRect(1, 0x1A3, 2, 4, 0x1A, 1, 7); - FillBgTilemapBufferRect(1, 0x1A4, 28, 4, 1, 1, 7); - FillBgTilemapBufferRect(1, 0x1A5, 1, 5, 1, 0x12, 7); - FillBgTilemapBufferRect(1, 0x1A7, 28, 5, 1, 0x12, 7); - FillBgTilemapBufferRect(1, 0x1A8, 1, 19, 1, 1, 7); - FillBgTilemapBufferRect(1, 0x1A9, 2, 19, 0x1A, 1, 7); - FillBgTilemapBufferRect(1, 0x1AA, 28, 19, 1, 1, 7); + // bg, tile, x, y, width, height, palNum + // Draw title window frame + FillBgTilemapBufferRect(1, TILE_TOP_CORNER_L, 1, 0, 1, 1, 7); + FillBgTilemapBufferRect(1, TILE_TOP_EDGE, 2, 0, 27, 1, 7); + FillBgTilemapBufferRect(1, TILE_TOP_CORNER_R, 28, 0, 1, 1, 7); + FillBgTilemapBufferRect(1, TILE_LEFT_EDGE, 1, 1, 1, 2, 7); + FillBgTilemapBufferRect(1, TILE_RIGHT_EDGE, 28, 1, 1, 2, 7); + FillBgTilemapBufferRect(1, TILE_BOT_CORNER_L, 1, 3, 1, 1, 7); + FillBgTilemapBufferRect(1, TILE_BOT_EDGE, 2, 3, 27, 1, 7); + FillBgTilemapBufferRect(1, TILE_BOT_CORNER_R, 28, 3, 1, 1, 7); + + // Draw options list window frame + FillBgTilemapBufferRect(1, TILE_TOP_CORNER_L, 1, 4, 1, 1, 7); + FillBgTilemapBufferRect(1, TILE_TOP_EDGE, 2, 4, 26, 1, 7); + FillBgTilemapBufferRect(1, TILE_TOP_CORNER_R, 28, 4, 1, 1, 7); + FillBgTilemapBufferRect(1, TILE_LEFT_EDGE, 1, 5, 1, 18, 7); + FillBgTilemapBufferRect(1, TILE_RIGHT_EDGE, 28, 5, 1, 18, 7); + FillBgTilemapBufferRect(1, TILE_BOT_CORNER_L, 1, 19, 1, 1, 7); + FillBgTilemapBufferRect(1, TILE_BOT_EDGE, 2, 19, 26, 1, 7); + FillBgTilemapBufferRect(1, TILE_BOT_CORNER_R, 28, 19, 1, 1, 7); CopyBgTilemapBufferToVram(1); } diff --git a/src/pokedex.c b/src/pokedex.c index 645d8e6c8..558c27083 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -3032,17 +3032,8 @@ static void SpriteCB_PokedexListMonSprite(struct Sprite *sprite) else { u32 var; - sprite->pos2.y = gSineTable[(u8)sprite->data[5]] * 76 / 256; - // UB: possible division by zero -#ifdef UBFIX - if (gSineTable[sprite->data[5] + 64] != 0) - var = 0x10000 / gSineTable[sprite->data[5] + 64]; - else - var = 0; -#else - var = 0x10000 / gSineTable[sprite->data[5] + 64]; -#endif //UBFIX + var = SAFE_DIV(0x10000, gSineTable[sprite->data[5] + 64]); if (var > 0xFFFF) var = 0xFFFF; SetOamMatrix(sprite->data[1] + 1, 0x100, 0, 0, var); diff --git a/src/pokemon.c b/src/pokemon.c index 2abf9cb56..5b683584b 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -4649,7 +4649,7 @@ bool8 ExecuteTableBasedItemEffect(struct Pokemon *mon, u16 item, u8 partyIndex, { \ friendshipChange = itemEffect[itemEffectParam]; \ friendship = GetMonData(mon, MON_DATA_FRIENDSHIP, NULL); \ - if (friendshipChange > 0 && holdEffect == HOLD_EFFECT_HAPPINESS_UP) \ + if (friendshipChange > 0 && holdEffect == HOLD_EFFECT_FRIENDSHIP_UP) \ friendship += 150 * friendshipChange / 100; \ else \ friendship += friendshipChange; \ @@ -5828,7 +5828,7 @@ void AdjustFriendship(struct Pokemon *mon, u8 event) && (event != FRIENDSHIP_EVENT_LEAGUE_BATTLE || IS_LEAGUE_BATTLE)) { s8 mod = sFriendshipEventModifiers[event][friendshipLevel]; - if (mod > 0 && holdEffect == HOLD_EFFECT_HAPPINESS_UP) + if (mod > 0 && holdEffect == HOLD_EFFECT_FRIENDSHIP_UP) mod = (150 * mod) / 100; friendship += mod; if (mod > 0) diff --git a/src/shop.c b/src/shop.c index 26bd964c5..dac43c96d 100755 --- a/src/shop.c +++ b/src/shop.c @@ -40,11 +40,14 @@ #include "constants/songs.h" #include "constants/tv.h" -EWRAM_DATA struct MartInfo gMartInfo = {0}; -EWRAM_DATA struct ShopData *gShopDataPtr = NULL; -EWRAM_DATA struct ListMenuItem *gUnknown_02039F74 = NULL; -EWRAM_DATA u8 (*gUnknown_02039F78)[16] = {0}; -EWRAM_DATA u8 gMartPurchaseHistoryId = 0; +#define TAG_SCROLL_ARROW 2100 +#define TAG_ITEM_ICON_BASE 2110 + +static EWRAM_DATA struct MartInfo sMartInfo = {0}; +static EWRAM_DATA struct ShopData *sShopData = NULL; +static EWRAM_DATA struct ListMenuItem *sListMenuItems = NULL; +static EWRAM_DATA u8 (*sItemNames)[16] = {0}; +static EWRAM_DATA u8 sPurchaseHistoryId = 0; EWRAM_DATA struct ItemSlot gMartPurchaseHistory[3] = {0}; static void Task_ShopMenu(u8 taskId); @@ -276,15 +279,15 @@ static u8 CreateShopMenu(u8 martType) int numMenuItems; ScriptContext2_Enable(); - gMartInfo.martType = martType; + sMartInfo.martType = martType; if (martType == MART_TYPE_NORMAL) { struct WindowTemplate winTemplate; winTemplate = sShopMenuWindowTemplates[0]; winTemplate.width = GetMaxWidthInMenuTable(sShopMenuActions_BuySellQuit, ARRAY_COUNT(sShopMenuActions_BuySellQuit)); - gMartInfo.windowId = AddWindow(&winTemplate); - gMartInfo.menuActions = sShopMenuActions_BuySellQuit; + sMartInfo.windowId = AddWindow(&winTemplate); + sMartInfo.menuActions = sShopMenuActions_BuySellQuit; numMenuItems = ARRAY_COUNT(sShopMenuActions_BuySellQuit); } else @@ -292,35 +295,35 @@ static u8 CreateShopMenu(u8 martType) struct WindowTemplate winTemplate; winTemplate = sShopMenuWindowTemplates[1]; winTemplate.width = GetMaxWidthInMenuTable(sShopMenuActions_BuyQuit, ARRAY_COUNT(sShopMenuActions_BuyQuit)); - gMartInfo.windowId = AddWindow(&winTemplate); - gMartInfo.menuActions = sShopMenuActions_BuyQuit; + sMartInfo.windowId = AddWindow(&winTemplate); + sMartInfo.menuActions = sShopMenuActions_BuyQuit; numMenuItems = ARRAY_COUNT(sShopMenuActions_BuyQuit); } - SetStandardWindowBorderStyle(gMartInfo.windowId, 0); - PrintMenuTable(gMartInfo.windowId, numMenuItems, gMartInfo.menuActions); - InitMenuInUpperLeftCornerPlaySoundWhenAPressed(gMartInfo.windowId, numMenuItems, 0); - PutWindowTilemap(gMartInfo.windowId); - CopyWindowToVram(gMartInfo.windowId, 1); + SetStandardWindowBorderStyle(sMartInfo.windowId, 0); + PrintMenuTable(sMartInfo.windowId, numMenuItems, sMartInfo.menuActions); + InitMenuInUpperLeftCornerPlaySoundWhenAPressed(sMartInfo.windowId, numMenuItems, 0); + PutWindowTilemap(sMartInfo.windowId); + CopyWindowToVram(sMartInfo.windowId, 1); return CreateTask(Task_ShopMenu, 8); } static void SetShopMenuCallback(void (* callback)(void)) { - gMartInfo.callback = callback; + sMartInfo.callback = callback; } static void SetShopItemsForSale(const u16 *items) { u16 i = 0; - gMartInfo.itemList = items; - gMartInfo.itemCount = 0; + sMartInfo.itemList = items; + sMartInfo.itemCount = 0; - while (gMartInfo.itemList[i]) + while (sMartInfo.itemList[i]) { - gMartInfo.itemCount++; + sMartInfo.itemCount++; i++; } } @@ -337,7 +340,7 @@ static void Task_ShopMenu(u8 taskId) Task_HandleShopMenuQuit(taskId); break; default: - gMartInfo.menuActions[inputCode].func.void_u8(taskId); + sMartInfo.menuActions[inputCode].func.void_u8(taskId); break; } } @@ -368,14 +371,14 @@ void CB2_ExitSellMenu(void) static void Task_HandleShopMenuQuit(u8 taskId) { - ClearStdWindowAndFrameToTransparent(gMartInfo.windowId, 2); - RemoveWindow(gMartInfo.windowId); + ClearStdWindowAndFrameToTransparent(sMartInfo.windowId, 2); + RemoveWindow(sMartInfo.windowId); SaveRecordedItemPurchasesForTVShow(); ScriptContext2_Disable(); DestroyTask(taskId); - if (gMartInfo.callback) - gMartInfo.callback(); + if (sMartInfo.callback) + sMartInfo.callback(); } static void Task_GoToBuyOrSellMenu(u8 taskId) @@ -398,7 +401,7 @@ static void Task_ReturnToShopMenu(u8 taskId) { if (IsWeatherNotFadingIn() == TRUE) { - if (gMartInfo.martType == MART_TYPE_DECOR2) + if (sMartInfo.martType == MART_TYPE_DECOR2) DisplayItemMessageOnField(taskId, gText_CanIHelpWithAnythingElse, ShowShopMenuAfterExitingBuyOrSellMenu); else DisplayItemMessageOnField(taskId, gText_AnythingElseICanHelp, ShowShopMenuAfterExitingBuyOrSellMenu); @@ -407,7 +410,7 @@ static void Task_ReturnToShopMenu(u8 taskId) static void ShowShopMenuAfterExitingBuyOrSellMenu(u8 taskId) { - CreateShopMenu(gMartInfo.martType); + CreateShopMenu(sMartInfo.martType); DestroyTask(taskId); } @@ -447,10 +450,10 @@ static void CB2_InitBuyMenu(void) ResetSpriteData(); ResetTasks(); ClearScheduledBgCopiesToVram(); - gShopDataPtr = AllocZeroed(sizeof(struct ShopData)); - gShopDataPtr->scrollIndicatorsTaskId = TASK_NONE; - gShopDataPtr->itemSpriteIds[0] = SPRITE_NONE; - gShopDataPtr->itemSpriteIds[1] = SPRITE_NONE; + sShopData = AllocZeroed(sizeof(struct ShopData)); + sShopData->scrollIndicatorsTaskId = TASK_NONE; + sShopData->itemSpriteIds[0] = SPRITE_NONE; + sShopData->itemSpriteIds[1] = SPRITE_NONE; BuyMenuBuildListMenuTemplate(); BuyMenuInitBgs(); FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 0x20, 0x20); @@ -480,9 +483,9 @@ static void CB2_InitBuyMenu(void) static void BuyMenuFreeMemory(void) { - Free(gShopDataPtr); - Free(gUnknown_02039F74); - Free(gUnknown_02039F78); + Free(sShopData); + Free(sListMenuItems); + Free(sItemNames); FreeAllWindowBuffers(); } @@ -490,29 +493,29 @@ static void BuyMenuBuildListMenuTemplate(void) { u16 i; - gUnknown_02039F74 = Alloc((gMartInfo.itemCount + 1) * sizeof(*gUnknown_02039F74)); - gUnknown_02039F78 = Alloc((gMartInfo.itemCount + 1) * sizeof(*gUnknown_02039F78)); - for (i = 0; i < gMartInfo.itemCount; i++) - BuyMenuSetListEntry(&gUnknown_02039F74[i], gMartInfo.itemList[i], gUnknown_02039F78[i]); + sListMenuItems = Alloc((sMartInfo.itemCount + 1) * sizeof(*sListMenuItems)); + sItemNames = Alloc((sMartInfo.itemCount + 1) * sizeof(*sItemNames)); + for (i = 0; i < sMartInfo.itemCount; i++) + BuyMenuSetListEntry(&sListMenuItems[i], sMartInfo.itemList[i], sItemNames[i]); - StringCopy(gUnknown_02039F78[i], gText_Cancel2); - gUnknown_02039F74[i].name = gUnknown_02039F78[i]; - gUnknown_02039F74[i].id = -2; + StringCopy(sItemNames[i], gText_Cancel2); + sListMenuItems[i].name = sItemNames[i]; + sListMenuItems[i].id = LIST_CANCEL; gMultiuseListMenuTemplate = sShopBuyMenuListTemplate; - gMultiuseListMenuTemplate.items = gUnknown_02039F74; - gMultiuseListMenuTemplate.totalItems = gMartInfo.itemCount + 1; + gMultiuseListMenuTemplate.items = sListMenuItems; + gMultiuseListMenuTemplate.totalItems = sMartInfo.itemCount + 1; if (gMultiuseListMenuTemplate.totalItems > 8) gMultiuseListMenuTemplate.maxShowed = 8; else gMultiuseListMenuTemplate.maxShowed = gMultiuseListMenuTemplate.totalItems; - gShopDataPtr->itemsShowed = gMultiuseListMenuTemplate.maxShowed; + sShopData->itemsShowed = gMultiuseListMenuTemplate.maxShowed; } static void BuyMenuSetListEntry(struct ListMenuItem *menuItem, u16 item, u8 *name) { - if (gMartInfo.martType == MART_TYPE_NORMAL) + if (sMartInfo.martType == MART_TYPE_NORMAL) CopyItemName(item, name); else StringCopy(name, gDecorations[item].name); @@ -527,16 +530,16 @@ static void BuyMenuPrintItemDescriptionAndShowItemIcon(s32 item, bool8 onInit, s if (onInit != TRUE) PlaySE(SE_SELECT); - if (item != -2) - BuyMenuAddItemIcon(item, gShopDataPtr->iconSlot); + if (item != LIST_CANCEL) + BuyMenuAddItemIcon(item, sShopData->iconSlot); else - BuyMenuAddItemIcon(-1, gShopDataPtr->iconSlot); + BuyMenuAddItemIcon(-1, sShopData->iconSlot); - BuyMenuRemoveItemIcon(item, gShopDataPtr->iconSlot ^ 1); - gShopDataPtr->iconSlot ^= 1; - if (item != -2) + BuyMenuRemoveItemIcon(item, sShopData->iconSlot ^ 1); + sShopData->iconSlot ^= 1; + if (item != LIST_CANCEL) { - if (gMartInfo.martType == MART_TYPE_NORMAL) + if (sMartInfo.martType == MART_TYPE_NORMAL) description = ItemId_GetDescription(item); else description = gDecorations[item].description; @@ -554,9 +557,9 @@ static void BuyMenuPrintPriceInList(u8 windowId, s32 item, u8 y) { u8 x; - if (item != -2) + if (item != LIST_CANCEL) { - if (gMartInfo.martType == MART_TYPE_NORMAL) + if (sMartInfo.martType == MART_TYPE_NORMAL) { ConvertIntToDecimalStringN( gStringVar1, @@ -581,26 +584,26 @@ static void BuyMenuPrintPriceInList(u8 windowId, s32 item, u8 y) static void BuyMenuAddScrollIndicatorArrows(void) { - if (gShopDataPtr->scrollIndicatorsTaskId == TASK_NONE && gMartInfo.itemCount + 1 > 8) + if (sShopData->scrollIndicatorsTaskId == TASK_NONE && sMartInfo.itemCount + 1 > 8) { - gShopDataPtr->scrollIndicatorsTaskId = AddScrollIndicatorArrowPairParameterized( + sShopData->scrollIndicatorsTaskId = AddScrollIndicatorArrowPairParameterized( SCROLL_ARROW_UP, - 0xAC, - 0xC, - 0x94, - gMartInfo.itemCount - 7, - 2100, - 2100, - &gShopDataPtr->scrollOffset); + 172, + 12, + 148, + sMartInfo.itemCount - 7, + TAG_SCROLL_ARROW, + TAG_SCROLL_ARROW, + &sShopData->scrollOffset); } } static void BuyMenuRemoveScrollIndicatorArrows(void) { - if (gShopDataPtr->scrollIndicatorsTaskId != TASK_NONE) + if (sShopData->scrollIndicatorsTaskId != TASK_NONE) { - RemoveScrollIndicatorArrowPair(gShopDataPtr->scrollIndicatorsTaskId); - gShopDataPtr->scrollIndicatorsTaskId = TASK_NONE; + RemoveScrollIndicatorArrowPair(sShopData->scrollIndicatorsTaskId); + sShopData->scrollIndicatorsTaskId = TASK_NONE; } } @@ -613,13 +616,13 @@ static void BuyMenuPrintCursor(u8 scrollIndicatorsTaskId, u8 colorSet) static void BuyMenuAddItemIcon(u16 item, u8 iconSlot) { u8 spriteId; - u8 *spriteIdPtr = &gShopDataPtr->itemSpriteIds[iconSlot]; + u8 *spriteIdPtr = &sShopData->itemSpriteIds[iconSlot]; if (*spriteIdPtr != SPRITE_NONE) return; - if (gMartInfo.martType == MART_TYPE_NORMAL || item == 0xFFFF) + if (sMartInfo.martType == MART_TYPE_NORMAL || item == 0xFFFF) { - spriteId = AddItemIconSprite(iconSlot + 2110, iconSlot + 2110, item); + spriteId = AddItemIconSprite(iconSlot + TAG_ITEM_ICON_BASE, iconSlot + TAG_ITEM_ICON_BASE, item); if (spriteId != MAX_SPRITES) { *spriteIdPtr = spriteId; @@ -629,7 +632,7 @@ static void BuyMenuAddItemIcon(u16 item, u8 iconSlot) } else { - spriteId = AddDecorationIconObject(item, 20, 84, 1, iconSlot + 2110, iconSlot + 2110); + spriteId = AddDecorationIconObject(item, 20, 84, 1, iconSlot + TAG_ITEM_ICON_BASE, iconSlot + TAG_ITEM_ICON_BASE); if (spriteId != MAX_SPRITES) *spriteIdPtr = spriteId; } @@ -637,12 +640,12 @@ static void BuyMenuAddItemIcon(u16 item, u8 iconSlot) static void BuyMenuRemoveItemIcon(u16 item, u8 iconSlot) { - u8 *spriteIdPtr = &gShopDataPtr->itemSpriteIds[iconSlot]; + u8 *spriteIdPtr = &sShopData->itemSpriteIds[iconSlot]; if (*spriteIdPtr == SPRITE_NONE) return; - FreeSpriteTilesByTag(iconSlot + 2110); - FreeSpritePaletteByTag(iconSlot + 2110); + FreeSpriteTilesByTag(iconSlot + TAG_ITEM_ICON_BASE); + FreeSpritePaletteByTag(iconSlot + TAG_ITEM_ICON_BASE); DestroySprite(&gSprites[*spriteIdPtr]); *spriteIdPtr = SPRITE_NONE; } @@ -651,9 +654,9 @@ static void BuyMenuInitBgs(void) { ResetBgsAndClearDma3BusyFlags(0); InitBgsFromTemplates(0, sShopBuyMenuBgTemplates, ARRAY_COUNT(sShopBuyMenuBgTemplates)); - SetBgTilemapBuffer(1, gShopDataPtr->tilemapBuffers[1]); - SetBgTilemapBuffer(2, gShopDataPtr->tilemapBuffers[3]); - SetBgTilemapBuffer(3, gShopDataPtr->tilemapBuffers[2]); + SetBgTilemapBuffer(1, sShopData->tilemapBuffers[1]); + SetBgTilemapBuffer(2, sShopData->tilemapBuffers[3]); + SetBgTilemapBuffer(3, sShopData->tilemapBuffers[2]); SetGpuReg(REG_OFFSET_BG0HOFS, 0); SetGpuReg(REG_OFFSET_BG0VOFS, 0); SetGpuReg(REG_OFFSET_BG1HOFS, 0); @@ -673,7 +676,7 @@ static void BuyMenuInitBgs(void) static void BuyMenuDecompressBgGraphics(void) { DecompressAndCopyTileDataToVram(1, gBuyMenuFrame_Gfx, 0x3A0, 0x3E3, 0); - LZDecompressWram(gBuyMenuFrame_Tilemap, gShopDataPtr->tilemapBuffers[0]); + LZDecompressWram(gBuyMenuFrame_Tilemap, sShopData->tilemapBuffers[0]); LoadCompressedPalette(gMenuMoneyPal, 0xC0, 0x20); } @@ -763,16 +766,16 @@ static void BuyMenuDrawMapMetatile(s16 x, s16 y, const u16 *src, u8 metatileLaye switch (metatileLayerType) { case 0: - BuyMenuDrawMapMetatileLayer(gShopDataPtr->tilemapBuffers[3], offset1, offset2, src); - BuyMenuDrawMapMetatileLayer(gShopDataPtr->tilemapBuffers[1], offset1, offset2, src + 4); + BuyMenuDrawMapMetatileLayer(sShopData->tilemapBuffers[3], offset1, offset2, src); + BuyMenuDrawMapMetatileLayer(sShopData->tilemapBuffers[1], offset1, offset2, src + 4); break; case 1: - BuyMenuDrawMapMetatileLayer(gShopDataPtr->tilemapBuffers[2], offset1, offset2, src); - BuyMenuDrawMapMetatileLayer(gShopDataPtr->tilemapBuffers[3], offset1, offset2, src + 4); + BuyMenuDrawMapMetatileLayer(sShopData->tilemapBuffers[2], offset1, offset2, src); + BuyMenuDrawMapMetatileLayer(sShopData->tilemapBuffers[3], offset1, offset2, src + 4); break; case 2: - BuyMenuDrawMapMetatileLayer(gShopDataPtr->tilemapBuffers[2], offset1, offset2, src); - BuyMenuDrawMapMetatileLayer(gShopDataPtr->tilemapBuffers[1], offset1, offset2, src + 4); + BuyMenuDrawMapMetatileLayer(sShopData->tilemapBuffers[2], offset1, offset2, src); + BuyMenuDrawMapMetatileLayer(sShopData->tilemapBuffers[1], offset1, offset2, src + 4); break; } } @@ -796,7 +799,7 @@ static void BuyMenuCollectObjectEventData(void) GetXYCoordsOneStepInFrontOfPlayer(&facingX, &facingY); for (y = 0; y < OBJECT_EVENTS_COUNT; y++) - gShopDataPtr->viewportObjects[y][OBJ_EVENT_ID] = OBJECT_EVENTS_COUNT; + sShopData->viewportObjects[y][OBJ_EVENT_ID] = OBJECT_EVENTS_COUNT; for (y = 0; y < 5; y++) { for (x = 0; x < 7; x++) @@ -805,25 +808,25 @@ static void BuyMenuCollectObjectEventData(void) if (objEventId != OBJECT_EVENTS_COUNT) { - gShopDataPtr->viewportObjects[r8][OBJ_EVENT_ID] = objEventId; - gShopDataPtr->viewportObjects[r8][X_COORD] = x; - gShopDataPtr->viewportObjects[r8][Y_COORD] = y; - gShopDataPtr->viewportObjects[r8][LAYER_TYPE] = MapGridGetMetatileLayerTypeAt(facingX - 4 + x, facingY - 2 + y); + sShopData->viewportObjects[r8][OBJ_EVENT_ID] = objEventId; + sShopData->viewportObjects[r8][X_COORD] = x; + sShopData->viewportObjects[r8][Y_COORD] = y; + sShopData->viewportObjects[r8][LAYER_TYPE] = MapGridGetMetatileLayerTypeAt(facingX - 4 + x, facingY - 2 + y); switch (gObjectEvents[objEventId].facingDirection) { case DIR_SOUTH: - gShopDataPtr->viewportObjects[r8][ANIM_NUM] = 0; + sShopData->viewportObjects[r8][ANIM_NUM] = 0; break; case DIR_NORTH: - gShopDataPtr->viewportObjects[r8][ANIM_NUM] = 1; + sShopData->viewportObjects[r8][ANIM_NUM] = 1; break; case DIR_WEST: - gShopDataPtr->viewportObjects[r8][ANIM_NUM] = 2; + sShopData->viewportObjects[r8][ANIM_NUM] = 2; break; case DIR_EAST: default: - gShopDataPtr->viewportObjects[r8][ANIM_NUM] = 3; + sShopData->viewportObjects[r8][ANIM_NUM] = 3; break; } r8++; @@ -840,25 +843,25 @@ static void BuyMenuDrawObjectEvents(void) for (i = 0; i < OBJECT_EVENTS_COUNT; i++) { - if (gShopDataPtr->viewportObjects[i][OBJ_EVENT_ID] == OBJECT_EVENTS_COUNT) + if (sShopData->viewportObjects[i][OBJ_EVENT_ID] == OBJECT_EVENTS_COUNT) continue; - graphicsInfo = GetObjectEventGraphicsInfo(gObjectEvents[gShopDataPtr->viewportObjects[i][OBJ_EVENT_ID]].graphicsId); + graphicsInfo = GetObjectEventGraphicsInfo(gObjectEvents[sShopData->viewportObjects[i][OBJ_EVENT_ID]].graphicsId); spriteId = AddPseudoObjectEvent( - gObjectEvents[gShopDataPtr->viewportObjects[i][OBJ_EVENT_ID]].graphicsId, + gObjectEvents[sShopData->viewportObjects[i][OBJ_EVENT_ID]].graphicsId, SpriteCallbackDummy, - (u16)gShopDataPtr->viewportObjects[i][X_COORD] * 16 + 8, - (u16)gShopDataPtr->viewportObjects[i][Y_COORD] * 16 + 48 - graphicsInfo->height / 2, + (u16)sShopData->viewportObjects[i][X_COORD] * 16 + 8, + (u16)sShopData->viewportObjects[i][Y_COORD] * 16 + 48 - graphicsInfo->height / 2, 2); - if (BuyMenuCheckIfObjectEventOverlapsMenuBg(gShopDataPtr->viewportObjects[i]) == TRUE) + if (BuyMenuCheckIfObjectEventOverlapsMenuBg(sShopData->viewportObjects[i]) == TRUE) { gSprites[spriteId].subspriteTableNum = 4; gSprites[spriteId].subspriteMode = SUBSPRITES_ON; } - StartSpriteAnim(&gSprites[spriteId], gShopDataPtr->viewportObjects[i][ANIM_NUM]); + StartSpriteAnim(&gSprites[spriteId], sShopData->viewportObjects[i][ANIM_NUM]); } } @@ -877,8 +880,8 @@ static bool8 BuyMenuCheckIfObjectEventOverlapsMenuBg(s16 *object) static void BuyMenuCopyMenuBgToBg1TilemapBuffer(void) { s16 i; - u16 *dest = gShopDataPtr->tilemapBuffers[1]; - const u16 *src = gShopDataPtr->tilemapBuffers[0]; + u16 *dest = sShopData->tilemapBuffers[1]; + const u16 *src = sShopData->tilemapBuffers[0]; for (i = 0; i < 1024; i++) { @@ -891,7 +894,7 @@ static void BuyMenuCopyMenuBgToBg1TilemapBuffer(void) static bool8 BuyMenuCheckForOverlapWithMenuBg(int x, int y) { - const u16 *metatile = gShopDataPtr->tilemapBuffers[0]; + const u16 *metatile = sShopData->tilemapBuffers[0]; int offset1 = x * 2; int offset2 = y * 64; @@ -913,7 +916,7 @@ static void Task_BuyMenu(u8 taskId) if (!gPaletteFade.active) { s32 itemId = ListMenu_ProcessInput(tListTaskId); - ListMenuGetScrollAndRow(tListTaskId, &gShopDataPtr->scrollOffset, &gShopDataPtr->selectedRow); + ListMenuGetScrollAndRow(tListTaskId, &sShopData->scrollOffset, &sShopData->selectedRow); switch (itemId) { @@ -930,22 +933,22 @@ static void Task_BuyMenu(u8 taskId) BuyMenuRemoveScrollIndicatorArrows(); BuyMenuPrintCursor(tListTaskId, 2); - if (gMartInfo.martType == MART_TYPE_NORMAL) + if (sMartInfo.martType == MART_TYPE_NORMAL) { - gShopDataPtr->totalCost = (ItemId_GetPrice(itemId) >> GetPriceReduction(POKENEWS_SLATEPORT)); + sShopData->totalCost = (ItemId_GetPrice(itemId) >> GetPriceReduction(POKENEWS_SLATEPORT)); } else { - gShopDataPtr->totalCost = gDecorations[itemId].price; + sShopData->totalCost = gDecorations[itemId].price; } - if (!IsEnoughMoney(&gSaveBlock1Ptr->money, gShopDataPtr->totalCost)) + if (!IsEnoughMoney(&gSaveBlock1Ptr->money, sShopData->totalCost)) { BuyMenuDisplayMessage(taskId, gText_YouDontHaveMoney, BuyMenuReturnToItemList); } else { - if (gMartInfo.martType == MART_TYPE_NORMAL) + if (sMartInfo.martType == MART_TYPE_NORMAL) { CopyItemName(itemId, gStringVar1); if (ItemId_GetPocket(itemId) == POCKET_TM_HM) @@ -961,9 +964,9 @@ static void Task_BuyMenu(u8 taskId) else { StringCopy(gStringVar1, gDecorations[itemId].name); - ConvertIntToDecimalStringN(gStringVar2, gShopDataPtr->totalCost, STR_CONV_MODE_LEFT_ALIGN, 6); + ConvertIntToDecimalStringN(gStringVar2, sShopData->totalCost, STR_CONV_MODE_LEFT_ALIGN, 6); - if (gMartInfo.martType == MART_TYPE_DECOR) + if (sMartInfo.martType == MART_TYPE_DECOR) StringExpandPlaceholders(gStringVar4, gText_Var1IsItThatllBeVar2); else // MART_TYPE_DECOR2 StringExpandPlaceholders(gStringVar4, gText_YouWantedVar1ThatllBeVar2); @@ -992,15 +995,15 @@ static void Task_BuyHowManyDialogueInit(u8 taskId) BuyMenuPrintItemQuantityAndPrice(taskId); ScheduleBgCopyTilemapToVram(0); - maxQuantity = GetMoney(&gSaveBlock1Ptr->money) / gShopDataPtr->totalCost; + maxQuantity = GetMoney(&gSaveBlock1Ptr->money) / sShopData->totalCost; if (maxQuantity > MAX_BAG_ITEM_CAPACITY) { - gShopDataPtr->maxQuantity = MAX_BAG_ITEM_CAPACITY; + sShopData->maxQuantity = MAX_BAG_ITEM_CAPACITY; } else { - gShopDataPtr->maxQuantity = maxQuantity; + sShopData->maxQuantity = maxQuantity; } gTasks[taskId].func = Task_BuyHowManyDialogueHandleInput; @@ -1010,9 +1013,9 @@ static void Task_BuyHowManyDialogueHandleInput(u8 taskId) { s16 *data = gTasks[taskId].data; - if (AdjustQuantityAccordingToDPadInput(&tItemCount, gShopDataPtr->maxQuantity) == TRUE) + if (AdjustQuantityAccordingToDPadInput(&tItemCount, sShopData->maxQuantity) == TRUE) { - gShopDataPtr->totalCost = (ItemId_GetPrice(tItemId) >> GetPriceReduction(POKENEWS_SLATEPORT)) * tItemCount; + sShopData->totalCost = (ItemId_GetPrice(tItemId) >> GetPriceReduction(POKENEWS_SLATEPORT)) * tItemCount; BuyMenuPrintItemQuantityAndPrice(taskId); } else @@ -1027,7 +1030,7 @@ static void Task_BuyHowManyDialogueHandleInput(u8 taskId) PutWindowTilemap(1); CopyItemName(tItemId, gStringVar1); ConvertIntToDecimalStringN(gStringVar2, tItemCount, STR_CONV_MODE_LEFT_ALIGN, BAG_ITEM_CAPACITY_DIGITS); - ConvertIntToDecimalStringN(gStringVar3, gShopDataPtr->totalCost, STR_CONV_MODE_LEFT_ALIGN, 6); + ConvertIntToDecimalStringN(gStringVar3, sShopData->totalCost, STR_CONV_MODE_LEFT_ALIGN, 6); BuyMenuDisplayMessage(taskId, gText_Var1AndYouWantedVar2, BuyMenuConfirmPurchase); } else if (JOY_NEW(B_BUTTON)) @@ -1053,7 +1056,7 @@ static void BuyMenuTryMakePurchase(u8 taskId) PutWindowTilemap(1); - if (gMartInfo.martType == MART_TYPE_NORMAL) + if (sMartInfo.martType == MART_TYPE_NORMAL) { if (AddBagItem(tItemId, tItemCount) == TRUE) { @@ -1069,7 +1072,7 @@ static void BuyMenuTryMakePurchase(u8 taskId) { if (DecorationAdd(tItemId)) { - if (gMartInfo.martType == MART_TYPE_DECOR) + if (sMartInfo.martType == MART_TYPE_DECOR) BuyMenuDisplayMessage(taskId, gText_ThankYouIllSendItHome, BuyMenuSubtractMoney); else // MART_TYPE_DECOR2 BuyMenuDisplayMessage(taskId, gText_ThanksIllSendItHome, BuyMenuSubtractMoney); @@ -1084,11 +1087,11 @@ static void BuyMenuTryMakePurchase(u8 taskId) static void BuyMenuSubtractMoney(u8 taskId) { IncrementGameStat(GAME_STAT_SHOPPED); - RemoveMoney(&gSaveBlock1Ptr->money, gShopDataPtr->totalCost); + RemoveMoney(&gSaveBlock1Ptr->money, sShopData->totalCost); PlaySE(SE_SHOP); PrintMoneyAmountInMoneyBox(0, GetMoney(&gSaveBlock1Ptr->money), 0); - if (gMartInfo.martType == MART_TYPE_NORMAL) + if (sMartInfo.martType == MART_TYPE_NORMAL) { gTasks[taskId].func = Task_ReturnToItemListAfterItemPurchase; } @@ -1143,7 +1146,7 @@ static void BuyMenuPrintItemQuantityAndPrice(u8 taskId) s16 *data = gTasks[taskId].data; FillWindowPixelBuffer(4, PIXEL_FILL(1)); - PrintMoneyAmount(4, 38, 1, gShopDataPtr->totalCost, TEXT_SPEED_FF); + PrintMoneyAmount(4, 38, 1, sShopData->totalCost, TEXT_SPEED_FF); ConvertIntToDecimalStringN(gStringVar1, tItemCount, STR_CONV_MODE_LEADING_ZEROS, BAG_ITEM_CAPACITY_DIGITS); StringExpandPlaceholders(gStringVar4, gText_xVar1); BuyMenuPrint(4, gStringVar4, 0, 1, 0, 0); @@ -1169,7 +1172,7 @@ static void Task_ExitBuyMenu(u8 taskId) static void ClearItemPurchases(void) { - gMartPurchaseHistoryId = 0; + sPurchaseHistoryId = 0; memset(gMartPurchaseHistory, 0, sizeof(gMartPurchaseHistory)); } @@ -1179,27 +1182,23 @@ static void RecordItemPurchase(u8 taskId) u16 i; - for (i = 0; i < 3; i++) + for (i = 0; i < ARRAY_COUNT(gMartPurchaseHistory); i++) { if (gMartPurchaseHistory[i].itemId == tItemId && gMartPurchaseHistory[i].quantity != 0) { if (gMartPurchaseHistory[i].quantity + tItemCount > 255) - { gMartPurchaseHistory[i].quantity = 255; - } else - { gMartPurchaseHistory[i].quantity += tItemCount; - } return; } } - if (gMartPurchaseHistoryId < 3) + if (sPurchaseHistoryId < ARRAY_COUNT(gMartPurchaseHistory)) { - gMartPurchaseHistory[gMartPurchaseHistoryId].itemId = tItemId; - gMartPurchaseHistory[gMartPurchaseHistoryId].quantity = tItemCount; - gMartPurchaseHistoryId++; + gMartPurchaseHistory[sPurchaseHistoryId].itemId = tItemId; + gMartPurchaseHistory[sPurchaseHistoryId].quantity = tItemCount; + sPurchaseHistoryId++; } } diff --git a/src/start_menu.c b/src/start_menu.c index 26a5097a6..2316b85b6 100644 --- a/src/start_menu.c +++ b/src/start_menu.c @@ -170,7 +170,7 @@ static const struct MenuAction sStartMenuItems[] = {gText_MenuBag, {.u8_void = StartMenuBattlePyramidBagCallback}} }; -static const struct BgTemplate sUnknown_085105A8[] = +static const struct BgTemplate sBgTemplates_LinkBattleSave[] = { { .bg = 0, @@ -183,13 +183,29 @@ static const struct BgTemplate sUnknown_085105A8[] = } }; -static const struct WindowTemplate sUnknown_085105AC[] = +static const struct WindowTemplate sWindowTemplates_LinkBattleSave[] = { - {0, 2, 0xF, 0x1A, 4, 0xF, 0x194}, + { + .bg = 0, + .tilemapLeft = 2, + .tilemapTop = 15, + .width = 26, + .height = 4, + .paletteNum = 15, + .baseBlock = 0x194 + }, DUMMY_WIN_TEMPLATE }; -static const struct WindowTemplate sSaveInfoWindowTemplate = {0, 1, 1, 0xE, 0xA, 0xF, 8}; +static const struct WindowTemplate sSaveInfoWindowTemplate = { + .bg = 0, + .tilemapLeft = 1, + .tilemapTop = 1, + .width = 14, + .height = 10, + .paletteNum = 15, + .baseBlock = 8 +}; // Local functions static void BuildStartMenuActions(void); @@ -211,13 +227,13 @@ static void CreateStartMenuTask(TaskFunc followupFunc); static void InitSave(void); static u8 RunSaveCallback(void); static void ShowSaveMessage(const u8 *message, u8 (*saveCallback)(void)); -static void sub_80A0014(void); +static void HideSaveMessageWindow(void); static void HideSaveInfoWindow(void); static void SaveStartTimer(void); static bool8 SaveSuccesTimer(void); static bool8 SaveErrorTimer(void); static void InitBattlePyramidRetire(void); -static void sub_80A03D8(void); +static void VBlankCB_LinkBattleSave(void); static bool32 InitSaveWindowAfterLinkBattle(u8 *par1); static void CB2_SaveAfterLinkBattle(void); static void ShowSaveInfoWindow(void); @@ -887,7 +903,7 @@ static void SaveGameTask(u8 taskId) EnableBothScriptContexts(); } -static void sub_80A0014(void) +static void HideSaveMessageWindow(void) { ClearDialogWindowAndFrame(0, TRUE); } @@ -982,7 +998,7 @@ static u8 SaveConfirmInputCallback(void) case -1: // B Button case 1: // No HideSaveInfoWindow(); - sub_80A0014(); + HideSaveMessageWindow(); return SAVE_CANCELED; } @@ -1028,7 +1044,7 @@ static u8 SaveOverwriteInputCallback(void) case -1: // B Button case 1: // No HideSaveInfoWindow(); - sub_80A0014(); + HideSaveMessageWindow(); return SAVE_CANCELED; } @@ -1146,14 +1162,14 @@ static u8 BattlePyramidRetireInputCallback(void) return SAVE_CANCELED; case -1: // B Button case 1: // No - sub_80A0014(); + HideSaveMessageWindow(); return SAVE_SUCCESS; } return SAVE_IN_PROGRESS; } -static void sub_80A03D8(void) +static void VBlankCB_LinkBattleSave(void) { TransferPlttBuffer(); } @@ -1167,7 +1183,7 @@ static bool32 InitSaveWindowAfterLinkBattle(u8 *state) SetVBlankCallback(NULL); ScanlineEffect_Stop(); DmaClear16(3, PLTT, PLTT_SIZE); - DmaFillLarge16(3, 0, (void *)(VRAM + 0x0), 0x18000, 0x1000); + DmaFillLarge16(3, 0, (void *)VRAM, VRAM_SIZE, 0x1000); break; case 1: ResetSpriteData(); @@ -1177,15 +1193,15 @@ static bool32 InitSaveWindowAfterLinkBattle(u8 *state) break; case 2: ResetBgsAndClearDma3BusyFlags(0); - InitBgsFromTemplates(0, sUnknown_085105A8, ARRAY_COUNT(sUnknown_085105A8)); - InitWindows(sUnknown_085105AC); + InitBgsFromTemplates(0, sBgTemplates_LinkBattleSave, ARRAY_COUNT(sBgTemplates_LinkBattleSave)); + InitWindows(sWindowTemplates_LinkBattleSave); LoadUserWindowBorderGfx_(0, 8, 224); Menu_LoadStdPalAt(240); break; case 3: ShowBg(0); BlendPalettes(-1, 16, 0); - SetVBlankCallback(sub_80A03D8); + SetVBlankCallback(VBlankCB_LinkBattleSave); EnableInterrupts(1); break; case 4: diff --git a/src/trade.c b/src/trade.c index a42c9c805..0e5110a58 100644 --- a/src/trade.c +++ b/src/trade.c @@ -1160,12 +1160,12 @@ static void ReactToLinkTradeData(u8 mpId, u8 status) { switch (gBlockRecvBuffer[0][0]) { - case LINKCMD_CANCEL_TRADE: + case LINKCMD_BOTH_CANCEL_TRADE: BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); PrintTradeMessage(TRADE_MSG_WAITING_FOR_FRIEND); sTradeMenuData->tradeMenuFunc = TRADEMENUFUNC_CANCEL_TRADE_1; break; - case LINKCMD_0xEECC: + case LINKCMD_PARTNER_CANCEL_TRADE: PrintTradeMessage(TRADE_MSG_FRIEND_WANTS_TO_TRADE); sTradeMenuData->tradeMenuFunc = TRADEMENUFUNC_REDRAW_MAIN_MENU; break; @@ -1180,7 +1180,7 @@ static void ReactToLinkTradeData(u8 mpId, u8 status) BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); sTradeMenuData->tradeMenuFunc = TRADEMENUFUNC_LINK_TRADE_WAIT_FADE; break; - case LINKCMD_0xDDEE: + case LINKCMD_PLAYER_CANCEL_TRADE: PrintTradeMessage(TRADE_MSG_CANCELED); sTradeMenuData->tradeMenuFunc = TRADEMENUFUNC_REDRAW_MAIN_MENU; } @@ -1208,7 +1208,7 @@ static void QueueLinkTradeData(void) && sTradeMenuData->partnerLinkFlagChoseAction == WANTS_TO_CANCEL) { PrintTradeMessage(TRADE_MSG_CANCELED); - sTradeMenuData->linkData[0] = LINKCMD_0xEECC; + sTradeMenuData->linkData[0] = LINKCMD_PARTNER_CANCEL_TRADE; sTradeMenuData->linkData[1] = 0; QueueAction(QUEUE_DELAY_DATA, QUEUE_SEND_DATA); sTradeMenuData->playerLinkFlagStatus = sTradeMenuData->partnerLinkFlagStatus = 0; @@ -1219,7 +1219,7 @@ static void QueueLinkTradeData(void) && sTradeMenuData->partnerLinkFlagChoseAction == WANTS_TO_TRADE) { PrintTradeMessage(TRADE_MSG_FRIEND_WANTS_TO_TRADE); - sTradeMenuData->linkData[0] = LINKCMD_0xDDEE; + sTradeMenuData->linkData[0] = LINKCMD_PLAYER_CANCEL_TRADE; sTradeMenuData->linkData[1] = 0; QueueAction(QUEUE_DELAY_DATA, QUEUE_SEND_DATA); sTradeMenuData->playerLinkFlagStatus = sTradeMenuData->partnerLinkFlagStatus = 0; @@ -1229,7 +1229,7 @@ static void QueueLinkTradeData(void) else if (sTradeMenuData->playerLinkFlagChoseAction == WANTS_TO_CANCEL && sTradeMenuData->partnerLinkFlagChoseAction == WANTS_TO_CANCEL) { - sTradeMenuData->linkData[0] = LINKCMD_CANCEL_TRADE; + sTradeMenuData->linkData[0] = LINKCMD_BOTH_CANCEL_TRADE; sTradeMenuData->linkData[1] = 0; QueueAction(QUEUE_DELAY_DATA, QUEUE_SEND_DATA); BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); @@ -1255,7 +1255,7 @@ static void QueueLinkTradeData(void) || sTradeMenuData->partnerLinkFlagStatus == CANCEL_TRADE) { PrintTradeMessage(TRADE_MSG_CANCELED); - sTradeMenuData->linkData[0] = LINKCMD_0xDDEE; + sTradeMenuData->linkData[0] = LINKCMD_PLAYER_CANCEL_TRADE; sTradeMenuData->linkData[1] = 0; QueueAction(QUEUE_DELAY_DATA, QUEUE_SEND_DATA); sTradeMenuData->playerLinkFlagStatus = 0; diff --git a/src/trainer_card.c b/src/trainer_card.c index c42c16845..91a8047df 100755 --- a/src/trainer_card.c +++ b/src/trainer_card.c @@ -80,7 +80,7 @@ struct TrainerCardData u8 cardTiles[0x2300]; u16 cardTilemapBuffer[0x1000]; u16 bgTilemapBuffer[0x1000]; - u16 var_7CA8; + u16 cardTop; u8 language; }; @@ -113,7 +113,7 @@ static void SetPlayerCardData(struct TrainerCard*, u8); static void TrainerCard_GenerateCardForLinkPlayer(struct TrainerCard*); static u8 VersionToCardType(u8); static void SetDataFromTrainerCard(void); -static void HandleGpuRegs(void); +static void InitGpuRegs(void); static void ResetGpuRegs(void); static void InitBgsAndWindows(void); static void SetTrainerCardCb2(void); @@ -158,31 +158,30 @@ static bool8 Task_DrawFlippedCardSide(struct Task* task); static bool8 Task_SetCardFlipped(struct Task* task); static bool8 Task_AnimateCardFlipUp(struct Task* task); static bool8 Task_EndCardFlip(struct Task* task); -static void sub_80C32EC(u16); +static void UpdateCardFlipRegs(u16); static void LoadMonIconGfx(void); -// const rom data -static const u32 sTrainerCardStickers_Gfx[] = INCBIN_U32("graphics/trainer_card/stickers_fr.4bpp.lz"); -static const u16 sUnused_0856F18C[] = INCBIN_U16("graphics/trainer_card/unknown_56F18C.gbapal"); -static const u16 sHoennTrainerCard1Star_Pal[] = INCBIN_U16("graphics/trainer_card/one_star.gbapal"); -static const u16 sKantoTrainerCard1Star_Pal[] = INCBIN_U16("graphics/trainer_card/one_star_fr.gbapal"); -static const u16 sHoennTrainerCard2Star_Pal[] = INCBIN_U16("graphics/trainer_card/two_stars.gbapal"); -static const u16 sKantoTrainerCard2Star_Pal[] = INCBIN_U16("graphics/trainer_card/two_stars_fr.gbapal"); -static const u16 sHoennTrainerCard3Star_Pal[] = INCBIN_U16("graphics/trainer_card/three_stars.gbapal"); -static const u16 sKantoTrainerCard3Star_Pal[] = INCBIN_U16("graphics/trainer_card/three_stars_fr.gbapal"); -static const u16 sHoennTrainerCard4Star_Pal[] = INCBIN_U16("graphics/trainer_card/four_stars.gbapal"); -static const u16 sKantoTrainerCard4Star_Pal[] = INCBIN_U16("graphics/trainer_card/four_stars_fr.gbapal"); +static const u32 sTrainerCardStickers_Gfx[] = INCBIN_U32("graphics/trainer_card/stickers_fr.4bpp.lz"); +static const u16 sUnused_Pal[] = INCBIN_U16("graphics/trainer_card/unused.gbapal"); +static const u16 sHoennTrainerCard1Star_Pal[] = INCBIN_U16("graphics/trainer_card/one_star.gbapal"); +static const u16 sKantoTrainerCard1Star_Pal[] = INCBIN_U16("graphics/trainer_card/one_star_fr.gbapal"); +static const u16 sHoennTrainerCard2Star_Pal[] = INCBIN_U16("graphics/trainer_card/two_stars.gbapal"); +static const u16 sKantoTrainerCard2Star_Pal[] = INCBIN_U16("graphics/trainer_card/two_stars_fr.gbapal"); +static const u16 sHoennTrainerCard3Star_Pal[] = INCBIN_U16("graphics/trainer_card/three_stars.gbapal"); +static const u16 sKantoTrainerCard3Star_Pal[] = INCBIN_U16("graphics/trainer_card/three_stars_fr.gbapal"); +static const u16 sHoennTrainerCard4Star_Pal[] = INCBIN_U16("graphics/trainer_card/four_stars.gbapal"); +static const u16 sKantoTrainerCard4Star_Pal[] = INCBIN_U16("graphics/trainer_card/four_stars_fr.gbapal"); static const u16 sHoennTrainerCardFemaleBg_Pal[] = INCBIN_U16("graphics/trainer_card/female_bg.gbapal"); static const u16 sKantoTrainerCardFemaleBg_Pal[] = INCBIN_U16("graphics/trainer_card/female_bg_fr.gbapal"); -static const u16 sHoennTrainerCardBadges_Pal[] = INCBIN_U16("graphics/trainer_card/badges.gbapal"); -static const u16 sKantoTrainerCardBadges_Pal[] = INCBIN_U16("graphics/trainer_card/badges_fr.gbapal"); -static const u16 sTrainerCardGold_Pal[] = INCBIN_U16("graphics/trainer_card/gold.gbapal"); -static const u16 sTrainerCardSticker1_Pal[] = INCBIN_U16("graphics/trainer_card/stickers_fr1.gbapal"); -static const u16 sTrainerCardSticker2_Pal[] = INCBIN_U16("graphics/trainer_card/stickers_fr2.gbapal"); -static const u16 sTrainerCardSticker3_Pal[] = INCBIN_U16("graphics/trainer_card/stickers_fr3.gbapal"); -static const u16 sTrainerCardSticker4_Pal[] = INCBIN_U16("graphics/trainer_card/stickers_fr4.gbapal"); -static const u32 sHoennTrainerCardBadges_Gfx[] = INCBIN_U32("graphics/trainer_card/badges.4bpp.lz"); -static const u32 sKantoTrainerCardBadges_Gfx[] = INCBIN_U32("graphics/trainer_card/badges_fr.4bpp.lz"); +static const u16 sHoennTrainerCardBadges_Pal[] = INCBIN_U16("graphics/trainer_card/badges.gbapal"); +static const u16 sKantoTrainerCardBadges_Pal[] = INCBIN_U16("graphics/trainer_card/badges_fr.gbapal"); +static const u16 sTrainerCardGold_Pal[] = INCBIN_U16("graphics/trainer_card/gold.gbapal"); +static const u16 sTrainerCardSticker1_Pal[] = INCBIN_U16("graphics/trainer_card/stickers_fr1.gbapal"); +static const u16 sTrainerCardSticker2_Pal[] = INCBIN_U16("graphics/trainer_card/stickers_fr2.gbapal"); +static const u16 sTrainerCardSticker3_Pal[] = INCBIN_U16("graphics/trainer_card/stickers_fr3.gbapal"); +static const u16 sTrainerCardSticker4_Pal[] = INCBIN_U16("graphics/trainer_card/stickers_fr4.gbapal"); +static const u32 sHoennTrainerCardBadges_Gfx[] = INCBIN_U32("graphics/trainer_card/badges.4bpp.lz"); +static const u32 sKantoTrainerCardBadges_Gfx[] = INCBIN_U32("graphics/trainer_card/badges_fr.4bpp.lz"); static const struct BgTemplate sTrainerCardBgTemplates[4] = { @@ -321,7 +320,6 @@ static bool8 (*const sTrainerCardFlipTasks[])(struct Task *) = Task_EndCardFlip, }; -// code static void VblankCb_TrainerCard(void) { LoadOam(); @@ -620,7 +618,7 @@ static void CB2_InitTrainerCard(void) gMain.state++; break; case 8: - HandleGpuRegs(); + InitGpuRegs(); gMain.state++; break; case 9: @@ -841,7 +839,7 @@ static void SetDataFromTrainerCard(void) } } -static void HandleGpuRegs(void) +static void InitGpuRegs(void) { SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_WIN0_ON | DISPCNT_OBJ_ON | DISPCNT_OBJ_1D_MAP); ShowBg(0); @@ -852,24 +850,23 @@ static void HandleGpuRegs(void) SetGpuReg(REG_OFFSET_BLDY, 0); SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG_ALL | WININ_WIN0_OBJ | WININ_WIN0_CLR); SetGpuReg(REG_OFFSET_WINOUT, WINOUT_WIN01_BG1 | WINOUT_WIN01_BG2 | WINOUT_WIN01_BG3 | WINOUT_WIN01_OBJ); - SetGpuReg(REG_OFFSET_WIN0V, 160); - SetGpuReg(REG_OFFSET_WIN0H, 240); + SetGpuReg(REG_OFFSET_WIN0V, DISPLAY_HEIGHT); + SetGpuReg(REG_OFFSET_WIN0H, DISPLAY_WIDTH); if (gReceivedRemoteLinkPlayers) EnableInterrupts(INTR_FLAG_VBLANK | INTR_FLAG_HBLANK | INTR_FLAG_VCOUNT | INTR_FLAG_TIMER3 | INTR_FLAG_SERIAL); else EnableInterrupts(INTR_FLAG_VBLANK | INTR_FLAG_HBLANK); } -// Part of animating card flip -static void sub_80C32EC(u16 arg0) +static void UpdateCardFlipRegs(u16 cardTop) { - s8 quotient = (arg0 + 40) / 10; + s8 blendY = (cardTop + 40) / 10; - if (quotient <= 4) - quotient = 0; - sData->flipBlendY = quotient; + if (blendY <= 4) + blendY = 0; + sData->flipBlendY = blendY; SetGpuReg(REG_OFFSET_BLDY, sData->flipBlendY); - SetGpuReg(REG_OFFSET_WIN0V, (sData->var_7CA8 * 256) | (160 - sData->var_7CA8)); + SetGpuReg(REG_OFFSET_WIN0V, WIN_RANGE(sData->cardTop, DISPLAY_HEIGHT - sData->cardTop)); } static void ResetGpuRegs(void) @@ -1578,6 +1575,7 @@ u8 GetTrainerCardStars(u8 cardId) } #define tFlipState data[0] +#define tCardTop data[1] static void FlipTrainerCard(void) { @@ -1608,41 +1606,43 @@ static bool8 Task_BeginCardFlip(struct Task* task) HideBg(3); ScanlineEffect_Stop(); ScanlineEffect_Clear(); - for (i = 0; i < 160; i++) + for (i = 0; i < DISPLAY_HEIGHT; i++) gScanlineEffectRegBuffers[1][i] = 0; task->tFlipState++; return FALSE; } +// Note: Cannot be DISPLAY_HEIGHT / 2, or cardHeight will be 0 +#define CARD_FLIP_Y ((DISPLAY_HEIGHT / 2) - 3) + static bool8 Task_AnimateCardFlipDown(struct Task* task) { - u32 r4, r5, r10, r7, r6, var_24, r9, var; + u32 cardHeight, r5, r10, cardTop, r6, var_24, cardBottom, var; s16 i; sData->allowDMACopy = FALSE; - if (task->data[1] >= 77) - task->data[1] = 77; + if (task->tCardTop >= CARD_FLIP_Y) + task->tCardTop = CARD_FLIP_Y; else - task->data[1] += 7; - - sData->var_7CA8 = task->data[1]; - sub_80C32EC(task->data[1]); - - // ??? - r7 = task->data[1]; - r9 = 160 - r7; - r4 = r9 - r7; - r6 = -r7 << 16; - r5 = 0xA00000 / r4; - r5 += 0xFFFF0000; + task->tCardTop += 7; + + sData->cardTop = task->tCardTop; + UpdateCardFlipRegs(task->tCardTop); + + cardTop = task->tCardTop; + cardBottom = DISPLAY_HEIGHT - cardTop; + cardHeight = cardBottom - cardTop; + r6 = -cardTop << 16; + r5 = (DISPLAY_HEIGHT << 16) / cardHeight; + r5 -= 1 << 16; var_24 = r6; - var_24 += r5 * r4; - r10 = r5 / r4; + var_24 += r5 * cardHeight; + r10 = r5 / cardHeight; r5 *= 2; - for (i = 0; i < r7; i++) + for (i = 0; i < cardTop; i++) gScanlineEffectRegBuffers[0][i] = -i; - for (; i < (s16)(r9); i++) + for (; i < (s16)cardBottom; i++) { var = r6 >> 16; r6 += r5; @@ -1650,11 +1650,11 @@ static bool8 Task_AnimateCardFlipDown(struct Task* task) gScanlineEffectRegBuffers[0][i] = var; } var = var_24 >> 16; - for (; i < 160; i++) + for (; i < DISPLAY_HEIGHT; i++) gScanlineEffectRegBuffers[0][i] = var; sData->allowDMACopy = TRUE; - if (task->data[1] >= 77) + if (task->tCardTop >= CARD_FLIP_Y) task->tFlipState++; return FALSE; @@ -1736,33 +1736,32 @@ static bool8 Task_SetCardFlipped(struct Task* task) static bool8 Task_AnimateCardFlipUp(struct Task* task) { - u32 r4, r5, r10, r7, r6, var_24, r9, var; + u32 cardHeight, r5, r10, cardTop, r6, var_24, cardBottom, var; s16 i; sData->allowDMACopy = FALSE; - if (task->data[1] <= 5) - task->data[1] = 0; + if (task->tCardTop <= 5) + task->tCardTop = 0; else - task->data[1] -= 5; - - sData->var_7CA8 = task->data[1]; - sub_80C32EC(task->data[1]); - - // ??? - r7 = task->data[1]; - r9 = 160 - r7; - r4 = r9 - r7; - r6 = -r7 << 16; - r5 = 0xA00000 / r4; - r5 += 0xFFFF0000; + task->tCardTop -= 5; + + sData->cardTop = task->tCardTop; + UpdateCardFlipRegs(task->tCardTop); + + cardTop = task->tCardTop; + cardBottom = DISPLAY_HEIGHT - cardTop; + cardHeight = cardBottom - cardTop; + r6 = -cardTop << 16; + r5 = (DISPLAY_HEIGHT << 16) / cardHeight; + r5 -= 1 << 16; var_24 = r6; - var_24 += r5 * r4; - r10 = r5 / r4; + var_24 += r5 * cardHeight; + r10 = r5 / cardHeight; r5 /= 2; - for (i = 0; i < r7; i++) + for (i = 0; i < cardTop; i++) gScanlineEffectRegBuffers[0][i] = -i; - for (; i < (s16)(r9); i++) + for (; i < (s16)cardBottom; i++) { var = r6 >> 16; r6 += r5; @@ -1770,11 +1769,11 @@ static bool8 Task_AnimateCardFlipUp(struct Task* task) gScanlineEffectRegBuffers[0][i] = var; } var = var_24 >> 16; - for (; i < 160; i++) + for (; i < DISPLAY_HEIGHT; i++) gScanlineEffectRegBuffers[0][i] = var; sData->allowDMACopy = TRUE; - if (task->data[1] <= 0) + if (task->tCardTop <= 0) task->tFlipState++; return FALSE; diff --git a/src/trainer_hill.c b/src/trainer_hill.c index 18d56723c..3bc6c970b 100644 --- a/src/trainer_hill.c +++ b/src/trainer_hill.c @@ -74,7 +74,7 @@ static void GetChallengeWon(void); static void TrainerHillSetTag(void); static void SetUpDataStruct(void); static void FreeDataStruct(void); -static void nullsub_2(void); +static void TrainerHillDummy(void); static void SetTimerValue(u32 *dst, u32 val); static u32 GetTimerValue(u32 *src); static void SetTrainerHillMonLevel(struct Pokemon *mon, u8 level); @@ -358,7 +358,7 @@ static void SetUpDataStruct(void) sHillData = AllocZeroed(sizeof(*sHillData)); sHillData->floorId = gMapHeader.mapLayoutId - LAYOUT_TRAINER_HILL_1F; CpuCopy32(sDataPerTag[gSaveBlock1Ptr->trainerHill.tag], &sHillData->tag, sizeof(sHillData->tag) + 4 * sizeof(struct TrHillFloor)); - nullsub_2(); + TrainerHillDummy(); } } @@ -397,7 +397,7 @@ void CopyTrainerHillTrainerText(u8 which, u16 trainerId) static void TrainerHillStartChallenge(void) { - nullsub_2(); + TrainerHillDummy(); if (!ReadTrainerHillAndValidate()) gSaveBlock1Ptr->trainerHill.field_3D6E_0f = 1; else @@ -573,12 +573,12 @@ static void IsTrainerHillChallengeActive(void) gSpecialVar_Result = TRUE; } -void nullsub_129(void) +static void TrainerHillDummy_Unused(void) { } -static void nullsub_2(void) +static void TrainerHillDummy(void) { } diff --git a/src/unk_text_util_2.c b/src/unk_text_util_2.c index b92b34fbd..3459dde85 100644 --- a/src/unk_text_util_2.c +++ b/src/unk_text_util_2.c @@ -5,7 +5,7 @@ #include "sound.h" ALIGNED(4) -static const u8 sUnknown_08616124[] = {1, 2, 4}; +static const u8 sScrollDistances[] = {1, 2, 4}; static const u16 sFont6BrailleGlyphs[] = INCBIN_U16("graphics/fonts/font6.fwjpnfont"); static void DecompressGlyphFont6(u16); @@ -135,7 +135,7 @@ u16 Font6Func(struct TextPrinter *textPrinter) } DecompressGlyphFont6(char_); CopyGlyphToWindow(textPrinter); - textPrinter->printerTemplate.currentX += gUnknown_03002F90.width + textPrinter->printerTemplate.letterSpacing; + textPrinter->printerTemplate.currentX += gCurGlyph.width + textPrinter->printerTemplate.letterSpacing; return 0; case 1: if (TextPrinterWait(textPrinter)) @@ -164,15 +164,15 @@ u16 Font6Func(struct TextPrinter *textPrinter) case 4: if (textPrinter->scrollDistance) { - if (textPrinter->scrollDistance < sUnknown_08616124[gSaveBlock2Ptr->optionsTextSpeed]) + if (textPrinter->scrollDistance < sScrollDistances[gSaveBlock2Ptr->optionsTextSpeed]) { ScrollWindow(textPrinter->printerTemplate.windowId, 0, textPrinter->scrollDistance, PIXEL_FILL(textPrinter->printerTemplate.bgColor)); textPrinter->scrollDistance = 0; } else { - ScrollWindow(textPrinter->printerTemplate.windowId, 0, sUnknown_08616124[gSaveBlock2Ptr->optionsTextSpeed], PIXEL_FILL(textPrinter->printerTemplate.bgColor)); - textPrinter->scrollDistance -= sUnknown_08616124[gSaveBlock2Ptr->optionsTextSpeed]; + ScrollWindow(textPrinter->printerTemplate.windowId, 0, sScrollDistances[gSaveBlock2Ptr->optionsTextSpeed], PIXEL_FILL(textPrinter->printerTemplate.bgColor)); + textPrinter->scrollDistance -= sScrollDistances[gSaveBlock2Ptr->optionsTextSpeed]; } CopyWindowToVram(textPrinter->printerTemplate.windowId, 2); } @@ -206,12 +206,12 @@ static void DecompressGlyphFont6(u16 glyph) const u16 *glyphs; glyphs = sFont6BrailleGlyphs + 0x100 * (glyph / 8) + 0x10 * (glyph % 8); - DecompressGlyphTile(glyphs, (u16 *)gUnknown_03002F90.unk0); - DecompressGlyphTile(glyphs + 0x8, (u16 *)(gUnknown_03002F90.unk20)); - DecompressGlyphTile(glyphs + 0x80, (u16 *)(gUnknown_03002F90.unk40)); - DecompressGlyphTile(glyphs + 0x88, (u16 *)(gUnknown_03002F90.unk60)); - gUnknown_03002F90.width = 0x10; - gUnknown_03002F90.height = 0x10; + DecompressGlyphTile(glyphs, gCurGlyph.gfxBufferTop); + DecompressGlyphTile(glyphs + 0x8, gCurGlyph.gfxBufferTop + 8); + DecompressGlyphTile(glyphs + 0x80, gCurGlyph.gfxBufferBottom); + DecompressGlyphTile(glyphs + 0x88, gCurGlyph.gfxBufferBottom + 8); + gCurGlyph.width = 0x10; + gCurGlyph.height = 0x10; } u32 GetGlyphWidthFont6(u16 glyphId, bool32 isJapanese) |