mirror of
https://github.com/thornAvery/kep-hack.git
synced 2026-02-06 15:45:24 +13:00
Merge branch 'master' of https://github.com/YamaArashi/pokered
Conflicts: engine/evos_moves.asm engine/overworld/healing_machine.asm
This commit is contained in:
commit
64b4cf624f
67 changed files with 766 additions and 632 deletions
|
|
@ -1,17 +1,16 @@
|
|||
ShakeElevator: ; 7bf15 (1e:7f15)
|
||||
ld de, $ffe0
|
||||
call Func_7bf64
|
||||
ld de, $240
|
||||
call Func_7bf64
|
||||
ld de, -$20
|
||||
call ShakeElevatorRedrawRow
|
||||
ld de, SCREEN_HEIGHT * $20
|
||||
call ShakeElevatorRedrawRow
|
||||
call Delay3
|
||||
ld a, $ff
|
||||
call PlaySound
|
||||
ld a, [hSCY]
|
||||
ld d, a
|
||||
ld e, $1
|
||||
; number of times to play collision sfx
|
||||
ld b, 100
|
||||
.asm_7bf30
|
||||
.shakeLoop ; scroll the BG up and down and play a sound effect
|
||||
ld a, e
|
||||
xor $fe
|
||||
ld e, a
|
||||
|
|
@ -25,7 +24,7 @@ ShakeElevator: ; 7bf15 (1e:7f15)
|
|||
ld c, 2
|
||||
call DelayFrames
|
||||
dec b
|
||||
jr nz, .asm_7bf30
|
||||
jr nz, .shakeLoop
|
||||
ld a, d
|
||||
ld [hSCY], a
|
||||
ld a, $ff
|
||||
|
|
@ -33,14 +32,17 @@ ShakeElevator: ; 7bf15 (1e:7f15)
|
|||
ld c, BANK(SFX_02_5f)
|
||||
ld a, SFX_SAFARI_ZONE_PA
|
||||
call PlayMusic
|
||||
.asm_7bf57
|
||||
.musicLoop
|
||||
ld a, [wc02a]
|
||||
cp $b9
|
||||
jr z, .asm_7bf57
|
||||
jr z, .musicLoop
|
||||
call UpdateSprites
|
||||
jp PlayDefaultMusic
|
||||
|
||||
Func_7bf64: ; 7bf64 (1e:7f64)
|
||||
ShakeElevatorRedrawRow: ; 7bf64 (1e:7f64)
|
||||
; This function is used to redraw certain portions of the screen, but it does
|
||||
; not appear to ever result in any visible effect, so this function seems to
|
||||
; be pointless.
|
||||
ld hl, wMapViewVRAMPointer + 1
|
||||
ld a, [hld]
|
||||
push af
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ AnimateHealingMachine: ; 70433 (1c:4433)
|
|||
ld [rOBP1], a
|
||||
ld hl, wOAMBuffer + $84
|
||||
ld de, PokeCenterOAMData
|
||||
call Func_70503
|
||||
call CopyHealingMachineOAM
|
||||
ld a, $4
|
||||
ld [wMusicHeaderPointer], a
|
||||
ld a, $ff
|
||||
|
|
@ -27,7 +27,7 @@ AnimateHealingMachine: ; 70433 (1c:4433)
|
|||
ld a, [wPartyCount]
|
||||
ld b, a
|
||||
.asm_7046e
|
||||
call Func_70503
|
||||
call CopyHealingMachineOAM
|
||||
ld a, SFX_HEALING_MACHINE
|
||||
call PlaySound
|
||||
ld c, 30
|
||||
|
|
@ -87,7 +87,8 @@ FlashSprite8Times: ; 704f3 (1c:44f3)
|
|||
jr nz, .loop
|
||||
ret
|
||||
|
||||
Func_70503: ; 70503 (1c:4503)
|
||||
CopyHealingMachineOAM: ; 70503 (1c:4503)
|
||||
; copy one OAM entry and advance the pointers
|
||||
ld a, [de]
|
||||
inc de
|
||||
ld [hli], a
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
HiddenItems: ; 76688 (1d:6688)
|
||||
ld hl, HiddenItemCoords
|
||||
call Func_76857
|
||||
ld [wTrainerScreenX], a
|
||||
ld hl, wd6f0
|
||||
ld a, [wTrainerScreenX]
|
||||
call FindHiddenItemOrCoinsIndex
|
||||
ld [wHiddenItemOrCoinsIndex], a
|
||||
ld hl, wObtainedHiddenItemsFlags
|
||||
ld a, [wHiddenItemOrCoinsIndex]
|
||||
ld c, a
|
||||
ld b, $2
|
||||
predef FlagActionPredef
|
||||
|
|
@ -11,9 +11,9 @@ HiddenItems: ; 76688 (1d:6688)
|
|||
and a
|
||||
ret nz
|
||||
call EnableAutoTextBoxDrawing
|
||||
ld a, $1
|
||||
ld a, 1
|
||||
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
|
||||
ld a, [wWhichTrade] ; item ID
|
||||
ld a, [wHiddenObjectFunctionArgument] ; item ID
|
||||
ld [wd11e], a
|
||||
call GetItemName
|
||||
tx_pre_jump FoundHiddenItemText
|
||||
|
|
@ -23,12 +23,12 @@ INCLUDE "data/hidden_item_coords.asm"
|
|||
FoundHiddenItemText: ; 7675b (1d:675b)
|
||||
TX_FAR _FoundHiddenItemText
|
||||
TX_ASM
|
||||
ld a, [wWhichTrade] ; item ID
|
||||
ld a, [wHiddenObjectFunctionArgument] ; item ID
|
||||
ld b, a
|
||||
ld c, 1
|
||||
call GiveItem
|
||||
jr nc, .BagFull
|
||||
ld hl, wd6f0
|
||||
ld hl, wObtainedHiddenItemsFlags
|
||||
ld a, [wTrainerScreenX]
|
||||
ld c, a
|
||||
ld b, $1
|
||||
|
|
@ -56,10 +56,10 @@ HiddenCoins: ; 76799 (1d:6799)
|
|||
and a
|
||||
ret z
|
||||
ld hl, HiddenCoinCoords
|
||||
call Func_76857
|
||||
ld [wTrainerScreenX], a
|
||||
ld hl, wd6fe
|
||||
ld a, [wTrainerScreenX]
|
||||
call FindHiddenItemOrCoinsIndex
|
||||
ld [wHiddenItemOrCoinsIndex], a
|
||||
ld hl, wObtainedHiddenCoinsFlags
|
||||
ld a, [wHiddenItemOrCoinsIndex]
|
||||
ld c, a
|
||||
ld b, $2
|
||||
predef FlagActionPredef
|
||||
|
|
@ -70,7 +70,7 @@ HiddenCoins: ; 76799 (1d:6799)
|
|||
ld [hCoins - 1], a
|
||||
ld [hCoins], a
|
||||
ld [hCoins + 1], a
|
||||
ld a, [wWhichTrade]
|
||||
ld a, [wHiddenObjectFunctionArgument]
|
||||
sub COIN
|
||||
cp 10
|
||||
jr z, .bcd10
|
||||
|
|
@ -99,7 +99,7 @@ HiddenCoins: ; 76799 (1d:6799)
|
|||
ld hl, hCoins + 1
|
||||
ld c, $2
|
||||
predef AddBCDPredef
|
||||
ld hl, wd6fe
|
||||
ld hl, wObtainedHiddenCoinsFlags
|
||||
ld a, [wTrainerScreenX]
|
||||
ld c, a
|
||||
ld b, $1
|
||||
|
|
@ -130,31 +130,31 @@ DroppedHiddenCoinsText: ; 7684d (1d:684d)
|
|||
TX_FAR _DroppedHiddenCoinsText
|
||||
db "@"
|
||||
|
||||
Func_76857: ; 76857 (1d:6857)
|
||||
ld a, [wTrainerScreenY]
|
||||
FindHiddenItemOrCoinsIndex: ; 76857 (1d:6857)
|
||||
ld a, [wHiddenObjectY]
|
||||
ld d, a
|
||||
ld a, [wTrainerScreenX]
|
||||
ld a, [wHiddenObjectX]
|
||||
ld e, a
|
||||
ld a, [W_CURMAP]
|
||||
ld b, a
|
||||
ld c, $ff
|
||||
ld c, -1
|
||||
.loop
|
||||
inc c
|
||||
ld a, [hli]
|
||||
cp $ff ; end of the list?
|
||||
ret z ; if so, we're done here
|
||||
cp b
|
||||
jr nz, .asm_76877
|
||||
jr nz, .next1
|
||||
ld a, [hli]
|
||||
cp d
|
||||
jr nz, .asm_76878
|
||||
jr nz, .next2
|
||||
ld a, [hli]
|
||||
cp e
|
||||
jr nz, .loop
|
||||
ld a, c
|
||||
ret
|
||||
.asm_76877
|
||||
.next1
|
||||
inc hl
|
||||
.asm_76878
|
||||
.next2
|
||||
inc hl
|
||||
jr .loop
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
Func_46981: ; 46981 (11:6981)
|
||||
IsPlayerOnDungeonWarp: ; 46981 (11:6981)
|
||||
xor a
|
||||
ld [wWhichDungeonWarp], a
|
||||
ld a, [wd72d]
|
||||
|
|
@ -6,7 +6,7 @@ Func_46981: ; 46981 (11:6981)
|
|||
ret nz
|
||||
call ArePlayerCoordsInArray
|
||||
ret nc
|
||||
ld a, [wWhichTrade]
|
||||
ld a, [wCoordIndex]
|
||||
ld [wWhichDungeonWarp], a
|
||||
ld hl, wd72d
|
||||
set 4, [hl]
|
||||
|
|
@ -58,7 +58,7 @@ CheckForHiddenObject: ; 469a0 (11:69a0)
|
|||
ld [wHiddenObjectX], a
|
||||
ld c, a
|
||||
call CheckIfCoordsInFrontOfPlayerMatch
|
||||
ld a, [$ffea]
|
||||
ld a, [hCoordsInFrontOfPlayerMatch]
|
||||
and a
|
||||
jr z, .foundMatchingObject
|
||||
inc hl
|
||||
|
|
@ -85,7 +85,7 @@ CheckForHiddenObject: ; 469a0 (11:69a0)
|
|||
ret
|
||||
|
||||
; checks if the coordinates in front of the player's sprite match Y in b and X in c
|
||||
; [$ffea] = $00 if they match, $ff if they don't match
|
||||
; [hCoordsInFrontOfPlayerMatch] = $00 if they match, $ff if they don't match
|
||||
CheckIfCoordsInFrontOfPlayerMatch: ; 46a01 (11:6a01)
|
||||
ld a, [wSpriteStateData1 + 9] ; player's sprite facing direction
|
||||
cp SPRITE_FACING_UP
|
||||
|
|
@ -127,7 +127,7 @@ CheckIfCoordsInFrontOfPlayerMatch: ; 46a01 (11:6a01)
|
|||
.didNotMatch
|
||||
ld a, $ff
|
||||
.done
|
||||
ld [$ffea], a
|
||||
ld [hCoordsInFrontOfPlayerMatch], a
|
||||
ret
|
||||
|
||||
INCLUDE "data/hidden_objects.asm"
|
||||
|
|
|
|||
|
|
@ -210,9 +210,8 @@ UpdateNPCSprite: ; 4ed1 (1:4ed1)
|
|||
.moveDown
|
||||
ld de, 2*SCREEN_WIDTH
|
||||
add hl, de ; move tile pointer two rows down
|
||||
ld de, $100
|
||||
|
||||
ld bc, $400
|
||||
lb de, 1, 0
|
||||
lb bc, 4, SPRITE_FACING_DOWN
|
||||
jr TryWalking
|
||||
.notDown
|
||||
cp $80 ; $40 <= a < $80: up (or right)
|
||||
|
|
@ -223,8 +222,8 @@ UpdateNPCSprite: ; 4ed1 (1:4ed1)
|
|||
.moveUp
|
||||
ld de, -2*SCREEN_WIDTH
|
||||
add hl, de ; move tile pointer two rows up
|
||||
ld de, $ff00
|
||||
ld bc, $804
|
||||
lb de, -1, 0
|
||||
lb bc, 8, SPRITE_FACING_UP
|
||||
jr TryWalking
|
||||
.notUp
|
||||
cp $c0 ; $80 <= a < $c0: left (or up)
|
||||
|
|
@ -235,8 +234,8 @@ UpdateNPCSprite: ; 4ed1 (1:4ed1)
|
|||
.moveLeft
|
||||
dec hl
|
||||
dec hl ; move tile pointer two columns left
|
||||
ld de, $ff
|
||||
ld bc, $208
|
||||
lb de, 0, -1
|
||||
lb bc, 2, SPRITE_FACING_LEFT
|
||||
jr TryWalking
|
||||
.notLeft ; $c0 <= a: right (or down)
|
||||
ld a, [wCurSpriteMovement2]
|
||||
|
|
@ -245,8 +244,8 @@ UpdateNPCSprite: ; 4ed1 (1:4ed1)
|
|||
.moveRight
|
||||
inc hl
|
||||
inc hl ; move tile pointer two columns right
|
||||
ld de, $1
|
||||
ld bc, $10c
|
||||
lb de, 0, 1
|
||||
lb bc, 1, SPRITE_FACING_RIGHT
|
||||
jr TryWalking
|
||||
|
||||
; changes facing direction by zeroing the movement delta and calling TryWalking
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue