Add bigdw and dc data macros

This commit is contained in:
Rangi42 2023-11-20 17:53:19 -05:00
parent 7a7a6d689c
commit b066d3c9bc
8 changed files with 76 additions and 91 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -131,10 +131,10 @@ ScrollCreditsMonLeft_SetSCX:
ret
HoFGBPalettes:
db %11000000
db %11010000
db %11100000
db %11110000
dc 3, 0, 0, 0
dc 3, 1, 0, 0
dc 3, 2, 0, 0
dc 3, 3, 0, 0
CreditsCopyTileMapToVRAM:
ld a, l

View file

@ -192,12 +192,12 @@ FadeInIntroPic:
ret
IntroFadePalettes:
db %01010100
db %10101000
db %11111100
db %11111000
db %11110100
db %11100100
dc 1, 1, 1, 0
dc 2, 2, 2, 0
dc 3, 3, 3, 0
dc 3, 3, 2, 0
dc 3, 3, 1, 0
dc 3, 2, 1, 0
MovePicLeft:
ld a, 119

View file

@ -340,19 +340,6 @@ SetSpriteCollisionValues:
ret
SpriteCollisionBitTable:
db %00000000,%00000001
db %00000000,%00000010
db %00000000,%00000100
db %00000000,%00001000
db %00000000,%00010000
db %00000000,%00100000
db %00000000,%01000000
db %00000000,%10000000
db %00000001,%00000000
db %00000010,%00000000
db %00000100,%00000000
db %00001000,%00000000
db %00010000,%00000000
db %00100000,%00000000
db %01000000,%00000000
db %10000000,%00000000
FOR n, $10
bigdw 1 << n
ENDR

View file

@ -62,12 +62,12 @@ GBFadeDecCommon:
jr nz, GBFadeDecCommon
ret
FadePal1:: db %11111111, %11111111, %11111111
FadePal2:: db %11111110, %11111110, %11111000
FadePal3:: db %11111001, %11100100, %11100100
FadePal4:: db %11100100, %11010000, %11100000
FadePal1:: dc 3,3,3,3, 3,3,3,3, 3,3,3,3
FadePal2:: dc 3,3,3,2, 3,3,3,2, 3,3,2,0
FadePal3:: dc 3,3,2,1, 3,2,1,0, 3,2,1,0
FadePal4:: dc 3,2,1,0, 3,1,0,0, 3,2,0,0
; rBGP rOBP0 rOBP1
FadePal5:: db %11100100, %11010000, %11100000
FadePal6:: db %10010000, %10000000, %10010000
FadePal7:: db %01000000, %01000000, %01000000
FadePal8:: db %00000000, %00000000, %00000000
FadePal5:: dc 3,2,1,0, 3,1,0,0, 3,2,0,0
FadePal6:: dc 2,1,0,0, 2,0,0,0, 2,1,0,0
FadePal7:: dc 1,0,0,0, 1,0,0,0, 1,0,0,0
FadePal8:: dc 0,0,0,0, 0,0,0,0, 0,0,0,0

View file

@ -56,6 +56,17 @@ MACRO dn ; nybbles
ENDR
ENDM
MACRO dc ; "crumbs"
REPT _NARG / 4
db ((\1) << 6) | ((\2) << 4) | ((\3) << 2) | (\4)
SHIFT 4
ENDR
ENDM
MACRO bigdw ; big-endian word
db HIGH(\1), LOW(\1)
ENDM
MACRO dba ; dbw bank, address
REPT _NARG
dbw BANK(\1), \1