named more functions

This commit is contained in:
YamaArashi 2015-07-24 14:57:49 -07:00
parent 82512e4491
commit 12db77201f
4 changed files with 39 additions and 36 deletions

View file

@ -114,13 +114,13 @@ AccessedMyPCText: ; 17f32 (5:7f32)
TX_FAR _AccessedMyPCText TX_FAR _AccessedMyPCText
db "@" db "@"
; removes one of the specified item ID [$FFdb] from bag (if existent) ; removes one of the specified item ID [hItemToRemoveID] from bag (if existent)
RemoveItemByID: ; 17f37 (5:7f37) RemoveItemByID: ; 17f37 (5:7f37)
ld hl, wBagItems ld hl, wBagItems
ld a, [$ffdb] ld a, [hItemToRemoveID]
ld b, a ld b, a
xor a xor a
ld [$ffdc], a ld [hItemToRemoveIndex], a
.asm_17f40 .asm_17f40
ld a, [hli] ld a, [hli]
cp $ff cp $ff
@ -128,14 +128,14 @@ RemoveItemByID: ; 17f37 (5:7f37)
cp b cp b
jr z, .asm_17f4f jr z, .asm_17f4f
inc hl inc hl
ld a, [$ffdc] ld a, [hItemToRemoveIndex]
inc a inc a
ld [$ffdc], a ld [hItemToRemoveIndex], a
jr .asm_17f40 jr .asm_17f40
.asm_17f4f .asm_17f4f
ld a, $1 ld a, $1
ld [wItemQuantity], a ld [wItemQuantity], a
ld a, [$ffdc] ld a, [hItemToRemoveIndex]
ld [wWhichPokemon], a ld [wWhichPokemon], a
ld hl, wNumBagItems ld hl, wNumBagItems
jp RemoveItemFromInventory jp RemoveItemFromInventory

View file

@ -8,7 +8,7 @@ CableClubNPC: ; 71c5 (1:71c5)
call DelayFrames call DelayFrames
ld hl, CableClubNPCMakingPreparationsText ld hl, CableClubNPCMakingPreparationsText
call PrintText call PrintText
jp Func_7298 jp .didNotConnect
.receivedPokedex .receivedPokedex
ld a, $1 ld a, $1
ld [wMenuJoypadPollCount], a ld [wMenuJoypadPollCount], a
@ -71,31 +71,29 @@ CableClubNPC: ; 71c5 (1:71c5)
ld hl, wUnknownSerialCounter ld hl, wUnknownSerialCounter
ld a, [hli] ld a, [hli]
inc a inc a
jr nz, Func_72a8 jr nz, .connected
ld a, [hl] ld a, [hl]
inc a inc a
jr nz, Func_72a8 jr nz, .connected
ld b, $a ld b, 10
.asm_7273 .syncLoop
call DelayFrame call DelayFrame
call Serial_SendZeroByte call Serial_SendZeroByte
dec b dec b
jr nz, .asm_7273 jr nz, .syncLoop
call CloseLinkConnection call CloseLinkConnection
ld hl, CableClubNPCLinkClosedBecauseOfInactivityText ld hl, CableClubNPCLinkClosedBecauseOfInactivityText
call PrintText call PrintText
jr Func_7298 jr .didNotConnect
.failedToEstablishConnection .failedToEstablishConnection
ld hl, CableClubNPCAreaReservedFor2FriendsLinkedByCableText ld hl, CableClubNPCAreaReservedFor2FriendsLinkedByCableText
call PrintText call PrintText
jr Func_7298 jr .didNotConnect
.choseNo .choseNo
call CloseLinkConnection call CloseLinkConnection
ld hl, CableClubNPCPleaseComeAgainText ld hl, CableClubNPCPleaseComeAgainText
call PrintText call PrintText
; fall through .didNotConnect
Func_7298: ; 7298 (1:7298)
xor a xor a
ld hl, wUnknownSerialCounter ld hl, wUnknownSerialCounter
ld [hli], a ld [hli], a
@ -105,8 +103,7 @@ Func_7298: ; 7298 (1:7298)
xor a xor a
ld [wMenuJoypadPollCount], a ld [wMenuJoypadPollCount], a
ret ret
.connected
Func_72a8: ; 72a8 (1:72a8)
xor a xor a
ld [hld], a ld [hld], a
ld [hl], a ld [hl], a

View file

