summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRangi <remy.oukaour+rangi42@gmail.com>2018-09-01 22:24:05 -0400
committerRangi <remy.oukaour+rangi42@gmail.com>2018-09-01 22:24:05 -0400
commit1e36be6d7d85d33834b4c4f7702ab558dea77b96 (patch)
treeba565b9283d87c7f506b41c98093f2a13d6601ba
parentbfc41fea209538aa44bc3ce101c3034b25bc1d3c (diff)
normal.pal → front.gbcpal
-rw-r--r--Add-a-new-Pokémon.md40
-rw-r--r--Add-a-new-trainer-class.md23
-rw-r--r--Remove-Pokémon-sprite-animations.md36
3 files changed, 53 insertions, 46 deletions
diff --git a/Add-a-new-Pokémon.md b/Add-a-new-Pokémon.md
index b9f6cd9..3102d1e 100644
--- a/Add-a-new-Pokémon.md
+++ b/Add-a-new-Pokémon.md
@@ -330,7 +330,7 @@ Now the Pokédex entry exists, and will be listed correctly in "Old Pokédex Mod
Edit [data/pokemon/dex_order_new.asm](../blob/master/data/pokemon/dex_order_new.asm):
```diff
- NewPokedexOrder:
+ NewPokedexOrder:
db CHIKORITA
...
db AERODACTYL
@@ -370,13 +370,13 @@ Then edit [gfx/footprints.asm](../blob/master/gfx/footprints.asm):
; (32 rows of 8 footprints per row).
; That means there's a row of the top two tiles for eight footprints,
; then a row of the bottom two tiles for those eight footprints.
-
+
; These macros help extract the first and the last two tiles, respectively.
footprint_top EQUS "0, 2 * LEN_1BPP_TILE"
footprint_bottom EQUS "2 * LEN_1BPP_TILE, 2 * LEN_1BPP_TILE"
-
+
; Entries correspond to Pokémon species, two apiece, 8 tops then 8 bottoms
-
+
...
; 249-256 top halves
INCBIN "gfx/footprints/lugia.1bpp", footprint_top
@@ -458,13 +458,15 @@ This Munchlax animation was designed by SCMidna. But you're more likely to have
When you `make` the ROM, a number of sprite-related files will be automatically generated for you:
-- **normal.pal:** Like shiny.pal, but with the normal colors, derived from front.png.
+- **front.gbcpal:** Like shiny.pal, but for the normal colors; derived from front.png.
- **front.dimensions:** The size of the still sprite from front.png.
- **front.animated.2bpp.lz:** The compressed tiles needed to animate the sprite. Animation frames tend to have lots of duplicate tiles, since only parts of a Pokémon move at a time, so each unique tile only exists once.
- **bitmask.asm:** A sequence of masks that define which spots in each frame are changed from the still sprite.
- **frames.asm:** A sequence of lists that declare the tile IDs with which to fill in the changed spots in each frame.
-There are two main reasons to pay attention to these auto-generated files. One, you want to make sure that normal.pal got its colors in the right order, and have shiny.pal match it. Two, if your animation appears corrupt, you want to make sure that frames.asm isn't using too high tile IDs. A 40x40 sprite can use IDs $00 to $31; a 48x48 sprite can use up to $47; a 56x56 sprite can use up to $61. If you see IDs above those limits, edit your front.png frames so they use fewer unique tiles.
+There are two main reasons to pay attention to these auto-generated files. One, you want to make sure that front.gbcpal got its colors in the right order, and have shiny.pal match it. Two, if your animation appears corrupt, you want to make sure that frames.asm isn't using too high tile IDs. A 40x40 sprite can use IDs $00 to $31; a 48x48 sprite can use up to $47; a 56x56 sprite can use up to $61. If you see IDs above those limits, edit your front.png frames so they use fewer unique tiles.
+
+(Older versions of pokecrystal generated normal.pal and normal.gbcpal files instead of front.gbcpal, but this was redundant work and could mislead users into editing normal.pal directly, so as of September 2018 they were removed.)
Anyway, all that's left is to `INCLUDE` and point to to the new data!
@@ -512,39 +514,43 @@ Anyway, edit [data/pokemon/palettes.asm](../blob/master/data/pokemon/palettes.as
```diff
PokemonPalettes:
; entries correspond to Pokémon species, two apiece
-
+
+ ; Each front.gbcpal is generated from the corresponding .png, and
+ ; only the middle two colors are included, not black or white.
+ ; Shiny palettes are defined directly, not generated.
+
; 000
RGB 30, 22, 17
RGB 16, 14, 19
; 000 shiny
RGB 30, 22, 17
RGB 16, 14, 19
-
- INCLUDE "gfx/pokemon/bulbasaur/normal.pal"
+
+ INCBIN "gfx/pokemon/bulbasaur/front.gbcpal", middle_colors
INCLUDE "gfx/pokemon/bulbasaur/shiny.pal"
...
- INCLUDE "gfx/pokemon/celebi/normal.pal"
+ INCBIN "gfx/pokemon/celebi/front.gbcpal", middle_colors
INCLUDE "gfx/pokemon/celebi/shiny.pal"
-
+
-; 252
- RGB 30, 26, 11
- RGB 23, 16, 00
-; 252 shiny
- RGB 30, 26, 11
- RGB 23, 16, 00
-+INCLUDE "gfx/pokemon/munchlax/normal.pal"
++INCBIN "gfx/pokemon/munchlax/front.gbcpal", middle_colors
+INCLUDE "gfx/pokemon/munchlax/shiny.pal"
-
- INCLUDE "gfx/pokemon/egg/normal.pal"
+
+ INCBIN "gfx/pokemon/egg/front.gbcpal", middle_colors
INCLUDE "gfx/pokemon/egg/shiny.pal"
-
+
; 254
RGB 30, 26, 11
RGB 23, 16, 00
; 254 shiny
RGB 30, 26, 11
RGB 23, 16, 00
-
+
; 255
RGB 23, 23, 23
RGB 17, 17, 17
@@ -553,6 +559,8 @@ Anyway, edit [data/pokemon/palettes.asm](../blob/master/data/pokemon/palettes.as
RGB 17, 17, 17
```
+(Older versions of pokecrystal would `INCLUDE "normal.pal"` instead of `INCBIN "front.gbcpal"`, as discussed earlier.)
+
Edit [gfx/pokemon/anim_pointers.asm](../blob/master/gfx/pokemon/anim_pointers.asm):
```diff
diff --git a/Add-a-new-trainer-class.md b/Add-a-new-trainer-class.md
index 7b068e1..e067d53 100644
--- a/Add-a-new-trainer-class.md
+++ b/Add-a-new-trainer-class.md
@@ -221,16 +221,21 @@ Anyway, edit [data/trainers/palettes.asm](../blob/master/data/trainers/palettes.
TrainerPalettes:
; entries correspond to trainer classes
+ ; Each .gbcpal is generated from the corresponding .png, and
+ ; only the middle two colors are included, not black or white.
+
PlayerPalette: ; Chris uses the same colors as Cal
- INCLUDE "gfx/trainers/cal.pal"
+ INCBIN "gfx/trainers/cal.gbcpal", middle_colors
KrisPalette: ; Kris shares Falkner's palette
- INCLUDE "gfx/trainers/falkner.pal"
+ INCBIN "gfx/trainers/falkner.gbcpal", middle_colors
...
- INCLUDE "gfx/trainers/mysticalman.pal"
-+INCLUDE "gfx/trainers/parasol_lady.pal"
+ INCBIN "gfx/trainers/mysticalman.gbcpal", middle_colors
++INCBIN "gfx/trainers/mysticalman.parasol_lady", middle_colors
```
-parasol_lady.2bpp.lz and parasol_lady.pal will be automatically generated from parasol_lady.png when you run `make`.
+parasol_lady.2bpp.lz and parasol_lady.gbcpal will be automatically generated from parasol_lady.png when you run `make`.
+
+(Older versions of pokecrystal would `INCLUDE "parasol_lady.pal"` instead of `INCBIN "parasol_lady.gbcpal"`. This is because they generated .pal files instead of .gbcpal, but this was redundant work and could mislead users into editing .pal files directly, so as of September 2018 they were removed.)
## 7. Define their individual parties
@@ -367,7 +372,7 @@ Edit [gfx/pics.asm](../blob/master/gfx/pics.asm) again:
```diff
SECTION "Pics 3", ROMX
-
+
SteelixFrontpic: INCBIN "gfx/pokemon/steelix/front.animated.2bpp.lz"
AlakazamFrontpic: INCBIN "gfx/pokemon/alakazam/front.animated.2bpp.lz"
GyaradosFrontpic: INCBIN "gfx/pokemon/gyarados/front.animated.2bpp.lz"
@@ -386,11 +391,11 @@ Edit [gfx/pics.asm](../blob/master/gfx/pics.asm) again:
RaichuFrontpic: INCBIN "gfx/pokemon/raichu/front.animated.2bpp.lz"
PrimeapeFrontpic: INCBIN "gfx/pokemon/primeape/front.animated.2bpp.lz"
-OmastarBackpic: INCBIN "gfx/pokemon/omastar/back.2bpp.lz"
-
+
...
-
+
SECTION "Pics 19", ROMX
-
+
ParasolLadyPic: INCBIN "gfx/trainers/parasol_lady.2bpp.lz"
+OmastarBackpic: INCBIN "gfx/pokemon/omastar/back.2bpp.lz"
```
diff --git a/Remove-Pokémon-sprite-animations.md b/Remove-Pokémon-sprite-animations.md
index b2e5a8e..b135f6b 100644
--- a/Remove-Pokémon-sprite-animations.md
+++ b/Remove-Pokémon-sprite-animations.md
@@ -556,6 +556,19 @@ mv $temp_file $1
Then edit the [Makefile](../blob/master/Makefile):
```diff
+ ### Pokemon pic animation rules
+
+ gfx/pokemon/%/front.animated.2bpp: gfx/pokemon/%/front.2bpp gfx/pokemon/%/front.dimensions
+ tools/pokemon_animation_graphics -o $@ $^
++ tools/trim_animation.sh $@ $(word 2,$^)
+-gfx/pokemon/%/front.animated.tilemap: gfx/pokemon/%/front.2bpp gfx/pokemon/%/front.dimensions
+- tools/pokemon_animation_graphics -t $@ $^
+-gfx/pokemon/%/bitmask.asm: gfx/pokemon/%/front.animated.tilemap gfx/pokemon/%/front.dimensions
+- tools/pokemon_animation -b $^ > $@
+-gfx/pokemon/%/frames.asm: gfx/pokemon/%/front.animated.tilemap gfx/pokemon/%/front.dimensions
+- tools/pokemon_animation -f $^ > $@
+-
+-
-### Terrible hacks to match animations. Delete these rules if you don't care about matching.
-
-# Dewgong has an unused tile id in its last frame. The tile itself is missing.
@@ -574,31 +587,12 @@ Then edit the [Makefile](../blob/master/Makefile):
- tools/pokemon_animation_graphics --girafarig -o $@ $^
-gfx/pokemon/girafarig/front.animated.tilemap: gfx/pokemon/girafarig/front.2bpp gfx/pokemon/girafarig/front.dimensions
- tools/pokemon_animation_graphics --girafarig -t $@ $^
--
-
- ### Pokemon pic graphics rules
-
- gfx/pokemon/%/front.dimensions: gfx/pokemon/%/front.png
- tools/png_dimensions $< $@
- gfx/pokemon/%/normal.pal: gfx/pokemon/%/normal.gbcpal
- tools/palette -p $< > $@
- gfx/pokemon/%/normal.gbcpal: gfx/pokemon/%/front.png
- $(RGBGFX) -p $@ $<
- gfx/pokemon/%/back.2bpp: gfx/pokemon/%/back.png
- $(RGBGFX) -h -o $@ $<
--gfx/pokemon/%/bitmask.asm: gfx/pokemon/%/front.animated.tilemap gfx/pokemon/%/front.dimensions
-- tools/pokemon_animation -b $^ > $@
--gfx/pokemon/%/frames.asm: gfx/pokemon/%/front.animated.tilemap gfx/pokemon/%/front.dimensions
-- tools/pokemon_animation -f $^ > $@
- gfx/pokemon/%/front.animated.2bpp: gfx/pokemon/%/front.2bpp gfx/pokemon/%/front.dimensions
- tools/pokemon_animation_graphics -o $@ $^
-+ tools/trim_animation.sh $@ $(word 2,$^)
--gfx/pokemon/%/front.animated.tilemap: gfx/pokemon/%/front.2bpp gfx/pokemon/%/front.dimensions
-- tools/pokemon_animation_graphics -t $@ $^
```
(Be sure to use tabs, not spaces, for indenting commands in the Makefile!)
+(Older versions of pokecrystal also had rules to build `gfx/pokemon/%/normal.pal`, `gfx/pokemon/%/normal.gbcpal`, and `gfx/pokemon/%/back.2bpp`, but as of September 2018 they were removed. They do not need to be changed for this tutorial.)
+
Let's go over what trim_animation.sh is doing. Before, this was the workflow when building the ROM:
1. `tools/gfx` converts each front.png to **front.2bpp**