diff options
| author | YamaArashi <shadow962@live.com> | 2015-08-29 17:15:05 -0700 | 
|---|---|---|
| committer | YamaArashi <shadow962@live.com> | 2015-08-29 17:15:05 -0700 | 
| commit | b6a7e5e9cf20e7924f6cf427c66e9aeb42fa77f3 (patch) | |
| tree | af1bac71243d59c9479898fa0c86ba37d742aacf /engine | |
| parent | 1a987d1e1ab96ca9553d4253c72858057332a03a (diff) | |
documented flags and misc. fixes
Diffstat (limited to 'engine')
| -rwxr-xr-x | engine/hidden_object_functions17.asm | 48 | ||||
| -rwxr-xr-x | engine/hidden_object_functions7.asm | 14 | ||||
| -rwxr-xr-x | engine/items/items.asm | 2 | ||||
| -rwxr-xr-x | engine/menu/main_menu.asm | 4 | ||||
| -rwxr-xr-x | engine/menu/naming_screen.asm | 2 | ||||
| -rwxr-xr-x | engine/menu/start_sub_menus.asm | 2 | ||||
| -rwxr-xr-x | engine/oak_speech.asm | 2 | ||||
| -rw-r--r-- | engine/overworld/movement.asm | 11 | 
8 files changed, 45 insertions, 40 deletions
| diff --git a/engine/hidden_object_functions17.asm b/engine/hidden_object_functions17.asm index 77f3eeb9..65a4669e 100755 --- a/engine/hidden_object_functions17.asm +++ b/engine/hidden_object_functions17.asm @@ -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] diff --git a/engine/hidden_object_functions7.asm b/engine/hidden_object_functions7.asm index 02d3928a..0c1e2be2 100755 --- a/engine/hidden_object_functions7.asm +++ b/engine/hidden_object_functions7.asm @@ -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 diff --git a/engine/items/items.asm b/engine/items/items.asm index f0666587..e8fe55f4 100755 --- a/engine/items/items.asm +++ b/engine/items/items.asm @@ -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 diff --git a/engine/menu/main_menu.asm b/engine/menu/main_menu.asm index 6c109cec..78830093 100755 --- a/engine/menu/main_menu.asm +++ b/engine/menu/main_menu.asm @@ -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 diff --git a/engine/menu/naming_screen.asm b/engine/menu/naming_screen.asm index 978216c8..703d570a 100755 --- a/engine/menu/naming_screen.asm +++ b/engine/menu/naming_screen.asm @@ -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] diff --git a/engine/menu/start_sub_menus.asm b/engine/menu/start_sub_menus.asm index ab8c8756..678877ef 100755 --- a/engine/menu/start_sub_menus.asm +++ b/engine/menu/start_sub_menus.asm @@ -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] diff --git a/engine/oak_speech.asm b/engine/oak_speech.asm index 0de7ffad..48e8da80 100755 --- a/engine/oak_speech.asm +++ b/engine/oak_speech.asm @@ -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 diff --git a/engine/overworld/movement.asm b/engine/overworld/movement.asm index be10fd69..2ed49838 100644 --- a/engine/overworld/movement.asm +++ b/engine/overworld/movement.asm @@ -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 | 