@ -3,19 +3,19 @@ GiveFossilToCinnabarLab: ; 61006 (18:5006)
set 6, [hl] set 6, [hl]
xor a xor a
ld [wCurrentMenuItem], a ld [wCurrentMenuItem], a
ld a, $3 ld a, A_BUTTON | B_BUTTON
ld [wMenuWatchedKeys], a ld [wMenuWatchedKeys], a
ld a, [wcd37] ld a, [wcd37]
dec a dec a
ld [wMaxMenuItem], a ld [wMaxMenuItem], a
ld a, $2 ld a, 2
ld [wTopMenuItemY], a ld [wTopMenuItemY], a
ld a, $1 ld a, 1
ld [wTopMenuItemX], a ld [wTopMenuItemX], a
ld a, [wcd37] ld a, [wcd37]
dec a dec a
ld bc, $2 ld bc, 2
ld hl, $3 ld hl, 3
call AddNTimes call AddNTimes
dec l dec l
ld b, l ld b, l
@ -23,12 +23,12 @@ GiveFossilToCinnabarLab: ; 61006 (18:5006)
coord hl, 0, 0 coord hl, 0, 0
call TextBoxBorder call TextBoxBorder
call UpdateSprites call UpdateSprites
call Func_610c2 call PrintFossilsInBag
ld hl, wd730 ld hl, wd730
res 6, [hl] res 6, [hl]
call HandleMenuInput call HandleMenuInput
bit 1, a bit 1, a ; pressed B?
jr nz, .asm_610a7 jr nz, .cancelledGivingFossil
ld hl, wcc5b ld hl, wcc5b
ld a, [wCurrentMenuItem] ld a, [wCurrentMenuItem]
ld d, $0 ld d, $0
@ -57,17 +57,17 @@ GiveFossilToCinnabarLab: ; 61006 (18:5006)
call YesNoChoice call YesNoChoice
ld a, [wCurrentMenuItem] ld a, [wCurrentMenuItem]
and a and a
jr nz, .asm_610a7 jr nz, .cancelledGivingFossil
ld hl, LabFossil_610b3 ld hl, LabFossil_610b3
call PrintText call PrintText
ld a, [W_FOSSILITEM] ld a, [W_FOSSILITEM]
ld [$ffdb], a ld [hItemToRemoveID], a
callba RemoveItemByID callba RemoveItemByID
ld hl, LabFossil_610b8 ld hl, LabFossil_610b8
call PrintText call PrintText
SetEvents EVENT_GAVE_FOSSIL_TO_LAB, EVENT_LAB_STILL_REVIVING_FOSSIL SetEvents EVENT_GAVE_FOSSIL_TO_LAB, EVENT_LAB_STILL_REVIVING_FOSSIL
ret ret
.asm_610a7 .cancelledGivingFossil
ld hl, LabFossil_610bd ld hl, LabFossil_610bd
call PrintText call PrintText
ret ret
@ -88,11 +88,12 @@ LabFossil_610bd: ; 610bd (18:50bd)
TX_FAR _Lab4Text_610bd TX_FAR _Lab4Text_610bd
db "@" db "@"
Func_610c2: ; 610c2 (18:50c2) PrintFossilsInBag: ; 610c2 (18:50c2)
; Prints each fossil in the player's bag on a separate line in the menu.
ld hl, wcc5b ld hl, wcc5b
xor a xor a
ld [$ffdb], a ld [hFossilCounter], a
.asm_610c8 .loop
ld a, [hli] ld a, [hli]
cp $ff cp $ff
ret z ret z
@ -100,15 +101,15 @@ Func_610c2: ; 610c2 (18:50c2)
ld [wd11e], a ld [wd11e], a
call GetItemName call GetItemName
coord hl, 2, 2 coord hl, 2, 2
ld a, [$ffdb] ld a, [hFossilCounter]
ld bc, SCREEN_WIDTH * 2 ld bc, SCREEN_WIDTH * 2
call AddNTimes call AddNTimes
ld de, wcd6d ld de, wcd6d
call PlaceString call PlaceString
ld hl, $ffdb ld hl, hFossilCounter
inc [hl] inc [hl]
pop hl pop hl
jr .asm_610c8 jr .loop
; loads the names of the fossil item and the resulting mon ; loads the names of the fossil item and the resulting mon
LoadFossilItemAndMonName: ; 610eb (18:50eb) LoadFossilItemAndMonName: ; 610eb (18:50eb)

View file

@ -261,6 +261,11 @@ hTilesetType EQU $FFD7
H_CURRENTSPRITEOFFSET EQU $FFDA ; multiple of $10 H_CURRENTSPRITEOFFSET EQU $FFDA ; multiple of $10
hFossilCounter EQU $FFDB
hItemToRemoveID EQU $FFDB
hItemToRemoveIndex EQU $FFDC
hVendingMachineItem EQU $FFDB hVendingMachineItem EQU $FFDB
hVendingMachinePrice EQU $FFDC ; 3-byte BCD number hVendingMachinePrice EQU $FFDC ; 3-byte BCD number