diff options
Diffstat (limited to 'engine/phone')
-rw-r--r-- | engine/phone/buenas_password.asm | 1 | ||||
-rw-r--r-- | engine/phone/generic_calls.asm | 1 | ||||
-rw-r--r-- | engine/phone/phone.asm | 115 | ||||
-rw-r--r-- | engine/phone/phone_scripts.asm | 1 | ||||
-rw-r--r-- | engine/phone/phonering_copytilemapatonce.asm | 4 |
5 files changed, 45 insertions, 77 deletions
diff --git a/engine/phone/buenas_password.asm b/engine/phone/buenas_password.asm index 82a696648..68c5c01b9 100644 --- a/engine/phone/buenas_password.asm +++ b/engine/phone/buenas_password.asm @@ -165,6 +165,5 @@ BuenaPhoneScript_Random1: .two writetext UnknownText_0xa1e2f end -; a0c28 INCLUDE "data/phone/text/buena.asm" diff --git a/engine/phone/generic_calls.asm b/engine/phone/generic_calls.asm index b3b3eb56a..359d0146b 100644 --- a/engine/phone/generic_calls.asm +++ b/engine/phone/generic_calls.asm @@ -1254,7 +1254,6 @@ PhoneScript_MonFlavorText: farwritetext UnknownText_0x1b522b buttonsound farjump PhoneScript_HangupText_Male -; be643 GrandmaString: db "Grandma@" diff --git a/engine/phone/phone.asm b/engine/phone/phone.asm index 41f7bf47f..019fc7e07 100644 --- a/engine/phone/phone.asm +++ b/engine/phone/phone.asm @@ -1,4 +1,4 @@ -AddPhoneNumber:: ; 90000 +AddPhoneNumber:: call _CheckCellNum jr c, .cant_add call Phone_FindOpenSlot @@ -10,10 +10,9 @@ AddPhoneNumber:: ; 90000 .cant_add scf ret -; 9000f -DelCellNum:: ; 9000f +DelCellNum:: call _CheckCellNum jr nc, .not_in_list xor a @@ -23,13 +22,11 @@ DelCellNum:: ; 9000f .not_in_list scf ret -; 90019 -CheckCellNum:: ; 90019 +CheckCellNum:: jp _CheckCellNum ; wtf -; 9001c -_CheckCellNum: ; 9001c +_CheckCellNum: ld hl, wPhoneList ld b, CONTACT_LIST_SIZE .loop @@ -45,9 +42,8 @@ _CheckCellNum: ; 9001c dec hl scf ret -; 9002d -Phone_FindOpenSlot: ; 9002d +Phone_FindOpenSlot: call GetRemainingSpaceInPhoneList ld b, a ld hl, wPhoneList @@ -64,9 +60,8 @@ Phone_FindOpenSlot: ; 9002d dec hl scf ret -; 90040 -GetRemainingSpaceInPhoneList: ; 90040 +GetRemainingSpaceInPhoneList: xor a ld [wBuffer1], a ld hl, PermanentNumbers @@ -96,12 +91,11 @@ GetRemainingSpaceInPhoneList: ; 90040 ld hl, wBuffer1 sub [hl] ret -; 90066 INCLUDE "data/phone/permanent_numbers.asm" -FarPlaceString: ; 90069 +FarPlaceString: ld a, [hROMBank] push af ld a, b @@ -112,10 +106,9 @@ FarPlaceString: ; 90069 pop af rst Bankswitch ret -; 90074 -CheckPhoneCall:: ; 90074 (24:4074) +CheckPhoneCall:: ; Check if the phone is ringing in the overworld. call CheckStandingOnEntrance @@ -151,11 +144,11 @@ CheckPhoneCall:: ; 90074 (24:4074) xor a ret -.timecheck ; 900a6 (24:40a6) +.timecheck farcall CheckReceiveCallTimer ret -CheckPhoneContactTimeOfDay: ; 900ad (24:40ad) +CheckPhoneContactTimeOfDay: push hl push bc push de @@ -171,7 +164,7 @@ CheckPhoneContactTimeOfDay: ; 900ad (24:40ad) pop hl ret -ChooseRandomCaller: ; 900bf (24:40bf) +ChooseRandomCaller: ; If no one is available to call, don't return anything. ld a, [wEngineBuffer3] and a @@ -198,7 +191,7 @@ ChooseRandomCaller: ; 900bf (24:40bf) xor a ret -GetAvailableCallers: ; 900de (24:40de) +GetAvailableCallers: farcall CheckTime ld a, c ld [wEngineBuffer1], a @@ -246,7 +239,7 @@ GetAvailableCallers: ; 900de (24:40de) jr nz, .loop ret -CheckSpecialPhoneCall:: ; 90136 (24:4136) +CheckSpecialPhoneCall:: ld a, [wSpecialPhoneCallID] and a jr z, .NoPhoneCall @@ -288,14 +281,13 @@ CheckSpecialPhoneCall:: ; 90136 (24:4136) .NoPhoneCall: xor a ret -; 90173 (24:4173) .script ; 0x90173 pause 30 jump Script_ReceivePhoneCall ; 0x90178 -.DoSpecialPhoneCall: ; 90178 (24:4178) +.DoSpecialPhoneCall: ld a, [wSpecialPhoneCallID] dec a ld c, a @@ -305,7 +297,7 @@ CheckSpecialPhoneCall:: ; 90136 (24:4136) call AddNTimes ret -SpecialCallOnlyWhenOutside: ; 90188 +SpecialCallOnlyWhenOutside: ld a, [wEnvironment] cp TOWN jr z, .outside @@ -318,11 +310,11 @@ SpecialCallOnlyWhenOutside: ; 90188 scf ret -SpecialCallWhereverYouAre: ; 90197 +SpecialCallWhereverYouAre: scf ret -Function90199: ; 90199 (24:4199) +Function90199: ; Don't do the call if you're in a link communication ld a, [wLinkMode] and a @@ -388,7 +380,6 @@ Function90199: ; 90199 (24:4199) ld de, UnknownScript_0x90205 call ExecuteCallbackScript ret -; 90205 (24:4205) UnknownScript_0x90205: ; 0x90205 ptcall wd002 @@ -400,7 +391,7 @@ UnknownScript_0x90209: ; 0x90209 return ; 0x9020d -LoadCallerScript: ; 9020d (24:420d) +LoadCallerScript: nop nop ld a, e @@ -422,9 +413,8 @@ LoadCallerScript: ; 9020d (24:420d) ld bc, 12 call FarCopyBytes ret -; 90233 (24:4233) -WrongNumber: ; 90233 +WrongNumber: db TRAINER_NONE, PHONE_00 dba .script .script @@ -434,7 +424,6 @@ WrongNumber: ; 90233 ; Huh? Sorry, wrong number! text_jump UnknownText_0x1c5565 db "@" -; 90241 Script_ReceivePhoneCall: ; 0x90241 refreshscreen @@ -454,7 +443,6 @@ Script_SpecialBillCall:: ; 0x90255 .LoadBillScript: ld e, PHONE_BILL jp LoadCallerScript -; 90261 UnknownScript_0x90261: ; 0x90261 callasm .LoadElmScript @@ -464,16 +452,14 @@ UnknownScript_0x90261: ; 0x90261 .LoadElmScript: ld e, PHONE_ELM jp LoadCallerScript -; 9026f -RingTwice_StartCall: ; 9026f +RingTwice_StartCall: call .Ring call .Ring farcall StubbedTrainerRankings_PhoneCalls ret -; 9027c -.Ring: ; 9027c (24:427c) +.Ring: call Phone_StartRinging call Phone_Wait20Frames call Phone_CallerTextboxWithName @@ -483,13 +469,13 @@ RingTwice_StartCall: ; 9026f call Phone_CallerTextboxWithName ret -Phone_CallerTextboxWithName: ; 90292 (24:4292) +Phone_CallerTextboxWithName: ld a, [wCurrentCaller] ld b, a call Function90363 ret -PhoneCall:: ; 9029a +PhoneCall:: ld a, b ld [wPhoneScriptBank], a ld a, e @@ -500,9 +486,8 @@ PhoneCall:: ; 9029a call Phone_FirstOfTwoRings farcall StubbedTrainerRankings_PhoneCalls ret -; 902b3 -Phone_FirstOfTwoRings: ; 902b3 +Phone_FirstOfTwoRings: call Phone_StartRinging call Phone_Wait20Frames call Phone_CallerTextboxWithName2 @@ -511,9 +496,8 @@ Phone_FirstOfTwoRings: ; 902b3 call Phone_Wait20Frames call Phone_CallerTextboxWithName2 ret -; 902c9 -Phone_CallerTextboxWithName2: ; 902c9 +Phone_CallerTextboxWithName2: call Phone_CallerTextbox hlcoord 1, 2 ld [hl], "☎" @@ -527,15 +511,14 @@ Phone_CallerTextboxWithName2: ; 902c9 ld d, a call FarPlaceString ret -; 902e3 -Phone_NoSignal: ; 902e3 (24:42e3) +Phone_NoSignal: ld de, SFX_NO_SIGNAL call PlaySFX jr Phone_CallEnd -HangUp:: ; 902eb +HangUp:: call HangUp_Beep call HangUp_Wait20Frames Phone_CallEnd: @@ -552,33 +535,28 @@ Phone_CallEnd: call HangUp_BoopOff call HangUp_Wait20Frames ret -; 90316 -Function90316: ; 90316 +Function90316: ld de, SFX_SHUT_DOWN_PC call PlaySFX ret -; 9031d -HangUp_Beep: ; 9031d +HangUp_Beep: ld hl, UnknownText_0x9032a call PrintText ld de, SFX_HANG_UP call PlaySFX ret -; 9032a -UnknownText_0x9032a: ; 9032a +UnknownText_0x9032a: text_jump UnknownText_0x1c5580 db "@" -; 9032f -HangUp_BoopOn: ; 9032f +HangUp_BoopOn: ld hl, UnknownText_0x90336 call PrintText ret -; 90336 UnknownText_0x90336: ; 0x90336 text_jump UnknownText_0x1c5588 @@ -586,12 +564,11 @@ UnknownText_0x90336: ; 0x90336 ; 0x9033b -HangUp_BoopOff: ; 9033b +HangUp_BoopOff: call SpeechTextBox ret -; 9033f -Phone_StartRinging: ; 9033f +Phone_StartRinging: call WaitSFX ld de, SFX_CALL call PlaySFX @@ -599,9 +576,8 @@ Phone_StartRinging: ; 9033f call UpdateSprites farcall PhoneRing_CopyTilemapAtOnce ret -; 90355 -HangUp_Wait20Frames: ; 90355 +HangUp_Wait20Frames: jr Phone_Wait20Frames Phone_Wait20Frames: @@ -609,10 +585,9 @@ Phone_Wait20Frames: call DelayFrames farcall PhoneRing_CopyTilemapAtOnce ret -; 90363 -Function90363: ; 90363 (24:4363) +Function90363: push bc call Phone_CallerTextbox hlcoord 1, 1 @@ -626,16 +601,15 @@ Function90363: ; 90363 (24:4363) ret -Phone_CallerTextbox: ; 90375 +Phone_CallerTextbox: hlcoord 0, 0 ld b, 2 ld c, SCREEN_WIDTH - 2 call TextBox ret -; 90380 -Function90380: ; 90380 (24:4380) +Function90380: ld h, d ld l, e ld a, b @@ -643,7 +617,7 @@ Function90380: ; 90380 (24:4380) call GetCallerName ret -CheckCanDeletePhoneNumber: ; 9038a (24:438a) +CheckCanDeletePhoneNumber: ld a, c call GetCallerTrainerClass ld a, c @@ -657,7 +631,7 @@ CheckCanDeletePhoneNumber: ; 9038a (24:438a) ld c, $1 ret -GetCallerTrainerClass: ; 9039a +GetCallerTrainerClass: push hl ld hl, PhoneContacts + PHONE_CONTACT_TRAINER_CLASS ld bc, PHONE_TABLE_WIDTH @@ -667,10 +641,9 @@ GetCallerTrainerClass: ; 9039a ld c, a pop hl ret -; 903a9 -GetCallerName: ; 903a9 (24:43a9) +GetCallerName: ld a, c and a jr z, .NotTrainer @@ -702,11 +675,10 @@ GetCallerName: ; 903a9 (24:43a9) pop hl call PlaceString ret -; 903d6 (24:43d6) INCLUDE "data/phone/non_trainer_names.asm" -Phone_GetTrainerName: ; 90423 (24:4423) +Phone_GetTrainerName: push hl push bc farcall GetTrainerName @@ -714,7 +686,7 @@ Phone_GetTrainerName: ; 90423 (24:4423) pop hl ret -Phone_GetTrainerClassName: ; 9042e (24:442e) +Phone_GetTrainerClassName: push hl push bc farcall GetTrainerClassName @@ -722,7 +694,7 @@ Phone_GetTrainerClassName: ; 9042e (24:442e) pop hl ret -GetCallerLocation: ; 90439 +GetCallerLocation: ld a, [wCurrentCaller] call GetCallerTrainerClass ld d, c @@ -742,7 +714,6 @@ GetCallerLocation: ; 90439 pop bc pop de ret -; 9045f INCLUDE "data/phone/phone_contacts.asm" diff --git a/engine/phone/phone_scripts.asm b/engine/phone/phone_scripts.asm index 6a4813634..45856ad46 100644 --- a/engine/phone/phone_scripts.asm +++ b/engine/phone/phone_scripts.asm @@ -294,7 +294,6 @@ ElmPhoneScript2: ; 0xbd081 farwritetext ElmPhoneUnusedText specialphonecall SPECIALCALL_NONE end -; bd0d0 ; Jack diff --git a/engine/phone/phonering_copytilemapatonce.asm b/engine/phone/phonering_copytilemapatonce.asm index b0d4ffa1e..41f92a5e3 100644 --- a/engine/phone/phonering_copytilemapatonce.asm +++ b/engine/phone/phonering_copytilemapatonce.asm @@ -1,4 +1,4 @@ -PhoneRing_CopyTilemapAtOnce: ; 4d188 +PhoneRing_CopyTilemapAtOnce: ld a, [hCGB] and a jp z, WaitBGMap @@ -41,7 +41,7 @@ PhoneRing_CopyTilemapAtOnce: ; 4d188 ld [hBGMapMode], a ret -.CopyTilemapAtOnce: ; 4d1cb +.CopyTilemapAtOnce: ld [hSPBuffer], sp ld sp, hl ld a, [hBGMapAddress + 1] |