summaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
Diffstat (limited to 'engine')
-rwxr-xr-xengine/battle/core.asm8
-rw-r--r--engine/debug/test_battle.asm2
-rwxr-xr-xengine/events/hidden_items.asm2
-rwxr-xr-xengine/gfx/palettes.asm2
-rw-r--r--engine/menus/draw_badges.asm8
-rwxr-xr-xengine/menus/party_menu.asm21
-rwxr-xr-xengine/menus/start_sub_menus.asm10
-rw-r--r--engine/overworld/spinners.asm65
8 files changed, 82 insertions, 36 deletions
diff --git a/engine/battle/core.asm b/engine/battle/core.asm
index 5cf8a45d..c1eecc73 100755
--- a/engine/battle/core.asm
+++ b/engine/battle/core.asm
@@ -3954,16 +3954,16 @@ CheckForDisobedience:
.monIsTraded
; what level might disobey?
ld hl, wObtainedBadges
- bit 7, [hl]
+ bit BIT_EARTHBADGE, [hl]
ld a, 101
jr nz, .next
- bit 5, [hl]
+ bit BIT_MARSHBADGE, [hl]
ld a, 70
jr nz, .next
- bit 3, [hl]
+ bit BIT_RAINBOWBADGE, [hl]
ld a, 50
jr nz, .next
- bit 1, [hl]
+ bit BIT_CASCADEBADGE, [hl]
ld a, 30
jr nz, .next
ld a, 10
diff --git a/engine/debug/test_battle.asm b/engine/debug/test_battle.asm
index 92f74576..01b9825e 100644
--- a/engine/debug/test_battle.asm
+++ b/engine/debug/test_battle.asm
@@ -6,7 +6,7 @@ TestBattle:
; Don't mess around
; with obedience.
- ld a, %10000000 ; EARTHBADGE
+ ld a, 1 << BIT_EARTHBADGE
ld [wObtainedBadges], a
ld hl, wFlags_D733
diff --git a/engine/events/hidden_items.asm b/engine/events/hidden_items.asm
index 6a5835cd..97bb0b71 100755
--- a/engine/events/hidden_items.asm
+++ b/engine/events/hidden_items.asm
@@ -142,7 +142,7 @@ FindHiddenItemOrCoinsIndex:
.loop
inc c
ld a, [hli]
- cp $ff ; end of the list?
+ cp -1 ; end of the list?
ret z ; if so, we're done here
cp b
jr nz, .next1
diff --git a/engine/gfx/palettes.asm b/engine/gfx/palettes.asm
index 23203374..f724a8a9 100755
--- a/engine/gfx/palettes.asm
+++ b/engine/gfx/palettes.asm
@@ -208,7 +208,7 @@ SetPal_TrainerCard:
ld de, BadgeBlkDataLengths
ld hl, wTrainerCardBlkPacket + 2
ld a, [wObtainedBadges]
- ld c, 8
+ ld c, NUM_BADGES
.badgeLoop
srl a
push af
diff --git a/engine/menus/draw_badges.asm b/engine/menus/draw_badges.asm
index a74497c1..0bb433cc 100644
--- a/engine/menus/draw_badges.asm
+++ b/engine/menus/draw_badges.asm
@@ -8,12 +8,12 @@ DrawBadges:
; Tile ids for face/badge graphics.
ld de, wBadgeOrFaceTiles
ld hl, .FaceBadgeTiles
- ld bc, 8
+ ld bc, NUM_BADGES
call CopyData
; Booleans for each badge.
ld hl, wTempObtainedBadgesBooleans
- ld bc, 8
+ ld bc, NUM_BADGES
xor a
call FillMemory
@@ -22,7 +22,7 @@ DrawBadges:
ld hl, wBadgeOrFaceTiles
ld a, [wObtainedBadges]
ld b, a
- ld c, 8
+ ld c, NUM_BADGES
.CheckBadge
srl b
jr nc, .NextBadge
@@ -92,7 +92,7 @@ DrawBadges:
push bc
ld hl, wBadgeOrFaceTiles + 1
ld de, wBadgeOrFaceTiles
- ld bc, 8
+ ld bc, NUM_BADGES
call CopyData
pop bc
diff --git a/engine/menus/party_menu.asm b/engine/menus/party_menu.asm
index 14216b64..6648ab54 100755
--- a/engine/menus/party_menu.asm
+++ b/engine/menus/party_menu.asm
@@ -1,22 +1,3 @@
-; [wPartyMenuTypeOrMessageID] = menu type / message ID
-; if less than $F0, it is a menu type
-; menu types:
-; 00: normal pokemon menu (e.g. Start menu)
-; 01: use healing item on pokemon menu
-; 02: in-battle switch pokemon menu
-; 03: learn TM/HM menu
-; 04: swap pokemon positions menu
-; 05: use evolution stone on pokemon menu
-; otherwise, it is a message ID
-; f0: poison healed
-; f1: burn healed
-; f2: freeze healed
-; f3: sleep healed
-; f4: paralysis healed
-; f5: HP healed
-; f6: health returned
-; f7: revitalized
-; f8: leveled up
DrawPartyMenu_::
xor a
ldh [hAutoBGTransferEnabled], a
@@ -197,7 +178,7 @@ RedrawPartyMenu_::
push hl
set 6, [hl] ; turn off letter printing delay
ld a, [wPartyMenuTypeOrMessageID] ; message ID
- cp $F0
+ cp FIRST_PARTY_MENU_TEXT_ID
jr nc, .printItemUseMessage
add a
ld hl, PartyMenuMessagePointers
diff --git a/engine/menus/start_sub_menus.asm b/engine/menus/start_sub_menus.asm
index a845592f..6a98a10c 100755
--- a/engine/menus/start_sub_menus.asm
+++ b/engine/menus/start_sub_menus.asm
@@ -130,7 +130,7 @@ StartMenu_Pokemon::
dw .teleport
dw .softboiled
.fly
- bit 2, a ; does the player have the Thunder Badge?
+ bit BIT_THUNDERBADGE, a
jp z, .newBadgeRequired
call CheckIfInOutsideMap
jr z, .canFly
@@ -150,7 +150,7 @@ StartMenu_Pokemon::
set 1, [hl]
jp StartMenu_Pokemon
.cut
- bit 1, a ; does the player have the Cascade Badge?
+ bit BIT_CASCADEBADGE, a
jp z, .newBadgeRequired
predef UsedCut
ld a, [wActionResultOrTookBattleTurn]
@@ -158,7 +158,7 @@ StartMenu_Pokemon::
jp z, .loop
jp CloseTextDisplay
.surf
- bit 4, a ; does the player have the Soul Badge?
+ bit BIT_SOULBADGE, a
jp z, .newBadgeRequired
farcall IsSurfingAllowed
ld hl, wd728
@@ -175,13 +175,13 @@ StartMenu_Pokemon::
call GBPalWhiteOutWithDelay3
jp .goBackToMap
.strength
- bit 3, a ; does the player have the Rainbow Badge?
+ bit BIT_RAINBOWBADGE, a
jp z, .newBadgeRequired
predef PrintStrengthTxt
call GBPalWhiteOutWithDelay3
jp .goBackToMap
.flash
- bit 0, a ; does the player have the Boulder Badge?
+ bit BIT_BOULDERBADGE, a
jp z, .newBadgeRequired
xor a
ld [wMapPalOffset], a
diff --git a/engine/overworld/spinners.asm b/engine/overworld/spinners.asm
new file mode 100644
index 00000000..0ac6380d
--- /dev/null
+++ b/engine/overworld/spinners.asm
@@ -0,0 +1,65 @@
+LoadSpinnerArrowTiles::
+ ld a, [wSpritePlayerStateData1ImageIndex]
+ srl a
+ srl a
+ ld hl, SpinnerPlayerFacingDirections
+ ld c, a
+ ld b, $0
+ add hl, bc
+ ld a, [hl]
+ ld [wSpritePlayerStateData1ImageIndex], a
+ ld a, [wCurMapTileset]
+ cp FACILITY
+ ld hl, FacilitySpinnerArrows
+ jr z, .asm_44ff6
+ ld hl, GymSpinnerArrows
+.asm_44ff6
+ ld a, [wSimulatedJoypadStatesIndex]
+ bit 0, a
+ jr nz, .asm_45001
+ ld de, $18
+ add hl, de
+.asm_45001
+ ld a, $4
+ ld bc, $0
+.asm_45006
+ push af
+ push hl
+ push bc
+ add hl, bc
+ ld a, [hli]
+ ld e, a
+ ld a, [hli]
+ ld d, a
+ ld a, [hli]
+ ld c, a
+ ld a, [hli]
+ ld b, a
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ call CopyVideoData
+ pop bc
+ ld a, $6
+ add c
+ ld c, a
+ pop hl
+ pop af
+ dec a
+ jr nz, .asm_45006
+ ret
+
+INCLUDE "data/tilesets/spinner_tiles.asm"
+
+SpinnerPlayerFacingDirections:
+; This isn't the order of the facing directions. Rather, it's a list of
+; the facing directions that come next. For example, when the player is
+; facing down (00), the next facing direction is left (08).
+ db $08 ; down -> left
+ db $0C ; up -> right
+ db $04 ; left -> up
+ db $00 ; right -> down
+
+; these tiles are the animation for the tiles that push the player in dungeons like Rocket HQ
+SpinnerArrowAnimTiles:
+ INCBIN "gfx/overworld/spinners.2bpp"