documented flags and misc. fixes

This commit is contained in:
YamaArashi 2015-08-29 17:15:05 -07:00
parent 1a987d1e1a
commit b6a7e5e9cf
12 changed files with 96 additions and 54 deletions

View file

@ -95,23 +95,23 @@ LinkCableHelp: ; 5dc29 (17:5c29)
ld hl, LinkCableHelpText1
call PrintText
xor a
ld [W_ANIMATIONID], a
ld [wMenuItemOffset], a ; not used
ld [wCurrentMenuItem], a
ld [wLastMenuItem], a
ld a, A_BUTTON | B_BUTTON
ld [wMenuWatchedKeys], a
ld a, $3
ld a, 3
ld [wMaxMenuItem], a
ld a, $2
ld a, 2
ld [wTopMenuItemY], a
ld a, $1
ld a, 1
ld [wTopMenuItemX], a
.linkHelpLoop
ld hl, wd730
set 6, [hl]
coord hl, 0, 0
ld b, $8
ld c, $d
ld b, 8
ld c, 13
call TextBoxBorder
coord hl, 2, 2
ld de, HowToLinkText
@ -122,13 +122,13 @@ LinkCableHelp: ; 5dc29 (17:5c29)
bit 1, a ; pressed b
jr nz, .exit
ld a, [wCurrentMenuItem]
cp $3 ; pressed a on "STOP READING"
cp 3 ; pressed a on "STOP READING"
jr z, .exit
ld hl, wd730
res 6, [hl]
ld hl, LinkCableInfoTexts
add a
ld d, $0
ld d, 0
ld e, a
add hl, de
ld a, [hli]
@ -179,16 +179,16 @@ ViridianSchoolBlackboard: ; 5dced (17:5ced)
ld hl, ViridianSchoolBlackboardText1
call PrintText
xor a
ld [W_ANIMATIONID], a
ld [wMenuItemOffset], a
ld [wCurrentMenuItem], a
ld [wLastMenuItem], a
ld a, D_LEFT | D_RIGHT | A_BUTTON | B_BUTTON
ld [wMenuWatchedKeys], a
ld a, $2
ld a, 2
ld [wMaxMenuItem], a
ld a, $2
ld a, 2
ld [wTopMenuItemY], a
ld a, $1
ld a, 1
ld [wTopMenuItemX], a
.blackboardLoop
ld hl, wd730
@ -210,34 +210,34 @@ ViridianSchoolBlackboard: ; 5dced (17:5ced)
bit 4, a ; pressed right
jr z, .didNotPressRight
; move cursor to right column
ld a, $2
ld a, 2
ld [wMaxMenuItem], a
ld a, $2
ld a, 2
ld [wTopMenuItemY], a
ld a, $6
ld a, 6
ld [wTopMenuItemX], a
ld a, $3
ld [W_ANIMATIONID], a
ld a, 3 ; in the the right column, use an offset to prevent overlap
ld [wMenuItemOffset], a
jr .blackboardLoop
.didNotPressRight
bit 5, a ; pressed left
jr z, .didNotPressLeftOrRight
; move cursor to left column
ld a, $2
ld a, 2
ld [wMaxMenuItem], a
ld a, $2
ld a, 2
ld [wTopMenuItemY], a
ld a, $1
ld a, 1
ld [wTopMenuItemX], a
xor a
ld [W_ANIMATIONID], a
ld [wMenuItemOffset], a
jr .blackboardLoop
.didNotPressLeftOrRight
ld a, [wCurrentMenuItem]
ld b, a
ld a, [W_ANIMATIONID]
ld a, [wMenuItemOffset]
add b
cp $5 ; cursor is pointing to "QUIT"
cp 5 ; cursor is pointing to "QUIT"
jr z, .exitBlackboard
; we must have pressed a on a status condition
; so print the text
@ -245,7 +245,7 @@ ViridianSchoolBlackboard: ; 5dced (17:5ced)
res 6, [hl]
ld hl, ViridianBlackboardStatusPointers
add a
ld d, $0
ld d, 0
ld e, a
add hl, de
ld a, [hli]

View file

