diff options
author | PikalaxALT <PikalaxALT@gmail.com> | 2015-12-17 22:31:16 -0500 |
---|---|---|
committer | PikalaxALT <PikalaxALT@gmail.com> | 2015-12-17 22:31:16 -0500 |
commit | d644406f61983be78339a0e9f366e8d34c209c6c (patch) | |
tree | feb8188bd644c8642b41d72d7fccfa274696064d /event | |
parent | fe4ef4e5951e855174cbff3da308b342b0b5bd09 (diff) |
More menu stuff
Diffstat (limited to 'event')
-rwxr-xr-x | event/basement_key.asm | 4 | ||||
-rw-r--r-- | event/battle_tower.asm | 110 | ||||
-rw-r--r-- | event/buena.asm | 34 | ||||
-rwxr-xr-x | event/elevator.asm | 2 | ||||
-rw-r--r-- | event/kurt.asm | 16 |
5 files changed, 83 insertions, 83 deletions
diff --git a/event/basement_key.asm b/event/basement_key.asm index 6b32049a8..8fa47df5f 100755 --- a/event/basement_key.asm +++ b/event/basement_key.asm @@ -18,12 +18,12 @@ _BasementKey: ; 507b4 ; Let's use the Basement Key ld hl, .BasementKeyScript call QueueScript - ld a, 1 + ld a, TRUE ld [wItemEffectSucceeded], a ret .nope - ld a, $0 + ld a, FALSE ld [wItemEffectSucceeded], a ret ; 507e1 diff --git a/event/battle_tower.asm b/event/battle_tower.asm index 9c494b168..a938e34c7 100644 --- a/event/battle_tower.asm +++ b/event/battle_tower.asm @@ -1,29 +1,29 @@ -Function8b1e1: ; 8b1e1 - ld de, Unknown_8b1ed - call Function8b25b +CheckForMobileBattleRules: ; 8b1e1 + ld de, .PointerTables + call BattleTower_ExecuteJumptable ret z - call Function8b231 + call BattleTower_PleaseReturnWhenReady scf ret ; 8b1ed -Unknown_8b1ed: ; 8b1ed +.PointerTables: ; 8b1ed db 2 - dw Unknown_8b1f2 - dw Unknown_8b1f6 + dw .Functions + dw .TextPointers -Unknown_8b1f2: ; 8b1f2 - dw Function8b2bb - dw Function8b2c1 +.Functions: ; 8b1f2 + dw BattleTower_CheckPartyLengthIs3 + dw BattleTower_CheckPartyHasThreeMonsThatAreNotEggs ; 8b1f6 -Unknown_8b1f6: ; 8b1f6 - dw UnknownText_0x8b1fc - dw UnknownText_0x8b23d - dw UnknownText_0x8b242 +.TextPointers: ; 8b1f6 + dw .ExcuseMeText + dw JumpText_NeedAtLeastThreeMon + dw JumpText_EggDoesNotQualify ; 8b1fc -UnknownText_0x8b1fc: ; 0x8b1fc +.ExcuseMeText: ; 0x8b1fc ; Excuse me! text_jump UnknownText_0x1c5937 db "@" @@ -34,27 +34,27 @@ CheckForBattleTowerRules: ; 8b201 ld [hl], "3" inc hl ld [hl], "@" - ld de, CheckForBattleTowerRules_FunctionsText - call Function8b25b + ld de, .PointerTables + call BattleTower_ExecuteJumptable ret z - call Function8b231 + call BattleTower_PleaseReturnWhenReady scf ret ; 8b215 -CheckForBattleTowerRules_FunctionsText: ; 8b215 +.PointerTables: ; 8b215 db 4 - dw CheckForBattleTowerRules_Functions - dw CheckForBattleTowerRules_Text + dw .Functions + dw .TextPointers -CheckForBattleTowerRules_Functions: ; 8b21a +.Functions: ; 8b21a dw Function_PartyCountEq3 dw Function_PartySpeciesAreUnique dw Function_PartyItemsAreUnique dw Function_HasPartyAnEgg ; 8b222 -CheckForBattleTowerRules_Text: ; 8b222 +.TextPointers: ; 8b222 dw JumpText_ExcuseMeYoureNotReady dw JumpText_OnlyThreePkmnMayBeEntered dw JumpText_ThePkmnMustAllBeDifferentKinds @@ -68,25 +68,25 @@ JumpText_ExcuseMeYoureNotReady: ; 0x8b22c db "@" ; 0x8b231 -Function8b231: ; 8b231 - ld hl, UnknownText_0x8b238 +BattleTower_PleaseReturnWhenReady: ; 8b231 + ld hl, .PleaseReturnWhenReady call PrintText ret ; 8b238 -UnknownText_0x8b238: ; 0x8b238 +.PleaseReturnWhenReady: ; 0x8b238 ; Please return when you're ready. text_jump UnknownText_0x1c5962 db "@" ; 0x8b23d -UnknownText_0x8b23d: ; 0x8b23d +JumpText_NeedAtLeastThreeMon: ; 0x8b23d ; You need at least three #MON. text_jump UnknownText_0x1c5983 db "@" ; 0x8b242 -UnknownText_0x8b242: ; 0x8b242 +JumpText_EggDoesNotQualify: ; 0x8b242 ; Sorry, an EGG doesn't qualify. text_jump UnknownText_0x1c59a3 db "@" @@ -116,22 +116,22 @@ JumpText_YouCantTakeAnEgg: ; 0x8b256 db "@" ; 0x8b25b -Function8b25b: ; 8b25b +BattleTower_ExecuteJumptable: ; 8b25b ld bc, 0 -.asm_8b25e - call Function8b26c - call c, Function8b28e - call Function8b276 - jr nz, .asm_8b25e +.loop + call .DoJumptableFunction + call c, .PrintFailureText + call .Next_CheckReachedEnd + jr nz, .loop ld a, b and a ret ; 8b26c -Function8b26c: ; 8b26c +.DoJumptableFunction: ; 8b26c push de push bc - call Function8b27a + call .GetFunctionPointer ld a, c rst JumpTable pop bc @@ -139,14 +139,14 @@ Function8b26c: ; 8b26c ret ; 8b276 -Function8b276: ; 8b276 +.Next_CheckReachedEnd: ; 8b276 inc c ld a, [de] cp c ret ; 8b27a -Function8b27a: ; 8b27a +.GetFunctionPointer: ; 8b27a inc de ld a, [de] ld l, a @@ -156,7 +156,7 @@ Function8b27a: ; 8b27a ret ; 8b281 -Function8b281: ; 8b281 +.GetTextPointers: ; 8b281 rept 3 inc de endr @@ -168,38 +168,38 @@ endr ret ; 8b28a -Function8b28a: ; 8b28a +.LoadTextPointer: ; 8b28a ld a, [hli] ld h, [hl] ld l, a ret ; 8b28e -Function8b28e: ; 8b28e +.PrintFailureText: ; 8b28e push de push bc ld a, b and a - call z, Function8b29d + call z, .PrintFirstText pop bc - call Function8b2a9 + call .PrintNthText ld b, $1 pop de ret ; 8b29d -Function8b29d: ; 8b29d +.PrintFirstText: ; 8b29d push de - call Function8b281 - call Function8b28a + call .GetTextPointers + call .LoadTextPointer call PrintText pop de ret ; 8b2a9 -Function8b2a9: ; 8b2a9 +.PrintNthText: ; 8b2a9 push bc - call Function8b281 + call .GetTextPointers rept 2 inc hl endr @@ -207,32 +207,32 @@ endr rept 2 add hl, bc endr - call Function8b28a + call .LoadTextPointer call PrintText pop bc ret ; 8b2bb -Function8b2bb: ; 8b2bb +BattleTower_CheckPartyLengthIs3: ; 8b2bb ld a, [PartyCount] cp 3 ret ; 8b2c1 -Function8b2c1: ; 8b2c1 +BattleTower_CheckPartyHasThreeMonsThatAreNotEggs: ; 8b2c1 ld hl, PartyCount ld a, [hli] ld b, $0 ld c, a -.asm_8b2c8 +.loop ld a, [hli] cp EGG - jr z, .asm_8b2ce + jr z, .egg inc b -.asm_8b2ce +.egg dec c - jr nz, .asm_8b2c8 + jr nz, .loop ld a, [PartyCount] cp b ret z diff --git a/event/buena.asm b/event/buena.asm index ddc78b016..68df12dfa 100644 --- a/event/buena.asm +++ b/event/buena.asm @@ -82,10 +82,10 @@ SpecialBuenaPrize: ; 8afd4 .okay call DelayFrame call UpdateSprites - call Function8b097 + call PrintBlueCardBalance call Function8b0e2 jr z, .done - ld [wcf75], a + ld [MenuSelectionQuantity], a call Buena_getprize ld a, [hl] ld [wd265], a @@ -95,7 +95,7 @@ SpecialBuenaPrize: ; 8afd4 call YesNoBox jr c, .loop - ld a, [wcf75] + ld a, [MenuSelectionQuantity] call Buena_getprize inc hl ld a, [hld] @@ -118,7 +118,7 @@ SpecialBuenaPrize: ; 8afd4 ld a, [wBlueCardBalance] sub c ld [wBlueCardBalance], a - call Function8b097 + call PrintBlueCardBalance jr .Purchase .InsufficientBalance @@ -184,34 +184,34 @@ SpecialBuenaPrize: ; 8afd4 ; 0x8b090 Function8b090: ; 8b090 - ld hl, MenuDataHeader_0x8b0d1 + ld hl, BlueCardBalanceMenuDataHeader call LoadMenuDataHeader ret ; 8b097 -Function8b097: ; 8b097 +PrintBlueCardBalance: ; 8b097 ld de, wBlueCardBalance - call Function8b09e + call .DrawBox ret ; 8b09e -Function8b09e: ; 8b09e +.DrawBox: ; 8b09e push de xor a ld [hBGMapMode], a - ld hl, MenuDataHeader_0x8b0d1 + ld hl, BlueCardBalanceMenuDataHeader call CopyMenuDataHeader call MenuBox call UpdateSprites call MenuBoxCoord2Tile - ld bc, $0015 + ld bc, SCREEN_WIDTH + 1 add hl, bc ld de, .Points_string call PlaceString ld h, b ld l, c inc hl - ld a, $7f + ld a, " " ld [hli], a ld [hld], a pop de @@ -224,7 +224,7 @@ Function8b09e: ; 8b09e db "Points@" ; 8b0d1 -MenuDataHeader_0x8b0d1: ; 0x8b0d1 +BlueCardBalanceMenuDataHeader: ; 0x8b0d1 db $40 ; flags db 11, 00 ; start coords db 13, 11 ; end coords @@ -252,19 +252,19 @@ Function8b0e2: ; 8b0e2 ld [hBGMapMode], a call InitScrollingMenu call UpdateSprites - call HandleScrollingMenu + call ScrollingMenu ld a, [MenuSelection] ld c, a ld a, [wMenuCursorY] ld [MenuSelection], a ld a, [wMenuJoypad] cp $2 - jr z, .asm_8b111 + jr z, .cancel ld a, c and a ret nz -.asm_8b111 +.cancel xor a ret ; 8b113 @@ -281,8 +281,8 @@ Function8b0e2: ; 8b0e2 .MenuData2: ; 0x8b11c db $10 ; flags - db 4 ; items - db $d, $1 + db 4, 13 ; rows, columns + db 1 ; spacing dba .indices dba .prizeitem dba .prizepoints diff --git a/event/elevator.asm b/event/elevator.asm index 097293a56..37b15a558 100755 --- a/event/elevator.asm +++ b/event/elevator.asm @@ -130,7 +130,7 @@ Elevator_AskWhichFloor: ; 134dd call UpdateSprites xor a ld [wMenuScrollPosition], a - call HandleScrollingMenu + call ScrollingMenu call WriteBackup ld a, [wMenuJoypad] cp B_BUTTON diff --git a/event/kurt.asm b/event/kurt.asm index f7a3f3a55..54461aecb 100644 --- a/event/kurt.asm +++ b/event/kurt.asm @@ -67,7 +67,7 @@ Kurt_SelectApricorn: ; 88055 ld [hBGMapMode], a call InitScrollingMenu call UpdateSprites - call HandleScrollingMenu + call ScrollingMenu ld a, [wMenuJoypad] cp $2 jr z, .nope @@ -116,7 +116,7 @@ Kurt_SelectApricorn: ; 88055 call Kurt_GetQuantityOfApricorn ret z ld a, [wItemQuantityChangeBuffer] - ld [wcf75], a + ld [MenuSelectionQuantity], a callba PlaceMenuItemQuantity ret ; 880c2 @@ -231,16 +231,16 @@ Kurt_GiveUpSelectedQuantityOfSelectedApricorn: ; 88161 ld c, a ld e, $0 xor a - ld [ItemCountBuffer], a + ld [CurItemQuantity], a ld a, -1 ld [wd002], a ; Search for [CurItem] in the bag. .loop1 ; Increase the total count. - ld a, [ItemCountBuffer] + ld a, [CurItemQuantity] inc a - ld [ItemCountBuffer], a + ld [CurItemQuantity], a ; Get the index of the next item. inc hl ld a, [hli] @@ -256,7 +256,7 @@ Kurt_GiveUpSelectedQuantityOfSelectedApricorn: ; 88161 ld hl, wd002 add hl, de inc e - ld a, [ItemCountBuffer] + ld a, [CurItemQuantity] dec a ld [hli], a ld a, -1 @@ -322,7 +322,7 @@ Kurt_GiveUpSelectedQuantityOfSelectedApricorn: ; 88161 cp -1 jr z, .done push hl - ld [ItemCountBuffer], a + ld [CurItemQuantity], a call Kurt_GetRidOfItem pop hl ld a, [wItemQuantityChangeBuffer] @@ -375,7 +375,7 @@ endr Kurt_GetRidOfItem: ; 88211 push bc ld hl, NumItems - ld a, [ItemCountBuffer] + ld a, [CurItemQuantity] ld c, a ld b, $0 inc hl |