pokeemerald/asm/mauville_old_man.s

1454 lines
21 KiB
ArmAsm
Raw Normal View History

2016-11-01 10:08:48 -07:00
.include "asm/macros.inc"
.include "constants/constants.inc"
.syntax unified
.text
thumb_func_start sub_8120944
sub_8120944: @ 8120944
push {r4-r7,lr}
lsls r0, 24
lsrs r6, r0, 24
lsls r0, r6, 2
adds r0, r6
lsls r0, 3
2016-11-01 11:35:16 -07:00
ldr r1, =gTasks
2016-11-01 10:08:48 -07:00
adds r5, r0, r1
2016-11-01 11:35:16 -07:00
ldr r1, =gUnknown_03006130
2016-11-01 10:08:48 -07:00
adds r0, r5, 0
bl sub_8120748
movs r1, 0x8
ldrsh r0, [r5, r1]
cmp r0, 0x5
bls _08120966
b _08120B50
_08120966:
lsls r0, 2
ldr r1, =_0812097C
adds r0, r1
ldr r0, [r0]
mov pc, r0
.pool
.align 2, 0
_0812097C:
.4byte _08120994
.4byte _081209B8
.4byte _081209C8
.4byte _08120A7E
.4byte _08120B40
.4byte _08120A6E
_08120994:
bl sub_8120280
2017-01-14 11:53:20 -08:00
ldr r0, =gStringVar4
2016-11-01 10:08:48 -07:00
bl sub_8120708
movs r0, 0
strh r0, [r5, 0xA]
strh r0, [r5, 0xC]
strh r0, [r5, 0xE]
strh r0, [r5, 0x10]
movs r0, 0x4
2017-09-02 16:03:53 +02:00
bl FadeOutBGMTemporarily
2016-11-01 10:08:48 -07:00
movs r0, 0x1
b _08120B4E
.pool
_081209B8:
2017-09-02 16:03:53 +02:00
bl IsBGMPausedOrStopped
2016-11-01 10:08:48 -07:00
lsls r0, 24
cmp r0, 0
bne _081209C4
b _08120B50
_081209C4:
movs r0, 0x2
b _08120B4E
_081209C8:
2017-01-14 11:53:20 -08:00
ldr r0, =gSaveBlock1Ptr
2016-11-01 10:08:48 -07:00
ldr r0, [r0]
ldr r2, =0x00002e28
adds r4, r0, r2
movs r0, 0xE
ldrsh r1, [r5, r0]
2017-01-14 11:53:20 -08:00
ldr r0, =gStringVar4
2016-11-01 10:08:48 -07:00
adds r1, r0
movs r3, 0
ldrb r0, [r1]
2016-11-01 11:35:16 -07:00
ldr r7, =gUnknown_03006130
2016-11-01 10:08:48 -07:00
ldrh r2, [r5, 0x12]
2016-11-01 11:35:16 -07:00
ldr r6, =gUnknown_0203A128
2016-11-01 10:08:48 -07:00
b _08120A02
.pool
_081209F8:
adds r1, 0x1
adds r0, r3, 0x1
lsls r0, 16
lsrs r3, r0, 16
ldrb r0, [r1]
_08120A02:
cmp r0, 0
beq _08120A12
cmp r0, 0xFE
beq _08120A12
cmp r0, 0xFC
beq _08120A12
cmp r0, 0xFF
bne _081209F8
_08120A12:
cmp r2, 0
bne _08120A20
movs r2, 0x10
ldrsh r1, [r5, r2]
lsls r1, 1
adds r0, r4, 0x2
b _08120A2A
_08120A20:
movs r0, 0x10
ldrsh r1, [r5, r0]
lsls r1, 1
adds r0, r4, 0
adds r0, 0xE
_08120A2A:
adds r0, r1
ldrh r0, [r0]
movs r1, 0x3
ands r1, r0
lsrs r0, 3
movs r2, 0x1
ands r0, r2
adds r1, r0
strh r1, [r6]
movs r1, 0x4
ldrsh r0, [r7, r1]
adds r1, r3, 0
bl __divsi3
movs r1, 0
strh r0, [r7, 0x4]
lsls r0, 16
cmp r0, 0
bgt _08120A54
movs r0, 0x1
strh r0, [r7, 0x4]
_08120A54:
ldrh r0, [r5, 0x10]
adds r0, 0x1
strh r0, [r5, 0x10]
movs r2, 0xC
ldrsh r0, [r5, r2]
cmp r0, 0
bne _08120A66
movs r0, 0x3
b _08120A68
_08120A66:
movs r0, 0x5
_08120A68:
strh r0, [r5, 0x8]
strh r1, [r5, 0xA]
b _08120B50
_08120A6E:
ldrh r1, [r5, 0xC]
movs r2, 0xC
ldrsh r0, [r5, r2]
cmp r0, 0
beq _08120B4C
subs r0, r1, 0x1
strh r0, [r5, 0xC]
b _08120B50
_08120A7E:
2017-01-14 11:53:20 -08:00
ldr r1, =gStringVar4
2016-11-01 10:08:48 -07:00
movs r2, 0xE
ldrsh r0, [r5, r2]
adds r0, r1
ldrb r4, [r0]
cmp r4, 0xFF
bne _08120AB0
movs r0, 0x6
2017-09-02 16:03:53 +02:00
bl FadeInBGM
ldr r0, =gMPlayInfo_SE2
2016-11-01 10:08:48 -07:00
movs r1, 0x2
bl m4aMPlayFadeOutTemporarily
2017-09-10 23:05:23 +02:00
bl EnableBothScriptContexts
2016-11-01 10:08:48 -07:00
adds r0, r6, 0
bl DestroyTask
b _08120B50
.pool
_08120AB0:
cmp r4, 0
bne _08120AC6
bl sub_81206F0
ldrh r0, [r5, 0xE]
adds r0, 0x1
strh r0, [r5, 0xE]
movs r0, 0x2
strh r0, [r5, 0x8]
strh r4, [r5, 0xC]
b _08120B50
_08120AC6:
cmp r4, 0xFE
bne _08120ADA
ldrh r0, [r5, 0xE]
adds r0, 0x1
movs r1, 0
strh r0, [r5, 0xE]
movs r0, 0x2
strh r0, [r5, 0x8]
strh r1, [r5, 0xC]
b _08120B50
_08120ADA:
cmp r4, 0xFC
bne _08120AEE
ldrh r0, [r5, 0xE]
adds r0, 0x2
strh r0, [r5, 0xE]
movs r0, 0x2
strh r0, [r5, 0x8]
movs r0, 0x8
strh r0, [r5, 0xC]
b _08120B50
_08120AEE:
cmp r4, 0x37
bne _08120B04
movs r4, 0
strb r4, [r0]
bl sub_81206F0
ldrh r0, [r5, 0xE]
adds r0, 0x1
strh r0, [r5, 0xE]
strh r4, [r5, 0xC]
b _08120B50
_08120B04:
movs r1, 0xA
ldrsh r0, [r5, r1]
cmp r0, 0x1
beq _08120B20
cmp r0, 0x1
bgt _08120B16
cmp r0, 0
beq _08120B1C
b _08120B50
_08120B16:
cmp r0, 0x2
beq _08120B28
b _08120B50
_08120B1C:
bl sub_81206F0
_08120B20:
ldrh r0, [r5, 0xA]
adds r0, 0x1
strh r0, [r5, 0xA]
b _08120B50
_08120B28:
ldrh r0, [r5, 0xE]
adds r0, 0x1
movs r1, 0
strh r0, [r5, 0xE]
strh r1, [r5, 0xA]
2016-11-01 11:35:16 -07:00
ldr r0, =gUnknown_03006130
2016-11-01 10:08:48 -07:00
ldrh r0, [r0, 0x4]
strh r0, [r5, 0xC]
movs r0, 0x4
b _08120B4E
.pool
_08120B40:
ldrh r0, [r5, 0xC]
subs r0, 0x1
strh r0, [r5, 0xC]
lsls r0, 16
cmp r0, 0
bne _08120B50
_08120B4C:
movs r0, 0x3
_08120B4E:
strh r0, [r5, 0x8]
_08120B50:
bl sub_8197224
pop {r4-r7}
pop {r0}
bx r0
thumb_func_end sub_8120944
thumb_func_start sub_8120B5C
sub_8120B5C: @ 8120B5C
push {lr}
ldr r0, =0x00004010
movs r1, 0x45
bl VarSet
pop {r0}
bx r0
.pool
thumb_func_end sub_8120B5C
thumb_func_start sub_8120B70
sub_8120B70: @ 8120B70
push {r4-r7,lr}
sub sp, 0x8
ldrb r1, [r0]
cmp r1, 0x2
beq _08120B80
cmp r1, 0x3
beq _08120BA6
b _08120C00
_08120B80:
adds r5, r0, 0
movs r4, 0
_08120B84:
adds r0, r5, 0
adds r0, 0x32
adds r0, r4
ldrb r0, [r0]
cmp r0, 0x1
bne _08120B9E
movs r0, 0xB
muls r0, r4
adds r0, 0x5
adds r0, r5, r0
movs r1, 0x1
2017-01-14 11:53:20 -08:00
bl ConvertInternationalString
2016-11-01 10:08:48 -07:00
_08120B9E:
adds r4, 0x1
cmp r4, 0x3
ble _08120B84
b _08120C00
_08120BA6:
adds r6, r0, 0
movs r4, 0
mov r7, sp
adds r5, r6, 0
adds r5, 0x8
_08120BB0:
adds r0, r6, 0x4
adds r0, r4
ldrb r0, [r0]
cmp r0, 0
beq _08120BF8
mov r0, sp
adds r1, r5, 0
movs r2, 0x7
bl memcpy
movs r0, 0xFF
strb r0, [r7, 0x7]
mov r0, sp
Decompile TV (#80) * ClearTVShowData * special_0x44 * DoTVShow (nonmatching because align) * DoTVShowBravoTrainerPokemonProfile * Update field names * DoTVShowBravoTrainerBattleTower * Renaming of struct fields * sub_80EBFF4 and UpdateTVScreensOnMap * SetTVMetatilesOnMap * Power buttons for the TV screens on the map * special_0x45 * sub_80EC18C * special_0x4a * ResetGabbyAndTy * GabbyAndTyBeforeInterview * GabbyAndTyAfterInterview * Through IsTVShowInSearchOfTrainersAiring * GabbyAndTyGetLastQuote * GabbyAndTyGetLastBattleTrivia * GabbyAndTySetScriptVarsToFieldObjectLocalIds * InterviewAfter; use TVShow as a precursor for making the individual show structs anonymous * Make TV structs anonymous within the union * Move the TV union to its own subheader * Move TV show enums to the global.tv.h subheader * Funcion renaming * Apply static attributes where able * PutPokemonTodayCaughtOnAir * sub_80EC8A4 * PutPokemonTodayFailedOnTheAir * sub_80EC9E8, sub_80ECA10 * sub_80ECA38 * sub_80ECB00 * Put3CheersForPokeblocksOnTheAir * PutFanClubSpecialOnTheAir * ContestLiveUpdates_BeforeInterview * Other before-interview Contest Live Updates functions * ContestLiveUpdates_BeforeInterview_5 * InterviewAfter_BravoTrainerPokemonProfile * BravoTrainerPokemonProfile_BeforeInterview1 * BravoTrainerPokemonProfile_BeforeInterview2 * Disassemble TV data * Decompile TV data * InterviewAfter_BravoTrainerBattleTowerProfile * SaveRecordedItemPurchasesForTVShow * PutNameRaterShowOnTheAir * StartMassOutbreak * PutLilycoveContestLadyShowOnTheAir * InterviewAfter_FanClubLetter * Rip TV strings * InterviewAfter_RecentHappenings * InterviewAfter_PkmnFanClubOpinions * sub_80ED718 * EndMassOutbreak * sub_80ED888 * sub_80ED8B4 * UpdateMassOutbreakTimeLeft * sub_80ED950 * PutFishingAdviceShowOnTheAir * through sub_80EDA80 * ewram and common syms are now fetched from the object files * BSS symbols are taken from the tv.o file * through sub_80EDC60 * sub_80EDCE8 * sub_80EDD78 * through sub_80EDE84 * nomatching sub_80EDE98 * sub_80EDFB4 * sub_80EE104 * sub_80EE104 * sub_80EE184 * sub_80EE2CC * sub_80EE35C * sub_80EE44C * sub_80EE4DC * sub_80EE5A4 * sub_80EE69C * sub_80EE72C * sub_80EE7C0 * sub_80EE818 * sub_80EE8C8 * sub_80EEA70 * sub_80EEB98 * sub_80EEBF4 * through sub_80EED60 * Functions relating to Pokemon News * sub_80EEF6C * GetPriceReduction * IsPriceDiscounted * sub_80EF120 * through sub_80EF370 * sub_80EF40C * HasMixableShowAlreadyBeenSpawnedWithPlayerID * TV_SortPurchasesByQuantity * FindActiveBroadcastByShowType_SetScriptResult * InterviewBefore * through sub_80EF88C * through sub_80EF93C * through sub_80EFA24 * through TV_BernoulliTrial * sub_80EFB58 * sub_80EFBA4 * sub_80EFBDC * through sub_80EFD98 * ChangePokemonNickname * ChangeBoxPokemonNickname * sub_80EFF9C * through player_id_to_dword * CheckForBigMovieOrEmergencyNewsOnTV * GetMomOrDadStringForTVMessage * sub_80F01E8 * sub_80F0358 * sub_80F049C * TV record mixing functions * sub_80F06D0 * sub_80F0708 nonmatching * through sub_80F0B24 * sub_80F0B64 * through sub_80F0C04 * sub_80F0C7C * sub_80F0D60 * sub_80F0E58 * sub_80F0E84 * through sub_80F0F24 * sub_80F0F64 * sub_80F1208 * sub_80F1254 * sub_80F1290 * sub_80F12A4 * sub_80F14F8 * DoTVShowTodaysSmartShopper * DoTVShowTheNameRaterShow * DoTVShowPokemonTodaySuccessfulCapture * DoTVShowPokemonTodayFailedCapture * DoTVShowPokemonFanClubLetter * DoTVShowRecentHappenings * DoTVShowPokemonFanClubOpinions * DoTVShowPokemonNewsMassOutbreak * DoTVShowPokemonContestLiveUpdates * DoTVShowPokemonBattleUpdate * DoTVShow3CheersForPokeblocks * DoTVShowInSearchOfTrainers * Label GabbyAndTyData fields; remove ddump comments from data/text/tv.inc * DoTVShowPokemonAngler * DoTVShowTheWorldOfMasters; update RAM symbols and field names * Decorate static functions * DoTVShowTodaysRivalTrainer; region map enums * TVDewfordTrendWatcherNetworkTextGroup * DoTVShowHoennTreasureInvestigators * DoTVShowFindThatGamer * DoTVShowBreakingNewsTV * DoTVShowSecretBaseVisit * DoTVShowPokemonLotterWinnerFlashReport * DoTVShowThePokemonBattleSeminar * DoTVShowTrainerFanClubSpecial, DoTVShowTrainerFanClub * DoTVShowSpotTheCuties * DoTVShowPokemonNewsBattleFrontier * DoTVShowWhatsNo1InHoennToday * Helpers for DoTVShowSecretBaseSecrets * DoTVShowSecretBaseSecrets * DoTVShowSafariFanClub * Finish decompilation of tv.s * Some renaming * Rename text group pointers * revoke statis; pokenews enums * Labels are number one * Label all TV struct fields * Make data/text/tv.inc more readable * Split data/text/tv.inc * Rename pokenews text pointers * Frontier Symbol constants; indicate static rodata objects with 's' prefix * Fix leading spaces/tabs F*** CLion sometimes * Fix inconsequential warning
2017-10-13 11:09:36 -04:00
bl IsStringJapanese
2016-11-01 10:08:48 -07:00
cmp r0, 0
beq _08120BF8
mov r0, sp
movs r1, 0
movs r2, 0x8
bl memset
mov r0, sp
2017-09-20 14:38:05 -05:00
ldr r1, =gText_Friend
2017-01-14 11:53:20 -08:00
bl StringCopy
2016-11-01 10:08:48 -07:00
adds r0, r5, 0
mov r1, sp
movs r2, 0x7
bl memcpy
adds r0, r6, 0
adds r0, 0x34
adds r0, r4
movs r1, 0x2
strb r1, [r0]
_08120BF8:
adds r5, 0x7
adds r4, 0x1
cmp r4, 0x3
ble _08120BB0
_08120C00:
add sp, 0x8
pop {r4-r7}
pop {r0}
bx r0
.pool
thumb_func_end sub_8120B70
thumb_func_start sub_8120C0C
sub_8120C0C: @ 8120C0C
push {r4-r7,lr}
mov r7, r8
push {r7}
adds r5, r0, 0
mov r8, r1
adds r7, r2, 0
ldrb r0, [r5]
cmp r0, 0x4
bhi _08120CC4
lsls r0, 2
ldr r1, =_08120C2C
adds r0, r1
ldr r0, [r0]
mov pc, r0
.pool
.align 2, 0
_08120C2C:
.4byte _08120C92
.4byte _08120CA2
.4byte _08120C40
.4byte _08120C6A
.4byte _08120CB0
_08120C40:
adds r6, r5, 0
movs r5, 0
adds r4, r6, 0
adds r4, 0x32
_08120C48:
movs r0, 0xB
muls r0, r5
adds r0, 0x5
adds r0, r6, r0
Decompile TV (#80) * ClearTVShowData * special_0x44 * DoTVShow (nonmatching because align) * DoTVShowBravoTrainerPokemonProfile * Update field names * DoTVShowBravoTrainerBattleTower * Renaming of struct fields * sub_80EBFF4 and UpdateTVScreensOnMap * SetTVMetatilesOnMap * Power buttons for the TV screens on the map * special_0x45 * sub_80EC18C * special_0x4a * ResetGabbyAndTy * GabbyAndTyBeforeInterview * GabbyAndTyAfterInterview * Through IsTVShowInSearchOfTrainersAiring * GabbyAndTyGetLastQuote * GabbyAndTyGetLastBattleTrivia * GabbyAndTySetScriptVarsToFieldObjectLocalIds * InterviewAfter; use TVShow as a precursor for making the individual show structs anonymous * Make TV structs anonymous within the union * Move the TV union to its own subheader * Move TV show enums to the global.tv.h subheader * Funcion renaming * Apply static attributes where able * PutPokemonTodayCaughtOnAir * sub_80EC8A4 * PutPokemonTodayFailedOnTheAir * sub_80EC9E8, sub_80ECA10 * sub_80ECA38 * sub_80ECB00 * Put3CheersForPokeblocksOnTheAir * PutFanClubSpecialOnTheAir * ContestLiveUpdates_BeforeInterview * Other before-interview Contest Live Updates functions * ContestLiveUpdates_BeforeInterview_5 * InterviewAfter_BravoTrainerPokemonProfile * BravoTrainerPokemonProfile_BeforeInterview1 * BravoTrainerPokemonProfile_BeforeInterview2 * Disassemble TV data * Decompile TV data * InterviewAfter_BravoTrainerBattleTowerProfile * SaveRecordedItemPurchasesForTVShow * PutNameRaterShowOnTheAir * StartMassOutbreak * PutLilycoveContestLadyShowOnTheAir * InterviewAfter_FanClubLetter * Rip TV strings * InterviewAfter_RecentHappenings * InterviewAfter_PkmnFanClubOpinions * sub_80ED718 * EndMassOutbreak * sub_80ED888 * sub_80ED8B4 * UpdateMassOutbreakTimeLeft * sub_80ED950 * PutFishingAdviceShowOnTheAir * through sub_80EDA80 * ewram and common syms are now fetched from the object files * BSS symbols are taken from the tv.o file * through sub_80EDC60 * sub_80EDCE8 * sub_80EDD78 * through sub_80EDE84 * nomatching sub_80EDE98 * sub_80EDFB4 * sub_80EE104 * sub_80EE104 * sub_80EE184 * sub_80EE2CC * sub_80EE35C * sub_80EE44C * sub_80EE4DC * sub_80EE5A4 * sub_80EE69C * sub_80EE72C * sub_80EE7C0 * sub_80EE818 * sub_80EE8C8 * sub_80EEA70 * sub_80EEB98 * sub_80EEBF4 * through sub_80EED60 * Functions relating to Pokemon News * sub_80EEF6C * GetPriceReduction * IsPriceDiscounted * sub_80EF120 * through sub_80EF370 * sub_80EF40C * HasMixableShowAlreadyBeenSpawnedWithPlayerID * TV_SortPurchasesByQuantity * FindActiveBroadcastByShowType_SetScriptResult * InterviewBefore * through sub_80EF88C * through sub_80EF93C * through sub_80EFA24 * through TV_BernoulliTrial * sub_80EFB58 * sub_80EFBA4 * sub_80EFBDC * through sub_80EFD98 * ChangePokemonNickname * ChangeBoxPokemonNickname * sub_80EFF9C * through player_id_to_dword * CheckForBigMovieOrEmergencyNewsOnTV * GetMomOrDadStringForTVMessage * sub_80F01E8 * sub_80F0358 * sub_80F049C * TV record mixing functions * sub_80F06D0 * sub_80F0708 nonmatching * through sub_80F0B24 * sub_80F0B64 * through sub_80F0C04 * sub_80F0C7C * sub_80F0D60 * sub_80F0E58 * sub_80F0E84 * through sub_80F0F24 * sub_80F0F64 * sub_80F1208 * sub_80F1254 * sub_80F1290 * sub_80F12A4 * sub_80F14F8 * DoTVShowTodaysSmartShopper * DoTVShowTheNameRaterShow * DoTVShowPokemonTodaySuccessfulCapture * DoTVShowPokemonTodayFailedCapture * DoTVShowPokemonFanClubLetter * DoTVShowRecentHappenings * DoTVShowPokemonFanClubOpinions * DoTVShowPokemonNewsMassOutbreak * DoTVShowPokemonContestLiveUpdates * DoTVShowPokemonBattleUpdate * DoTVShow3CheersForPokeblocks * DoTVShowInSearchOfTrainers * Label GabbyAndTyData fields; remove ddump comments from data/text/tv.inc * DoTVShowPokemonAngler * DoTVShowTheWorldOfMasters; update RAM symbols and field names * Decorate static functions * DoTVShowTodaysRivalTrainer; region map enums * TVDewfordTrendWatcherNetworkTextGroup * DoTVShowHoennTreasureInvestigators * DoTVShowFindThatGamer * DoTVShowBreakingNewsTV * DoTVShowSecretBaseVisit * DoTVShowPokemonLotterWinnerFlashReport * DoTVShowThePokemonBattleSeminar * DoTVShowTrainerFanClubSpecial, DoTVShowTrainerFanClub * DoTVShowSpotTheCuties * DoTVShowPokemonNewsBattleFrontier * DoTVShowWhatsNo1InHoennToday * Helpers for DoTVShowSecretBaseSecrets * DoTVShowSecretBaseSecrets * DoTVShowSafariFanClub * Finish decompilation of tv.s * Some renaming * Rename text group pointers * revoke statis; pokenews enums * Labels are number one * Label all TV struct fields * Make data/text/tv.inc more readable * Split data/text/tv.inc * Rename pokenews text pointers * Frontier Symbol constants; indicate static rodata objects with 's' prefix * Fix leading spaces/tabs F*** CLion sometimes * Fix inconsequential warning
2017-10-13 11:09:36 -04:00
bl IsStringJapanese
2016-11-01 10:08:48 -07:00
cmp r0, 0
beq _08120C5E
mov r0, r8
strb r0, [r4]
b _08120C60
_08120C5E:
strb r7, [r4]
_08120C60:
adds r4, 0x1
adds r5, 0x1
cmp r5, 0x3
ble _08120C48
b _08120CC4
_08120C6A:
adds r4, r5, 0
adds r4, 0x34
adds r6, r5, 0
adds r6, 0x8
movs r5, 0x3
_08120C74:
adds r0, r6, 0
Decompile TV (#80) * ClearTVShowData * special_0x44 * DoTVShow (nonmatching because align) * DoTVShowBravoTrainerPokemonProfile * Update field names * DoTVShowBravoTrainerBattleTower * Renaming of struct fields * sub_80EBFF4 and UpdateTVScreensOnMap * SetTVMetatilesOnMap * Power buttons for the TV screens on the map * special_0x45 * sub_80EC18C * special_0x4a * ResetGabbyAndTy * GabbyAndTyBeforeInterview * GabbyAndTyAfterInterview * Through IsTVShowInSearchOfTrainersAiring * GabbyAndTyGetLastQuote * GabbyAndTyGetLastBattleTrivia * GabbyAndTySetScriptVarsToFieldObjectLocalIds * InterviewAfter; use TVShow as a precursor for making the individual show structs anonymous * Make TV structs anonymous within the union * Move the TV union to its own subheader * Move TV show enums to the global.tv.h subheader * Funcion renaming * Apply static attributes where able * PutPokemonTodayCaughtOnAir * sub_80EC8A4 * PutPokemonTodayFailedOnTheAir * sub_80EC9E8, sub_80ECA10 * sub_80ECA38 * sub_80ECB00 * Put3CheersForPokeblocksOnTheAir * PutFanClubSpecialOnTheAir * ContestLiveUpdates_BeforeInterview * Other before-interview Contest Live Updates functions * ContestLiveUpdates_BeforeInterview_5 * InterviewAfter_BravoTrainerPokemonProfile * BravoTrainerPokemonProfile_BeforeInterview1 * BravoTrainerPokemonProfile_BeforeInterview2 * Disassemble TV data * Decompile TV data * InterviewAfter_BravoTrainerBattleTowerProfile * SaveRecordedItemPurchasesForTVShow * PutNameRaterShowOnTheAir * StartMassOutbreak * PutLilycoveContestLadyShowOnTheAir * InterviewAfter_FanClubLetter * Rip TV strings * InterviewAfter_RecentHappenings * InterviewAfter_PkmnFanClubOpinions * sub_80ED718 * EndMassOutbreak * sub_80ED888 * sub_80ED8B4 * UpdateMassOutbreakTimeLeft * sub_80ED950 * PutFishingAdviceShowOnTheAir * through sub_80EDA80 * ewram and common syms are now fetched from the object files * BSS symbols are taken from the tv.o file * through sub_80EDC60 * sub_80EDCE8 * sub_80EDD78 * through sub_80EDE84 * nomatching sub_80EDE98 * sub_80EDFB4 * sub_80EE104 * sub_80EE104 * sub_80EE184 * sub_80EE2CC * sub_80EE35C * sub_80EE44C * sub_80EE4DC * sub_80EE5A4 * sub_80EE69C * sub_80EE72C * sub_80EE7C0 * sub_80EE818 * sub_80EE8C8 * sub_80EEA70 * sub_80EEB98 * sub_80EEBF4 * through sub_80EED60 * Functions relating to Pokemon News * sub_80EEF6C * GetPriceReduction * IsPriceDiscounted * sub_80EF120 * through sub_80EF370 * sub_80EF40C * HasMixableShowAlreadyBeenSpawnedWithPlayerID * TV_SortPurchasesByQuantity * FindActiveBroadcastByShowType_SetScriptResult * InterviewBefore * through sub_80EF88C * through sub_80EF93C * through sub_80EFA24 * through TV_BernoulliTrial * sub_80EFB58 * sub_80EFBA4 * sub_80EFBDC * through sub_80EFD98 * ChangePokemonNickname * ChangeBoxPokemonNickname * sub_80EFF9C * through player_id_to_dword * CheckForBigMovieOrEmergencyNewsOnTV * GetMomOrDadStringForTVMessage * sub_80F01E8 * sub_80F0358 * sub_80F049C * TV record mixing functions * sub_80F06D0 * sub_80F0708 nonmatching * through sub_80F0B24 * sub_80F0B64 * through sub_80F0C04 * sub_80F0C7C * sub_80F0D60 * sub_80F0E58 * sub_80F0E84 * through sub_80F0F24 * sub_80F0F64 * sub_80F1208 * sub_80F1254 * sub_80F1290 * sub_80F12A4 * sub_80F14F8 * DoTVShowTodaysSmartShopper * DoTVShowTheNameRaterShow * DoTVShowPokemonTodaySuccessfulCapture * DoTVShowPokemonTodayFailedCapture * DoTVShowPokemonFanClubLetter * DoTVShowRecentHappenings * DoTVShowPokemonFanClubOpinions * DoTVShowPokemonNewsMassOutbreak * DoTVShowPokemonContestLiveUpdates * DoTVShowPokemonBattleUpdate * DoTVShow3CheersForPokeblocks * DoTVShowInSearchOfTrainers * Label GabbyAndTyData fields; remove ddump comments from data/text/tv.inc * DoTVShowPokemonAngler * DoTVShowTheWorldOfMasters; update RAM symbols and field names * Decorate static functions * DoTVShowTodaysRivalTrainer; region map enums * TVDewfordTrendWatcherNetworkTextGroup * DoTVShowHoennTreasureInvestigators * DoTVShowFindThatGamer * DoTVShowBreakingNewsTV * DoTVShowSecretBaseVisit * DoTVShowPokemonLotterWinnerFlashReport * DoTVShowThePokemonBattleSeminar * DoTVShowTrainerFanClubSpecial, DoTVShowTrainerFanClub * DoTVShowSpotTheCuties * DoTVShowPokemonNewsBattleFrontier * DoTVShowWhatsNo1InHoennToday * Helpers for DoTVShowSecretBaseSecrets * DoTVShowSecretBaseSecrets * DoTVShowSafariFanClub * Finish decompilation of tv.s * Some renaming * Rename text group pointers * revoke statis; pokenews enums * Labels are number one * Label all TV struct fields * Make data/text/tv.inc more readable * Split data/text/tv.inc * Rename pokenews text pointers * Frontier Symbol constants; indicate static rodata objects with 's' prefix * Fix leading spaces/tabs F*** CLion sometimes * Fix inconsequential warning
2017-10-13 11:09:36 -04:00
bl IsStringJapanese
2016-11-01 10:08:48 -07:00
cmp r0, 0
beq _08120C84
mov r1, r8
strb r1, [r4]
b _08120C86
_08120C84:
strb r7, [r4]
_08120C86:
adds r4, 0x1
adds r6, 0x7
subs r5, 0x1
cmp r5, 0
bge _08120C74
b _08120CC4
_08120C92:
cmp r3, 0x1
bne _08120C9C
adds r0, r5, 0
adds r0, 0x2A
b _08120CB8
_08120C9C:
adds r0, r5, 0
adds r0, 0x2A
b _08120CC2
_08120CA2:
cmp r3, 0x1
bne _08120CAC
mov r0, r8
strb r0, [r5, 0x2]
b _08120CC4
_08120CAC:
strb r7, [r5, 0x2]
b _08120CC4
_08120CB0:
cmp r3, 0x1
bne _08120CBE
adds r0, r5, 0
adds r0, 0x20
_08120CB8:
mov r1, r8
strb r1, [r0]
b _08120CC4
_08120CBE:
adds r0, r5, 0
adds r0, 0x20
_08120CC2:
strb r7, [r0]
_08120CC4:
pop {r3}
mov r8, r3
pop {r4-r7}
pop {r0}
bx r0
thumb_func_end sub_8120C0C
thumb_func_start sub_8120CD0
sub_8120CD0: @ 8120CD0
push {r4-r7,lr}
mov r7, r8
push {r7}
sub sp, 0x8
adds r1, r0, 0
ldrb r0, [r1]
cmp r0, 0x3
bne _08120D28
cmp r2, 0x1
bne _08120D28
adds r7, r1, 0
movs r6, 0
mov r8, sp
adds r4, r7, 0
adds r4, 0x34
adds r5, r7, 0
adds r5, 0x8
_08120CF2:
adds r0, r7, 0x4
adds r0, r6
ldrb r0, [r0]
cmp r0, 0
beq _08120D1E
mov r0, sp
adds r1, r5, 0
movs r2, 0x7
bl memcpy
movs r0, 0xFF
mov r1, r8
strb r0, [r1, 0x7]
mov r0, sp
Decompile TV (#80) * ClearTVShowData * special_0x44 * DoTVShow (nonmatching because align) * DoTVShowBravoTrainerPokemonProfile * Update field names * DoTVShowBravoTrainerBattleTower * Renaming of struct fields * sub_80EBFF4 and UpdateTVScreensOnMap * SetTVMetatilesOnMap * Power buttons for the TV screens on the map * special_0x45 * sub_80EC18C * special_0x4a * ResetGabbyAndTy * GabbyAndTyBeforeInterview * GabbyAndTyAfterInterview * Through IsTVShowInSearchOfTrainersAiring * GabbyAndTyGetLastQuote * GabbyAndTyGetLastBattleTrivia * GabbyAndTySetScriptVarsToFieldObjectLocalIds * InterviewAfter; use TVShow as a precursor for making the individual show structs anonymous * Make TV structs anonymous within the union * Move the TV union to its own subheader * Move TV show enums to the global.tv.h subheader * Funcion renaming * Apply static attributes where able * PutPokemonTodayCaughtOnAir * sub_80EC8A4 * PutPokemonTodayFailedOnTheAir * sub_80EC9E8, sub_80ECA10 * sub_80ECA38 * sub_80ECB00 * Put3CheersForPokeblocksOnTheAir * PutFanClubSpecialOnTheAir * ContestLiveUpdates_BeforeInterview * Other before-interview Contest Live Updates functions * ContestLiveUpdates_BeforeInterview_5 * InterviewAfter_BravoTrainerPokemonProfile * BravoTrainerPokemonProfile_BeforeInterview1 * BravoTrainerPokemonProfile_BeforeInterview2 * Disassemble TV data * Decompile TV data * InterviewAfter_BravoTrainerBattleTowerProfile * SaveRecordedItemPurchasesForTVShow * PutNameRaterShowOnTheAir * StartMassOutbreak * PutLilycoveContestLadyShowOnTheAir * InterviewAfter_FanClubLetter * Rip TV strings * InterviewAfter_RecentHappenings * InterviewAfter_PkmnFanClubOpinions * sub_80ED718 * EndMassOutbreak * sub_80ED888 * sub_80ED8B4 * UpdateMassOutbreakTimeLeft * sub_80ED950 * PutFishingAdviceShowOnTheAir * through sub_80EDA80 * ewram and common syms are now fetched from the object files * BSS symbols are taken from the tv.o file * through sub_80EDC60 * sub_80EDCE8 * sub_80EDD78 * through sub_80EDE84 * nomatching sub_80EDE98 * sub_80EDFB4 * sub_80EE104 * sub_80EE104 * sub_80EE184 * sub_80EE2CC * sub_80EE35C * sub_80EE44C * sub_80EE4DC * sub_80EE5A4 * sub_80EE69C * sub_80EE72C * sub_80EE7C0 * sub_80EE818 * sub_80EE8C8 * sub_80EEA70 * sub_80EEB98 * sub_80EEBF4 * through sub_80EED60 * Functions relating to Pokemon News * sub_80EEF6C * GetPriceReduction * IsPriceDiscounted * sub_80EF120 * through sub_80EF370 * sub_80EF40C * HasMixableShowAlreadyBeenSpawnedWithPlayerID * TV_SortPurchasesByQuantity * FindActiveBroadcastByShowType_SetScriptResult * InterviewBefore * through sub_80EF88C * through sub_80EF93C * through sub_80EFA24 * through TV_BernoulliTrial * sub_80EFB58 * sub_80EFBA4 * sub_80EFBDC * through sub_80EFD98 * ChangePokemonNickname * ChangeBoxPokemonNickname * sub_80EFF9C * through player_id_to_dword * CheckForBigMovieOrEmergencyNewsOnTV * GetMomOrDadStringForTVMessage * sub_80F01E8 * sub_80F0358 * sub_80F049C * TV record mixing functions * sub_80F06D0 * sub_80F0708 nonmatching * through sub_80F0B24 * sub_80F0B64 * through sub_80F0C04 * sub_80F0C7C * sub_80F0D60 * sub_80F0E58 * sub_80F0E84 * through sub_80F0F24 * sub_80F0F64 * sub_80F1208 * sub_80F1254 * sub_80F1290 * sub_80F12A4 * sub_80F14F8 * DoTVShowTodaysSmartShopper * DoTVShowTheNameRaterShow * DoTVShowPokemonTodaySuccessfulCapture * DoTVShowPokemonTodayFailedCapture * DoTVShowPokemonFanClubLetter * DoTVShowRecentHappenings * DoTVShowPokemonFanClubOpinions * DoTVShowPokemonNewsMassOutbreak * DoTVShowPokemonContestLiveUpdates * DoTVShowPokemonBattleUpdate * DoTVShow3CheersForPokeblocks * DoTVShowInSearchOfTrainers * Label GabbyAndTyData fields; remove ddump comments from data/text/tv.inc * DoTVShowPokemonAngler * DoTVShowTheWorldOfMasters; update RAM symbols and field names * Decorate static functions * DoTVShowTodaysRivalTrainer; region map enums * TVDewfordTrendWatcherNetworkTextGroup * DoTVShowHoennTreasureInvestigators * DoTVShowFindThatGamer * DoTVShowBreakingNewsTV * DoTVShowSecretBaseVisit * DoTVShowPokemonLotterWinnerFlashReport * DoTVShowThePokemonBattleSeminar * DoTVShowTrainerFanClubSpecial, DoTVShowTrainerFanClub * DoTVShowSpotTheCuties * DoTVShowPokemonNewsBattleFrontier * DoTVShowWhatsNo1InHoennToday * Helpers for DoTVShowSecretBaseSecrets * DoTVShowSecretBaseSecrets * DoTVShowSafariFanClub * Finish decompilation of tv.s * Some renaming * Rename text group pointers * revoke statis; pokenews enums * Labels are number one * Label all TV struct fields * Make data/text/tv.inc more readable * Split data/text/tv.inc * Rename pokenews text pointers * Frontier Symbol constants; indicate static rodata objects with 's' prefix * Fix leading spaces/tabs F*** CLion sometimes * Fix inconsequential warning
2017-10-13 11:09:36 -04:00
bl IsStringJapanese
2016-11-01 10:08:48 -07:00
cmp r0, 0
beq _08120D1A
movs r0, 0x1
b _08120D1C
_08120D1A:
movs r0, 0x2
_08120D1C:
strb r0, [r4]
_08120D1E:
adds r4, 0x1
adds r5, 0x7
adds r6, 0x1
cmp r6, 0x3
ble _08120CF2
_08120D28:
add sp, 0x8
pop {r3}
mov r8, r3
pop {r4-r7}
pop {r0}
bx r0
thumb_func_end sub_8120CD0
thumb_func_start sub_8120D34
sub_8120D34: @ 8120D34
push {r4-r7,lr}
adds r3, r0, 0
adds r6, r2, 0
movs r2, 0
subs r1, 0x1
cmp r1, 0x1
bhi _08120D44
movs r2, 0x1
_08120D44:
ldrb r0, [r3]
cmp r0, 0x4
bhi _08120E02
lsls r0, 2
ldr r1, =_08120D58
adds r0, r1
ldr r0, [r0]
mov pc, r0
.pool
.align 2, 0
_08120D58:
.4byte _08120DE6
.4byte _08120DF0
.4byte _08120D6C
.4byte _08120DC6
.4byte _08120DF8
_08120D6C:
adds r7, r3, 0
cmp r2, 0
beq _08120DA4
movs r5, 0
adds r4, r3, 0
adds r4, 0x32
_08120D78:
movs r0, 0xB
muls r0, r5
adds r0, 0x5
adds r1, r7, r0
ldrb r0, [r1]
cmp r0, 0xFC
bne _08120D98
ldrb r0, [r1, 0x1]
cmp r0, 0x15
bne _08120D98
adds r0, r1, 0
2017-01-14 11:53:20 -08:00
bl StripExtCtrlCodes
2016-11-01 10:08:48 -07:00
movs r0, 0x1
strb r0, [r4]
b _08120D9A
_08120D98:
strb r6, [r4]
_08120D9A:
adds r4, 0x1
adds r5, 0x1
cmp r5, 0x3
ble _08120D78
b _08120E02
_08120DA4:
movs r5, 0
adds r4, r3, 0
adds r4, 0x32
_08120DAA:
adds r0, r4, r5
ldrb r0, [r0]
cmp r0, 0x1
bne _08120DBE
movs r0, 0xB
muls r0, r5
adds r0, 0x5
adds r0, r7, r0
2017-01-14 11:53:20 -08:00
bl StripExtCtrlCodes
2016-11-01 10:08:48 -07:00
_08120DBE:
adds r5, 0x1
cmp r5, 0x3
ble _08120DAA
b _08120E02
_08120DC6:
cmp r2, 0
beq _08120E02
movs r1, 0
adds r4, r3, 0x4
adds r2, r3, 0
adds r2, 0x34
_08120DD2:
adds r0, r4, r1
ldrb r0, [r0]
cmp r0, 0
beq _08120DDE
adds r0, r2, r1
strb r6, [r0]
_08120DDE:
adds r1, 0x1
cmp r1, 0x3
ble _08120DD2
b _08120E02
_08120DE6:
cmp r2, 0
beq _08120E02
adds r0, r3, 0
adds r0, 0x2A
b _08120E00
_08120DF0:
cmp r2, 0
beq _08120E02
strb r6, [r3, 0x2]
b _08120E02
_08120DF8:
cmp r2, 0
beq _08120E02
adds r0, r3, 0
adds r0, 0x20
_08120E00:
strb r6, [r0]
_08120E02:
pop {r4-r7}
pop {r0}
bx r0
thumb_func_end sub_8120D34
thumb_func_start sub_8120E08
sub_8120E08: @ 8120E08
push {r4,r5,lr}
2016-11-01 11:35:16 -07:00
ldr r2, =gUnknown_0203A12C
2017-01-14 11:53:20 -08:00
ldr r0, =gSaveBlock1Ptr
2016-11-01 10:08:48 -07:00
ldr r0, [r0]
ldr r1, =0x00002e28
adds r0, r1
str r0, [r2]
movs r3, 0
movs r1, 0x3
strb r1, [r0]
ldr r0, [r2]
strb r3, [r0, 0x1]
movs r5, 0
movs r4, 0xFF
_08120E24:
ldr r0, [r2]
adds r0, 0x4
adds r0, r3
strb r5, [r0]
ldr r1, [r2]
adds r1, 0x8
adds r1, r3
ldrb r0, [r1]
orrs r0, r4
strb r0, [r1]
adds r3, 0x1
cmp r3, 0x3
ble _08120E24
pop {r4,r5}
pop {r0}
bx r0
.pool
thumb_func_end sub_8120E08
thumb_func_start sub_8120E50
sub_8120E50: @ 8120E50
2016-11-01 11:35:16 -07:00
ldr r3, =gUnknown_0203A12C
2017-01-14 11:53:20 -08:00
ldr r0, =gSaveBlock1Ptr
2016-11-01 10:08:48 -07:00
ldr r0, [r0]
ldr r1, =0x00002e28
adds r0, r1
str r0, [r3]
movs r2, 0
movs r1, 0x3
strb r1, [r0]
ldr r0, [r3]
strb r2, [r0, 0x1]
bx lr
.pool
thumb_func_end sub_8120E50
thumb_func_start sub_8120E74
sub_8120E74: @ 8120E74
push {lr}
lsls r0, 24
lsrs r0, 24
cmp r0, 0x32
bne _08120E80
movs r0, 0
_08120E80:
2017-09-03 14:13:01 +02:00
bl GetGameStat
2016-11-01 10:08:48 -07:00
pop {r1}
bx r1
thumb_func_end sub_8120E74
thumb_func_start sub_8120E88
sub_8120E88: @ 8120E88
push {lr}
adds r3, r0, 0
movs r2, 0
ldr r1, =gUnknown_0859F048
_08120E90:
ldrb r0, [r1]
cmp r0, r3
bne _08120EA0
adds r0, r1, 0
b _08120EAA
.pool
_08120EA0:
adds r1, 0x10
adds r2, 0x1
cmp r2, 0x23
ble _08120E90
ldr r0, =gUnknown_0859F278
_08120EAA:
pop {r1}
bx r1
.pool
thumb_func_end sub_8120E88
thumb_func_start sub_8120EB4
sub_8120EB4: @ 8120EB4
push {lr}
bl sub_8120E88
ldr r0, [r0, 0x4]
pop {r1}
bx r1
thumb_func_end sub_8120EB4
thumb_func_start sub_8120EC0
sub_8120EC0: @ 8120EC0
push {lr}
bl sub_8120E88
ldr r0, [r0, 0xC]
pop {r1}
bx r1
thumb_func_end sub_8120EC0
thumb_func_start sub_8120ECC
sub_8120ECC: @ 8120ECC
push {lr}
bl sub_8120E88
ldr r0, [r0, 0x8]
pop {r1}
bx r1
thumb_func_end sub_8120ECC
thumb_func_start sub_8120ED8
sub_8120ED8: @ 8120ED8
push {lr}
movs r1, 0
2016-11-01 11:35:16 -07:00
ldr r2, =gUnknown_0203A12C
2016-11-01 10:08:48 -07:00
ldr r0, [r2]
ldrb r0, [r0, 0x4]
cmp r0, 0
beq _08120EFC
_08120EE6:
adds r0, r1, 0x1
lsls r0, 24
lsrs r1, r0, 24
cmp r1, 0x3
bhi _08120EFC
ldr r0, [r2]
adds r0, 0x4
adds r0, r1
ldrb r0, [r0]
cmp r0, 0
bne _08120EE6
_08120EFC:
adds r0, r1, 0
pop {r1}
bx r1
.pool
thumb_func_end sub_8120ED8
thumb_func_start sub_8120F08
sub_8120F08: @ 8120F08
2016-11-01 11:35:16 -07:00
ldr r1, =gUnknown_0203A12C
2016-11-01 10:08:48 -07:00
lsls r0, 2
adds r0, 0x24
ldr r2, [r1]
adds r2, r0
ldrb r0, [r2]
ldrb r1, [r2, 0x1]
lsls r1, 8
orrs r0, r1
ldrb r1, [r2, 0x2]
lsls r1, 16
orrs r0, r1
ldrb r1, [r2, 0x3]
lsls r1, 24
orrs r0, r1
bx lr
.pool
thumb_func_end sub_8120F08
thumb_func_start sub_8120F2C
sub_8120F2C: @ 8120F2C
2016-11-01 11:35:16 -07:00
ldr r2, =gUnknown_0203A12C
2016-11-01 10:08:48 -07:00
lsls r0, 2
adds r0, 0x24
ldr r2, [r2]
adds r2, r0
strb r1, [r2]
lsrs r0, r1, 8
strb r0, [r2, 0x1]
lsrs r0, r1, 16
strb r0, [r2, 0x2]
lsrs r1, 24
strb r1, [r2, 0x3]
bx lr
.pool
thumb_func_end sub_8120F2C
thumb_func_start sub_8120F4C
sub_8120F4C: @ 8120F4C
push {r4,r5,lr}
adds r5, r0, 0
2016-11-01 11:35:16 -07:00
ldr r0, =gUnknown_0203A12C
2016-11-01 10:08:48 -07:00
ldr r0, [r0]
adds r0, 0x4
adds r0, r5
ldrb r0, [r0]
bl sub_8120E74
adds r4, r0, 0
adds r0, r5, 0
bl sub_8120F08
cmp r4, r0
bhi _08120F74
movs r0, 0
b _08120F76
.pool
_08120F74:
movs r0, 0x1
_08120F76:
pop {r4,r5}
pop {r1}
bx r1
thumb_func_end sub_8120F4C
thumb_func_start sub_8120F7C
sub_8120F7C: @ 8120F7C
push {r4,r5,lr}
adds r5, r1, 0
2016-11-01 11:35:16 -07:00
ldr r2, =gUnknown_0203A12C
2016-11-01 10:08:48 -07:00
lsls r1, r0, 3
subs r1, r0
adds r1, 0x8
ldr r4, [r2]
adds r4, r1
adds r0, r5, 0
movs r1, 0xFF
movs r2, 0x8
bl memset
adds r0, r5, 0
adds r1, r4, 0
movs r2, 0x7
bl memcpy
pop {r4,r5}
pop {r0}
bx r0
.pool
thumb_func_end sub_8120F7C
thumb_func_start sub_8120FAC
sub_8120FAC: @ 8120FAC
push {r4,r5,lr}
adds r5, r1, 0
2016-11-01 11:35:16 -07:00
ldr r2, =gUnknown_0203A12C
2016-11-01 10:08:48 -07:00
lsls r1, r0, 3
subs r1, r0
adds r1, 0x8
ldr r4, [r2]
adds r4, r1
adds r0, r4, 0
movs r1, 0xFF
movs r2, 0x7
bl memset
adds r0, r4, 0
adds r1, r5, 0
movs r2, 0x7
bl memcpy
pop {r4,r5}
pop {r0}
bx r0
.pool
thumb_func_end sub_8120FAC
thumb_func_start sub_8120FDC
sub_8120FDC: @ 8120FDC
push {r4-r6,lr}
mov r6, r9
mov r5, r8
push {r5,r6}
mov r8, r0
adds r6, r1, 0
2016-11-01 11:35:16 -07:00
ldr r0, =gUnknown_0203A12C
2016-11-01 10:08:48 -07:00
mov r9, r0
ldr r0, [r0]
adds r0, 0x4
add r0, r8
strb r6, [r0]
2017-01-14 11:53:20 -08:00
ldr r0, =gSaveBlock2Ptr
2016-11-01 10:08:48 -07:00
ldr r1, [r0]
mov r0, r8
bl sub_8120FAC
lsls r4, r6, 24
lsrs r4, 24
adds r0, r4, 0
bl sub_8120E74
adds r1, r0, 0
mov r0, r8
bl sub_8120F2C
2017-01-14 11:53:20 -08:00
ldr r5, =gStringVar1
2016-11-01 10:08:48 -07:00
adds r0, r4, 0
bl sub_8120E74
adds r1, r0, 0
adds r0, r5, 0
movs r2, 0
movs r3, 0xA
2017-01-14 11:53:20 -08:00
bl ConvertIntToDecimalStringN
ldr r4, =gStringVar2
2016-11-01 10:08:48 -07:00
adds r0, r6, 0
bl sub_8120ECC
adds r1, r0, 0
adds r0, r4, 0
2017-01-14 11:53:20 -08:00
bl StringCopy
2016-11-01 10:08:48 -07:00
mov r1, r9
ldr r0, [r1]
adds r0, 0x34
add r0, r8
2017-02-03 16:44:06 -08:00
ldr r1, =gGameLanguage
2016-11-01 10:08:48 -07:00
ldrb r1, [r1]
strb r1, [r0]
pop {r3,r4}
mov r8, r3
mov r9, r4
pop {r4-r6}
pop {r0}
bx r0
.pool
thumb_func_end sub_8120FDC
thumb_func_start sub_8121064
sub_8121064: @ 8121064
push {r4-r7,lr}
adds r7, r0, 0
adds r6, r1, 0
movs r5, 0
cmp r5, r6
bge _0812107A
_08121070:
adds r0, r7, r5
strb r5, [r0]
adds r5, 0x1
cmp r5, r6
blt _08121070
_0812107A:
cmp r6, 0
ble _081210B0
adds r5, r6, 0
_08121080:
bl Random
2016-11-01 10:08:48 -07:00
lsls r0, 16
lsrs r0, 16
adds r1, r6, 0
bl __modsi3
adds r4, r0, 0
bl Random
2016-11-01 10:08:48 -07:00
lsls r0, 16
lsrs r0, 16
adds r1, r6, 0
bl __modsi3
adds r4, r7, r4
ldrb r2, [r4]
adds r0, r7, r0
ldrb r1, [r0]
strb r1, [r4]
strb r2, [r0]
subs r5, 0x1
cmp r5, 0
bne _08121080
_081210B0:
pop {r4-r7}
pop {r0}
bx r0
thumb_func_end sub_8121064
thumb_func_start sub_81210B8
sub_81210B8: @ 81210B8
push {r4-r7,lr}
mov r7, r9
mov r6, r8
push {r6,r7}
mov r7, sp
mov r8, sp
ldr r0, =gUnknown_0859F288
ldr r0, [r0]
lsls r0, 3
lsrs r0, 3
adds r0, 0x3
lsrs r0, 2
lsls r0, 2
mov r1, sp
subs r1, r0
mov sp, r1
mov r9, sp
mov r0, sp
movs r1, 0x24
bl sub_8121064
movs r5, 0
_081210E4:
ldr r1, =gUnknown_0859F048
mov r2, r9
adds r0, r2, r5
ldrb r0, [r0]
lsls r0, 4
adds r0, r1
ldrb r4, [r0]
ldrb r6, [r0, 0x1]
movs r1, 0
2016-11-01 11:35:16 -07:00
ldr r2, =gUnknown_0203A12C
2016-11-01 10:08:48 -07:00
ldr r0, [r2]
ldrb r0, [r0, 0x4]
cmp r0, r4
beq _08121112
_08121100:
adds r1, 0x1
cmp r1, 0x3
bgt _08121112
ldr r0, [r2]
adds r0, 0x4
adds r0, r1
ldrb r0, [r0]
cmp r0, r4
bne _08121100
_08121112:
cmp r1, 0x4
bne _08121162
adds r0, r4, 0
bl sub_8120E74
cmp r0, r6
bcc _08121162
2016-11-01 11:35:16 -07:00
ldr r0, =gUnknown_0203A12C
2016-11-01 10:08:48 -07:00
ldr r1, [r0]
movs r0, 0x1
strb r0, [r1, 0x1]
bl sub_8120ED8
lsls r0, 24
lsrs r0, 24
cmp r0, 0x4
bne _08121150
2016-11-01 11:35:16 -07:00
ldr r0, =gUnknown_03001178
2016-11-01 10:08:48 -07:00
ldrb r0, [r0]
adds r1, r4, 0
bl sub_8120FDC
b _0812115E
.pool
_08121150:
bl sub_8120ED8
lsls r0, 24
lsrs r0, 24
adds r1, r4, 0
bl sub_8120FDC
_0812115E:
movs r0, 0x1
b _0812116A
_08121162:
adds r5, 0x1
cmp r5, 0x23
ble _081210E4
movs r0, 0
_0812116A:
mov sp, r8
pop {r3,r4}
mov r8, r3
mov r9, r4
pop {r4-r7}
pop {r1}
bx r1
thumb_func_end sub_81210B8
thumb_func_start sub_8121178
sub_8121178: @ 8121178
push {r4-r6,lr}
mov r6, r8
push {r6}
adds r5, r0, 0
2016-11-01 11:35:16 -07:00
ldr r6, =gUnknown_0203A12C
2016-11-01 10:08:48 -07:00
ldr r0, [r6]
adds r0, 0x4
adds r0, r5
ldrb r0, [r0]
mov r8, r0
2017-01-14 11:53:20 -08:00
ldr r4, =gStringVar1
2016-11-01 10:08:48 -07:00
adds r0, r5, 0
bl sub_8120F08
adds r1, r0, 0
adds r0, r4, 0
movs r2, 0
movs r3, 0xA
2017-01-14 11:53:20 -08:00
bl ConvertIntToDecimalStringN
ldr r4, =gStringVar2
2016-11-01 10:08:48 -07:00
mov r0, r8
bl sub_8120ECC
adds r1, r0, 0
adds r0, r4, 0
2017-01-14 11:53:20 -08:00
bl StringCopy
ldr r4, =gStringVar3
2016-11-01 10:08:48 -07:00
adds r0, r5, 0
adds r1, r4, 0
bl sub_8120F7C
ldr r0, [r6]
adds r0, 0x34
adds r0, r5
ldrb r1, [r0]
adds r0, r4, 0
2017-01-14 11:53:20 -08:00
bl ConvertInternationalString
2016-11-01 10:08:48 -07:00
mov r0, r8
bl sub_8120EC0
Decompile TV (#80) * ClearTVShowData * special_0x44 * DoTVShow (nonmatching because align) * DoTVShowBravoTrainerPokemonProfile * Update field names * DoTVShowBravoTrainerBattleTower * Renaming of struct fields * sub_80EBFF4 and UpdateTVScreensOnMap * SetTVMetatilesOnMap * Power buttons for the TV screens on the map * special_0x45 * sub_80EC18C * special_0x4a * ResetGabbyAndTy * GabbyAndTyBeforeInterview * GabbyAndTyAfterInterview * Through IsTVShowInSearchOfTrainersAiring * GabbyAndTyGetLastQuote * GabbyAndTyGetLastBattleTrivia * GabbyAndTySetScriptVarsToFieldObjectLocalIds * InterviewAfter; use TVShow as a precursor for making the individual show structs anonymous * Make TV structs anonymous within the union * Move the TV union to its own subheader * Move TV show enums to the global.tv.h subheader * Funcion renaming * Apply static attributes where able * PutPokemonTodayCaughtOnAir * sub_80EC8A4 * PutPokemonTodayFailedOnTheAir * sub_80EC9E8, sub_80ECA10 * sub_80ECA38 * sub_80ECB00 * Put3CheersForPokeblocksOnTheAir * PutFanClubSpecialOnTheAir * ContestLiveUpdates_BeforeInterview * Other before-interview Contest Live Updates functions * ContestLiveUpdates_BeforeInterview_5 * InterviewAfter_BravoTrainerPokemonProfile * BravoTrainerPokemonProfile_BeforeInterview1 * BravoTrainerPokemonProfile_BeforeInterview2 * Disassemble TV data * Decompile TV data * InterviewAfter_BravoTrainerBattleTowerProfile * SaveRecordedItemPurchasesForTVShow * PutNameRaterShowOnTheAir * StartMassOutbreak * PutLilycoveContestLadyShowOnTheAir * InterviewAfter_FanClubLetter * Rip TV strings * InterviewAfter_RecentHappenings * InterviewAfter_PkmnFanClubOpinions * sub_80ED718 * EndMassOutbreak * sub_80ED888 * sub_80ED8B4 * UpdateMassOutbreakTimeLeft * sub_80ED950 * PutFishingAdviceShowOnTheAir * through sub_80EDA80 * ewram and common syms are now fetched from the object files * BSS symbols are taken from the tv.o file * through sub_80EDC60 * sub_80EDCE8 * sub_80EDD78 * through sub_80EDE84 * nomatching sub_80EDE98 * sub_80EDFB4 * sub_80EE104 * sub_80EE104 * sub_80EE184 * sub_80EE2CC * sub_80EE35C * sub_80EE44C * sub_80EE4DC * sub_80EE5A4 * sub_80EE69C * sub_80EE72C * sub_80EE7C0 * sub_80EE818 * sub_80EE8C8 * sub_80EEA70 * sub_80EEB98 * sub_80EEBF4 * through sub_80EED60 * Functions relating to Pokemon News * sub_80EEF6C * GetPriceReduction * IsPriceDiscounted * sub_80EF120 * through sub_80EF370 * sub_80EF40C * HasMixableShowAlreadyBeenSpawnedWithPlayerID * TV_SortPurchasesByQuantity * FindActiveBroadcastByShowType_SetScriptResult * InterviewBefore * through sub_80EF88C * through sub_80EF93C * through sub_80EFA24 * through TV_BernoulliTrial * sub_80EFB58 * sub_80EFBA4 * sub_80EFBDC * through sub_80EFD98 * ChangePokemonNickname * ChangeBoxPokemonNickname * sub_80EFF9C * through player_id_to_dword * CheckForBigMovieOrEmergencyNewsOnTV * GetMomOrDadStringForTVMessage * sub_80F01E8 * sub_80F0358 * sub_80F049C * TV record mixing functions * sub_80F06D0 * sub_80F0708 nonmatching * through sub_80F0B24 * sub_80F0B64 * through sub_80F0C04 * sub_80F0C7C * sub_80F0D60 * sub_80F0E58 * sub_80F0E84 * through sub_80F0F24 * sub_80F0F64 * sub_80F1208 * sub_80F1254 * sub_80F1290 * sub_80F12A4 * sub_80F14F8 * DoTVShowTodaysSmartShopper * DoTVShowTheNameRaterShow * DoTVShowPokemonTodaySuccessfulCapture * DoTVShowPokemonTodayFailedCapture * DoTVShowPokemonFanClubLetter * DoTVShowRecentHappenings * DoTVShowPokemonFanClubOpinions * DoTVShowPokemonNewsMassOutbreak * DoTVShowPokemonContestLiveUpdates * DoTVShowPokemonBattleUpdate * DoTVShow3CheersForPokeblocks * DoTVShowInSearchOfTrainers * Label GabbyAndTyData fields; remove ddump comments from data/text/tv.inc * DoTVShowPokemonAngler * DoTVShowTheWorldOfMasters; update RAM symbols and field names * Decorate static functions * DoTVShowTodaysRivalTrainer; region map enums * TVDewfordTrendWatcherNetworkTextGroup * DoTVShowHoennTreasureInvestigators * DoTVShowFindThatGamer * DoTVShowBreakingNewsTV * DoTVShowSecretBaseVisit * DoTVShowPokemonLotterWinnerFlashReport * DoTVShowThePokemonBattleSeminar * DoTVShowTrainerFanClubSpecial, DoTVShowTrainerFanClub * DoTVShowSpotTheCuties * DoTVShowPokemonNewsBattleFrontier * DoTVShowWhatsNo1InHoennToday * Helpers for DoTVShowSecretBaseSecrets * DoTVShowSecretBaseSecrets * DoTVShowSafariFanClub * Finish decompilation of tv.s * Some renaming * Rename text group pointers * revoke statis; pokenews enums * Labels are number one * Label all TV struct fields * Make data/text/tv.inc more readable * Split data/text/tv.inc * Rename pokenews text pointers * Frontier Symbol constants; indicate static rodata objects with 's' prefix * Fix leading spaces/tabs F*** CLion sometimes * Fix inconsequential warning
2017-10-13 11:09:36 -04:00
bl ShowFieldMessage
2016-11-01 10:08:48 -07:00
pop {r3}
mov r8, r3
pop {r4-r6}
pop {r0}
bx r0
.pool
thumb_func_end sub_8121178
thumb_func_start sub_81211EC
sub_81211EC: @ 81211EC
push {r4,r5,lr}
sub sp, 0xC
2017-09-20 14:38:05 -05:00
ldr r1, =gText_Exit
2016-11-01 10:08:48 -07:00
movs r0, 0x1
movs r2, 0
bl GetStringWidth
adds r5, r0, 0
movs r4, 0
2016-11-01 11:35:16 -07:00
ldr r0, =gUnknown_0203A12C
2016-11-01 10:08:48 -07:00
ldr r0, [r0]
ldrb r0, [r0, 0x4]
cmp r0, 0
beq _08121230
_08121208:
bl sub_8120EB4
adds r1, r0, 0
movs r0, 0x1
movs r2, 0
bl GetStringWidth
cmp r0, r5
ble _0812121C
adds r5, r0, 0
_0812121C:
adds r4, 0x1
cmp r4, 0x3
bgt _08121230
2016-11-01 11:35:16 -07:00
ldr r0, =gUnknown_0203A12C
2016-11-01 10:08:48 -07:00
ldr r0, [r0]
adds r0, 0x4
adds r0, r4
ldrb r0, [r0]
cmp r0, 0
bne _08121208
_08121230:
adds r0, r5, 0
bl convert_pixel_width_to_tile_width
adds r4, r0, 0
lsls r4, 24
lsrs r4, 24
bl sub_8120ED8
adds r3, r0, 0
lsls r3, 25
movs r0, 0x80
lsls r0, 18
adds r3, r0
lsrs r3, 24
movs r0, 0
movs r1, 0
adds r2, r4, 0
bl CreateWindowFromRect
2016-11-01 11:35:16 -07:00
ldr r1, =gUnknown_0203A130
2016-11-01 10:08:48 -07:00
strb r0, [r1]
ldrb r0, [r1]
movs r1, 0
bl SetStandardWindowBorderStyle
movs r4, 0
2016-11-01 11:35:16 -07:00
ldr r0, =gUnknown_0203A12C
2016-11-01 10:08:48 -07:00
ldr r0, [r0]
ldrb r0, [r0, 0x4]
cmp r0, 0
beq _081212AA
movs r5, 0x80
lsls r5, 17
_08121272:
bl sub_8120EB4
adds r2, r0, 0
2016-11-01 11:35:16 -07:00
ldr r0, =gUnknown_0203A130
2016-11-01 10:08:48 -07:00
ldrb r0, [r0]
lsrs r1, r5, 24
str r1, [sp]
movs r1, 0xFF
str r1, [sp, 0x4]
movs r1, 0
str r1, [sp, 0x8]
movs r1, 0x1
movs r3, 0x8
2017-09-05 13:01:24 +02:00
bl PrintTextOnWindow
2016-11-01 10:08:48 -07:00
movs r0, 0x80
lsls r0, 21
adds r5, r0
adds r4, 0x1
cmp r4, 0x3
bgt _081212AA
2016-11-01 11:35:16 -07:00
ldr r0, =gUnknown_0203A12C
2016-11-01 10:08:48 -07:00
ldr r0, [r0]
adds r0, 0x4
adds r0, r4
ldrb r0, [r0]
cmp r0, 0
bne _08121272
_081212AA:
2016-11-01 11:35:16 -07:00
ldr r5, =gUnknown_0203A130
2016-11-01 10:08:48 -07:00
ldrb r0, [r5]
2017-09-20 14:38:05 -05:00
ldr r2, =gText_Exit
2016-11-01 10:08:48 -07:00
lsls r1, r4, 4
adds r1, 0x1
lsls r1, 24
lsrs r1, 24
str r1, [sp]
movs r1, 0xFF
str r1, [sp, 0x4]
movs r1, 0
str r1, [sp, 0x8]
movs r1, 0x1
movs r3, 0x8
2017-09-05 13:01:24 +02:00
bl PrintTextOnWindow
2016-11-01 10:08:48 -07:00
ldrb r4, [r5]
bl sub_8120ED8
adds r1, r0, 0
adds r1, 0x1
lsls r1, 24
lsrs r1, 24
adds r0, r4, 0
movs r2, 0
bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed
ldrb r0, [r5]
movs r1, 0x3
bl CopyWindowToVram
add sp, 0xC
pop {r4,r5}
pop {r0}
bx r0
.pool
thumb_func_end sub_81211EC
thumb_func_start sub_81212FC
sub_81212FC: @ 81212FC
push {r4-r6,lr}
lsls r0, 24
lsrs r6, r0, 24
lsls r0, r6, 2
adds r0, r6
lsls r0, 3
2016-11-01 11:35:16 -07:00
ldr r1, =gTasks
2016-11-01 10:08:48 -07:00
adds r4, r0, r1
movs r0, 0x8
ldrsh r5, [r4, r0]
cmp r5, 0
beq _08121320
cmp r5, 0x1
beq _0812132C
b _08121376
.pool
_08121320:
bl sub_81211EC
ldrh r0, [r4, 0x8]
adds r0, 0x1
strh r0, [r4, 0x8]
b _08121376
_0812132C:
bl ProcessMenuInput
lsls r0, 24
asrs r4, r0, 24
movs r0, 0x2
negs r0, r0
cmp r4, r0
beq _08121376
adds r0, 0x1
cmp r4, r0
beq _0812134E
bl sub_8120ED8
lsls r0, 24
lsrs r0, 24
cmp r4, r0
bne _0812135C
_0812134E:
2017-11-10 18:12:18 -06:00
ldr r1, =gSpecialVar_Result
2016-11-01 10:08:48 -07:00
movs r0, 0
strh r0, [r1]
b _08121364
.pool
_0812135C:
2017-11-10 18:12:18 -06:00
ldr r0, =gSpecialVar_Result
2016-11-01 10:08:48 -07:00
strh r5, [r0]
2016-11-01 11:35:16 -07:00
ldr r0, =gUnknown_03001178
2016-11-01 10:08:48 -07:00
strb r4, [r0]
_08121364:
2016-11-01 11:35:16 -07:00
ldr r0, =gUnknown_0203A130
2016-11-01 10:08:48 -07:00
ldrb r0, [r0]
bl sub_80E2A78
adds r0, r6, 0
bl DestroyTask
2017-09-10 23:05:23 +02:00
bl EnableBothScriptContexts
2016-11-01 10:08:48 -07:00
_08121376:
pop {r4-r6}
pop {r0}
bx r0
.pool
thumb_func_end sub_81212FC
thumb_func_start sub_8121388
sub_8121388: @ 8121388
push {lr}
ldr r0, =sub_81212FC
movs r1, 0x50
bl CreateTask
pop {r0}
bx r0
.pool
thumb_func_end sub_8121388
thumb_func_start sub_812139C
sub_812139C: @ 812139C
push {lr}
2016-11-01 11:35:16 -07:00
ldr r0, =gUnknown_03001178
2016-11-01 10:08:48 -07:00
ldrb r0, [r0]
bl sub_8121178
pop {r0}
bx r0
.pool
thumb_func_end sub_812139C
thumb_func_start sub_81213B0
sub_81213B0: @ 81213B0
push {lr}
2016-11-01 11:35:16 -07:00
ldr r1, =gUnknown_0203A12C
2017-01-14 11:53:20 -08:00
ldr r0, =gSaveBlock1Ptr
2016-11-01 10:08:48 -07:00
ldr r0, [r0]
ldr r2, =0x00002e28
adds r0, r2
str r0, [r1]
bl sub_8120ED8
lsls r0, 24
lsrs r0, 24
pop {r1}
bx r1
.pool
thumb_func_end sub_81213B0
thumb_func_start sub_81213D8
sub_81213D8: @ 81213D8
push {r4,r5,lr}
2016-11-01 11:35:16 -07:00
ldr r2, =gUnknown_0203A12C
2017-01-14 11:53:20 -08:00
ldr r0, =gSaveBlock1Ptr
2016-11-01 10:08:48 -07:00
ldr r1, [r0]
ldr r3, =0x00002e28
adds r0, r1, r3
str r0, [r2]
2016-11-01 11:35:16 -07:00
ldr r5, =gUnknown_03001178
2016-11-01 10:08:48 -07:00
ldrb r0, [r5]
ldr r2, =0x00002e2c
adds r1, r2
adds r1, r0
ldrb r4, [r1]
bl sub_8120F4C
cmp r0, 0x1
beq _08121414
movs r0, 0
b _0812141E
.pool
_08121414:
ldrb r0, [r5]
adds r1, r4, 0
bl sub_8120FDC
movs r0, 0x1
_0812141E:
pop {r4,r5}
pop {r1}
bx r1
thumb_func_end sub_81213D8
thumb_func_start sub_8121424
sub_8121424: @ 8121424
push {lr}
2016-11-01 11:35:16 -07:00
ldr r1, =gUnknown_0203A12C
2017-01-14 11:53:20 -08:00
ldr r0, =gSaveBlock1Ptr
2016-11-01 10:08:48 -07:00
ldr r0, [r0]
ldr r2, =0x00002e28
adds r0, r2
str r0, [r1]
ldrb r0, [r0, 0x1]
cmp r0, 0
beq _08121448
movs r0, 0x1
b _0812144A
.pool
_08121448:
movs r0, 0
_0812144A:
pop {r1}
bx r1
thumb_func_end sub_8121424
thumb_func_start sub_8121450
sub_8121450: @ 8121450
push {lr}
2016-11-01 11:35:16 -07:00
ldr r1, =gUnknown_0203A12C
2017-01-14 11:53:20 -08:00
ldr r0, =gSaveBlock1Ptr
2016-11-01 10:08:48 -07:00
ldr r0, [r0]
ldr r2, =0x00002e28
adds r0, r2
str r0, [r1]
bl sub_81210B8
lsls r0, 24
lsrs r0, 24
pop {r1}
bx r1
.pool
thumb_func_end sub_8121450
.align 2, 0 @ Don't pad with nop.