From 69d1b312f654abd550d350b5b1db29a5f6aba348 Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Tue, 24 Nov 2015 01:41:14 -0800 Subject: [PATCH] title screen background tiles and palettes --- asm/emerald.s | 8 +- data/data2.s | 32 ++- data/graphics/title_screen/clouds.png | Bin 0 -> 629 bytes data/graphics/title_screen/pokemon_logo.pal | 259 ++++++++++++++++++ data/graphics/title_screen/pokemon_logo.png | Bin 0 -> 4666 bytes data/graphics/title_screen/rayquaza.png | Bin 0 -> 1730 bytes .../title_screen/rayquaza_and_clouds.pal | 19 ++ graphics_file_rules.mk | 3 + tools/gbagfx/gfx.c | 6 +- tools/gbagfx/main.c | 27 +- 10 files changed, 338 insertions(+), 16 deletions(-) create mode 100644 data/graphics/title_screen/clouds.png create mode 100644 data/graphics/title_screen/pokemon_logo.pal create mode 100644 data/graphics/title_screen/pokemon_logo.png create mode 100644 data/graphics/title_screen/rayquaza.png create mode 100644 data/graphics/title_screen/rayquaza_and_clouds.pal diff --git a/asm/emerald.s b/asm/emerald.s index 0e2f47f87..566158231 100644 --- a/asm/emerald.s +++ b/asm/emerald.s @@ -320114,25 +320114,25 @@ c2_title_screen_1: ; 80AA7A4 .align 2, 0 .pool @080AA8C4: - ldr r0, =gUnknown_08DDE690 + ldr r0, =gTitleScreenPokemonLogoTiles movs r1, 0xC0 lsls r1, 19 bl LZ77UnCompVram ldr r0, =gUnknown_08DE0644 ldr r1, =0x06004800 bl LZ77UnCompVram - ldr r0, =gTitleScreenBgPalette + ldr r0, =gTitleScreenBgPalettes movs r2, 0xF0 lsls r2, 1 movs r1, 0 bl gpu_pal_apply - ldr r0, =gUnknown_0853F058 + ldr r0, =gTitleScreenRayquazaTiles ldr r1, =0x06008000 bl LZ77UnCompVram ldr r0, =gUnknown_0853F83C ldr r1, =0x0600d000 bl LZ77UnCompVram - ldr r0, =gUnknown_0853FC8C + ldr r0, =gTitleScreenCloudsTiles ldr r1, =0x0600c000 bl LZ77UnCompVram ldr r0, =gUnknown_08DDE458 diff --git a/data/data2.s b/data/data2.s index 0560de31c..a99d3e74f 100644 --- a/data/data2.s +++ b/data/data2.s @@ -3204,14 +3204,18 @@ gUnknown_0853EF48: ; 853EF48 gUnknown_0853EF60: ; 853EF60 .incbin "base_emerald.gba", 0x53ef60, 0xf8 -gUnknown_0853F058: ; 853F058 - .incbin "base_emerald.gba", 0x53f058, 0x7e4 +gTitleScreenRayquazaTiles: ; 853F058 + .incbin "data/graphics/title_screen/rayquaza.4bpp.lz" + + .align 2, 0 gUnknown_0853F83C: ; 853F83C .incbin "base_emerald.gba", 0x53f83c, 0x450 -gUnknown_0853FC8C: ; 853FC8C - .incbin "base_emerald.gba", 0x53fc8c, 0x2e4 +gTitleScreenCloudsTiles: ; 853FC8C + .incbin "data/graphics/title_screen/clouds.4bpp.lz" + + .align 2, 0 gUnknown_0853FF70: ; 853FF70 .incbin "base_emerald.gba", 0x53ff70, 0xa8 @@ -13251,13 +13255,20 @@ gUnknown_08DDE030: ; 8DDE030 gUnknown_08DDE12C: ; 8DDE12C .incbin "base_emerald.gba", 0xdde12c, 0xcc + .align 2, 0 + gMonIconPalettes: ; 8DDE1F8 .incbin "data/graphics/pokemon/icon_palettes/icon_palette_0.gbapal" .incbin "data/graphics/pokemon/icon_palettes/icon_palette_1.gbapal" .incbin "data/graphics/pokemon/icon_palettes/icon_palette_2.gbapal" -gTitleScreenBgPalette: ; 8DDE258 - .incbin "base_emerald.gba", 0xdde258, 0x1e0 + .align 2, 0 + +gTitleScreenBgPalettes: ; 8DDE258 + .incbin "data/graphics/title_screen/pokemon_logo.gbapal" + .incbin "data/graphics/title_screen/rayquaza_and_clouds.gbapal" + + .align 2, 0 gUnknown_08DDE438: ; 8DDE438 .incbin "base_emerald.gba", 0xdde438, 0x20 @@ -13265,8 +13276,13 @@ gUnknown_08DDE438: ; 8DDE438 gUnknown_08DDE458: ; 8DDE458 .incbin "base_emerald.gba", 0xdde458, 0x238 -gUnknown_08DDE690: ; 8DDE690 - .incbin "base_emerald.gba", 0xdde690, 0x1fb4 +gTitleScreenPokemonLogoTiles: ; 8DDE690 + .incbin "data/graphics/title_screen/pokemon_logo.8bpp.lz" + + .align 2, 0 + +; 8DDFD94 + .incbin "base_emerald.gba", 0xddfd94, 0x8b0 gUnknown_08DE0644: ; 8DE0644 .incbin "base_emerald.gba", 0xde0644, 0x184 diff --git a/data/graphics/title_screen/clouds.png b/data/graphics/title_screen/clouds.png new file mode 100644 index 0000000000000000000000000000000000000000..361c8e145d356ec79e4fa881ec1f4afd662320ce GIT binary patch literal 629 zcmV-*0*d{KP))C@f zOaC*-8xP4TwRY;@&FCmZWxQhjf(%?F?9o(tzt~l@AgZBkUS?J5I)t1%%97buq2n>W zUB*ebtH5v$rhIk8h@oucJ5q3DpKTwUq##T(H>EsI^Gd~l>mv?m^6%2& z({>R^F9K@*4qN0k+emx{uE|*p0cW)@g8L;$ZPQgjP9e=L1}i?a!2+`M+NpN znvs~UAT>yimNIA9Nnl!YW^Rdiz+JjE}$-oD@}V0eNw5d+sK zFzo|FG#}ib1Zz)4x8QkS%UPG(K7A+P-9_7p!9{ykc2nSBIdbI!iQ$@BcsxOqsC#Qk z3n59^XV1$lfNrzAc1iL*{iKa>h1hiS66DvAAE6<0@aYyFXjr8de2SM?U)^Ra9qi^8 zZFrX$MD$BKvtO&XhpNnJm8npUp+DX~1n-EgcIb{xzZD2blva23D*m#pAOY=8HrKS+ zTo>Ie~%?|*8kcGJ^4gk0~ zCSZ)<=I9QR(>(y-25hYCPybs50QNeP#ei7rEH(?pVnHkp*lae7&DlW!Y!tB0VxU+I zki8DE*U@Y?lFdf_+h%hP04N9qK`aO`L0}yOSRlY=t%GbPipAt4gjh^8ixa{E*(`|7 z2H9)~L~+hT-DIe{1VREV8}IG3W>>zoiy5NCi8 z1foF@{m+KbAcW%hARdYGMS*S*h=Vv9!ar^iJO^$Z_!4}5Np6HBH{T?J8#M`2Nirc5 z@MIE>fJ=(NkqB-il3N5Jf&)?#DJdg@M6X1RR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1mGr}2?$+dZ37Khxv7BgkFKOTPT6P0$*DVlb>q_?lOmnu}@R)%P;_&$tvCe>W$a^UaP@l>v`%CVV?$BqaDZ@VU_?!7~!zUbKMmi7;5tLhGh_!KqOYOT=2 zFef_=eKWde4G8YB{U%*b7)qq>cTSz-#DArpC6rPH!~^*HD3RT`_JXSHo5Vq zRm1UM}2CJ&;5a3ftq+cNzpXK_1S5Z>V(B~@t{R3tE!WcIzApn1>b26>1;_)amtib9( zVRl<@rw*}eBzb--XqnFIa>t$Rc_`rT^ip8%?d>t!=z{66hd|4=A#b#h4UotWDmtfd zZFp1mz%5#phCdm8J|C0r>Gb^TMz0^Gfm0q{nF6KiB0`O1OXF9KA{*n|#2M`iyL(Qb z;sI2RH#3NRMX;hp+ltyr8LY&thXAUe%{W~n1wL=u%4YtF_!+%xX`0F>ygR^c{cDhy z_=yn}+1@-8#oI^vb)4sRuKyAx?nj~JqYB{;)}Q*$ij&W!0@ga$+ebTk9{jyr@L{)R zu`wHdG-s@y)!yDez4`T?K<;Wkv07Zf!|^s>=jWTAHmFO^8uhDHf;<#81Sxat_iU{v zQ4mnq&M6b(?@;?2^R6zy_reTb?(JcsEa;IKkg?6r_6z70XrBco3)Ls~PX|n0G7gOV zIriHRliSX-&3v6KGcyhRI#$Kic9Hj))+xhRQ)2<@eF9zjL|5LaD+@EOJbt`IVZ-;w z8(1+uLMJvaUI4!>_5<@qe*58-KSQg(MkK+DJ@R3*(zw~*uNuoEw`(QZwZ8r9KDX6B a&)oe0GvuDifBdh%wm5y(wCbd5-2VZ%BWg+j literal 0 HcmV?d00001 diff --git a/data/graphics/title_screen/rayquaza.png b/data/graphics/title_screen/rayquaza.png new file mode 100644 index 0000000000000000000000000000000000000000..f52f559e25cb54f7f997abf913d21a684ec57f53 GIT binary patch literal 1730 zcmV;z20i(SP)3h$dr)-u4n3&>mbfKLlh4GQp`{}Lc7j+|ElOeot_D1cOd*|zmw z04TuLkAzczq(bZk0epQV6o5|;2va}gp9Dx##QujL8$k4H;=GDY zBcLO|%>Y=)S^z#z06KV75qlzzR8R?s%TSn@eF<0!K+yJ0tm+tmaS&1i+ye-&X3Qh+ zH+Zk&O31y(E71D5|+&fhy;}oHxU-l`}%xAEB%fa zC=2ZXP$o4T{oq{#rVjCJgH;A?g7|Gu?Ia(xLHz`l#{7? z0$5fFfzD)1DF?jh%5qq-w3KmC-)pco_U0`azJKE(j6I#`S+rIGXfsxj7@PZDo6$I12AEVfat(S0ZQO7z5@UefV1#w36BDBR{OEg zZQo-G65&C>)mZxs01CqWfGK}Q6Nv!-vONfhgg6S%0^0uzxJn=X3HB7A<+<>8u&)5c zbIC_I8}CtY2*7;sSFoo6NKk-Te$D_{a*6=72LWv=YXH|Hz*GRVz5*`64geQ>kL65# z_#;>Zyr4CEfR`70ucgTT43-p#2nQH1nS#{*?@mEY)|3kB+9}ZXBLL4;Jz&{R0jd4w z!vn;cC4K4ePGyW_ycUIk51WtQa6pRF-6qV^Wz$0!50LtZItHW_kB6}U5E4!REA6lt zFlGRD7kuEb;mNK8)cm<7r#4a}0mfPYfT4qD%Nam+$=fcVt`%^g0OUI$0Y)7KV+6zV z6Ax%0eTfJFo&;ztaKAfau@9i9Lr66AY9h8BPE7%2nPi}j+71^YiBGWT~BcrV&mu<4LvDSk)gfX1HN*jTWMSJICI zH0=8HO$x?17Epx^XZt0G0Fv*HAYGdopz#1;K(nNe+JfK#^**4Eb!8{Kx=!E>v@-(7 zr35r`hLra6Nx~Fz0J)C<7#9{0ofva-teUc0BH%hf5iss4SYj$e?}n=-iCDE0@sCN3 z=o15=_N2rn=UB;`BgW2Xa5g{&{#lrny7%$12_OjnQ7*{%t=syjzkG)z?~@{0Kfnm z52!t0I{=Ipz)O;hj_<<(02Bana5GX?T8OF9wno%aj(d^6s8v!E71KPU)aZYZd z0krsH(xm840|?Ma803JnumColors = fileSize / 2; + if (fileSize % 2 != 0) + FATAL_ERROR("The file size (%d) is not a multiple of 2.\n", fileSize); - if (palette->numColors != 16 && palette->numColors != 256) - FATAL_ERROR("\"%s\" contains %d colors, but the number of colors must be 16 or 256.\n", path, palette->numColors); + palette->numColors = fileSize / 2; for (int i = 0; i < palette->numColors; i++) { uint16_t paletteEntry = (data[i * 2 + 1] << 8) | data[i * 2]; diff --git a/tools/gbagfx/main.c b/tools/gbagfx/main.c index 56a1c2c7b..cc1e8f807 100644 --- a/tools/gbagfx/main.c +++ b/tools/gbagfx/main.c @@ -129,11 +129,36 @@ void HandleGbaToJascPaletteCommand(char *inputPath, char *outputPath, int argc U WriteJascPalette(outputPath, &palette); } -void HandleJascToGbaPaletteCommand(char *inputPath, char *outputPath, int argc UNUSED, char **argv UNUSED) +void HandleJascToGbaPaletteCommand(char *inputPath, char *outputPath, int argc, char **argv) { + int numColors = 0; + + for (int i = 3; i < argc; i++) { + char *option = argv[i]; + + if (strcmp(option, "-num_colors") == 0) { + if (i + 1 >= argc) + FATAL_ERROR("No number of colors following \"-num_colors\".\n"); + + i++; + + if (!ParseNumber(argv[i], NULL, 10, &numColors)) + FATAL_ERROR("Failed to parse number of colors.\n"); + + if (numColors < 1) + FATAL_ERROR("Number of colors must be positive.\n"); + } else { + FATAL_ERROR("Unrecognized option \"%s\".\n", option); + } + } + struct Palette palette; ReadJascPalette(inputPath, &palette); + + if (numColors != 0) + palette.numColors = numColors; + WriteGbaPalette(outputPath, &palette); }