@ -147,7 +147,7 @@ CinnabarGymQuiz: ; 1ea25 (7:6a25)
ld h, [hl]
ld l, a
call PrintText
ld a, $1
ld a, 1
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
call CinnabarGymQuiz_1ea92
jp TextScriptEnd
@ -391,23 +391,23 @@ BillsHousePokemonList: ; 1ec05 (7:6c05)
ld hl, BillsHousePokemonListText1
call PrintText
xor a
ld [W_ANIMATIONID], a
ld [wMenuItemOffset], a ; not used
ld [wCurrentMenuItem], a
ld [wLastMenuItem], a
ld a, A_BUTTON | B_BUTTON
ld [wMenuWatchedKeys], a
ld a, $4
ld a, 4
ld [wMaxMenuItem], a
ld a, $2
ld a, 2
ld [wTopMenuItemY], a
ld a, $1
ld a, 1
ld [wTopMenuItemX], a
.billsPokemonLoop
ld hl, wd730
set 6, [hl]
coord hl, 0, 0
ld b, $a
ld c, $9
ld b, 10
ld c, 9
call TextBoxBorder
coord hl, 2, 2
ld de, BillsMonListText

View file

@ -1421,7 +1421,7 @@ ItemUseCardKey: ; e022 (3:6022)
xor a
ld [wUnusedD71F],a
call GetTileAndCoordsInFrontOfPlayer
ld a,[GetTileAndCoordsInFrontOfPlayer] ; $4586
ld a,[GetTileAndCoordsInFrontOfPlayer]
cp a,$18
jr nz,.next0
ld hl,CardKeyTable1

View file

@ -20,7 +20,7 @@ MainMenu: ; 5af2 (1:5af2)
ld [hli],a
ld [hli],a
ld [hl],a
ld [W_ANIMATIONID],a
ld [wDefaultMap],a
ld hl,wd72e
res 6,[hl]
call ClearScreen
@ -269,7 +269,7 @@ LinkMenu: ; 5c0a (1:5c0a)
call DelayFrames
ld hl, wd732
res 1, [hl]
ld a, [W_ANIMATIONID]
ld a, [wDefaultMap]
ld [wDestinationMap], a
call SpecialWarpIn
ld c, 20

View file

@ -166,7 +166,7 @@ DisplayNamingScreen: ; 6596 (1:6596)
call RunDefaultPaletteCommand
call GBPalNormal
xor a
ld [W_SUBANIMTRANSFORM], a
ld [wAnimCounter], a
ld hl, wd730
res 6, [hl]
ld a, [W_ISINBATTLE]

View file

@ -160,7 +160,7 @@ StartMenu_Pokemon: ; 130a9 (4:70a9)
.surf
bit 4,a ; does the player have the Soul Badge?
jp z,.newBadgeRequired
callba CheckForForcedBikeSurf
callba IsSurfingAllowed
ld hl,wd728
bit 1,[hl]
res 1,[hl]

View file

@ -48,7 +48,7 @@ OakSpeech: ; 6115 (1:6115)
ld a,1
ld [wItemQuantity],a
call AddItemToInventory ; give one potion
ld a,[W_ANIMATIONID]
ld a,[wDefaultMap]
ld [wDestinationMap],a
call SpecialWarpIn
xor a

View file

@ -133,8 +133,8 @@ UpdateNPCSprite: ; 4ed1 (1:4ed1)
ld l, a
inc l
ld a, [hl] ; c1x1
bit 7, a
jp nz, InitializeSpriteFacingDirection ; c1x1 >= $80
bit 7, a ; is the face player flag set?
jp nz, MakeNPCFacePlayer
ld b, a
ld a, [wFontLoaded]
bit 0, a
@ -400,10 +400,15 @@ notYetMoving: ; 5073 (1:5073)
ld [hl], $0 ; c1x8 = 0 (walk animation frame)
jp UpdateSpriteImage
InitializeSpriteFacingDirection: ; 507f (1:507f)
MakeNPCFacePlayer: ; 507f (1:507f)
; Make an NPC face the player if the player has spoken to him or her.
; Check if the behaviour of the NPC facing the player when spoken to is
; disabled. This is only done when rubbing the S.S. Anne captain's back.
ld a, [wd72d]
bit 5, a
jr nz, notYetMoving
res 7, [hl]
ld a, [wPlayerDirection]
bit PLAYER_DIR_BIT_UP, a