diff --git a/.gitignore b/.gitignore index 8e5ae8b3f..da5883b87 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ *.4bpp *.8bpp *.gbapal +*.pmdpal *.lz *.rl *.pcm diff --git a/data/dungeon/banrpal.inc b/data/dungeon/banrpal.inc deleted file mode 100644 index 8f9153fb8..000000000 --- a/data/dungeon/banrpal.inc +++ /dev/null @@ -1,18 +0,0 @@ -.global banrpal -banrpal: -.byte 0x00, 0x00, 0x00, 0x80 -.byte 0x0f, 0x0f, 0x0f, 0x80 -.byte 0x1f, 0x1f, 0x1f, 0x80 -.byte 0x2f, 0x2f, 0x2f, 0x80 -.byte 0x3f, 0x3f, 0x3f, 0x80 -.byte 0x4f, 0x4f, 0x4f, 0x80 -.byte 0x5f, 0x5f, 0x5f, 0x80 -.byte 0x6f, 0x6f, 0x6f, 0x80 -.byte 0x7f, 0x7f, 0x7f, 0x80 -.byte 0x8f, 0x8f, 0x8f, 0x80 -.byte 0x9f, 0x9f, 0x9f, 0x80 -.byte 0xaf, 0xaf, 0xaf, 0x80 -.byte 0xbf, 0xbf, 0xbf, 0x80 -.byte 0xcf, 0xcf, 0xcf, 0x80 -.byte 0xd7, 0xd7, 0xd7, 0x80 -.byte 0xe7, 0xe7, 0xe7, 0x80 diff --git a/data/dungeon_sbin.s b/data/dungeon_sbin.s index acf45e13a..26e25aaef 100644 --- a/data/dungeon_sbin.s +++ b/data/dungeon_sbin.s @@ -43080,7 +43080,9 @@ gUnknown_8499554: #include "dungeon/banfont.inc" -#include "dungeon/banrpal.inc" +.global banrpal +banrpal: +.incbin "graphics/dungeon/pal/barnpal.pmdpal" #include "dungeon/colvec.inc" #include "dungeon/etcfont.inc" #include "dungeon/etcfonta.inc" diff --git a/data/monster_sbin.s b/data/monster_sbin.s index 37e971c8c..d2df720d4 100644 --- a/data/monster_sbin.s +++ b/data/monster_sbin.s @@ -612,7 +612,3 @@ ax_sprite 0, 0 .include "data/kao/deoxysnormal.inc" .include "data/kao/munchlax.inc" .include "data/kao/rayquazacutscene.inc" - -.global gPaletFile -gPaletFile: -.incbin "baserom.gba", 0x16BD42C, 0x82BD4 diff --git a/data/unk_96BD7AC.s b/data/unk_96BD7AC.s new file mode 100644 index 000000000..45dedf0c7 --- /dev/null +++ b/data/unk_96BD7AC.s @@ -0,0 +1,5 @@ +.section .rodata + +.align 2 + +.incbin "baserom.gba", 0x16BD7AC, 0x82854 diff --git a/data/unk_data.s b/data/unk_data.s index aa9d19e76..35d7f1ada 100644 --- a/data/unk_data.s +++ b/data/unk_data.s @@ -19,262 +19,22 @@ @ Unknown Palette .global monPal monPal: - .byte 0x00, 0x00, 0x00, 0x80 - .byte 0x17, 0x17, 0x0f, 0x80 - .byte 0x47, 0x37, 0x37, 0x80 - .byte 0x77, 0x67, 0x67, 0x80 - .byte 0xaf, 0x9f, 0x9f, 0x80 - .byte 0xd7, 0xcf, 0xcf, 0x80 - .byte 0xff, 0xff, 0xff, 0x80 - .byte 0x77, 0x1f, 0x47, 0x80 - .byte 0xaf, 0x3f, 0x6f, 0x80 - .byte 0xd7, 0x7f, 0x9f, 0x80 - .byte 0x00, 0x37, 0xc7, 0x80 - .byte 0x00, 0x97, 0xef, 0x80 - .byte 0x37, 0xbf, 0xff, 0x80 - .byte 0x77, 0x57, 0x37, 0x80 - .byte 0xb7, 0x7f, 0x47, 0x80 - - .byte 0xe7, 0xb7, 0x6f, 0x80 - .byte 0x00, 0x8f, 0x00, 0x80 - .byte 0x17, 0x17, 0x0f, 0x80 - .byte 0x5f, 0x5f, 0x5f, 0x80 - .byte 0xaf, 0xaf, 0xaf, 0x80 - .byte 0xff, 0xff, 0xff, 0x80 - .byte 0x77, 0x37, 0x00, 0x80 - .byte 0xbf, 0x87, 0x27, 0x80 - .byte 0xdf, 0xbf, 0x4f, 0x80 - .byte 0xff, 0xff, 0x77, 0x80 - .byte 0x4f, 0x27, 0x57, 0x80 - .byte 0x8f, 0x57, 0x7f, 0x80 - .byte 0xd7, 0x87, 0xa7, 0x80 - .byte 0x3f, 0x67, 0x00, 0x80 - .byte 0x67, 0x8f, 0x00, 0x80 - - .byte 0xb7, 0xd7, 0x1f, 0x80 - .byte 0x8f, 0x0f, 0x3f, 0x80 - .byte 0x00, 0x8f, 0x00, 0x80 - .byte 0x17, 0x17, 0x0f, 0x80 - .byte 0xc7, 0x87, 0x00, 0x80 - .byte 0xef, 0xdf, 0x2f, 0x80 - .byte 0xff, 0xff, 0xff, 0x80 - .byte 0x17, 0x4f, 0x6f, 0x80 - .byte 0x27, 0x7f, 0xb7, 0x80 - .byte 0x37, 0xaf, 0xff, 0x80 - .byte 0xbf, 0xe7, 0xef, 0x80 - .byte 0x87, 0x87, 0x00, 0x80 - .byte 0xbf, 0xbf, 0x00, 0x80 - .byte 0x8f, 0xd7, 0xf7, 0x80 - .byte 0x2f, 0x2f, 0x2f, 0x80 - - .byte 0x67, 0x67, 0x67, 0x80 - .byte 0xa7, 0xa7, 0xa7, 0x80 - .byte 0x37, 0xaf, 0xff, 0x80 - .byte 0x00, 0x8f, 0x00, 0x80 - .byte 0x17, 0x17, 0x0f, 0x80 - .byte 0x5f, 0x5f, 0x5f, 0x80 - .byte 0xaf, 0xaf, 0xaf, 0x80 - .byte 0xff, 0xff, 0xff, 0x80 - .byte 0x47, 0x1f, 0x5f, 0x80 - .byte 0x6f, 0x47, 0x87, 0x80 - .byte 0x9f, 0x6f, 0xb7, 0x80 - .byte 0xcf, 0x97, 0xe7, 0x80 - .byte 0x6f, 0x00, 0x37, 0x80 - .byte 0xa7, 0x47, 0x77, 0x80 - .byte 0xe7, 0x8f, 0xb7, 0x80 - - .byte 0x87, 0x3f, 0x00, 0x80 - .byte 0xaf, 0x6f, 0x00, 0x80 - .byte 0xef, 0xaf, 0x37, 0x80 - .byte 0xff, 0xd7, 0x57, 0x80 - .byte 0x00, 0x8f, 0x00, 0x80 - .byte 0x17, 0x17, 0x0f, 0x80 - .byte 0x5f, 0x5f, 0x5f, 0x80 - .byte 0xaf, 0xaf, 0xaf, 0x80 - .byte 0xff, 0xff, 0xff, 0x80 - .byte 0x37, 0x6f, 0x1f, 0x80 - .byte 0x5f, 0x8f, 0x17, 0x80 - .byte 0x87, 0xaf, 0x0f, 0x80 - .byte 0xaf, 0xd7, 0x0f, 0x80 - .byte 0x17, 0x1f, 0x77, 0x80 - .byte 0x37, 0x5f, 0xb7, 0x80 - - .byte 0x57, 0xa7, 0xff, 0x80 - .byte 0x27, 0x1f, 0x37, 0x80 - .byte 0x3f, 0x3f, 0x4f, 0x80 - .byte 0x57, 0x67, 0x67, 0x80 - .byte 0xbf, 0x17, 0x00, 0x80 - .byte 0x00, 0x8f, 0x00, 0x80 - .byte 0x17, 0x17, 0x0f, 0x80 - .byte 0x5f, 0x5f, 0x5f, 0x80 - .byte 0xaf, 0xaf, 0xaf, 0x80 - .byte 0xff, 0xff, 0xff, 0x80 - .byte 0x1f, 0x47, 0x6f, 0x80 - .byte 0x37, 0x6f, 0x9f, 0x80 - .byte 0x57, 0x9f, 0xcf, 0x80 - .byte 0x77, 0xcf, 0xff, 0x80 - .byte 0x57, 0x37, 0x00, 0x80 - - .byte 0x97, 0x67, 0x00, 0x80 - .byte 0xd7, 0xa7, 0x47, 0x80 - .byte 0x77, 0x2f, 0x77, 0x80 - .byte 0xaf, 0x47, 0xaf, 0x80 - .byte 0xdf, 0x77, 0xd7, 0x80 - .byte 0x87, 0x00, 0x00, 0x80 - .byte 0x00, 0x8f, 0x00, 0x80 - .byte 0x17, 0x17, 0x0f, 0x80 - .byte 0x5f, 0x5f, 0x5f, 0x80 - .byte 0xaf, 0xaf, 0xaf, 0x80 - .byte 0xff, 0xff, 0xff, 0x80 - .byte 0x6f, 0x17, 0x0f, 0x80 - .byte 0xa7, 0x37, 0x0f, 0x80 - .byte 0xd7, 0x57, 0x0f, 0x80 - .byte 0xf7, 0x9f, 0x67, 0x80 - - .byte 0x5f, 0x87, 0x0f, 0x80 - .byte 0x8f, 0xb7, 0x1f, 0x80 - .byte 0xc7, 0xe7, 0x2f, 0x80 - .byte 0x67, 0x47, 0x27, 0x80 - .byte 0x97, 0x77, 0x57, 0x80 - .byte 0xdf, 0xb7, 0x67, 0x80 - .byte 0xff, 0xff, 0x8f, 0x80 - .byte 0x00, 0x8f, 0x00, 0x80 - .byte 0x17, 0x17, 0x0f, 0x80 - .byte 0x5f, 0x5f, 0x5f, 0x80 - .byte 0xaf, 0xaf, 0xaf, 0x80 - .byte 0xff, 0xff, 0xff, 0x80 - .byte 0x8f, 0x37, 0x00, 0x80 - .byte 0xe7, 0x8f, 0x00, 0x80 - .byte 0xff, 0xc7, 0x57, 0x80 - - .byte 0xff, 0xff, 0xaf, 0x80 - .byte 0x67, 0x67, 0x00, 0x80 - .byte 0xaf, 0xaf, 0x00, 0x80 - .byte 0xff, 0xff, 0x00, 0x80 - .byte 0x5f, 0x1f, 0x3f, 0x80 - .byte 0xa7, 0x4f, 0x5f, 0x80 - .byte 0xdf, 0x8f, 0xaf, 0x80 - .byte 0x00, 0x6f, 0x97, 0x80 - .byte 0x00, 0x8f, 0x00, 0x80 - .byte 0x17, 0x17, 0x0f, 0x80 - .byte 0x5f, 0x5f, 0x5f, 0x80 - .byte 0xaf, 0xaf, 0xaf, 0x80 - .byte 0xff, 0xff, 0xff, 0x80 - .byte 0x67, 0x37, 0x0f, 0x80 - .byte 0x97, 0x67, 0x27, 0x80 - - .byte 0xc7, 0x9f, 0x47, 0x80 - .byte 0xff, 0xd7, 0x67, 0x80 - .byte 0x57, 0x3f, 0x77, 0x80 - .byte 0x77, 0x67, 0xc7, 0x80 - .byte 0xaf, 0xaf, 0xd7, 0x80 - .byte 0x27, 0x57, 0x67, 0x80 - .byte 0x57, 0x97, 0x8f, 0x80 - .byte 0x7f, 0xcf, 0x9f, 0x80 - .byte 0xbf, 0x17, 0x00, 0x80 - .byte 0x00, 0x8f, 0x00, 0x80 - .byte 0x17, 0x17, 0x0f, 0x80 - .byte 0x5f, 0x5f, 0x5f, 0x80 - .byte 0xaf, 0xaf, 0xaf, 0x80 - .byte 0xff, 0xff, 0xff, 0x80 - .byte 0x27, 0x5f, 0x0f, 0x80 - - .byte 0x5f, 0x8f, 0x17, 0x80 - .byte 0x8f, 0xbf, 0x27, 0x80 - .byte 0xbf, 0xef, 0x3f, 0x80 - .byte 0x47, 0x47, 0x47, 0x80 - .byte 0x87, 0x87, 0x87, 0x80 - .byte 0xd7, 0xd7, 0xd7, 0x80 - .byte 0x67, 0x47, 0x27, 0x80 - .byte 0xb7, 0x77, 0x00, 0x80 - .byte 0xef, 0xd7, 0x57, 0x80 - .byte 0xbf, 0x17, 0x00, 0x80 - .byte 0x00, 0x8f, 0x00, 0x80 - .byte 0x0f, 0x0f, 0x0f, 0x80 - .byte 0xc7, 0x87, 0x00, 0x80 - .byte 0xef, 0xdf, 0x2f, 0x80 - .byte 0xff, 0xff, 0xff, 0x80 - - .byte 0x47, 0x47, 0x47, 0x80 - .byte 0x77, 0x7f, 0x77, 0x80 - .byte 0xa7, 0xb7, 0xa7, 0x80 - .byte 0xcf, 0xdf, 0xcf, 0x80 - .byte 0x67, 0x67, 0x67, 0x80 - .byte 0xa7, 0xa7, 0xa7, 0x80 - .byte 0xdf, 0xef, 0xdf, 0x80 - .byte 0x6f, 0x4f, 0x1f, 0x80 - .byte 0xcf, 0x97, 0x00, 0x80 - .byte 0xef, 0xd7, 0x57, 0x80 - .byte 0xff, 0x3f, 0x00, 0x80 - .byte 0x00, 0x8f, 0x00, 0x80 - .byte 0x17, 0x17, 0x0f, 0x80 - .byte 0x57, 0x00, 0x27, 0x80 - .byte 0x97, 0x3f, 0x5f, 0x80 - - .byte 0xc7, 0x77, 0x97, 0x80 - .byte 0xd7, 0xaf, 0xbf, 0x80 - .byte 0xef, 0xef, 0xef, 0x80 - .byte 0x97, 0x97, 0x8f, 0x80 - .byte 0x27, 0x67, 0x6f, 0x80 - .byte 0x37, 0x97, 0x97, 0x80 - .byte 0x27, 0x57, 0x3f, 0x80 - .byte 0x57, 0x7f, 0x37, 0x80 - .byte 0x87, 0xc7, 0x57, 0x80 - .byte 0xb7, 0x77, 0x00, 0x80 - .byte 0xef, 0xaf, 0x00, 0x80 - .byte 0xef, 0xff, 0x87, 0x80 - .byte 0x00, 0x00, 0x00, 0x80 - .byte 0x17, 0x17, 0x17, 0x80 - .byte 0x3f, 0x3f, 0x3f, 0x80 - - .byte 0x6f, 0x6f, 0x6f, 0x80 - .byte 0x9f, 0x9f, 0x9f, 0x80 - .byte 0xcf, 0xcf, 0xcf, 0x80 - .byte 0xff, 0xff, 0xff, 0x80 - .byte 0x57, 0x57, 0x57, 0x80 - .byte 0x87, 0x87, 0x87, 0x80 - .byte 0xbf, 0xbf, 0xbf, 0x80 - .byte 0x5f, 0x5f, 0x5f, 0x80 - .byte 0x8f, 0x97, 0x97, 0x80 - .byte 0xc7, 0xcf, 0xd7, 0x80 - .byte 0x5f, 0x5f, 0x5f, 0x80 - .byte 0x8f, 0x8f, 0x8f, 0x80 - .byte 0xbf, 0xbf, 0xbf, 0x80 - .byte 0x00, 0x8f, 0x00, 0x80 - .byte 0x0f, 0x0f, 0x0f, 0x80 - - .byte 0x5f, 0x5f, 0x5f, 0x80 - .byte 0xaf, 0xaf, 0xaf, 0x80 - .byte 0xff, 0xff, 0xff, 0x80 - .byte 0x47, 0x47, 0x47, 0x80 - .byte 0x77, 0x77, 0x77, 0x80 - .byte 0xa7, 0xa7, 0xa7, 0x80 - .byte 0xd7, 0xd7, 0xd7, 0x80 - .byte 0x67, 0x67, 0x67, 0x80 - .byte 0xa7, 0xa7, 0xa7, 0x80 - .byte 0xe7, 0xe7, 0xe7, 0x80 - .byte 0x5f, 0x5f, 0x5f, 0x80 - .byte 0x97, 0x97, 0x97, 0x80 - .byte 0xcf, 0xcf, 0xcf, 0x80 - .byte 0xa7, 0xa7, 0xa7, 0x80 - .byte 0x00, 0x00, 0x00, 0x80 - - .byte 0x00, 0x00, 0x00, 0x80 - .byte 0x00, 0x00, 0x00, 0x80 - .byte 0x00, 0x00, 0x00, 0x80 - .byte 0x00, 0x00, 0x00, 0x80 - .byte 0x00, 0x00, 0x00, 0x80 - .byte 0x00, 0x00, 0x00, 0x80 - .byte 0x00, 0x00, 0x00, 0x80 - .byte 0x00, 0x00, 0x00, 0x80 - .byte 0x00, 0x00, 0x00, 0x80 - .byte 0x00, 0x00, 0x00, 0x80 - .byte 0x00, 0x00, 0x00, 0x80 - .byte 0x00, 0x00, 0x00, 0x80 - .byte 0x00, 0x00, 0x00, 0x80 - .byte 0x00, 0x00, 0x00, 0x80 - .byte 0x00, 0x00, 0x00, 0x80 - + .incbin "graphics/unk_monpal/0.pmdpal" + .incbin "graphics/unk_monpal/1.pmdpal" + .incbin "graphics/unk_monpal/2.pmdpal" + .incbin "graphics/unk_monpal/3.pmdpal" + .incbin "graphics/unk_monpal/4.pmdpal" + .incbin "graphics/unk_monpal/5.pmdpal" + .incbin "graphics/unk_monpal/6.pmdpal" + .incbin "graphics/unk_monpal/7.pmdpal" + .incbin "graphics/unk_monpal/8.pmdpal" + .incbin "graphics/unk_monpal/9.pmdpal" + .incbin "graphics/unk_monpal/10.pmdpal" + .incbin "graphics/unk_monpal/11.pmdpal" + .incbin "graphics/unk_monpal/12.pmdpal" + .incbin "graphics/unk_monpal/13.pmdpal" + .incbin "graphics/unk_monpal/14.pmdpal" + .string "pksdir0\0" .string "pksdir0\0" .string "pksdir0\0" diff --git a/graphics.mk b/graphics.mk index 6a76c5367..a00463e96 100644 --- a/graphics.mk +++ b/graphics.mk @@ -1,2 +1,3 @@ -%.4bpp: %.png - $(GBAGFX) $< $@ +%.4bpp: %.png ; $(GBAGFX) $< $@ +%.pmdpal: %.pal ; $(GBAGFX) $< $@ +%.gbapal: %.pal ; $(GBAGFX) $< $@ diff --git a/graphics/ax/pal/0.pal b/graphics/ax/pal/0.pal new file mode 100644 index 000000000..6ea5967e7 --- /dev/null +++ b/graphics/ax/pal/0.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +0 127 151 +0 0 0 +191 119 39 +223 175 103 +255 231 159 +167 111 0 +223 183 0 +255 247 0 +0 103 183 +31 159 231 +143 223 255 +159 0 0 +215 63 0 +255 135 95 +255 135 191 +255 255 255 diff --git a/graphics/ax/pal/1.pal b/graphics/ax/pal/1.pal new file mode 100644 index 000000000..c1a6db3fa --- /dev/null +++ b/graphics/ax/pal/1.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +0 127 151 +0 0 0 +231 63 103 +255 143 175 +255 199 215 +0 103 183 +31 159 231 +143 223 255 +119 63 0 +167 95 31 +223 119 31 +159 0 0 +215 63 0 +255 135 95 +199 215 215 +255 255 255 diff --git a/graphics/ax/pal/10.pal b/graphics/ax/pal/10.pal new file mode 100644 index 000000000..f7b361d79 --- /dev/null +++ b/graphics/ax/pal/10.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +0 127 151 +0 0 0 +231 63 103 +255 143 175 +255 199 215 +127 143 151 +175 183 191 +215 223 223 +39 135 0 +95 199 55 +143 255 103 +111 63 151 +199 151 223 +223 183 0 +255 247 0 +255 255 255 diff --git a/graphics/ax/pal/11.pal b/graphics/ax/pal/11.pal new file mode 100644 index 000000000..9bb77b98a --- /dev/null +++ b/graphics/ax/pal/11.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +0 127 151 +0 0 0 +191 119 39 +223 175 103 +255 231 159 +55 63 143 +79 95 151 +103 135 175 +127 143 151 +175 183 191 +215 223 223 +183 0 0 +231 63 103 +255 143 175 +255 199 215 +255 255 255 diff --git a/graphics/ax/pal/12.pal b/graphics/ax/pal/12.pal new file mode 100644 index 000000000..c86b2db3b --- /dev/null +++ b/graphics/ax/pal/12.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +0 127 151 +0 0 0 +119 63 0 +167 95 31 +223 119 31 +71 135 111 +143 175 183 +215 231 223 +215 167 0 +255 247 0 +255 231 159 +159 0 0 +255 87 15 +79 159 215 +167 207 239 +255 255 255 diff --git a/graphics/ax/pal/13.pal b/graphics/ax/pal/13.pal new file mode 100644 index 000000000..417578fea --- /dev/null +++ b/graphics/ax/pal/13.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +0 127 151 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 diff --git a/graphics/ax/pal/2.pal b/graphics/ax/pal/2.pal new file mode 100644 index 000000000..b42f96be3 --- /dev/null +++ b/graphics/ax/pal/2.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +0 127 151 +0 0 0 +87 47 159 +143 103 191 +183 151 223 +167 111 0 +223 183 0 +255 247 0 +55 63 143 +79 95 151 +103 135 175 +159 0 0 +215 63 0 +255 135 95 +191 207 247 +255 255 255 diff --git a/graphics/ax/pal/3.pal b/graphics/ax/pal/3.pal new file mode 100644 index 000000000..da2170f74 --- /dev/null +++ b/graphics/ax/pal/3.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +0 127 151 +0 0 0 +159 0 0 +215 63 0 +255 135 95 +87 103 183 +135 159 255 +183 207 255 +167 111 0 +223 183 0 +255 247 0 +39 135 0 +95 183 39 +159 207 111 +215 239 167 +255 255 255 diff --git a/graphics/ax/pal/4.pal b/graphics/ax/pal/4.pal new file mode 100644 index 000000000..7d16acf52 --- /dev/null +++ b/graphics/ax/pal/4.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +0 127 151 +0 0 0 +183 135 39 +215 191 103 +255 247 159 +167 111 0 +223 183 0 +255 247 0 +231 63 103 +255 143 175 +255 199 215 +119 63 0 +167 95 31 +223 119 31 +255 151 71 +255 255 255 diff --git a/graphics/ax/pal/5.pal b/graphics/ax/pal/5.pal new file mode 100644 index 000000000..f0156f7dc --- /dev/null +++ b/graphics/ax/pal/5.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +0 127 151 +0 0 0 +191 119 39 +223 175 103 +255 231 159 +159 0 0 +215 63 0 +255 135 95 +0 103 183 +31 159 231 +127 207 255 +71 103 111 +127 143 151 +175 183 191 +215 223 223 +255 255 255 diff --git a/graphics/ax/pal/6.pal b/graphics/ax/pal/6.pal new file mode 100644 index 000000000..797b7f717 --- /dev/null +++ b/graphics/ax/pal/6.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +0 127 151 +0 0 0 +191 119 39 +223 175 103 +255 231 159 +119 63 0 +167 95 31 +223 119 31 +159 0 0 +215 63 0 +255 135 95 +71 103 111 +127 143 151 +175 183 191 +215 223 223 +255 255 255 diff --git a/graphics/ax/pal/7.pal b/graphics/ax/pal/7.pal new file mode 100644 index 000000000..b88856350 --- /dev/null +++ b/graphics/ax/pal/7.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +0 127 151 +0 0 0 +87 103 183 +135 159 255 +183 207 255 +191 119 39 +223 175 103 +255 231 159 +135 63 135 +175 111 183 +215 151 223 +215 63 0 +71 103 111 +151 159 167 +215 223 223 +255 255 255 diff --git a/graphics/ax/pal/8.pal b/graphics/ax/pal/8.pal new file mode 100644 index 000000000..4bdbc6b82 --- /dev/null +++ b/graphics/ax/pal/8.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +0 127 151 +0 0 0 +119 63 0 +167 95 31 +223 119 31 +159 0 0 +215 63 0 +255 135 95 +191 119 39 +223 175 103 +255 231 159 +39 135 0 +95 183 39 +127 223 87 +143 255 103 +255 255 255 diff --git a/graphics/ax/pal/9.pal b/graphics/ax/pal/9.pal new file mode 100644 index 000000000..03b1fbe72 --- /dev/null +++ b/graphics/ax/pal/9.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +0 127 151 +0 0 0 +55 63 143 +79 95 151 +103 135 175 +87 103 183 +135 159 255 +183 207 255 +119 63 0 +223 119 31 +255 151 71 +175 103 31 +223 175 103 +255 231 159 +183 191 199 +255 255 255 diff --git a/graphics/dungeon/pal/barnpal.pal b/graphics/dungeon/pal/barnpal.pal new file mode 100644 index 000000000..32afe6c5e --- /dev/null +++ b/graphics/dungeon/pal/barnpal.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +0 0 0 +15 15 15 +31 31 31 +47 47 47 +63 63 63 +79 79 79 +95 95 95 +111 111 111 +127 127 127 +143 143 143 +159 159 159 +175 175 175 +191 191 191 +207 207 207 +215 215 215 +231 231 231 diff --git a/graphics/unk_monpal/0.pal b/graphics/unk_monpal/0.pal new file mode 100644 index 000000000..5882a7d34 --- /dev/null +++ b/graphics/unk_monpal/0.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +0 0 0 +23 23 15 +71 55 55 +119 103 103 +175 159 159 +215 207 207 +255 255 255 +119 31 71 +175 63 111 +215 127 159 +0 55 199 +0 151 239 +55 191 255 +119 87 55 +183 127 71 +231 183 111 diff --git a/graphics/unk_monpal/1.pal b/graphics/unk_monpal/1.pal new file mode 100644 index 000000000..6c8a401a5 --- /dev/null +++ b/graphics/unk_monpal/1.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +0 143 0 +23 23 15 +95 95 95 +175 175 175 +255 255 255 +119 55 0 +191 135 39 +223 191 79 +255 255 119 +79 39 87 +143 87 127 +215 135 167 +63 103 0 +103 143 0 +183 215 31 +143 15 63 diff --git a/graphics/unk_monpal/10.pal b/graphics/unk_monpal/10.pal new file mode 100644 index 000000000..520371775 --- /dev/null +++ b/graphics/unk_monpal/10.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +0 143 0 +15 15 15 +199 135 0 +239 223 47 +255 255 255 +71 71 71 +119 127 119 +167 183 167 +207 223 207 +103 103 103 +167 167 167 +223 239 223 +111 79 31 +207 151 0 +239 215 87 +255 63 0 diff --git a/graphics/unk_monpal/11.pal b/graphics/unk_monpal/11.pal new file mode 100644 index 000000000..f1bf8db11 --- /dev/null +++ b/graphics/unk_monpal/11.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +0 143 0 +23 23 15 +87 0 39 +151 63 95 +199 119 151 +215 175 191 +239 239 239 +151 151 143 +39 103 111 +55 151 151 +39 87 63 +87 127 55 +135 199 87 +183 119 0 +239 175 0 +239 255 135 diff --git a/graphics/unk_monpal/12.pal b/graphics/unk_monpal/12.pal new file mode 100644 index 000000000..92f338a8c --- /dev/null +++ b/graphics/unk_monpal/12.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +0 0 0 +23 23 23 +63 63 63 +111 111 111 +159 159 159 +207 207 207 +255 255 255 +87 87 87 +135 135 135 +191 191 191 +95 95 95 +143 151 151 +199 207 215 +95 95 95 +143 143 143 +191 191 191 diff --git a/graphics/unk_monpal/13.pal b/graphics/unk_monpal/13.pal new file mode 100644 index 000000000..70d072cef --- /dev/null +++ b/graphics/unk_monpal/13.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +0 143 0 +15 15 15 +95 95 95 +175 175 175 +255 255 255 +71 71 71 +119 119 119 +167 167 167 +215 215 215 +103 103 103 +167 167 167 +231 231 231 +95 95 95 +151 151 151 +207 207 207 +167 167 167 diff --git a/graphics/unk_monpal/14.pal b/graphics/unk_monpal/14.pal new file mode 100644 index 000000000..4b0812f09 --- /dev/null +++ b/graphics/unk_monpal/14.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 diff --git a/graphics/unk_monpal/2.pal b/graphics/unk_monpal/2.pal new file mode 100644 index 000000000..a0ab17a09 --- /dev/null +++ b/graphics/unk_monpal/2.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +0 143 0 +23 23 15 +199 135 0 +239 223 47 +255 255 255 +23 79 111 +39 127 183 +55 175 255 +191 231 239 +135 135 0 +191 191 0 +143 215 247 +47 47 47 +103 103 103 +167 167 167 +55 175 255 diff --git a/graphics/unk_monpal/3.pal b/graphics/unk_monpal/3.pal new file mode 100644 index 000000000..65fdeb299 --- /dev/null +++ b/graphics/unk_monpal/3.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +0 143 0 +23 23 15 +95 95 95 +175 175 175 +255 255 255 +71 31 95 +111 71 135 +159 111 183 +207 151 231 +111 0 55 +167 71 119 +231 143 183 +135 63 0 +175 111 0 +239 175 55 +255 215 87 diff --git a/graphics/unk_monpal/4.pal b/graphics/unk_monpal/4.pal new file mode 100644 index 000000000..20f06a6c0 --- /dev/null +++ b/graphics/unk_monpal/4.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +0 143 0 +23 23 15 +95 95 95 +175 175 175 +255 255 255 +55 111 31 +95 143 23 +135 175 15 +175 215 15 +23 31 119 +55 95 183 +87 167 255 +39 31 55 +63 63 79 +87 103 103 +191 23 0 diff --git a/graphics/unk_monpal/5.pal b/graphics/unk_monpal/5.pal new file mode 100644 index 000000000..0b943f215 --- /dev/null +++ b/graphics/unk_monpal/5.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +0 143 0 +23 23 15 +95 95 95 +175 175 175 +255 255 255 +31 71 111 +55 111 159 +87 159 207 +119 207 255 +87 55 0 +151 103 0 +215 167 71 +119 47 119 +175 71 175 +223 119 215 +135 0 0 diff --git a/graphics/unk_monpal/6.pal b/graphics/unk_monpal/6.pal new file mode 100644 index 000000000..63c97cb47 --- /dev/null +++ b/graphics/unk_monpal/6.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +0 143 0 +23 23 15 +95 95 95 +175 175 175 +255 255 255 +111 23 15 +167 55 15 +215 87 15 +247 159 103 +95 135 15 +143 183 31 +199 231 47 +103 71 39 +151 119 87 +223 183 103 +255 255 143 diff --git a/graphics/unk_monpal/7.pal b/graphics/unk_monpal/7.pal new file mode 100644 index 000000000..6e99283c1 --- /dev/null +++ b/graphics/unk_monpal/7.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +0 143 0 +23 23 15 +95 95 95 +175 175 175 +255 255 255 +143 55 0 +231 143 0 +255 199 87 +255 255 175 +103 103 0 +175 175 0 +255 255 0 +95 31 63 +167 79 95 +223 143 175 +0 111 151 diff --git a/graphics/unk_monpal/8.pal b/graphics/unk_monpal/8.pal new file mode 100644 index 000000000..7dbbc28c3 --- /dev/null +++ b/graphics/unk_monpal/8.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +0 143 0 +23 23 15 +95 95 95 +175 175 175 +255 255 255 +103 55 15 +151 103 39 +199 159 71 +255 215 103 +87 63 119 +119 103 199 +175 175 215 +39 87 103 +87 151 143 +127 207 159 +191 23 0 diff --git a/graphics/unk_monpal/9.pal b/graphics/unk_monpal/9.pal new file mode 100644 index 000000000..253c8d283 --- /dev/null +++ b/graphics/unk_monpal/9.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +0 143 0 +23 23 15 +95 95 95 +175 175 175 +255 255 255 +39 95 15 +95 143 23 +143 191 39 +191 239 63 +71 71 71 +135 135 135 +215 215 215 +103 71 39 +183 119 0 +239 215 87 +191 23 0 diff --git a/include/structs/rgb.h b/include/structs/rgb.h index b4c9ad9f3..7fee2c50c 100644 --- a/include/structs/rgb.h +++ b/include/structs/rgb.h @@ -6,6 +6,7 @@ typedef struct RGB u8 r; u8 g; u8 b; + u8 unk4; // Never read, always 0x80. Unused transparency/alpha flag? } RGB; #endif // GUARD_RGB_H diff --git a/ld_script.txt b/ld_script.txt index 1e86fbc4e..aad75d9ce 100755 --- a/ld_script.txt +++ b/ld_script.txt @@ -811,6 +811,13 @@ SECTIONS { { src/monster_sbin.o(.rodata); data/monster_sbin.o(.rodata); + src/monster_sbin_palet.o(.rodata); + } > ROM =0 + + unk_96BD7AC_section : + ALIGN(4) + { + data/unk_96BD7AC.o(.rodata); } > ROM =0 effect_sbin_section : diff --git a/src/monster_sbin.c b/src/monster_sbin.c index b697f858c..9cee63fe0 100644 --- a/src/monster_sbin.c +++ b/src/monster_sbin.c @@ -510,7 +510,7 @@ extern const u8 gKaoJirachi[]; extern const u8 gKaoDeoxysNormal[]; extern const u8 gKaoMunchlax[]; extern const u8 gKaoRayquazaCutscene[]; -extern const u8 gPaletFile[]; +extern const u8 gAxMonsPalette[]; const File gMonsterFiles[MONSTER_FILES_COUNT] = { [0] = { "ax001", gAxBulbasaur,}, @@ -1009,7 +1009,7 @@ const File gMonsterFiles[MONSTER_FILES_COUNT] = { [493] = { "kao414", gKaoDeoxysNormal,}, [494] = { "kao420", gKaoMunchlax,}, [495] = { "kao423", gKaoRayquazaCutscene,}, - [496] = { "palet", gPaletFile,}, + [496] = { "palet", gAxMonsPalette,}, }; UNUSED ALIGNED(4) static const char sPksDir3[] = "pksdir0"; diff --git a/src/monster_sbin_palet.c b/src/monster_sbin_palet.c new file mode 100644 index 000000000..d29c707db --- /dev/null +++ b/src/monster_sbin_palet.c @@ -0,0 +1,20 @@ +#include "global.h" +#include "structs/rgb.h" + +// These correspond to the 'overworldPalette' field in the monster data. Only slots 0-12 are actually used, slot 13 seems to be a placeholder. +const RGB gAxMonsPalette[] = { + INCBIN_RGB("graphics/ax/pal/0.pmdpal", + "graphics/ax/pal/1.pmdpal", + "graphics/ax/pal/2.pmdpal", + "graphics/ax/pal/3.pmdpal", + "graphics/ax/pal/4.pmdpal", + "graphics/ax/pal/5.pmdpal", + "graphics/ax/pal/6.pmdpal", + "graphics/ax/pal/7.pmdpal", + "graphics/ax/pal/8.pmdpal", + "graphics/ax/pal/9.pmdpal", + "graphics/ax/pal/10.pmdpal", + "graphics/ax/pal/11.pmdpal", + "graphics/ax/pal/12.pmdpal", + "graphics/ax/pal/13.pmdpal") +}; diff --git a/tools/gbagfx/gfx.c b/tools/gbagfx/gfx.c index 4e85953fd..d0d9681f5 100644 --- a/tools/gbagfx/gfx.c +++ b/tools/gbagfx/gfx.c @@ -505,3 +505,25 @@ void WriteGbaPalette(char *path, struct Palette *palette) fclose(fp); } + +void WritePmdPalette(char *path, struct Palette *palette) +{ + FILE *fp = fopen(path, "wb"); + + if (fp == NULL) + FATAL_ERROR("Failed to open \"%s\" for writing.\n", path); + + for (int i = 0; i < palette->numColors; i++) { + unsigned char red = palette->colors[i].red; + unsigned char green = palette->colors[i].green; + unsigned char blue = palette->colors[i].blue; + unsigned char alpha = 0x80; + + fputc(red, fp); + fputc(green, fp); + fputc(blue, fp); + fputc(alpha, fp); + } + + fclose(fp); +} diff --git a/tools/gbagfx/gfx.h b/tools/gbagfx/gfx.h index edb9e62c4..e881f6890 100644 --- a/tools/gbagfx/gfx.h +++ b/tools/gbagfx/gfx.h @@ -49,5 +49,6 @@ void WriteImage(char *path, int numTiles, int bitDepth, int metatileWidth, int m void FreeImage(struct Image *image); void ReadGbaPalette(char *path, struct Palette *palette); void WriteGbaPalette(char *path, struct Palette *palette); +void WritePmdPalette(char *path, struct Palette *palette); #endif // GFX_H diff --git a/tools/gbagfx/main.c b/tools/gbagfx/main.c index cf3031696..117db99da 100644 --- a/tools/gbagfx/main.c +++ b/tools/gbagfx/main.c @@ -262,7 +262,7 @@ void HandleGbaToJascPaletteCommand(char *inputPath, char *outputPath, int argc U WriteJascPalette(outputPath, &palette); } -void HandleJascToGbaPaletteCommand(char *inputPath, char *outputPath, int argc, char **argv) +static void HandleJascToPaletteCommand(char *inputPath, char *outputPath, int argc, char **argv, bool isPmdPal) { int numColors = 0; @@ -296,7 +296,22 @@ void HandleJascToGbaPaletteCommand(char *inputPath, char *outputPath, int argc, if (numColors != 0) palette.numColors = numColors; - WriteGbaPalette(outputPath, &palette); + if (isPmdPal) { + WritePmdPalette(outputPath, &palette); + } + else { + WriteGbaPalette(outputPath, &palette); + } +} + +void HandleJascToGbaPaletteCommand(char *inputPath, char *outputPath, int argc, char **argv) +{ + HandleJascToPaletteCommand(inputPath, outputPath, argc, argv, false); +} + +void HandleJascToPmdPaletteCommand(char *inputPath, char *outputPath, int argc, char **argv) +{ + HandleJascToPaletteCommand(inputPath, outputPath, argc, argv, true); } void HandleLatinFontToPngCommand(char *inputPath, char *outputPath, int argc UNUSED, char **argv UNUSED) @@ -554,6 +569,7 @@ int main(int argc, char **argv) { "png", "pal", HandlePngToJascPaletteCommand }, { "gbapal", "pal", HandleGbaToJascPaletteCommand }, { "pal", "gbapal", HandleJascToGbaPaletteCommand }, + { "pal", "pmdpal", HandleJascToPmdPaletteCommand }, { "latfont", "png", HandleLatinFontToPngCommand }, { "png", "latfont", HandlePngToLatinFontCommand }, { "hwjpnfont", "png", HandleHalfwidthJapaneseFontToPngCommand }, diff --git a/tools/preproc/c_file.cpp b/tools/preproc/c_file.cpp index 98e65ef6e..5bf65f414 100644 --- a/tools/preproc/c_file.cpp +++ b/tools/preproc/c_file.cpp @@ -332,10 +332,12 @@ int ExtractData(const std::unique_ptr& buffer, int offset, int void CFile::TryConvertIncbin() { - std::string idents[6] = { "INCBIN_S8", "INCBIN_U8", "INCBIN_S16", "INCBIN_U16", "INCBIN_S32", "INCBIN_U32" }; + std::string idents[7] = { "INCBIN_S8", "INCBIN_U8", "INCBIN_S16", "INCBIN_U16", "INCBIN_S32", "INCBIN_U32", "INCBIN_RGB" }; int incbinType = -1; + int size; + bool isSigned, isRGB; - for (int i = 0; i < 6; i++) + for (int i = 0; i < 7; i++) { if (CheckIdentifier(idents[i])) { @@ -347,8 +349,17 @@ void CFile::TryConvertIncbin() if (incbinType == -1) return; - int size = 1 << (incbinType / 2); - bool isSigned = ((incbinType % 2) == 0); + // RGB incbin + if (incbinType == 6) { + isRGB = true; + size = 4; + isSigned = false; + } + else { + isRGB = false; + size = 1 << (incbinType / 2); + isSigned = ((incbinType % 2) == 0); + } long oldPos = m_pos; long oldLineNum = m_lineNum; @@ -366,7 +377,8 @@ void CFile::TryConvertIncbin() m_pos++; - std::printf("{"); + if (!isRGB) + std::printf("{"); while (true) { @@ -394,7 +406,7 @@ void CFile::TryConvertIncbin() if (m_buffer[m_pos] == '\\') RaiseError("unexpected escape in path string"); - + m_pos++; } @@ -416,7 +428,9 @@ void CFile::TryConvertIncbin() int data = ExtractData(buffer, offset, size); offset += size; - if (isSigned) + if (isRGB) + std::printf("{%uu, %uu, %uu, %uu},", (data & 0xFF), (data & 0xFF00) >> 8, (data & 0xFF0000) >> 16, (data & 0xFF000000) >> 24); + else if (isSigned) std::printf("%d,", data); else std::printf("%uu,", data); @@ -429,13 +443,14 @@ void CFile::TryConvertIncbin() m_pos++; } - + if (m_buffer[m_pos] != ')') RaiseError("expected ')'"); m_pos++; - std::printf("}"); + if (!isRGB) + std::printf("}"); } // Reports a diagnostic message. diff --git a/tools/scaninc/c_file.cpp b/tools/scaninc/c_file.cpp index 595f366cb..b6ccfeac9 100644 --- a/tools/scaninc/c_file.cpp +++ b/tools/scaninc/c_file.cpp @@ -213,10 +213,10 @@ void CFile::CheckIncbin() return; } - std::string idents[6] = { "INCBIN_S8", "INCBIN_U8", "INCBIN_S16", "INCBIN_U16", "INCBIN_S32", "INCBIN_U32" }; + std::string idents[7] = { "INCBIN_S8", "INCBIN_U8", "INCBIN_S16", "INCBIN_U16", "INCBIN_S32", "INCBIN_U32", "INCBIN_RGB" }; int incbinType = -1; - for (int i = 0; i < 6; i++) + for (int i = 0; i < 7; i++) { if (CheckIdentifier(idents[i])) {