summaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
authordannye <33dannye@gmail.com>2021-05-31 16:43:31 -0500
committerdannye <33dannye@gmail.com>2021-05-31 16:51:45 -0500
commit7a23e2a635318754b56923824d5949bcff3815bf (patch)
tree6e57c5b6762b76ce8e18e8b08dace841f640a01d /engine
parentd53e450c984d4e2d60b146594e7934703a8c9796 (diff)
parentf3dbec09a89d1ef816da83228e67a27c8df0be89 (diff)
Merge branch 'master' of https://github.com/pret/pokered
Diffstat (limited to 'engine')
-rw-r--r--engine/battle/init_battle.asm69
-rw-r--r--engine/items/town_map.asm2
-rw-r--r--engine/menus/party_menu.asm2
-rw-r--r--engine/overworld/dust_smoke.asm24
-rw-r--r--engine/predefs.asm10
5 files changed, 51 insertions, 56 deletions
diff --git a/engine/battle/init_battle.asm b/engine/battle/init_battle.asm
index bd8b2e8f..680befda 100644
--- a/engine/battle/init_battle.asm
+++ b/engine/battle/init_battle.asm
@@ -188,95 +188,96 @@ LoadMonBackPic:
ld b, a
jp CopyVideoData
+; animates the mon "growing" out of the pokeball
AnimateSendingOutMon:
- ld a, [wPredefRegisters]
+ ld a, [wPredefHL]
ld h, a
- ld a, [wPredefRegisters + 1]
+ ld a, [wPredefHL + 1]
ld l, a
ldh a, [hStartTileID]
- ldh [hDownArrowBlinkCount1], a
+ ldh [hBaseTileID], a
ld b, $4c
ld a, [wIsInBattle]
and a
- jr z, .asm_f61ef
+ jr z, .notInBattle
add b
ld [hl], a
call Delay3
- ld bc, -41
+ ld bc, -(SCREEN_WIDTH * 2 + 1)
add hl, bc
- ld a, $1
- ld [wNumMovesMinusOne], a
- ld bc, $303
+ ld a, 1
+ ld [wDownscaledMonSize], a
+ lb bc, 3, 3
predef CopyDownscaledMonTiles
- ld c, $4
+ ld c, 4
call DelayFrames
- ld bc, -41
+ ld bc, -(SCREEN_WIDTH * 2 + 1)
add hl, bc
xor a
- ld [wNumMovesMinusOne], a
- ld bc, $505
+ ld [wDownscaledMonSize], a
+ lb bc, 5, 5
predef CopyDownscaledMonTiles
- ld c, $5
+ ld c, 5
call DelayFrames
- ld bc, -41
- jr .asm_f61f2
-.asm_f61ef
- ld bc, -123
-.asm_f61f2
+ ld bc, -(SCREEN_WIDTH * 2 + 1)
+ jr .next
+.notInBattle
+ ld bc, -(SCREEN_WIDTH * 6 + 3)
+.next
add hl, bc
- ldh a, [hDownArrowBlinkCount1]
+ ldh a, [hBaseTileID]
add $31
jr CopyUncompressedPicToHL
CopyUncompressedPicToTilemap:
- ld a, [wPredefRegisters]
+ ld a, [wPredefHL]
ld h, a
- ld a, [wPredefRegisters + 1]
+ ld a, [wPredefHL + 1]
ld l, a
ldh a, [hStartTileID]
CopyUncompressedPicToHL::
- ld bc, $707
- ld de, $14
+ lb bc, 7, 7
+ ld de, SCREEN_WIDTH
push af
ld a, [wSpriteFlipped]
and a
- jr nz, .asm_f6220
+ jr nz, .flipped
pop af
-.asm_f6211
+.loop
push bc
push hl
-.asm_f6213
+.innerLoop
ld [hl], a
add hl, de
inc a
dec c
- jr nz, .asm_f6213
+ jr nz, .innerLoop
pop hl
inc hl
pop bc
dec b
- jr nz, .asm_f6211
+ jr nz, .loop
ret
-.asm_f6220
+.flipped
push bc
- ld b, $0
+ ld b, 0
dec c
add hl, bc
pop bc
pop af
-.asm_f6227
+.flippedLoop
push bc
push hl
-.asm_f6229
+.flippedInnerLoop
ld [hl], a
add hl, de
inc a
dec c
- jr nz, .asm_f6229
+ jr nz, .flippedInnerLoop
pop hl
dec hl
pop bc
dec b
- jr nz, .asm_f6227
+ jr nz, .flippedLoop
ret
diff --git a/engine/items/town_map.asm b/engine/items/town_map.asm
index d385044a..3e71fc29 100644
--- a/engine/items/town_map.asm
+++ b/engine/items/town_map.asm
@@ -260,7 +260,7 @@ ToText:
db "To@"
BuildFlyLocationsList:
- ld hl, wFlyLocationsList - 1
+ ld hl, wFlyAnimUsingCoordList
ld [hl], $ff
inc hl
ld a, [wTownVisitedFlag]
diff --git a/engine/menus/party_menu.asm b/engine/menus/party_menu.asm
index 3af777a2..c64ce70a 100644
--- a/engine/menus/party_menu.asm
+++ b/engine/menus/party_menu.asm
@@ -139,7 +139,7 @@ RedrawPartyMenu_::
ld l, a
ld de, wEvosMoves
ld a, BANK(EvosMovesPointerTable)
- ld bc, wEvosMoves.end - wEvosMoves
+ ld bc, wEvosMovesEnd - wEvosMoves
call FarCopyData
ld hl, wEvosMoves
ld de, .notAbleToEvolveText
diff --git a/engine/overworld/dust_smoke.asm b/engine/overworld/dust_smoke.asm
index 773def96..ed016107 100644
--- a/engine/overworld/dust_smoke.asm
+++ b/engine/overworld/dust_smoke.asm
@@ -53,22 +53,16 @@ GetMoveBoulderDustFunctionPointer:
pop hl
ret
-MoveBoulderDustFunctionPointerTable:
-; facing down
- db $FF,$00
- dw AdjustOAMBlockYPos
-
-; facing up
- db $01,$00
- dw AdjustOAMBlockYPos
+boulder_dust_adjust: MACRO
+ db \1, \2 ; coords
+ dw \3 ; function
+ENDM
-; facing left
- db $01,$01
- dw AdjustOAMBlockXPos
-
-; facing right
- db $FF,$01
- dw AdjustOAMBlockXPos
+MoveBoulderDustFunctionPointerTable:
+ boulder_dust_adjust -1, 0, AdjustOAMBlockYPos ; down
+ boulder_dust_adjust 1, 0, AdjustOAMBlockYPos ; up
+ boulder_dust_adjust 1, 1, AdjustOAMBlockXPos ; left
+ boulder_dust_adjust -1, 1, AdjustOAMBlockXPos ; right
LoadSmokeTileFourTimes::
ld hl, vChars1 tile $7c
diff --git a/engine/predefs.asm b/engine/predefs.asm
index a9877739..faf0029e 100644
--- a/engine/predefs.asm
+++ b/engine/predefs.asm
@@ -1,20 +1,20 @@
GetPredefPointer::
-; Store the contents of the register
-; pairs (hl, de, bc) at wPredefRegisters.
+; Back up the contents of the registers (hl, de, bc).
; Then put the bank and address of predef
; wPredefID in [wPredefBank] and hl.
ld a, h
- ld [wPredefRegisters], a
+ ld [wPredefHL], a
ld a, l
- ld [wPredefRegisters + 1], a
+ ld [wPredefHL + 1], a
- ld hl, wPredefRegisters + 2
+ ld hl, wPredefDE
ld a, d
ld [hli], a
ld a, e
ld [hli], a
+ ASSERT wPredefDE + 2 == wPredefBC
ld a, b
ld [hli], a
ld [hl], c