diff options
author | Rangi42 <remy.oukaour+rangi42@gmail.com> | 2018-01-26 21:42:39 -0500 |
---|---|---|
committer | Rangi42 <remy.oukaour+rangi42@gmail.com> | 2018-01-26 21:42:39 -0500 |
commit | 14a4f70816c32b2899662b42261fa1c8062f9ae0 (patch) | |
tree | 03c8628bcc994dd6dfe52b7247e4e157f5f6e3e2 | |
parent | 540fca486878860200cf25436347d72f34108557 (diff) |
Tutorial: Colored trainer card badges
-rw-r--r-- | Colored-trainer-card-badges.md | 102 | ||||
-rw-r--r-- | Tutorials.md | 1 | ||||
-rw-r--r-- | screenshots/badge-colors.png | bin | 0 -> 2369 bytes |
3 files changed, 103 insertions, 0 deletions
diff --git a/Colored-trainer-card-badges.md b/Colored-trainer-card-badges.md new file mode 100644 index 0000000..d254066 --- /dev/null +++ b/Colored-trainer-card-badges.md @@ -0,0 +1,102 @@ +This one is a simple upgrade. + + +## 1. Define the colors + +Create **gfx/trainer_card/badges.pal**: + +```diff ++ RGB 31,31,31, 21,21,24, 13,13,16, 00,00,00 ; ZEPHYRBADGE ++ RGB 31,31,31, 31,12,12, 29,00,00, 00,00,00 ; HIVEBADGE ++ RGB 31,31,31, 29,29,29, 27,24,00, 00,00,00 ; PLAINBADGE ++ RGB 31,31,31, 23,22,26, 11,10,23, 00,00,00 ; FOGBADGE ++ RGB 31,31,31, 27,16,08, 12,07,04, 00,00,00 ; STORMBADGE ++ RGB 31,31,31, 23,26,29, 15,19,23, 00,00,00 ; MINERALBADGE ++ RGB 31,31,31, 19,27,30, 00,22,26, 00,00,00 ; GLACIERBADGE ++ RGB 31,31,31, 30,09,05, 05,05,06, 00,00,00 ; RISINGBADGE +``` + + +## 2. Load the colors + +Edit [engine/cgb_layouts.asm](../blob/master/engine/cgb_layouts.asm): + +```diff +_CGB_TrainerCard: ; 9289 + ... +- ld a, PREDEFPAL_CGB_BADGE +- call GetPredefPal +- call LoadHLPaletteIntoDE ++ ld hl, .BadgePalettes ++ ld bc, 8 palettes ++ ld a, BANK(wOBPals1) ++ call FarCopyWRAM + + ... + ret +; 9373 + ++.BadgePalettes: ++INCLUDE "gfx/trainer_card/badges.pal" +``` + + +## 3. Apply the colors to the badges + +Edit [[engine/trainer_card.asm](../blob/master/engine/trainer_card.asm): + +``` +TrainerCard_JohtoBadgesOAM: ; 254c9 +; Template OAM data for each badge on the trainer card. +; Format: + ; y, x, palette + ; cycle 1: face tile, in1 tile, in2 tile, in3 tile + ; cycle 2: face tile, in1 tile, in2 tile, in3 tile + + dw wJohtoBadges + + ; Zephyrbadge + db $68, $18, 0 + db $00, $20, $24, $20 | (1 << 7) + db $00, $20, $24, $20 | (1 << 7) + + ; Hivebadge +- db $68, $38, 0 ++ db $68, $38, 1 + ... + + ; Plainbadge +- db $68, $58, 0 ++ db $68, $58, 2 + ... + + ; Fogbadge +- db $68, $78, 0 ++ db $68, $78, 3 + ... + + ; Mineralbadge +- db $80, $38, 0 ++ db $80, $38, 5 + ... + + ; Stormbadge +- db $80, $18, 0 ++ db $80, $18, 4 + ... + + ; Glacierbadge +- db $80, $58, 0 ++ db $80, $58, 6 + ... + + ; Risingbadge + ; X-flips on alternate cycles. +- db $80, $78, 0 ++ db $80, $78, 7 + ... +``` + +That's it! + + diff --git a/Tutorials.md b/Tutorials.md index 0e31d64..b777d48 100644 --- a/Tutorials.md +++ b/Tutorials.md @@ -5,6 +5,7 @@ **Upgrades to existing features:** - [Remove the 25% failure chance for AI status moves](Remove-the-25%25-failure-chance-for-AI-status-moves) +- [Colored trainer card badges](Colored-trainer-card-badges) - [Allow map tiles to appear above sprites](Allow-map-tiles-to-appear-above-sprites) **Features from later generations:** diff --git a/screenshots/badge-colors.png b/screenshots/badge-colors.png Binary files differnew file mode 100644 index 0000000..cf2da80 --- /dev/null +++ b/screenshots/badge-colors.png |