diff options
-rw-r--r-- | constants/gfx_constants.asm | 21 | ||||
-rwxr-xr-x | data/sgb/sgb_palettes.asm | 210 | ||||
-rwxr-xr-x | engine/battle/animations.asm | 8 | ||||
-rwxr-xr-x | engine/movie/intro.asm | 6 | ||||
-rwxr-xr-x | engine/movie/title.asm | 2 | ||||
-rw-r--r-- | engine/overworld/clear_variables.asm | 2 | ||||
-rwxr-xr-x | engine/overworld/cut.asm | 2 | ||||
-rw-r--r-- | macros.asm | 1 | ||||
-rwxr-xr-x | macros/data.asm | 4 | ||||
-rw-r--r-- | macros/gfx.asm | 17 |
10 files changed, 84 insertions, 189 deletions
diff --git a/constants/gfx_constants.asm b/constants/gfx_constants.asm index 04671ecb..0cc0d98d 100644 --- a/constants/gfx_constants.asm +++ b/constants/gfx_constants.asm @@ -1,15 +1,20 @@ -SCREEN_WIDTH EQU 20 -SCREEN_HEIGHT EQU 18 +TILE_WIDTH EQU 8 ; pixels +LEN_1BPP_TILE EQU 1 * TILE_WIDTH ; bytes +LEN_2BPP_TILE EQU 2 * TILE_WIDTH ; bytes -SCREEN_WIDTH_PIXELS EQU SCREEN_WIDTH * 8 -SCREEN_HEIGHT_PIXELS EQU SCREEN_HEIGHT * 8 +NUM_PAL_COLORS EQU 4 +PAL_COLOR_SIZE EQU 2 +PALETTE_SIZE EQU NUM_PAL_COLORS * PAL_COLOR_SIZE -BYTES_PER_TILE EQU 16 +SCREEN_WIDTH EQU 20 +SCREEN_HEIGHT EQU 18 +SCREEN_WIDTH_PX EQU SCREEN_WIDTH * TILE_WIDTH ; pixels +SCREEN_HEIGHT_PX EQU SCREEN_HEIGHT * TILE_WIDTH ; pixels -BG_MAP_WIDTH EQU 32 -BG_MAP_HEIGHT EQU 32 +BG_MAP_WIDTH EQU 32 ; tiles +BG_MAP_HEIGHT EQU 32 ; tiles -SPRITEBUFFERSIZE EQU 7*7 * 8 ; 7 * 7 (tiles) * 8 (bytes per tile) +SPRITEBUFFERSIZE EQU 7 * 7 * LEN_1BPP_TILE ; HP bar HP_BAR_GREEN EQU 0 diff --git a/data/sgb/sgb_palettes.asm b/data/sgb/sgb_palettes.asm index 97f1d8ec..056ac8b9 100755 --- a/data/sgb/sgb_palettes.asm +++ b/data/sgb/sgb_palettes.asm @@ -1,174 +1,50 @@ -; palettes for overworlds, title screen, monsters SuperPalettes: - RGB 31,29,31 ; PAL_ROUTE - RGB 21,28,11 - RGB 20,26,31 - RGB 3,2,2 - RGB 31,29,31 ; PAL_PALLET - RGB 25,28,27 - RGB 20,26,31 - RGB 3,2,2 - RGB 31,29,31 ; PAL_VIRIDIAN - RGB 17,26,3 - RGB 20,26,31 - RGB 3,2,2 - RGB 31,29,31 ; PAL_PEWTER - RGB 23,25,16 - RGB 20,26,31 - RGB 3,2,2 - RGB 31,29,31 ; PAL_CERULEAN - RGB 17,20,30 - RGB 20,26,31 - RGB 3,2,2 - RGB 31,29,31 ; PAL_LAVENDER - RGB 27,20,27 - RGB 20,26,31 - RGB 3,2,2 - RGB 31,29,31 ; PAL_VERMILION - RGB 30,18,0 - RGB 20,26,31 - RGB 3,2,2 - RGB 31,29,31 ; PAL_CELADON - RGB 16,30,22 - RGB 20,26,31 - RGB 3,2,2 - RGB 31,29,31 ; PAL_FUCHSIA - RGB 31,15,22 - RGB 20,26,31 - RGB 3,2,2 - RGB 31,29,31 ; PAL_CINNABAR - RGB 26,10,6 - RGB 20,26,31 - RGB 3,2,2 - RGB 31,29,31 ; PAL_INDIGO - RGB 22,14,24 - RGB 20,26,31 - RGB 3,2,2 - RGB 31,29,31 ; PAL_SAFFRON - RGB 27,27,3 - RGB 20,26,31 - RGB 3,2,2 - RGB 31,29,31 ; PAL_TOWNMAP - RGB 20,26,31 - RGB 17,23,10 - RGB 3,2,2 + RGB 31,29,31, 21,28,11, 20,26,31, 03,02,02 ; PAL_ROUTE + RGB 31,29,31, 25,28,27, 20,26,31, 03,02,02 ; PAL_PALLET + RGB 31,29,31, 17,26,03, 20,26,31, 03,02,02 ; PAL_VIRIDIAN + RGB 31,29,31, 23,25,16, 20,26,31, 03,02,02 ; PAL_PEWTER + RGB 31,29,31, 17,20,30, 20,26,31, 03,02,02 ; PAL_CERULEAN + RGB 31,29,31, 27,20,27, 20,26,31, 03,02,02 ; PAL_LAVENDER + RGB 31,29,31, 30,18,00, 20,26,31, 03,02,02 ; PAL_VERMILION + RGB 31,29,31, 16,30,22, 20,26,31, 03,02,02 ; PAL_CELADON + RGB 31,29,31, 31,15,22, 20,26,31, 03,02,02 ; PAL_FUCHSIA + RGB 31,29,31, 26,10,06, 20,26,31, 03,02,02 ; PAL_CINNABAR + RGB 31,29,31, 22,14,24, 20,26,31, 03,02,02 ; PAL_INDIGO + RGB 31,29,31, 27,27,03, 20,26,31, 03,02,02 ; PAL_SAFFRON + RGB 31,29,31, 20,26,31, 17,23,10, 03,02,02 ; PAL_TOWNMAP IF DEF(_RED) - RGB 31,29,31 ; PAL_LOGO1 - RGB 30,30,17 - RGB 17,23,10 - RGB 21,0,4 + RGB 31,29,31, 30,30,17, 17,23,10, 21,00,04 ; PAL_LOGO1 ENDC IF DEF(_BLUE) - RGB 31,29,31 ; PAL_LOGO1 - RGB 30,30,17 - RGB 21,0,4 - RGB 14,19,29 -ENDC - RGB 31,29,31 ; PAL_LOGO2 - RGB 30,30,17 - RGB 18,18,24 - RGB 7,7,16 - RGB 31,29,31 ; PAL_0F - RGB 24,20,30 - RGB 11,20,30 - RGB 3,2,2 - RGB 31,29,31 ; PAL_MEWMON - RGB 30,22,17 - RGB 16,14,19 - RGB 3,2,2 - RGB 31,29,31 ; PAL_BLUEMON - RGB 18,20,27 - RGB 11,15,23 - RGB 3,2,2 - RGB 31,29,31 ; PAL_REDMON - RGB 31,20,10 - RGB 26,10,6 - RGB 3,2,2 - RGB 31,29,31 ; PAL_CYANMON - RGB 21,25,29 - RGB 14,19,25 - RGB 3,2,2 - RGB 31,29,31 ; PAL_PURPLEMON - RGB 27,22,24 - RGB 21,15,23 - RGB 3,2,2 - RGB 31,29,31 ; PAL_BROWNMON - RGB 28,20,15 - RGB 21,14,9 - RGB 3,2,2 - RGB 31,29,31 ; PAL_GREENMON - RGB 20,26,16 - RGB 9,20,11 - RGB 3,2,2 - RGB 31,29,31 ; PAL_PINKMON - RGB 30,22,24 - RGB 28,15,21 - RGB 3,2,2 - RGB 31,29,31 ; PAL_YELLOWMON - RGB 31,28,14 - RGB 26,20,0 - RGB 3,2,2 - RGB 31,29,31 ; PAL_GREYMON - RGB 26,21,22 - RGB 15,15,18 - RGB 3,2,2 - RGB 31,29,31 ; PAL_SLOTS1 - RGB 26,21,22 - RGB 27,20,6 - RGB 3,2,2 - RGB 31,29,31 ; PAL_SLOTS2 - RGB 31,31,17 -IF DEF(_RED) - RGB 25,17,21 -ENDC -IF DEF(_BLUE) - RGB 16,19,29 -ENDC - RGB 3,2,2 - RGB 31,29,31 ; PAL_SLOTS3 - RGB 22,31,16 + RGB 31,29,31, 30,30,17, 21,00,04, 14,19,29 ; PAL_LOGO1 +ENDC + RGB 31,29,31, 30,30,17, 18,18,24, 07,07,16 ; PAL_LOGO2 + RGB 31,29,31, 24,20,30, 11,20,30, 03,02,02 ; PAL_0F + RGB 31,29,31, 30,22,17, 16,14,19, 03,02,02 ; PAL_MEWMON + RGB 31,29,31, 18,20,27, 11,15,23, 03,02,02 ; PAL_BLUEMON + RGB 31,29,31, 31,20,10, 26,10,06, 03,02,02 ; PAL_REDMON + RGB 31,29,31, 21,25,29, 14,19,25, 03,02,02 ; PAL_CYANMON + RGB 31,29,31, 27,22,24, 21,15,23, 03,02,02 ; PAL_PURPLEMON + RGB 31,29,31, 28,20,15, 21,14,09, 03,02,02 ; PAL_BROWNMON + RGB 31,29,31, 20,26,16, 09,20,11, 03,02,02 ; PAL_GREENMON + RGB 31,29,31, 30,22,24, 28,15,21, 03,02,02 ; PAL_PINKMON + RGB 31,29,31, 31,28,14, 26,20,00, 03,02,02 ; PAL_YELLOWMON + RGB 31,29,31, 26,21,22, 15,15,18, 03,02,02 ; PAL_GREYMON + RGB 31,29,31, 26,21,22, 27,20,06, 03,02,02 ; PAL_SLOTS1 IF DEF(_RED) - RGB 25,17,21 + RGB 31,29,31, 31,31,17, 25,17,21, 03,02,02 ; PAL_SLOTS2 + RGB 31,29,31, 22,31,16, 25,17,21, 03,02,02 ; PAL_SLOTS3 + RGB 31,29,31, 16,19,29, 25,17,21, 03,02,02 ; PAL_SLOTS4 ENDC IF DEF(_BLUE) - RGB 16,19,29 -ENDC - RGB 3,2,2 - RGB 31,29,31 ; PAL_SLOTS4 -IF DEF(_RED) - RGB 16,19,29 - RGB 25,17,21 -ENDC -IF DEF(_BLUE) - RGB 25,17,21 - RGB 16,19,29 -ENDC - RGB 3,2,2 - RGB 31,29,31 ; PAL_BLACK - RGB 7,7,7 - RGB 2,3,3 - RGB 3,2,2 - RGB 31,29,31 ; PAL_GREENBAR - RGB 30,26,15 - RGB 9,20,11 - RGB 3,2,2 - RGB 31,29,31 ; PAL_YELLOWBAR - RGB 30,26,15 - RGB 26,20,0 - RGB 3,2,2 - RGB 31,29,31 ; PAL_REDBAR - RGB 30,26,15 - RGB 26,10,6 - RGB 3,2,2 - RGB 31,29,31 ; PAL_BADGE - RGB 30,22,17 - RGB 11,15,23 - RGB 3,2,2 - RGB 31,29,31 ; PAL_CAVE - RGB 21,14,9 - RGB 18,24,22 - RGB 3,2,2 - RGB 31,29,31 ; PAL_GAMEFREAK - RGB 31,28,14 - RGB 24,20,10 - RGB 3,2,2 + RGB 31,29,31, 31,31,17, 16,19,29, 03,02,02 ; PAL_SLOTS2 + RGB 31,29,31, 22,31,16, 16,19,29, 03,02,02 ; PAL_SLOTS3 + RGB 31,29,31, 25,17,21, 16,19,29, 03,02,02 ; PAL_SLOTS4 +ENDC + RGB 31,29,31, 07,07,07, 02,03,03, 03,02,02 ; PAL_BLACK + RGB 31,29,31, 30,26,15, 09,20,11, 03,02,02 ; PAL_GREENBAR + RGB 31,29,31, 30,26,15, 26,20,00, 03,02,02 ; PAL_YELLOWBAR + RGB 31,29,31, 30,26,15, 26,10,06, 03,02,02 ; PAL_REDBAR + RGB 31,29,31, 30,22,17, 11,15,23, 03,02,02 ; PAL_BADGE + RGB 31,29,31, 21,14,09, 18,24,22, 03,02,02 ; PAL_CAVE + RGB 31,29,31, 31,28,14, 24,20,10, 03,02,02 ; PAL_GAMEFREAK diff --git a/engine/battle/animations.asm b/engine/battle/animations.asm index ee476ce9..78301b2e 100755 --- a/engine/battle/animations.asm +++ b/engine/battle/animations.asm @@ -1838,10 +1838,10 @@ AnimationWavyScreen: call Delay3 xor a ld [hAutoBGTransferEnabled], a - ld a, SCREEN_HEIGHT_PIXELS + ld a, SCREEN_HEIGHT_PX ld [hWY], a ld d, $80 ; terminator - ld e, SCREEN_HEIGHT_PIXELS - 1 + ld e, SCREEN_HEIGHT_PX - 1 ld c, $ff ld hl, WavyScreenLineOffsets .loop @@ -2538,7 +2538,7 @@ AnimationShakeEnemyHUD: ; Now that the regular BG is showing the same thing the window was, move the ; window off the screen so that we can modify its contents below. - ld a, SCREEN_HEIGHT_PIXELS + ld a, SCREEN_HEIGHT_PX ld [hWY], a ; Copy wTileMap to VRAM such that the row below the enemy HUD (in wTileMap) is @@ -2575,7 +2575,7 @@ AnimationShakeEnemyHUD: ; Restore the original graphics. call AnimationShowMonPic call ClearSprites - ld a, SCREEN_HEIGHT_PIXELS + ld a, SCREEN_HEIGHT_PX ld [hWY], a ld hl, vBGMap1 call BattleAnimCopyTileMapToVRAM diff --git a/engine/movie/intro.asm b/engine/movie/intro.asm index a8151ab4..21f1a885 100755 --- a/engine/movie/intro.asm +++ b/engine/movie/intro.asm @@ -97,7 +97,7 @@ PlayIntroScene: ; hip ld a, SFX_INTRO_HIP call PlaySound - ld a, (FightIntroFrontMon2 - FightIntroFrontMon) / BYTES_PER_TILE + ld a, (FightIntroFrontMon2 - FightIntroFrontMon) / LEN_2BPP_TILE ld [wIntroNidorinoBaseTile], a ld de, IntroNidorinoAnimation3 call AnimateIntroNidorino @@ -129,7 +129,7 @@ PlayIntroScene: call CheckForUserInterruption ret c - ld a, (FightIntroFrontMon2 - FightIntroFrontMon) / BYTES_PER_TILE + ld a, (FightIntroFrontMon2 - FightIntroFrontMon) / LEN_2BPP_TILE ld [wIntroNidorinoBaseTile], a ld de, IntroNidorinoAnimation6 call AnimateIntroNidorino @@ -140,7 +140,7 @@ PlayIntroScene: ; lunge ld a, SFX_INTRO_LUNGE call PlaySound - ld a, (FightIntroFrontMon3 - FightIntroFrontMon) / BYTES_PER_TILE + ld a, (FightIntroFrontMon3 - FightIntroFrontMon) / LEN_2BPP_TILE ld [wIntroNidorinoBaseTile], a ld de, IntroNidorinoAnimation7 jp AnimateIntroNidorino diff --git a/engine/movie/title.asm b/engine/movie/title.asm index 9cbe5494..5ee9b77f 100755 --- a/engine/movie/title.asm +++ b/engine/movie/title.asm @@ -189,7 +189,7 @@ ENDC ; scroll game version in from the right call PrintGameVersionOnTitleScreen - ld a, SCREEN_HEIGHT_PIXELS + ld a, SCREEN_HEIGHT_PX ld [hWY], a ld d, 144 .scrollTitleScreenGameVersionLoop diff --git a/engine/overworld/clear_variables.asm b/engine/overworld/clear_variables.asm index b5a1f4a0..9b735495 100644 --- a/engine/overworld/clear_variables.asm +++ b/engine/overworld/clear_variables.asm @@ -1,5 +1,5 @@ ClearVariablesOnEnterMap:: - ld a, SCREEN_HEIGHT_PIXELS + ld a, SCREEN_HEIGHT_PX ld [hWY], a ld [rWY], a xor a diff --git a/engine/overworld/cut.asm b/engine/overworld/cut.asm index fa28a751..dd9b7c1a 100755 --- a/engine/overworld/cut.asm +++ b/engine/overworld/cut.asm @@ -37,7 +37,7 @@ UsedCut: call GBPalWhiteOutWithDelay3 call ClearSprites call RestoreScreenTilesAndReloadTilePatterns - ld a, SCREEN_HEIGHT_PIXELS + ld a, SCREEN_HEIGHT_PX ld [hWY], a call Delay3 call LoadGBPal @@ -3,6 +3,7 @@ INCLUDE "macros/predef.asm" INCLUDE "macros/farcall.asm" INCLUDE "macros/data.asm" INCLUDE "macros/code.asm" +INCLUDE "macros/gfx.asm" INCLUDE "macros/coords.asm" INCLUDE "macros/scripts/audio.asm" diff --git a/macros/data.asm b/macros/data.asm index 54d1d561..46fb866d 100755 --- a/macros/data.asm +++ b/macros/data.asm @@ -16,10 +16,6 @@ ENDM coins equs "bcd2" money equs "bcd3" -RGB: MACRO - dw (\3 << 10 | \2 << 5 | \1) -ENDM - tmlearn: MACRO x = 0 REPT _NARG diff --git a/macros/gfx.asm b/macros/gfx.asm new file mode 100644 index 00000000..bad051ad --- /dev/null +++ b/macros/gfx.asm @@ -0,0 +1,17 @@ +RGB: MACRO +rept _NARG / 3 + dw palred (\1) + palgreen (\2) + palblue (\3) + shift 3 +endr +ENDM + +palred EQUS "(1 << 0) *" +palgreen EQUS "(1 << 5) *" +palblue EQUS "(1 << 10) *" + +palettes EQUS "* PALETTE_SIZE" +palette EQUS "+ PALETTE_SIZE *" +color EQUS "+ PAL_COLOR_SIZE *" + +tiles EQUS "* LEN_2BPP_TILE" +tile EQUS "+ LEN_2BPP_TILE *" |