aboutsummaryrefslogtreecommitdiffstats
path: root/engine/battle
diff options
context:
space:
mode:
authorRangi42 <remy.oukaour+rangi42@gmail.com>2023-11-20 17:53:19 -0500
committerRangi42 <remy.oukaour+rangi42@gmail.com>2023-11-20 17:53:19 -0500
commitb066d3c9bc02cf4213173538d148cfabcc7212a8 (patch)
tree9ce48f3d91afbbb8fbe9274de3c271d6fa602190 /engine/battle
parentIdentify the unnamed HRAM variables and one WRAM label (#438) (diff)
downloadpokeyellow-b066d3c9bc02cf4213173538d148cfabcc7212a8.tar.gz
pokeyellow-b066d3c9bc02cf4213173538d148cfabcc7212a8.tar.xz
pokeyellow-b066d3c9bc02cf4213173538d148cfabcc7212a8.zip
Add `bigdw` and `dc` data macros
Diffstat (limited to 'engine/battle')
-rw-r--r--engine/battle/animations.asm54
-rw-r--r--engine/battle/battle_transitions.asm24
-rw-r--r--engine/battle/scale_sprites.asm21
3 files changed, 43 insertions, 56 deletions
diff --git a/engine/battle/animations.asm b/engine/battle/animations.asm
index fcfec14d..712958bc 100644
--- a/engine/battle/animations.asm
+++ b/engine/battle/animations.asm
@@ -976,7 +976,7 @@ AnimationFlashScreenLong:
push hl
.innerLoop
ld a, [hli]
- cp $01 ; is it the end of the palettes?
+ cp 1
jr z, .endOfPalettes
ldh [rBGP], a
call FlashScreenLongDelay
@@ -992,35 +992,35 @@ AnimationFlashScreenLong:
; BG palettes
FlashScreenLongMonochrome:
- db %11111001 ; 3, 3, 2, 1
- db %11111110 ; 3, 3, 3, 2
- db %11111111 ; 3, 3, 3, 3
- db %11111110 ; 3, 3, 3, 2
- db %11111001 ; 3, 3, 2, 1
- db %11100100 ; 3, 2, 1, 0
- db %10010000 ; 2, 1, 0, 0
- db %01000000 ; 1, 0, 0, 0
- db %00000000 ; 0, 0, 0, 0
- db %01000000 ; 1, 0, 0, 0
- db %10010000 ; 2, 1, 0, 0
- db %11100100 ; 3, 2, 1, 0
- db $01 ; terminator
+ dc 3, 3, 2, 1
+ dc 3, 3, 3, 2
+ dc 3, 3, 3, 3
+ dc 3, 3, 3, 2
+ dc 3, 3, 2, 1
+ dc 3, 2, 1, 0
+ dc 2, 1, 0, 0
+ dc 1, 0, 0, 0
+ dc 0, 0, 0, 0
+ dc 1, 0, 0, 0
+ dc 2, 1, 0, 0
+ dc 3, 2, 1, 0
+ db 1 ; end
; BG palettes
FlashScreenLongSGB:
- db %11111000 ; 3, 3, 2, 0
- db %11111100 ; 3, 3, 3, 0
- db %11111111 ; 3, 3, 3, 3
- db %11111100 ; 3, 3, 3, 0
- db %11111000 ; 3, 3, 2, 0
- db %11100100 ; 3, 2, 1, 0
- db %10010000 ; 2, 1, 0, 0
- db %01000000 ; 1, 0, 0, 0
- db %00000000 ; 0, 0, 0, 0
- db %01000000 ; 1, 0, 0, 0
- db %10010000 ; 2, 1, 0, 0
- db %11100100 ; 3, 2, 1, 0
- db $01 ; terminator
+ dc 3, 3, 2, 0
+ dc 3, 3, 3, 0
+ dc 3, 3, 3, 3
+ dc 3, 3, 3, 0
+ dc 3, 3, 2, 0
+ dc 3, 2, 1, 0
+ dc 2, 1, 0, 0
+ dc 1, 0, 0, 0
+ dc 0, 0, 0, 0
+ dc 1, 0, 0, 0
+ dc 2, 1, 0, 0
+ dc 3, 2, 1, 0
+ db 1 ; end
; causes a delay of 2 frames for the first cycle
; causes a delay of 1 frame for the second and third cycles
diff --git a/engine/battle/battle_transitions.asm b/engine/battle/battle_transitions.asm
index a16fd250..363533ce 100644
--- a/engine/battle/battle_transitions.asm
+++ b/engine/battle/battle_transitions.asm
@@ -335,18 +335,18 @@ BattleTransition_FlashScreen_:
ret
BattleTransition_FlashScreenPalettes:
- db %11111001
- db %11111110
- db %11111111
- db %11111110
- db %11111001
- db %11100100
- db %10010000
- db %01000000
- db %00000000
- db %01000000
- db %10010000
- db %11100100
+ dc 3, 3, 2, 1
+ dc 3, 3, 3, 2
+ dc 3, 3, 3, 3
+ dc 3, 3, 3, 2
+ dc 3, 3, 2, 1
+ dc 3, 2, 1, 0
+ dc 2, 1, 0, 0
+ dc 1, 0, 0, 0
+ dc 0, 0, 0, 0
+ dc 1, 0, 0, 0
+ dc 2, 1, 0, 0
+ dc 3, 2, 1, 0
db 1 ; end
; used for low level trainer dungeon battles
diff --git a/engine/battle/scale_sprites.asm b/engine/battle/scale_sprites.asm
index 8b8942e6..9e24c89d 100644
--- a/engine/battle/scale_sprites.asm
+++ b/engine/battle/scale_sprites.asm
@@ -77,21 +77,8 @@ ScalePixelsByTwo:
add hl, bc ; add offset
ret
-; repeats each input bit twice
+; repeats each input bit twice, e.g. DuplicateBitsTable[%0101] = %00110011
DuplicateBitsTable:
- db %00000000
- db %00000011
- db %00001100
- db %00001111
- db %00110000
- db %00110011
- db %00111100
- db %00111111
- db %11000000
- db %11000011
- db %11001100
- db %11001111
- db %11110000
- db %11110011
- db %11111100
- db %11111111
+FOR n, 16
+ db (n & 1) * 3 + (n & 2) * 6 + (n & 4) * 12 + (n & 8) * 24
+ENDR