From 5045958c96ab1187433259376179ab8b389614ff Mon Sep 17 00:00:00 2001 From: Ariel Antonitis Date: Thu, 11 Mar 2021 21:26:56 -0500 Subject: [PATCH 001/104] OW windows now light up at night. --- data/tilesets/primary/general/palettes/04.pal | 6 ++-- .../tilesets/secondary/rustboro/metatiles.bin | Bin 5600 -> 5600 bytes .../secondary/rustboro/palettes/06.pal | 30 +++++++++--------- .../secondary/rustboro/palettes/10.pal | 2 +- data/tilesets/secondary/rustboro/tiles.png | Bin 3938 -> 4003 bytes src/overworld.c | 1 + src/util.c | 3 +- 7 files changed, 22 insertions(+), 20 deletions(-) diff --git a/data/tilesets/primary/general/palettes/04.pal b/data/tilesets/primary/general/palettes/04.pal index d8051b7bac42..11ebd16a6443 100644 --- a/data/tilesets/primary/general/palettes/04.pal +++ b/data/tilesets/primary/general/palettes/04.pal @@ -2,13 +2,13 @@ JASC-PAL 0100 16 24 41 82 -255 255 255 +248 0 248 222 230 238 255 0 255 255 0 255 255 0 255 156 164 189 -82 106 213 +80 104 208 65 90 189 57 82 156 41 65 139 @@ -16,4 +16,4 @@ JASC-PAL 139 164 222 106 131 213 82 106 213 -115 197 164 +248 0 248 diff --git a/data/tilesets/secondary/rustboro/metatiles.bin b/data/tilesets/secondary/rustboro/metatiles.bin index 5a0d1b0d14d6f8fd5d408d19880e64b556a6cdd0..585e3a6c299ba5f8428ca95b4b8020298f1f21c6 100644 GIT binary patch delta 34 scmV+-0NwxKE8r`zr~?R;W0hm1W2Ix0umgAqmSdM=remjLvoHj(5fNby>;M1& delta 34 dcmaE${Xl!e3T6%lD44u~xdP7FY{0TX5CD+i2Iv3) diff --git a/data/tilesets/secondary/rustboro/palettes/06.pal b/data/tilesets/secondary/rustboro/palettes/06.pal index 955b1d21a8e9..767ae160d58d 100644 --- a/data/tilesets/secondary/rustboro/palettes/06.pal +++ b/data/tilesets/secondary/rustboro/palettes/06.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 115 197 164 -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 +255 255 255 +238 238 213 +205 205 164 +136 144 152 +131 131 139 +98 98 123 +65 74 106 +41 49 90 +205 213 230 +139 180 213 +205 238 189 +164 205 172 +139 189 139 +123 164 74 +115 197 164 diff --git a/data/tilesets/secondary/rustboro/palettes/10.pal b/data/tilesets/secondary/rustboro/palettes/10.pal index 6f0bfa7ee93a..d68d54ce9ae9 100644 --- a/data/tilesets/secondary/rustboro/palettes/10.pal +++ b/data/tilesets/secondary/rustboro/palettes/10.pal @@ -5,7 +5,7 @@ JASC-PAL 255 255 255 222 222 222 172 180 189 -139 148 156 +136 144 152 131 131 139 98 98 123 65 74 106 diff --git a/data/tilesets/secondary/rustboro/tiles.png b/data/tilesets/secondary/rustboro/tiles.png index c3a3bfbab469519db64233b1868d8c9370d06d49..0ae3620c7d018237d642c731975612b49eddc80f 100644 GIT binary patch delta 3926 zcmXw%`9G9>pg_OR3^RkVWrRt#?E7vgj3FsxNT@6$*>@?DJdZ6|-VCW^9h7}5BoSjN zDn*jKZ>5pF5Hi-%z4wQEemI}=2b^ybWs-Ccm|y+4g_&b?!BW0$(1CtoWRvca7B4X^ zs}{3ZYttWwE@{tkDZ`F^b7|fum8w=(HL4hpHR6yg_(4#qe$j$!Qg%cFb^rE3!n#rl z(K6B|c$0icF`^Rf5`my>)#cxrpLes_-`F1jdt+84GBzAk z^QnvT1+bba0Nj+r4YRDB(X*LUWNaU!Cl#=M{xC!2jw>R5%KjDcxW^T=-7J2_4x#d;exQqZA6z zJ@~Bz92@F1hw;}|kVj#s$|qfYjE_KLI7l7L(hkfb#^1Y=fi zYEI^O7M=kCQV_XLjM?rjGnnK<*0V??*ir_QcWAyu4)BQI9dH3k!2sY3WtuRIV>m28E6Pnlpx1Bb@E$$zZ5R!$#4G~-(m@GES~$-Y9AJG6R_TK7>* z3KMemw!*EW{i$ym1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YBA?f320P@MvpFNO+cs`^HpY(F}$ zfA8@xtVm5KZmFA?7eaPFz%hagmu;7``}=#p%b+zx1h=*a>$u_$cycqWw#^x6_pnpJ z&GoVw0l$nE;=;x|^RL-=i6+n1n4bi#6n<32RLqbMVt1%dozrI#0TiWs6lenF0nVSR zj(z#znihEr8M}&R3tHp?qHiCBJo)|)jGco_k zE3b{m_ZCId7CMKmbgb@M3XdBe%8Dh{1*%jP{Mr7(U*%KB2`{&<-KsBBBc2NRoxr|r znw}GT#dRk~Na>TaQ^2RKI~VE>@T%`qj~^wo$%?>-ZwU@%IH7Q_E7g=2{0;DZN%#b{ zLP~n49?r?KgKTU$&qb>Bc-V1~mq3D!8~v26WHQvs`f;rP4xF63sb>8GCNH@g6ISeR z>;JwZLsz$ngAjH`xe=M)1!c@X7b(=z1kNiYWMO0r%!}1fvg8w_*t`rm%6FiaINgc` z<6G)Kq5iH1_Z!@NE^4WkG0ZySdBEYO&fKGzic4gJ(cD&Zimd1HdMq;o{&N$*dTx`U zsny~J1K`A~@m#gl;|mgK>Jb>tk6tJC>bK89C4?8qqTljC6fbs>OZzEX$+`k` z{ao9Yd9uA zY9Ec@>zg^YIFNO2kj(Zu$9&9t49mUL+{4Q;{vhVV|M@N|u(~c5)ABew-J^7Kwg4LW zQe!_@;8pcr{ddl*@n2`Xw?>!a;!gT}C{`;~fAP1wyB1#QkBbxbbc`+ooS)W2Nm1)x z3du)}BBctI9jc^vVmsJIGK`UxvswvXx*NTl$1pt+`bOl~EtR&kLBZG?swZ3iLx#7- zm TIME_OF_DAY_MAX ? TIME_OF_DAY_MAX : gTimeOfDay; BlendPalettes(palettes, sTimeOfDayBlendVars[gTimeOfDay].coeff, sTimeOfDayBlendVars[gTimeOfDay].blendColor); } diff --git a/src/util.c b/src/util.c index a4e3fa4cfc21..33983e9f408e 100644 --- a/src/util.c +++ b/src/util.c @@ -264,6 +264,7 @@ u32 CalcByteArraySum(const u8* data, u32 length) void BlendPalette(u16 palOffset, u16 numEntries, u8 coeff, u16 blendColor) { u16 i; + struct PlttData *data2 = (struct PlttData *)&blendColor; for (i = 0; i < numEntries; i++) { u16 index = i + palOffset; @@ -271,7 +272,7 @@ void BlendPalette(u16 palOffset, u16 numEntries, u8 coeff, u16 blendColor) s8 r = data1->r; s8 g = data1->g; s8 b = data1->b; - struct PlttData *data2 = (struct PlttData *)&blendColor; + gPlttBufferFaded[index] = RGB(r + (((data2->r - r) * coeff) >> 4), g + (((data2->g - g) * coeff) >> 4), b + (((data2->b - b) * coeff) >> 4)); From 127749369d14e66be49df81aa49696e59f23c2c0 Mon Sep 17 00:00:00 2001 From: Ariel Antonitis Date: Thu, 11 Mar 2021 22:38:06 -0500 Subject: [PATCH 002/104] Allowed map headers to specify light palettes. --- data/tilesets/headers.inc | 2 +- .../secondary/rustboro/palettes/06.pal | 2 +- include/global.fieldmap.h | 1 + include/palette.h | 2 + src/fieldmap.c | 8 +++- src/overworld.c | 9 ++-- src/palette.c | 48 ++++++++++++++++--- 7 files changed, 59 insertions(+), 13 deletions(-) diff --git a/data/tilesets/headers.inc b/data/tilesets/headers.inc index c56234b13b6e..aefc245db508 100644 --- a/data/tilesets/headers.inc +++ b/data/tilesets/headers.inc @@ -24,7 +24,7 @@ gTileset_Petalburg:: @ 83DF71C gTileset_Rustboro:: @ 83DF734 .byte TRUE @ is compressed .byte TRUE @ is secondary tileset - .2byte 0 @ padding + .2byte 1 << 6 @ 1 << 6 .4byte gTilesetTiles_Rustboro .4byte gTilesetPalettes_Rustboro .4byte gMetatiles_Rustboro diff --git a/data/tilesets/secondary/rustboro/palettes/06.pal b/data/tilesets/secondary/rustboro/palettes/06.pal index 767ae160d58d..5851fc31aa91 100644 --- a/data/tilesets/secondary/rustboro/palettes/06.pal +++ b/data/tilesets/secondary/rustboro/palettes/06.pal @@ -1,7 +1,7 @@ JASC-PAL 0100 16 -115 197 164 +248 224 120 255 255 255 238 238 213 205 205 164 diff --git a/include/global.fieldmap.h b/include/global.fieldmap.h index 0e65cc844c78..248e2a6c00bf 100644 --- a/include/global.fieldmap.h +++ b/include/global.fieldmap.h @@ -29,6 +29,7 @@ struct Tileset { /*0x00*/ bool8 isCompressed; /*0x01*/ bool8 isSecondary; + /*0x02*/ u16 lightPalettes; /*0x04*/ void *tiles; /*0x08*/ void *palettes; /*0x0c*/ u16 *metatiles; diff --git a/include/palette.h b/include/palette.h index ebc1cc0bb4b7..4a54b1d552e1 100644 --- a/include/palette.h +++ b/include/palette.h @@ -76,6 +76,8 @@ void BeginHardwarePaletteFade(u8, u8, u8, u8, u8); void BlendPalettes(u32 selectedPalettes, u8 coeff, u16 color); void BlendPalettesUnfaded(u32, u8, u16); void BlendPalettesGradually(u32 selectedPalettes, s8 delay, u8 coeff, u8 coeffTarget, u16 color, u8 priority, u8 id); +void TimePalette(u16 palOffset, u16 numEntries, u8 coeff, u16 blendColor); +void TimePalettes(u32 palettes, u8 coeff, u16 color); void TintPalette_GrayScale(u16 *palette, u16 count); void TintPalette_GrayScale2(u16 *palette, u16 count); void TintPalette_SepiaTone(u16 *palette, u16 count); diff --git a/src/fieldmap.c b/src/fieldmap.c index e437ea7fc2e6..d084dcf38794 100644 --- a/src/fieldmap.c +++ b/src/fieldmap.c @@ -884,8 +884,14 @@ void LoadTilesetPalette(struct Tileset const *tileset, u16 destOffset, u16 size) } else if (tileset->isSecondary == TRUE) { + u8 i; LoadPalette(((u16*)tileset->palettes) + (NUM_PALS_IN_PRIMARY * 16), destOffset, size); - FieldmapPaletteDummy(destOffset, size >> 1); + for (i = NUM_PALS_IN_PRIMARY; i < NUM_PALS_TOTAL; i++) { + if (tileset->lightPalettes & (1 << i)) { + u16 index = i * 16; + gPlttBufferFaded[index] = gPlttBufferUnfaded[index] |= 0x8000; + } + } } else { diff --git a/src/overworld.c b/src/overworld.c index 5bbb1b376204..294bec37bf3d 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -1521,13 +1521,14 @@ void BlendPalettesWithTime(u32 palettes) { palettes &= ~(1 << (i + 16)); } palettes &= ~0xE000; // Don't blend tile palettes [13,15] - palettes &= ~(1 << 6); - gTimeOfDay = gTimeOfDay > TIME_OF_DAY_MAX ? TIME_OF_DAY_MAX : gTimeOfDay; - BlendPalettes(palettes, sTimeOfDayBlendVars[gTimeOfDay].coeff, sTimeOfDayBlendVars[gTimeOfDay].blendColor); + gTimeOfDay = min(TIME_OF_DAY_MAX, gTimeOfDay); + if (!palettes) + return; + TimePalettes(palettes, sTimeOfDayBlendVars[gTimeOfDay].coeff, sTimeOfDayBlendVars[gTimeOfDay].blendColor); } } -u8 UpdateSpritePaletteWithTime(u8 paletteNum) { +u8 UpdateSpritePaletteWithTime(u8 paletteNum) { // TODO: Optimize this BlendPalettesWithTime(1 << (paletteNum + 16)); return paletteNum; } diff --git a/src/palette.c b/src/palette.c index a367a5ed43fe..593c9bcd452e 100644 --- a/src/palette.c +++ b/src/palette.c @@ -457,7 +457,7 @@ static u8 GetPaletteNumByUid(u16 uid) } // Like normal palette fade, but respects sprite/tile palettes immune to time of day fading -static u8 UpdateTimeOfDayPaletteFade(void) // Like normal, but respects sprite palettes immune to fading +static u8 UpdateTimeOfDayPaletteFade(void) { u8 paletteNum; u16 paletteOffset; @@ -496,13 +496,13 @@ static u8 UpdateTimeOfDayPaletteFade(void) // Like normal, but respects sprite p if (gPaletteFade.yDec) { if (gPaletteFade.objPaletteToggle) { // sprite palettes if (gPaletteFade.y >= gPaletteFade.targetY || GetSpritePaletteTagByPaletteNum(paletteNum) & 0x8000) - BlendPalette(paletteOffset, 16, gPaletteFade.y, gPaletteFade.blendColor); + TimePalette(paletteOffset, 16, gPaletteFade.y, gPaletteFade.blendColor); // tile palettes } else if (gPaletteFade.y >= gPaletteFade.targetY || (paletteNum >= 13 && paletteNum <= 15)) { - BlendPalette(paletteOffset, 16, gPaletteFade.y, gPaletteFade.blendColor); + TimePalette(paletteOffset, 16, gPaletteFade.y, gPaletteFade.blendColor); } } else { - BlendPalette(paletteOffset, 16, gPaletteFade.y, gPaletteFade.blendColor); + TimePalette(paletteOffset, 16, gPaletteFade.y, gPaletteFade.blendColor); } } } @@ -978,6 +978,42 @@ void BlendPalettes(u32 selectedPalettes, u8 coeff, u16 color) } } +// Like BlendPalette, but ignores blendColor if the transparency high bit is set +void TimePalette(u16 palOffset, u16 numEntries, u8 coeff, u16 blendColor) { + u16 i; + s8 r, g, b; + struct PlttData *data2 = (struct PlttData *)&blendColor; + for (i = 0; i < numEntries; i++) { + u16 index = i + palOffset; + struct PlttData *data1 = (struct PlttData *)&gPlttBufferUnfaded[index]; + if (i == 0) { + if (data1->unused_15) { // Use transparency color to blend + data2 = data1; + gPlttBufferFaded[index] = gPlttBufferUnfaded[index]; + } + else if (data2->unused_15) // Set transparency/blending color + gPlttBufferUnfaded[index] = gPlttBufferFaded[index] = blendColor; + continue; + } + r = data1->r; + g = data1->g; + b = data1->b; + gPlttBufferFaded[index] = RGB(r + (((data2->r - r) * coeff) >> 4), + g + (((data2->g - g) * coeff) >> 4), + b + (((data2->b - b) * coeff) >> 4)); + } +} + +// Apply time effect to a series of palettes +void TimePalettes(u32 palettes, u8 coeff, u16 color) { + u16 paletteOffset; + for (paletteOffset = 0; palettes; paletteOffset += 16) { + if (palettes & 1) + TimePalette(paletteOffset, 16, coeff, color); + palettes >>= 1; + } +} + void BlendPalettesUnfaded(u32 selectedPalettes, u8 coeff, u16 color) { void *src = gPlttBufferUnfaded; @@ -1123,8 +1159,8 @@ static bool32 IsBlendPalettesGraduallyTaskActive(u8 id) int i; for (i = 0; i < NUM_TASKS; i++) - if ((gTasks[i].isActive == TRUE) - && (gTasks[i].func == Task_BlendPalettesGradually) + if ((gTasks[i].isActive == TRUE) + && (gTasks[i].func == Task_BlendPalettesGradually) && (gTasks[i].tId == id)) return TRUE; From 73234e0c748c19bea198527e8c0abc2a88a0ae9d Mon Sep 17 00:00:00 2001 From: Ariel Antonitis Date: Fri, 12 Mar 2021 02:07:34 -0500 Subject: [PATCH 003/104] Changed Route 104 windows palette. --- .../tilesets/secondary/rustboro/metatiles.bin | Bin 5600 -> 5600 bytes .../secondary/rustboro/palettes/06.pal | 20 +++++++++--------- data/tilesets/secondary/rustboro/tiles.png | Bin 4003 -> 12786 bytes src/palette.c | 17 +++++++++------ 4 files changed, 20 insertions(+), 17 deletions(-) diff --git a/data/tilesets/secondary/rustboro/metatiles.bin b/data/tilesets/secondary/rustboro/metatiles.bin index 585e3a6c299ba5f8428ca95b4b8020298f1f21c6..63ecf0306eed55fba51975805e7469fdd82f728a 100644 GIT binary patch delta 108 zcmaE${XlzyBzw}?q&rD>lQt@FGKwcHOxlpNG3nu^2b&%N@d7A+vjd|a3)76`$rD&@ zgk~f&FjxvPE1YcFFTlWH1>{e@$Ew4$B6%_on~l&4ploDQWYbNcEC{Yh-W zaB^>EX>4U6ba`-PAZ2)IW&i+q+O3;ua$Gr*g#Y6da|Gn;|6^t8Pjk4BWxp<{f3efo^P&9Z`Sjy$;!i6I@y9#I?<-m@nE(Fu z&3^Ym0m`fHPu{8t+iF*)NHBcR$6VX^)}k-+JlFxh(IY)U;KJz0cmr{wWvdB3WfyEX1ZDWFq~zXvRKIWvOXfxns0*#y#QAwt&f+ z?>V^)>S;*3&fU&7zt-{{Q?yoHJ2Q_O_K3~S7^jxi?!JBBdzJsozn>)}p6n2Z~kv-mNb%dQ}v%QUcjhKYOH4|Rvml<%?rVb?EaDLBwo>lAcGD$WU z_oyvw10wN0zN$q0i20^`*IU)_$#%Qe`YtTW(%FmOY&4(s_nlXa$8{>j={}~L&dmf^ zEk+hDpLj&ZeszF(^=rZUqY7S;jt%{(5-4KKRuml2A_eu%oYeZBMaanr!nyr04&g?Z16t=>CX zaN9QS9rc(kY>(N_3QoI>VJzb!JbL#bP|3~}pSOa(^E}>IW45~P9PQR=qei_T+?6wN zIh?J#PF!|Y9zAlk#cDWX`hNJH{oXg`PR@;fh|@d-KW(2fn*st0H6r4;`resh$-bMDtw$p3)@YYqK0yzCR!-X6EGLaa_|uF`FVI=<}wNG?zJNbB|jEQVKr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NgJFqrhCJo#v{+v~lv7dcW+wX?dxqW?6Ktb}kJVU55 z$a%7QyymBCYrsF~_&F>`=sX^Xy`XcP9cd}_iF7Ybh=zw*OB^8!b^J~E-?g<~IO;uT zT48m!_j-BGtk^$317o&&wzq9WCX8inbpxw+-cDb-n{sx%j%Lmo;c zr|6a>-+(PhQaN^grZ%(qunv#A{cZyEi;$Sf&Y_wS=8(c`DOQjUL&}|^{ca9daQzrA zsw}`h;4ON~K>slpHR`yMKDzK3l;z!mE78#g&P!z8lGsi}fLBw|Mv#zf*RCxn$kRZZ zs^bL{Y>gd={onlU)^px&I%*Y6i-AObp!OIZ$k)PE(GEL(>pGfz=#W@5*GLxf$A>(7 zaf7L?(`%Cvb4ZK}NFAsn;~VNG=ESji>Iilpc9nMGaPJIskNOB*`pYmh*&8G3`8$n$ zU0$eZ-%6r8WmE|>0J@lNK0|c;s290()Rzw+r_@;2IVWK zm|4tPj)$oBhHN3JKOolBl}>D21`^7Nd|9~+T(mx)YdY_%Wq<>dVyRJp9+4oxmq*(g zU$J3wy3QZf%z(cXeza3J7K(P>?^fVuKw?bGm|HXdR&J-(e10{_Z{72QYt^E91Cm(O zkSsr#{^*Vydb6Q%s{-0apyEB+kCm?Ww#c0%x6_d`X``{B#3SMD$B;u`Oj+4Sa{k_D z{==T#@{GDZx@MglKc>ex*B$?B@l=rBZoBE*`A&})svfYZmS)pmf@|*mjh(r_+Y^HH zZhg(wxOR(9CUv?&FUL%-^9PG9K0LVjmH5h9n*g1<;Ie1(jH+`D@uMd#8Yr~H{{aC> B@M{17 diff --git a/src/palette.c b/src/palette.c index 593c9bcd452e..f433f442b2a7 100644 --- a/src/palette.c +++ b/src/palette.c @@ -983,24 +983,27 @@ void TimePalette(u16 palOffset, u16 numEntries, u8 coeff, u16 blendColor) { u16 i; s8 r, g, b; struct PlttData *data2 = (struct PlttData *)&blendColor; + struct PlttData *data3; + struct PlttData *blendData; + u16 altBlendIndices = 0; for (i = 0; i < numEntries; i++) { u16 index = i + palOffset; struct PlttData *data1 = (struct PlttData *)&gPlttBufferUnfaded[index]; if (i == 0) { - if (data1->unused_15) { // Use transparency color to blend - data2 = data1; + if (data1->unused_15) { // Color 0 is a bitmask for which colors to blend; color 15 is the alt blend color gPlttBufferFaded[index] = gPlttBufferUnfaded[index]; + altBlendIndices = gPlttBufferUnfaded[index] & 0x7FFF; + data3 = (struct PlttData *)&gPlttBufferUnfaded[index+15]; } - else if (data2->unused_15) // Set transparency/blending color - gPlttBufferUnfaded[index] = gPlttBufferFaded[index] = blendColor; continue; } r = data1->r; g = data1->g; b = data1->b; - gPlttBufferFaded[index] = RGB(r + (((data2->r - r) * coeff) >> 4), - g + (((data2->g - g) * coeff) >> 4), - b + (((data2->b - b) * coeff) >> 4)); + blendData = (altBlendIndices && altBlendIndices & (1 << i)) ? data3 : data2; + gPlttBufferFaded[index] = RGB(r + (((blendData->r - r) * coeff) >> 4), + g + (((blendData->g - g) * coeff) >> 4), + b + (((blendData->b - b) * coeff) >> 4)); } } From 3a7c2e3480773b95945a2ded71d083897994b551 Mon Sep 17 00:00:00 2001 From: Ariel Antonitis Date: Fri, 12 Mar 2021 21:20:47 -0500 Subject: [PATCH 004/104] Updated Petalburg tileset lights. --- data/tilesets/headers.inc | 4 +-- .../secondary/petalburg/metatiles.bin | Bin 2304 -> 2304 bytes .../secondary/petalburg/palettes/06.pal | 4 +-- .../secondary/petalburg/palettes/07.pal | 32 +++++++++--------- data/tilesets/secondary/petalburg/tiles.png | Bin 1740 -> 1738 bytes 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/data/tilesets/headers.inc b/data/tilesets/headers.inc index aefc245db508..32eec2ab94cd 100644 --- a/data/tilesets/headers.inc +++ b/data/tilesets/headers.inc @@ -13,7 +13,7 @@ gTileset_General:: @ 83DF704 gTileset_Petalburg:: @ 83DF71C .byte TRUE @ is compressed .byte TRUE @ is secondary tileset - .2byte 0 @ padding + .2byte 0xC0 @ lightPalettes 7,8 .4byte gTilesetTiles_Petalburg .4byte gTilesetPalettes_Petalburg .4byte gMetatiles_Petalburg @@ -24,7 +24,7 @@ gTileset_Petalburg:: @ 83DF71C gTileset_Rustboro:: @ 83DF734 .byte TRUE @ is compressed .byte TRUE @ is secondary tileset - .2byte 1 << 6 @ 1 << 6 + .2byte 1 << 6 @ lightPalettes .4byte gTilesetTiles_Rustboro .4byte gTilesetPalettes_Rustboro .4byte gMetatiles_Rustboro diff --git a/data/tilesets/secondary/petalburg/metatiles.bin b/data/tilesets/secondary/petalburg/metatiles.bin index 3711f4aeef135df2d52e729beee708e72769e30b..3ca46efec7868bb936838d926c003fd61abdf1cb 100644 GIT binary patch delta 35 rcmZn=Y7m<6mAPnY*~A}}%th16HkUBUGP4);70oT0SG0KsO9l%72__Cm delta 35 rcmZn=Y7m<6mAPqZ+r%H0%uUnUHkUBUGP5`JHO+0B*R**CO9l%75k?Nk diff --git a/data/tilesets/secondary/petalburg/palettes/06.pal b/data/tilesets/secondary/petalburg/palettes/06.pal index b893aa09e4de..0c727de68ca6 100644 --- a/data/tilesets/secondary/petalburg/palettes/06.pal +++ b/data/tilesets/secondary/petalburg/palettes/06.pal @@ -1,7 +1,7 @@ JASC-PAL 0100 16 -24 41 82 +0 128 8 255 255 255 230 222 222 213 213 197 @@ -16,4 +16,4 @@ JASC-PAL 205 197 123 180 164 123 164 139 98 -115 197 164 +248 224 120 diff --git a/data/tilesets/secondary/petalburg/palettes/07.pal b/data/tilesets/secondary/petalburg/palettes/07.pal index 4b0812f09403..3f7cad9b2cf0 100644 --- a/data/tilesets/secondary/petalburg/palettes/07.pal +++ b/data/tilesets/secondary/petalburg/palettes/07.pal @@ -1,19 +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 +0 128 8 +213 222 172 +0 0 0 +189 189 131 +164 172 123 +131 131 139 +98 106 123 +65 74 106 +0 0 0 +164 213 230 +106 189 197 +112 192 160 +205 213 238 +156 156 180 +115 172 57 +248 224 120 diff --git a/data/tilesets/secondary/petalburg/tiles.png b/data/tilesets/secondary/petalburg/tiles.png index 00d6d94a4ef2f74d70ca5eb58cfe0497deeb66b5..c3ae46ad7cc2d244042381cb4d43a10ddf4c553f 100644 GIT binary patch delta 1626 zcmV-g2BrDT4ayCWU+WH0*O9gig`%8}EdPk!Q=y8G$9cX#g{Wf-54uc=|sSU=N|J}_c+{6xHV zL}{cnbz4aW@cZ#-KpCTywSwk1uh-X=)|>q(`lvKq|8af&dXv3_Zu0XSAo|Fne`v&_ zpK}1tKPnvp;QC3Qk2&YG05Cd^7$6t|tXN*x+v+CjJGg;71n>s@lLMTN7-J*G^A@CC zxDMk7)CItxz=d-jMVw#i!U>FQaqboZmT{p8-n&BZmh>S5@aTzhfl&u7U~dXssP)kS zAq0e>k+Y!Hr^-A!3Yt{Q!;A}*e`>&#^B}jhI_#Lz=37cfY)HRlvAhKr5((M6uJDj6 zL|6EXWdZ$=vF2OG+|lq+DUrI%5(!G*Gd7^G1YNYCRLTOzp%CsAlm`tfkvjcX9BYg5 z0WN3{0l6S{#txhJNl?L+_|#JSS2K9p+^$MdP<>|`yNMHeDM{WW}i+q5jD89--9Pr2F) zU=Mws0k|`M&Y>R{2q1*qKsD<)XR(HzvFFBsDfOtAvj6}b6#?1>yC7Q{gLg&G5dSOM?Ey~|>7L&tzX3?M})4H7`L0N_y_gI~h*QjVi8weyF% zxni28ZRY_FpTQaj^_UqYNEEhxFAGR_ zyymIJ0vGg6rvu|sfT1n-z zU>Hv}zI#YW?WfJU?6z_%mrSn=*jx%gsRW=4DF87Hf&lY}FSH=~REf}qsF1LP1z2fT zD)6>pewhUlK=A!Pe*-oOd{`Dx`C@>h0Jl`t&5WHGlL-JU1XyzbQbxcX5(75p0BcgR zfb=X_wMUj!yKBV&@@Eb(nH(KWzygn2xV|kMl(E37J&pl#9S{;_0BftO{r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hC=f?$FH z*L{p!3V@cZfL7B%oZw1?Wq>mP25exuwmfZtvz>MUuUHeRnROsH0;Fm9W(2@>TLK8b zt^wKtC8paE*Y2V$mOf4D`IMBPxGj(5XtV}a-c^zHbX z0f=s>8r}a3U_1J(>|G9^D{d4nc%)59;iKM}x2D|YyRD6@l^RGH1DqRdveGxFDZ4Ed8aRaOiP!sG8vO&^=;uw?I0(h!Y zfZ9OYS%|mFLmTBcInBUGCppyi4 zN<{yM(3XHy3 Date: Fri, 12 Mar 2021 22:07:46 -0500 Subject: [PATCH 005/104] Added Slateport light palettes. --- data/tilesets/headers.inc | 2 +- .../secondary/slateport/metatiles.bin | Bin 6496 -> 6496 bytes .../secondary/slateport/palettes/06.pal | 4 ++-- .../secondary/slateport/palettes/12.pal | 16 ++++++++-------- data/tilesets/secondary/slateport/tiles.png | Bin 6559 -> 6558 bytes 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/data/tilesets/headers.inc b/data/tilesets/headers.inc index 32eec2ab94cd..4ebfe80a5251 100644 --- a/data/tilesets/headers.inc +++ b/data/tilesets/headers.inc @@ -46,7 +46,7 @@ gTileset_Dewford:: @ 83DF74C gTileset_Slateport:: @ 83DF764 .byte TRUE @ is compressed .byte TRUE @ is secondary tileset - .2byte 0 @ padding + .2byte 1 << 12 @ lightPalettes .4byte gTilesetTiles_Slateport .4byte gTilesetPalettes_Slateport .4byte gMetatiles_Slateport diff --git a/data/tilesets/secondary/slateport/metatiles.bin b/data/tilesets/secondary/slateport/metatiles.bin index 72f671f71def8f5a93264b76c854c5b797ee20b8..0cb7f64acaf96c38d35e004426fe9fc0bfca9d57 100644 GIT binary patch delta 89 zcmaE0^uTBXFDv(91_ovYW`)bgFCU&P!73{aqz^7WxOm%QkT{dV!^O-B2Nxd!@~#}- j9Kia7ndNcw-Ty*UXRD?@p%6A`tSA1SIJXJBSA9v+>cP6e#gfW729?tUrXdfT{^sZ z$-3@K@}1e61(m}utAmTCgVt|{+|gG;bEAL5_j-(kMq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D<~JK}ogeP3x zF~<7};oKXUv;bzO4d?!|&TXDWE>sI3z8|Q;lUCQBKlAckb-MbD$wdC3LGc}*S!aU$ bEy{uBMuOlQf)_U{_)nKE8egb7Pm25>ez(A` From 56b9764aecf64aa3aed33b30acdc000e4098510e Mon Sep 17 00:00:00 2001 From: Ariel Antonitis Date: Fri, 12 Mar 2021 23:20:15 -0500 Subject: [PATCH 006/104] Added default light blending color. Fixed light palette header offsets. Changed blending function names. --- data/tilesets/headers.inc | 6 +++--- include/global.fieldmap.h | 3 ++- include/overworld.h | 2 +- include/palette.h | 4 ++-- src/field_weather_effect.c | 4 ++-- src/fieldmap.c | 4 +++- src/overworld.c | 8 ++++---- src/palette.c | 17 ++++++++++------- 8 files changed, 27 insertions(+), 21 deletions(-) diff --git a/data/tilesets/headers.inc b/data/tilesets/headers.inc index 4ebfe80a5251..38e74bb66a03 100644 --- a/data/tilesets/headers.inc +++ b/data/tilesets/headers.inc @@ -13,7 +13,7 @@ gTileset_General:: @ 83DF704 gTileset_Petalburg:: @ 83DF71C .byte TRUE @ is compressed .byte TRUE @ is secondary tileset - .2byte 0xC0 @ lightPalettes 7,8 + .2byte 3 @ lightPalettes 6,7 .4byte gTilesetTiles_Petalburg .4byte gTilesetPalettes_Petalburg .4byte gMetatiles_Petalburg @@ -24,7 +24,7 @@ gTileset_Petalburg:: @ 83DF71C gTileset_Rustboro:: @ 83DF734 .byte TRUE @ is compressed .byte TRUE @ is secondary tileset - .2byte 1 << 6 @ lightPalettes + .2byte 1 @ lightPalettes 6 .4byte gTilesetTiles_Rustboro .4byte gTilesetPalettes_Rustboro .4byte gMetatiles_Rustboro @@ -46,7 +46,7 @@ gTileset_Dewford:: @ 83DF74C gTileset_Slateport:: @ 83DF764 .byte TRUE @ is compressed .byte TRUE @ is secondary tileset - .2byte 1 << 12 @ lightPalettes + .2byte 0x41 @ lightPalettes 6,12 .4byte gTilesetTiles_Slateport .4byte gTilesetPalettes_Slateport .4byte gMetatiles_Slateport diff --git a/include/global.fieldmap.h b/include/global.fieldmap.h index 248e2a6c00bf..84a9c14a6706 100644 --- a/include/global.fieldmap.h +++ b/include/global.fieldmap.h @@ -29,7 +29,8 @@ struct Tileset { /*0x00*/ bool8 isCompressed; /*0x01*/ bool8 isSecondary; - /*0x02*/ u16 lightPalettes; + /*0x02*/ u8 lightPalettes; // Bitmask determining whether a palette should be time-blended as a light + /*0x03*/ u8 customLightColor; // Bitmask determining which light palettes have custom light colors (color 15) /*0x04*/ void *tiles; /*0x08*/ void *palettes; /*0x0c*/ u16 *metatiles; diff --git a/include/overworld.h b/include/overworld.h index 86d5426b2850..918a5dcce90f 100644 --- a/include/overworld.h +++ b/include/overworld.h @@ -136,7 +136,7 @@ void CleanupOverworldWindowsAndTilemaps(void); bool32 IsUpdateLinkStateCBActive(void); void CB1_Overworld(void); void CB2_OverworldBasic(void); -void BlendPalettesWithTime(u32); +void UpdatePalettesWithTime(u32); void CB2_Overworld(void); void SetMainCallback1(void (*cb)(void)); void SetUnusedCallback(void *a0); diff --git a/include/palette.h b/include/palette.h index 4a54b1d552e1..f9bd20560de4 100644 --- a/include/palette.h +++ b/include/palette.h @@ -76,8 +76,8 @@ void BeginHardwarePaletteFade(u8, u8, u8, u8, u8); void BlendPalettes(u32 selectedPalettes, u8 coeff, u16 color); void BlendPalettesUnfaded(u32, u8, u16); void BlendPalettesGradually(u32 selectedPalettes, s8 delay, u8 coeff, u8 coeffTarget, u16 color, u8 priority, u8 id); -void TimePalette(u16 palOffset, u16 numEntries, u8 coeff, u16 blendColor); -void TimePalettes(u32 palettes, u8 coeff, u16 color); +void TimeBlendPalette(u16 palOffset, u16 numEntries, u8 coeff, u16 blendColor); +void TimeBlendPalettes(u32 palettes, u8 coeff, u16 color); void TintPalette_GrayScale(u16 *palette, u16 count); void TintPalette_GrayScale2(u16 *palette, u16 count); void TintPalette_SepiaTone(u16 *palette, u16 count); diff --git a/src/field_weather_effect.c b/src/field_weather_effect.c index 9f7894066678..db480772c672 100644 --- a/src/field_weather_effect.c +++ b/src/field_weather_effect.c @@ -1142,7 +1142,7 @@ void Thunderstorm_Main(void) { ApplyWeatherGammaShiftIfIdle(3); if (gTimeOfDay != TIME_OF_DAY_DAY) - BlendPalettesWithTime(0xFFFFFFFF); + UpdatePalettesWithTime(0xFFFFFFFF); gWeatherPtr->thunderAllowEnd = TRUE; if (--gWeatherPtr->thunderShortRetries != 0) { @@ -1183,7 +1183,7 @@ void Thunderstorm_Main(void) case TSTORM_STATE_FADE_THUNDER_LONG: if (--gWeatherPtr->thunderDelay == 0) { - gTimeOfDay == TIME_OF_DAY_DAY ? sub_80ABC7C(19, 3, 5) : BlendPalettesWithTime(0xFFFFFFFF); + gTimeOfDay == TIME_OF_DAY_DAY ? sub_80ABC7C(19, 3, 5) : UpdatePalettesWithTime(0xFFFFFFFF); gWeatherPtr->initStep++; } break; diff --git a/src/fieldmap.c b/src/fieldmap.c index d084dcf38794..b3b35a7b08e8 100644 --- a/src/fieldmap.c +++ b/src/fieldmap.c @@ -887,9 +887,11 @@ void LoadTilesetPalette(struct Tileset const *tileset, u16 destOffset, u16 size) u8 i; LoadPalette(((u16*)tileset->palettes) + (NUM_PALS_IN_PRIMARY * 16), destOffset, size); for (i = NUM_PALS_IN_PRIMARY; i < NUM_PALS_TOTAL; i++) { - if (tileset->lightPalettes & (1 << i)) { + if (tileset->lightPalettes & (1 << (i - NUM_PALS_IN_PRIMARY))) { // Mark as light palette u16 index = i * 16; gPlttBufferFaded[index] = gPlttBufferUnfaded[index] |= 0x8000; + if (tileset->customLightColor & (1 << (i - NUM_PALS_IN_PRIMARY))) // Mark as custom light color + gPlttBufferFaded[index+15] = gPlttBufferUnfaded[index+15] |= 0x8000; } } } diff --git a/src/overworld.c b/src/overworld.c index 294bec37bf3d..5a7ace7b8d0d 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -846,7 +846,7 @@ void LoadMapFromCameraTransition(u8 mapGroup, u8 mapNum) RoamerMove(); DoCurrentWeather(); ResetFieldTasksArgs(); - BlendPalettesWithTime(0xFFFFFFFF); + UpdatePalettesWithTime(0xFFFFFFFF); RunOnResumeMapScript(); if (gMapHeader.regionMapSectionId != MAPSEC_BATTLE_FRONTIER @@ -1512,7 +1512,7 @@ static bool8 FadePalettesWithTime(void) { } } -void BlendPalettesWithTime(u32 palettes) { +void UpdatePalettesWithTime(u32 palettes) { // Only blend if not transitioning between times and the map type allows if (gTimeOfDayState == 0 && MapHasNaturalLight(gMapHeader.mapType)) { u8 i; @@ -1524,12 +1524,12 @@ void BlendPalettesWithTime(u32 palettes) { gTimeOfDay = min(TIME_OF_DAY_MAX, gTimeOfDay); if (!palettes) return; - TimePalettes(palettes, sTimeOfDayBlendVars[gTimeOfDay].coeff, sTimeOfDayBlendVars[gTimeOfDay].blendColor); + TimeBlendPalettes(palettes, sTimeOfDayBlendVars[gTimeOfDay].coeff, sTimeOfDayBlendVars[gTimeOfDay].blendColor); } } u8 UpdateSpritePaletteWithTime(u8 paletteNum) { // TODO: Optimize this - BlendPalettesWithTime(1 << (paletteNum + 16)); + UpdatePalettesWithTime(1 << (paletteNum + 16)); return paletteNum; } diff --git a/src/palette.c b/src/palette.c index f433f442b2a7..1b38003df57c 100644 --- a/src/palette.c +++ b/src/palette.c @@ -496,13 +496,13 @@ static u8 UpdateTimeOfDayPaletteFade(void) if (gPaletteFade.yDec) { if (gPaletteFade.objPaletteToggle) { // sprite palettes if (gPaletteFade.y >= gPaletteFade.targetY || GetSpritePaletteTagByPaletteNum(paletteNum) & 0x8000) - TimePalette(paletteOffset, 16, gPaletteFade.y, gPaletteFade.blendColor); + TimeBlendPalette(paletteOffset, 16, gPaletteFade.y, gPaletteFade.blendColor); // tile palettes } else if (gPaletteFade.y >= gPaletteFade.targetY || (paletteNum >= 13 && paletteNum <= 15)) { - TimePalette(paletteOffset, 16, gPaletteFade.y, gPaletteFade.blendColor); + TimeBlendPalette(paletteOffset, 16, gPaletteFade.y, gPaletteFade.blendColor); } } else { - TimePalette(paletteOffset, 16, gPaletteFade.y, gPaletteFade.blendColor); + TimeBlendPalette(paletteOffset, 16, gPaletteFade.y, gPaletteFade.blendColor); } } } @@ -979,8 +979,9 @@ void BlendPalettes(u32 selectedPalettes, u8 coeff, u16 color) } // Like BlendPalette, but ignores blendColor if the transparency high bit is set -void TimePalette(u16 palOffset, u16 numEntries, u8 coeff, u16 blendColor) { +void TimeBlendPalette(u16 palOffset, u16 numEntries, u8 coeff, u16 blendColor) { u16 i; + u16 defaultBlendColor = 0x3f9f; s8 r, g, b; struct PlttData *data2 = (struct PlttData *)&blendColor; struct PlttData *data3; @@ -992,8 +993,10 @@ void TimePalette(u16 palOffset, u16 numEntries, u8 coeff, u16 blendColor) { if (i == 0) { if (data1->unused_15) { // Color 0 is a bitmask for which colors to blend; color 15 is the alt blend color gPlttBufferFaded[index] = gPlttBufferUnfaded[index]; - altBlendIndices = gPlttBufferUnfaded[index] & 0x7FFF; + altBlendIndices = gPlttBufferUnfaded[index] & 0x7FFF; // Note that color 15 will never be light-blended data3 = (struct PlttData *)&gPlttBufferUnfaded[index+15]; + if (!data3->unused_15) // use default blend color instead + data3 = (struct PlttData *)&defaultBlendColor; } continue; } @@ -1008,11 +1011,11 @@ void TimePalette(u16 palOffset, u16 numEntries, u8 coeff, u16 blendColor) { } // Apply time effect to a series of palettes -void TimePalettes(u32 palettes, u8 coeff, u16 color) { +void TimeBlendPalettes(u32 palettes, u8 coeff, u16 color) { u16 paletteOffset; for (paletteOffset = 0; palettes; paletteOffset += 16) { if (palettes & 1) - TimePalette(paletteOffset, 16, coeff, color); + TimeBlendPalette(paletteOffset, 16, coeff, color); palettes >>= 1; } } From 4a04282c0b6a8714fcc75cacea63decb9c746fea Mon Sep 17 00:00:00 2001 From: Ariel Antonitis Date: Mon, 15 Mar 2021 23:58:46 -0400 Subject: [PATCH 007/104] Added Mauville light palettes. --- data/tilesets/headers.inc | 2 +- .../tilesets/secondary/mauville/metatiles.bin | Bin 8160 -> 8160 bytes .../secondary/mauville/palettes/07.pal | 6 +++--- .../secondary/mauville/palettes/08.pal | 10 +++++----- .../secondary/mauville/palettes/09.pal | 12 ++++++------ .../secondary/mauville/palettes/10.pal | 6 +++--- data/tilesets/secondary/mauville/tiles.png | Bin 6069 -> 6068 bytes 7 files changed, 18 insertions(+), 18 deletions(-) diff --git a/data/tilesets/headers.inc b/data/tilesets/headers.inc index 38e74bb66a03..f495aae2c0f1 100644 --- a/data/tilesets/headers.inc +++ b/data/tilesets/headers.inc @@ -57,7 +57,7 @@ gTileset_Slateport:: @ 83DF764 gTileset_Mauville:: @ 83DF77C .byte TRUE @ is compressed .byte TRUE @ is secondary tileset - .2byte 0 @ padding + .2byte 0x12 @ lightPalettes 7,10 .4byte gTilesetTiles_Mauville .4byte gTilesetPalettes_Mauville .4byte gMetatiles_Mauville diff --git a/data/tilesets/secondary/mauville/metatiles.bin b/data/tilesets/secondary/mauville/metatiles.bin index a71ead8e57b2e0e512ce2057d3a92e1d0fc62122..d1384046582c50a3fe9fc009d6dbbfce980deb88 100644 GIT binary patch delta 28 ecmaE0|G<7jp(KCu>*P1dZ-FF)-rOLWzy<)^#}35+ delta 28 ecmaE0|G<7jp(KCt>*6=XZ-FF)-rOLWzy<*0M-N2+ diff --git a/data/tilesets/secondary/mauville/palettes/07.pal b/data/tilesets/secondary/mauville/palettes/07.pal index fa1dbd29628b..b74a8c0097b2 100644 --- a/data/tilesets/secondary/mauville/palettes/07.pal +++ b/data/tilesets/secondary/mauville/palettes/07.pal @@ -1,7 +1,7 @@ JASC-PAL 0100 16 -123 180 189 +16 64 0 255 255 180 238 238 90 213 213 65 @@ -9,11 +9,11 @@ JASC-PAL 131 131 139 98 98 123 65 74 106 -41 49 90 +168 200 224 213 213 213 164 164 172 230 197 246 213 139 222 197 115 164 148 98 106 -172 205 230 +40 48 88 diff --git a/data/tilesets/secondary/mauville/palettes/08.pal b/data/tilesets/secondary/mauville/palettes/08.pal index bc7cb5c883ea..3742cfd9ba8b 100644 --- a/data/tilesets/secondary/mauville/palettes/08.pal +++ b/data/tilesets/secondary/mauville/palettes/08.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 123 180 189 -115 189 246 +0 248 0 131 197 98 57 139 49 57 82 0 255 255 98 255 255 255 222 230 238 -189 205 230 +0 248 0 255 172 222 230 131 180 213 90 139 -164 213 197 +0 248 0 115 197 164 -65 180 131 -24 164 106 +0 248 0 +0 248 0 diff --git a/data/tilesets/secondary/mauville/palettes/09.pal b/data/tilesets/secondary/mauville/palettes/09.pal index 9c37027c3dc0..312bb1aac7ac 100644 --- a/data/tilesets/secondary/mauville/palettes/09.pal +++ b/data/tilesets/secondary/mauville/palettes/09.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 123 180 189 -255 255 255 +248 0 248 131 197 98 57 139 49 57 82 0 255 255 98 172 197 230 -139 164 222 -106 131 213 +248 0 248 +248 0 248 255 230 148 238 197 115 -230 172 82 +248 0 248 164 213 197 115 197 164 -65 180 131 -24 164 106 +248 0 248 +248 0 248 diff --git a/data/tilesets/secondary/mauville/palettes/10.pal b/data/tilesets/secondary/mauville/palettes/10.pal index a2e1cdc17613..5b3c5e6ef224 100644 --- a/data/tilesets/secondary/mauville/palettes/10.pal +++ b/data/tilesets/secondary/mauville/palettes/10.pal @@ -1,7 +1,7 @@ JASC-PAL 0100 16 -123 180 189 +16 128 8 255 255 255 148 222 205 123 180 172 @@ -9,9 +9,9 @@ JASC-PAL 131 131 139 98 98 123 65 74 106 -41 49 90 +144 216 248 246 197 98 -148 222 255 +144 216 248 230 172 238 213 139 222 197 115 164 diff --git a/data/tilesets/secondary/mauville/tiles.png b/data/tilesets/secondary/mauville/tiles.png index 208a052c538867a6cc6837f5ce270b8d959dee6f..68e2f49dcd230ab4f02a0750dca913f8ed2bedf0 100644 GIT binary patch delta 6026 zcmW+)c|6qr^MAeHyX#oXTK5$zlB=9)NvxbvK2nY(Eec)ElpMX^?ju))RAP%tC6pXF zSFY0G2(4V}7Rky@`1bqFU-QSzV`d(6J!eYQ-m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4=Zp1@2^-eL_%2VQ9oB+>)?)fHLN zwsp^dE`f5FE5wKjHY34E3i4;~mIAWunh`uXCO4+y2tlyaL({ancrDmc`1a+d(jw13 zrqysJy*a$OzFXZ&R&%*ar-u=v5O^tYR8(CB^zJAC^{s0;U6Y1R!V*MDbN z&G{n23jR{3ibJoFjzd_IS1PEC2W0jykE5?=4~M^o=+hm%Z6I HNDlu$H%7Fc From b7d9b77e4697b84ccefe33056c5bece0c94cf557 Mon Sep 17 00:00:00 2001 From: Ariel Antonitis Date: Tue, 16 Mar 2021 01:00:14 -0400 Subject: [PATCH 008/104] Added Fortree/weather institute lights. --- data/tilesets/headers.inc | 4 ++-- data/tilesets/secondary/fortree/metatiles.bin | Bin 4480 -> 4480 bytes .../secondary/fortree/palettes/08.pal | 4 ++-- data/tilesets/secondary/fortree/tiles.png | Bin 4414 -> 4433 bytes .../tilesets/secondary/mauville/metatiles.bin | Bin 8160 -> 8160 bytes .../secondary/mauville/palettes/07.pal | 6 +++--- .../secondary/mauville/palettes/10.pal | 2 +- .../secondary/mauville/palettes/11.pal | 2 +- data/tilesets/secondary/mauville/tiles.png | Bin 6068 -> 6069 bytes .../secondary/petalburg/palettes/06.pal | 2 +- .../secondary/petalburg/palettes/07.pal | 2 +- .../secondary/rustboro/palettes/06.pal | 2 +- .../secondary/slateport/palettes/06.pal | 2 +- .../secondary/slateport/palettes/12.pal | 2 +- src/palette.c | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/data/tilesets/headers.inc b/data/tilesets/headers.inc index f495aae2c0f1..c652587a0edc 100644 --- a/data/tilesets/headers.inc +++ b/data/tilesets/headers.inc @@ -57,7 +57,7 @@ gTileset_Slateport:: @ 83DF764 gTileset_Mauville:: @ 83DF77C .byte TRUE @ is compressed .byte TRUE @ is secondary tileset - .2byte 0x12 @ lightPalettes 7,10 + .2byte 0x32 @ lightPalettes 7,10,11 .4byte gTilesetTiles_Mauville .4byte gTilesetPalettes_Mauville .4byte gMetatiles_Mauville @@ -90,7 +90,7 @@ gTileset_Fallarbor:: @ 83DF7AC gTileset_Fortree:: @ 83DF7C4 .byte TRUE @ is compressed .byte TRUE @ is secondary tileset - .2byte 0 @ padding + .2byte 0x0404 @ lightPalettes 8, customLights 8 .4byte gTilesetTiles_Fortree .4byte gTilesetPalettes_Fortree .4byte gMetatiles_Fortree diff --git a/data/tilesets/secondary/fortree/metatiles.bin b/data/tilesets/secondary/fortree/metatiles.bin index ecc00d7e7092a272c134c4a9fdcaae507c44c11e..1b0958cbd1e07e44e47a8dc2a7f6e04356798110 100644 GIT binary patch delta 56 zcmZorZcyGJ!OO(ZFjP(5HM!<&sD#p#h}@*yDutBiLF6nY5vp~da#TVRSqqU! zk|Sa&cVpzt(eL|v{rURi_3!)rM)9*^h9^8=z1!R&GM|_05j5a<@JQw+2=k>rsU(s zp}3N3r6`U31U)g+-Gha58K?74mQUq4y>&sw*=(CO%!U(nEKet%55D?QL~nF`*?8;@ z9Ie@6dqps3G`Gwt)S>t3yG^8uT`~90>)i^FGkInk!KShoZi$ zr!V^Tz;k7%1X<=!IelJMGq|nJWgdH*uZ`f2uAk<@J7j@={9!bx?N|lV-9h?jE<=g8CZ-ps4}lzwA9-VXe>46S#aNPheE zsiw}pql#z2W{#9i&oE~joNH$ zDWjyj4DJS!@Zddp{GLI?8X#V z6uIA=gC6sH?A0-Gmky?0+ynVS>r@Ch0QOEWek;()Ug;Q1%YA>?X_V8@R@@~wHsV3|i1^cd$uU!pDbNt*KnCW}2=1-gaL#&}r zt{)J|%>C2=3Hi+TPKdlC5Ssmn6S~I56w9-SqNE_@kdcO%JjfoWY53m$VI3A`?*1M! zOZeMzLI)ncy{ql&TrGD8a!UK@g@g7#VDRsjDtrIU1z=;|Od!YZ{|0d{bRAoLT?%QQ z&`Ft!Q!K>p%vDfoL#e36Lw8dqf|T3phu5}0uzYaz<{tE7!HfdeMV)JFW?*!P4^(q9 zS;|+5mkhd-n@w`+mES|%+gIkbt3{2mB$DHz;jqyZ%!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~@{WQqfV z1v?z;UwRniua5{FvZYNrmSElN`4{yYW|SGa7?KKWB;paYw1vbp4H6BCDOSb6>gDHxWjJxIyQnI1m>?2oP^hinG1NNNDbm_c3n9sgW8CA}9WqlkEZ0 z|8a^Dbu0lX5q$ny>Af>HbhlfpN?VoaH7N^n`;Mhb-|sIqNYl zyvPEq_Dj@tt`{?mOJGc49#ft|R<;xrB{oe0QzI^Np~ ze%CPI^AAWccJ@qg&}vwWXiB@(nCAXg`(KYVqrlG!BoyOShz01At;s4Oe*k5lv@oar z@7lCG7>Jicxu7Y{t~`KhbDdH^2Y;q4alrq1cr#bkp1!s2Hzc-qU8mvG{^R>S`~zw< zqwcCpkQ6S|Q&4%!SbzR3mf=5*r}kAa2+y=SvnigBej2I?E%j7L(((u61H1kx{ePh! z#6e`-EVTDJ)XaE_piSC6H~Z4jy3~Wl(1Js9KlarfpMUys5BGM`Kj{LLKC8E{j0dRf xt?d`6F$AY-N+S{KQ=a(2MH*6=XZ-FF)-rOLWzy<*0M-N2+ delta 28 ecmaE0|G<7jp(KCu>*P1dZ-FF)-rOLWzy<)^#}35+ diff --git a/data/tilesets/secondary/mauville/palettes/07.pal b/data/tilesets/secondary/mauville/palettes/07.pal index b74a8c0097b2..6f43490ad677 100644 --- a/data/tilesets/secondary/mauville/palettes/07.pal +++ b/data/tilesets/secondary/mauville/palettes/07.pal @@ -1,7 +1,7 @@ JASC-PAL 0100 16 -16 64 0 +8 0 128 255 255 180 238 238 90 213 213 65 @@ -9,11 +9,11 @@ JASC-PAL 131 131 139 98 98 123 65 74 106 -168 200 224 +40 48 88 213 213 213 164 164 172 230 197 246 213 139 222 197 115 164 148 98 106 -40 48 88 +168 200 224 diff --git a/data/tilesets/secondary/mauville/palettes/10.pal b/data/tilesets/secondary/mauville/palettes/10.pal index 5b3c5e6ef224..b87549f6d19e 100644 --- a/data/tilesets/secondary/mauville/palettes/10.pal +++ b/data/tilesets/secondary/mauville/palettes/10.pal @@ -1,7 +1,7 @@ JASC-PAL 0100 16 -16 128 8 +8 192 0 255 255 255 148 222 205 123 180 172 diff --git a/data/tilesets/secondary/mauville/palettes/11.pal b/data/tilesets/secondary/mauville/palettes/11.pal index c73ec2fe827e..48166182aef3 100644 --- a/data/tilesets/secondary/mauville/palettes/11.pal +++ b/data/tilesets/secondary/mauville/palettes/11.pal @@ -1,7 +1,7 @@ JASC-PAL 0100 16 -172 180 139 +0 48 0 255 255 255 222 230 238 164 180 197 diff --git a/data/tilesets/secondary/mauville/tiles.png b/data/tilesets/secondary/mauville/tiles.png index 68e2f49dcd230ab4f02a0750dca913f8ed2bedf0..20da7198e89bf0890f4ec48261c9372907c2c4c6 100644 GIT binary patch delta 6027 zcmW-kc{r5+*T+BiJu{54?~}+#+1FA@mLdC2k}XYSCzB-<=0;@~m5`;8BoRu=H``63 zEJewZrIAQ>WnUk^=lpf9^S)l^pR-)&yi%-EOr_AsM!MQIp*geJ=Y56yf?I#<4Pmv< zBw+`Y{z24?U{>gwl7|d`)IH|84=|zMQkebh&Bvw@GaqaW^1zlHKne0k4*^}p(EjVEa`Q?CBJ^$T;(JMLYwL0Q?N zs@@MQ-z1r)w^vm-IR~tAQySFTRDX>)ZfH~I1J56p%41giDo#-P?Iv8*kTD%kWT

7rC$&PQT!Ma5fp*VO=^0-Ex9)H2nuMzXUBPpP7Qy=WA zFfM{1&nDrMgA1#dHt^KyP08Ml+k*Rmn~GJ%8R36p0S*`}bfhTf<6Qyi$#uQYr~aeK z;)!uknvBOYH;9(*tyij1pefrUz=ZBBp1JPCfEf$->*@2C;d@U^zA|%J+K!tRTJwYA zxWC``E!%6u=&I;y$UHO30(^Ij{}gT#mCig6LoCOW;!NNVgP1JoKbv>&ZeDavI`A># zaA;#V$D?oAd0BZ;X7IupH{$^5B^rkD;KiS};}&y2f`(PM4*Lw=E*~-j6%Qp)FOGRv zk4M#|Rp9X{He~wlyT0V^MTYT@-hZEiHKt#3I)yY#$rQLcJDI=pNLI7K63>jANQPg# zNtVgo{hZ|`%s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vZ2gC4@{{7abljy%HOG>^a_Qw=6GJKp6^Z@vz<(Q+U*f-aN z>0zo!&8Ct#23dGBNi3og98f7#V@ zGXS;`jSL@MM@I5*cu9WA{Y_9(QA*!z|{y0bFp4>8y}#r(jN-YbA*9j zICO%GzYJRZ@2hmz_0vmQz~1lL;~ni8TZijSs;A$L`rnc?UV!?TosRnqj`U*1-mft@ zWpL<1cnXJCf3+ltN#?MT(qL4o0GIPiUE{eJ4ns|unused_15) { // Color 0 is a bitmask for which colors to blend; color 15 is the alt blend color gPlttBufferFaded[index] = gPlttBufferUnfaded[index]; - altBlendIndices = gPlttBufferUnfaded[index] & 0x7FFF; // Note that color 15 will never be light-blended + altBlendIndices = gPlttBufferUnfaded[index] << 1; // bit 0 species color 1, etc. data3 = (struct PlttData *)&gPlttBufferUnfaded[index+15]; if (!data3->unused_15) // use default blend color instead data3 = (struct PlttData *)&defaultBlendColor; From 806b4acda2cba48bf5c3c30a27fc37a7cd3001a7 Mon Sep 17 00:00:00 2001 From: Ariel Antonitis Date: Tue, 16 Mar 2021 21:13:57 -0400 Subject: [PATCH 009/104] Added Lilycove light palettes. --- data/tilesets/headers.inc | 2 +- .../tilesets/secondary/lilycove/metatiles.bin | Bin 5616 -> 5616 bytes .../secondary/lilycove/palettes/06.pal | 24 +++++++++--------- data/tilesets/secondary/lilycove/tiles.png | Bin 3652 -> 3666 bytes 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/data/tilesets/headers.inc b/data/tilesets/headers.inc index c652587a0edc..949799ef4c72 100644 --- a/data/tilesets/headers.inc +++ b/data/tilesets/headers.inc @@ -101,7 +101,7 @@ gTileset_Fortree:: @ 83DF7C4 gTileset_Lilycove:: @ 83DF7DC .byte TRUE @ is compressed .byte TRUE @ is secondary tileset - .2byte 0 @ padding + .2byte 0x01 @ lightPalettes 6 .4byte gTilesetTiles_Lilycove .4byte gTilesetPalettes_Lilycove .4byte gMetatiles_Lilycove diff --git a/data/tilesets/secondary/lilycove/metatiles.bin b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;rxKjI+hiDZjTa?GUkfasuF67@uXBLL914P1#7Ot+*P{KZ8dX6mad}@- z88kts?aij>&LU;_OXDut#)w*jV)Qrzv6cCnoOc0F?!q}@auNaT?;$I`$q*IGi~>)< zSKGl2lds4Y7cyL1!qZm_>q#0)YL?6iGm`K9`hsD@YPA4wO^;`(>oUNQNV7K)4&27b zq)=4gote3b2~hK@osa%Uy58#(5(2@Am%v2w=rVZ=m1`~BraOJ>?~C@9VTPE1NIA3Y zx$4j*M%t2WD!nu1pAASGKs$TK9_N|`$Jvg1l{Lvg zKP5FcXY(|~WqZ5pE+BdYur#6ict)m4pMo^dK-YUn&WIR!-@CgxUZoz7c0VzBb*g8_ z3#{Xyh|&t2ao#f)`CA8G-r$2iD);=-O2OMm^mSUFi2HxCqudG*+4H*_B|=I29*hJDI-(EsMHy)x)-ujx*`tEk_>HKK+aGr;rNYrK6ox?)a{vKh zzMc8Y4}|4KvC{*JFCf^*)c*iwRVQHp From 68068981a4f16a183dd7b329b02777d0de865178 Mon Sep 17 00:00:00 2001 From: Ariel Antonitis Date: Wed, 17 Mar 2021 01:52:07 -0400 Subject: [PATCH 010/104] Fixed TOD & weather fadeout. --- src/field_weather.c | 8 ++++---- src/field_weather_effect.c | 13 +++++++++---- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/field_weather.c b/src/field_weather.c index bfd7f2afa2c7..0b8427c2935a 100644 --- a/src/field_weather.c +++ b/src/field_weather.c @@ -110,8 +110,8 @@ void (*const gWeatherPalStateFuncs[])(void) = { [WEATHER_PAL_STATE_CHANGING_WEATHER] = UpdateWeatherGammaShift, [WEATHER_PAL_STATE_SCREEN_FADING_IN] = FadeInScreenWithWeather, - [WEATHER_PAL_STATE_SCREEN_FADING_OUT] = DoNothing, - [WEATHER_PAL_STATE_IDLE] = DoNothing, + [WEATHER_PAL_STATE_SCREEN_FADING_OUT] = DoNothing, + [WEATHER_PAL_STATE_IDLE] = DoNothing, }; // This table specifies which of the gamma shift tables should be @@ -779,7 +779,7 @@ void FadeScreen(u8 mode, s8 delay) if (fadeOut) { - if (useWeatherPal) + if (TRUE || useWeatherPal) // TODO: Can copying Faded to Unfaded before fadeout cause problems ? CpuFastCopy(gPlttBufferFaded, gPlttBufferUnfaded, 0x400); BeginNormalPaletteFade(PALETTES_ALL, delay, 0, 16, fadeColor); @@ -789,7 +789,7 @@ void FadeScreen(u8 mode, s8 delay) { gWeatherPtr->fadeDestColor = fadeColor; if (useWeatherPal) - gWeatherPtr->fadeScreenCounter = 0; + gWeatherPtr->fadeScreenCounter = 0; else BeginNormalPaletteFade(PALETTES_ALL, delay, 16, 0, fadeColor); diff --git a/src/field_weather_effect.c b/src/field_weather_effect.c index db480772c672..d8eff78b7b48 100644 --- a/src/field_weather_effect.c +++ b/src/field_weather_effect.c @@ -481,6 +481,7 @@ void Rain_InitVars(void) gWeatherPtr->gammaTargetIndex = gTimeOfDay == TIME_OF_DAY_DAY ? 3 : 0; gWeatherPtr->gammaStepDelay = 20; SetRainStrengthFromSoundEffect(SE_RAIN); + Weather_SetBlendCoeffs(8, 12); // preserve shadow darkness } void Rain_InitAll(void) @@ -774,6 +775,7 @@ void Snow_InitVars(void) gWeatherPtr->gammaStepDelay = 20; gWeatherPtr->targetSnowflakeSpriteCount = 16; gWeatherPtr->snowflakeVisibleCounter = 0; + Weather_SetBlendCoeffs(8, 12); // preserve shadow darkness } void Snow_InitAll(void) @@ -1049,6 +1051,7 @@ void Thunderstorm_InitVars(void) gWeatherPtr->weatherGfxLoaded = FALSE; // duplicate assignment gWeatherPtr->thunderTriggered = FALSE; SetRainStrengthFromSoundEffect(SE_THUNDERSTORM); + Weather_SetBlendCoeffs(8, 12); // preserve shadow darkness } void Thunderstorm_InitAll(void) @@ -1077,6 +1080,7 @@ void Downpour_InitVars(void) gWeatherPtr->gammaStepDelay = 20; gWeatherPtr->weatherGfxLoaded = FALSE; // duplicate assignment SetRainStrengthFromSoundEffect(SE_DOWNPOUR); + Weather_SetBlendCoeffs(8, 12); // preserve shadow darkness } void Downpour_InitAll(void) @@ -1525,8 +1529,8 @@ void Ash_InitVars(void) gWeatherPtr->ashUnused = 20; // Never read if (!gWeatherPtr->ashSpritesCreated) { - Weather_SetBlendCoeffs(0, 16); - SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(64, 63)); // These aren't valid blend coefficients! + Weather_SetBlendCoeffs(0, 12); + // SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(64, 63)); // These aren't valid blend coefficients! } } @@ -1553,7 +1557,7 @@ void Ash_Main(void) if (!gWeatherPtr->ashSpritesCreated) CreateAshSprites(); - Weather_SetTargetBlendCoeffs(16, 0, 1); + Weather_SetTargetBlendCoeffs(10, 12, 1); gWeatherPtr->initStep++; break; case 2: @@ -1574,7 +1578,7 @@ bool8 Ash_Finish(void) switch (gWeatherPtr->finishStep) { case 0: - Weather_SetTargetBlendCoeffs(0, 16, 1); + Weather_SetTargetBlendCoeffs(0, 12, 1); gWeatherPtr->finishStep++; break; case 1: @@ -2243,6 +2247,7 @@ void Shade_InitVars(void) gWeatherPtr->initStep = 0; gWeatherPtr->gammaTargetIndex = 3; gWeatherPtr->gammaStepDelay = 20; + Weather_SetBlendCoeffs(8, 12); // preserve shadow darkness } void Shade_InitAll(void) From cd9276c569f10c4d209967b2e13cb5d1db4b7664 Mon Sep 17 00:00:00 2001 From: Ariel Antonitis Date: Wed, 24 Mar 2021 00:34:42 -0400 Subject: [PATCH 011/104] Refactored light metatile caching. --- include/fieldmap.h | 1 + include/overworld.h | 1 - src/fieldmap.c | 21 +++++++++++++++++++++ src/overworld.c | 21 --------------------- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/include/fieldmap.h b/include/fieldmap.h index 5bcbe20ea676..d148fa582469 100644 --- a/include/fieldmap.h +++ b/include/fieldmap.h @@ -12,6 +12,7 @@ #include "main.h" extern struct BackupMapLayout gBackupMapLayout; +extern struct Coords16 gLightMetatiles[32]; u32 MapGridGetMetatileIdAt(int, int); u32 MapGridGetMetatileBehaviorAt(int, int); diff --git a/include/overworld.h b/include/overworld.h index 918a5dcce90f..be7c33ff0317 100644 --- a/include/overworld.h +++ b/include/overworld.h @@ -47,7 +47,6 @@ struct LinkPlayerObjectEvent // Exported RAM declarations extern struct WarpData gLastUsedWarp; extern struct LinkPlayerObjectEvent gLinkPlayerObjectEvents[4]; -extern struct Coords16 gLightMetatiles[32]; extern u16 *gBGTilemapBuffers1; extern u16 *gBGTilemapBuffers2; diff --git a/src/fieldmap.c b/src/fieldmap.c index b3b35a7b08e8..dfa617317694 100644 --- a/src/fieldmap.c +++ b/src/fieldmap.c @@ -30,6 +30,7 @@ EWRAM_DATA struct MapHeader gMapHeader = {0}; EWRAM_DATA struct Camera gCamera = {0}; EWRAM_DATA static struct ConnectionFlags gMapConnectionFlags = {0}; EWRAM_DATA static u32 sFiller = 0; // without this, the next file won't align properly +EWRAM_DATA struct Coords16 gLightMetatiles[32] = {0}; struct BackupMapLayout gBackupMapLayout; @@ -62,6 +63,7 @@ static bool8 IsCoordInIncomingConnectingMap(int coord, int srcMax, int destMax, #define AreCoordsWithinMapGridBounds(x, y) (x >= 0 && x < gBackupMapLayout.width && y >= 0 && y < gBackupMapLayout.height) #define MapGridGetTileAt(x, y) (AreCoordsWithinMapGridBounds(x, y) ? gBackupMapLayout.map[x + gBackupMapLayout.width * y] : MapGridGetBorderTileAt(x, y)) +static void CacheLightMetatiles(void); struct MapHeader const *const GetMapHeaderFromConnection(struct MapConnection *connection) { @@ -73,6 +75,7 @@ void InitMap(void) InitMapLayoutData(&gMapHeader); SetOccupiedSecretBaseEntranceMetatiles(gMapHeader.events); RunOnLoadMapScript(); + CacheLightMetatiles(); } void InitMapFromSavedGame(void) @@ -82,6 +85,7 @@ void InitMapFromSavedGame(void) SetOccupiedSecretBaseEntranceMetatiles(gMapHeader.events); LoadSavedMapView(); RunOnLoadMapScript(); + CacheLightMetatiles(); UpdateTVScreensOnMap(gBackupMapLayout.width, gBackupMapLayout.height); } @@ -378,6 +382,23 @@ u32 MapGridGetMetatileBehaviorAt(int x, int y) return GetBehaviorByMetatileId(metatile) & METATILE_BEHAVIOR_MASK; } +// Caches light metatile coordinates +static void CacheLightMetatiles(void) { // TODO: Better way to dynamically generate lights + u8 i = 0; + s16 x, y; + for (x = 0; x < gBackupMapLayout.width; x++) { + for (y = 0; y < gBackupMapLayout.height; y++) { + if (MapGridGetMetatileBehaviorAt(x, y) == 0x04) { + gLightMetatiles[i].x = x; + gLightMetatiles[i].y = y; + i++; + } + } + } + gLightMetatiles[i].x = -1; + gLightMetatiles[i].y = -1; +} + u8 MapGridGetMetatileLayerTypeAt(int x, int y) { u16 metatile = MapGridGetMetatileIdAt(x, y); diff --git a/src/overworld.c b/src/overworld.c index 5a7ace7b8d0d..6e7542109f67 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -211,7 +211,6 @@ EWRAM_DATA static struct InitialPlayerAvatarState sInitialPlayerAvatarState = {0 EWRAM_DATA static u16 sAmbientCrySpecies = 0; EWRAM_DATA static bool8 sIsAmbientCryWaterMon = FALSE; EWRAM_DATA struct LinkPlayerObjectEvent gLinkPlayerObjectEvents[4] = {0}; -EWRAM_DATA struct Coords16 gLightMetatiles[32] = {0}; // const rom data @@ -601,23 +600,6 @@ struct MapHeader const *const GetDestinationWarpMapHeader(void) return Overworld_GetMapHeaderByGroupAndId(sWarpDestination.mapGroup, sWarpDestination.mapNum); } -// Caches light metatile coordinates -static void CacheLightMetatiles(void) { // TODO: Better way to dynamically generate lights - u8 i = 0; - s16 x, y; - for (x = 0; x < gBackupMapLayout.width; x++) { - for (y = 0; y < gBackupMapLayout.height; y++) { - if (MapGridGetMetatileBehaviorAt(x, y) == 0x04) { - gLightMetatiles[i].x = x; - gLightMetatiles[i].y = y; - i++; - } - } - } - gLightMetatiles[i].x = -1; - gLightMetatiles[i].y = -1; -} - static void LoadCurrentMapData(void) { sLastMapSectionId = gMapHeader.regionMapSectionId; @@ -834,7 +816,6 @@ void LoadMapFromCameraTransition(u8 mapGroup, u8 mapNum) Overworld_ClearSavedMusic(); RunOnTransitionMapScript(); InitMap(); - CacheLightMetatiles(); CopySecondaryTilesetToVramUsingHeap(gMapHeader.mapLayout); LoadSecondaryTilesetPalette(gMapHeader.mapLayout); @@ -1823,7 +1804,6 @@ void CB2_ContinueSavedGame(void) } else { - CacheLightMetatiles(); TryPutTodaysRivalTrainerOnAir(); gFieldCallback = FieldCB_FadeTryShowMapPopup; SetMainCallback1(CB1_Overworld); @@ -1983,7 +1963,6 @@ static bool32 LoadMapInStepsLocal(u8 *state, bool32 a2) (*state)++; break; case 3: - CacheLightMetatiles(); InitObjectEventsLocal(); SetCameraToTrackPlayer(); (*state)++; From 1ebf94af90881d66329cb1d3d1a0eeddbba38557 Mon Sep 17 00:00:00 2001 From: Ariel Antonitis Date: Mon, 5 Apr 2021 18:22:28 -0400 Subject: [PATCH 012/104] Added more Lilycove window lights. --- .../tilesets/secondary/lilycove/metatiles.bin | Bin 5616 -> 5616 bytes .../secondary/lilycove/palettes/06.pal | 4 ++-- data/tilesets/secondary/lilycove/tiles.png | Bin 3666 -> 3674 bytes 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/data/tilesets/secondary/lilycove/metatiles.bin b/data/tilesets/secondary/lilycove/metatiles.bin index 80561055b38b18a57c4251a8eb97c0bb8b30a1f3..15b22292776bcba749ccf955107603eb5fec08fa 100644 GIT binary patch delta 56 zcmeyM{Xu(!0K3ezrfF@=3d}0glcuLFYg*REq%f_CS%FDmM$`19$vW&;xFFI@3e(dz Jb8$T51prRp6IB2J delta 56 zcmeyM{Xu(!0J{v60+R}}0<+4rrfF@4k|-0Q(}lOZ~^Z@CltktR2}k0!|# zioTI^g>)e04CVKI{)gvzJtHy`G7Kth!Pe4@5}mh@>v&uGUs=`@)z*$r#S9CVe{XY_ zad94sKYLPrnycGqlgu3PeIhI+Is$x3`zmFsmeICR20DU=7e-*RZ$NBdk<CtbKP_|h%UZ|J=%|_D{i-dRyqqJAeolV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S2ES6ea!#n`WwUDrCA{8HMpwSW-#=!&WHWi>=L!8LRp*M_N4L%X;YAD+fNt@& zzq^#H0CxYjg=oo(;7K76FKX6|E&p`2DaJ4XW|GmV6Yo2946rbfFHa4@6`kP7?a2cS z{kV^8h?Zp@_~I0KK8AOxLkp|G@#!x5fo6-TsX}It-zgD4Bqu~EjrV>Y z5s+J+3DFJ3AdDphF_04getd;PP}zyIf%N$}UX0!4OlO Date: Mon, 5 Apr 2021 20:21:56 -0400 Subject: [PATCH 013/104] Added Dewford window lights. --- data/tilesets/headers.inc | 2 +- data/tilesets/secondary/dewford/metatiles.bin | Bin 6064 -> 6064 bytes .../secondary/dewford/palettes/12.pal | 24 +++++++++--------- data/tilesets/secondary/dewford/tiles.png | Bin 3810 -> 12295 bytes 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/data/tilesets/headers.inc b/data/tilesets/headers.inc index 949799ef4c72..b9a97c9e4e9b 100644 --- a/data/tilesets/headers.inc +++ b/data/tilesets/headers.inc @@ -35,7 +35,7 @@ gTileset_Rustboro:: @ 83DF734 gTileset_Dewford:: @ 83DF74C .byte TRUE @ is compressed .byte TRUE @ is secondary tileset - .2byte 0 @ padding + .2byte 64 @ lightPalettes 12 .4byte gTilesetTiles_Dewford .4byte gTilesetPalettes_Dewford .4byte gMetatiles_Dewford diff --git a/data/tilesets/secondary/dewford/metatiles.bin b/data/tilesets/secondary/dewford/metatiles.bin index 728d5b6325cf60c959b13ab469249f2c6f39ba6e..d99fd8a3a80be7defee72bc7f5d4d2d9f3f208ea 100644 GIT binary patch delta 24 gcmdm>zd?V)Q%2@P$;T$YV60?5lzMD)3X_j00FD6)q5uE@ delta 24 gcmdm>zd?V)Q%2^X zaB^>EX>4U6ba`-PAZ2)IW&i+q+O3;smSih-h5s`O4FPY40~}aOGtlt$Z6aQ|e%)$m zDXS_oD$Kob%r-!}^I!jY-GA`alFu%e*6XO%^OZ*)aq^)1&)4T?@cDiJ<*E1o-=23r z9!7p9ex}b0^?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fcaae15c7432b7b3e698b8dc3c95cdf257936 Mon Sep 17 00:00:00 2001 From: Ariel Antonitis Date: Mon, 5 Apr 2021 20:39:37 -0400 Subject: [PATCH 014/104] Added Fallarbor window lights. --- data/tilesets/headers.inc | 2 +- .../secondary/fallarbor/palettes/07.pal | 6 +++--- data/tilesets/secondary/fallarbor/tiles.png | Bin 4653 -> 15247 bytes 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/data/tilesets/headers.inc b/data/tilesets/headers.inc index b9a97c9e4e9b..5977020be687 100644 --- a/data/tilesets/headers.inc +++ b/data/tilesets/headers.inc @@ -79,7 +79,7 @@ gTileset_Lavaridge:: @ 83DF794 gTileset_Fallarbor:: @ 83DF7AC .byte TRUE @ is compressed .byte TRUE @ is secondary tileset - .2byte 0 @ padding + .2byte 2 @ lightPalettes 7 .4byte gTilesetTiles_Fallarbor .4byte gTilesetPalettes_Fallarbor .4byte gMetatiles_Fallarbor diff --git a/data/tilesets/secondary/fallarbor/palettes/07.pal b/data/tilesets/secondary/fallarbor/palettes/07.pal index 724a8f09db38..f3a70207315e 100644 --- a/data/tilesets/secondary/fallarbor/palettes/07.pal +++ b/data/tilesets/secondary/fallarbor/palettes/07.pal @@ -1,7 +1,7 @@ JASC-PAL 0100 16 -24 41 82 +0 192 0 222 230 164 180 197 115 148 156 82 @@ -9,11 +9,11 @@ JASC-PAL 131 131 139 98 98 123 65 74 106 -41 49 90 +88 168 168 90 172 172 131 197 222 255 205 82 230 156 49 222 123 32 156 98 41 -115 197 164 +128 192 216 diff --git a/data/tilesets/secondary/fallarbor/tiles.png b/data/tilesets/secondary/fallarbor/tiles.png index 3582d1d030d978025a2de580831db536aa401cf9..06b86ff956176ba4e616b0abb47c930de7c3aee5 100644 GIT binary patch literal 15247 zcmV;AJ8;B_P) zaB^>EX>4U6ba`-PAZ2)IW&i+q+O3>vl3clNh5vIEUIHg@SPsVs@4(CVcbF-)q<;Mz zc35hus#2MEAb>M~xb4n={pWT6!LROHYlM z>+bych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PFmTm`!YYBT9(7=KTFP;qas^n2kYc7#kE4`|O-zXZ|brA&nQZ+Tr9+z^saY zFlR{vtMnfRTy#?vVfhyy%%2SBU&2%>bJzB*$gQ}rSV2`tkVmSPWf zTlHL65<~vt@M5E1_e9%{ZKCwhaQ)XNArNoOoCQ5b2j8k!hICmj{yhim0o}xH;Ampe#A-quiAt75Nv)l0cThuyD z7!>7XBF^c0`ClKheu~FEol6wQ)qz7GU#`mwO=6jz{yJ&M%lO!lXEqnO@n@Kz|6QM4 zbQ#iJE80cXHBp^YSm5JdgNhLc7f>S>3|gqGlgn3NA*c|(0$uZxSmHZOck$E=PG?Uq zjAb49CI!$S+nRwhIv_*?IXB|QMxW}HVK$KF;fT*us|X(BrIbVT<7{3VBB&X~a!Sn` z)k_>6FY*M?XzhfaUH{fQj&Y+9knCB%CeXDE)LAR0&;GC~X>HgZh1$Ms?j#HM z!6$*1F1CUVxJ_!8SIsrYuWSNMTr?By*O~9%7}^m8IsY8d#N+9qOo<$Fb8BPM+BLtH z?ipVPIkK6&D9WpPdqCy6i!6>o6(*+M^rT>)6~wV-$QoJW&W9^C=-N$5*^%ieKQ?f% zlYLMxM}n7b=yQFD)}K<5r1)C<6J}Ss$tcwJ*lGI0n{7+` d|EGB0c-z?>U2!hH?=i;0niVYxmf@_&Y9Oh^C# From dbd86a3cc328c40c9c6e46450782e706f54c29c7 Mon Sep 17 00:00:00 2001 From: Ariel Antonitis Date: Mon, 5 Apr 2021 21:05:39 -0400 Subject: [PATCH 015/104] Added Mossdeep window lights. --- data/tilesets/headers.inc | 2 +- .../secondary/mossdeep/palettes/08.pal | 2 +- .../secondary/mossdeep/palettes/09.pal | 8 ++++---- data/tilesets/secondary/mossdeep/tiles.png | Bin 4111 -> 4115 bytes 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/data/tilesets/headers.inc b/data/tilesets/headers.inc index 5977020be687..dfa58de30afb 100644 --- a/data/tilesets/headers.inc +++ b/data/tilesets/headers.inc @@ -112,7 +112,7 @@ gTileset_Lilycove:: @ 83DF7DC gTileset_Mossdeep:: @ 83DF7F4 .byte TRUE @ is compressed .byte TRUE @ is secondary tileset - .2byte 0 @ padding + .2byte 0 @ lightPalettes 8,9 .4byte gTilesetTiles_Mossdeep .4byte gTilesetPalettes_Mossdeep .4byte gMetatiles_Mossdeep diff --git a/data/tilesets/secondary/mossdeep/palettes/08.pal b/data/tilesets/secondary/mossdeep/palettes/08.pal index 07d79210a74b..34e9db9806ed 100644 --- a/data/tilesets/secondary/mossdeep/palettes/08.pal +++ b/data/tilesets/secondary/mossdeep/palettes/08.pal @@ -1,7 +1,7 @@ JASC-PAL 0100 16 -131 197 98 +0 192 0 255 255 255 205 205 197 180 180 164 diff --git a/data/tilesets/secondary/mossdeep/palettes/09.pal b/data/tilesets/secondary/mossdeep/palettes/09.pal index cee575bae618..818ed6aa0e9c 100644 --- a/data/tilesets/secondary/mossdeep/palettes/09.pal +++ b/data/tilesets/secondary/mossdeep/palettes/09.pal @@ -1,15 +1,15 @@ JASC-PAL 0100 16 -131 197 98 +0 32 0 255 255 255 -139 205 123 -98 172 98 +248 0 248 +248 0 248 65 131 98 123 123 148 98 98 123 65 74 106 -41 49 90 +64 72 104 189 189 197 164 164 156 246 222 156 diff --git a/data/tilesets/secondary/mossdeep/tiles.png b/data/tilesets/secondary/mossdeep/tiles.png index cc4591f8804be4f05f7d9e3de1ef91d110a41c43..3bd134f1a4578eb3aa39f07aa40d661c158a30ae 100644 GIT binary patch delta 3965 zcmWNScRbX60LQ<-8=URTi*WWjTv=zNBT7g}A?p-TwlYH950%H(W0a9j3MI0#$5pbo z%!8^+=huXwb#)_~RQv4}V_FKh@I`{J*r;6RYmrHl?3Y##Y^xB`~uXjI^ z`L6v_bQ|k{n_3=OFE@rqy5CI!KRMBB^61?qbsdv^m-E__zc&ic8g4OctZl}ZEOuR* z!*@nxO#d%Lo3t$*jivsjDZWFZ@50j*A-ss!2IAiy4c%#U>Vp0{S|B;)D>vi1&*Nc_ z{j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xi(2M(I*Pg5*iyV zZU}$&Ku14+#VLsK5#(}Z2qs%p%i0D*o?J|~2{Ozj@7}yC_t4I_G8AOg5l>78d1h(U z@RuM`SWerQGp&ku>mA6Op{>5u(i#|dW+U6PD9h}HZN?#AKnndp(PGRR1tWq$CerKI}| zzr2A#5r?Xu*Yzx$c|Z_nb4gQ-Quk$Q{nnq$`j8b+<1*Q3r}3gj-{@J##1vMzbPew< z`8FVmPNXzIz+NovyNUgeJdbYS`7{F#*z0VkFa{qj4gY40Y2#TtHmNo10V62^K~T@S z=+Wt7lcF@^dJ>$HcOb**1|a3;8{vs-W-=KFM1K@u&;Lb8hSb4(NS3D!^0CuoF!+bF NhUR3>3Ioc6{{y4s3{U_7 From 898a09ff34436579171a44da55170acb4909e180 Mon Sep 17 00:00:00 2001 From: Ariel Antonitis Date: Mon, 5 Apr 2021 21:25:36 -0400 Subject: [PATCH 016/104] Added Sootopolis lights. --- data/tilesets/headers.inc | 2 +- .../secondary/sootopolis/palettes/06.pal | 8 ++++---- data/tilesets/secondary/sootopolis/tiles.png | Bin 2695 -> 13423 bytes 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/data/tilesets/headers.inc b/data/tilesets/headers.inc index dfa58de30afb..9ba29a2f46e4 100644 --- a/data/tilesets/headers.inc +++ b/data/tilesets/headers.inc @@ -145,7 +145,7 @@ gTileset_Pacifidlog:: @ 83DF824 gTileset_Sootopolis:: @ 83DF83C .byte TRUE @ is compressed .byte TRUE @ is secondary tileset - .2byte 0 @ padding + .2byte 0x101 @ lightPalettes 6, customLights 6 .4byte gTilesetTiles_Sootopolis .4byte gTilesetPalettes_Sootopolis .4byte gMetatiles_Sootopolis diff --git a/data/tilesets/secondary/sootopolis/palettes/06.pal b/data/tilesets/secondary/sootopolis/palettes/06.pal index b9e93fa5f026..6bb529da6bf3 100644 --- a/data/tilesets/secondary/sootopolis/palettes/06.pal +++ b/data/tilesets/secondary/sootopolis/palettes/06.pal @@ -1,7 +1,7 @@ JASC-PAL 0100 16 -115 197 164 +0 192 0 255 255 255 238 238 213 222 222 180 @@ -10,10 +10,10 @@ JASC-PAL 98 98 123 65 74 106 41 49 90 -0 0 0 -0 0 0 +64 72 104 +80 88 80 156 164 156 123 131 123 98 106 98 82 90 82 -0 0 0 +248 240 176 diff --git a/data/tilesets/secondary/sootopolis/tiles.png b/data/tilesets/secondary/sootopolis/tiles.png index d27c817f005a35cbf3850b42bc10d5a612b3d1eb..f9a6be2154a278142a6091b064c224a6cb95d9cc 100644 GIT binary patch literal 13423 zcmV-#G?2@QP) zaB^>EX>4U6ba`-PAZ2)IW&i+q+O?c%mL0irr2k_Ty#&m|asUT#PVYd=@6Qm)8mOm| z)aqtdG0B_vMgTsTn>jq_&cFTd>;4zNMrzsR(s~`WdVb}RN1Xhj`|sEHJ^1{7|I177 z?|*yU&0jx>yp;H!zQ5M<^Zv=}<SUH=Y}zM;d&{$cv49I{T{zNCH)`LU2H?)wE_S5({J|kzgCw1G>7{v`}2nSo1K1M59PPl|GaVh+loT`QP zCA|9%-H)4f?z{u@MmnL=jY^$>L zse~GQi?M}(9XtM+tURV17aj=3mAF}D%qdlz)1&UqXIgmgjU|3B11~tDq?#J88EN9I zoJ+3cTPK93E2-pCN-eGQGRmx}=2~j4tqP}R1GHLcwYApUXtSrDd+D{e-uvit#F2op z;zk{9^fAVq+;ry2wI=VMys+X*E3dNZYOAlYrV&1ttyr~Y-G}b1PGi+IP8$LGP_c*wui|HOSEynwCeP=y)q}*<;1yHuzbJEY64Qw&EzurKJt*y^q zX7*I6(~{$cTH**hRr9T^@N+GkIqC|{uX?GBWV!X#eB37xQfH2};=Z$=v~db4GUfqE zEg#(;xbr=`K*>+j9dd*L`-l zMu2^n>01`M*vAay*)uh+l6F}asP~Q-=fyB_(@uD7<2Zfr#5qPht6+#>#7Ag(Ro0qo z;^jcat1;~b(v=bSbfauOQg15w_7I3xmv3o?ZPb^OjP2yzxCTa?tHq;yCA2mctux;h zZQZ>c%UcKg_MKUEz$PaTZr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;v-Mp#$sVs9z=kzu(ab+ zMInlT-|rORRUlen<$stlk{^F|Y4{XT{Bx&L)jTcBGFj-X$}fsCf6B6g>c$#6)eM5pF*mAY;{R^^)eGy{V$iKgkA1Q@E8W0|@Wb$8tz zN@1)pLQA28nrg-n{foJxcdY8JYy#(|Mt_bm4XZPt*2qUH(oTh< z?u-fQG-4D89)Sl|JPq8q#n10nsfO;!u3D^M;ZLE2WoVr{0ssbfDd;*rpOniL0)Xj*Zn;Q5) z#q+HajnSq74S&*36&z-28pvk1_kYf*DvkgN3R!j#VCt+;uwZPEE#dF6IYrH8bS3XP z08lg)9fT_0y@ICND(|mJfNNTyniWhrwgP_@^lUL(KtRPHra~CFhpG3P|6t%A$O;&z zuBZY)3kvjAb=~9uJ^}=+W>o;BKp`b6HNo+>-|d5bRexhSwV<22p<)S-EPvAeJz_gX4$N!QcZX398jhFIV7U0s*(+(%masjG-NsJT=ZnFek&!O;q# z_#8}8&oqxALV#R$hEr;W;Y4yN2Y_QtMKxF6Y6_$sb;lQs>4p;ADuw}n*3I*nKUvP( pKNVXND=tE&JS{pOAp*_c@xSJX;A%&k7PbHY002ovPDHLkV1i-csbc^D From 2f488d685be3ddaad963110e777e3251951700ae Mon Sep 17 00:00:00 2001 From: Ariel Antonitis Date: Mon, 5 Apr 2021 21:41:57 -0400 Subject: [PATCH 017/104] Added Pacifidlog window lights. --- data/tilesets/headers.inc | 2 +- .../secondary/pacifidlog/palettes/09.pal | 4 ++-- data/tilesets/secondary/pacifidlog/tiles.png | Bin 4718 -> 12672 bytes 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/data/tilesets/headers.inc b/data/tilesets/headers.inc index 9ba29a2f46e4..dae108b59a66 100644 --- a/data/tilesets/headers.inc +++ b/data/tilesets/headers.inc @@ -134,7 +134,7 @@ gTileset_EverGrande:: @ 83DF80C gTileset_Pacifidlog:: @ 83DF824 .byte TRUE @ is compressed .byte TRUE @ is secondary tileset - .2byte 0 @ padding + .2byte 8 @ lightPalettes 9 .4byte gTilesetTiles_Pacifidlog .4byte gTilesetPalettes_Pacifidlog .4byte gMetatiles_Pacifidlog diff --git a/data/tilesets/secondary/pacifidlog/palettes/09.pal b/data/tilesets/secondary/pacifidlog/palettes/09.pal index 780f5b0ab6c0..4f27efece10c 100644 --- a/data/tilesets/secondary/pacifidlog/palettes/09.pal +++ b/data/tilesets/secondary/pacifidlog/palettes/09.pal @@ -1,7 +1,7 @@ JASC-PAL 0100 16 -0 0 0 +0 0 128 222 230 164 180 189 123 156 164 98 @@ -16,4 +16,4 @@ JASC-PAL 164 123 24 131 82 49 131 131 139 -82 106 213 +64 72 104 diff --git a/data/tilesets/secondary/pacifidlog/tiles.png b/data/tilesets/secondary/pacifidlog/tiles.png index 9fe620e1efc7e2ae908f7e145b15500e0048d378..31f78891d4898aabd5c2912e963d9bf1c56d19c1 100644 GIT binary patch literal 12672 zcmV-`F@Mg9P) zaB^>EX>4U6ba`-PAZ2)IW&i+q+O3;uavV95h5zFeeFW?d90#k}++dF1-$PQ=(p6>F zVU$v#?at)5@G=N<}??}_i}^AGiWy?^j}`S}6MU$4*KUw5`XKg9NRp|5}7!tYnoo%QqnTG7{qQvAFg zzW(m|*9S)ZWjkMg;`+Mm*Tw(*dp3fx3)f50#gjtv?`!;q6MtJ#h~IaPzpkk7(EYE!eu>|` zyWM*}yBoPW!d1UE^S>$R3F_P7XoApHCeH=0X5?bOK1B6EqCe$2od)#EG8r};A==F)Zi^f3xPN` z@-tX@OgT<65Q-~tv&xuLswAgH-J8!?c<+rReqIJ%NJL3B8L8=MkgS|buJl`@goZ1r z^DVbtyY2QnzOxp-+V;1s{h7Ic&RY1&T6~Gp`|M}dc-id7C4%6jC}(6W=0L_x z8K9t}a^_peIVy9?neQ>V1a7g)qU7wLjFG{7LM%6Y=k90b{x)xp=>E5Pi+`0lr_}v_ zWX>sdzhv$|^Y#~6+vCA)dI?e&5>pT|(SE#X#M#$8JI6dPckV6jXtlKC6ITYkDs3H= z5?-{m8^}UVS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@s#Qfk<_QL3fH2%IGKON)X%+Fuxwts)$&`-zQegAJ4I`aO`7{G+5mLca= zp80v<4u3qg4!J2+JZL;x`rC!B+>b{4$!LQLQ(&j8avlqoim!A!J9WrSk#`?7-nR>5 z8`9|evU>7!Yy+^~n907XY{xdZy}jLC%VsYaTk`&`ae%TP+hOL;F3ts6ZM$fPokth& zoa0sbSEtd@ss1xmLq8q!%>O=)<^uV2$PXS}z<;t8d3qHcAFI=>tnsR4{q%+P)BhRs zk8{@Sb?Y@_7!+)2b0x2? zGY36vmkVP6YmrqJ^R1P|YGZ|7i9%n4%m157NulPbHo_1^@s607*qoM6N<$f?C{M AYybcN From 3c52e9b7ca466456eb1f71322f8aeac70c556e2d Mon Sep 17 00:00:00 2001 From: Ariel Antonitis Date: Mon, 5 Apr 2021 22:52:47 -0400 Subject: [PATCH 018/104] Experimental TOD tint. --- include/palette.h | 1 + src/palette.c | 56 +++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 55 insertions(+), 2 deletions(-) diff --git a/include/palette.h b/include/palette.h index f9bd20560de4..0be99d3c648b 100644 --- a/include/palette.h +++ b/include/palette.h @@ -77,6 +77,7 @@ void BlendPalettes(u32 selectedPalettes, u8 coeff, u16 color); void BlendPalettesUnfaded(u32, u8, u16); void BlendPalettesGradually(u32 selectedPalettes, s8 delay, u8 coeff, u8 coeffTarget, u16 color, u8 priority, u8 id); void TimeBlendPalette(u16 palOffset, u16 numEntries, u8 coeff, u16 blendColor); +void TintPalette_RGB_Copy(u16 palOffset, u16 numEntries, u8 coeff, u16 blendColor); void TimeBlendPalettes(u32 palettes, u8 coeff, u16 color); void TintPalette_GrayScale(u16 *palette, u16 count); void TintPalette_GrayScale2(u16 *palette, u16 count); diff --git a/src/palette.c b/src/palette.c index 3d57136f886d..34cf0286da89 100644 --- a/src/palette.c +++ b/src/palette.c @@ -978,10 +978,12 @@ void BlendPalettes(u32 selectedPalettes, u8 coeff, u16 color) } } +#define DEFAULT_LIGHT_COLOR 0x3f9f + // Like BlendPalette, but ignores blendColor if the transparency high bit is set void TimeBlendPalette(u16 palOffset, u16 numEntries, u8 coeff, u16 blendColor) { u16 i; - u16 defaultBlendColor = 0x3f9f; + u16 defaultBlendColor = DEFAULT_LIGHT_COLOR; s8 r, g, b; struct PlttData *data2 = (struct PlttData *)&blendColor; struct PlttData *data3; @@ -993,7 +995,7 @@ void TimeBlendPalette(u16 palOffset, u16 numEntries, u8 coeff, u16 blendColor) { if (i == 0) { if (data1->unused_15) { // Color 0 is a bitmask for which colors to blend; color 15 is the alt blend color gPlttBufferFaded[index] = gPlttBufferUnfaded[index]; - altBlendIndices = gPlttBufferUnfaded[index] << 1; // bit 0 species color 1, etc. + altBlendIndices = gPlttBufferUnfaded[index] << 1; // bit 0 specifies color 1, etc. data3 = (struct PlttData *)&gPlttBufferUnfaded[index+15]; if (!data3->unused_15) // use default blend color instead data3 = (struct PlttData *)&defaultBlendColor; @@ -1119,6 +1121,56 @@ void TintPalette_CustomTone(u16 *palette, u16 count, u16 rTone, u16 gTone, u16 b } } +// Tints from Unfaded to Faded, using a 15-bit GBA color +void TintPalette_RGB_Copy(u16 palOffset, u16 numEntries, u8 coeff, u16 blendColor) { + u16 rTone, gTone, bTone; + u16 defaultBlendColor = DEFAULT_LIGHT_COLOR; + s32 r, g, b, i; + u32 gray; + struct PlttData *data2 = (struct PlttData *)&blendColor; + struct PlttData *data3; + struct PlttData *blendData; + u16 altBlendIndices = 0; + u16* palette = &gPlttBufferUnfaded[palOffset]; + for (i = 0; i < numEntries; i++) { + u16 index = i + palOffset; + struct PlttData *data1 = (struct PlttData *)palette; + if (i == 0) { + if (data1->unused_15) { // Color 0 is a bitmask for which colors to blend; color 15 is the alt blend color + gPlttBufferFaded[index] = gPlttBufferUnfaded[index]; + altBlendIndices = gPlttBufferUnfaded[index] << 1; // bit 0 specifies color 1, etc. + data3 = (struct PlttData *)&gPlttBufferUnfaded[index+15]; + if (!data3->unused_15) // use default blend color instead + data3 = (struct PlttData *)&defaultBlendColor; + } + palette++; + continue; + } + blendData = (altBlendIndices && altBlendIndices & (1 << i)) ? data3 : data2; + rTone = blendData->r << 3; + gTone = blendData->g << 3; + bTone = blendData->b << 3; + + r = GET_R(*palette); + g = GET_G(*palette); + b = GET_B(*palette); + gray = (r * Q_8_8(0.3) + g * Q_8_8(0.59) + b * Q_8_8(0.1133)) >> 8; + r = (u16)((rTone * gray)) >> 8; + g = (u16)((gTone * gray)) >> 8; + b = (u16)((bTone * gray)) >> 8; + + if (r > 31) + r = 31; + if (g > 31) + g = 31; + if (b > 31) + b = 31; + + gPlttBufferFaded[index] = RGB2(r, g, b); + palette++; + } +} + #define tCoeff data[0] #define tCoeffTarget data[1] #define tCoeffDelta data[2] From e11d050423d13abe773d38716c69628e582b38fd Mon Sep 17 00:00:00 2001 From: Ariel Antonitis Date: Tue, 6 Apr 2021 01:02:37 -0400 Subject: [PATCH 019/104] Added weighted palette average. --- include/palette.h | 1 + src/overworld.c | 13 +++++++++++-- src/palette.c | 29 +++++++++++++++++++++++++++++ 3 files changed, 41 insertions(+), 2 deletions(-) diff --git a/include/palette.h b/include/palette.h index 0be99d3c648b..406f56b84af8 100644 --- a/include/palette.h +++ b/include/palette.h @@ -76,6 +76,7 @@ void BeginHardwarePaletteFade(u8, u8, u8, u8, u8); void BlendPalettes(u32 selectedPalettes, u8 coeff, u16 color); void BlendPalettesUnfaded(u32, u8, u16); void BlendPalettesGradually(u32 selectedPalettes, s8 delay, u8 coeff, u8 coeffTarget, u16 color, u8 priority, u8 id); +void AveragePalettes(u16 *palette0, u16* palette1, u16* dest, u16 weight); void TimeBlendPalette(u16 palOffset, u16 numEntries, u8 coeff, u16 blendColor); void TintPalette_RGB_Copy(u16 palOffset, u16 numEntries, u8 coeff, u16 blendColor); void TimeBlendPalettes(u32 palettes, u8 coeff, u16 color); diff --git a/src/overworld.c b/src/overworld.c index 6e7542109f67..cd1a1df966f9 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -1496,7 +1496,8 @@ static bool8 FadePalettesWithTime(void) { void UpdatePalettesWithTime(u32 palettes) { // Only blend if not transitioning between times and the map type allows if (gTimeOfDayState == 0 && MapHasNaturalLight(gMapHeader.mapType)) { - u8 i; + u8 i, j; + u16 tempPaletteBuffer[16]; for (i = 0; i < 16; i++) { if (GetSpritePaletteTagByPaletteNum(i) & 0x8000) // Don't blend special sprite palette tags palettes &= ~(1 << (i + 16)); @@ -1505,7 +1506,15 @@ void UpdatePalettesWithTime(u32 palettes) { gTimeOfDay = min(TIME_OF_DAY_MAX, gTimeOfDay); if (!palettes) return; - TimeBlendPalettes(palettes, sTimeOfDayBlendVars[gTimeOfDay].coeff, sTimeOfDayBlendVars[gTimeOfDay].blendColor); + for (i = 0; palettes; i++) { + if (palettes & 1) { + TimeBlendPalette(i*16, 16, sTimeOfDayBlendVars[gTimeOfDay].coeff, sTimeOfDayBlendVars[gTimeOfDay].blendColor); + CpuFastCopy(&gPlttBufferFaded[i*16], tempPaletteBuffer, 32); + TimeBlendPalette(i*16, 16, sTimeOfDayBlendVars[TIME_OF_DAY_TWILIGHT].coeff, sTimeOfDayBlendVars[TIME_OF_DAY_TWILIGHT].blendColor); + AveragePalettes(tempPaletteBuffer, &gPlttBufferFaded[i*16], &gPlttBufferFaded[i*16], 256); + } + palettes >>= 1; + } } } diff --git a/src/palette.c b/src/palette.c index 34cf0286da89..a285a48257b7 100644 --- a/src/palette.c +++ b/src/palette.c @@ -978,6 +978,35 @@ void BlendPalettes(u32 selectedPalettes, u8 coeff, u16 color) } } +// Computes a weighted average of two palettes, as (p0*weight + (256-weight)*p1)/256 +void AveragePalettes(u16 *palette0, u16* palette1, u16* dest, u16 weight) { + u8 i; + u32 tempColor; + u16 r0, g0, b0, r1, g1, b1, r, g, b; + u16 color0, color1, destColor; + *dest++ = *palette0++; // Copy palette0's transparency color as is + palette1++; + for (i = 1; i < 16; i++) { // Skip transparent color + color0 = *palette0++; + color1 = *palette1++; + r0 = color0 & 0x1F; + g0 = (color0 >> 5) & 0x1F; + b0 = (color0 >> 10) & 0x1F; + r1 = color1 & 0x1F; + g1 = (color1 >> 5) & 0x1F; + b1 = (color1 >> 10) & 0x1F; + r = (weight*r0 + (256-weight)*r1) >> 8; + g = (weight*g0 + (256-weight)*g1) >> 8; + b = (weight*b0 + (256-weight)*b1) >> 8; + r = r > 31 ? 31 : r; + g = g > 31 ? 31 : g; + b = b > 31 ? 31 : b; + destColor = (color0 | color1) & 0x8000; + destColor += r + (g << 5) + (b << 10); + *dest++ = destColor; + } +} + #define DEFAULT_LIGHT_COLOR 0x3f9f // Like BlendPalette, but ignores blendColor if the transparency high bit is set From 3bd46b5b7aa4ee0add0f2d1e145e91c9087befb3 Mon Sep 17 00:00:00 2001 From: Ariel Antonitis Date: Sun, 18 Apr 2021 01:40:14 -0400 Subject: [PATCH 020/104] Fixed bug in MapHasNaturalLight for ocean routes. --- src/overworld.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/overworld.c b/src/overworld.c index cd1a1df966f9..0ac310e6535c 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -1481,7 +1481,8 @@ u8 UpdateTimeOfDay(void) { } static bool8 MapHasNaturalLight(u8 mapType) { // Weather a map type is naturally lit/outside - return mapType == MAP_TYPE_TOWN || mapType == MAP_TYPE_CITY || mapType == MAP_TYPE_ROUTE; + return mapType == MAP_TYPE_TOWN || mapType == MAP_TYPE_CITY || mapType == MAP_TYPE_ROUTE + || mapType == MAP_TYPE_OCEAN_ROUTE; } static bool8 FadePalettesWithTime(void) { From 22c429d0d6dc5c823b55e88c764be71b51d0db76 Mon Sep 17 00:00:00 2001 From: Ariel Antonitis Date: Mon, 19 Apr 2021 00:07:42 -0400 Subject: [PATCH 021/104] Added inter-time-of-day blending. --- include/overworld.h | 6 ++ include/palette.h | 4 +- src/overworld.c | 69 ++++++++++++++++---- src/palette.c | 154 +++++++++++++++++++++++++++++++++----------- 4 files changed, 181 insertions(+), 52 deletions(-) diff --git a/include/overworld.h b/include/overworld.h index be7c33ff0317..2180a87a9b9c 100644 --- a/include/overworld.h +++ b/include/overworld.h @@ -44,6 +44,12 @@ struct LinkPlayerObjectEvent u8 movementMode; }; +struct __attribute__((packed)) TimeBlendSettings { + u16 weight:9; + u16 time1:3; + u16 time0:3; +}; + // Exported RAM declarations extern struct WarpData gLastUsedWarp; extern struct LinkPlayerObjectEvent gLinkPlayerObjectEvents[4]; diff --git a/include/palette.h b/include/palette.h index 406f56b84af8..a9e6cd7671ba 100644 --- a/include/palette.h +++ b/include/palette.h @@ -77,9 +77,9 @@ void BlendPalettes(u32 selectedPalettes, u8 coeff, u16 color); void BlendPalettesUnfaded(u32, u8, u16); void BlendPalettesGradually(u32 selectedPalettes, s8 delay, u8 coeff, u8 coeffTarget, u16 color, u8 priority, u8 id); void AveragePalettes(u16 *palette0, u16* palette1, u16* dest, u16 weight); -void TimeBlendPalette(u16 palOffset, u16 numEntries, u8 coeff, u16 blendColor); +void TimeBlendPalette(u16 palOffset, u32 coeff, u32 blendColor); void TintPalette_RGB_Copy(u16 palOffset, u16 numEntries, u8 coeff, u16 blendColor); -void TimeBlendPalettes(u32 palettes, u8 coeff, u16 color); +void TimeBlendPalettes(u32 palettes, u32 coeff, u32 blendColor); void TintPalette_GrayScale(u16 *palette, u16 count); void TintPalette_GrayScale2(u16 *palette, u16 count); void TintPalette_SepiaTone(u16 *palette, u16 count); diff --git a/src/overworld.c b/src/overworld.c index 0ac310e6535c..6c7196a515af 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -186,7 +186,9 @@ static u16 (*sPlayerKeyInterceptCallback)(u32); static bool8 sReceivingFromLink; static u8 sRfuKeepAliveTimer; -u8 static gTimeOfDayState; +static u8 gTimeOfDayState; +static u8 timeCounter; +static struct TimeBlendSettings currentTimeBlend; // IWRAM common u16 *gBGTilemapBuffers1; @@ -1472,12 +1474,39 @@ static const struct TimeOfDayBlend sTimeOfDayBlendVars[] = }; u8 UpdateTimeOfDay(void) { + s8 hours, minutes; RtcCalcLocalTime(); - if (gLocalTime.hours >= 20 || gLocalTime.hours < 4) - return gTimeOfDay = TIME_OF_DAY_NIGHT; - else if (gLocalTime.hours >= 10 && gLocalTime.hours < 20) + hours = gLocalTime.hours; + minutes = gLocalTime.minutes; + if (hours >= 22 || hours < 4) { + currentTimeBlend.weight = 256; + return gTimeOfDay = currentTimeBlend.time0 = currentTimeBlend.time1 = TIME_OF_DAY_NIGHT; + } else if (hours >= 4 && hours < 7) { // night->twilight + currentTimeBlend.time0 = TIME_OF_DAY_NIGHT; + currentTimeBlend.time1 = TIME_OF_DAY_TWILIGHT; + currentTimeBlend.weight = 256 - 256 * ((hours - 4) * 60 + minutes) / ((7-4)*60); + return gTimeOfDay = TIME_OF_DAY_DAY; + } else if (hours >= 7 && hours < 10) { // twilight->day + currentTimeBlend.time0 = TIME_OF_DAY_TWILIGHT; + currentTimeBlend.time1 = TIME_OF_DAY_DAY; + currentTimeBlend.weight = 256 - 256 * ((hours - 7) * 60 + minutes) / ((10-7)*60); return gTimeOfDay = TIME_OF_DAY_DAY; - return gTimeOfDay = TIME_OF_DAY_TWILIGHT; + } else if (hours >= 10 && hours < 18) { // day + currentTimeBlend.weight = 256; + return gTimeOfDay = currentTimeBlend.time0 = currentTimeBlend.time1 = TIME_OF_DAY_DAY; + } else if (hours >= 18 && hours < 20) { // day->twilight + currentTimeBlend.time0 = TIME_OF_DAY_DAY; + currentTimeBlend.time1 = TIME_OF_DAY_TWILIGHT; + currentTimeBlend.weight = 256 - 256 * ((hours - 18) * 60 + minutes) / ((20-18)*60); + return gTimeOfDay = TIME_OF_DAY_TWILIGHT; + } else if (hours >= 20 && hours < 22) { // twilight->night + currentTimeBlend.time0 = TIME_OF_DAY_TWILIGHT; + currentTimeBlend.time1 = TIME_OF_DAY_NIGHT; + currentTimeBlend.weight = 256 - 256 * ((hours - 20) * 60 + minutes) / ((22-20)*60); + return gTimeOfDay = TIME_OF_DAY_NIGHT; + } else { // This should never occur + return TIME_OF_DAY_MAX; + } } static bool8 MapHasNaturalLight(u8 mapType) { // Weather a map type is naturally lit/outside @@ -1485,7 +1514,7 @@ static bool8 MapHasNaturalLight(u8 mapType) { // Weather a map type is naturally || mapType == MAP_TYPE_OCEAN_ROUTE; } -static bool8 FadePalettesWithTime(void) { +static bool8 FadePalettesWithTime(void) { // Only used to fade back in gTimeOfDayState = 0; gTimeOfDay = UpdateTimeOfDay(); if (MapHasNaturalLight(gMapHeader.mapType)) { @@ -1495,8 +1524,7 @@ static bool8 FadePalettesWithTime(void) { } void UpdatePalettesWithTime(u32 palettes) { - // Only blend if not transitioning between times and the map type allows - if (gTimeOfDayState == 0 && MapHasNaturalLight(gMapHeader.mapType)) { + if (MapHasNaturalLight(gMapHeader.mapType)) { u8 i, j; u16 tempPaletteBuffer[16]; for (i = 0; i < 16; i++) { @@ -1509,10 +1537,14 @@ void UpdatePalettesWithTime(u32 palettes) { return; for (i = 0; palettes; i++) { if (palettes & 1) { - TimeBlendPalette(i*16, 16, sTimeOfDayBlendVars[gTimeOfDay].coeff, sTimeOfDayBlendVars[gTimeOfDay].blendColor); + TimeBlendPalette(i*16, sTimeOfDayBlendVars[currentTimeBlend.time0].coeff, sTimeOfDayBlendVars[currentTimeBlend.time0].blendColor); + if (currentTimeBlend.weight == 256) { + palettes >>= 1; + continue; + } CpuFastCopy(&gPlttBufferFaded[i*16], tempPaletteBuffer, 32); - TimeBlendPalette(i*16, 16, sTimeOfDayBlendVars[TIME_OF_DAY_TWILIGHT].coeff, sTimeOfDayBlendVars[TIME_OF_DAY_TWILIGHT].blendColor); - AveragePalettes(tempPaletteBuffer, &gPlttBufferFaded[i*16], &gPlttBufferFaded[i*16], 256); + TimeBlendPalette(i*16, sTimeOfDayBlendVars[currentTimeBlend.time1].coeff, sTimeOfDayBlendVars[currentTimeBlend.time1].blendColor); + AveragePalettes(tempPaletteBuffer, &gPlttBufferFaded[i*16], &gPlttBufferFaded[i*16], currentTimeBlend.weight); } palettes >>= 1; } @@ -1535,6 +1567,19 @@ static void OverworldBasic(void) UpdatePaletteFade(); UpdateTilesetAnimations(); DoScheduledBgTilemapCopiesToVram(); + if (!(gPaletteFade.active || (timeCounter++ % 60))) { + struct TimeBlendSettings cachedBlend = { + .time0 = currentTimeBlend.time0, + .time1 = currentTimeBlend.time1, + .weight = currentTimeBlend.weight, + }; + timeCounter = 0; + UpdateTimeOfDay(); + if (cachedBlend.time0 != currentTimeBlend.time0 + || cachedBlend.time1 != currentTimeBlend.time1 + || cachedBlend.weight != currentTimeBlend.weight) + UpdatePalettesWithTime(0xFFFFFFFF); + } } // This CB2 is used when starting @@ -1545,9 +1590,7 @@ void CB2_OverworldBasic(void) void CB2_Overworld(void) { - u32 *debugPtr = (u32*) 0x0203de00; bool32 fading = (gPaletteFade.active != 0); - *debugPtr = (u32) &gTimeOfDay; if (fading) SetVBlankCallback(NULL); OverworldBasic(); diff --git a/src/palette.c b/src/palette.c index a285a48257b7..ff5f2106060a 100644 --- a/src/palette.c +++ b/src/palette.c @@ -496,13 +496,13 @@ static u8 UpdateTimeOfDayPaletteFade(void) if (gPaletteFade.yDec) { if (gPaletteFade.objPaletteToggle) { // sprite palettes if (gPaletteFade.y >= gPaletteFade.targetY || GetSpritePaletteTagByPaletteNum(paletteNum) & 0x8000) - TimeBlendPalette(paletteOffset, 16, gPaletteFade.y, gPaletteFade.blendColor); + TimeBlendPalette(paletteOffset, gPaletteFade.y, gPaletteFade.blendColor); // tile palettes } else if (gPaletteFade.y >= gPaletteFade.targetY || (paletteNum >= 13 && paletteNum <= 15)) { - TimeBlendPalette(paletteOffset, 16, gPaletteFade.y, gPaletteFade.blendColor); + TimeBlendPalette(paletteOffset, gPaletteFade.y, gPaletteFade.blendColor); } } else { - TimeBlendPalette(paletteOffset, 16, gPaletteFade.y, gPaletteFade.blendColor); + TimeBlendPalette(paletteOffset, gPaletteFade.y, gPaletteFade.blendColor); } } } @@ -1010,45 +1010,125 @@ void AveragePalettes(u16 *palette0, u16* palette1, u16* dest, u16 weight) { #define DEFAULT_LIGHT_COLOR 0x3f9f // Like BlendPalette, but ignores blendColor if the transparency high bit is set -void TimeBlendPalette(u16 palOffset, u16 numEntries, u8 coeff, u16 blendColor) { - u16 i; - u16 defaultBlendColor = DEFAULT_LIGHT_COLOR; - s8 r, g, b; - struct PlttData *data2 = (struct PlttData *)&blendColor; - struct PlttData *data3; - struct PlttData *blendData; - u16 altBlendIndices = 0; - for (i = 0; i < numEntries; i++) { - u16 index = i + palOffset; - struct PlttData *data1 = (struct PlttData *)&gPlttBufferUnfaded[index]; - if (i == 0) { - if (data1->unused_15) { // Color 0 is a bitmask for which colors to blend; color 15 is the alt blend color - gPlttBufferFaded[index] = gPlttBufferUnfaded[index]; - altBlendIndices = gPlttBufferUnfaded[index] << 1; // bit 0 specifies color 1, etc. - data3 = (struct PlttData *)&gPlttBufferUnfaded[index+15]; - if (!data3->unused_15) // use default blend color instead - data3 = (struct PlttData *)&defaultBlendColor; - } - continue; +// Optimization help by lucktyphlosion +void TimeBlendPalette(u16 palOffset, u32 coeff, u32 blendColor) { + s32 newR, newG, newB, defR, defG, defB; + u16 * palDataSrc = gPlttBufferUnfaded + palOffset; + u16 * palDataDst = gPlttBufferFaded + palOffset; + u32 defaultBlendColor = DEFAULT_LIGHT_COLOR; + u16 *palDataSrcEnd = palDataSrc + 16; + u16 altBlendIndices = *palDataDst++ = *palDataSrc++; // color 0 is copied through unchanged + u32 altBlendColor; + + coeff *= 2; + newR = (blendColor << 27) >> 27; + newG = (blendColor << 22) >> 27; + newB = (blendColor << 17) >> 27; + + if (altBlendIndices >> 15) { // High bit set; bitmask of which colors to alt-blend + // Note that bit 0 of altBlendIndices specifies color 1 + altBlendColor = palDataSrc[14]; // color 15 + if (altBlendColor >> 15) { // Set alternate blend color + defR = (altBlendColor << 27) >> 27; + defG = (altBlendColor << 22) >> 27; + defB = (altBlendColor << 17) >> 27; + } else { // Set default blend color + defR = (defaultBlendColor << 27) >> 27; + defG = (defaultBlendColor << 22) >> 27; + defB = (defaultBlendColor << 17) >> 27; } - r = data1->r; - g = data1->g; - b = data1->b; - blendData = (altBlendIndices && altBlendIndices & (1 << i)) ? data3 : data2; - gPlttBufferFaded[index] = RGB(r + (((blendData->r - r) * coeff) >> 4), - g + (((blendData->g - g) * coeff) >> 4), - b + (((blendData->b - b) * coeff) >> 4)); + } else { + altBlendIndices = 0; + } + while (palDataSrc != palDataSrcEnd) { + u32 palDataSrcColor = *palDataSrc; + s32 r = (palDataSrcColor << 27) >> 27; + s32 g = (palDataSrcColor << 22) >> 27; + s32 b = (palDataSrcColor << 17) >> 27; + + if (altBlendIndices & 1) { + *palDataDst = ((r + (((defR - r) * coeff) >> 5)) << 0) + | ((g + (((defG - g) * coeff) >> 5)) << 5) + | ((b + (((defB - b) * coeff) >> 5)) << 10); + } else { // Use provided blend color + *palDataDst = ((r + (((newR - r) * coeff) >> 5)) << 0) + | ((g + (((newG - g) * coeff) >> 5)) << 5) + | ((b + (((newB - b) * coeff) >> 5)) << 10); + } + palDataSrc++; + palDataDst++; + altBlendIndices >>= 1; } } -// Apply time effect to a series of palettes -void TimeBlendPalettes(u32 palettes, u8 coeff, u16 color) { - u16 paletteOffset; - for (paletteOffset = 0; palettes; paletteOffset += 16) { - if (palettes & 1) - TimeBlendPalette(paletteOffset, 16, coeff, color); +void TimeBlendPalettes(u32 palettes, u32 coeff, u32 blendColor) { + s32 newR, newG, newB, defR, defG, defB, altR, altG, altB; + u16 * palDataSrc; + u16 * palDataDst; + u32 defaultBlendColor = DEFAULT_LIGHT_COLOR; + + if (!palettes) + return; + + coeff *= 2; + newR = (blendColor << 27) >> 27; + newG = (blendColor << 22) >> 27; + newB = (blendColor << 17) >> 27; + defR = (defaultBlendColor << 27) >> 27; + defG = (defaultBlendColor << 22) >> 27; + defB = (defaultBlendColor << 17) >> 27; + palDataSrc = gPlttBufferUnfaded; + palDataDst = gPlttBufferFaded; + + do { + if (palettes & 1) { + u16 *palDataSrcEnd = palDataSrc + 16; + u16 altBlendIndices = *palDataDst++ = *palDataSrc++; // color 0 is copied through + u32 altBlendColor; + if (altBlendIndices >> 15) { // High bit set; bitmask of which colors to alt-blend + // Note that bit 0 of altBlendIndices specifies color 1 + altBlendColor = palDataSrc[14]; // color 15 + if (altBlendColor >> 15) { // Set alternate blend color + altR = (altBlendColor << 27) >> 27; + altG = (altBlendColor << 22) >> 27; + altB = (altBlendColor << 17) >> 27; + } else { + altBlendColor = 0; + } + } else { + altBlendIndices = 0; + } + while (palDataSrc != palDataSrcEnd) { + u32 palDataSrcColor = *palDataSrc; + s32 r = (palDataSrcColor << 27) >> 27; + s32 g = (palDataSrcColor << 22) >> 27; + s32 b = (palDataSrcColor << 17) >> 27; + + if (altBlendIndices & 1) { + if (altBlendColor) { // Use alternate blend color + *palDataDst = ((r + (((altR - r) * coeff) >> 5)) << 0) + | ((g + (((altG - g) * coeff) >> 5)) << 5) + | ((b + (((altB - b) * coeff) >> 5)) << 10); + } else { // Use default blend color + *palDataDst = ((r + (((defR - r) * coeff) >> 5)) << 0) + | ((g + (((defG - g) * coeff) >> 5)) << 5) + | ((b + (((defB - b) * coeff) >> 5)) << 10); + } + } else { // Use provided blend color + *palDataDst = ((r + (((newR - r) * coeff) >> 5)) << 0) + | ((g + (((newG - g) * coeff) >> 5)) << 5) + | ((b + (((newB - b) * coeff) >> 5)) << 10); + } + palDataSrc++; + palDataDst++; + altBlendIndices >>= 1; + } + } else { + palDataSrc += 16; + palDataDst += 16; + } palettes >>= 1; - } + } while (palettes); } void BlendPalettesUnfaded(u32 selectedPalettes, u8 coeff, u16 color) From def9d39fbb7a62e0d6cd7501aa07964e212f1c6f Mon Sep 17 00:00:00 2001 From: Ariel Antonitis Date: Mon, 19 Apr 2021 19:59:26 -0400 Subject: [PATCH 022/104] Testing evening tint. --- include/palette.h | 2 +- src/overworld.c | 17 +++++++--- src/palette.c | 82 +++++++++++++++++++++++++---------------------- 3 files changed, 57 insertions(+), 44 deletions(-) diff --git a/include/palette.h b/include/palette.h index a9e6cd7671ba..071af1c12ce1 100644 --- a/include/palette.h +++ b/include/palette.h @@ -78,7 +78,7 @@ void BlendPalettesUnfaded(u32, u8, u16); void BlendPalettesGradually(u32 selectedPalettes, s8 delay, u8 coeff, u8 coeffTarget, u16 color, u8 priority, u8 id); void AveragePalettes(u16 *palette0, u16* palette1, u16* dest, u16 weight); void TimeBlendPalette(u16 palOffset, u32 coeff, u32 blendColor); -void TintPalette_RGB_Copy(u16 palOffset, u16 numEntries, u8 coeff, u16 blendColor); +void TintPalette_RGB_Copy(u16 palOffset, u32 blendColor); void TimeBlendPalettes(u32 palettes, u32 coeff, u32 blendColor); void TintPalette_GrayScale(u16 *palette, u16 count); void TintPalette_GrayScale2(u16 *palette, u16 count); diff --git a/src/overworld.c b/src/overworld.c index 6c7196a515af..8b07124366cb 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -1462,14 +1462,15 @@ void CB1_Overworld(void) } struct TimeOfDayBlend { - u8 coeff:4; - u16 blendColor; + u8 coeff:5; + u16 blendColor:15; + u16 isTint:1; }; static const struct TimeOfDayBlend sTimeOfDayBlendVars[] = { [TIME_OF_DAY_NIGHT] = {.coeff = 10, .blendColor = 0x1400}, - [TIME_OF_DAY_TWILIGHT] = {.coeff = 4, .blendColor = 0x155D}, + [TIME_OF_DAY_TWILIGHT] = {.coeff = 4, .blendColor = 0x56dc, .isTint = TRUE}, [TIME_OF_DAY_DAY] = {.coeff = 0, .blendColor = 0}, }; @@ -1537,13 +1538,19 @@ void UpdatePalettesWithTime(u32 palettes) { return; for (i = 0; palettes; i++) { if (palettes & 1) { - TimeBlendPalette(i*16, sTimeOfDayBlendVars[currentTimeBlend.time0].coeff, sTimeOfDayBlendVars[currentTimeBlend.time0].blendColor); + if (sTimeOfDayBlendVars[currentTimeBlend.time0].isTint) + TintPalette_RGB_Copy(i*16, sTimeOfDayBlendVars[currentTimeBlend.time0].blendColor); + else + TimeBlendPalette(i*16, sTimeOfDayBlendVars[currentTimeBlend.time0].coeff, sTimeOfDayBlendVars[currentTimeBlend.time0].blendColor); if (currentTimeBlend.weight == 256) { palettes >>= 1; continue; } CpuFastCopy(&gPlttBufferFaded[i*16], tempPaletteBuffer, 32); - TimeBlendPalette(i*16, sTimeOfDayBlendVars[currentTimeBlend.time1].coeff, sTimeOfDayBlendVars[currentTimeBlend.time1].blendColor); + if (sTimeOfDayBlendVars[currentTimeBlend.time1].isTint) + TintPalette_RGB_Copy(i*16, sTimeOfDayBlendVars[currentTimeBlend.time1].blendColor); + else + TimeBlendPalette(i*16, sTimeOfDayBlendVars[currentTimeBlend.time1].coeff, sTimeOfDayBlendVars[currentTimeBlend.time1].blendColor); AveragePalettes(tempPaletteBuffer, &gPlttBufferFaded[i*16], &gPlttBufferFaded[i*16], currentTimeBlend.weight); } palettes >>= 1; diff --git a/src/palette.c b/src/palette.c index ff5f2106060a..36dfdfffa3fe 100644 --- a/src/palette.c +++ b/src/palette.c @@ -1231,52 +1231,58 @@ void TintPalette_CustomTone(u16 *palette, u16 count, u16 rTone, u16 gTone, u16 b } // Tints from Unfaded to Faded, using a 15-bit GBA color -void TintPalette_RGB_Copy(u16 palOffset, u16 numEntries, u8 coeff, u16 blendColor) { - u16 rTone, gTone, bTone; - u16 defaultBlendColor = DEFAULT_LIGHT_COLOR; - s32 r, g, b, i; - u32 gray; - struct PlttData *data2 = (struct PlttData *)&blendColor; - struct PlttData *data3; - struct PlttData *blendData; - u16 altBlendIndices = 0; - u16* palette = &gPlttBufferUnfaded[palOffset]; - for (i = 0; i < numEntries; i++) { - u16 index = i + palOffset; - struct PlttData *data1 = (struct PlttData *)palette; - if (i == 0) { - if (data1->unused_15) { // Color 0 is a bitmask for which colors to blend; color 15 is the alt blend color - gPlttBufferFaded[index] = gPlttBufferUnfaded[index]; - altBlendIndices = gPlttBufferUnfaded[index] << 1; // bit 0 specifies color 1, etc. - data3 = (struct PlttData *)&gPlttBufferUnfaded[index+15]; - if (!data3->unused_15) // use default blend color instead - data3 = (struct PlttData *)&defaultBlendColor; - } - palette++; - continue; +void TintPalette_RGB_Copy(u16 palOffset, u32 blendColor) { + s32 newR, newG, newB, rTone, gTone, bTone; + u16 * palDataSrc = gPlttBufferUnfaded + palOffset; + u16 * palDataDst = gPlttBufferFaded + palOffset; + u32 defaultBlendColor = DEFAULT_LIGHT_COLOR; + u16 *palDataSrcEnd = palDataSrc + 16; + u16 altBlendIndices = *palDataDst++ = *palDataSrc++; // color 0 is copied through unchanged + u32 altBlendColor; + + newR = ((blendColor << 27) >> 27) << 3; + newG = ((blendColor << 22) >> 27) << 3; + newB = ((blendColor << 17) >> 27) << 3; + + if (altBlendIndices >> 15) { // High bit set; bitmask of which colors to alt-blend + // Note that bit 0 of altBlendIndices specifies color 1 + altBlendColor = palDataSrc[14]; // color 15 + if (altBlendColor >> 15) { // Set alternate blend color + rTone = ((altBlendColor << 27) >> 27) << 3; + gTone = ((altBlendColor << 22) >> 27) << 3; + bTone = ((altBlendColor << 17) >> 27) << 3; + } else { // Set default blend color + rTone = ((defaultBlendColor << 27) >> 27) << 3; + gTone = ((defaultBlendColor << 22) >> 27) << 3; + bTone = ((defaultBlendColor << 17) >> 27) << 3; } - blendData = (altBlendIndices && altBlendIndices & (1 << i)) ? data3 : data2; - rTone = blendData->r << 3; - gTone = blendData->g << 3; - bTone = blendData->b << 3; - - r = GET_R(*palette); - g = GET_G(*palette); - b = GET_B(*palette); - gray = (r * Q_8_8(0.3) + g * Q_8_8(0.59) + b * Q_8_8(0.1133)) >> 8; - r = (u16)((rTone * gray)) >> 8; - g = (u16)((gTone * gray)) >> 8; - b = (u16)((bTone * gray)) >> 8; + } else { + altBlendIndices = 0; + } + while (palDataSrc != palDataSrcEnd) { + u32 palDataSrcColor = *palDataSrc; + s32 r = (palDataSrcColor << 27) >> 27; + s32 g = (palDataSrcColor << 22) >> 27; + s32 b = (palDataSrcColor << 17) >> 27; + if (altBlendIndices & 1) { + r = (u16)((rTone * r)) >> 8; + g = (u16)((gTone * g)) >> 8; + b = (u16)((bTone * b)) >> 8; + } else { // Use provided blend color + r = (u16)((newR * r)) >> 8; + g = (u16)((newG * g)) >> 8; + b = (u16)((newB * b)) >> 8; + } if (r > 31) r = 31; if (g > 31) g = 31; if (b > 31) b = 31; - - gPlttBufferFaded[index] = RGB2(r, g, b); - palette++; + palDataSrc++; + *palDataDst++ = RGB2(r, g, b); + altBlendIndices >>= 1; } } From a80de91463743c030585fd1584a303d9b8b80de6 Mon Sep 17 00:00:00 2001 From: Ariel Antonitis Date: Mon, 19 Apr 2021 22:07:47 -0400 Subject: [PATCH 023/104] Fixed bugged interaction between reflections & light sprites. --- src/event_object_movement.c | 1 + src/field_effect_helpers.c | 28 +++++++++++++++------------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/src/event_object_movement.c b/src/event_object_movement.c index fc99a172aa9a..62c64718f033 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -1943,6 +1943,7 @@ void UpdateLightSprite(struct Sprite *sprite) { DestroySprite(sprite); FieldEffectFreeTilesIfUnused(sheetTileStart); FieldEffectFreePaletteIfUnused(paletteNum); + Weather_SetBlendCoeffs(7, 12); // TODO: Restore original blend coeffs at dawn return; } diff --git a/src/field_effect_helpers.c b/src/field_effect_helpers.c index db58cb9a77b8..f3d4d71491b2 100755 --- a/src/field_effect_helpers.c +++ b/src/field_effect_helpers.c @@ -97,39 +97,41 @@ static void LoadObjectReflectionPalette(struct ObjectEvent *objectEvent, struct // Apply a blue tint effect to a palette static void ApplyPondFilter(u8 paletteNum, u16 *dest) { - u8 i, val, r, g, b; - // CpuCopy16(gPlttBufferUnfaded + 0x100 + paletteNum * 16, dest, 32); + u8 i; + s32 r, g, b; u16 *src = gPlttBufferUnfaded + 0x100 + paletteNum * 16; for (i = 0; i < 16; i++) { - r = src[i] & 0x1F; - g = (src[i] >> 5) & 0x1F; - b = (src[i] >> 10) & 0x1F; + u32 color = *src++; + r = (color << 27) >> 27; + g = (color << 22) >> 27; + b = (color << 17) >> 27; b += 10; if (b > 31) b = 31; - *dest++ = (b << 10) | (g << 5) | r; + *dest++ = r | (g << 5) | (b << 10); } } // Apply a ice tint effect to a palette static void ApplyIceFilter(u8 paletteNum, u16 *dest) { - u8 i, val, r, g, b; - // CpuCopy16(gPlttBufferUnfaded + 0x100 + paletteNum * 16, dest, 32); + u8 i; + s32 r, g, b; u16 *src = gPlttBufferUnfaded + 0x100 + paletteNum * 16; for (i = 0; i < 16; i++) { - r = src[i] & 0x1F; + u32 color = *src++; + r = (color << 27) >> 27; + g = (color << 22) >> 27; + b = (color << 17) >> 27; r -= 5; - if (r > 31) + if (r < 0) r = 0; - g = (src[i] >> 5) & 0x1F; g += 3; if (g > 31) g = 31; - b = (src[i] >> 10) & 0x1F; b += 16; if (b > 31) b = 31; - *dest++ = (b << 10) | (g << 5) | r; + *dest++ = r | (g << 5) | (b << 10); } } From 0d8467c2a922d3df0256a9019b4f7ff531e46716 Mon Sep 17 00:00:00 2001 From: Ariel Antonitis Date: Mon, 19 Apr 2021 23:17:13 -0400 Subject: [PATCH 024/104] Slight palette update optimization. --- src/overworld.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/overworld.c b/src/overworld.c index 8b07124366cb..aa66280fc29f 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -1526,32 +1526,31 @@ static bool8 FadePalettesWithTime(void) { // Only used to fade back in void UpdatePalettesWithTime(u32 palettes) { if (MapHasNaturalLight(gMapHeader.mapType)) { - u8 i, j; + u16 i; u16 tempPaletteBuffer[16]; for (i = 0; i < 16; i++) { - if (GetSpritePaletteTagByPaletteNum(i) & 0x8000) // Don't blend special sprite palette tags + if (GetSpritePaletteTagByPaletteNum(i) >> 15) // Don't blend special sprite palette tags palettes &= ~(1 << (i + 16)); } palettes &= ~0xE000; // Don't blend tile palettes [13,15] - gTimeOfDay = min(TIME_OF_DAY_MAX, gTimeOfDay); if (!palettes) return; - for (i = 0; palettes; i++) { + for (i = 0; palettes; i+=16) { if (palettes & 1) { if (sTimeOfDayBlendVars[currentTimeBlend.time0].isTint) - TintPalette_RGB_Copy(i*16, sTimeOfDayBlendVars[currentTimeBlend.time0].blendColor); + TintPalette_RGB_Copy(i, sTimeOfDayBlendVars[currentTimeBlend.time0].blendColor); else - TimeBlendPalette(i*16, sTimeOfDayBlendVars[currentTimeBlend.time0].coeff, sTimeOfDayBlendVars[currentTimeBlend.time0].blendColor); + TimeBlendPalette(i, sTimeOfDayBlendVars[currentTimeBlend.time0].coeff, sTimeOfDayBlendVars[currentTimeBlend.time0].blendColor); if (currentTimeBlend.weight == 256) { palettes >>= 1; continue; } - CpuFastCopy(&gPlttBufferFaded[i*16], tempPaletteBuffer, 32); + CpuFastCopy(&gPlttBufferFaded[i], tempPaletteBuffer, 32); if (sTimeOfDayBlendVars[currentTimeBlend.time1].isTint) - TintPalette_RGB_Copy(i*16, sTimeOfDayBlendVars[currentTimeBlend.time1].blendColor); + TintPalette_RGB_Copy(i, sTimeOfDayBlendVars[currentTimeBlend.time1].blendColor); else - TimeBlendPalette(i*16, sTimeOfDayBlendVars[currentTimeBlend.time1].coeff, sTimeOfDayBlendVars[currentTimeBlend.time1].blendColor); - AveragePalettes(tempPaletteBuffer, &gPlttBufferFaded[i*16], &gPlttBufferFaded[i*16], currentTimeBlend.weight); + TimeBlendPalette(i, sTimeOfDayBlendVars[currentTimeBlend.time1].coeff, sTimeOfDayBlendVars[currentTimeBlend.time1].blendColor); + AveragePalettes(tempPaletteBuffer, &gPlttBufferFaded[i], &gPlttBufferFaded[i], currentTimeBlend.weight); } palettes >>= 1; } From 93ab4451fc155bc1e841d3daafc4c85099dfb292 Mon Sep 17 00:00:00 2001 From: Ariel Antonitis Date: Mon, 19 Apr 2021 23:50:50 -0400 Subject: [PATCH 025/104] Testing combined averaging function. --- include/palette.h | 1 + src/overworld.c | 25 ++++----------- src/palette.c | 77 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 84 insertions(+), 19 deletions(-) diff --git a/include/palette.h b/include/palette.h index 071af1c12ce1..346091c64ae3 100644 --- a/include/palette.h +++ b/include/palette.h @@ -80,6 +80,7 @@ void AveragePalettes(u16 *palette0, u16* palette1, u16* dest, u16 weight); void TimeBlendPalette(u16 palOffset, u32 coeff, u32 blendColor); void TintPalette_RGB_Copy(u16 palOffset, u32 blendColor); void TimeBlendPalettes(u32 palettes, u32 coeff, u32 blendColor); +void TimeMixPalettes(u32 palettes, u32 coeff0, u32 color0, u32 coeff1, u32 color1, u16 weight); void TintPalette_GrayScale(u16 *palette, u16 count); void TintPalette_GrayScale2(u16 *palette, u16 count); void TintPalette_SepiaTone(u16 *palette, u16 count); diff --git a/src/overworld.c b/src/overworld.c index aa66280fc29f..8ccdf412bbc0 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -1535,25 +1535,12 @@ void UpdatePalettesWithTime(u32 palettes) { palettes &= ~0xE000; // Don't blend tile palettes [13,15] if (!palettes) return; - for (i = 0; palettes; i+=16) { - if (palettes & 1) { - if (sTimeOfDayBlendVars[currentTimeBlend.time0].isTint) - TintPalette_RGB_Copy(i, sTimeOfDayBlendVars[currentTimeBlend.time0].blendColor); - else - TimeBlendPalette(i, sTimeOfDayBlendVars[currentTimeBlend.time0].coeff, sTimeOfDayBlendVars[currentTimeBlend.time0].blendColor); - if (currentTimeBlend.weight == 256) { - palettes >>= 1; - continue; - } - CpuFastCopy(&gPlttBufferFaded[i], tempPaletteBuffer, 32); - if (sTimeOfDayBlendVars[currentTimeBlend.time1].isTint) - TintPalette_RGB_Copy(i, sTimeOfDayBlendVars[currentTimeBlend.time1].blendColor); - else - TimeBlendPalette(i, sTimeOfDayBlendVars[currentTimeBlend.time1].coeff, sTimeOfDayBlendVars[currentTimeBlend.time1].blendColor); - AveragePalettes(tempPaletteBuffer, &gPlttBufferFaded[i], &gPlttBufferFaded[i], currentTimeBlend.weight); - } - palettes >>= 1; - } + TimeMixPalettes(palettes, + sTimeOfDayBlendVars[currentTimeBlend.time0].coeff, + sTimeOfDayBlendVars[currentTimeBlend.time0].blendColor, + sTimeOfDayBlendVars[currentTimeBlend.time1].coeff, + sTimeOfDayBlendVars[currentTimeBlend.time1].blendColor, + currentTimeBlend.weight); } } diff --git a/src/palette.c b/src/palette.c index 36dfdfffa3fe..c2029adf0115 100644 --- a/src/palette.c +++ b/src/palette.c @@ -1131,6 +1131,83 @@ void TimeBlendPalettes(u32 palettes, u32 coeff, u32 blendColor) { } while (palettes); } +// Blends a weighted average of two blend parameters +void TimeMixPalettes(u32 palettes, u32 coeff0, u32 color0, u32 coeff1, u32 color1, u16 weight) { + s32 r0, g0, b0, r1, g1, b1, defR, defG, defB, altR, altG, altB; + u16 * palDataSrc; + u16 * palDataDst; + u32 defaultColor = DEFAULT_LIGHT_COLOR; + + if (!palettes) + return; + + // TODO: Check coeff for tint + coeff0 *= 2; + coeff1 *= 2; + r0 = (color0 << 27) >> 27; + g0 = (color0 << 22) >> 27; + b0 = (color0 << 17) >> 27; + r1 = (color1 << 27) >> 27; + g1 = (color1 << 22) >> 27; + b1 = (color1 << 17) >> 27; + defR = (defaultColor << 27) >> 27; + defG = (defaultColor << 22) >> 27; + defB = (defaultColor << 17) >> 27; + palDataSrc = gPlttBufferUnfaded; + palDataDst = gPlttBufferFaded; + + do { + if (palettes & 1) { + u16 *palDataSrcEnd = palDataSrc + 16; + u16 altBlendIndices = *palDataDst++ = *palDataSrc++; // color 0 is copied through + u32 altBlendColor; + if (altBlendIndices >> 15) { // High bit set; bitmask of which colors to alt-blend + // Note that bit 0 of altBlendIndices specifies color 1 + altBlendColor = palDataSrc[14]; // color 15 + if (altBlendColor >> 15) { // Set alternate blend color + altR = (altBlendColor << 27) >> 27; + altG = (altBlendColor << 22) >> 27; + altB = (altBlendColor << 17) >> 27; + } else { + altBlendColor = 0; + } + } else { + altBlendIndices = 0; + } + while (palDataSrc != palDataSrcEnd) { + u32 palDataSrcColor = *palDataSrc; + s32 r = (palDataSrcColor << 27) >> 27; + s32 g = (palDataSrcColor << 22) >> 27; + s32 b = (palDataSrcColor << 17) >> 27; + + if (altBlendIndices & 1) { // No need to average; colors will be the same + if (altBlendColor) { // Use alternate blend color + *palDataDst = ((r + (((altR - r) * coeff0) >> 5)) << 0) + | ((g + (((altG - g) * coeff0) >> 5)) << 5) + | ((b + (((altB - b) * coeff0) >> 5)) << 10); + } else { // Use default blend color + *palDataDst = ((r + (((defR - r) * coeff0) >> 5)) << 0) + | ((g + (((defG - g) * coeff0) >> 5)) << 5) + | ((b + (((defB - b) * coeff0) >> 5)) << 10); + } + } else { // Use provided blend colors + r = (weight*(r + (((r0 - r) * coeff0) >> 5)) + (256-weight)*(r + (((r1 - r) * coeff1) >> 5))) >> 8; + g = (weight*(g + (((g0 - g) * coeff0) >> 5)) + (256-weight)*(g + (((g1 - g) * coeff1) >> 5))) >> 8; + b = (weight*(b + (((b0 - b) * coeff0) >> 5)) + (256-weight)*(b + (((b1 - b) * coeff1) >> 5))) >> 8; + *palDataDst = RGB2(r, g, b); + } + palDataSrc++; + palDataDst++; + altBlendIndices >>= 1; + } + } else { + palDataSrc += 16; + palDataDst += 16; + } + palettes >>= 1; + } while (palettes); +} + void BlendPalettesUnfaded(u32 selectedPalettes, u8 coeff, u16 color) { void *src = gPlttBufferUnfaded; From ae4f59688556375142c3b4d1931fff6e699f9544 Mon Sep 17 00:00:00 2001 From: Ariel Antonitis Date: Tue, 20 Apr 2021 00:19:07 -0400 Subject: [PATCH 026/104] Averaging function can now tint. --- include/palette.h | 2 +- src/overworld.c | 4 ++- src/palette.c | 63 ++++++++++++++++++++++++++++++++++++----------- 3 files changed, 53 insertions(+), 16 deletions(-) diff --git a/include/palette.h b/include/palette.h index 346091c64ae3..d0a8e67a8c1c 100644 --- a/include/palette.h +++ b/include/palette.h @@ -80,7 +80,7 @@ void AveragePalettes(u16 *palette0, u16* palette1, u16* dest, u16 weight); void TimeBlendPalette(u16 palOffset, u32 coeff, u32 blendColor); void TintPalette_RGB_Copy(u16 palOffset, u32 blendColor); void TimeBlendPalettes(u32 palettes, u32 coeff, u32 blendColor); -void TimeMixPalettes(u32 palettes, u32 coeff0, u32 color0, u32 coeff1, u32 color1, u16 weight); +void TimeMixPalettes(u32 palettes, u32 coeff0, u32 color0, u32 coeff1, u32 color1, u16 weight, bool8 tint0, bool8 tint1); void TintPalette_GrayScale(u16 *palette, u16 count); void TintPalette_GrayScale2(u16 *palette, u16 count); void TintPalette_SepiaTone(u16 *palette, u16 count); diff --git a/src/overworld.c b/src/overworld.c index 8ccdf412bbc0..5bf44433f7f7 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -1540,7 +1540,9 @@ void UpdatePalettesWithTime(u32 palettes) { sTimeOfDayBlendVars[currentTimeBlend.time0].blendColor, sTimeOfDayBlendVars[currentTimeBlend.time1].coeff, sTimeOfDayBlendVars[currentTimeBlend.time1].blendColor, - currentTimeBlend.weight); + currentTimeBlend.weight, + sTimeOfDayBlendVars[currentTimeBlend.time0].isTint, + sTimeOfDayBlendVars[currentTimeBlend.time1].isTint); } } diff --git a/src/palette.c b/src/palette.c index c2029adf0115..c4e12cd8beaa 100644 --- a/src/palette.c +++ b/src/palette.c @@ -1132,7 +1132,7 @@ void TimeBlendPalettes(u32 palettes, u32 coeff, u32 blendColor) { } // Blends a weighted average of two blend parameters -void TimeMixPalettes(u32 palettes, u32 coeff0, u32 color0, u32 coeff1, u32 color1, u16 weight) { +void TimeMixPalettes(u32 palettes, u32 coeff0, u32 color0, u32 coeff1, u32 color1, u16 weight, bool8 tint0, bool8 tint1) { s32 r0, g0, b0, r1, g1, b1, defR, defG, defB, altR, altG, altB; u16 * palDataSrc; u16 * palDataDst; @@ -1141,9 +1141,8 @@ void TimeMixPalettes(u32 palettes, u32 coeff0, u32 color0, u32 coeff1, u32 color if (!palettes) return; - // TODO: Check coeff for tint - coeff0 *= 2; - coeff1 *= 2; + coeff0 = tint0 ? 8*2 : coeff0 * 2; + coeff1 = tint1 ? 8*2 : coeff1 * 2; r0 = (color0 << 27) >> 27; g0 = (color0 << 22) >> 27; b0 = (color0 << 17) >> 27; @@ -1180,20 +1179,56 @@ void TimeMixPalettes(u32 palettes, u32 coeff0, u32 color0, u32 coeff1, u32 color s32 g = (palDataSrcColor << 22) >> 27; s32 b = (palDataSrcColor << 17) >> 27; - if (altBlendIndices & 1) { // No need to average; colors will be the same + if (altBlendIndices & 1) { if (altBlendColor) { // Use alternate blend color - *palDataDst = ((r + (((altR - r) * coeff0) >> 5)) << 0) - | ((g + (((altG - g) * coeff0) >> 5)) << 5) - | ((b + (((altB - b) * coeff0) >> 5)) << 10); + r = (weight*(r + (((altR - r) * coeff0) >> 5)) + (256-weight)*(r + (((altR - r) * coeff1) >> 5))) >> 8; + g = (weight*(g + (((altG - g) * coeff0) >> 5)) + (256-weight)*(g + (((altG - g) * coeff1) >> 5))) >> 8; + b = (weight*(b + (((altB - b) * coeff0) >> 5)) + (256-weight)*(b + (((altB - b) * coeff1) >> 5))) >> 8; + *palDataDst = RGB2(r, g, b); } else { // Use default blend color - *palDataDst = ((r + (((defR - r) * coeff0) >> 5)) << 0) - | ((g + (((defG - g) * coeff0) >> 5)) << 5) - | ((b + (((defB - b) * coeff0) >> 5)) << 10); + r = (weight*(r + (((defR - r) * coeff0) >> 5)) + (256-weight)*(r + (((defR - r) * coeff1) >> 5))) >> 8; + g = (weight*(g + (((defG - g) * coeff0) >> 5)) + (256-weight)*(g + (((defG - g) * coeff1) >> 5))) >> 8; + b = (weight*(b + (((defB - b) * coeff0) >> 5)) + (256-weight)*(b + (((defB - b) * coeff1) >> 5))) >> 8; + *palDataDst = RGB2(r, g, b); } } else { // Use provided blend colors - r = (weight*(r + (((r0 - r) * coeff0) >> 5)) + (256-weight)*(r + (((r1 - r) * coeff1) >> 5))) >> 8; - g = (weight*(g + (((g0 - g) * coeff0) >> 5)) + (256-weight)*(g + (((g1 - g) * coeff1) >> 5))) >> 8; - b = (weight*(b + (((b0 - b) * coeff0) >> 5)) + (256-weight)*(b + (((b1 - b) * coeff1) >> 5))) >> 8; + s32 r2, g2, b2, r3, g3, b3; + if (!tint0) { // blend-based + r2 = (r + (((r0 - r) * coeff0) >> 5)); + g2 = (g + (((g0 - g) * coeff0) >> 5)); + b2 = (b + (((b0 - b) * coeff0) >> 5)); + } else { // tint-based + r2 = (u16)(((r0 << 3) * r)) >> 8; + g2 = (u16)(((g0 << 3) * g)) >> 8; + b2 = (u16)(((b0 << 3) * b)) >> 8; + if (r2 > 31) + r2 = 31; + if (g2 > 31) + g2 = 31; + if (b2 > 31) + b2 = 31; + } + if (!tint1) { // blend-based + r3 = (r + (((r1 - r) * coeff1) >> 5)); + g3 = (g + (((g1 - g) * coeff1) >> 5)); + b3 = (b + (((b1 - b) * coeff1) >> 5)); + } else { // tint-based + r3 = (u16)(((r1 << 3) * r)) >> 8; + g3 = (u16)(((g1 << 3) * g)) >> 8; + b3 = (u16)(((b1 << 3) * b)) >> 8; + if (r3 > 31) + r3 = 31; + if (g3 > 31) + g3 = 31; + if (b3 > 31) + b3 = 31; + } + r = (weight*r2 + (256-weight)*r3) >> 8; + g = (weight*g2 + (256-weight)*g3) >> 8; + b = (weight*b2 + (256-weight)*b3) >> 8; + // r = (weight*(r + (((r0 - r) * coeff0) >> 5)) + (256-weight)*(r + (((r1 - r) * coeff1) >> 5))) >> 8; + // g = (weight*(g + (((g0 - g) * coeff0) >> 5)) + (256-weight)*(g + (((g1 - g) * coeff1) >> 5))) >> 8; + // b = (weight*(b + (((b0 - b) * coeff0) >> 5)) + (256-weight)*(b + (((b1 - b) * coeff1) >> 5))) >> 8; *palDataDst = RGB2(r, g, b); } palDataSrc++; From 73d060b3b61a49b47990813cac5afbbef1e30c2b Mon Sep 17 00:00:00 2001 From: Ariel Antonitis Date: Tue, 20 Apr 2021 01:49:02 -0400 Subject: [PATCH 027/104] Added glowing colors for some follower pokemon (Ampharos). --- .../object_events/pics/pokemon/ampharos.png | Bin 703 -> 5069 bytes graphics/pokemon/ampharos/normal.pal | 6 +++--- graphics/pokemon/ampharos/shiny.pal | 6 +++--- src/event_object_movement.c | 12 ++++++++++++ 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/graphics/object_events/pics/pokemon/ampharos.png b/graphics/object_events/pics/pokemon/ampharos.png index 076d853d035d00096907463e52259562df05647b..2386f6d45263ab682cff969859bd8c75e2a23ea0 100644 GIT binary patch delta 5039 zcmV;g6Hx5G1aB^>EX>4U6ba`-PAZ2)IW&i+q+O3&sl4U85 zh5xgPS^@&ZupETItas4MuTRfCA~K?~%BXI$|M!1h`UfAi=b4(0 z*;ntGkG9$>n;&NW`uO@TxqZHVKF;@_`2DxnQ~B|S!b_F!^?&Qve!s8Zysp3AFxvO) z_WSE;eBYwX?}g;&!k>>CcaER^dz0S_)$;YaeE*)-_ZxQq%W=N{mGiyq_u_y4-Uh{R zWxZNbxm9ZZd@Wyhs_{?i=6mBSzjI-{wyW}e*IN6()-U}m-QN`OQ~1BBU;eSP`l}pY z3;j4&|D#UduYZgF@p}Dv`|{h4qczdeOKI%n}1F2?822rSd1S3{+a%K;s5&i z+d}UJ%tbz6+@D&puM+rT8_~J=%2hN(-giy)Q(sA6-}0Xy@)LxCJ$P!5 zI@-|D#~5?0v1gra>g;pOIoI5)tO|{3T78W**IIjX)7>^}ZLZ(EV8yC6Q|mTt+OmCs z&uK?bKjX}^&i3Nfp@8JwhfiO=uUw#X+tu6exPSAmyB}D4^|hz3zwzc6-5k-PTWo zVt)#$DGXT|zt`3-69nvc)f>OM-q&Lf&*rHpsFnG~>T}-48zu|4H}j0Bxvo{;fdM{gc zy(6pngUzm=dAm`}UJJWjqn!TU7*P&8(|>mg@@bCkOLjdM))=E`;M z?U}Z}^;K3B2j5WqmOl6M1dM12XR=Xqr%fOU!T=h=Tkmf9DQIeL;*GVgwYw;ukJSP# z@1AS@crv|hIykra*o2%nuD_{W)aVDBe8tSItD`2${qzb+1b;#nV<2}hlh>8K0;@4N7iEP#96oLUc7rj0ur=?w zz=iVWlg2CiR(9YM9h<8>=2YCQ2 zeavX@VE?Nai)g_bfXvQ7wtEojJ^OVEY9MkuT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ZHJ#fa5-pU+qM55)K{e~K#Ggmld zTx1S+P@$6N99&_;y39jPti%HRoqt!X$iYHaTw^Zfy2wMp&~na$Z-Fat=2yg;P7>uF zfRsFPQs7Fj@%RUxeNHSCot%tY?S_meg)<|C8?A2H>BumPA4!92h0gq%aTxAlD5Ap1 zNI@&D*x`v0o*KdDWmOt0Hv9TaI7rFi&ZEMaV=M86l=HPPl&9riU-%qg5r0z_-+IEq zWrw0ig)_%t6R=%^NdX3SQ;rYcIqeI_^F9$E!`Ivp<}R&=05%IS#TO=<3wJRm8wh>N zqr%92ETitW%UY%38#$)qG)O#Iou%wOm6T1N1V>JdVAXc1n{;g>#{+fF0-iikQ}$=l zQp#2}g!`mmOpEGqm~rfeLW1Jnk$)t=ZWZOe#q7^a9nL!#HCKc&rYV!ReM6b&j=!~wh!>83 aWxoOMtag) == 0xFF) { // Load compressed palette LoadCompressedSpritePalette(spritePalette); sprite->oam.paletteNum = IndexOfSpritePaletteTag(spritePalette->tag); // Tag is always present + if (species == SPECIES_AMPHAROS) { // palette should be light-blended TODO: Add more glowing pokemon + // CHARIZARD_LINE ? + // CHINCHOU & LANTERN + // FLAAFY, MAREEP + // UMBREON + // VOLBEAT ? + // REGIS ? + u16 * palette = &gPlttBufferUnfaded[(sprite->oam.paletteNum+16)*16]; + palette[0] |= 0x8000; + if (palette[0] & 0x4000) // If color 15 is blended, use it as the alternate color + palette[15] |= 0x8000; + } UpdateSpritePaletteWithTime(sprite->oam.paletteNum); } else sprite->oam.paletteNum = IndexOfSpritePaletteTag(spritePalette->tag); // Tag is always present From da345c1eeb94dfd9d329efe5ce8270d3c13ddc52 Mon Sep 17 00:00:00 2001 From: Ariel Antonitis Date: Tue, 20 Apr 2021 03:34:14 -0400 Subject: [PATCH 028/104] Optimized time-of-day & native palette blending. --- include/palette.h | 9 +- src/overworld.c | 22 ++--- src/palette.c | 229 +++++++++++++++++++++++----------------------- 3 files changed, 129 insertions(+), 131 deletions(-) diff --git a/include/palette.h b/include/palette.h index d0a8e67a8c1c..4fbde048aa4c 100644 --- a/include/palette.h +++ b/include/palette.h @@ -46,6 +46,12 @@ struct PaletteFadeControl u8 deltaY:4; // rate of change of blend coefficient }; +struct BlendSettings { + u16 blendColor:15; + u16 isTint:1; + u8 coeff:5; +}; + extern struct PaletteFadeControl gPaletteFade; extern u32 gPlttBufferTransferPending; extern u8 gPaletteDecompressionBuffer[]; @@ -76,11 +82,10 @@ void BeginHardwarePaletteFade(u8, u8, u8, u8, u8); void BlendPalettes(u32 selectedPalettes, u8 coeff, u16 color); void BlendPalettesUnfaded(u32, u8, u16); void BlendPalettesGradually(u32 selectedPalettes, s8 delay, u8 coeff, u8 coeffTarget, u16 color, u8 priority, u8 id); -void AveragePalettes(u16 *palette0, u16* palette1, u16* dest, u16 weight); void TimeBlendPalette(u16 palOffset, u32 coeff, u32 blendColor); void TintPalette_RGB_Copy(u16 palOffset, u32 blendColor); void TimeBlendPalettes(u32 palettes, u32 coeff, u32 blendColor); -void TimeMixPalettes(u32 palettes, u32 coeff0, u32 color0, u32 coeff1, u32 color1, u16 weight, bool8 tint0, bool8 tint1); +void TimeMixPalettes(u32, u16 *, u16 *, struct BlendSettings *, struct BlendSettings *, u16); void TintPalette_GrayScale(u16 *palette, u16 count); void TintPalette_GrayScale2(u16 *palette, u16 count); void TintPalette_SepiaTone(u16 *palette, u16 count); diff --git a/src/overworld.c b/src/overworld.c index 5bf44433f7f7..0028d976f4c7 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -186,7 +186,6 @@ static u16 (*sPlayerKeyInterceptCallback)(u32); static bool8 sReceivingFromLink; static u8 sRfuKeepAliveTimer; -static u8 gTimeOfDayState; static u8 timeCounter; static struct TimeBlendSettings currentTimeBlend; @@ -1461,13 +1460,9 @@ void CB1_Overworld(void) DoCB1_Overworld(gMain.newKeys, gMain.heldKeys); } -struct TimeOfDayBlend { - u8 coeff:5; - u16 blendColor:15; - u16 isTint:1; -}; -static const struct TimeOfDayBlend sTimeOfDayBlendVars[] = + +static const struct BlendSettings sTimeOfDayBlendVars[] = { [TIME_OF_DAY_NIGHT] = {.coeff = 10, .blendColor = 0x1400}, [TIME_OF_DAY_TWILIGHT] = {.coeff = 4, .blendColor = 0x56dc, .isTint = TRUE}, @@ -1516,7 +1511,6 @@ static bool8 MapHasNaturalLight(u8 mapType) { // Weather a map type is naturally } static bool8 FadePalettesWithTime(void) { // Only used to fade back in - gTimeOfDayState = 0; gTimeOfDay = UpdateTimeOfDay(); if (MapHasNaturalLight(gMapHeader.mapType)) { ResetPaletteFade(); @@ -1536,13 +1530,11 @@ void UpdatePalettesWithTime(u32 palettes) { if (!palettes) return; TimeMixPalettes(palettes, - sTimeOfDayBlendVars[currentTimeBlend.time0].coeff, - sTimeOfDayBlendVars[currentTimeBlend.time0].blendColor, - sTimeOfDayBlendVars[currentTimeBlend.time1].coeff, - sTimeOfDayBlendVars[currentTimeBlend.time1].blendColor, - currentTimeBlend.weight, - sTimeOfDayBlendVars[currentTimeBlend.time0].isTint, - sTimeOfDayBlendVars[currentTimeBlend.time1].isTint); + gPlttBufferUnfaded, + gPlttBufferFaded, + (struct BlendSettings *)&sTimeOfDayBlendVars[currentTimeBlend.time0], + (struct BlendSettings *)&sTimeOfDayBlendVars[currentTimeBlend.time1], + currentTimeBlend.weight); } } diff --git a/src/palette.c b/src/palette.c index c4e12cd8beaa..e1c9628aa2da 100644 --- a/src/palette.c +++ b/src/palette.c @@ -966,45 +966,43 @@ static bool8 IsSoftwarePaletteFadeFinishing(void) } } -void BlendPalettes(u32 selectedPalettes, u8 coeff, u16 color) -{ - u16 paletteOffset; +// optimized based on lucktyphlosion's BlendPalettesFine +static void BlendPalettesFine(u32 palettes, u16 *src, u16 *dst, u32 coeff, u32 color) { + s32 newR, newG, newB; - for (paletteOffset = 0; selectedPalettes; paletteOffset += 16) - { - if (selectedPalettes & 1) - BlendPalette(paletteOffset, 16, coeff, color); - selectedPalettes >>= 1; + if (!palettes) + return; + + coeff *= 2; + newR = (color << 27) >> 27; + newG = (color << 22) >> 27; + newB = (color << 17) >> 27; + + do { + if (palettes & 1) { + u16 *srcEnd = src + 16; + *dst++ = *src++; // transparency is copied-through + while (src != srcEnd) { + u32 srcColor = *src; + s32 r = (srcColor << 27) >> 27; + s32 g = (srcColor << 22) >> 27; + s32 b = (srcColor << 17) >> 27; + + *dst++ = ((r + (((newR - r) * coeff) >> 5)) << 0) + | ((g + (((newG - g) * coeff) >> 5)) << 5) + | ((b + (((newB - b) * coeff) >> 5)) << 10); + src++; + } + } else { + src += 16; + dst + 16; } + palettes >>= 1; + } while (palettes); } -// Computes a weighted average of two palettes, as (p0*weight + (256-weight)*p1)/256 -void AveragePalettes(u16 *palette0, u16* palette1, u16* dest, u16 weight) { - u8 i; - u32 tempColor; - u16 r0, g0, b0, r1, g1, b1, r, g, b; - u16 color0, color1, destColor; - *dest++ = *palette0++; // Copy palette0's transparency color as is - palette1++; - for (i = 1; i < 16; i++) { // Skip transparent color - color0 = *palette0++; - color1 = *palette1++; - r0 = color0 & 0x1F; - g0 = (color0 >> 5) & 0x1F; - b0 = (color0 >> 10) & 0x1F; - r1 = color1 & 0x1F; - g1 = (color1 >> 5) & 0x1F; - b1 = (color1 >> 10) & 0x1F; - r = (weight*r0 + (256-weight)*r1) >> 8; - g = (weight*g0 + (256-weight)*g1) >> 8; - b = (weight*b0 + (256-weight)*b1) >> 8; - r = r > 31 ? 31 : r; - g = g > 31 ? 31 : g; - b = b > 31 ? 31 : b; - destColor = (color0 | color1) & 0x8000; - destColor += r + (g << 5) + (b << 10); - *dest++ = destColor; - } +void BlendPalettes(u32 palettes, u8 coeff, u16 color) { + BlendPalettesFine(palettes, gPlttBufferUnfaded, gPlttBufferFaded, coeff, color); } #define DEFAULT_LIGHT_COLOR 0x3f9f @@ -1013,11 +1011,11 @@ void AveragePalettes(u16 *palette0, u16* palette1, u16* dest, u16 weight) { // Optimization help by lucktyphlosion void TimeBlendPalette(u16 palOffset, u32 coeff, u32 blendColor) { s32 newR, newG, newB, defR, defG, defB; - u16 * palDataSrc = gPlttBufferUnfaded + palOffset; - u16 * palDataDst = gPlttBufferFaded + palOffset; + u16 * src = gPlttBufferUnfaded + palOffset; + u16 * dst = gPlttBufferFaded + palOffset; u32 defaultBlendColor = DEFAULT_LIGHT_COLOR; - u16 *palDataSrcEnd = palDataSrc + 16; - u16 altBlendIndices = *palDataDst++ = *palDataSrc++; // color 0 is copied through unchanged + u16 *srcEnd = src + 16; + u16 altBlendIndices = *dst++ = *src++; // color 0 is copied through unchanged u32 altBlendColor; coeff *= 2; @@ -1027,7 +1025,7 @@ void TimeBlendPalette(u16 palOffset, u32 coeff, u32 blendColor) { if (altBlendIndices >> 15) { // High bit set; bitmask of which colors to alt-blend // Note that bit 0 of altBlendIndices specifies color 1 - altBlendColor = palDataSrc[14]; // color 15 + altBlendColor = src[14]; // color 15 if (altBlendColor >> 15) { // Set alternate blend color defR = (altBlendColor << 27) >> 27; defG = (altBlendColor << 22) >> 27; @@ -1040,31 +1038,31 @@ void TimeBlendPalette(u16 palOffset, u32 coeff, u32 blendColor) { } else { altBlendIndices = 0; } - while (palDataSrc != palDataSrcEnd) { - u32 palDataSrcColor = *palDataSrc; - s32 r = (palDataSrcColor << 27) >> 27; - s32 g = (palDataSrcColor << 22) >> 27; - s32 b = (palDataSrcColor << 17) >> 27; + while (src != srcEnd) { + u32 srcColor = *src; + s32 r = (srcColor << 27) >> 27; + s32 g = (srcColor << 22) >> 27; + s32 b = (srcColor << 17) >> 27; if (altBlendIndices & 1) { - *palDataDst = ((r + (((defR - r) * coeff) >> 5)) << 0) + *dst = ((r + (((defR - r) * coeff) >> 5)) << 0) | ((g + (((defG - g) * coeff) >> 5)) << 5) | ((b + (((defB - b) * coeff) >> 5)) << 10); } else { // Use provided blend color - *palDataDst = ((r + (((newR - r) * coeff) >> 5)) << 0) + *dst = ((r + (((newR - r) * coeff) >> 5)) << 0) | ((g + (((newG - g) * coeff) >> 5)) << 5) | ((b + (((newB - b) * coeff) >> 5)) << 10); } - palDataSrc++; - palDataDst++; + src++; + dst++; altBlendIndices >>= 1; } } void TimeBlendPalettes(u32 palettes, u32 coeff, u32 blendColor) { s32 newR, newG, newB, defR, defG, defB, altR, altG, altB; - u16 * palDataSrc; - u16 * palDataDst; + u16 * src; + u16 * dst; u32 defaultBlendColor = DEFAULT_LIGHT_COLOR; if (!palettes) @@ -1077,17 +1075,17 @@ void TimeBlendPalettes(u32 palettes, u32 coeff, u32 blendColor) { defR = (defaultBlendColor << 27) >> 27; defG = (defaultBlendColor << 22) >> 27; defB = (defaultBlendColor << 17) >> 27; - palDataSrc = gPlttBufferUnfaded; - palDataDst = gPlttBufferFaded; + src = gPlttBufferUnfaded; + dst = gPlttBufferFaded; do { if (palettes & 1) { - u16 *palDataSrcEnd = palDataSrc + 16; - u16 altBlendIndices = *palDataDst++ = *palDataSrc++; // color 0 is copied through + u16 *srcEnd = src + 16; + u16 altBlendIndices = *dst++ = *src++; // color 0 is copied through u32 altBlendColor; if (altBlendIndices >> 15) { // High bit set; bitmask of which colors to alt-blend // Note that bit 0 of altBlendIndices specifies color 1 - altBlendColor = palDataSrc[14]; // color 15 + altBlendColor = src[14]; // color 15 if (altBlendColor >> 15) { // Set alternate blend color altR = (altBlendColor << 27) >> 27; altG = (altBlendColor << 22) >> 27; @@ -1098,51 +1096,58 @@ void TimeBlendPalettes(u32 palettes, u32 coeff, u32 blendColor) { } else { altBlendIndices = 0; } - while (palDataSrc != palDataSrcEnd) { - u32 palDataSrcColor = *palDataSrc; - s32 r = (palDataSrcColor << 27) >> 27; - s32 g = (palDataSrcColor << 22) >> 27; - s32 b = (palDataSrcColor << 17) >> 27; + while (src != srcEnd) { + u32 srcColor = *src; + s32 r = (srcColor << 27) >> 27; + s32 g = (srcColor << 22) >> 27; + s32 b = (srcColor << 17) >> 27; if (altBlendIndices & 1) { if (altBlendColor) { // Use alternate blend color - *palDataDst = ((r + (((altR - r) * coeff) >> 5)) << 0) + *dst = ((r + (((altR - r) * coeff) >> 5)) << 0) | ((g + (((altG - g) * coeff) >> 5)) << 5) | ((b + (((altB - b) * coeff) >> 5)) << 10); } else { // Use default blend color - *palDataDst = ((r + (((defR - r) * coeff) >> 5)) << 0) + *dst = ((r + (((defR - r) * coeff) >> 5)) << 0) | ((g + (((defG - g) * coeff) >> 5)) << 5) | ((b + (((defB - b) * coeff) >> 5)) << 10); } } else { // Use provided blend color - *palDataDst = ((r + (((newR - r) * coeff) >> 5)) << 0) + *dst = ((r + (((newR - r) * coeff) >> 5)) << 0) | ((g + (((newG - g) * coeff) >> 5)) << 5) | ((b + (((newB - b) * coeff) >> 5)) << 10); } - palDataSrc++; - palDataDst++; + src++; + dst++; altBlendIndices >>= 1; } } else { - palDataSrc += 16; - palDataDst += 16; + src += 16; + dst += 16; } palettes >>= 1; } while (palettes); } // Blends a weighted average of two blend parameters -void TimeMixPalettes(u32 palettes, u32 coeff0, u32 color0, u32 coeff1, u32 color1, u16 weight, bool8 tint0, bool8 tint1) { +// TODO: Should pointers be marked as const? +void TimeMixPalettes(u32 palettes, u16 *src, u16 *dst, struct BlendSettings *blend0, struct BlendSettings *blend1, u16 weight0) { s32 r0, g0, b0, r1, g1, b1, defR, defG, defB, altR, altG, altB; - u16 * palDataSrc; - u16 * palDataDst; + u32 color0, coeff0, color1, coeff1; + bool8 tint0, tint1; + u16 weight1; u32 defaultColor = DEFAULT_LIGHT_COLOR; if (!palettes) return; - coeff0 = tint0 ? 8*2 : coeff0 * 2; - coeff1 = tint1 ? 8*2 : coeff1 * 2; + color0 = blend0->blendColor; + tint0 = blend0->isTint; + coeff0 = tint0 ? 8*2 : blend0->coeff*2; + color1 = blend1->blendColor; + tint1 = blend1->isTint; + coeff1 = tint1 ? 8*2 : blend1->coeff*2; + r0 = (color0 << 27) >> 27; g0 = (color0 << 22) >> 27; b0 = (color0 << 17) >> 27; @@ -1152,17 +1157,16 @@ void TimeMixPalettes(u32 palettes, u32 coeff0, u32 color0, u32 coeff1, u32 color defR = (defaultColor << 27) >> 27; defG = (defaultColor << 22) >> 27; defB = (defaultColor << 17) >> 27; - palDataSrc = gPlttBufferUnfaded; - palDataDst = gPlttBufferFaded; + weight1 = 256 - weight0; do { if (palettes & 1) { - u16 *palDataSrcEnd = palDataSrc + 16; - u16 altBlendIndices = *palDataDst++ = *palDataSrc++; // color 0 is copied through + u16 *srcEnd = src + 16; + u16 altBlendIndices = *dst++ = *src++; // color 0 is copied through u32 altBlendColor; if (altBlendIndices >> 15) { // High bit set; bitmask of which colors to alt-blend // Note that bit 0 of altBlendIndices specifies color 1 - altBlendColor = palDataSrc[14]; // color 15 + altBlendColor = src[14]; // color 15 if (altBlendColor >> 15) { // Set alternate blend color altR = (altBlendColor << 27) >> 27; altG = (altBlendColor << 22) >> 27; @@ -1173,23 +1177,23 @@ void TimeMixPalettes(u32 palettes, u32 coeff0, u32 color0, u32 coeff1, u32 color } else { altBlendIndices = 0; } - while (palDataSrc != palDataSrcEnd) { - u32 palDataSrcColor = *palDataSrc; - s32 r = (palDataSrcColor << 27) >> 27; - s32 g = (palDataSrcColor << 22) >> 27; - s32 b = (palDataSrcColor << 17) >> 27; + while (src != srcEnd) { + u32 srcColor = *src; + s32 r = (srcColor << 27) >> 27; + s32 g = (srcColor << 22) >> 27; + s32 b = (srcColor << 17) >> 27; if (altBlendIndices & 1) { if (altBlendColor) { // Use alternate blend color - r = (weight*(r + (((altR - r) * coeff0) >> 5)) + (256-weight)*(r + (((altR - r) * coeff1) >> 5))) >> 8; - g = (weight*(g + (((altG - g) * coeff0) >> 5)) + (256-weight)*(g + (((altG - g) * coeff1) >> 5))) >> 8; - b = (weight*(b + (((altB - b) * coeff0) >> 5)) + (256-weight)*(b + (((altB - b) * coeff1) >> 5))) >> 8; - *palDataDst = RGB2(r, g, b); + r = (weight0*(r + (((altR - r) * coeff0) >> 5)) + weight1*(r + (((altR - r) * coeff1) >> 5))) >> 8; + g = (weight0*(g + (((altG - g) * coeff0) >> 5)) + weight1*(g + (((altG - g) * coeff1) >> 5))) >> 8; + b = (weight0*(b + (((altB - b) * coeff0) >> 5)) + weight1*(b + (((altB - b) * coeff1) >> 5))) >> 8; + *dst = RGB2(r, g, b); } else { // Use default blend color - r = (weight*(r + (((defR - r) * coeff0) >> 5)) + (256-weight)*(r + (((defR - r) * coeff1) >> 5))) >> 8; - g = (weight*(g + (((defG - g) * coeff0) >> 5)) + (256-weight)*(g + (((defG - g) * coeff1) >> 5))) >> 8; - b = (weight*(b + (((defB - b) * coeff0) >> 5)) + (256-weight)*(b + (((defB - b) * coeff1) >> 5))) >> 8; - *palDataDst = RGB2(r, g, b); + r = (weight0*(r + (((defR - r) * coeff0) >> 5)) + weight1*(r + (((defR - r) * coeff1) >> 5))) >> 8; + g = (weight0*(g + (((defG - g) * coeff0) >> 5)) + weight1*(g + (((defG - g) * coeff1) >> 5))) >> 8; + b = (weight0*(b + (((defB - b) * coeff0) >> 5)) + weight1*(b + (((defB - b) * coeff1) >> 5))) >> 8; + *dst = RGB2(r, g, b); } } else { // Use provided blend colors s32 r2, g2, b2, r3, g3, b3; @@ -1223,21 +1227,18 @@ void TimeMixPalettes(u32 palettes, u32 coeff0, u32 color0, u32 coeff1, u32 color if (b3 > 31) b3 = 31; } - r = (weight*r2 + (256-weight)*r3) >> 8; - g = (weight*g2 + (256-weight)*g3) >> 8; - b = (weight*b2 + (256-weight)*b3) >> 8; - // r = (weight*(r + (((r0 - r) * coeff0) >> 5)) + (256-weight)*(r + (((r1 - r) * coeff1) >> 5))) >> 8; - // g = (weight*(g + (((g0 - g) * coeff0) >> 5)) + (256-weight)*(g + (((g1 - g) * coeff1) >> 5))) >> 8; - // b = (weight*(b + (((b0 - b) * coeff0) >> 5)) + (256-weight)*(b + (((b1 - b) * coeff1) >> 5))) >> 8; - *palDataDst = RGB2(r, g, b); + r = (weight0*r2 + weight1*r3) >> 8; + g = (weight0*g2 + weight1*g3) >> 8; + b = (weight0*b2 + weight1*b3) >> 8; + *dst = RGB2(r, g, b); } - palDataSrc++; - palDataDst++; + src++; + dst++; altBlendIndices >>= 1; } } else { - palDataSrc += 16; - palDataDst += 16; + src += 16; + dst += 16; } palettes >>= 1; } while (palettes); @@ -1345,11 +1346,11 @@ void TintPalette_CustomTone(u16 *palette, u16 count, u16 rTone, u16 gTone, u16 b // Tints from Unfaded to Faded, using a 15-bit GBA color void TintPalette_RGB_Copy(u16 palOffset, u32 blendColor) { s32 newR, newG, newB, rTone, gTone, bTone; - u16 * palDataSrc = gPlttBufferUnfaded + palOffset; - u16 * palDataDst = gPlttBufferFaded + palOffset; + u16 * src = gPlttBufferUnfaded + palOffset; + u16 * dst = gPlttBufferFaded + palOffset; u32 defaultBlendColor = DEFAULT_LIGHT_COLOR; - u16 *palDataSrcEnd = palDataSrc + 16; - u16 altBlendIndices = *palDataDst++ = *palDataSrc++; // color 0 is copied through unchanged + u16 *srcEnd = src + 16; + u16 altBlendIndices = *dst++ = *src++; // color 0 is copied through unchanged u32 altBlendColor; newR = ((blendColor << 27) >> 27) << 3; @@ -1358,7 +1359,7 @@ void TintPalette_RGB_Copy(u16 palOffset, u32 blendColor) { if (altBlendIndices >> 15) { // High bit set; bitmask of which colors to alt-blend // Note that bit 0 of altBlendIndices specifies color 1 - altBlendColor = palDataSrc[14]; // color 15 + altBlendColor = src[14]; // color 15 if (altBlendColor >> 15) { // Set alternate blend color rTone = ((altBlendColor << 27) >> 27) << 3; gTone = ((altBlendColor << 22) >> 27) << 3; @@ -1371,11 +1372,11 @@ void TintPalette_RGB_Copy(u16 palOffset, u32 blendColor) { } else { altBlendIndices = 0; } - while (palDataSrc != palDataSrcEnd) { - u32 palDataSrcColor = *palDataSrc; - s32 r = (palDataSrcColor << 27) >> 27; - s32 g = (palDataSrcColor << 22) >> 27; - s32 b = (palDataSrcColor << 17) >> 27; + while (src != srcEnd) { + u32 srcColor = *src; + s32 r = (srcColor << 27) >> 27; + s32 g = (srcColor << 22) >> 27; + s32 b = (srcColor << 17) >> 27; if (altBlendIndices & 1) { r = (u16)((rTone * r)) >> 8; @@ -1392,8 +1393,8 @@ void TintPalette_RGB_Copy(u16 palOffset, u32 blendColor) { g = 31; if (b > 31) b = 31; - palDataSrc++; - *palDataDst++ = RGB2(r, g, b); + src++; + *dst++ = RGB2(r, g, b); altBlendIndices >>= 1; } } From 4bb7abb520dabd862cc0be3e85fd6e8f5f9b8878 Mon Sep 17 00:00:00 2001 From: Ariel Antonitis Date: Wed, 21 Apr 2021 02:53:24 -0400 Subject: [PATCH 029/104] Fixed palette fades during intermediate times of day. --- include/palette.h | 10 +++++-- src/overworld.c | 5 +++- src/palette.c | 74 +++++++++++++++++++++++++++++++++++------------ 3 files changed, 68 insertions(+), 21 deletions(-) diff --git a/include/palette.h b/include/palette.h index 4fbde048aa4c..4b7abd865c80 100644 --- a/include/palette.h +++ b/include/palette.h @@ -28,7 +28,13 @@ enum struct PaletteFadeControl { - u32 multipurpose1; + u32 multipurpose1; // This field needs to exist or errors will occur + u16 blendColor1:15; + u16 tint1:1; + u32 tint0:1; + u32 coeff0:5; + u32 coeff1:5; + u32 weight:9; u8 delayCounter:6; u16 y:5; // blend coefficient u16 targetY:5; // target blend coefficient @@ -66,7 +72,7 @@ u8 UpdatePaletteFade(void); void ResetPaletteFade(void); void ReadPlttIntoBuffers(void); bool8 BeginNormalPaletteFade(u32, s8, u8, u8, u16); -bool8 BeginTimeOfDayPaletteFade(u32, s8, u8, u8, u16); +bool8 BeginTimeOfDayPaletteFade(u32, s8, u8, u8, struct BlendSettings *, struct BlendSettings *, u16); bool8 unref_sub_8073D3C(u32, u8, u8, u8, u16); void unref_sub_8073D84(u8, u32 *); void ResetPaletteStructByUid(u16); diff --git a/src/overworld.c b/src/overworld.c index 0028d976f4c7..53b693a834b1 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -1514,7 +1514,10 @@ static bool8 FadePalettesWithTime(void) { // Only used to fade back in gTimeOfDay = UpdateTimeOfDay(); if (MapHasNaturalLight(gMapHeader.mapType)) { ResetPaletteFade(); - BeginTimeOfDayPaletteFade(0xFFFFFFFF, 0, 16, sTimeOfDayBlendVars[gTimeOfDay].coeff, sTimeOfDayBlendVars[gTimeOfDay].blendColor); + BeginTimeOfDayPaletteFade(0xFFFFFFFF, 0, 16, 0, + (struct BlendSettings *)&sTimeOfDayBlendVars[currentTimeBlend.time0], + (struct BlendSettings *)&sTimeOfDayBlendVars[currentTimeBlend.time1], + currentTimeBlend.weight); } } diff --git a/src/palette.c b/src/palette.c index e1c9628aa2da..9015a42ee8f7 100644 --- a/src/palette.c +++ b/src/palette.c @@ -55,6 +55,7 @@ static u8 UpdateTimeOfDayPaletteFade(void); static void UpdateBlendRegisters(void); static bool8 IsSoftwarePaletteFadeFinishing(void); static void Task_BlendPalettesGradually(u8 taskId); +static void BlendPalettesFine(u32 palettes, u16 *src, u16 *dst, u32 coeff, u32 color); // palette buffers require alignment with agbcc because // unaligned word reads are issued in BlendPalette otherwise @@ -204,10 +205,10 @@ bool8 BeginNormalPaletteFade(u32 selectedPalettes, s8 delay, u8 startY, u8 targe } // Like normal palette fade but respects sprite/tile palettes immune to time of day fading -bool8 BeginTimeOfDayPaletteFade(u32 selectedPalettes, s8 delay, u8 startY, u8 targetY, u16 blendColor) +// Blend color here is always assumed to be 0 (black). +bool8 BeginTimeOfDayPaletteFade(u32 selectedPalettes, s8 delay, u8 startY, u8 targetY, struct BlendSettings *bld0, struct BlendSettings *bld1, u16 weight) { u8 temp; - u16 color = blendColor; if (gPaletteFade.active) { @@ -228,10 +229,17 @@ bool8 BeginTimeOfDayPaletteFade(u32 selectedPalettes, s8 delay, u8 startY, u8 ta gPaletteFade_delay = delay; gPaletteFade.y = startY; gPaletteFade.targetY = targetY; - gPaletteFade.blendColor = color; gPaletteFade.active = 1; gPaletteFade.mode = TIME_OF_DAY_FADE; + gPaletteFade.blendColor = bld0->blendColor; + gPaletteFade.coeff0 = bld0->coeff; + gPaletteFade.tint0 = bld0->isTint; + gPaletteFade.blendColor1 = bld1->blendColor; + gPaletteFade.coeff1 = bld1->coeff; + gPaletteFade.tint1 = bld1->isTint; + gPaletteFade.weight = weight; + if (startY < targetY) gPaletteFade.yDec = 0; else @@ -462,6 +470,12 @@ static u8 UpdateTimeOfDayPaletteFade(void) u8 paletteNum; u16 paletteOffset; u16 selectedPalettes; + u16 timePalettes = 0; // palettes passed to the time-blender + u16 copyPalettes; + u16 * src; + u16 * dst; + struct BlendSettings bld0; + struct BlendSettings bld1; if (!gPaletteFade.active) return PALETTE_FADE_STATUS_DONE; @@ -491,22 +505,47 @@ static u8 UpdateTimeOfDayPaletteFade(void) paletteOffset = 256; } - for (paletteNum = 0; paletteNum < 16; paletteNum++, selectedPalettes >>= 1, paletteOffset += 16) { - if (selectedPalettes & 1) { - if (gPaletteFade.yDec) { - if (gPaletteFade.objPaletteToggle) { // sprite palettes - if (gPaletteFade.y >= gPaletteFade.targetY || GetSpritePaletteTagByPaletteNum(paletteNum) & 0x8000) - TimeBlendPalette(paletteOffset, gPaletteFade.y, gPaletteFade.blendColor); - // tile palettes - } else if (gPaletteFade.y >= gPaletteFade.targetY || (paletteNum >= 13 && paletteNum <= 15)) { - TimeBlendPalette(paletteOffset, gPaletteFade.y, gPaletteFade.blendColor); - } - } else { - TimeBlendPalette(paletteOffset, gPaletteFade.y, gPaletteFade.blendColor); - } + // Extract blend settings from palette fade struct TODO: Embed struct within gPaletteFade + bld0.blendColor = gPaletteFade.blendColor; + bld0.coeff = gPaletteFade.coeff0; + bld0.isTint = gPaletteFade.tint0; + bld1.blendColor = gPaletteFade.blendColor1; + bld1.coeff = gPaletteFade.coeff1; + bld1.isTint = gPaletteFade.tint1; + + src = gPlttBufferUnfaded + paletteOffset; + dst = gPlttBufferFaded + paletteOffset; + + // First pply TOD blend to relevant subset of palettes + if (gPaletteFade.objPaletteToggle) { // Sprite palettes, don't blend those with tags + u8 i; + u16 j = 1; + for (i = 0; i < 16; i++, j <<= 1) { // Mask out palettes that should not be light blended + if ((selectedPalettes & j) && !(GetSpritePaletteTagByPaletteNum(i) >> 15)) + timePalettes |= j; + } + + } else { // tile palettes, don't blend [13, 15] + timePalettes = selectedPalettes &= ~0xE000; + } + TimeMixPalettes(timePalettes, src, dst, &bld0, &bld1, gPaletteFade.weight); + + // palettes that were not blended above must be copied through + if ((copyPalettes = ~timePalettes)) { + u16 * src1 = src; + u16 * dst1 = dst; + while (copyPalettes) { + if (copyPalettes & 1) + CpuFastCopy(src1, dst1, 64); + copyPalettes >>= 1; + src1 += 16; + dst1 += 16; } } + // Then, blend from faded->faded with native BlendPalettes + BlendPalettesFine(selectedPalettes, dst, dst, gPaletteFade.y, 0); + gPaletteFade.objPaletteToggle ^= 1; if (!gPaletteFade.objPaletteToggle) @@ -981,8 +1020,7 @@ static void BlendPalettesFine(u32 palettes, u16 *src, u16 *dst, u32 coeff, u32 c do { if (palettes & 1) { u16 *srcEnd = src + 16; - *dst++ = *src++; // transparency is copied-through - while (src != srcEnd) { + while (src != srcEnd) { // Transparency is blended because it can matter for tile palettes u32 srcColor = *src; s32 r = (srcColor << 27) >> 27; s32 g = (srcColor << 22) >> 27; From 96d0f7ed7d78eb18fb618a7a04f6766bbf34caa8 Mon Sep 17 00:00:00 2001 From: Ariel Antonitis Date: Thu, 22 Apr 2021 03:54:42 -0400 Subject: [PATCH 030/104] Fixed bug in TOD blending. --- src/overworld.c | 2 +- src/palette.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/overworld.c b/src/overworld.c index 53b693a834b1..8bcbc17aaa18 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -1529,7 +1529,7 @@ void UpdatePalettesWithTime(u32 palettes) { if (GetSpritePaletteTagByPaletteNum(i) >> 15) // Don't blend special sprite palette tags palettes &= ~(1 << (i + 16)); } - palettes &= ~0xE000; // Don't blend tile palettes [13,15] + palettes &= 0xFFFF1FFF; // Don't blend tile palettes [13,15] if (!palettes) return; TimeMixPalettes(palettes, diff --git a/src/palette.c b/src/palette.c index 9015a42ee8f7..704740a06705 100644 --- a/src/palette.c +++ b/src/palette.c @@ -526,7 +526,7 @@ static u8 UpdateTimeOfDayPaletteFade(void) } } else { // tile palettes, don't blend [13, 15] - timePalettes = selectedPalettes &= ~0xE000; + timePalettes = selectedPalettes & 0x1FFF; } TimeMixPalettes(timePalettes, src, dst, &bld0, &bld1, gPaletteFade.weight); From 741e880c245bbeaff47599ae120a8d3a2d3cbd2a Mon Sep 17 00:00:00 2001 From: Ariel Antonitis Date: Sat, 24 Apr 2021 00:43:53 -0400 Subject: [PATCH 031/104] Increased TOD update interval. --- src/overworld.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/overworld.c b/src/overworld.c index 8bcbc17aaa18..ce68cfbd8930 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -1557,7 +1557,7 @@ static void OverworldBasic(void) UpdatePaletteFade(); UpdateTilesetAnimations(); DoScheduledBgTilemapCopiesToVram(); - if (!(gPaletteFade.active || (timeCounter++ % 60))) { + if (!(gPaletteFade.active || (timeCounter++ % 3600))) { struct TimeBlendSettings cachedBlend = { .time0 = currentTimeBlend.time0, .time1 = currentTimeBlend.time1, From a4680ed572c831138450a673677c5cb439db53a2 Mon Sep 17 00:00:00 2001 From: Ariel Antonitis Date: Sat, 24 Apr 2021 00:57:11 -0400 Subject: [PATCH 032/104] Minor TOD documentation. --- src/overworld.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/overworld.c b/src/overworld.c index ce68cfbd8930..659d8bec92ca 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -1474,7 +1474,7 @@ u8 UpdateTimeOfDay(void) { RtcCalcLocalTime(); hours = gLocalTime.hours; minutes = gLocalTime.minutes; - if (hours >= 22 || hours < 4) { + if (hours >= 22 || hours < 4) { // night currentTimeBlend.weight = 256; return gTimeOfDay = currentTimeBlend.time0 = currentTimeBlend.time1 = TIME_OF_DAY_NIGHT; } else if (hours >= 4 && hours < 7) { // night->twilight @@ -1501,7 +1501,8 @@ u8 UpdateTimeOfDay(void) { currentTimeBlend.weight = 256 - 256 * ((hours - 20) * 60 + minutes) / ((22-20)*60); return gTimeOfDay = TIME_OF_DAY_NIGHT; } else { // This should never occur - return TIME_OF_DAY_MAX; + currentTimeBlend.weight = 256; + return gTimeOfDay = currentTimeBlend.time0 = currentTimeBlend.time1 = TIME_OF_DAY_DAY; } } @@ -1557,6 +1558,7 @@ static void OverworldBasic(void) UpdatePaletteFade(); UpdateTilesetAnimations(); DoScheduledBgTilemapCopiesToVram(); + // Every minute if no palette fade is active, update TOD blending as needed if (!(gPaletteFade.active || (timeCounter++ % 3600))) { struct TimeBlendSettings cachedBlend = { .time0 = currentTimeBlend.time0, From dbc4cb82932414cee4ef00f4d2d61e5f2a6f1001 Mon Sep 17 00:00:00 2001 From: Ariel Antonitis Date: Sat, 24 Apr 2021 01:12:04 -0400 Subject: [PATCH 033/104] Refactored BlendSettings storage inside gPaletteFade. --- include/palette.h | 22 ++++++++++------------ src/overworld.c | 2 +- src/palette.c | 21 ++++----------------- 3 files changed, 15 insertions(+), 30 deletions(-) diff --git a/include/palette.h b/include/palette.h index 4b7abd865c80..886c05c3867e 100644 --- a/include/palette.h +++ b/include/palette.h @@ -26,15 +26,19 @@ enum FAST_FADE_OUT_TO_BLACK, }; +struct BlendSettings { + u16 blendColor:15; + u16 isTint:1; + u8 coeff:5; +}; + struct PaletteFadeControl { u32 multipurpose1; // This field needs to exist or errors will occur - u16 blendColor1:15; - u16 tint1:1; - u32 tint0:1; - u32 coeff0:5; - u32 coeff1:5; - u32 weight:9; + // These three are only used for TOD blending + struct BlendSettings *bld0; + struct BlendSettings *bld1; + u16 weight:9; // [0, 256], so must be 9 bits u8 delayCounter:6; u16 y:5; // blend coefficient u16 targetY:5; // target blend coefficient @@ -52,12 +56,6 @@ struct PaletteFadeControl u8 deltaY:4; // rate of change of blend coefficient }; -struct BlendSettings { - u16 blendColor:15; - u16 isTint:1; - u8 coeff:5; -}; - extern struct PaletteFadeControl gPaletteFade; extern u32 gPlttBufferTransferPending; extern u8 gPaletteDecompressionBuffer[]; diff --git a/src/overworld.c b/src/overworld.c index 659d8bec92ca..a3b3649fa87c 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -1506,7 +1506,7 @@ u8 UpdateTimeOfDay(void) { } } -static bool8 MapHasNaturalLight(u8 mapType) { // Weather a map type is naturally lit/outside +static bool8 MapHasNaturalLight(u8 mapType) { // Whether a map type is naturally lit/outside return mapType == MAP_TYPE_TOWN || mapType == MAP_TYPE_CITY || mapType == MAP_TYPE_ROUTE || mapType == MAP_TYPE_OCEAN_ROUTE; } diff --git a/src/palette.c b/src/palette.c index 704740a06705..d7974779ca3b 100644 --- a/src/palette.c +++ b/src/palette.c @@ -232,12 +232,9 @@ bool8 BeginTimeOfDayPaletteFade(u32 selectedPalettes, s8 delay, u8 startY, u8 ta gPaletteFade.active = 1; gPaletteFade.mode = TIME_OF_DAY_FADE; - gPaletteFade.blendColor = bld0->blendColor; - gPaletteFade.coeff0 = bld0->coeff; - gPaletteFade.tint0 = bld0->isTint; - gPaletteFade.blendColor1 = bld1->blendColor; - gPaletteFade.coeff1 = bld1->coeff; - gPaletteFade.tint1 = bld1->isTint; + gPaletteFade.blendColor = 0; + gPaletteFade.bld0 = bld0; + gPaletteFade.bld1 = bld1; gPaletteFade.weight = weight; if (startY < targetY) @@ -474,8 +471,6 @@ static u8 UpdateTimeOfDayPaletteFade(void) u16 copyPalettes; u16 * src; u16 * dst; - struct BlendSettings bld0; - struct BlendSettings bld1; if (!gPaletteFade.active) return PALETTE_FADE_STATUS_DONE; @@ -505,14 +500,6 @@ static u8 UpdateTimeOfDayPaletteFade(void) paletteOffset = 256; } - // Extract blend settings from palette fade struct TODO: Embed struct within gPaletteFade - bld0.blendColor = gPaletteFade.blendColor; - bld0.coeff = gPaletteFade.coeff0; - bld0.isTint = gPaletteFade.tint0; - bld1.blendColor = gPaletteFade.blendColor1; - bld1.coeff = gPaletteFade.coeff1; - bld1.isTint = gPaletteFade.tint1; - src = gPlttBufferUnfaded + paletteOffset; dst = gPlttBufferFaded + paletteOffset; @@ -528,7 +515,7 @@ static u8 UpdateTimeOfDayPaletteFade(void) } else { // tile palettes, don't blend [13, 15] timePalettes = selectedPalettes & 0x1FFF; } - TimeMixPalettes(timePalettes, src, dst, &bld0, &bld1, gPaletteFade.weight); + TimeMixPalettes(timePalettes, src, dst, gPaletteFade.bld0, gPaletteFade.bld1, gPaletteFade.weight); // palettes that were not blended above must be copied through if ((copyPalettes = ~timePalettes)) { From 4454a6397b3c0006916ad071f788781ffa61e2ef Mon Sep 17 00:00:00 2001 From: Ariel Antonitis Date: Sat, 24 Apr 2021 01:17:39 -0400 Subject: [PATCH 034/104] Fixed bug where TOD was updated too frequently. --- include/overworld.h | 1 + include/palette.h | 1 - src/overworld.c | 8 ++--- src/palette.c | 72 +-------------------------------------------- 4 files changed, 6 insertions(+), 76 deletions(-) diff --git a/include/overworld.h b/include/overworld.h index 2180a87a9b9c..58cf5b16affa 100644 --- a/include/overworld.h +++ b/include/overworld.h @@ -141,6 +141,7 @@ void CleanupOverworldWindowsAndTilemaps(void); bool32 IsUpdateLinkStateCBActive(void); void CB1_Overworld(void); void CB2_OverworldBasic(void); +u8 UpdateTimeOfDay(void); void UpdatePalettesWithTime(u32); void CB2_Overworld(void); void SetMainCallback1(void (*cb)(void)); diff --git a/include/palette.h b/include/palette.h index 886c05c3867e..89de237c238c 100644 --- a/include/palette.h +++ b/include/palette.h @@ -88,7 +88,6 @@ void BlendPalettesUnfaded(u32, u8, u16); void BlendPalettesGradually(u32 selectedPalettes, s8 delay, u8 coeff, u8 coeffTarget, u16 color, u8 priority, u8 id); void TimeBlendPalette(u16 palOffset, u32 coeff, u32 blendColor); void TintPalette_RGB_Copy(u16 palOffset, u32 blendColor); -void TimeBlendPalettes(u32 palettes, u32 coeff, u32 blendColor); void TimeMixPalettes(u32, u16 *, u16 *, struct BlendSettings *, struct BlendSettings *, u16); void TintPalette_GrayScale(u16 *palette, u16 count); void TintPalette_GrayScale2(u16 *palette, u16 count); diff --git a/src/overworld.c b/src/overworld.c index a3b3649fa87c..51e4279fb8b9 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -186,7 +186,7 @@ static u16 (*sPlayerKeyInterceptCallback)(u32); static bool8 sReceivingFromLink; static u8 sRfuKeepAliveTimer; -static u8 timeCounter; +static u16 sTimeUpdateCounter; // playTimeVBlanks will eventually overflow, so this is used to update TOD static struct TimeBlendSettings currentTimeBlend; // IWRAM common @@ -1542,7 +1542,7 @@ void UpdatePalettesWithTime(u32 palettes) { } } -u8 UpdateSpritePaletteWithTime(u8 paletteNum) { // TODO: Optimize this +u8 UpdateSpritePaletteWithTime(u8 paletteNum) { UpdatePalettesWithTime(1 << (paletteNum + 16)); return paletteNum; } @@ -1559,13 +1559,13 @@ static void OverworldBasic(void) UpdateTilesetAnimations(); DoScheduledBgTilemapCopiesToVram(); // Every minute if no palette fade is active, update TOD blending as needed - if (!(gPaletteFade.active || (timeCounter++ % 3600))) { + if (!(gPaletteFade.active || (++sTimeUpdateCounter % 3600))) { struct TimeBlendSettings cachedBlend = { .time0 = currentTimeBlend.time0, .time1 = currentTimeBlend.time1, .weight = currentTimeBlend.weight, }; - timeCounter = 0; + sTimeUpdateCounter = 0; UpdateTimeOfDay(); if (cachedBlend.time0 != currentTimeBlend.time0 || cachedBlend.time1 != currentTimeBlend.time1 diff --git a/src/palette.c b/src/palette.c index d7974779ca3b..37b30d0c38ab 100644 --- a/src/palette.c +++ b/src/palette.c @@ -1084,78 +1084,8 @@ void TimeBlendPalette(u16 palOffset, u32 coeff, u32 blendColor) { } } -void TimeBlendPalettes(u32 palettes, u32 coeff, u32 blendColor) { - s32 newR, newG, newB, defR, defG, defB, altR, altG, altB; - u16 * src; - u16 * dst; - u32 defaultBlendColor = DEFAULT_LIGHT_COLOR; - - if (!palettes) - return; - - coeff *= 2; - newR = (blendColor << 27) >> 27; - newG = (blendColor << 22) >> 27; - newB = (blendColor << 17) >> 27; - defR = (defaultBlendColor << 27) >> 27; - defG = (defaultBlendColor << 22) >> 27; - defB = (defaultBlendColor << 17) >> 27; - src = gPlttBufferUnfaded; - dst = gPlttBufferFaded; - - do { - if (palettes & 1) { - u16 *srcEnd = src + 16; - u16 altBlendIndices = *dst++ = *src++; // color 0 is copied through - u32 altBlendColor; - if (altBlendIndices >> 15) { // High bit set; bitmask of which colors to alt-blend - // Note that bit 0 of altBlendIndices specifies color 1 - altBlendColor = src[14]; // color 15 - if (altBlendColor >> 15) { // Set alternate blend color - altR = (altBlendColor << 27) >> 27; - altG = (altBlendColor << 22) >> 27; - altB = (altBlendColor << 17) >> 27; - } else { - altBlendColor = 0; - } - } else { - altBlendIndices = 0; - } - while (src != srcEnd) { - u32 srcColor = *src; - s32 r = (srcColor << 27) >> 27; - s32 g = (srcColor << 22) >> 27; - s32 b = (srcColor << 17) >> 27; - - if (altBlendIndices & 1) { - if (altBlendColor) { // Use alternate blend color - *dst = ((r + (((altR - r) * coeff) >> 5)) << 0) - | ((g + (((altG - g) * coeff) >> 5)) << 5) - | ((b + (((altB - b) * coeff) >> 5)) << 10); - } else { // Use default blend color - *dst = ((r + (((defR - r) * coeff) >> 5)) << 0) - | ((g + (((defG - g) * coeff) >> 5)) << 5) - | ((b + (((defB - b) * coeff) >> 5)) << 10); - } - } else { // Use provided blend color - *dst = ((r + (((newR - r) * coeff) >> 5)) << 0) - | ((g + (((newG - g) * coeff) >> 5)) << 5) - | ((b + (((newB - b) * coeff) >> 5)) << 10); - } - src++; - dst++; - altBlendIndices >>= 1; - } - } else { - src += 16; - dst += 16; - } - palettes >>= 1; - } while (palettes); -} - // Blends a weighted average of two blend parameters -// TODO: Should pointers be marked as const? +// Parameters can be either blended (as in BlendPalettes) or tinted (as in TintPaletteRGB_Copy) void TimeMixPalettes(u32 palettes, u16 *src, u16 *dst, struct BlendSettings *blend0, struct BlendSettings *blend1, u16 weight0) { s32 r0, g0, b0, r1, g1, b1, defR, defG, defB, altR, altG, altB; u32 color0, coeff0, color1, coeff1; From 68e43a8f0453d44077cbf992f780cad17ada8483 Mon Sep 17 00:00:00 2001 From: Ariel Antonitis Date: Sat, 24 Apr 2021 01:35:19 -0400 Subject: [PATCH 035/104] Updated time-of-day-based evolution methods. --- src/pokemon.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/pokemon.c b/src/pokemon.c index 0b50a72f3ae4..21daf2ec61c6 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -4878,7 +4878,7 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov temp2 = itemEffect[itemEffectParam]; dataSigned = GetMonData(mon, sGetMonDataEVConstants[temp1], NULL); evChange = temp2; - + if (evChange > 0) // Increasing EV (HP or Atk) { // Has EV increase limit already been reached? @@ -4976,7 +4976,7 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov { if (!usedByAI) { - // Restore HP + // Restore HP dataUnsigned = GetMonData(mon, MON_DATA_HP, NULL) + dataUnsigned; if (dataUnsigned > GetMonData(mon, MON_DATA_MAX_HP, NULL)) dataUnsigned = GetMonData(mon, MON_DATA_MAX_HP, NULL); @@ -5055,7 +5055,7 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov dataUnsigned = CalculatePPWithBonus(moveId, GetMonData(mon, MON_DATA_PP_BONUSES, NULL), moveIndex); } SetMonData(mon, MON_DATA_PP1 + moveIndex, &dataUnsigned); - + // Heal battler PP too (if applicable) if (gMain.inBattle && battlerId != MAX_BATTLERS_COUNT && !(gBattleMons[battlerId].status2 & STATUS2_TRANSFORMED) @@ -5092,7 +5092,7 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov case 5: effectFlags = itemEffect[i]; temp1 = 0; - + // Loop through and try each of the ITEM5 effects while (effectFlags != 0) { @@ -5437,13 +5437,13 @@ u16 GetEvolutionTargetSpecies(struct Pokemon *mon, u8 mode, u16 evolutionItem) targetSpecies = gEvolutionTable[species][i].targetSpecies; break; case EVO_FRIENDSHIP_DAY: - RtcCalcLocalTime(); - if (gLocalTime.hours >= 12 && gLocalTime.hours < 24 && friendship >= 220) + UpdateTimeOfDay(); + if (gTimeOfDay != TIME_OF_DAY_NIGHT && friendship >= 220) targetSpecies = gEvolutionTable[species][i].targetSpecies; break; case EVO_FRIENDSHIP_NIGHT: - RtcCalcLocalTime(); - if (gLocalTime.hours >= 0 && gLocalTime.hours < 12 && friendship >= 220) + UpdateTimeOfDay(); + if (gTimeOfDay == TIME_OF_DAY_NIGHT && friendship >= 220) targetSpecies = gEvolutionTable[species][i].targetSpecies; break; case EVO_LEVEL: From a160012dbfd6eebbec05fd2442154055c3da8419 Mon Sep 17 00:00:00 2001 From: Ariel Antonitis Date: Sat, 24 Apr 2021 02:18:41 -0400 Subject: [PATCH 036/104] Added shadow toggle to weather structure. --- include/field_weather.h | 3 ++- src/event_object_movement.c | 4 ++-- src/field_effect_helpers.c | 1 + src/field_weather.c | 1 + src/field_weather_effect.c | 13 +++++++++++++ 5 files changed, 19 insertions(+), 3 deletions(-) diff --git a/include/field_weather.h b/include/field_weather.h index 9c6a4ab7add9..c462707f9d4e 100644 --- a/include/field_weather.h +++ b/include/field_weather.h @@ -45,7 +45,8 @@ struct Weather s8 gammaTargetIndex; u8 gammaStepDelay; u8 gammaStepFrameCounter; - u16 fadeDestColor; + u16 fadeDestColor:15; + u16 noShadows:1; // Certain weathers require blend coeffs that do not work nice with shadows u8 palProcessingState; u8 fadeScreenCounter; bool8 readyForInit; diff --git a/src/event_object_movement.c b/src/event_object_movement.c index ce94116aa0e7..939ff3ca6ded 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -8856,14 +8856,14 @@ static void GroundEffect_Shadow(struct ObjectEvent *objEvent, struct Sprite *spr static void DoFlaggedGroundEffects(struct ObjectEvent *objEvent, struct Sprite *sprite, u32 flags) { u8 i; - if (ObjectEventIsFarawayIslandMew(objEvent) == TRUE && !ShouldMewShakeGrass(objEvent)) return; for (i = 0; i < ARRAY_COUNT(sGroundEffectFuncs); i++, flags >>= 1) if (flags & 1) sGroundEffectFuncs[i](objEvent, sprite); - GroundEffect_Shadow(objEvent, sprite); + if (!gWeatherPtr->noShadows) + GroundEffect_Shadow(objEvent, sprite); } void filters_out_some_ground_effects(struct ObjectEvent *objEvent, u32 *flags) diff --git a/src/field_effect_helpers.c b/src/field_effect_helpers.c index f3d4d71491b2..ed5ffecd6285 100755 --- a/src/field_effect_helpers.c +++ b/src/field_effect_helpers.c @@ -349,6 +349,7 @@ void UpdateShadowFieldEffect(struct Sprite *sprite) sprite->invisible = linkedSprite->invisible; if (!objectEvent->active || objectEvent->noShadow + || gWeatherPtr->noShadows || MetatileBehavior_IsPokeGrass(objectEvent->currentMetatileBehavior) || MetatileBehavior_IsSurfableWaterOrUnderwater(objectEvent->currentMetatileBehavior) || MetatileBehavior_IsSurfableWaterOrUnderwater(objectEvent->previousMetatileBehavior)) diff --git a/src/field_weather.c b/src/field_weather.c index 0b8427c2935a..e94d6f254ee9 100644 --- a/src/field_weather.c +++ b/src/field_weather.c @@ -255,6 +255,7 @@ static void Task_WeatherMain(u8 taskId) static void None_Init(void) { Weather_SetBlendCoeffs(8, 12); // Indoor shadows + gWeatherPtr->noShadows = FALSE; gWeatherPtr->gammaTargetIndex = 0; gWeatherPtr->gammaStepDelay = 0; } diff --git a/src/field_weather_effect.c b/src/field_weather_effect.c index d8eff78b7b48..36ca937b6a72 100644 --- a/src/field_weather_effect.c +++ b/src/field_weather_effect.c @@ -95,6 +95,7 @@ static const struct SpriteTemplate sCloudSpriteTemplate = void Clouds_InitVars(void) { + gWeatherPtr->noShadows = FALSE; gWeatherPtr->gammaTargetIndex = 0; gWeatherPtr->gammaStepDelay = 20; gWeatherPtr->weatherGfxLoaded = FALSE; @@ -156,6 +157,7 @@ void Sunny_InitVars(void) gWeatherPtr->gammaTargetIndex = 0; gWeatherPtr->gammaStepDelay = 20; Weather_SetBlendCoeffs(8, 12); + gWeatherPtr->noShadows = FALSE; } void Sunny_InitAll(void) @@ -239,6 +241,7 @@ void Drought_InitVars(void) gWeatherPtr->weatherGfxLoaded = FALSE; gWeatherPtr->gammaTargetIndex = 0; gWeatherPtr->gammaStepDelay = 0; + gWeatherPtr->noShadows = FALSE; } void Drought_InitAll(void) @@ -482,6 +485,7 @@ void Rain_InitVars(void) gWeatherPtr->gammaStepDelay = 20; SetRainStrengthFromSoundEffect(SE_RAIN); Weather_SetBlendCoeffs(8, 12); // preserve shadow darkness + gWeatherPtr->noShadows = FALSE; } void Rain_InitAll(void) @@ -776,6 +780,7 @@ void Snow_InitVars(void) gWeatherPtr->targetSnowflakeSpriteCount = 16; gWeatherPtr->snowflakeVisibleCounter = 0; Weather_SetBlendCoeffs(8, 12); // preserve shadow darkness + gWeatherPtr->noShadows = FALSE; } void Snow_InitAll(void) @@ -1052,6 +1057,7 @@ void Thunderstorm_InitVars(void) gWeatherPtr->thunderTriggered = FALSE; SetRainStrengthFromSoundEffect(SE_THUNDERSTORM); Weather_SetBlendCoeffs(8, 12); // preserve shadow darkness + gWeatherPtr->noShadows = FALSE; } void Thunderstorm_InitAll(void) @@ -1081,6 +1087,7 @@ void Downpour_InitVars(void) gWeatherPtr->weatherGfxLoaded = FALSE; // duplicate assignment SetRainStrengthFromSoundEffect(SE_DOWNPOUR); Weather_SetBlendCoeffs(8, 12); // preserve shadow darkness + gWeatherPtr->noShadows = FALSE; } void Downpour_InitAll(void) @@ -1378,6 +1385,7 @@ void FogHorizontal_InitVars(void) gWeatherPtr->fogHScrollPosX = 0; Weather_SetBlendCoeffs(0, 16); } + gWeatherPtr->noShadows = TRUE; // TODO: Can fog be made compatible with shadows? } void FogHorizontal_InitAll(void) @@ -1532,6 +1540,7 @@ void Ash_InitVars(void) Weather_SetBlendCoeffs(0, 12); // SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(64, 63)); // These aren't valid blend coefficients! } + gWeatherPtr->noShadows = FALSE; } void Ash_InitAll(void) @@ -1748,6 +1757,7 @@ void FogDiagonal_InitVars(void) gWeatherPtr->fogDPosY = 0; Weather_SetBlendCoeffs(0, 16); } + gWeatherPtr->noShadows = TRUE; } void FogDiagonal_InitAll(void) @@ -1961,6 +1971,7 @@ void Sandstorm_InitVars(void) Weather_SetBlendCoeffs(0, 16); } + gWeatherPtr->noShadows = TRUE; // TODO: Can sandstorm be compatible with shadows? } void Sandstorm_InitAll(void) @@ -2248,6 +2259,7 @@ void Shade_InitVars(void) gWeatherPtr->gammaTargetIndex = 3; gWeatherPtr->gammaStepDelay = 20; Weather_SetBlendCoeffs(8, 12); // preserve shadow darkness + gWeatherPtr->noShadows = FALSE; } void Shade_InitAll(void) @@ -2309,6 +2321,7 @@ void Bubbles_InitVars(void) gWeatherPtr->bubblesCoordsIndex = 0; gWeatherPtr->bubblesSpriteCount = 0; } + gWeatherPtr->noShadows = TRUE; } void Bubbles_InitAll(void) From 0cc6c7b111e60ee941a5b858a9ce54e19a5d83a3 Mon Sep 17 00:00:00 2001 From: Ariel Antonitis Date: Sat, 24 Apr 2021 02:56:16 -0400 Subject: [PATCH 037/104] Made BlendPalettesFine global. --- include/palette.h | 1 + src/palette.c | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/palette.h b/include/palette.h index 89de237c238c..3b0368aca411 100644 --- a/include/palette.h +++ b/include/palette.h @@ -84,6 +84,7 @@ void UnfadePlttBuffer(u32); void BeginFastPaletteFade(u8); void BeginHardwarePaletteFade(u8, u8, u8, u8, u8); void BlendPalettes(u32 selectedPalettes, u8 coeff, u16 color); +void BlendPalettesFine(u32 palettes, u16 *src, u16 *dst, u32 coeff, u32 color); void BlendPalettesUnfaded(u32, u8, u16); void BlendPalettesGradually(u32 selectedPalettes, s8 delay, u8 coeff, u8 coeffTarget, u16 color, u8 priority, u8 id); void TimeBlendPalette(u16 palOffset, u32 coeff, u32 blendColor); diff --git a/src/palette.c b/src/palette.c index 37b30d0c38ab..8b08eb9e486d 100644 --- a/src/palette.c +++ b/src/palette.c @@ -55,7 +55,6 @@ static u8 UpdateTimeOfDayPaletteFade(void); static void UpdateBlendRegisters(void); static bool8 IsSoftwarePaletteFadeFinishing(void); static void Task_BlendPalettesGradually(u8 taskId); -static void BlendPalettesFine(u32 palettes, u16 *src, u16 *dst, u32 coeff, u32 color); // palette buffers require alignment with agbcc because // unaligned word reads are issued in BlendPalette otherwise @@ -993,7 +992,7 @@ static bool8 IsSoftwarePaletteFadeFinishing(void) } // optimized based on lucktyphlosion's BlendPalettesFine -static void BlendPalettesFine(u32 palettes, u16 *src, u16 *dst, u32 coeff, u32 color) { +void BlendPalettesFine(u32 palettes, u16 *src, u16 *dst, u32 coeff, u32 color) { s32 newR, newG, newB; if (!palettes) From c0d6692ce8a43abb1968eb779a3273351da7911a Mon Sep 17 00:00:00 2001 From: Ariel Antonitis Date: Sat, 24 Apr 2021 02:56:33 -0400 Subject: [PATCH 038/104] Fixed weather gamma blending. --- src/field_weather.c | 12 ++++++++---- src/overworld.c | 1 + 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/field_weather.c b/src/field_weather.c index e94d6f254ee9..089fcf98944a 100644 --- a/src/field_weather.c +++ b/src/field_weather.c @@ -16,6 +16,7 @@ #include "task.h" #include "trig.h" #include "gpu_regs.h" +#include "overworld.h" #define DROUGHT_COLOR_INDEX(color) ((((color) >> 1) & 0xF) | (((color) >> 2) & 0xF0) | (((color) >> 3) & 0xF00)) @@ -473,10 +474,12 @@ static void ApplyGammaShift(u8 startPalIndex, u8 numPalettes, s8 gammaIndex) // Loop through the speficied palette range and apply necessary gamma shifts to the colors. while (curPalIndex < numPalettes) { + CpuFastCopy(gPlttBufferUnfaded + palOffset, gPlttBufferFaded + palOffset, 16 * sizeof(u16)); + UpdatePalettesWithTime(1 << (palOffset >> 4)); if (sPaletteGammaTypes[curPalIndex] == GAMMA_NONE) { // No palette change. - CpuFastCopy(gPlttBufferUnfaded + palOffset, gPlttBufferFaded + palOffset, 16 * sizeof(u16)); + // CpuFastCopy(gPlttBufferUnfaded + palOffset, gPlttBufferFaded + palOffset, 16 * sizeof(u16)); palOffset += 16; } else @@ -491,7 +494,7 @@ static void ApplyGammaShift(u8 startPalIndex, u8 numPalettes, s8 gammaIndex) for (i = 0; i < 16; i++) { // Apply gamma shift to the original color. - struct RGBColor baseColor = *(struct RGBColor *)&gPlttBufferUnfaded[palOffset]; + struct RGBColor baseColor = *(struct RGBColor *)&gPlttBufferFaded[palOffset]; r = gammaTable[baseColor.r]; g = gammaTable[baseColor.g]; b = gammaTable[baseColor.b]; @@ -554,10 +557,11 @@ static void ApplyGammaShiftWithBlend(u8 startPalIndex, u8 numPalettes, s8 gammaI while (curPalIndex < numPalettes) { + UpdatePalettesWithTime(1 << (palOffset >> 4)); // Apply TOD blend if (sPaletteGammaTypes[curPalIndex] == GAMMA_NONE) { // No gamma shift. Simply blend the colors. - BlendPalette(palOffset, 16, blendCoeff, blendColor); + BlendPalettesFine(1 << (palOffset >> 4), gPlttBufferFaded, gPlttBufferFaded, blendCoeff, blendColor); palOffset += 16; } else @@ -571,7 +575,7 @@ static void ApplyGammaShiftWithBlend(u8 startPalIndex, u8 numPalettes, s8 gammaI for (i = 0; i < 16; i++) { - struct RGBColor baseColor = *(struct RGBColor *)&gPlttBufferUnfaded[palOffset]; + struct RGBColor baseColor = *(struct RGBColor *)&gPlttBufferFaded[palOffset]; u8 r = gammaTable[baseColor.r]; u8 g = gammaTable[baseColor.g]; u8 b = gammaTable[baseColor.b]; diff --git a/src/overworld.c b/src/overworld.c index 51e4279fb8b9..99d8294947f7 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -1511,6 +1511,7 @@ static bool8 MapHasNaturalLight(u8 mapType) { // Whether a map type is naturally || mapType == MAP_TYPE_OCEAN_ROUTE; } +// TODO: Rewrite palette fading to work with FadeScreen static bool8 FadePalettesWithTime(void) { // Only used to fade back in gTimeOfDay = UpdateTimeOfDay(); if (MapHasNaturalLight(gMapHeader.mapType)) { From 65e616342b8ea414dd175e0fee116f7aaf7105eb Mon Sep 17 00:00:00 2001 From: Ariel Antonitis Date: Sat, 24 Apr 2021 03:24:14 -0400 Subject: [PATCH 039/104] Changed time blending to work with FadeScreen. --- common_syms/overworld.txt | 1 + include/overworld.h | 5 +++++ include/palette.h | 2 +- src/field_weather.c | 16 +++++++++++++--- src/overworld.c | 30 ++++++++++++++++-------------- src/palette.c | 9 ++++----- 6 files changed, 40 insertions(+), 23 deletions(-) diff --git a/common_syms/overworld.txt b/common_syms/overworld.txt index 48333620987e..cc92cee1e21c 100644 --- a/common_syms/overworld.txt +++ b/common_syms/overworld.txt @@ -7,3 +7,4 @@ gFieldCallback2 gLocalLinkPlayerId gFieldLinkPlayerCount gTimeOfDay +currentTimeBlend diff --git a/include/overworld.h b/include/overworld.h index 58cf5b16affa..2a1353b7bc55 100644 --- a/include/overworld.h +++ b/include/overworld.h @@ -62,11 +62,15 @@ extern void (*gFieldCallback)(void); extern bool8 (*gFieldCallback2)(void); extern u8 gLocalLinkPlayerId; extern u8 gFieldLinkPlayerCount; + extern u8 gTimeOfDay; +extern struct TimeBlendSettings currentTimeBlend; // Exported ROM declarations extern const struct UCoords32 gDirectionToVectors[]; +extern const struct BlendSettings gTimeOfDayBlend[]; + void DoWhiteOut(void); void Overworld_ResetStateAfterFly(void); void Overworld_ResetStateAfterTeleport(void); @@ -142,6 +146,7 @@ bool32 IsUpdateLinkStateCBActive(void); void CB1_Overworld(void); void CB2_OverworldBasic(void); u8 UpdateTimeOfDay(void); +bool8 MapHasNaturalLight(u8 mapType); void UpdatePalettesWithTime(u32); void CB2_Overworld(void); void SetMainCallback1(void (*cb)(void)); diff --git a/include/palette.h b/include/palette.h index 3b0368aca411..201e85380081 100644 --- a/include/palette.h +++ b/include/palette.h @@ -70,7 +70,7 @@ u8 UpdatePaletteFade(void); void ResetPaletteFade(void); void ReadPlttIntoBuffers(void); bool8 BeginNormalPaletteFade(u32, s8, u8, u8, u16); -bool8 BeginTimeOfDayPaletteFade(u32, s8, u8, u8, struct BlendSettings *, struct BlendSettings *, u16); +bool8 BeginTimeOfDayPaletteFade(u32, s8, u8, u8, struct BlendSettings *, struct BlendSettings *, u16, u16); bool8 unref_sub_8073D3C(u32, u8, u8, u8, u16); void unref_sub_8073D84(u8, u32 *); void ResetPaletteStructByUid(u16); diff --git a/src/field_weather.c b/src/field_weather.c index 089fcf98944a..bbc7506e329e 100644 --- a/src/field_weather.c +++ b/src/field_weather.c @@ -472,6 +472,7 @@ static void ApplyGammaShift(u8 startPalIndex, u8 numPalettes, s8 gammaIndex) curPalIndex = startPalIndex; // Loop through the speficied palette range and apply necessary gamma shifts to the colors. + // TODO: Optimize this to work with time blending while (curPalIndex < numPalettes) { CpuFastCopy(gPlttBufferUnfaded + palOffset, gPlttBufferFaded + palOffset, 16 * sizeof(u16)); @@ -647,7 +648,7 @@ static void ApplyDroughtGammaShiftWithBlend(s8 gammaIndex, u8 blendCoeff, u16 bl } } -static void ApplyFogBlend(u8 blendCoeff, u16 blendColor) +static void ApplyFogBlend(u8 blendCoeff, u16 blendColor) // TODO: How does this interact with time { struct RGBColor color; u8 rBlend; @@ -794,9 +795,18 @@ void FadeScreen(u8 mode, s8 delay) { gWeatherPtr->fadeDestColor = fadeColor; if (useWeatherPal) - gWeatherPtr->fadeScreenCounter = 0; - else + gWeatherPtr->fadeScreenCounter = 0; // Triggers gamma-shift-based fade-in + else { + UpdateTimeOfDay(); + if (MapHasNaturalLight(gMapHeader.mapType)) { + BeginTimeOfDayPaletteFade(PALETTES_ALL, delay, 16, 0, + (struct BlendSettings *)&gTimeOfDayBlend[currentTimeBlend.time0], + (struct BlendSettings *)&gTimeOfDayBlend[currentTimeBlend.time1], + currentTimeBlend.weight, fadeColor); + } else { BeginNormalPaletteFade(PALETTES_ALL, delay, 16, 0, fadeColor); + } + } gWeatherPtr->palProcessingState = WEATHER_PAL_STATE_SCREEN_FADING_IN; gWeatherPtr->fadeInFirstFrame = TRUE; diff --git a/src/overworld.c b/src/overworld.c index 99d8294947f7..5e4aa1a32f07 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -187,7 +187,7 @@ static bool8 sReceivingFromLink; static u8 sRfuKeepAliveTimer; static u16 sTimeUpdateCounter; // playTimeVBlanks will eventually overflow, so this is used to update TOD -static struct TimeBlendSettings currentTimeBlend; + // IWRAM common u16 *gBGTilemapBuffers1; @@ -200,6 +200,7 @@ u8 gLocalLinkPlayerId; // This is our player id in a multiplayer mode. u8 gFieldLinkPlayerCount; u8 gTimeOfDay; +struct TimeBlendSettings currentTimeBlend; // EWRAM vars EWRAM_DATA static u8 sObjectEventLoadFlag = 0; @@ -828,7 +829,7 @@ void LoadMapFromCameraTransition(u8 mapGroup, u8 mapNum) RoamerMove(); DoCurrentWeather(); ResetFieldTasksArgs(); - UpdatePalettesWithTime(0xFFFFFFFF); + UpdatePalettesWithTime(PALETTES_ALL); RunOnResumeMapScript(); if (gMapHeader.regionMapSectionId != MAPSEC_BATTLE_FRONTIER @@ -1462,7 +1463,7 @@ void CB1_Overworld(void) -static const struct BlendSettings sTimeOfDayBlendVars[] = +const struct BlendSettings gTimeOfDayBlend[] = { [TIME_OF_DAY_NIGHT] = {.coeff = 10, .blendColor = 0x1400}, [TIME_OF_DAY_TWILIGHT] = {.coeff = 4, .blendColor = 0x56dc, .isTint = TRUE}, @@ -1506,20 +1507,21 @@ u8 UpdateTimeOfDay(void) { } } -static bool8 MapHasNaturalLight(u8 mapType) { // Whether a map type is naturally lit/outside +bool8 MapHasNaturalLight(u8 mapType) { // Whether a map type is naturally lit/outside return mapType == MAP_TYPE_TOWN || mapType == MAP_TYPE_CITY || mapType == MAP_TYPE_ROUTE || mapType == MAP_TYPE_OCEAN_ROUTE; } // TODO: Rewrite palette fading to work with FadeScreen +// Currently, this cancels the "Normal" palette fade started by FadeScreen static bool8 FadePalettesWithTime(void) { // Only used to fade back in - gTimeOfDay = UpdateTimeOfDay(); + UpdateTimeOfDay(); if (MapHasNaturalLight(gMapHeader.mapType)) { ResetPaletteFade(); - BeginTimeOfDayPaletteFade(0xFFFFFFFF, 0, 16, 0, - (struct BlendSettings *)&sTimeOfDayBlendVars[currentTimeBlend.time0], - (struct BlendSettings *)&sTimeOfDayBlendVars[currentTimeBlend.time1], - currentTimeBlend.weight); + BeginTimeOfDayPaletteFade(PALETTES_ALL, 0, 16, 0, + (struct BlendSettings *)&gTimeOfDayBlend[currentTimeBlend.time0], + (struct BlendSettings *)&gTimeOfDayBlend[currentTimeBlend.time1], + currentTimeBlend.weight, 0); } } @@ -1537,8 +1539,8 @@ void UpdatePalettesWithTime(u32 palettes) { TimeMixPalettes(palettes, gPlttBufferUnfaded, gPlttBufferFaded, - (struct BlendSettings *)&sTimeOfDayBlendVars[currentTimeBlend.time0], - (struct BlendSettings *)&sTimeOfDayBlendVars[currentTimeBlend.time1], + (struct BlendSettings *)&gTimeOfDayBlend[currentTimeBlend.time0], + (struct BlendSettings *)&gTimeOfDayBlend[currentTimeBlend.time1], currentTimeBlend.weight); } } @@ -1571,7 +1573,7 @@ static void OverworldBasic(void) if (cachedBlend.time0 != currentTimeBlend.time0 || cachedBlend.time1 != currentTimeBlend.time1 || cachedBlend.weight != currentTimeBlend.weight) - UpdatePalettesWithTime(0xFFFFFFFF); + UpdatePalettesWithTime(PALETTES_ALL); } } @@ -1686,7 +1688,7 @@ static void CB2_LoadMap2(void) DoMapLoadLoop(&gMain.state); SetFieldVBlankCallback(); SetMainCallback1(CB1_Overworld); - FadePalettesWithTime(); + // FadePalettesWithTime(); SetMainCallback2(CB2_Overworld); } @@ -1743,7 +1745,7 @@ static void CB2_ReturnToFieldLocal(void) if (ReturnToFieldLocal(&gMain.state)) { SetFieldVBlankCallback(); - FadePalettesWithTime(); + // FadePalettesWithTime(); SetMainCallback2(CB2_Overworld); } } diff --git a/src/palette.c b/src/palette.c index 8b08eb9e486d..b947f464c3f2 100644 --- a/src/palette.c +++ b/src/palette.c @@ -204,8 +204,7 @@ bool8 BeginNormalPaletteFade(u32 selectedPalettes, s8 delay, u8 startY, u8 targe } // Like normal palette fade but respects sprite/tile palettes immune to time of day fading -// Blend color here is always assumed to be 0 (black). -bool8 BeginTimeOfDayPaletteFade(u32 selectedPalettes, s8 delay, u8 startY, u8 targetY, struct BlendSettings *bld0, struct BlendSettings *bld1, u16 weight) +bool8 BeginTimeOfDayPaletteFade(u32 selectedPalettes, s8 delay, u8 startY, u8 targetY, struct BlendSettings *bld0, struct BlendSettings *bld1, u16 weight, u16 color) { u8 temp; @@ -231,7 +230,7 @@ bool8 BeginTimeOfDayPaletteFade(u32 selectedPalettes, s8 delay, u8 startY, u8 ta gPaletteFade.active = 1; gPaletteFade.mode = TIME_OF_DAY_FADE; - gPaletteFade.blendColor = 0; + gPaletteFade.blendColor = color; gPaletteFade.bld0 = bld0; gPaletteFade.bld1 = bld1; gPaletteFade.weight = weight; @@ -522,7 +521,7 @@ static u8 UpdateTimeOfDayPaletteFade(void) u16 * dst1 = dst; while (copyPalettes) { if (copyPalettes & 1) - CpuFastCopy(src1, dst1, 64); + CpuFastCopy(src1, dst1, 32); copyPalettes >>= 1; src1 += 16; dst1 += 16; @@ -530,7 +529,7 @@ static u8 UpdateTimeOfDayPaletteFade(void) } // Then, blend from faded->faded with native BlendPalettes - BlendPalettesFine(selectedPalettes, dst, dst, gPaletteFade.y, 0); + BlendPalettesFine(selectedPalettes, dst, dst, gPaletteFade.y, gPaletteFade.blendColor); gPaletteFade.objPaletteToggle ^= 1; From 7b59eabbcff3c07bebd31e97a264d172f2bb23c9 Mon Sep 17 00:00:00 2001 From: Ariel Antonitis Date: Sat, 24 Apr 2021 17:23:35 -0400 Subject: [PATCH 040/104] Changed fog to be compatible with transparent shadows. --- .../field_effects/pics/shadow_extra_large.png | Bin 152 -> 5188 bytes graphics/field_effects/pics/shadow_large.png | Bin 144 -> 4911 bytes graphics/field_effects/pics/shadow_medium.png | Bin 143 -> 4767 bytes graphics/field_effects/pics/shadow_small.png | Bin 143 -> 4807 bytes graphics/weather/fog.pal | 2 +- src/data/field_effects/field_effect_objects.h | 8 +++--- src/field_weather_effect.c | 23 +++++++++++++++--- 7 files changed, 24 insertions(+), 9 deletions(-) diff --git a/graphics/field_effects/pics/shadow_extra_large.png b/graphics/field_effects/pics/shadow_extra_large.png index 765a5291a8d9eb0f6508e5d9e223c421112ca56b..eb334a976c597db39f56470dcb6e90b9123a3dd4 100644 GIT binary patch literal 5188 zcmeHKX;@Ro8V*~56p&RAgM?regzO1fWDyCF2%#822#9c!oP+>bOacV#?R5i-OGO0{ z1r)HBi()Gvf-5MC3aGe%Wzn{X;tFU*tWfSr!0oyHDOh1N2xeK8d9#13B}1EQk5E zgu&E3Pa|WFI=h-oifpR&lW|#tBe_Du>IqubGU?9V&Kmk8kz)%tw;gPy-S)44ef4hJ zWabuD)s|9PUasfSDBf?ISz`|>PAzmyJNJ{i|NPX#`hi~4ESGqb2eOdvKlc?rgI@{7 z?=tkSkE8Uw*rq7BKT$eVg=lx)w>@Ziy|sZiWr!2{b(DABk?l@3=`E|b%-_Gi8gpNC z;@o890g8UA?h6xZ&kVCss`-;ZOn5LVqpx8p{N#g;-dPG)J*3b1OFrtsRowcktD-K+ zn8pu}$jv=B6g(T4H8>ypJgB7C+$YLxa_?w$;lA!}x%AxefYhW8tJrPEIfvZJW4>FH zm1&x@X)n>&2=T5U{ieaM_FL*Of`T#Mp(QU7p)%%&2IDZbdyZs<1N zyxUrSVNdnE!%K`Rd%bs>j#Qpm)sh6;Pz78u`uWe)a8gN<>=$qNzM-|5>qqa|KdiHc zp>EHn`stXAGkjfkL<+ys{eI3wxXb0;b4{&tjAp4X;Wz3l2>T?SWi{PZBNk=Cbw$%U_j@m0h}TZwUYTqhH3^Tj!Wt?L@8*2t51?A+y8r*GLlPRT!e?{2JOf0@#AHB>Zcij|tCw&s5FYA4O3|G^LTt6kz`ZHGT_qHo!c@--MOa79EMOiI5Ae z*@aOq@Mdq*bhl%F0ji(Y$2r8=u$z_)>dFIwh@O$f%ZE(QIb>Co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fpl-(pRmat2RVKbLh*2~7Zaj3H$J diff --git a/graphics/field_effects/pics/shadow_large.png b/graphics/field_effects/pics/shadow_large.png index e917823b05cd96f64884877479f9c8df82d73483..1695208af543eee620304317dd419295cbe6d44a 100644 GIT binary patch literal 4911 zcmeHKYg7~077ij+!B?dM3YIY_SHUEckiaA+0ummnCSpJkg~DVqA)|Sb2}uA^E=qlH z^~y^`@d3j1QSnjj)go#^xJVUIQL(nZuoSRXpruNElzS3TaozrLt=oTQt(=)T``h2% z`#bxbWY&jELdV!owx>`iV?<#>DY!!5J94-!7?*v1ub4uyJ&+o?*dRqskWQ~v5Goup zr08%6Hxmj9#eAz`%ktbuo})whk8PM`BM6Xjw}vh~4p*3Y5 zy0twmyL?{!eQiEp$!eP3zAiM|=}?E6zpHZjhRUB_c5|}sE_iVN=sM;!W!sC+-*eB_ zcb42!d8Kx)rfOSid-w}`uXZsu(DURm$Dh5FM$&_8+K0#4KkSUUSoiZDhkE3@m8Uw| zPsK&7@_pW{4eCv;nN!1GGp$r{rI`}Lu-o4;W7+(G&9%l|;dy=Kqis^0_x4pE=>DYb zN?J*2kKm(*y~3}*CgETAq|cUg;<1_+-nH(=EymyaQrwc7qfL)ZmmZ^+l2W5N9%aAl z9~zUMLgs*iNBE?=ZqHtIVP>n%x8G${)jN&L56N;_?0NM}M7an%v2pVJ$d6UZB3JW4 zrt^auv5evxm*u(rqt4cZ8yV5?H{+HnyOusNZgg`sWlnR<|1e6o`1*qUc&}|_Isb~} zrccz7?3R*@N!i~YnEIt>`;JgzL?8WdQ>)kIEyk@=#@;X&duPapk{@`ApVbTK&v zOlv?SV*@50{K(n$m-=ftK^)Q5e5qs$zaa9Mym4l`DkW~^_1bH>xDV+a6&EW=F_Pmx zt#YDgUSJl)9yHG^k5Vlu`AU|Y6;Lt4UEh(jX~oU^q1WpDwq>_qAG-hB zip(3yxlTUgvFYPa1XD&eX2%$$ZAUKC6h~o6uxxRWQ?Vr5W#mIhlK1hWKc+sdrS1EJ zp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ff --git a/graphics/weather/fog.pal b/graphics/weather/fog.pal index 6191b6692855..1f40dd4e74f5 100644 --- a/graphics/weather/fog.pal +++ b/graphics/weather/fog.pal @@ -10,7 +10,7 @@ JASC-PAL 213 213 213 222 222 222 164 164 164 -255 0 255 +0 0 0 255 0 255 255 0 255 180 180 180 diff --git a/src/data/field_effects/field_effect_objects.h b/src/data/field_effects/field_effect_objects.h index 516ade7cbe18..2fd33a4cb142 100755 --- a/src/data/field_effects/field_effect_objects.h +++ b/src/data/field_effects/field_effect_objects.h @@ -32,13 +32,13 @@ const struct SpriteFrameImage gFieldEffectObjectPicTable_BallLight[] = { obj_frame_tiles(gFieldEffectObjectPic_BallLight), }; -const struct SpriteTemplate gFieldEffectObjectTemplate_ShadowSmall = {0xFFFF, OBJ_EVENT_PAL_TAG_MAY, &gObjectEventBaseOam_8x8, sAnimTable_Shadow, sPicTable_ShadowSmall, gDummySpriteAffineAnimTable, UpdateShadowFieldEffect}; +const struct SpriteTemplate gFieldEffectObjectTemplate_ShadowSmall = {0xFFFF, TAG_WEATHER_START, &gObjectEventBaseOam_8x8, sAnimTable_Shadow, sPicTable_ShadowSmall, gDummySpriteAffineAnimTable, UpdateShadowFieldEffect}; -const struct SpriteTemplate gFieldEffectObjectTemplate_ShadowMedium = {0xFFFF, OBJ_EVENT_PAL_TAG_MAY, &gObjectEventBaseOam_16x8, sAnimTable_Shadow, sPicTable_ShadowMedium, gDummySpriteAffineAnimTable, UpdateShadowFieldEffect}; +const struct SpriteTemplate gFieldEffectObjectTemplate_ShadowMedium = {0xFFFF, TAG_WEATHER_START, &gObjectEventBaseOam_16x8, sAnimTable_Shadow, sPicTable_ShadowMedium, gDummySpriteAffineAnimTable, UpdateShadowFieldEffect}; -const struct SpriteTemplate gFieldEffectObjectTemplate_ShadowLarge = {0xFFFF, OBJ_EVENT_PAL_TAG_MAY, &gObjectEventBaseOam_32x8, sAnimTable_Shadow, sPicTable_ShadowLarge, gDummySpriteAffineAnimTable, UpdateShadowFieldEffect}; +const struct SpriteTemplate gFieldEffectObjectTemplate_ShadowLarge = {0xFFFF, TAG_WEATHER_START, &gObjectEventBaseOam_32x8, sAnimTable_Shadow, sPicTable_ShadowLarge, gDummySpriteAffineAnimTable, UpdateShadowFieldEffect}; -const struct SpriteTemplate gFieldEffectObjectTemplate_ShadowExtraLarge = {0xFFFF, OBJ_EVENT_PAL_TAG_MAY, &gObjectEventBaseOam_64x32, sAnimTable_Shadow, sPicTable_ShadowExtraLarge, gDummySpriteAffineAnimTable, UpdateShadowFieldEffect}; +const struct SpriteTemplate gFieldEffectObjectTemplate_ShadowExtraLarge = {0xFFFF, TAG_WEATHER_START, &gObjectEventBaseOam_64x32, sAnimTable_Shadow, sPicTable_ShadowExtraLarge, gDummySpriteAffineAnimTable, UpdateShadowFieldEffect}; const struct SpriteTemplate gFieldEffectObjectTemplate_BallLight = {0xFFFF, OBJ_EVENT_PAL_TAG_LIGHT, &gObjectEventBaseOam_32x32, sAnimTable_Inanimate, gFieldEffectObjectPicTable_BallLight, gDummySpriteAffineAnimTable, UpdateLightSprite}; diff --git a/src/field_weather_effect.c b/src/field_weather_effect.c index 36ca937b6a72..da6c9601f21a 100644 --- a/src/field_weather_effect.c +++ b/src/field_weather_effect.c @@ -7,11 +7,13 @@ #include "script.h" #include "constants/weather.h" #include "constants/songs.h" +#include "constants/rgb.h" #include "sound.h" #include "sprite.h" #include "task.h" #include "trig.h" #include "gpu_regs.h" +#include "palette.h" // EWRAM EWRAM_DATA static u8 gCurrentAbnormalWeather = 0; @@ -1372,6 +1374,9 @@ void FogHorizontal_Main(void); static void CreateFogHorizontalSprites(void); static void DestroyFogHorizontalSprites(void); +// Within the weather palette, shadow sprites' color index +#define SHADOW_COLOR_INDEX 9 + void FogHorizontal_InitVars(void) { gWeatherPtr->initStep = 0; @@ -1385,7 +1390,7 @@ void FogHorizontal_InitVars(void) gWeatherPtr->fogHScrollPosX = 0; Weather_SetBlendCoeffs(0, 16); } - gWeatherPtr->noShadows = TRUE; // TODO: Can fog be made compatible with shadows? + gWeatherPtr->noShadows = FALSE; } void FogHorizontal_InitAll(void) @@ -1407,9 +1412,14 @@ void FogHorizontal_Main(void) { case 0: CreateFogHorizontalSprites(); - if (gWeatherPtr->currWeather == WEATHER_FOG_HORIZONTAL) - Weather_SetTargetBlendCoeffs(12, 8, 3); - else + if (gWeatherPtr->currWeather == WEATHER_FOG_HORIZONTAL) { + u8 paletteNum = IndexOfSpritePaletteTag(TAG_WEATHER_START); + Weather_SetTargetBlendCoeffs(12, 8, 3); + if (paletteNum != 0xFF) { // Lighten shadow color to match + u16 index = (paletteNum+16)*16+SHADOW_COLOR_INDEX; // Shadow color index + gPlttBufferUnfaded[index] = gPlttBufferFaded[index] = 0x3DEF; // Gray + } + } else Weather_SetTargetBlendCoeffs(4, 16, 0); gWeatherPtr->initStep++; break; @@ -1425,6 +1435,7 @@ void FogHorizontal_Main(void) bool8 FogHorizontal_Finish(void) { + u8 paletteNum = IndexOfSpritePaletteTag(TAG_WEATHER_START); gWeatherPtr->fogHScrollPosX = (gSpriteCoordOffsetX - gWeatherPtr->fogHScrollOffset) & 0xFF; if (++gWeatherPtr->fogHScrollCounter > 3) { @@ -1447,6 +1458,10 @@ bool8 FogHorizontal_Finish(void) gWeatherPtr->finishStep++; break; default: + if (paletteNum != 0xFF) { // Change shadow color back to black + u16 index = (paletteNum+16)*16+SHADOW_COLOR_INDEX; + gPlttBufferUnfaded[index] = gPlttBufferFaded[index] = RGB_BLACK; + } return FALSE; } return TRUE; From c3fdaca8e262a83b1238f6931b737d4c7201bf2d Mon Sep 17 00:00:00 2001 From: Ariel Antonitis Date: Sat, 24 Apr 2021 18:10:37 -0400 Subject: [PATCH 041/104] Fixed sandstorm shadow color. --- src/field_weather_effect.c | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/src/field_weather_effect.c b/src/field_weather_effect.c index da6c9601f21a..bda62fcf067e 100644 --- a/src/field_weather_effect.c +++ b/src/field_weather_effect.c @@ -1377,6 +1377,17 @@ static void DestroyFogHorizontalSprites(void); // Within the weather palette, shadow sprites' color index #define SHADOW_COLOR_INDEX 9 +// Updates just the color of shadows to match special weather blending +static u8 UpdateShadowColor(u16 color) { + u8 paletteNum = IndexOfSpritePaletteTag(TAG_WEATHER_START); + if (paletteNum != 0xFF) { + u16 index = (paletteNum+16)*16+SHADOW_COLOR_INDEX; + gPlttBufferUnfaded[index] = gPlttBufferFaded[index] = color; + UpdateSpritePaletteWithTime(paletteNum); + } + return paletteNum; +} + void FogHorizontal_InitVars(void) { gWeatherPtr->initStep = 0; @@ -1415,10 +1426,7 @@ void FogHorizontal_Main(void) if (gWeatherPtr->currWeather == WEATHER_FOG_HORIZONTAL) { u8 paletteNum = IndexOfSpritePaletteTag(TAG_WEATHER_START); Weather_SetTargetBlendCoeffs(12, 8, 3); - if (paletteNum != 0xFF) { // Lighten shadow color to match - u16 index = (paletteNum+16)*16+SHADOW_COLOR_INDEX; // Shadow color index - gPlttBufferUnfaded[index] = gPlttBufferFaded[index] = 0x3DEF; // Gray - } + UpdateShadowColor(0x3DEF); // Gray } else Weather_SetTargetBlendCoeffs(4, 16, 0); gWeatherPtr->initStep++; @@ -1435,7 +1443,6 @@ void FogHorizontal_Main(void) bool8 FogHorizontal_Finish(void) { - u8 paletteNum = IndexOfSpritePaletteTag(TAG_WEATHER_START); gWeatherPtr->fogHScrollPosX = (gSpriteCoordOffsetX - gWeatherPtr->fogHScrollOffset) & 0xFF; if (++gWeatherPtr->fogHScrollCounter > 3) { @@ -1458,10 +1465,7 @@ bool8 FogHorizontal_Finish(void) gWeatherPtr->finishStep++; break; default: - if (paletteNum != 0xFF) { // Change shadow color back to black - u16 index = (paletteNum+16)*16+SHADOW_COLOR_INDEX; - gPlttBufferUnfaded[index] = gPlttBufferFaded[index] = RGB_BLACK; - } + UpdateShadowColor(RGB_BLACK); return FALSE; } return TRUE; @@ -1986,7 +1990,7 @@ void Sandstorm_InitVars(void) Weather_SetBlendCoeffs(0, 16); } - gWeatherPtr->noShadows = TRUE; // TODO: Can sandstorm be compatible with shadows? + gWeatherPtr->noShadows = FALSE; } void Sandstorm_InitAll(void) @@ -2011,7 +2015,8 @@ void Sandstorm_Main(void) gWeatherPtr->initStep++; break; case 1: - Weather_SetTargetBlendCoeffs(16, 0, 0); + Weather_SetTargetBlendCoeffs(16, 2, 0); + UpdateShadowColor(0x3DEF); gWeatherPtr->initStep++; break; case 2: @@ -2037,9 +2042,12 @@ bool8 Sandstorm_Finish(void) case 1: if (Weather_UpdateBlend()) gWeatherPtr->finishStep++; + if (gWeatherPtr->currBlendEVB == 12) + UpdateShadowColor(RGB_BLACK); break; case 2: DestroySandstormSprites(); + UpdateShadowColor(RGB_BLACK); gWeatherPtr->finishStep++; break; default: From 37d0e17be491625384ba738acaa135b9e9f71a60 Mon Sep 17 00:00:00 2001 From: Ariel Antonitis Date: Sat, 24 Apr 2021 21:21:01 -0400 Subject: [PATCH 042/104] Fixed shadow hot springs bug. --- data/layouts/LavaridgeTown/map.bin | 2 +- data/maps/LavaridgeTown/map.json | 2 +- src/event_object_movement.c | 2 +- src/field_effect_helpers.c | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/data/layouts/LavaridgeTown/map.bin b/data/layouts/LavaridgeTown/map.bin index 604ad5f3f8ed..a001f8cd388f 100644 --- a/data/layouts/LavaridgeTown/map.bin +++ b/data/layouts/LavaridgeTown/map.bin @@ -1,3 +1,3 @@ -qqqq{ttttt|qqqqqqq66{tttzq2®2®2®2®2xttttttttr{™š››œ2tž2|qqqNKLOq6rr¡£2¼2£2£2¥JHIMyy0123rr¡»233»2¥PQRS2289:;Æ4Æ4rr©ª2£2¼2¬2­XYZ[Ö5×5`ABCÆ4Æ4rr±²³³´µ`abcæ5ç50 1"1044rrº2¨2¨2¨2¹2Š20 1"10000 1"1000rr¨2˜2¨2˜2Œ2’20 1"1000 1"1000rr¨ B¨ BŠ00 1!11111!1!1111rr‘2‘‘2‘’200(1)1)1)1)1)1)1)1)1)1)1rrª1«1«1«1«1¬1000000000000rr²³³³³´0000 0 0 +qqqq{ttttt|qqqqqqq66{tttzq2®2®2®2®2xttttttttr{™š››œ2tž2|qqqNKLOq6rr¡£2¼2£2£2¥JHIMyy0123rr¡»2£2£2»2¥PQRS2289:;Æ4Æ4rr©ª2£2¼2¬2­XYZ[Ö5×5`ABCÆ4Æ4rr±²³³´µ`abcæ5ç50 1"1044rrº2¨2¨2¨2¹2Š20 1"10000 1"1000rr¨2˜2¨2˜2Œ2’20 1"1000 1"1000rr¨ B¨ BŠ00 1!11111!1!1111rr‘2‘‘2‘’200(1)1)1)1)1)1)1)1)1)1)1rrª1«1«1«1«1¬1000000000000rr²³³³³´0000 0 0 00 0 0 00rr¸¹º³»¼0000rrÀÁÂÅß000  Æ4rrÈ1É1ÊÍ˧000 !" !"Æ4rr00000000000040000Æ4m000000000000000Æ4Æ4qqrm0000000000000044qqllllllllllllllll \ No newline at end of file diff --git a/data/maps/LavaridgeTown/map.json b/data/maps/LavaridgeTown/map.json index 54bda6ca32a6..29b1d2d33f87 100644 --- a/data/maps/LavaridgeTown/map.json +++ b/data/maps/LavaridgeTown/map.json @@ -77,7 +77,7 @@ "x": 4, "y": 4, "elevation": 3, - "movement_type": "MOVEMENT_TYPE_FACE_DOWN_AND_RIGHT", + "movement_type": "MOVEMENT_TYPE_FACE_DOWN_AND_LEFT", "movement_range_x": 0, "movement_range_y": 0, "trainer_type": "TRAINER_TYPE_NONE", diff --git a/src/event_object_movement.c b/src/event_object_movement.c index 939ff3ca6ded..635659fb03cc 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -8862,7 +8862,7 @@ static void DoFlaggedGroundEffects(struct ObjectEvent *objEvent, struct Sprite * for (i = 0; i < ARRAY_COUNT(sGroundEffectFuncs); i++, flags >>= 1) if (flags & 1) sGroundEffectFuncs[i](objEvent, sprite); - if (!gWeatherPtr->noShadows) + if (!(gWeatherPtr->noShadows || objEvent->inHotSprings)) GroundEffect_Shadow(objEvent, sprite); } diff --git a/src/field_effect_helpers.c b/src/field_effect_helpers.c index ed5ffecd6285..43042303918f 100755 --- a/src/field_effect_helpers.c +++ b/src/field_effect_helpers.c @@ -349,6 +349,7 @@ void UpdateShadowFieldEffect(struct Sprite *sprite) sprite->invisible = linkedSprite->invisible; if (!objectEvent->active || objectEvent->noShadow + || objectEvent->inHotSprings || gWeatherPtr->noShadows || MetatileBehavior_IsPokeGrass(objectEvent->currentMetatileBehavior) || MetatileBehavior_IsSurfableWaterOrUnderwater(objectEvent->currentMetatileBehavior) From 4a5dbcb52ba695376986363a03808f4b42a6c8d2 Mon Sep 17 00:00:00 2001 From: Ariel Antonitis Date: Sun, 25 Apr 2021 00:56:23 -0400 Subject: [PATCH 043/104] Testing updating sprite palettes with weather + time. --- src/field_effect.c | 2 +- src/field_effect_helpers.c | 2 -- src/field_weather.c | 15 +++++++++++---- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/field_effect.c b/src/field_effect.c index 967e3d23985a..ad6bdd747aed 100644 --- a/src/field_effect.c +++ b/src/field_effect.c @@ -770,8 +770,8 @@ void FieldEffectScript_LoadFadedPalette(u8 **script) { struct SpritePalette *palette = (struct SpritePalette *)FieldEffectScript_ReadWord(script); LoadSpritePalette(palette); - UpdateSpritePaletteWithWeather(IndexOfSpritePaletteTag(palette->tag)); UpdateSpritePaletteWithTime(IndexOfSpritePaletteTag(palette->tag)); // Ensure field effects are blended + UpdateSpritePaletteWithWeather(IndexOfSpritePaletteTag(palette->tag)); (*script) += 4; } diff --git a/src/field_effect_helpers.c b/src/field_effect_helpers.c index 43042303918f..8c3cf5bb1c94 100755 --- a/src/field_effect_helpers.c +++ b/src/field_effect_helpers.c @@ -152,7 +152,6 @@ static void LoadObjectRegularReflectionPalette(struct ObjectEvent *objectEvent, } paletteNum = LoadSpritePalette(&filteredPalette); UpdateSpritePaletteWithWeather(paletteNum); - UpdateSpritePaletteWithTime(paletteNum); } sprite->oam.paletteNum = paletteNum; sprite->oam.objMode = 1; // Alpha blending @@ -205,7 +204,6 @@ static void UpdateObjectReflectionSprite(struct Sprite *reflectionSprite) } paletteNum = LoadSpritePalette(&filteredPalette); UpdateSpritePaletteWithWeather(paletteNum); - UpdateSpritePaletteWithTime(paletteNum); } reflectionSprite->oam.paletteNum = paletteNum; } diff --git a/src/field_weather.c b/src/field_weather.c index bbc7506e329e..d4444a098d35 100644 --- a/src/field_weather.c +++ b/src/field_weather.c @@ -536,8 +536,13 @@ static void ApplyGammaShift(u8 startPalIndex, u8 numPalettes, s8 gammaIndex) } else { - // No palette blending. + u32 palettes = 0; + u32 mask = 1 << startPalIndex; + u8 i; CpuFastCopy(gPlttBufferUnfaded + startPalIndex * 16, gPlttBufferFaded + startPalIndex * 16, numPalettes * 16 * sizeof(u16)); + for (i = 0; i < numPalettes; i++, mask <<= 1) + palettes |= mask; + UpdatePalettesWithTime(palettes); } } @@ -825,7 +830,6 @@ void UpdateSpritePaletteWithWeather(u8 spritePaletteIndex) { u16 paletteIndex = 16 + spritePaletteIndex; u16 i; - switch (gWeatherPtr->palProcessingState) { case WEATHER_PAL_STATE_SCREEN_FADING_IN: @@ -853,7 +857,10 @@ void UpdateSpritePaletteWithWeather(u8 spritePaletteIndex) else { paletteIndex *= 16; - BlendPalette(paletteIndex, 16, 12, RGB(28, 31, 28)); + // First blend with time + CpuFastCopy(gPlttBufferUnfaded + paletteIndex, gPlttBufferFaded + paletteIndex, 32); + UpdateSpritePaletteWithTime(spritePaletteIndex); + BlendPalettesFine(1 << (spritePaletteIndex + 16), gPlttBufferFaded + paletteIndex, gPlttBufferFaded + paletteIndex, 12, RGB(28, 31, 28)); } break; } @@ -876,8 +883,8 @@ static bool8 IsFirstFrameOfWeatherFadeIn(void) void LoadCustomWeatherSpritePalette(const u16 *palette) { LoadPalette(palette, 0x100 + gWeatherPtr->weatherPicSpritePalIndex * 16, 32); - UpdateSpritePaletteWithWeather(gWeatherPtr->weatherPicSpritePalIndex); UpdateSpritePaletteWithTime(gWeatherPtr->weatherPicSpritePalIndex); + UpdateSpritePaletteWithWeather(gWeatherPtr->weatherPicSpritePalIndex); } static void LoadDroughtWeatherPalette(u8 *gammaIndexPtr, u8 *a1) From 147e101df516cb9eeee81bbbe5e763bbd8e2637b Mon Sep 17 00:00:00 2001 From: Ariel Antonitis Date: Sun, 25 Apr 2021 17:00:07 -0400 Subject: [PATCH 044/104] More testing of fog blending. --- include/field_weather.h | 2 +- src/event_object_movement.c | 6 ++--- src/faraway_island.c | 2 +- src/field_effect.c | 3 +-- src/field_effect_helpers.c | 6 ++--- src/field_weather.c | 53 ++++++++++++++++++++++--------------- src/field_weather_effect.c | 7 +++++ src/overworld.c | 31 +++++++++------------- 8 files changed, 61 insertions(+), 49 deletions(-) diff --git a/include/field_weather.h b/include/field_weather.h index c462707f9d4e..ce1a91c4c756 100644 --- a/include/field_weather.h +++ b/include/field_weather.h @@ -151,7 +151,7 @@ void ApplyWeatherGammaShiftIfIdle(s8 gammaIndex); void sub_80ABC7C(u8 gammaIndex, u8 gammaTargetIndex, u8 gammaStepDelay); void FadeScreen(u8 mode, s8 delay); bool8 IsWeatherNotFadingIn(void); -void UpdateSpritePaletteWithWeather(u8 spritePaletteIndex); +void UpdateSpritePaletteWithWeather(u8 spritePaletteIndex, bool8 allowFog); void ApplyWeatherGammaShiftToPal(u8 paletteIndex); void LoadCustomWeatherSpritePalette(const u16 *palette); void ResetDroughtWeatherPaletteLoading(void); diff --git a/src/event_object_movement.c b/src/event_object_movement.c index 635659fb03cc..76fc26d05595 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -1684,7 +1684,7 @@ static void FollowerSetGraphics(struct ObjectEvent *objectEvent, u16 species, u8 if (palette[0] & 0x4000) // If color 15 is blended, use it as the alternate color palette[15] |= 0x8000; } - UpdateSpritePaletteWithTime(sprite->oam.paletteNum); + UpdateSpritePaletteWithWeather(sprite->oam.paletteNum, FALSE); } else sprite->oam.paletteNum = IndexOfSpritePaletteTag(spritePalette->tag); // Tag is always present } @@ -2186,7 +2186,7 @@ static u8 UpdateSpritePalette(const struct SpritePalette * spritePalette, struct sprite->inUse = TRUE; if (IndexOfSpritePaletteTag(spritePalette->tag) == 0xFF) { sprite->oam.paletteNum = LoadSpritePalette(spritePalette); - UpdateSpritePaletteWithTime(sprite->oam.paletteNum); + UpdateSpritePaletteWithWeather(sprite->oam.paletteNum, FALSE); } else { sprite->oam.paletteNum = LoadSpritePalette(spritePalette); } @@ -2443,7 +2443,7 @@ static u8 LoadSpritePaletteIfTagExists(const struct SpritePalette *spritePalette if (IndexOfSpritePaletteTag(spritePalette->tag) != 0xFF) return 0xFF; paletteNum = LoadSpritePalette(spritePalette); - UpdateSpritePaletteWithTime(paletteNum); + UpdateSpritePaletteWithWeather(paletteNum, FALSE); return paletteNum; } diff --git a/src/faraway_island.c b/src/faraway_island.c index bc08146523ea..28c5bcf78761 100755 --- a/src/faraway_island.c +++ b/src/faraway_island.c @@ -393,7 +393,7 @@ void SetMewAboveGrass(void) gSprites[mew->spriteId].subpriority = 1; LoadSpritePalette(&gSpritePalette_GeneralFieldEffect1); - UpdateSpritePaletteWithWeather(IndexOfSpritePaletteTag(gSpritePalette_GeneralFieldEffect1.tag)); + UpdateSpritePaletteWithWeather(IndexOfSpritePaletteTag(gSpritePalette_GeneralFieldEffect1.tag), FALSE); x = mew->currentCoords.x; y = mew->currentCoords.y; diff --git a/src/field_effect.c b/src/field_effect.c index ad6bdd747aed..4ef5ea497028 100644 --- a/src/field_effect.c +++ b/src/field_effect.c @@ -770,8 +770,7 @@ void FieldEffectScript_LoadFadedPalette(u8 **script) { struct SpritePalette *palette = (struct SpritePalette *)FieldEffectScript_ReadWord(script); LoadSpritePalette(palette); - UpdateSpritePaletteWithTime(IndexOfSpritePaletteTag(palette->tag)); // Ensure field effects are blended - UpdateSpritePaletteWithWeather(IndexOfSpritePaletteTag(palette->tag)); + UpdateSpritePaletteWithWeather(IndexOfSpritePaletteTag(palette->tag), FALSE); (*script) += 4; } diff --git a/src/field_effect_helpers.c b/src/field_effect_helpers.c index 8c3cf5bb1c94..389a3dce63b0 100755 --- a/src/field_effect_helpers.c +++ b/src/field_effect_helpers.c @@ -151,7 +151,7 @@ static void LoadObjectRegularReflectionPalette(struct ObjectEvent *objectEvent, ApplyIceFilter(mainSprite->oam.paletteNum, filteredData); } paletteNum = LoadSpritePalette(&filteredPalette); - UpdateSpritePaletteWithWeather(paletteNum); + UpdateSpritePaletteWithWeather(paletteNum, TRUE); } sprite->oam.paletteNum = paletteNum; sprite->oam.objMode = 1; // Alpha blending @@ -170,7 +170,7 @@ static void LoadObjectHighBridgeReflectionPalette(struct ObjectEvent *objectEven blueData[i] = 0x55c9; } sprite->oam.paletteNum = LoadSpritePalette(&bluePalette); - UpdateSpritePaletteWithWeather(sprite->oam.paletteNum); + UpdateSpritePaletteWithWeather(sprite->oam.paletteNum, TRUE); } static void UpdateObjectReflectionSprite(struct Sprite *reflectionSprite) @@ -203,7 +203,7 @@ static void UpdateObjectReflectionSprite(struct Sprite *reflectionSprite) ApplyIceFilter(mainSprite->oam.paletteNum, filteredData); } paletteNum = LoadSpritePalette(&filteredPalette); - UpdateSpritePaletteWithWeather(paletteNum); + UpdateSpritePaletteWithWeather(paletteNum, TRUE); } reflectionSprite->oam.paletteNum = paletteNum; } diff --git a/src/field_weather.c b/src/field_weather.c index d4444a098d35..aad85dfc6184 100644 --- a/src/field_weather.c +++ b/src/field_weather.c @@ -536,13 +536,16 @@ static void ApplyGammaShift(u8 startPalIndex, u8 numPalettes, s8 gammaIndex) } else { - u32 palettes = 0; - u32 mask = 1 << startPalIndex; - u8 i; - CpuFastCopy(gPlttBufferUnfaded + startPalIndex * 16, gPlttBufferFaded + startPalIndex * 16, numPalettes * 16 * sizeof(u16)); - for (i = 0; i < numPalettes; i++, mask <<= 1) - palettes |= mask; - UpdatePalettesWithTime(palettes); + if (MapHasNaturalLight(gMapHeader.mapType)) { // Time-blend + u32 palettes = 0; + u32 mask = 1 << startPalIndex; + u8 i; + for (i = 0; i < numPalettes; i++, mask <<= 1) + palettes |= mask; + UpdatePalettesWithTime(palettes); + } else { // copy + CpuFastCopy(gPlttBufferUnfaded + startPalIndex * 16, gPlttBufferFaded + startPalIndex * 16, numPalettes * 16 * sizeof(u16)); + } } } @@ -653,7 +656,7 @@ static void ApplyDroughtGammaShiftWithBlend(s8 gammaIndex, u8 blendCoeff, u16 bl } } -static void ApplyFogBlend(u8 blendCoeff, u16 blendColor) // TODO: How does this interact with time +static void ApplyFogBlend(u8 blendCoeff, u16 blendColor) // TODO: Optimize this with time blending { struct RGBColor color; u8 rBlend; @@ -661,7 +664,11 @@ static void ApplyFogBlend(u8 blendCoeff, u16 blendColor) // TODO: How does this u8 bBlend; u16 curPalIndex; - BlendPalette(0, 256, blendCoeff, blendColor); + // First blend all palettes with time + CpuFastCopy(gPlttBufferUnfaded, gPlttBufferFaded, 0x400); + UpdatePalettesWithTime(PALETTES_ALL); + // Then blend tile palettes [0, 12] faded->faded + BlendPalettesFine(0x1FFF, gPlttBufferFaded, gPlttBufferFaded, blendCoeff, blendColor); color = *(struct RGBColor *)&blendColor; rBlend = color.r; gBlend = color.g; @@ -676,7 +683,7 @@ static void ApplyFogBlend(u8 blendCoeff, u16 blendColor) // TODO: How does this while (palOffset < palEnd) { - struct RGBColor color = *(struct RGBColor *)&gPlttBufferUnfaded[palOffset]; + struct RGBColor color = *(struct RGBColor *)&gPlttBufferFaded[palOffset]; u8 r = color.r; u8 g = color.g; u8 b = color.b; @@ -695,7 +702,7 @@ static void ApplyFogBlend(u8 blendCoeff, u16 blendColor) // TODO: How does this } else { - BlendPalette(curPalIndex * 16, 16, blendCoeff, blendColor); + BlendPalettesFine(1, gPlttBufferFaded + curPalIndex * 16, gPlttBufferFaded + curPalIndex * 16, blendCoeff, blendColor); } } } @@ -799,10 +806,10 @@ void FadeScreen(u8 mode, s8 delay) else { gWeatherPtr->fadeDestColor = fadeColor; + UpdateTimeOfDay(); if (useWeatherPal) gWeatherPtr->fadeScreenCounter = 0; // Triggers gamma-shift-based fade-in else { - UpdateTimeOfDay(); if (MapHasNaturalLight(gMapHeader.mapType)) { BeginTimeOfDayPaletteFade(PALETTES_ALL, delay, 16, 0, (struct BlendSettings *)&gTimeOfDayBlend[currentTimeBlend.time0], @@ -826,7 +833,7 @@ bool8 IsWeatherNotFadingIn(void) return (gWeatherPtr->palProcessingState != WEATHER_PAL_STATE_SCREEN_FADING_IN); } -void UpdateSpritePaletteWithWeather(u8 spritePaletteIndex) +void UpdateSpritePaletteWithWeather(u8 spritePaletteIndex, bool8 allowFog) { u16 paletteIndex = 16 + spritePaletteIndex; u16 i; @@ -850,17 +857,22 @@ void UpdateSpritePaletteWithWeather(u8 spritePaletteIndex) // WEATHER_PAL_STATE_CHANGING_WEATHER // WEATHER_PAL_STATE_CHANGING_IDLE default: - if (gWeatherPtr->currWeather != WEATHER_FOG_HORIZONTAL) - { - ApplyGammaShift(paletteIndex, 1, gWeatherPtr->gammaIndex); - } - else - { + if (gWeatherPtr->currWeather != WEATHER_FOG_HORIZONTAL) { + if (gWeatherPtr->gammaIndex) + ApplyGammaShift(paletteIndex, 1, gWeatherPtr->gammaIndex); + else + UpdateSpritePaletteWithTime(spritePaletteIndex); + } else { // In horizontal fog, only specific palettes should be fog-blended + if (allowFog) { paletteIndex *= 16; // First blend with time CpuFastCopy(gPlttBufferUnfaded + paletteIndex, gPlttBufferFaded + paletteIndex, 32); UpdateSpritePaletteWithTime(spritePaletteIndex); + // Then blend faded->faded BlendPalettesFine(1 << (spritePaletteIndex + 16), gPlttBufferFaded + paletteIndex, gPlttBufferFaded + paletteIndex, 12, RGB(28, 31, 28)); + } else { // Otherwise, just time-blend the palette + UpdateSpritePaletteWithTime(spritePaletteIndex); + } } break; } @@ -883,8 +895,7 @@ static bool8 IsFirstFrameOfWeatherFadeIn(void) void LoadCustomWeatherSpritePalette(const u16 *palette) { LoadPalette(palette, 0x100 + gWeatherPtr->weatherPicSpritePalIndex * 16, 32); - UpdateSpritePaletteWithTime(gWeatherPtr->weatherPicSpritePalIndex); - UpdateSpritePaletteWithWeather(gWeatherPtr->weatherPicSpritePalIndex); + UpdateSpritePaletteWithWeather(gWeatherPtr->weatherPicSpritePalIndex, TRUE); } static void LoadDroughtWeatherPalette(u8 *gammaIndexPtr, u8 *a1) diff --git a/src/field_weather_effect.c b/src/field_weather_effect.c index bda62fcf067e..e22f04b74178 100644 --- a/src/field_weather_effect.c +++ b/src/field_weather_effect.c @@ -1380,10 +1380,17 @@ static void DestroyFogHorizontalSprites(void); // Updates just the color of shadows to match special weather blending static u8 UpdateShadowColor(u16 color) { u8 paletteNum = IndexOfSpritePaletteTag(TAG_WEATHER_START); + u16 tempBuffer[16]; + u16 blendedColor; if (paletteNum != 0xFF) { u16 index = (paletteNum+16)*16+SHADOW_COLOR_INDEX; gPlttBufferUnfaded[index] = gPlttBufferFaded[index] = color; + // Copy to temporary buffer, blend, and keep just the shadow color index + CpuFastCopy(&gPlttBufferFaded[index-SHADOW_COLOR_INDEX], tempBuffer, 32); UpdateSpritePaletteWithTime(paletteNum); + blendedColor = gPlttBufferFaded[index]; + CpuFastCopy(tempBuffer, &gPlttBufferFaded[index-SHADOW_COLOR_INDEX], 32); + gPlttBufferFaded[index] = blendedColor; } return paletteNum; } diff --git a/src/overworld.c b/src/overworld.c index 5e4aa1a32f07..a36e2ed55143 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -821,7 +821,7 @@ void LoadMapFromCameraTransition(u8 mapGroup, u8 mapNum) CopySecondaryTilesetToVramUsingHeap(gMapHeader.mapLayout); LoadSecondaryTilesetPalette(gMapHeader.mapLayout); - for (paletteIndex = 6; paletteIndex < 13; paletteIndex++) + for (paletteIndex = 6; paletteIndex < 13; paletteIndex++) // TODO: Optimize gamma shifts ApplyWeatherGammaShiftToPal(paletteIndex); InitSecondaryTilesetAnimation(); @@ -829,7 +829,6 @@ void LoadMapFromCameraTransition(u8 mapGroup, u8 mapNum) RoamerMove(); DoCurrentWeather(); ResetFieldTasksArgs(); - UpdatePalettesWithTime(PALETTES_ALL); RunOnResumeMapScript(); if (gMapHeader.regionMapSectionId != MAPSEC_BATTLE_FRONTIER @@ -1512,19 +1511,6 @@ bool8 MapHasNaturalLight(u8 mapType) { // Whether a map type is naturally lit/ou || mapType == MAP_TYPE_OCEAN_ROUTE; } -// TODO: Rewrite palette fading to work with FadeScreen -// Currently, this cancels the "Normal" palette fade started by FadeScreen -static bool8 FadePalettesWithTime(void) { // Only used to fade back in - UpdateTimeOfDay(); - if (MapHasNaturalLight(gMapHeader.mapType)) { - ResetPaletteFade(); - BeginTimeOfDayPaletteFade(PALETTES_ALL, 0, 16, 0, - (struct BlendSettings *)&gTimeOfDayBlend[currentTimeBlend.time0], - (struct BlendSettings *)&gTimeOfDayBlend[currentTimeBlend.time1], - currentTimeBlend.weight, 0); - } -} - void UpdatePalettesWithTime(u32 palettes) { if (MapHasNaturalLight(gMapHeader.mapType)) { u16 i; @@ -1546,7 +1532,18 @@ void UpdatePalettesWithTime(u32 palettes) { } u8 UpdateSpritePaletteWithTime(u8 paletteNum) { - UpdatePalettesWithTime(1 << (paletteNum + 16)); + if (MapHasNaturalLight(gMapHeader.mapType)) { + u16 offset; + if (GetSpritePaletteTagByPaletteNum(paletteNum) >> 15) + return paletteNum; + offset = (paletteNum + 16) * 16; + TimeMixPalettes(1, + gPlttBufferUnfaded + offset, + gPlttBufferFaded + offset, + (struct BlendSettings *)&gTimeOfDayBlend[currentTimeBlend.time0], + (struct BlendSettings *)&gTimeOfDayBlend[currentTimeBlend.time1], + currentTimeBlend.weight); + } return paletteNum; } @@ -1688,7 +1685,6 @@ static void CB2_LoadMap2(void) DoMapLoadLoop(&gMain.state); SetFieldVBlankCallback(); SetMainCallback1(CB1_Overworld); - // FadePalettesWithTime(); SetMainCallback2(CB2_Overworld); } @@ -1745,7 +1741,6 @@ static void CB2_ReturnToFieldLocal(void) if (ReturnToFieldLocal(&gMain.state)) { SetFieldVBlankCallback(); - // FadePalettesWithTime(); SetMainCallback2(CB2_Overworld); } } From 39ba328afbef5f21a622dca0c3fc30f4247b07af Mon Sep 17 00:00:00 2001 From: Ariel Antonitis Date: Sun, 25 Apr 2021 20:13:56 -0400 Subject: [PATCH 045/104] Optimized follower palette loading. --- .../object_event_graphics_info.h | 2 +- src/event_object_movement.c | 50 +++++++++---------- src/overworld.c | 7 +-- 3 files changed, 28 insertions(+), 31 deletions(-) diff --git a/src/data/object_events/object_event_graphics_info.h b/src/data/object_events/object_event_graphics_info.h index dc96762604f9..9dad1424fbbd 100755 --- a/src/data/object_events/object_event_graphics_info.h +++ b/src/data/object_events/object_event_graphics_info.h @@ -244,7 +244,7 @@ const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RubySapphireMay = const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Lugia = {0xFFFF, OBJ_EVENT_PAL_TAG_LUGIA, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_LugiaOld, gDummySpriteAffineAnimTable}; const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_HoOh = {0xFFFF, OBJ_EVENT_PAL_TAG_HO_OH, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_HoOh, sPicTable_HoOhOld, gDummySpriteAffineAnimTable}; const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_AnimatedBall = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Following, sPicTable_AnimatedBall, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Follower = {0xFFFF, OBJ_EVENT_PAL_TAG_DYNAMIC, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Following, sPicTable_Togetic, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Follower = {0xFFFF, OBJ_EVENT_PAL_TAG_MAY, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Following, sPicTable_Togetic, gDummySpriteAffineAnimTable}; // Species-indexed pokemon object event table const struct ObjectEventGraphicsInfo gPokemonObjectGraphics[] = { diff --git a/src/event_object_movement.c b/src/event_object_movement.c index 76fc26d05595..299425562d7c 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -152,7 +152,7 @@ static bool8 AnimateSpriteInFigure8(struct Sprite *sprite); static void UpdateObjectEventSprite(struct Sprite *); u8 GetDirectionToFace(s16 x1, s16 y1, s16 x2, s16 y2); -static void FollowerSetGraphics(struct ObjectEvent *, u16, u8, bool8); +static void FollowerSetGraphics(struct ObjectEvent *, u16, u8, bool8, bool8); static void ObjectEventSetGraphics(struct ObjectEvent *, const struct ObjectEventGraphicsInfo *); static void DoShadowFieldEffect(struct ObjectEvent *); static void SetJumpSpriteData(struct Sprite *, u8, u8, u8); @@ -1477,7 +1477,7 @@ TrySpawnObjectEventTemplate(struct ObjectEventTemplate *objectEventTemplate, species = gObjectEvents[objectEventId].extra.mon.species; form = gObjectEvents[objectEventId].extra.mon.form; shiny = gObjectEvents[objectEventId].extra.mon.shiny; - FollowerSetGraphics(&gObjectEvents[objectEventId], species, form, shiny); + FollowerSetGraphics(&gObjectEvents[objectEventId], species, form, shiny, TRUE); } } @@ -1652,16 +1652,17 @@ static const struct ObjectEventGraphicsInfo * SpeciesToGraphicsInfo(u16 species, } // Set graphics & sprite for a follower object event by species & shininess. -static void FollowerSetGraphics(struct ObjectEvent *objectEvent, u16 species, u8 form, bool8 shiny) { +static void FollowerSetGraphics(struct ObjectEvent *objEvent, u16 species, u8 form, bool8 shiny, bool8 doPalette) { const struct ObjectEventGraphicsInfo *graphicsInfo = SpeciesToGraphicsInfo(species, form); - objectEvent->graphicsId = OBJ_EVENT_GFX_OW_MON; - ObjectEventSetGraphics(objectEvent, graphicsInfo); - objectEvent->graphicsId = OBJ_EVENT_GFX_OW_MON; - objectEvent->extra.mon.species = species; - objectEvent->extra.mon.form = form; - objectEvent->extra.mon.shiny = shiny; - if (graphicsInfo->paletteTag == OBJ_EVENT_PAL_TAG_DYNAMIC) { // Use palette from species palette table - struct Sprite *sprite = &gSprites[objectEvent->spriteId]; + objEvent->graphicsId = OBJ_EVENT_GFX_OW_MON; + ObjectEventSetGraphics(objEvent, graphicsInfo); + objEvent->graphicsId = OBJ_EVENT_GFX_OW_MON; + objEvent->extra.mon.species = species; + objEvent->extra.mon.form = form; + objEvent->extra.mon.shiny = shiny; + if (graphicsInfo->paletteTag == OBJ_EVENT_PAL_TAG_DYNAMIC && doPalette) { // Use palette from species palette table + u8 paletteNum; + struct Sprite *sprite = &gSprites[objEvent->spriteId]; // Note that the shiny palette tag is `species + SPECIES_SHINY_TAG`, which must be increased with more pokemon // so that palette tags do not overlap const struct CompressedSpritePalette *spritePalette = &(shiny ? gMonShinyPaletteTable : gMonPaletteTable)[species]; @@ -1669,24 +1670,19 @@ static void FollowerSetGraphics(struct ObjectEvent *objectEvent, u16 species, u8 sprite->inUse = FALSE; FieldEffectFreePaletteIfUnused(sprite->oam.paletteNum); sprite->inUse = TRUE; - if (IndexOfSpritePaletteTag(spritePalette->tag) == 0xFF) { // Load compressed palette + if ((paletteNum = IndexOfSpritePaletteTag(spritePalette->tag)) == 0xFF) { // Load compressed palette LoadCompressedSpritePalette(spritePalette); - sprite->oam.paletteNum = IndexOfSpritePaletteTag(spritePalette->tag); // Tag is always present + sprite->oam.paletteNum = paletteNum = IndexOfSpritePaletteTag(spritePalette->tag); // Tag is always present if (species == SPECIES_AMPHAROS) { // palette should be light-blended TODO: Add more glowing pokemon - // CHARIZARD_LINE ? - // CHINCHOU & LANTERN - // FLAAFY, MAREEP - // UMBREON - // VOLBEAT ? - // REGIS ? - u16 * palette = &gPlttBufferUnfaded[(sprite->oam.paletteNum+16)*16]; + // CHARIZARD LINE ? CHINCHOU LANTERN FLAAFY MAREEP UMBREON VOLBEAT ? + u16 * palette = &gPlttBufferUnfaded[(paletteNum+16)*16]; palette[0] |= 0x8000; if (palette[0] & 0x4000) // If color 15 is blended, use it as the alternate color palette[15] |= 0x8000; } - UpdateSpritePaletteWithWeather(sprite->oam.paletteNum, FALSE); + UpdateSpritePaletteWithWeather(paletteNum, FALSE); } else - sprite->oam.paletteNum = IndexOfSpritePaletteTag(spritePalette->tag); // Tag is always present + sprite->oam.paletteNum = paletteNum; } } @@ -1717,7 +1713,7 @@ void UpdateFollowingPokemon(void) { // Update following pokemon if any MoveObjectEventToMapCoords(objEvent, gObjectEvents[gPlayerAvatar.objectEventId].currentCoords.x, gObjectEvents[gPlayerAvatar.objectEventId].currentCoords.y); objEvent->invisible = TRUE; } - FollowerSetGraphics(objEvent, species, 0, shiny); + FollowerSetGraphics(objEvent, species, 0, shiny, TRUE); sprite->data[6] = 0; // set animation data objEvent->extra.mon.species = species; objEvent->extra.mon.shiny = shiny; @@ -2147,7 +2143,7 @@ static void SpawnObjectEventOnReturnToField(u8 objectEventId, s16 x, s16 y) sprite->sObjEventId = objectEventId; objectEvent->spriteId = i; if (objectEvent->graphicsId == OBJ_EVENT_GFX_OW_MON) { // Set pokemon graphics - FollowerSetGraphics(objectEvent, objectEvent->extra.mon.species, objectEvent->extra.mon.form, objectEvent->extra.mon.shiny); + FollowerSetGraphics(objectEvent, objectEvent->extra.mon.species, objectEvent->extra.mon.form, objectEvent->extra.mon.shiny, TRUE); } if (!objectEvent->inanimate && objectEvent->movementType != MOVEMENT_TYPE_PLAYER) StartSpriteAnim(sprite, GetFaceDirectionAnimNum(objectEvent->facingDirection)); @@ -6494,11 +6490,11 @@ bool8 MovementAction_ExitPokeball_Step1(struct ObjectEvent *objectEvent, struct return TRUE; // Restore graphicsId and set palette to white } else if ((duration == 0 && sprite->data[3] == 3) || (duration == 1 && sprite->data[3] == 7)) { - FollowerSetGraphics(objectEvent, objectEvent->extra.mon.species, objectEvent->extra.mon.form, objectEvent->extra.mon.shiny); + FollowerSetGraphics(objectEvent, objectEvent->extra.mon.species, objectEvent->extra.mon.form, objectEvent->extra.mon.shiny, FALSE); LoadWhiteFlashPalette(objectEvent, sprite); // Restore original palette } else if ((duration == 0 && sprite->data[3] == 1) || (duration == 1 && sprite->data[3] == 3)) { - FollowerSetGraphics(objectEvent, objectEvent->extra.mon.species, objectEvent->extra.mon.form, objectEvent->extra.mon.shiny); + FollowerSetGraphics(objectEvent, objectEvent->extra.mon.species, objectEvent->extra.mon.form, objectEvent->extra.mon.shiny, TRUE); } return FALSE; } @@ -6526,7 +6522,7 @@ bool8 MovementAction_EnterPokeball_Step1(struct ObjectEvent *objectEvent, struct bool8 MovementAction_EnterPokeball_Step2(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - FollowerSetGraphics(objectEvent, objectEvent->extra.mon.species, objectEvent->extra.mon.form, objectEvent->extra.mon.shiny); + FollowerSetGraphics(objectEvent, objectEvent->extra.mon.species, objectEvent->extra.mon.form, objectEvent->extra.mon.shiny, FALSE); objectEvent->invisible = TRUE; sprite->data[1] = 0; sprite->data[6] = 0; diff --git a/src/overworld.c b/src/overworld.c index a36e2ed55143..c6670266765a 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -1515,9 +1515,10 @@ void UpdatePalettesWithTime(u32 palettes) { if (MapHasNaturalLight(gMapHeader.mapType)) { u16 i; u16 tempPaletteBuffer[16]; - for (i = 0; i < 16; i++) { + u32 mask = 1 << 16; + for (i = 0; i < 16; i++, mask <<= 1) { if (GetSpritePaletteTagByPaletteNum(i) >> 15) // Don't blend special sprite palette tags - palettes &= ~(1 << (i + 16)); + palettes &= ~(mask); } palettes &= 0xFFFF1FFF; // Don't blend tile palettes [13,15] if (!palettes) @@ -1536,7 +1537,7 @@ u8 UpdateSpritePaletteWithTime(u8 paletteNum) { u16 offset; if (GetSpritePaletteTagByPaletteNum(paletteNum) >> 15) return paletteNum; - offset = (paletteNum + 16) * 16; + offset = (paletteNum + 16) << 4; TimeMixPalettes(1, gPlttBufferUnfaded + offset, gPlttBufferFaded + offset, From 74a90889ace827e1f33769a32176f381e8eaf771 Mon Sep 17 00:00:00 2001 From: Ariel Antonitis Date: Sun, 25 Apr 2021 22:38:31 -0400 Subject: [PATCH 046/104] Fixed rain fade-in. --- src/field_weather.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/field_weather.c b/src/field_weather.c index aad85dfc6184..1f275a3df605 100644 --- a/src/field_weather.c +++ b/src/field_weather.c @@ -566,11 +566,12 @@ static void ApplyGammaShiftWithBlend(u8 startPalIndex, u8 numPalettes, s8 gammaI while (curPalIndex < numPalettes) { + CpuFastCopy(gPlttBufferUnfaded + palOffset, gPlttBufferFaded + palOffset, 16 * sizeof(u16)); UpdatePalettesWithTime(1 << (palOffset >> 4)); // Apply TOD blend if (sPaletteGammaTypes[curPalIndex] == GAMMA_NONE) { // No gamma shift. Simply blend the colors. - BlendPalettesFine(1 << (palOffset >> 4), gPlttBufferFaded, gPlttBufferFaded, blendCoeff, blendColor); + BlendPalettesFine(1, gPlttBufferFaded + palOffset, gPlttBufferFaded + palOffset, blendCoeff, blendColor); palOffset += 16; } else From 7d8e63a44b8a7654055cf564971fd744b5e87d7d Mon Sep 17 00:00:00 2001 From: Ariel Antonitis Date: Sun, 25 Apr 2021 23:50:29 -0400 Subject: [PATCH 047/104] Reverted 42d5fe07f and fixed rain/thunder gamma. --- src/field_weather.c | 24 ++++++++++++++---------- src/field_weather_effect.c | 8 +++----- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/field_weather.c b/src/field_weather.c index 1f275a3df605..205b4f7f221b 100644 --- a/src/field_weather.c +++ b/src/field_weather.c @@ -468,19 +468,23 @@ static void ApplyGammaShift(u8 startPalIndex, u8 numPalettes, s8 gammaIndex) { gammaIndex--; palOffset = startPalIndex * 16; + CpuFastCopy(gPlttBufferUnfaded + palOffset, gPlttBufferFaded + palOffset, 32 * numPalettes); numPalettes += startPalIndex; + // Thunder gamma-shift looks bad on night-blended palettes, so ignore time blending in some situations + if (!(gammaIndex > 3 && gWeatherPtr->currWeather == WEATHER_RAIN_THUNDERSTORM)) { + // Create the palette mask + u32 palettes = PALETTES_ALL; + palettes = (palettes >> startPalIndex) << startPalIndex; + palettes = (palettes << (32-numPalettes)) >> (32-numPalettes); + UpdatePalettesWithTime(palettes); + } curPalIndex = startPalIndex; - // Loop through the speficied palette range and apply necessary gamma shifts to the colors. - // TODO: Optimize this to work with time blending while (curPalIndex < numPalettes) { - CpuFastCopy(gPlttBufferUnfaded + palOffset, gPlttBufferFaded + palOffset, 16 * sizeof(u16)); - UpdatePalettesWithTime(1 << (palOffset >> 4)); if (sPaletteGammaTypes[curPalIndex] == GAMMA_NONE) { // No palette change. - // CpuFastCopy(gPlttBufferUnfaded + palOffset, gPlttBufferFaded + palOffset, 16 * sizeof(u16)); palOffset += 16; } else @@ -537,11 +541,11 @@ static void ApplyGammaShift(u8 startPalIndex, u8 numPalettes, s8 gammaIndex) else { if (MapHasNaturalLight(gMapHeader.mapType)) { // Time-blend - u32 palettes = 0; - u32 mask = 1 << startPalIndex; - u8 i; - for (i = 0; i < numPalettes; i++, mask <<= 1) - palettes |= mask; + // Create the palette mask + u32 palettes = PALETTES_ALL; + numPalettes += startPalIndex; + palettes = (palettes >> startPalIndex) << startPalIndex; + palettes = (palettes << (32-numPalettes)) >> (32-numPalettes); UpdatePalettesWithTime(palettes); } else { // copy CpuFastCopy(gPlttBufferUnfaded + startPalIndex * 16, gPlttBufferFaded + startPalIndex * 16, numPalettes * 16 * sizeof(u16)); diff --git a/src/field_weather_effect.c b/src/field_weather_effect.c index e22f04b74178..dad64903173f 100644 --- a/src/field_weather_effect.c +++ b/src/field_weather_effect.c @@ -483,7 +483,7 @@ void Rain_InitVars(void) gWeatherPtr->rainSpriteVisibleDelay = 8; gWeatherPtr->isDownpour = FALSE; gWeatherPtr->targetRainSpriteCount = 10; - gWeatherPtr->gammaTargetIndex = gTimeOfDay == TIME_OF_DAY_DAY ? 3 : 0; + gWeatherPtr->gammaTargetIndex = 3; gWeatherPtr->gammaStepDelay = 20; SetRainStrengthFromSoundEffect(SE_RAIN); Weather_SetBlendCoeffs(8, 12); // preserve shadow darkness @@ -1053,7 +1053,7 @@ void Thunderstorm_InitVars(void) gWeatherPtr->rainSpriteVisibleDelay = 4; gWeatherPtr->isDownpour = FALSE; gWeatherPtr->targetRainSpriteCount = 16; - gWeatherPtr->gammaTargetIndex = gTimeOfDay == TIME_OF_DAY_DAY ? 3 : 0; + gWeatherPtr->gammaTargetIndex = 3; gWeatherPtr->gammaStepDelay = 20; gWeatherPtr->weatherGfxLoaded = FALSE; // duplicate assignment gWeatherPtr->thunderTriggered = FALSE; @@ -1154,8 +1154,6 @@ void Thunderstorm_Main(void) if (--gWeatherPtr->thunderDelay == 0) { ApplyWeatherGammaShiftIfIdle(3); - if (gTimeOfDay != TIME_OF_DAY_DAY) - UpdatePalettesWithTime(0xFFFFFFFF); gWeatherPtr->thunderAllowEnd = TRUE; if (--gWeatherPtr->thunderShortRetries != 0) { @@ -1196,7 +1194,7 @@ void Thunderstorm_Main(void) case TSTORM_STATE_FADE_THUNDER_LONG: if (--gWeatherPtr->thunderDelay == 0) { - gTimeOfDay == TIME_OF_DAY_DAY ? sub_80ABC7C(19, 3, 5) : UpdatePalettesWithTime(0xFFFFFFFF); + sub_80ABC7C(19, 3, 5); gWeatherPtr->initStep++; } break; From c9845c66eed49ae307658ae8c4364a285370f4f3 Mon Sep 17 00:00:00 2001 From: Ariel Antonitis Date: Sun, 2 May 2021 03:23:38 -0400 Subject: [PATCH 048/104] Fixed mirage tower time blending. --- src/palette_util.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/palette_util.c b/src/palette_util.c index 5364ff6d9835..4f6416ea0167 100755 --- a/src/palette_util.c +++ b/src/palette_util.c @@ -2,6 +2,7 @@ #include "palette.h" #include "palette_util.h" #include "util.h" +#include "overworld.h" // "RouletteFlash" is more accurately a general flashing/fading util // this file handles fading the palettes for the color/icon selections on the Roulette wheel @@ -247,7 +248,7 @@ int InitPulseBlendPaletteSettings(struct PulseBlend *pulseBlend, const struct Pu if (pulseBlendPalette == NULL) return 0xFF; - + pulseBlendPalette->blendCoeff = 0; pulseBlendPalette->fadeDirection = 0; pulseBlendPalette->available = 1; @@ -322,7 +323,7 @@ void MarkUsedPulseBlendPalettes(struct PulseBlend *pulseBlend, u16 pulseBlendPal pulseBlend->usedPulseBlendPalettes |= 1 << i; } } - } + } } void UnmarkUsedPulseBlendPalettes(struct PulseBlend *pulseBlend, u16 pulseBlendPaletteSelector, u8 multiSelection) @@ -385,7 +386,12 @@ void UpdatePulseBlend(struct PulseBlend *pulseBlend) if (--pulseBlendPalette->delayCounter == 0xFF) { pulseBlendPalette->delayCounter = pulseBlendPalette->pulseBlendSettings.delay; - BlendPalette(pulseBlendPalette->pulseBlendSettings.paletteOffset, pulseBlendPalette->pulseBlendSettings.numColors, pulseBlendPalette->blendCoeff, pulseBlendPalette->pulseBlendSettings.blendColor); + // TODO: Optimize pulse blending + CpuFastCopy(gPlttBufferUnfaded + pulseBlendPalette->pulseBlendSettings.paletteOffset, gPlttBufferFaded + pulseBlendPalette->pulseBlendSettings.paletteOffset, 32); + UpdatePalettesWithTime(1 << (pulseBlendPalette->pulseBlendSettings.paletteOffset >> 4)); + // pulseBlendSettings has a numColors field, but it is only ever set to 16 (for mirage tower) + // So, it's ok to use the fine blending here which blends the entire palette + BlendPalettesFine(1, gPlttBufferFaded + pulseBlendPalette->pulseBlendSettings.paletteOffset, gPlttBufferFaded + pulseBlendPalette->pulseBlendSettings.paletteOffset, pulseBlendPalette->blendCoeff, pulseBlendPalette->pulseBlendSettings.blendColor); switch (pulseBlendPalette->pulseBlendSettings.fadeType) { case 0: // Fade all the way to the max blend amount, then wrap around @@ -423,7 +429,7 @@ void UpdatePulseBlend(struct PulseBlend *pulseBlend) pulseBlendPalette->blendCoeff = 0; else pulseBlendPalette->blendCoeff = pulseBlendPalette->pulseBlendSettings.maxBlendCoeff & 0xF; - + pulseBlendPalette->fadeDirection ^= 1; pulseBlendPalette->fadeCycleCounter++; break; From c20db9475d63509d96ac6214d2db94599ec90185 Mon Sep 17 00:00:00 2001 From: Ariel Antonitis Date: Tue, 4 May 2021 00:49:51 -0400 Subject: [PATCH 049/104] Fixed BlendPalettes not incrementing the destination buffer. --- src/palette.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/palette.c b/src/palette.c index b947f464c3f2..052b8a5568d6 100644 --- a/src/palette.c +++ b/src/palette.c @@ -1018,7 +1018,7 @@ void BlendPalettesFine(u32 palettes, u16 *src, u16 *dst, u32 coeff, u32 color) { } } else { src += 16; - dst + 16; + dst += 16; } palettes >>= 1; } while (palettes); From b64eb7ea142d91603a213099e8f6d7fcead16277 Mon Sep 17 00:00:00 2001 From: Ariel Antonitis Date: Sat, 28 Aug 2021 03:46:30 -0400 Subject: [PATCH 050/104] Modified palette tint behavior. --- include/palette.h | 6 +++--- src/overworld.c | 4 ++-- src/palette.c | 36 ++++++++++++++++++++++++------------ 3 files changed, 29 insertions(+), 17 deletions(-) diff --git a/include/palette.h b/include/palette.h index 201e85380081..39219f40a72c 100644 --- a/include/palette.h +++ b/include/palette.h @@ -27,9 +27,9 @@ enum }; struct BlendSettings { - u16 blendColor:15; - u16 isTint:1; - u8 coeff:5; + u32 blendColor:24; + u32 isTint:1; + u32 coeff:5; }; struct PaletteFadeControl diff --git a/src/overworld.c b/src/overworld.c index c6670266765a..cfb819426c0e 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -1460,11 +1460,11 @@ void CB1_Overworld(void) DoCB1_Overworld(gMain.newKeys, gMain.heldKeys); } - +#define TINT_NIGHT Q_8_8(0.456) | Q_8_8(0.456) << 8 | Q_8_8(0.615) << 16 const struct BlendSettings gTimeOfDayBlend[] = { - [TIME_OF_DAY_NIGHT] = {.coeff = 10, .blendColor = 0x1400}, + [TIME_OF_DAY_NIGHT] = {.coeff = 10, .blendColor = TINT_NIGHT, .isTint = TRUE}, [TIME_OF_DAY_TWILIGHT] = {.coeff = 4, .blendColor = 0x56dc, .isTint = TRUE}, [TIME_OF_DAY_DAY] = {.coeff = 0, .blendColor = 0}, }; diff --git a/src/palette.c b/src/palette.c index 052b8a5568d6..697a762a6294 100644 --- a/src/palette.c +++ b/src/palette.c @@ -1101,12 +1101,24 @@ void TimeMixPalettes(u32 palettes, u16 *src, u16 *dst, struct BlendSettings *ble tint1 = blend1->isTint; coeff1 = tint1 ? 8*2 : blend1->coeff*2; - r0 = (color0 << 27) >> 27; - g0 = (color0 << 22) >> 27; - b0 = (color0 << 17) >> 27; - r1 = (color1 << 27) >> 27; - g1 = (color1 << 22) >> 27; - b1 = (color1 << 17) >> 27; + if (tint0) { + r0 = (color0 << 24) >> 24; + g0 = (color0 << 16) >> 24; + b0 = (color0 << 8) >> 24; + } else { + r0 = (color0 << 27) >> 27; + g0 = (color0 << 22) >> 27; + b0 = (color0 << 17) >> 27; + } + if (tint1) { + r1 = (color1 << 24) >> 24; + g1 = (color1 << 16) >> 24; + b1 = (color1 << 8) >> 24; + } else { + r1 = (color1 << 27) >> 27; + g1 = (color1 << 22) >> 27; + b1 = (color1 << 17) >> 27; + } defR = (defaultColor << 27) >> 27; defG = (defaultColor << 22) >> 27; defB = (defaultColor << 17) >> 27; @@ -1155,9 +1167,9 @@ void TimeMixPalettes(u32 palettes, u16 *src, u16 *dst, struct BlendSettings *ble g2 = (g + (((g0 - g) * coeff0) >> 5)); b2 = (b + (((b0 - b) * coeff0) >> 5)); } else { // tint-based - r2 = (u16)(((r0 << 3) * r)) >> 8; - g2 = (u16)(((g0 << 3) * g)) >> 8; - b2 = (u16)(((b0 << 3) * b)) >> 8; + r2 = (u16)((r0 * r)) >> 8; + g2 = (u16)((g0 * g)) >> 8; + b2 = (u16)((b0 * b)) >> 8; if (r2 > 31) r2 = 31; if (g2 > 31) @@ -1170,9 +1182,9 @@ void TimeMixPalettes(u32 palettes, u16 *src, u16 *dst, struct BlendSettings *ble g3 = (g + (((g1 - g) * coeff1) >> 5)); b3 = (b + (((b1 - b) * coeff1) >> 5)); } else { // tint-based - r3 = (u16)(((r1 << 3) * r)) >> 8; - g3 = (u16)(((g1 << 3) * g)) >> 8; - b3 = (u16)(((b1 << 3) * b)) >> 8; + r3 = (u16)((r1 * r)) >> 8; + g3 = (u16)((g1 * g)) >> 8; + b3 = (u16)((b1 * b)) >> 8; if (r3 > 31) r3 = 31; if (g3 > 31) From cbb417a5304c3f8a229a378878f15a6bbfca05bc Mon Sep 17 00:00:00 2001 From: Ariel Antonitis Date: Wed, 22 Sep 2021 22:00:33 -0400 Subject: [PATCH 051/104] Fixed morning/evening tint. --- src/overworld.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/overworld.c b/src/overworld.c index 0948f67d6649..c06513e6233f 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -1465,7 +1465,7 @@ void CB1_Overworld(void) const struct BlendSettings gTimeOfDayBlend[] = { [TIME_OF_DAY_NIGHT] = {.coeff = 10, .blendColor = TINT_NIGHT, .isTint = TRUE}, - [TIME_OF_DAY_TWILIGHT] = {.coeff = 4, .blendColor = 0x56dc, .isTint = TRUE}, + [TIME_OF_DAY_TWILIGHT] = {.coeff = 4, .blendColor = 0xA8B0E0, .isTint = TRUE}, [TIME_OF_DAY_DAY] = {.coeff = 0, .blendColor = 0}, }; From bd3c9ed3b90d7be39d724d60406f8d47e93e0fca Mon Sep 17 00:00:00 2001 From: Ariel A <24759293+aarant@users.noreply.github.com> Date: Fri, 26 Nov 2021 03:58:06 -0500 Subject: [PATCH 052/104] Fixed warp arrow palette bug. Optimized weather palette loading. --- include/event_object_movement.h | 1 + src/event_object_movement.c | 19 ++++++++++--------- src/field_effect_helpers.c | 4 +++- src/field_weather.c | 5 ++++- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/include/event_object_movement.h b/include/event_object_movement.h index 7d66072a76a8..701a47f409b3 100644 --- a/include/event_object_movement.h +++ b/include/event_object_movement.h @@ -106,6 +106,7 @@ u8 SpawnSpecialObjectEventParameterized(u8 graphicsId, u8 movementBehavior, u8 l u8 SpawnSpecialObjectEvent(struct ObjectEventTemplate *); void SetSpritePosToMapCoords(s16, s16, s16 *, s16 *); void CameraObjectReset1(void); +u8 LoadObjectEventPalette(u16); u8 UpdateSpritePaletteByTemplate(const struct SpriteTemplate *, struct Sprite *); void ObjectEventSetGraphicsId(struct ObjectEvent *, u8 graphicsId); void ObjectEventTurn(struct ObjectEvent *, u8); diff --git a/src/event_object_movement.c b/src/event_object_movement.c index b8494bfa0235..c2056d1b3e0e 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -130,7 +130,6 @@ static void UpdateObjectEventVisibility(struct ObjectEvent *, struct Sprite *); static void MakeObjectTemplateFromObjectEventTemplate(struct ObjectEventTemplate *, struct SpriteTemplate *, const struct SubspriteTable **); static void GetObjectEventMovingCameraOffset(s16 *, s16 *); static struct ObjectEventTemplate *GetObjectEventTemplateByLocalIdAndMap(u8, u8, u8); -static void LoadObjectEventPalette(u16); static void RemoveObjectEventIfOutsideView(struct ObjectEvent *); static void SpawnObjectEventOnReturnToField(u8, s16, s16); static void SetPlayerAvatarObjectEventIdAndObjectId(u8, u8); @@ -2431,12 +2430,12 @@ void FreeAndReserveObjectSpritePalettes(void) gReservedSpritePaletteCount = 12; } -static void LoadObjectEventPalette(u16 paletteTag) +u8 LoadObjectEventPalette(u16 paletteTag) { u16 i = FindObjectEventPaletteIndexByTag(paletteTag); - - if (i != OBJ_EVENT_PAL_TAG_NONE) // always true - LoadSpritePaletteIfTagExists(&sObjectEventSpritePalettes[i]); + if (i == 0xFF) + return i; + return LoadSpritePaletteIfTagExists(&sObjectEventSpritePalettes[i]); } // Unused @@ -2448,13 +2447,15 @@ static void LoadObjectEventPaletteSet(u16 *paletteTags) LoadObjectEventPalette(paletteTags[i]); } +// Really just loads the palette and applies weather fade static u8 LoadSpritePaletteIfTagExists(const struct SpritePalette *spritePalette) { - u8 paletteNum; - if (IndexOfSpritePaletteTag(spritePalette->tag) != 0xFF) - return 0xFF; + u8 paletteNum = IndexOfSpritePaletteTag(spritePalette->tag); + if (paletteNum != 0xFF) // don't load twice; return + return paletteNum; paletteNum = LoadSpritePalette(spritePalette); - UpdateSpritePaletteWithWeather(paletteNum, FALSE); + if (paletteNum != 0xFF) + UpdateSpritePaletteWithWeather(paletteNum, FALSE); return paletteNum; } diff --git a/src/field_effect_helpers.c b/src/field_effect_helpers.c index 14330bd66151..e263ebe23e41 100755 --- a/src/field_effect_helpers.c +++ b/src/field_effect_helpers.c @@ -255,6 +255,8 @@ u8 CreateWarpArrowSprite(void) if (spriteId != MAX_SPRITES) { sprite = &gSprites[spriteId]; + // OBJ_EVENT_PAL_TAG_MAY : OBJ_EVENT_PAL_TAG_BRENDAN + sprite->oam.paletteNum = LoadObjectEventPalette(gSaveBlock2Ptr->playerGender ? 0x1110 : 0x1100); sprite->oam.priority = 1; sprite->coordOffsetEnabled = TRUE; sprite->invisible = TRUE; @@ -1421,7 +1423,7 @@ static u32 ShowDisguiseFieldEffect(u8 fldEff, u8 fldEffObj, u8 paletteNum) if (spriteId != MAX_SPRITES) { sprite = &gSprites[spriteId]; - UpdateSpritePaletteByTemplate(gFieldEffectObjectTemplatePointers[fldEffObj], sprite); + sprite->oam.paletteNum = LoadObjectEventPalette(gFieldEffectObjectTemplatePointers[fldEffObj]->paletteTag); sprite->coordOffsetEnabled ++; sprite->sFldEff = fldEff; sprite->sLocalId = gFieldEffectArguments[0]; diff --git a/src/field_weather.c b/src/field_weather.c index 205b4f7f221b..137a167a4e7c 100644 --- a/src/field_weather.c +++ b/src/field_weather.c @@ -165,7 +165,7 @@ void StartWeather(void) CpuCopy32(gFogPalette, &gPlttBufferUnfaded[0x100 + index * 16], 32); BuildGammaShiftTables(); gWeatherPtr->altGammaSpritePalIndex = index; - gWeatherPtr->weatherPicSpritePalIndex = AllocSpritePalette(PALTAG_WEATHER_2); + gWeatherPtr->weatherPicSpritePalIndex = 0xFF; // defer allocation until needed gWeatherPtr->rainSpriteCount = 0; gWeatherPtr->curRainSpriteIndex = 0; gWeatherPtr->cloudSpritesCreated = 0; @@ -899,6 +899,9 @@ static bool8 IsFirstFrameOfWeatherFadeIn(void) void LoadCustomWeatherSpritePalette(const u16 *palette) { + if (gWeatherPtr->weatherPicSpritePalIndex > 16) // haven't allocated palette yet + if ((gWeatherPtr->weatherPicSpritePalIndex = AllocSpritePalette(PALTAG_WEATHER_2)) > 16) + return; LoadPalette(palette, 0x100 + gWeatherPtr->weatherPicSpritePalIndex * 16, 32); UpdateSpritePaletteWithWeather(gWeatherPtr->weatherPicSpritePalIndex, TRUE); } From e7cbec7eda4532dfe284ad1b246036a286f3ecb2 Mon Sep 17 00:00:00 2001 From: Ariel A <24759293+aarant@users.noreply.github.com> Date: Tue, 7 Dec 2021 01:04:17 -0500 Subject: [PATCH 053/104] Implemented light colors/palettes for primary tilesets. --- src/fieldmap.c | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/src/fieldmap.c b/src/fieldmap.c index dfa617317694..35e8bc529043 100644 --- a/src/fieldmap.c +++ b/src/fieldmap.c @@ -894,6 +894,8 @@ static void FieldmapUnkDummy(void) void LoadTilesetPalette(struct Tileset const *tileset, u16 destOffset, u16 size) { u16 black = RGB_BLACK; + u32 low = 0; + u32 high = 0; if (tileset) { @@ -902,25 +904,31 @@ void LoadTilesetPalette(struct Tileset const *tileset, u16 destOffset, u16 size) LoadPalette(&black, destOffset, 2); LoadPalette(((u16*)tileset->palettes) + 1, destOffset + 1, size - 2); FieldmapPaletteDummy(destOffset + 1, (size - 2) >> 1); + low = 0; + high = NUM_PALS_IN_PRIMARY; } else if (tileset->isSecondary == TRUE) { - u8 i; LoadPalette(((u16*)tileset->palettes) + (NUM_PALS_IN_PRIMARY * 16), destOffset, size); - for (i = NUM_PALS_IN_PRIMARY; i < NUM_PALS_TOTAL; i++) { - if (tileset->lightPalettes & (1 << (i - NUM_PALS_IN_PRIMARY))) { // Mark as light palette - u16 index = i * 16; - gPlttBufferFaded[index] = gPlttBufferUnfaded[index] |= 0x8000; - if (tileset->customLightColor & (1 << (i - NUM_PALS_IN_PRIMARY))) // Mark as custom light color - gPlttBufferFaded[index+15] = gPlttBufferUnfaded[index+15] |= 0x8000; - } - } + low = NUM_PALS_IN_PRIMARY; + high = NUM_PALS_TOTAL; } else { LoadCompressedPalette((u32*)tileset->palettes, destOffset, size); FieldmapPaletteDummy(destOffset, size >> 1); } + if (tileset->isSecondary == FALSE || tileset->isSecondary == TRUE) { + u32 i; + for (i = low; i < high; i++) { + if (tileset->lightPalettes & (1 << (i - low))) { // Mark as light palette + u32 index = i * 16; + gPlttBufferFaded[index] = gPlttBufferUnfaded[index] |= 0x8000; + if (tileset->customLightColor & (1 << (i - low))) // Mark as custom light color + gPlttBufferFaded[index+15] = gPlttBufferUnfaded[index+15] |= 0x8000; + } + } + } } } From 11c7eee285a6b0699681a0b3cfd9061e875d9090 Mon Sep 17 00:00:00 2001 From: Ariel A <24759293+aarant@users.noreply.github.com> Date: Wed, 22 Dec 2021 23:12:20 -0500 Subject: [PATCH 054/104] Restored lighting & shadows code removed from follower branch. --- common_syms/overworld.txt | 1 + include/event_object_movement.h | 1 + include/global.fieldmap.h | 2 +- include/global.h | 3 +- include/overworld.h | 1 + include/palette.h | 1 + .../field_effect_object_template_pointers.h | 1 + src/data/field_effects/field_effect_objects.h | 6 ++ .../object_events/object_event_graphics.h | 2 + src/event_object_movement.c | 66 ++++++++++--------- src/field_effect.c | 3 +- 11 files changed, 53 insertions(+), 34 deletions(-) diff --git a/common_syms/overworld.txt b/common_syms/overworld.txt index 3cea73ccd38f..cc92cee1e21c 100644 --- a/common_syms/overworld.txt +++ b/common_syms/overworld.txt @@ -6,4 +6,5 @@ gFieldCallback gFieldCallback2 gLocalLinkPlayerId gFieldLinkPlayerCount +gTimeOfDay currentTimeBlend diff --git a/include/event_object_movement.h b/include/event_object_movement.h index a59203f84b1f..98e5fd784e86 100644 --- a/include/event_object_movement.h +++ b/include/event_object_movement.h @@ -100,6 +100,7 @@ void UpdateFollowingPokemon(void); void RemoveFollowingPokemon(void); struct ObjectEvent * GetFollowerObject(void); u8 GetDirectionToFace(s16, s16, s16, s16); +void UpdateLightSprite(struct Sprite *); void TrySpawnObjectEvents(s16, s16); u8 CreateObjectGraphicsSprite(u16, void (*)(struct Sprite *), s16 x, s16 y, u8 subpriority); u8 TrySpawnObjectEvent(u8, u8, u8); diff --git a/include/global.fieldmap.h b/include/global.fieldmap.h index 424fd46d574e..24e9e9ea536c 100644 --- a/include/global.fieldmap.h +++ b/include/global.fieldmap.h @@ -183,7 +183,7 @@ struct ObjectEvent u32 inShallowFlowingWater:1; u32 inSandPile:1; u32 inHotSprings:1; - u32 hasShadow:1; + u32 noShadow:1; u32 spriteAnimPausedBackup:1; /*0x03*/ u32 spriteAffineAnimPausedBackup:1; u32 disableJumpLandingGroundEffect:1; diff --git a/include/global.h b/include/global.h index 13bdf0282374..c4094ffc2505 100644 --- a/include/global.h +++ b/include/global.h @@ -497,6 +497,7 @@ struct SaveBlock2 extern struct SaveBlock2 *gSaveBlock2Ptr; +extern u8 UpdateSpritePaletteWithTime(u8); extern bool8 IsAccurateGBA(void); struct SecretBaseParty @@ -871,7 +872,7 @@ struct MysteryGiftSave struct WonderCardMetadata cardMetadata; u16 questionnaireWords[NUM_QUESTIONNAIRE_WORDS]; struct WonderNewsMetadata newsMetadata; - u32 trainerIds[2][5]; // Saved ids for 10 trainers, 5 each for battles and trades + u32 trainerIds[2][5]; // Saved ids for 10 trainers, 5 each for battles and trades }; // 0x36C 0x3598 // For external event data storage. The majority of these may have never been used. diff --git a/include/overworld.h b/include/overworld.h index 246d63e29f71..0469c8b9ed76 100644 --- a/include/overworld.h +++ b/include/overworld.h @@ -62,6 +62,7 @@ extern void (*gFieldCallback)(void); extern bool8 (*gFieldCallback2)(void); extern u8 gLocalLinkPlayerId; extern u8 gFieldLinkPlayerCount; +extern u8 gTimeOfDay; extern struct TimeBlendSettings currentTimeBlend; diff --git a/include/palette.h b/include/palette.h index f9f42990e0e8..7e9ed0cae0b5 100644 --- a/include/palette.h +++ b/include/palette.h @@ -69,6 +69,7 @@ void TransferPlttBuffer(void); u8 UpdatePaletteFade(void); void ResetPaletteFade(void); bool8 BeginNormalPaletteFade(u32, s8, u8, u8, u16); +bool8 BeginTimeOfDayPaletteFade(u32, s8, u8, u8, struct BlendSettings *, struct BlendSettings *, u16, u16); void PaletteStruct_ResetById(u16); void ResetPaletteFadeControl(void); void InvertPlttBuffer(u32); diff --git a/src/data/field_effects/field_effect_object_template_pointers.h b/src/data/field_effects/field_effect_object_template_pointers.h index 41d6271bf27c..eb8e52029dee 100755 --- a/src/data/field_effects/field_effect_object_template_pointers.h +++ b/src/data/field_effects/field_effect_object_template_pointers.h @@ -35,6 +35,7 @@ const struct SpriteTemplate gFieldEffectObjectTemplate_AshLaunch; const struct SpriteTemplate gFieldEffectObjectTemplate_Bubbles; const struct SpriteTemplate gFieldEffectObjectTemplate_SmallSparkle; const struct SpriteTemplate gFieldEffectObjectTemplate_Rayquaza; +const struct SpriteTemplate gFieldEffectObjectTemplate_BallLight; const struct SpriteTemplate *const gFieldEffectObjectTemplatePointers[] = { [FLDEFFOBJ_SHADOW_S] = &gFieldEffectObjectTemplate_ShadowSmall, diff --git a/src/data/field_effects/field_effect_objects.h b/src/data/field_effects/field_effect_objects.h index da688f2cfa41..aa4bc624d225 100755 --- a/src/data/field_effects/field_effect_objects.h +++ b/src/data/field_effects/field_effect_objects.h @@ -28,6 +28,12 @@ static const struct SpriteFrameImage sPicTable_ShadowExtraLarge[] = { obj_frame_tiles(gFieldEffectObjectPic_ShadowExtraLarge), }; +const struct SpriteFrameImage gFieldEffectObjectPicTable_BallLight[] = { + obj_frame_tiles(gFieldEffectObjectPic_BallLight), +}; + +const struct SpriteTemplate gFieldEffectObjectTemplate_BallLight = {TAG_NONE, OBJ_EVENT_PAL_TAG_LIGHT, &gObjectEventBaseOam_32x32, sAnimTable_Inanimate, gFieldEffectObjectPicTable_BallLight, gDummySpriteAffineAnimTable, UpdateLightSprite}; + const struct SpriteTemplate gFieldEffectObjectTemplate_ShadowSmall = { .tileTag = TAG_NONE, .paletteTag = TAG_WEATHER_START, diff --git a/src/data/object_events/object_event_graphics.h b/src/data/object_events/object_event_graphics.h index 43ccdcff779f..51ad7d393790 100755 --- a/src/data/object_events/object_event_graphics.h +++ b/src/data/object_events/object_event_graphics.h @@ -281,6 +281,7 @@ const u32 gFieldEffectObjectPic_ShadowSmall[] = INCBIN_U32("graphics/field_effec const u32 gFieldEffectObjectPic_ShadowMedium[] = INCBIN_U32("graphics/field_effects/pics/shadow_medium.4bpp"); const u32 gFieldEffectObjectPic_ShadowLarge[] = INCBIN_U32("graphics/field_effects/pics/shadow_large.4bpp"); const u32 gFieldEffectObjectPic_ShadowExtraLarge[] = INCBIN_U32("graphics/field_effects/pics/shadow_extra_large.4bpp"); +const u32 gFieldEffectObjectPic_BallLight[] = INCBIN_U32("graphics/object_events/pics/misc/light.4bpp"); static const u32 sFiller[0x48] = {}; const u8 gFieldEffectPic_CutGrass[] = INCBIN_U8("graphics/field_effects/pics/cut_grass.4bpp"); const u32 gFieldEffectPic_CutGrass_Copy[] = INCBIN_U32("graphics/field_effects/pics/cut_grass.4bpp"); @@ -778,4 +779,5 @@ const u32 gObjectEventPic_RayquazaCutscene[] = INCBIN_U32("graphics/object_event const u16 gObjectEventPal_HoOh[] = INCBIN_U16("graphics/object_events/palettes/ho_oh.gbapal"); const u16 gObjectEventPal_Lugia[] = INCBIN_U16("graphics/object_events/palettes/lugia.gbapal"); +const u16 gObjectEventPaletteLight[] = INCBIN_U16("graphics/object_events/palettes/light.gbapal"); const u16 gObjectEventPaletteEmotes[] = INCBIN_U16("graphics/misc/emotes.gbapal"); diff --git a/src/event_object_movement.c b/src/event_object_movement.c index 6ef1bd15e144..f9ec12b8dfc5 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -448,6 +448,7 @@ const u8 gInitialMovementTypeFacingDirections[] = { #define OBJ_EVENT_PAL_TAG_RS_BRENDAN 0x1122 #define OBJ_EVENT_PAL_TAG_RS_MAY 0x1123 #define OBJ_EVENT_PAL_TAG_DYNAMIC 0x1124 +#define OBJ_EVENT_PAL_TAG_LIGHT 0x8001 #define OBJ_EVENT_PAL_TAG_EMOTES 0x8002 #define OBJ_EVENT_PAL_TAG_NONE 0x11FF @@ -497,6 +498,7 @@ static const struct SpritePalette sObjectEventSpritePalettes[] = { {gObjectEventPal_RubySapphireBrendan, OBJ_EVENT_PAL_TAG_RS_BRENDAN}, {gObjectEventPal_RubySapphireMay, OBJ_EVENT_PAL_TAG_RS_MAY}, {gObjectEventPal_Npc1, OBJ_EVENT_PAL_TAG_DYNAMIC}, + {gObjectEventPaletteLight, OBJ_EVENT_PAL_TAG_LIGHT}, {gObjectEventPaletteEmotes, OBJ_EVENT_PAL_TAG_EMOTES}, {NULL, 0x0000}, }; @@ -2054,6 +2056,7 @@ void TrySpawnObjectEvents(s16 cameraX, s16 cameraY) TrySpawnObjectEventTemplate(template, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, cameraX, cameraY); } } + TrySpawnLightSprites(cameraX, cameraY); } void RemoveObjectEventsOutsideView(void) @@ -2107,6 +2110,7 @@ void SpawnObjectEventsOnReturnToField(s16 x, s16 y) SpawnObjectEventOnReturnToField(i, x, y); } CreateReflectionEffectSprites(); + TrySpawnLightSprites(x, y); } static void SpawnObjectEventOnReturnToField(u8 objectEventId, s16 x, s16 y) @@ -2170,7 +2174,7 @@ static void ResetObjectEventFldEffData(struct ObjectEvent *objectEvent) { objectEvent->singleMovementActive = FALSE; objectEvent->triggerGroundEffectsOnMove = TRUE; - objectEvent->hasShadow = FALSE; + objectEvent->noShadow = FALSE; objectEvent->hasReflection = FALSE; objectEvent->inShortGrass = FALSE; objectEvent->inShallowFlowingWater = FALSE; @@ -6160,7 +6164,7 @@ bool8 MovementAction_Jump2Down_Step1(struct ObjectEvent *objectEvent, struct Spr { if (DoJumpAnim(objectEvent, sprite)) { - objectEvent->hasShadow = FALSE; + objectEvent->noShadow = FALSE; sprite->sActionFuncId = 2; return TRUE; } @@ -6177,7 +6181,7 @@ bool8 MovementAction_Jump2Up_Step1(struct ObjectEvent *objectEvent, struct Sprit { if (DoJumpAnim(objectEvent, sprite)) { - objectEvent->hasShadow = FALSE; + objectEvent->noShadow = FALSE; sprite->sActionFuncId = 2; return TRUE; } @@ -6194,7 +6198,7 @@ bool8 MovementAction_Jump2Left_Step1(struct ObjectEvent *objectEvent, struct Spr { if (DoJumpAnim(objectEvent, sprite)) { - objectEvent->hasShadow = FALSE; + objectEvent->noShadow = FALSE; sprite->sActionFuncId = 2; return TRUE; } @@ -6211,7 +6215,7 @@ bool8 MovementAction_Jump2Right_Step1(struct ObjectEvent *objectEvent, struct Sp { if (DoJumpAnim(objectEvent, sprite)) { - objectEvent->hasShadow = FALSE; + objectEvent->noShadow = FALSE; sprite->sActionFuncId = 2; return TRUE; } @@ -6982,7 +6986,7 @@ bool8 MovementAction_JumpDown_Step1(struct ObjectEvent *objectEvent, struct Spri { if (DoJumpAnim(objectEvent, sprite)) { - objectEvent->hasShadow = 0; + objectEvent->noShadow = 0; sprite->sActionFuncId = 2; return TRUE; } @@ -6999,7 +7003,7 @@ bool8 MovementAction_JumpUp_Step1(struct ObjectEvent *objectEvent, struct Sprite { if (DoJumpAnim(objectEvent, sprite)) { - objectEvent->hasShadow = 0; + objectEvent->noShadow = 0; sprite->sActionFuncId = 2; return TRUE; } @@ -7016,7 +7020,7 @@ bool8 MovementAction_JumpLeft_Step1(struct ObjectEvent *objectEvent, struct Spri { if (DoJumpAnim(objectEvent, sprite)) { - objectEvent->hasShadow = 0; + objectEvent->noShadow = 0; sprite->sActionFuncId = 2; return TRUE; } @@ -7033,7 +7037,7 @@ bool8 MovementAction_JumpRight_Step1(struct ObjectEvent *objectEvent, struct Spr { if (DoJumpAnim(objectEvent, sprite)) { - objectEvent->hasShadow = 0; + objectEvent->noShadow = 0; sprite->sActionFuncId = 2; return TRUE; } @@ -7050,7 +7054,7 @@ bool8 MovementAction_JumpInPlaceDown_Step1(struct ObjectEvent *objectEvent, stru { if (DoJumpAnim(objectEvent, sprite)) { - objectEvent->hasShadow = 0; + objectEvent->noShadow = 0; sprite->sActionFuncId = 2; return TRUE; } @@ -7067,7 +7071,7 @@ bool8 MovementAction_JumpInPlaceUp_Step1(struct ObjectEvent *objectEvent, struct { if (DoJumpAnim(objectEvent, sprite)) { - objectEvent->hasShadow = 0; + objectEvent->noShadow = 0; sprite->sActionFuncId = 2; return TRUE; } @@ -7084,7 +7088,7 @@ bool8 MovementAction_JumpInPlaceLeft_Step1(struct ObjectEvent *objectEvent, stru { if (DoJumpAnim(objectEvent, sprite)) { - objectEvent->hasShadow = 0; + objectEvent->noShadow = 0; sprite->sActionFuncId = 2; return TRUE; } @@ -7101,7 +7105,7 @@ bool8 MovementAction_JumpInPlaceRight_Step1(struct ObjectEvent *objectEvent, str { if (DoJumpAnim(objectEvent, sprite)) { - objectEvent->hasShadow = 0; + objectEvent->noShadow = 0; sprite->sActionFuncId = 2; return TRUE; } @@ -7118,7 +7122,7 @@ bool8 MovementAction_JumpInPlaceDownUp_Step1(struct ObjectEvent *objectEvent, st { if (DoJumpInPlaceAnim(objectEvent, sprite)) { - objectEvent->hasShadow = 0; + objectEvent->noShadow = 0; sprite->sActionFuncId = 2; return TRUE; } @@ -7135,7 +7139,7 @@ bool8 MovementAction_JumpInPlaceUpDown_Step1(struct ObjectEvent *objectEvent, st { if (DoJumpInPlaceAnim(objectEvent, sprite)) { - objectEvent->hasShadow = 0; + objectEvent->noShadow = 0; sprite->sActionFuncId = 2; return TRUE; } @@ -7152,7 +7156,7 @@ bool8 MovementAction_JumpInPlaceLeftRight_Step1(struct ObjectEvent *objectEvent, { if (DoJumpInPlaceAnim(objectEvent, sprite)) { - objectEvent->hasShadow = 0; + objectEvent->noShadow = 0; sprite->sActionFuncId = 2; return TRUE; } @@ -7169,7 +7173,7 @@ bool8 MovementAction_JumpInPlaceRightLeft_Step1(struct ObjectEvent *objectEvent, { if (DoJumpInPlaceAnim(objectEvent, sprite)) { - objectEvent->hasShadow = 0; + objectEvent->noShadow = 0; sprite->sActionFuncId = 2; return TRUE; } @@ -7614,7 +7618,7 @@ bool8 MovementAction_AcroWheelieHopFaceDown_Step1(struct ObjectEvent *objectEven { if (DoJumpAnim(objectEvent, sprite)) { - objectEvent->hasShadow = FALSE; + objectEvent->noShadow = FALSE; sprite->sActionFuncId = 2; return TRUE; } @@ -7631,7 +7635,7 @@ bool8 MovementAction_AcroWheelieHopFaceUp_Step1(struct ObjectEvent *objectEvent, { if (DoJumpAnim(objectEvent, sprite)) { - objectEvent->hasShadow = FALSE; + objectEvent->noShadow = FALSE; sprite->sActionFuncId = 2; return TRUE; } @@ -7648,7 +7652,7 @@ bool8 MovementAction_AcroWheelieHopFaceLeft_Step1(struct ObjectEvent *objectEven { if (DoJumpAnim(objectEvent, sprite)) { - objectEvent->hasShadow = FALSE; + objectEvent->noShadow = FALSE; sprite->sActionFuncId = 2; return TRUE; } @@ -7665,7 +7669,7 @@ bool8 MovementAction_AcroWheelieHopFaceRight_Step1(struct ObjectEvent *objectEve { if (DoJumpAnim(objectEvent, sprite)) { - objectEvent->hasShadow = FALSE; + objectEvent->noShadow = FALSE; sprite->sActionFuncId = 2; return TRUE; } @@ -7682,7 +7686,7 @@ bool8 MovementAction_AcroWheelieHopDown_Step1(struct ObjectEvent *objectEvent, s { if (DoJumpAnim(objectEvent, sprite)) { - objectEvent->hasShadow = FALSE; + objectEvent->noShadow = FALSE; sprite->sActionFuncId = 2; return TRUE; } @@ -7699,7 +7703,7 @@ bool8 MovementAction_AcroWheelieHopUp_Step1(struct ObjectEvent *objectEvent, str { if (DoJumpAnim(objectEvent, sprite)) { - objectEvent->hasShadow = FALSE; + objectEvent->noShadow = FALSE; sprite->sActionFuncId = 2; return TRUE; } @@ -7716,7 +7720,7 @@ bool8 MovementAction_AcroWheelieHopLeft_Step1(struct ObjectEvent *objectEvent, s { if (DoJumpAnim(objectEvent, sprite)) { - objectEvent->hasShadow = FALSE; + objectEvent->noShadow = FALSE; sprite->sActionFuncId = 2; return TRUE; } @@ -7733,7 +7737,7 @@ bool8 MovementAction_AcroWheelieHopRight_Step1(struct ObjectEvent *objectEvent, { if (DoJumpAnim(objectEvent, sprite)) { - objectEvent->hasShadow = FALSE; + objectEvent->noShadow = FALSE; sprite->sActionFuncId = 2; return TRUE; } @@ -7750,7 +7754,7 @@ bool8 MovementAction_AcroWheelieJumpDown_Step1(struct ObjectEvent *objectEvent, { if (DoJumpAnim(objectEvent, sprite)) { - objectEvent->hasShadow = FALSE; + objectEvent->noShadow = FALSE; sprite->sActionFuncId = 2; return TRUE; } @@ -7767,7 +7771,7 @@ bool8 MovementAction_AcroWheelieJumpUp_Step1(struct ObjectEvent *objectEvent, st { if (DoJumpAnim(objectEvent, sprite)) { - objectEvent->hasShadow = FALSE; + objectEvent->noShadow = FALSE; sprite->sActionFuncId = 2; return TRUE; } @@ -7784,7 +7788,7 @@ bool8 MovementAction_AcroWheelieJumpLeft_Step1(struct ObjectEvent *objectEvent, { if (DoJumpAnim(objectEvent, sprite)) { - objectEvent->hasShadow = FALSE; + objectEvent->noShadow = FALSE; sprite->sActionFuncId = 2; return TRUE; } @@ -7801,7 +7805,7 @@ bool8 MovementAction_AcroWheelieJumpRight_Step1(struct ObjectEvent *objectEvent, { if (DoJumpAnim(objectEvent, sprite)) { - objectEvent->hasShadow = FALSE; + objectEvent->noShadow = FALSE; sprite->sActionFuncId = 2; return TRUE; } @@ -9518,9 +9522,9 @@ u32 StartFieldEffectForObjectEvent(u8 fieldEffectId, struct ObjectEvent *objectE static void DoShadowFieldEffect(struct ObjectEvent *objectEvent) { - if (!objectEvent->hasShadow) + if (objectEvent->noShadow) { - objectEvent->hasShadow = 1; + objectEvent->noShadow = FALSE; StartFieldEffectForObjectEvent(FLDEFF_SHADOW, objectEvent); } } diff --git a/src/field_effect.c b/src/field_effect.c index d97d86cd8218..afc25f757c14 100644 --- a/src/field_effect.c +++ b/src/field_effect.c @@ -3270,7 +3270,7 @@ static void FlyOutFieldEffect_FlyOffWithBird(struct Task *task) struct ObjectEvent *objectEvent = &gObjectEvents[gPlayerAvatar.objectEventId]; ObjectEventClearHeldMovementIfActive(objectEvent); objectEvent->inanimate = FALSE; - objectEvent->hasShadow = FALSE; + objectEvent->noShadow = TRUE; // TODO: Make shadow smaller instead of disappearing completely ? SetFlyBirdPlayerSpriteId(task->tBirdSpriteId, objectEvent->spriteId); CameraObjectReset2(); task->tState++; @@ -3490,6 +3490,7 @@ static void FlyInFieldEffect_BirdSwoopDown(struct Task *task) ObjectEventTurn(objectEvent, DIR_WEST); StartSpriteAnim(&gSprites[objectEvent->spriteId], ANIM_GET_ON_OFF_POKEMON_WEST); objectEvent->invisible = FALSE; + objectEvent->noShadow = TRUE; task->tBirdSpriteId = CreateFlyBirdSprite(); StartFlyBirdSwoopDown(task->tBirdSpriteId); SetFlyBirdPlayerSpriteId(task->tBirdSpriteId, objectEvent->spriteId); From 5e3c48acfc7faf0bc24b4cfc1cf7f159c06bb087 Mon Sep 17 00:00:00 2001 From: Ariel A <24759293+aarant@users.noreply.github.com> Date: Sun, 16 Jan 2022 17:08:09 -0500 Subject: [PATCH 055/104] Fixed bug where `lighting` branch wouldn't build on modern. Credit: Jaizu --- include/overworld.h | 2 -- include/palette.h | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/overworld.h b/include/overworld.h index 0469c8b9ed76..5061bb304d58 100644 --- a/include/overworld.h +++ b/include/overworld.h @@ -69,8 +69,6 @@ extern struct TimeBlendSettings currentTimeBlend; // Exported ROM declarations extern const struct UCoords32 gDirectionToVectors[]; -extern const struct BlendSettings gTimeOfDayBlend[]; - void DoWhiteOut(void); void Overworld_ResetStateAfterFly(void); void Overworld_ResetStateAfterTeleport(void); diff --git a/include/palette.h b/include/palette.h index 7e9ed0cae0b5..abb00be6cae6 100644 --- a/include/palette.h +++ b/include/palette.h @@ -56,6 +56,8 @@ struct PaletteFadeControl u8 deltaY:4; // rate of change of blend coefficient }; +extern const struct BlendSettings gTimeOfDayBlend[]; + extern struct PaletteFadeControl gPaletteFade; extern u32 gPlttBufferTransferPending; extern u8 gPaletteDecompressionBuffer[]; From 6e621d80a10f015e00ae017342cfb71284f51503 Mon Sep 17 00:00:00 2001 From: Ariel A <24759293+aarant@users.noreply.github.com> Date: Fri, 15 Apr 2022 22:38:56 -0400 Subject: [PATCH 056/104] Added day/night palette swapping. Updated lighting for lava, Petalburg, Slateport, Dewford, Verdanturf, Oldale, Mossdeep, Lilycove, Fallarbor. Improved lantern appearance & added neon signs on PokeCenter & Mart. Optimized gamma shift code. Removed obselete CacheLightMetatiles. --- common_syms/overworld.txt | 1 + data/maps/DewfordTown/map.json | 13 ++ data/maps/EverGrandeCity/map.json | 16 +- data/maps/LilycoveCity/map.json | 13 ++ data/maps/MauvilleCity/map.json | 26 +++ data/maps/MossdeepCity/map.json | 26 +++ data/maps/PacifidlogTown/map.json | 17 +- data/maps/PetalburgCity/map.json | 26 +++ data/maps/RustboroCity/map.json | 221 ++++++++++++++++++ data/maps/SlateportCity/map.json | 26 +++ data/maps/VerdanturfTown/map.json | 26 +++ data/tilesets/headers.inc | 30 +-- .../primary/general/metatile_attributes.bin | Bin 1024 -> 1024 bytes data/tilesets/primary/general/metatiles.bin | Bin 8192 -> 8192 bytes data/tilesets/primary/general/palettes/04.pal | 12 +- data/tilesets/primary/general/palettes/13.pal | 32 +-- data/tilesets/primary/general/tiles.png | Bin 7622 -> 7658 bytes .../secondary/dewford/metatile_attributes.bin | Bin 758 -> 758 bytes data/tilesets/secondary/dewford/metatiles.bin | Bin 6064 -> 6064 bytes .../secondary/dewford/palettes/12.pal | 24 +- data/tilesets/secondary/dewford/tiles.png | Bin 12295 -> 3818 bytes .../secondary/fallarbor/palettes/00.pal | 26 +-- .../secondary/lavaridge/metatiles.bin | Bin 7056 -> 7056 bytes .../secondary/lavaridge/palettes/06.pal | 32 +-- data/tilesets/secondary/lavaridge/tiles.png | Bin 4087 -> 4087 bytes .../lilycove/metatile_attributes.bin | Bin 702 -> 702 bytes .../tilesets/secondary/lilycove/metatiles.bin | Bin 5616 -> 5616 bytes .../secondary/lilycove/palettes/15.pal | 30 +-- data/tilesets/secondary/lilycove/tiles.png | Bin 3674 -> 3728 bytes .../tilesets/secondary/mauville/metatiles.bin | Bin 8160 -> 8192 bytes data/tilesets/secondary/mauville/tiles.png | Bin 6069 -> 6079 bytes .../tilesets/secondary/mossdeep/metatiles.bin | Bin 7264 -> 7264 bytes .../secondary/mossdeep/palettes/01.pal | 24 +- .../secondary/mossdeep/palettes/02.pal | 32 +-- .../secondary/mossdeep/palettes/09.pal | 26 +-- data/tilesets/secondary/mossdeep/tiles.png | Bin 4115 -> 4129 bytes .../secondary/pacifidlog/palettes/02.pal | 32 +-- .../secondary/petalburg/palettes/02.pal | 32 +-- .../secondary/petalburg/palettes/09.pal | 32 +-- .../tilesets/secondary/rustboro/metatiles.bin | Bin 5600 -> 5616 bytes data/tilesets/secondary/rustboro/tiles.png | Bin 12786 -> 4057 bytes .../slateport/metatile_attributes.bin | Bin 812 -> 812 bytes .../secondary/slateport/metatiles.bin | Bin 6496 -> 6496 bytes .../secondary/slateport/palettes/12.pal | 10 +- .../secondary/slateport/palettes/15.pal | 30 +-- data/tilesets/secondary/slateport/tiles.png | Bin 6558 -> 6587 bytes .../secondary/sootopolis/palettes/15.pal | 30 +-- gflib/sprite.c | 22 ++ gflib/sprite.h | 2 + graphics/object_events/palettes/light.pal | 30 +-- graphics/object_events/palettes/light2.pal | 19 ++ .../object_events/palettes/neon_light.pal | 19 ++ graphics/object_events/pics/misc/light.png | Bin 3064 -> 6205 bytes .../object_events/pics/misc/mart_light.png | Bin 0 -> 5395 bytes .../pics/misc/poke_center_light.png | Bin 0 -> 5378 bytes include/constants/event_objects.h | 1 + include/field_weather.h | 1 + include/fieldmap.h | 1 - include/global.fieldmap.h | 3 +- include/overworld.h | 4 + include/palette.h | 1 + src/data/field_effects/field_effect_objects.h | 36 ++- .../object_events/object_event_graphics.h | 4 + .../object_event_graphics_info.h | 2 + .../object_event_graphics_info_pointers.h | 4 +- .../object_events/object_event_pic_tables.h | 2 + src/event_object_movement.c | 196 ++++++++++------ src/field_weather.c | 29 ++- src/fieldmap.c | 21 -- src/overworld.c | 61 +++-- src/palette.c | 25 ++ src/trainer_see.c | 2 +- 72 files changed, 971 insertions(+), 359 deletions(-) create mode 100644 graphics/object_events/palettes/light2.pal create mode 100644 graphics/object_events/palettes/neon_light.pal create mode 100644 graphics/object_events/pics/misc/mart_light.png create mode 100644 graphics/object_events/pics/misc/poke_center_light.png diff --git a/common_syms/overworld.txt b/common_syms/overworld.txt index cc92cee1e21c..9aff4e77a116 100644 --- a/common_syms/overworld.txt +++ b/common_syms/overworld.txt @@ -8,3 +8,4 @@ gLocalLinkPlayerId gFieldLinkPlayerCount gTimeOfDay currentTimeBlend +gTimeUpdateCounter diff --git a/data/maps/DewfordTown/map.json b/data/maps/DewfordTown/map.json index 8beb5add7017..c59e66844479 100644 --- a/data/maps/DewfordTown/map.json +++ b/data/maps/DewfordTown/map.json @@ -89,6 +89,19 @@ "trainer_sight_or_berry_tree_id": "0", "script": "DewfordTown_EventScript_TrendyPhraseBoy", "flag": "0" + }, + { + "graphics_id": "OBJ_EVENT_GFX_LIGHT_SPRITE", + "x": 4, + "y": 10, + "elevation": 3, + "movement_type": "MOVEMENT_TYPE_NONE", + "movement_range_x": 0, + "movement_range_y": 0, + "trainer_type": "TRAINER_TYPE_NONE", + "trainer_sight_or_berry_tree_id": "1", + "script": "NULL", + "flag": "0" } ], "warp_events": [ diff --git a/data/maps/EverGrandeCity/map.json b/data/maps/EverGrandeCity/map.json index 9db9c8febbd4..311cf4c2c478 100644 --- a/data/maps/EverGrandeCity/map.json +++ b/data/maps/EverGrandeCity/map.json @@ -19,7 +19,21 @@ "map": "MAP_ROUTE128" } ], - "object_events": [], + "object_events": [ + { + "graphics_id": "OBJ_EVENT_GFX_LIGHT_SPRITE", + "x": 29, + "y": 48, + "elevation": 3, + "movement_type": "MOVEMENT_TYPE_NONE", + "movement_range_x": 0, + "movement_range_y": 0, + "trainer_type": "TRAINER_TYPE_NONE", + "trainer_sight_or_berry_tree_id": "1", + "script": "NULL", + "flag": "0" + } + ], "warp_events": [ { "x": 18, diff --git a/data/maps/LilycoveCity/map.json b/data/maps/LilycoveCity/map.json index a13904ca9a2f..d4a2b6ee476e 100644 --- a/data/maps/LilycoveCity/map.json +++ b/data/maps/LilycoveCity/map.json @@ -310,6 +310,19 @@ "trainer_sight_or_berry_tree_id": "0", "script": "LilycoveCity_EventScript_FatMan", "flag": "0" + }, + { + "graphics_id": "OBJ_EVENT_GFX_LIGHT_SPRITE", + "x": 26, + "y": 14, + "elevation": 3, + "movement_type": "MOVEMENT_TYPE_NONE", + "movement_range_x": 0, + "movement_range_y": 0, + "trainer_type": "TRAINER_TYPE_NONE", + "trainer_sight_or_berry_tree_id": "1", + "script": "NULL", + "flag": "0" } ], "warp_events": [ diff --git a/data/maps/MauvilleCity/map.json b/data/maps/MauvilleCity/map.json index cf3d5f8a1c43..bd7426404fb8 100644 --- a/data/maps/MauvilleCity/map.json +++ b/data/maps/MauvilleCity/map.json @@ -177,6 +177,32 @@ "trainer_sight_or_berry_tree_id": "0", "script": "0x0", "flag": "FLAG_HIDE_MAUVILLE_CITY_SCOTT" + }, + { + "graphics_id": "OBJ_EVENT_GFX_LIGHT_SPRITE", + "x": 24, + "y": 5, + "elevation": 3, + "movement_type": "MOVEMENT_TYPE_NONE", + "movement_range_x": 0, + "movement_range_y": 0, + "trainer_type": "TRAINER_TYPE_NONE", + "trainer_sight_or_berry_tree_id": "1", + "script": "NULL", + "flag": "0" + }, + { + "graphics_id": "OBJ_EVENT_GFX_LIGHT_SPRITE", + "x": 25, + "y": 14, + "elevation": 3, + "movement_type": "MOVEMENT_TYPE_NONE", + "movement_range_x": 0, + "movement_range_y": 0, + "trainer_type": "TRAINER_TYPE_NONE", + "trainer_sight_or_berry_tree_id": "2", + "script": "NULL", + "flag": "0" } ], "warp_events": [ diff --git a/data/maps/MossdeepCity/map.json b/data/maps/MossdeepCity/map.json index ff8ae1b6161c..309a22f42442 100644 --- a/data/maps/MossdeepCity/map.json +++ b/data/maps/MossdeepCity/map.json @@ -250,6 +250,32 @@ "trainer_sight_or_berry_tree_id": "0", "script": "MossdeepCity_EventScript_BlackBelt", "flag": "0" + }, + { + "graphics_id": "OBJ_EVENT_GFX_LIGHT_SPRITE", + "x": 30, + "y": 16, + "elevation": 3, + "movement_type": "MOVEMENT_TYPE_NONE", + "movement_range_x": 0, + "movement_range_y": 0, + "trainer_type": "TRAINER_TYPE_NONE", + "trainer_sight_or_berry_tree_id": "1", + "script": "NULL", + "flag": "0" + }, + { + "graphics_id": "OBJ_EVENT_GFX_LIGHT_SPRITE", + "x": 39, + "y": 18, + "elevation": 3, + "movement_type": "MOVEMENT_TYPE_NONE", + "movement_range_x": 0, + "movement_range_y": 0, + "trainer_type": "TRAINER_TYPE_NONE", + "trainer_sight_or_berry_tree_id": "2", + "script": "NULL", + "flag": "0" } ], "warp_events": [ diff --git a/data/maps/PacifidlogTown/map.json b/data/maps/PacifidlogTown/map.json index 51fc772a9208..ec1bb1b2266a 100644 --- a/data/maps/PacifidlogTown/map.json +++ b/data/maps/PacifidlogTown/map.json @@ -63,6 +63,19 @@ "trainer_sight_or_berry_tree_id": "0", "script": "PacifidlogTown_EventScript_NinjaBoy", "flag": "0" + }, + { + "graphics_id": "OBJ_EVENT_GFX_LIGHT_SPRITE", + "x": 10, + "y": 15, + "elevation": 3, + "movement_type": "MOVEMENT_TYPE_NONE", + "movement_range_x": 0, + "movement_range_y": 0, + "trainer_type": "TRAINER_TYPE_NONE", + "trainer_sight_or_berry_tree_id": "1", + "script": "NULL", + "flag": "0" } ], "warp_events": [ @@ -109,7 +122,9 @@ "dest_warp_id": 0 } ], - "coord_events": [], + "coord_events": [ + + ], "bg_events": [ { "type": "sign", diff --git a/data/maps/PetalburgCity/map.json b/data/maps/PetalburgCity/map.json index d9587cdbb910..c36d36fafb37 100644 --- a/data/maps/PetalburgCity/map.json +++ b/data/maps/PetalburgCity/map.json @@ -141,6 +141,32 @@ "trainer_sight_or_berry_tree_id": "0", "script": "0x0", "flag": "FLAG_HIDE_PETALBURG_CITY_SCOTT" + }, + { + "graphics_id": "OBJ_EVENT_GFX_LIGHT_SPRITE", + "x": 22, + "y": 16, + "elevation": 3, + "movement_type": "MOVEMENT_TYPE_NONE", + "movement_range_x": 0, + "movement_range_y": 0, + "trainer_type": "TRAINER_TYPE_NONE", + "trainer_sight_or_berry_tree_id": "1", + "script": "NULL", + "flag": "0" + }, + { + "graphics_id": "OBJ_EVENT_GFX_LIGHT_SPRITE", + "x": 27, + "y": 12, + "elevation": 3, + "movement_type": "MOVEMENT_TYPE_NONE", + "movement_range_x": 0, + "movement_range_y": 0, + "trainer_type": "TRAINER_TYPE_NONE", + "trainer_sight_or_berry_tree_id": "2", + "script": "NULL", + "flag": "0" } ], "warp_events": [ diff --git a/data/maps/RustboroCity/map.json b/data/maps/RustboroCity/map.json index 445bc51899a5..979d61e0b6ee 100644 --- a/data/maps/RustboroCity/map.json +++ b/data/maps/RustboroCity/map.json @@ -237,6 +237,227 @@ "trainer_sight_or_berry_tree_id": "0", "script": "RustboroCity_EventScript_Boy1", "flag": "0" + }, + { + "graphics_id": "OBJ_EVENT_GFX_LIGHT_SPRITE", + "x": 19, + "y": 37, + "elevation": 3, + "movement_type": "MOVEMENT_TYPE_NONE", + "movement_range_x": 0, + "movement_range_y": 0, + "trainer_type": "TRAINER_TYPE_NONE", + "trainer_sight_or_berry_tree_id": "0", + "script": "NULL", + "flag": "0" + }, + { + "graphics_id": "OBJ_EVENT_GFX_LIGHT_SPRITE", + "x": 22, + "y": 37, + "elevation": 3, + "movement_type": "MOVEMENT_TYPE_NONE", + "movement_range_x": 0, + "movement_range_y": 0, + "trainer_type": "TRAINER_TYPE_NONE", + "trainer_sight_or_berry_tree_id": "0", + "script": "NULL", + "flag": "0" + }, + { + "graphics_id": "OBJ_EVENT_GFX_LIGHT_SPRITE", + "x": 19, + "y": 30, + "elevation": 3, + "movement_type": "MOVEMENT_TYPE_NONE", + "movement_range_x": 0, + "movement_range_y": 0, + "trainer_type": "TRAINER_TYPE_NONE", + "trainer_sight_or_berry_tree_id": "0", + "script": "NULL", + "flag": "0" + }, + { + "graphics_id": "OBJ_EVENT_GFX_LIGHT_SPRITE", + "x": 22, + "y": 30, + "elevation": 3, + "movement_type": "MOVEMENT_TYPE_NONE", + "movement_range_x": 0, + "movement_range_y": 0, + "trainer_type": "TRAINER_TYPE_NONE", + "trainer_sight_or_berry_tree_id": "0", + "script": "NULL", + "flag": "0" + }, + { + "graphics_id": "OBJ_EVENT_GFX_LIGHT_SPRITE", + "x": 19, + "y": 23, + "elevation": 3, + "movement_type": "MOVEMENT_TYPE_NONE", + "movement_range_x": 0, + "movement_range_y": 0, + "trainer_type": "TRAINER_TYPE_NONE", + "trainer_sight_or_berry_tree_id": "0", + "script": "NULL", + "flag": "0" + }, + { + "graphics_id": "OBJ_EVENT_GFX_LIGHT_SPRITE", + "x": 22, + "y": 23, + "elevation": 3, + "movement_type": "MOVEMENT_TYPE_NONE", + "movement_range_x": 0, + "movement_range_y": 0, + "trainer_type": "TRAINER_TYPE_NONE", + "trainer_sight_or_berry_tree_id": "0", + "script": "NULL", + "flag": "0" + }, + { + "graphics_id": "OBJ_EVENT_GFX_LIGHT_SPRITE", + "x": 22, + "y": 44, + "elevation": 3, + "movement_type": "MOVEMENT_TYPE_NONE", + "movement_range_x": 0, + "movement_range_y": 0, + "trainer_type": "TRAINER_TYPE_NONE", + "trainer_sight_or_berry_tree_id": "0", + "script": "NULL", + "flag": "0" + }, + { + "graphics_id": "OBJ_EVENT_GFX_LIGHT_SPRITE", + "x": 19, + "y": 44, + "elevation": 3, + "movement_type": "MOVEMENT_TYPE_NONE", + "movement_range_x": 0, + "movement_range_y": 0, + "trainer_type": "TRAINER_TYPE_NONE", + "trainer_sight_or_berry_tree_id": "0", + "script": "NULL", + "flag": "0" + }, + { + "graphics_id": "OBJ_EVENT_GFX_LIGHT_SPRITE", + "x": 29, + "y": 48, + "elevation": 3, + "movement_type": "MOVEMENT_TYPE_NONE", + "movement_range_x": 0, + "movement_range_y": 0, + "trainer_type": "TRAINER_TYPE_NONE", + "trainer_sight_or_berry_tree_id": "0", + "script": "NULL", + "flag": "0" + }, + { + "graphics_id": "OBJ_EVENT_GFX_LIGHT_SPRITE", + "x": 14, + "y": 19, + "elevation": 3, + "movement_type": "MOVEMENT_TYPE_NONE", + "movement_range_x": 0, + "movement_range_y": 0, + "trainer_type": "TRAINER_TYPE_NONE", + "trainer_sight_or_berry_tree_id": "0", + "script": "NULL", + "flag": "0" + }, + { + "graphics_id": "OBJ_EVENT_GFX_LIGHT_SPRITE", + "x": 15, + "y": 17, + "elevation": 3, + "movement_type": "MOVEMENT_TYPE_NONE", + "movement_range_x": 0, + "movement_range_y": 0, + "trainer_type": "TRAINER_TYPE_NONE", + "trainer_sight_or_berry_tree_id": "0", + "script": "NULL", + "flag": "0" + }, + { + "graphics_id": "OBJ_EVENT_GFX_LIGHT_SPRITE", + "x": 9, + "y": 19, + "elevation": 3, + "movement_type": "MOVEMENT_TYPE_NONE", + "movement_range_x": 0, + "movement_range_y": 0, + "trainer_type": "TRAINER_TYPE_NONE", + "trainer_sight_or_berry_tree_id": "0", + "script": "NULL", + "flag": "0" + }, + { + "graphics_id": "OBJ_EVENT_GFX_LIGHT_SPRITE", + "x": 8, + "y": 17, + "elevation": 3, + "movement_type": "MOVEMENT_TYPE_NONE", + "movement_range_x": 0, + "movement_range_y": 0, + "trainer_type": "TRAINER_TYPE_NONE", + "trainer_sight_or_berry_tree_id": "0", + "script": "NULL", + "flag": "0" + }, + { + "graphics_id": "OBJ_EVENT_GFX_LIGHT_SPRITE", + "x": 19, + "y": 15, + "elevation": 3, + "movement_type": "MOVEMENT_TYPE_NONE", + "movement_range_x": 0, + "movement_range_y": 0, + "trainer_type": "TRAINER_TYPE_NONE", + "trainer_sight_or_berry_tree_id": "0", + "script": "NULL", + "flag": "0" + }, + { + "graphics_id": "OBJ_EVENT_GFX_LIGHT_SPRITE", + "x": 22, + "y": 15, + "elevation": 3, + "movement_type": "MOVEMENT_TYPE_NONE", + "movement_range_x": 0, + "movement_range_y": 0, + "trainer_type": "TRAINER_TYPE_NONE", + "trainer_sight_or_berry_tree_id": "0", + "script": "NULL", + "flag": "0" + }, + { + "graphics_id": "OBJ_EVENT_GFX_LIGHT_SPRITE", + "x": 14, + "y": 54, + "elevation": 3, + "movement_type": "MOVEMENT_TYPE_NONE", + "movement_range_x": 0, + "movement_range_y": 0, + "trainer_type": "TRAINER_TYPE_NONE", + "trainer_sight_or_berry_tree_id": "0", + "script": "NULL", + "flag": "0" + }, + { + "graphics_id": "OBJ_EVENT_GFX_LIGHT_SPRITE", + "x": 17, + "y": 54, + "elevation": 3, + "movement_type": "MOVEMENT_TYPE_NONE", + "movement_range_x": 0, + "movement_range_y": 0, + "trainer_type": "TRAINER_TYPE_NONE", + "trainer_sight_or_berry_tree_id": "0", + "script": "NULL", + "flag": "0" } ], "warp_events": [ diff --git a/data/maps/SlateportCity/map.json b/data/maps/SlateportCity/map.json index 6ffed4b45413..9141e5ab69c3 100644 --- a/data/maps/SlateportCity/map.json +++ b/data/maps/SlateportCity/map.json @@ -484,6 +484,32 @@ "trainer_sight_or_berry_tree_id": "0", "script": "0x0", "flag": "FLAG_HIDE_SLATEPORT_CITY_SCOTT" + }, + { + "graphics_id": "OBJ_EVENT_GFX_LIGHT_SPRITE", + "x": 21, + "y": 19, + "elevation": 3, + "movement_type": "MOVEMENT_TYPE_NONE", + "movement_range_x": 0, + "movement_range_y": 0, + "trainer_type": "TRAINER_TYPE_NONE", + "trainer_sight_or_berry_tree_id": "1", + "script": "NULL", + "flag": "0" + }, + { + "graphics_id": "OBJ_EVENT_GFX_LIGHT_SPRITE", + "x": 15, + "y": 26, + "elevation": 3, + "movement_type": "MOVEMENT_TYPE_NONE", + "movement_range_x": 0, + "movement_range_y": 0, + "trainer_type": "TRAINER_TYPE_NONE", + "trainer_sight_or_berry_tree_id": "2", + "script": "NULL", + "flag": "0" } ], "warp_events": [ diff --git a/data/maps/VerdanturfTown/map.json b/data/maps/VerdanturfTown/map.json index 94d140c05e64..df419ce905f3 100644 --- a/data/maps/VerdanturfTown/map.json +++ b/data/maps/VerdanturfTown/map.json @@ -76,6 +76,32 @@ "trainer_sight_or_berry_tree_id": "0", "script": "VerdanturfTown_EventScript_Camper", "flag": "0" + }, + { + "graphics_id": "OBJ_EVENT_GFX_LIGHT_SPRITE", + "x": 18, + "y": 3, + "elevation": 3, + "movement_type": "MOVEMENT_TYPE_NONE", + "movement_range_x": 0, + "movement_range_y": 0, + "trainer_type": "TRAINER_TYPE_NONE", + "trainer_sight_or_berry_tree_id": "1", + "script": "NULL", + "flag": "0" + }, + { + "graphics_id": "OBJ_EVENT_GFX_LIGHT_SPRITE", + "x": 14, + "y": 3, + "elevation": 3, + "movement_type": "MOVEMENT_TYPE_NONE", + "movement_range_x": 0, + "movement_range_y": 0, + "trainer_type": "TRAINER_TYPE_NONE", + "trainer_sight_or_berry_tree_id": "2", + "script": "NULL", + "flag": "0" } ], "warp_events": [ diff --git a/data/tilesets/headers.inc b/data/tilesets/headers.inc index 3f1945af4bb7..8a1e8f444beb 100644 --- a/data/tilesets/headers.inc +++ b/data/tilesets/headers.inc @@ -1,8 +1,8 @@ .align 2 gTileset_General:: - .byte TRUE @ is compressed + .byte 0x41 @ is compressed, swapPalettes 4 .byte FALSE @ is secondary tileset - .2byte 0 @ padding + .2byte 0x10 @ lightPalettes 4 .4byte gTilesetTiles_General .4byte gTilesetPalettes_General .4byte gMetatiles_General @@ -11,9 +11,9 @@ gTileset_General:: .align 2 gTileset_Petalburg:: - .byte TRUE @ is compressed + .byte 0x21 @ is compressed, swapPalettes 9 .byte TRUE @ is secondary tileset - .2byte 3 @ lightPalettes 6,7 + .2byte 0x00B @ lightPalettes 6,7,9, custom 9 .4byte gTilesetTiles_Petalburg .4byte gTilesetPalettes_Petalburg .4byte gMetatiles_Petalburg @@ -35,7 +35,7 @@ gTileset_Rustboro:: gTileset_Dewford:: .byte TRUE @ is compressed .byte TRUE @ is secondary tileset - .2byte 64 @ lightPalettes 12 + .2byte 0 @ padding .4byte gTilesetTiles_Dewford .4byte gTilesetPalettes_Dewford .4byte gMetatiles_Dewford @@ -44,9 +44,9 @@ gTileset_Dewford:: .align 2 gTileset_Slateport:: - .byte TRUE @ is compressed + .byte 5 @ is compressed, swapPalettes 6 .byte TRUE @ is secondary tileset - .2byte 0x41 @ lightPalettes 6,12 + .2byte 0x1 @ lightPalettes 6 .4byte gTilesetTiles_Slateport .4byte gTilesetPalettes_Slateport .4byte gMetatiles_Slateport @@ -68,7 +68,7 @@ gTileset_Mauville:: gTileset_Lavaridge:: .byte TRUE @ is compressed .byte TRUE @ is secondary tileset - .2byte 0 @ padding + .2byte 0x0101 @ lightPalettes 6, customLights 6 .4byte gTilesetTiles_Lavaridge .4byte gTilesetPalettes_Lavaridge .4byte gMetatiles_Lavaridge @@ -77,7 +77,7 @@ gTileset_Lavaridge:: .align 2 gTileset_Fallarbor:: - .byte TRUE @ is compressed + .byte 9 @ is compressed, swapPalettes 7 .byte TRUE @ is secondary tileset .2byte 2 @ lightPalettes 7 .4byte gTilesetTiles_Fallarbor @@ -99,7 +99,7 @@ gTileset_Fortree:: .align 2 gTileset_Lilycove:: - .byte TRUE @ is compressed + .byte 5 @ is compressed, swapPalettes 6 .byte TRUE @ is secondary tileset .2byte 0x01 @ lightPalettes 6 .4byte gTilesetTiles_Lilycove @@ -107,12 +107,13 @@ gTileset_Lilycove:: .4byte gMetatiles_Lilycove .4byte gMetatileAttributes_Lilycove .4byte InitTilesetAnim_Lilycove + .2byte 0 .align 2 gTileset_Mossdeep:: - .byte TRUE @ is compressed + .byte 0x11 @ is compressed, swapPalettes 8 .byte TRUE @ is secondary tileset - .2byte 0 @ lightPalettes 8,9 + .2byte 0x4 @ lightPalettes 8 .4byte gTilesetTiles_Mossdeep .4byte gTilesetPalettes_Mossdeep .4byte gMetatiles_Mossdeep @@ -129,10 +130,11 @@ gTileset_EverGrande:: .4byte gMetatiles_EverGrande .4byte gMetatileAttributes_EverGrande .4byte InitTilesetAnim_EverGrande + .2byte 0 .align 2 gTileset_Pacifidlog:: - .byte TRUE @ is compressed + .byte 0x21 @ is compressed, swapPalettes 9 .byte TRUE @ is secondary tileset .2byte 8 @ lightPalettes 9 .4byte gTilesetTiles_Pacifidlog @@ -143,7 +145,7 @@ gTileset_Pacifidlog:: .align 2 gTileset_Sootopolis:: - .byte TRUE @ is compressed + .byte 5 @ is compressed, swapPalettes 6 .byte TRUE @ is secondary tileset .2byte 0x101 @ lightPalettes 6, customLights 6 .4byte gTilesetTiles_Sootopolis diff --git a/data/tilesets/primary/general/metatile_attributes.bin b/data/tilesets/primary/general/metatile_attributes.bin index d9cd29016d792fb568494dbf2f820100081a14f8..552dafb603a737f14fa19094994e2dfb92163764 100644 GIT binary patch delta 56 ocmZqRXyBM2t}DR6z{G$6i~@`d%m^+615h3c1TqCSy6j;F0Cb=PSpWb4 delta 56 ncmZqRXyBM2uFJr{zy!oFz{tSJzzpMnXaP7!Ad_LE%N}L`Z!iQY diff --git a/data/tilesets/primary/general/metatiles.bin b/data/tilesets/primary/general/metatiles.bin index af899bcc5efa4bdd3ab1f418b371a866441207c9..813543f580749b6863bb474c80764044624545a6 100644 GIT binary patch delta 111 zcmZp0XmFUYhh@3La+iq*Dp_Fh6|<%P6x_@S6Mmy=1mA0{~x$BLV;b delta 111 zcmZp0XmFUYhlPQGfo0->3NSs{hVc%F!LV6|>6xSlvjVdMlR|Ugw7}-Tus|jt55%7i fbK0veuN&RLonQhDfrW6@% diff --git a/data/tilesets/primary/general/palettes/04.pal b/data/tilesets/primary/general/palettes/04.pal index 11ebd16a6443..57d4faa34d65 100644 --- a/data/tilesets/primary/general/palettes/04.pal +++ b/data/tilesets/primary/general/palettes/04.pal @@ -1,12 +1,12 @@ JASC-PAL 0100 16 -24 41 82 -248 0 248 +232 0 128 +216 224 232 222 230 238 -255 0 255 -255 0 255 -255 0 255 +184 200 224 +152 176 216 +112 184 240 156 164 189 80 104 208 65 90 189 @@ -16,4 +16,4 @@ JASC-PAL 139 164 222 106 131 213 82 106 213 -248 0 248 +96 168 232 diff --git a/data/tilesets/primary/general/palettes/13.pal b/data/tilesets/primary/general/palettes/13.pal index 4b0812f09403..73fec5261aaf 100644 --- a/data/tilesets/primary/general/palettes/13.pal +++ b/data/tilesets/primary/general/palettes/13.pal @@ -1,19 +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 +232 0 128 +232 228 216 +222 230 238 +224 214 184 +216 200 152 +244 226 171 +156 164 189 +80 104 208 +65 90 189 +57 82 156 +41 65 139 +172 197 230 +139 164 222 +106 131 213 +82 106 213 +221 205 143 diff --git a/data/tilesets/primary/general/tiles.png b/data/tilesets/primary/general/tiles.png index 17426ab80e8fe2434bc9ecefbc8e063fd4e6d09a..b22b3f1f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9+a%x-wCRCXd;5a!i0DO#O2&n#_kMY3Ze=^m+VDiuTXX^l; zbpk$skYgGE%>~B8$*Ie#S1wbx^fnjV{&xb%yOi81Ot<4yJU zM-)c$^!T5?ql~siM4ZHp#E(LPU&w`~wgC$2RBluhfs1^E&np5|4kf^$*Y9Bu0-$Yx z0ClJ48I^fljarc;otE;v`SbOFu}e)MgSG)NtkCKmR|^sD%X~yVexBi~4UTHV*w`f@ zg0_(~;7zJAuk!m!giQc-1rT;o1%Q5-0l)|FdP*i!K!8Z7HICN+*l$gd z3iFKRjy-iOZok%+fb=3PQOaJY#|Gk_-Qtcxup=!4j@LIq8<-*5 z3<XAB3Hr{77ASm-o3x9u96@n%E2=ms96W4E^TSa}uI^gGG; ze;a;m7yV}4^-+=Ct_KXquD>;ae%qtpNk&?n38^9g0V*>3(OziV-WQD4^e&=)Cz;+y zn_&b%g920xrd>$)N|*ly0JJ&zO$NP>HbZx0)6fdD?Yip*{@g2Fhra-TF#W%6yI7=| z!QsHI`vkb{cct=k4zF9A+=+4d{A4ytR0k=^Auvx{N$N|#$}bkPYz{M$S+ z@nVbX(u)-0Z8nIlHy^jUp3?t)@7hl$+=;;iKso*3EWLZVH6RcGd%|871yn%*kiHyn z^P7K0k4%2=C#4k|09}aywciNv&G)W>aI;Vv%vt%p0zgghRa3qU;1_-m!drXi%)-iG z$vm6@sQv!|W5t&Nutb9JW_Bez7{@Ew!->068mrgFM04t21i*}bBA;8ZW3~`09V7rG ot&c5r@XeoC)O{?btK#VY19F}-r~yz*+yDRo07*qoM6N<$f=+cy+W-In diff --git a/data/tilesets/secondary/dewford/metatile_attributes.bin b/data/tilesets/secondary/dewford/metatile_attributes.bin index 67ee25d405026191260b7a7cfc078b007db4af1d..158238664fe74c5543b5e0374f4996b1eb3c441c 100644 GIT binary patch delta 28 dcmeyy`i*sht)Kt{1A_n%fdzd?V)Q%3Hf_Fh6|<%P6x_@+kxr>L|cIBVe*@+n9W2097!ft delta 117 zcmdm>zd?V)Q%3GX$;TKVfMxOr#zO8xsmF?gii3bcER%DXj(JD~N(6EQHU~}v;xHf! i!k-T0hYO|&BKU2A>45=oemhV;K(qx({pKoWGZ6qYsUj-? diff --git a/data/tilesets/secondary/dewford/palettes/12.pal b/data/tilesets/secondary/dewford/palettes/12.pal index cf04ad17c0bd..4b0812f09403 100644 --- a/data/tilesets/secondary/dewford/palettes/12.pal +++ b/data/tilesets/secondary/dewford/palettes/12.pal @@ -1,19 +1,19 @@ JASC-PAL 0100 16 -0 224 0 0 0 0 -222 230 238 -189 205 230 -156 180 222 -131 131 139 -98 98 123 -65 74 106 -152 176 216 -115 189 246 -98 172 238 0 0 0 0 0 0 -213 180 106 -205 156 82 +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/data/tilesets/secondary/dewford/tiles.png b/data/tilesets/secondary/dewford/tiles.png index 522864a973349519bbe3f1e52a202d929fe7d71c..2af1303c274bf1662d41d0b37c8b49772697f4c1 100644 GIT binary patch delta 3804 zcmWm3c_7pOEGgcp05*rgr2swv2KFU!!%e}YdNad&`Ay&?ml7t9z zRzlK2&Q)6a$PtAc`F(%SKOfHw+JEx7$`n9!v~#hN(sbJ0-JRwvwheNM8>Y{nzvSNd?VYU2l00d%eDP)(};%iJrG5UsP1Y@dP z@_=QOhpGuZKGNU0zck3XsNisG-|^2j1B$;#%=GkiS#)&Y+L^{*EVnt9@793Yyc9g5G?Ov2p3w1pJt61fo!CJl z&8z;DtkHUAw8blSyP_SgA%@;JROmOHo^)d;s5<@f#RrRPjzHoXeL8~H zs<4?ya;3T0$D5~-1zub=J)z9!2cCmCxnhfktXytCN|nVHw?(Xt)0;*&omH~w9lxX- zJFj@j-ve%wy+=3LMUO|5-Il7lyX6obDhNOMF*WPG9;^G&CjaUWgHy+;tVEXsg7^H9&{0J+Jfv13U?B-;w_k4QJ~of)02qdw)}y?waVS z1OiKbA`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}S2{XX3<20xU?Dw$OXZ*b zldhOCJv2&Vt$;x{fIE=^v=n@FXGH+|Ff$MU{M-T9>TX8f>x(GiCx53Z>?{=kIE3Im zneS(u03JwEEDt8ds05}W5}=v3Gk{c_U<6PR3>a(!h-sW4M*}qTeh!deHc-Le<+1`$GR-#w0nNOhMI9v+wJGQJ2DIO-2Qb(c0BeGh3qYSk1^}Yk z3{5m=BtE4K(}Bg|r~f}-_?u?i0L2Ed=N-`jNgn_pHVV)>0A^C?Sg#Uo=3c1%$UHh}-VkElTe0H^>70w5L93@H-8e2oE)?UAUh}kii}AyD4#1xrTK6lN|pEba{!sL0X#m9JgY%_K;`{K4j9BH zWdLnt7+pDz&GZ`V#Xu@jDi6Y&;?65KEzk#36fl8+Aq14%0N%b%d;YD8iM?TBXnYXj zcb^j=u?@UD|8^M0C~IG*J$K^OU8*_)h#?1H$S~&p08(qR_G4Mzg}wBKwwUYF$~#=)U6$7avvgq|9zjaQ3a!21CH?| h;Nbyy*DXf5_P-wg=!qh9dN%+7002ovPDHLkV1nB~wpaiF diff --git a/data/tilesets/secondary/fallarbor/palettes/00.pal b/data/tilesets/secondary/fallarbor/palettes/00.pal index ede0c60a19d5..87f9999aef28 100644 --- a/data/tilesets/secondary/fallarbor/palettes/00.pal +++ b/data/tilesets/secondary/fallarbor/palettes/00.pal @@ -1,19 +1,19 @@ JASC-PAL 0100 16 -115 197 164 -255 255 255 -222 230 238 -189 205 230 -156 180 222 +0 192 0 +222 230 164 +180 197 115 +148 156 82 +123 131 65 131 131 139 98 98 123 65 74 106 -189 189 131 -115 189 246 -98 172 238 -115 189 246 -98 164 222 -82 139 197 -74 115 172 -115 197 164 +88 168 168 +221 205 143 +244 226 171 +255 205 82 +230 156 49 +222 123 32 +156 98 41 +128 192 216 diff --git a/data/tilesets/secondary/lavaridge/metatiles.bin b/data/tilesets/secondary/lavaridge/metatiles.bin index fd0314ed78ce4aad760ba39a6e6522e5f27bfdd9..c9bc71442ad26a06aab12352b676b63098f74c93 100644 GIT binary patch delta 15 XcmbPWKEZs$4^F1#j+=jRP7?$GHQWY= delta 15 XcmbPWKEZs$4^AcqhRwe?rwIZ8FU19) diff --git a/data/tilesets/secondary/lavaridge/palettes/06.pal b/data/tilesets/secondary/lavaridge/palettes/06.pal index 00e1478a73ce..a858e623d1f1 100644 --- a/data/tilesets/secondary/lavaridge/palettes/06.pal +++ b/data/tilesets/secondary/lavaridge/palettes/06.pal @@ -1,19 +1,19 @@ JASC-PAL 0100 16 -0 0 0 -65 74 106 -197 205 0 -230 238 238 -255 255 255 -255 115 65 -230 115 65 -180 98 90 -164 82 82 -205 49 0 -148 49 0 -246 24 24 -246 148 0 -148 164 65 -106 123 139 -222 222 0 +0 192 24 +64 72 104 +192 200 0 +224 232 232 +248 248 248 +248 112 64 +224 112 64 +176 96 88 +160 80 80 +200 48 0 +144 48 0 +240 24 24 +240 144 0 +144 160 64 +104 120 136 +224 40 0 diff --git a/data/tilesets/secondary/lavaridge/tiles.png b/data/tilesets/secondary/lavaridge/tiles.png index 2f6898a0f7ca21efb0dfc0c1d608d8bae6931a27..03c832c37a14b993e7096921d0f27f8647945916 100644 GIT binary patch delta 30 kcmew^|6P7UDpSRrjp+^i0w#wmdKI;Vst0J-l9+yDRo delta 30 kcmew^|6P7UDpN+|#`Fe$fosPnZ(;xfPgg&ebxsLQ0K`@cm;e9( diff --git a/data/tilesets/secondary/lilycove/metatile_attributes.bin b/data/tilesets/secondary/lilycove/metatile_attributes.bin index 0f4e01b923280efa5742e9a869e9d172da7fb119..f31cc9a047db711eaaa07a556400e4425abe0ad0 100644 GIT binary patch delta 35 icmdnTx{q~(H>02c0|NsHg8-O4IfijIqrl`JjK=_MNe03I delta 26 icmdnTx{q~(H{-;QB9r48XH3>-WSe}Ok!vzL({=!cBMCVG diff --git a/data/tilesets/secondary/lilycove/metatiles.bin b/data/tilesets/secondary/lilycove/metatiles.bin index 15b22292776bcba749ccf955107603eb5fec08fa..f82bdff5c618f60de442abefd7d77737975195dc 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|iVNvxJL++E6## z#FJkER`x|DAV_O_!fMtajm*FZX>-sZh?-rAfY11*eYpU}o#{YA$RC}^<^ZSDgtKlC z-9E)3+?FsQ%^9oIk)KfYH$$>M=BK&z%>WSy@?Ly4GA>utat~@#CvG&LnogL#06)x@ zoXq#|fu`dbU|DY>RJdFnu)l>a=uFMK#Ax1(BN<5d)N(I}W{tp%a`qh9+#fXc{87K(Hr8^RKrx&ky8ao^Bk<=By+m z!qJ4%=O2DF=s3Vs~M z^;97K7Kxy_b^9|0tB0m!F}A-FUar6VUANDZ*Z z-q}|vR>=VE&JG3dT?U{EknXDm<&P_O%DE2(9y3T+0B2Gb0t b8!#B01mc?pEe72NvkYb%oHSuDxe3GoKrbzT delta 100 zcmZp0cwoO_iv*9aQmm43l5vtlkVDwy0}=&1u}Z#R7!VW?HrYlpOTrf{?-=9|1X2r< hHcm200;=98nIZuZa106v3JeN{D+mbNY$dgf6#xJq9c%yq diff --git a/data/tilesets/secondary/mauville/tiles.png b/data/tilesets/secondary/mauville/tiles.png index 20da7198e89bf0890f4ec48261c9372907c2c4c6..09bab365772533a3970d7f4a44cb72d806e02b38 100644 GIT binary patch literal 6079 zcmW+)c{G*#_x`-^865L5PY1^=B<{@|j(HvvGIcVOq$o2la?L}7DayH|bjg^I=v5ga zQxQ@+B@r1)I3@gie{1cvp1t<7pJ)H|{IfIcZOzzOgjoOp>=x$6jt7VU00AuKpv#!_ zxqbjD_SQ}&2e`k#KQS@U+1Yvf_U)9EEQ1Frw>Xj*Wr-s;T~&pKblgw3ke;o;S?4}aF$7jCtO2lxrP;&mt2 zACHCBH4OHME~@1?If%!4GM;wqFiIurN6&^v(~E-)-)n1oDo;MW5Iz0g4#6zR&o#u_ zef>(m70_X2e~i=1-;|F!JE%EK5ud!Kie4l!w#Kfps9f5P_pO;f`)*!3_dqhBu z5+(GSv{?B_4bST_c^3K^y0+`Fz7fE@K0(8&luuv1Ncyi`kgiJqX(2VoLw{};Q-6JJ znLxaGgU&~wmw$^n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QWQG)4=>t95ebm{aub{sO}TymF7rQyb=!fVCmElRLIQjs z7m_)w5cT}`dCGrLI(IZAVrlFUITBpWzYX=BPkwRAJoVkk4`+0ck>C@CzaTS(OFvc6 zL0k1yw=4P5q?+?)MWf-PH$3Qw*T6%!;hts!#xtEVJQVXHDghW+En`D)kODWhhgXtD z1OwFC?v9ITj6Aoa$$gvt|IDtTxLdBj-2^?~yS9Gnk5VPuq^UgtxpnbEXQkM0M||v8 z=+Pf)sO%l~Lo|b4_jXY-k*r-Fhj?NrpALR4dNO|c<~TJ2nv1VJY+vSy#DM{Q%3&PR z{RMv9@hD<=x~WtR3bV#UWV0d1`Iu~JlUDo)jlx(Q2JLFOD@<#|nLbM$ZK<7Jr=3oDt@&05G!4nIX95)4N;d}AoWR_Hg+kN|4 zJnQ~@GBZP*gB7?7NBrLIBT8RaZEa)&g$e)GB>nX4{7BEi%VJ@nNl+1QiAFzQ{%8jE zvrDTVoLd{UFw&RBd;z+lQrC%ypN-6YSp~^!qGIXhw#t`+RQ7?xBSUFvX2NRNpTzl# zX_3MrjLzg#(!2rY`)D9nNCxn~n`cP5i@)$&ma<{r)u&CQ$MJ{jgVpO`Fa=rO2~?0nDl{5@77s0qI7BLU>1Kpu<#3f5&jcqePi)^~xD>SNtJo~Anw zX_9AxaxeY&E-8Nvar1prE-GH+3%EwZSOu0ax`xVNdi;ktz;Q#2Y%(dOPF4yydoA^h mr(xK1)hIpw`r_jAJH_u6rEX`)>HPba17iaV{W3jT)c*iIW30ab diff --git a/data/tilesets/secondary/mossdeep/metatiles.bin b/data/tilesets/secondary/mossdeep/metatiles.bin index 5fc527d0ff3080888be2712495687578893e0d5b..1fe4faf9c560e696faa866bee59490b27545cb12 100644 GIT binary patch delta 42 zcmV+_0M-BCIN&(2lnD&86SNbtld+Sxlem+Upb2mc!xO|410Vt*$CJpDvm6RU5}^MP A!TZLU;AFhZO2G$~m>9+BPUrSV?o zx{i@!bdXoR`|st!%F^f+A7$T#?>mLMCjVy3yJ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T=~2RN2kga*$mmeZxWH#(oUA&*-Fn%4Lkge8e~pv(0xQINtR`nVs&30iI*N z1lQJ3JKE)dwv(9;Qx3H^Ndq_v87BxbRzQ{~im#@e_fVDOufkjuqpCjWW6gVl-H-<_ z;-C8SY}wU~gWX*`ffInHz8F)XV11&=H~SC<;q158K~_)X`U4H>fE|`+FR<-#=raJ@ z^!|CNj0?C2Qs?GWpt!1BoBG+r8)5&c%#9+U(|@ZA#cET4=1?k#r0`&So%U}r;g$gS z#g&#ZJpGSi#9DZf&*ro*<&SYeIp;5C`#DN!YFg*wzCX4V8!itWcJc3p$~h4phd~co zlD5@Ng4u^$tQKod=8cMXZ4-fjA^ee$9Zb)RM~#}rw{%fc5uYp)~wQmp71}Z Ca4E_F diff --git a/data/tilesets/secondary/pacifidlog/palettes/02.pal b/data/tilesets/secondary/pacifidlog/palettes/02.pal index 4c41030f6616..9ea109ce0032 100644 --- a/data/tilesets/secondary/pacifidlog/palettes/02.pal +++ b/data/tilesets/secondary/pacifidlog/palettes/02.pal @@ -1,19 +1,19 @@ JASC-PAL 0100 16 -24 41 82 -180 255 131 -131 197 98 -57 139 49 -57 82 0 -222 148 115 -106 90 90 -164 98 90 -65 57 49 -255 197 148 -222 106 98 -205 65 82 -164 213 197 -115 197 164 -65 180 131 -24 164 106 +0 0 128 +222 230 164 +180 189 123 +156 164 98 +131 139 74 +90 98 41 +98 98 123 +65 74 106 +32 32 82 +238 230 164 +238 197 98 +205 156 57 +164 123 24 +131 82 49 +131 131 139 +244 226 171 diff --git a/data/tilesets/secondary/petalburg/palettes/02.pal b/data/tilesets/secondary/petalburg/palettes/02.pal index 4c41030f6616..4897614451e6 100644 --- a/data/tilesets/secondary/petalburg/palettes/02.pal +++ b/data/tilesets/secondary/petalburg/palettes/02.pal @@ -1,19 +1,19 @@ JASC-PAL 0100 16 -24 41 82 -180 255 131 -131 197 98 -57 139 49 -57 82 0 -222 148 115 -106 90 90 -164 98 90 -65 57 49 -255 197 148 -222 106 98 -205 65 82 -164 213 197 -115 197 164 -65 180 131 -24 164 106 +0 192 0 +232 224 200 +208 200 144 +200 176 120 +168 136 120 +128 128 136 +96 96 120 +64 72 104 +40 48 88 +244 226 171 +221 205 143 +248 224 176 +248 184 168 +240 160 128 +200 136 104 +248 192 32 diff --git a/data/tilesets/secondary/petalburg/palettes/09.pal b/data/tilesets/secondary/petalburg/palettes/09.pal index c4a6e250afee..1a6a5c771344 100644 --- a/data/tilesets/secondary/petalburg/palettes/09.pal +++ b/data/tilesets/secondary/petalburg/palettes/09.pal @@ -1,19 +1,19 @@ JASC-PAL 0100 16 -24 41 82 -238 230 205 -213 205 148 -205 180 123 -172 139 123 -131 131 139 -98 98 123 -65 74 106 -41 49 90 -156 205 246 -98 156 238 -255 230 180 -255 189 172 -246 164 131 -205 139 106 -115 197 164 +0 192 0 +232 224 200 +208 200 144 +200 176 120 +168 136 120 +128 128 136 +96 96 120 +64 72 104 +40 48 88 +152 200 240 +120 152 232 +248 224 176 +248 184 168 +240 160 128 +200 136 104 +248 192 32 diff --git a/data/tilesets/secondary/rustboro/metatiles.bin b/data/tilesets/secondary/rustboro/metatiles.bin index 63ecf0306eed55fba51975805e7469fdd82f728a..649b09fac9aa91854c7410881856a96aee8e5aca 100644 GIT binary patch delta 177 zcmaE${Xu&}8!Ok0WD6lnA+NTX&66jvnn=w^_H42Q3e0Q<(aZ`nlJ^T(3Rwa9lkc%A z$uTgjNM-;6ueO!VQEib;o=qp3BAaeB?J(MD#K16Fj!i-(vT3K$E+7Y{l!0L-(5y%x zglGlvH%GCpV3U{@_^9bYQ*+=l$L7GW!0CYxnn3*Jj+>=;k8ubvDKG;elfpd1`G)HZ H*Bb%=xS>1? delta 160 zcmeyM{Xly|8!OkzCJP}32Cudm$&)9rnn;~&@@!%Nf*HvS43=*EATag^q770{*0?5D7w8LnpQDoC(IW`HE{Q^6Ub{R1+L^j<7N`n-y v0Gbuq1mc5uApYhkwiRp=51Jk|J!onUoEF#|7#8>t$OiGJ2X2<)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nE*R$d^ieL=z?G4AdIRQ)B4!7M=-0>o=ojbcC|yfE%g(X77_j;m{ek<~{Qi2i{P1oCMk^6W`e9g(I4diw0X&&fPBM7_DV6O&Du2lB7Y>y>|es9lNl)Dl52fze9 zQkK$JBb@_MSNr;2jTG^j0tmR?G2nXt`9J=6WatDwQz#Zc>HLBT(hocj((#!>@sn$l z9Rp6#k&*M~>2-Xj@Y8GKv}3>>iVEmWe5PO=nd=--_Yk&IizfKr;{$Blg_duHx3Woo z_dnb{fc^KUx$OX`Y0_;0CWj}J+XW173t&>3+a5rt=Jo*T7@4!MKmY&$07*qoM6N<$ Eg77eZ)&Kwi diff --git a/data/tilesets/secondary/slateport/metatile_attributes.bin b/data/tilesets/secondary/slateport/metatile_attributes.bin index d4894828bb7bc86e7d87bb144ca87610ca9b6bee..0f311a694f316031fc8829b1d3c72ae7fa4d39be 100644 GIT binary patch delta 36 kcmZ3(wuWtkJR_sPWCg}%K>-E^1_2-h0Wf>>7RCxj0C?;LzW@LL delta 36 jcmZ3(wuWtkJR>8+WCg}%K?WcY073{2BsXtitY8EHb!-KX diff --git a/data/tilesets/secondary/slateport/metatiles.bin b/data/tilesets/secondary/slateport/metatiles.bin index 0cb7f64acaf96c38d35e004426fe9fc0bfca9d57..3ba541bfbd4a2a77a00b1a692ed22bf48377f019 100644 GIT binary patch delta 241 zcmaE0^uTDt2Mz(bB-tdsB;F*IBGn?3BGaNxoFXhd%L0~#Tu!*0u-sv}%VY)K5>$Z& zyc#SqjLr>t9}}F# F4gkZUMKu5b delta 241 zcmaE0^uTDt2Mz%SG_Z+NgoTG$fm!8p!sUcz0n0)rEAW=^NCYAYEa25(0qNR&hW7;{ z7l@_NtkEpdJb52~5ts`S0&=YcPB;KfQeaXL2g<4g)i42hAU;SnNDqP!F#*Ph$b#f2 jI|;ftFe!jEs{=K`6o8b23_C6i1h z+YyN&cw-M4WjkWs5}|myZge1-K_?Vb3CSTuI;F*>yA*&!M&}ImtU_|ra!5D$r?T44 zzBq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gaFVdylcIs8ITOhdNs04HD*F%jED&P%{P?D6j#!PVWQ|fJZS4|m z!O7V^X9hXI3w#0&6acC3g{R-UpU8xzbLlu92}Hnlx+2eMdxgUj8svF}#al;Wjn6b9 zA1c1)I2)!3GS?U4GQ`l4*wyE)?FZA}rEv`oLKkR=#H@%KW5IUPa!Xu%i@UPk21PL@SvTwwC_38GA>#^0m ziZ9jx4-3|8WZW9iAn+C^k#vw*n6mT_nOq*~lrGOJLMc^mo)?;2#<5^9IS8+laG=rN`#j@8Yu5U;IF%lQXVxsUm-^Bj|AT#aT2^pya8 z%4f{Gh|11;Q>fegmwd)jwyIBxc*UVqA^?#b^;R2P8>0px7EypUS$lz$#EZb9jjhh< z=@_9Qlj!mYsh~DqU6koqbRP1d>$t~X4%%dM16x&(s1^Of(uGf^>~Nx#aC2g;bb+@T z*NqTK)&pIvh-vnt<9~17i8(z4Sie)AHgcjq1X%I&KO5D6`7jeZ3P05`%%MKVCr!hE z1etQY=51_rdN;&3|Lq3jG2^SPAdm$T`2CZUb|XA&3K=4q3DLQl9cUN7%620fQj+@i zJAA;z!R(?e!Y3aVqel=P6qjND4L@WA8df%_gfoEtOh9JBmf?dK_qGs?a{8&b4hX-l z0Wv-l_~?ouZ9h<`dYHR*bcG48gKj!@!xswZI{CiNhwrl>Ruk2_1fxe}s<&%+@lm7mnP>^_he4h-#j+L6kQziX*q%7z7 zZcw3A88a_8dY$nk`y&che7h~29Ar;Wkp*Y*sr2tQh+opGY2FJWfP`@tho6yY99J^; zq*YhRCI&)$t$(4&iv%ZhH`KAsnN|*hFz;Z2B1yAd$cw>+LbV9K_Ca7Fq1<4WJ5|W zvtbLX6c7#UsHkLsYeqYkhPli6A>>(BPlKLAH+Etko@sq<57EYpmzeu!N^y3Nm^vZuL@ R`0sT9MitileTag == TAG_NONE || !template->images) + return 0xFFFF; + if ((tileStart = GetSpriteTileStartByTag(template->tileTag)) != 0xFFFF) // return if already loaded + return tileStart; + tempSheet.data = template->images[frame].data; + tempSheet.size = template->images[frame].size; + tempSheet.tag = template->tileTag; + return LoadSpriteSheet(&tempSheet); +} + void LoadSpriteSheets(const struct SpriteSheet *sheets) { u8 i; @@ -1621,6 +1636,13 @@ void LoadSpritePalettes(const struct SpritePalette *palettes) break; } +u8 LoadSpritePaletteInSlot(const struct SpritePalette *palette, u8 paletteNum) { + paletteNum = min(15, paletteNum); + sSpritePaletteTags[paletteNum] = palette->tag; + DoLoadSpritePalette(palette->data, paletteNum * 16); + return paletteNum; +} + void DoLoadSpritePalette(const u16 *src, u16 paletteOffset) { LoadPalette(src, paletteOffset + 0x100, 32); diff --git a/gflib/sprite.h b/gflib/sprite.h index e53737981b2d..6b952ab4ee3e 100644 --- a/gflib/sprite.h +++ b/gflib/sprite.h @@ -296,6 +296,7 @@ void FreeOamMatrix(u8 matrixNum); void InitSpriteAffineAnim(struct Sprite *sprite); void SetOamMatrixRotationScaling(u8 matrixNum, s16 xScale, s16 yScale, u16 rotation); u16 LoadSpriteSheet(const struct SpriteSheet *sheet); +u16 LoadSpriteSheetByTemplate(const struct SpriteTemplate *template, u8 frame); void LoadSpriteSheets(const struct SpriteSheet *sheets); u16 AllocTilesForSpriteSheet(struct SpriteSheet *sheet); void AllocTilesForSpriteSheets(struct SpriteSheet *sheets); @@ -309,6 +310,7 @@ void RequestSpriteSheetCopy(const struct SpriteSheet *sheet); u16 LoadSpriteSheetDeferred(const struct SpriteSheet *sheet); void FreeAllSpritePalettes(void); u8 LoadSpritePalette(const struct SpritePalette *palette); +u8 LoadSpritePaletteInSlot(const struct SpritePalette *palette, u8 paletteNum); void LoadSpritePalettes(const struct SpritePalette *palettes); u8 AllocSpritePalette(u16 tag); u8 IndexOfSpritePaletteTag(u16 tag); diff --git a/graphics/object_events/palettes/light.pal b/graphics/object_events/palettes/light.pal index 3beca89bdfac..92a4477f764d 100644 --- a/graphics/object_events/palettes/light.pal +++ b/graphics/object_events/palettes/light.pal @@ -2,18 +2,18 @@ JASC-PAL 0100 16 110 198 165 -255 213 18 -255 214 38 -254 217 39 -254 218 53 -255 220 65 -255 221 76 -255 223 86 -254 225 95 -254 228 104 -254 229 112 -254 230 120 -255 232 132 -255 235 148 -255 237 162 -255 240 176 +64 61 42 +77 73 50 +85 81 58 +100 94 66 +111 105 75 +119 112 77 +140 131 92 +154 145 103 +171 159 111 +186 174 123 +197 183 128 +209 195 139 +224 209 146 +234 219 155 +249 232 161 diff --git a/graphics/object_events/palettes/light2.pal b/graphics/object_events/palettes/light2.pal new file mode 100644 index 000000000000..3d61a3020dda --- /dev/null +++ b/graphics/object_events/palettes/light2.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +106 202 166 +58 54 31 +67 62 33 +96 89 53 +110 102 57 +121 111 67 +128 119 66 +156 143 82 +166 155 96 +185 169 100 +199 183 112 +211 192 113 +223 203 123 +237 218 129 +247 227 137 +255 237 147 diff --git a/graphics/object_events/palettes/neon_light.pal b/graphics/object_events/palettes/neon_light.pal new file mode 100644 index 000000000000..dd287fc64562 --- /dev/null +++ b/graphics/object_events/palettes/neon_light.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +104 203 168 +19 48 64 +35 87 115 +58 132 140 +69 156 166 +77 193 254 +106 239 254 +27 68 89 +64 22 19 +115 39 34 +166 57 49 +191 66 57 +222 77 67 +0 0 0 +0 0 0 +0 0 0 diff --git a/graphics/object_events/pics/misc/light.png b/graphics/object_events/pics/misc/light.png index d1a0402d102cf52e47a584f2feb56230d5b7debf..22687a7c0067cff356a2cd6a1ebef4e6d1115a9d 100644 GIT binary patch literal 6205 zcmeHKc{o&U8y^W}9lK~5!;5IlVwi=oWF6TXOH!KU3=^}M8D=OUB}+vmskA7S%9b^y zMao{NUPOx)>1`n;D#dq3`}Mv5bY0)~Uvph&=FGkP?)&~d_w$_lr1^NcD#`20Lm&_( zvYV41_zROz0PvO=`5=Ikf0r4ev9{#)b<`!EFC~G2 z!>ysX_TkZ~*t!SmJ1=?*S7zO+;^$2$OgQc3WVA+;I2mh~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bh|K=R3;_B|lF#Dz3teC6 z`YZ-M%lV7CzR>kq41AXJ7j^yL=(75FH-{*|A3PnnS1WLQY!2@8+@m9S!6}U;6N&!Q z;xx=v&+9TP+E0!}me0DhO5gzLW zo>3OL*-qWRSr-?V?JS$xeIGN{&eXZPyT{-1x*H#lPvrCQ^%zTY)Yrx6sLjQ3GXW}! N6CBAt7?}Lse*nyl2|xe< literal 0 HcmV?d00001 diff --git a/graphics/object_events/pics/misc/poke_center_light.png b/graphics/object_events/pics/misc/poke_center_light.png new file mode 100644 index 0000000000000000000000000000000000000000..42d19f51c6eb9cc16d70ae9e9d4b06063494da62 GIT binary patch literal 5378 zcmeHKX;>5I77p75;{ujdp)?J&fSP5pC+rZGRD&sm)deS$2?Vp51QVzrDi&0%%cbIi zAZ~>Uil|isipZiUR>ggz3Tl;#lxjs>@O}xnJ=Z@z_x7K8o=IlD@0|CX^PYFkWR?h` zB1U7!V=)-aXkH{Y8vNQB4@(R1-E*T8ELb{b3KO)^unwnED(|{1U2H|WulG%;<#Kkxx&wokN*iA; z$jhQQ(-PaDOusMl+N^R1UKU>Xx9yI=X`nN*p%2w(iXj-W&66fa8eX5gfzH7@f%W`A$tD1#7lbraG_s) zUhX}*Rm|GjmHNk%U{~CuV^P@roDy!v?w~!#yL2Wz}-+-(k4 zqGJiSe%f>{ZQLohn*HV*@9qdZGXWJHp?C|nge-bCeq!uemjjxk$EPPco%Wn_cS46* z71?!k)aq?Z%&M?@tLcYjW&4yfufch-e^XGz_R-3w><**i+6 z+?Lq-U_!dqL>SEH%|3m)DK=-*PO_`pq`}J*#%!bRm$qM10XMa)7hM<3-FC)w=C>dPGBaq278*jbsc10^h~O$th-X4hza@X8*^GB zwi@d#J6`HAiY*k<%G1to-JUqP&}DOrOH6U|E>GT<(xpCMO=dgVkKFD=SjRpYM@b2u zbKXsJVvUAqwZSQsm@oq;IMI;jcI%9X`~7Nq>l%Y3Xh7PSWc@Nmz zj{~E*jl3Cq$1fME(hJySteHO^-g+w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{5066x`v% zl6t)^{Xn}QCQ1=8By0kkL8cLC6a*!}5S>b(h(sc>NW?;$8j^kxl0lc#lS}ye^S>cx;~15k23zGuKycd z*tc(Ur~>@K(}8z2p>E4V@Sf)-m?8{IJy~u~4)TcCaB>U6insF{2Ge>6UAc)tPWBov z{B|}}AHwe7hbotjUk+SGs3H?J7|cj}<6(wbU+e-Ft+hOUnDt#tJ9B5Z+PGbpz!Hzg z4Hnv5LT2Gc(t^Cld_Tr});*3U?QR=AC64^Kn6oGC!n#pos.x - 2; - s16 right = gSaveBlock1Ptr->pos.x + 17; - s16 top = gSaveBlock1Ptr->pos.y; - s16 bottom = gSaveBlock1Ptr->pos.y + 15; - s16 x = sprite->data[6]; - s16 y = sprite->data[7]; - u16 sheetTileStart; - u32 paletteNum; - bool8 finished = TRUE; - // Ripped from RemoveObjectEventIfOutsideView - if (x >= left && x <= right - && y >= top && y <= bottom) - finished = FALSE; - finished = finished ? finished : gTimeOfDay != TIME_OF_DAY_NIGHT; - if (finished) { - sheetTileStart = sprite->sheetTileStart; - paletteNum = sprite->oam.paletteNum; - DestroySprite(sprite); - FieldEffectFreeTilesIfUnused(sheetTileStart); - FieldEffectFreePaletteIfUnused(paletteNum); - Weather_SetBlendCoeffs(7, 12); // TODO: Restore original blend coeffs at dawn - return; - } + s16 left = gSaveBlock1Ptr->pos.x - 2; + s16 right = gSaveBlock1Ptr->pos.x + 17; + s16 top = gSaveBlock1Ptr->pos.y; + s16 bottom = gSaveBlock1Ptr->pos.y + 15; + s16 x = sprite->data[6]; + s16 y = sprite->data[7]; + u16 sheetTileStart; + u32 paletteNum; + // Ripped from RemoveObjectEventIfOutsideView + if (!(x >= left && x <= right && y >= top && y <= bottom)) { + sheetTileStart = sprite->sheetTileStart; + paletteNum = sprite->oam.paletteNum; + DestroySprite(sprite); + FieldEffectFreeTilesIfUnused(sheetTileStart); + FieldEffectFreePaletteIfUnused(paletteNum); + Weather_SetBlendCoeffs(7, 12); // TODO: Restore original blend coeffs at dawn + return; + } - if (gPlayerAvatar.tileTransitionState) { // As long as the second coefficient stays 12, shadows will not change - Weather_SetBlendCoeffs(7, 12); - sprite->invisible = FALSE; - } else { - Weather_SetBlendCoeffs(12, 12); - sprite->invisible = gSaveBlock2Ptr->playTimeVBlanks & 1; - } + if (gTimeOfDay != TIME_OF_DAY_NIGHT) { + sprite->invisible = TRUE; + return; + } + + switch (sprite->data[5]) { // lightType + case 0: + if (gPaletteFade.active) { // if palette fade is active, don't flicker since the timer won't be updated + Weather_SetBlendCoeffs(7, 12); + sprite->invisible = FALSE; + } else if (gPlayerAvatar.tileTransitionState) { + Weather_SetBlendCoeffs(7, 12); // As long as the second coefficient stays 12, shadows will not change + sprite->invisible = FALSE; + if (GetSpritePaletteTagByPaletteNum(sprite->oam.paletteNum) == OBJ_EVENT_PAL_TAG_LIGHT_2) + LoadSpritePaletteInSlot(&sObjectEventSpritePalettes[FindObjectEventPaletteIndexByTag(OBJ_EVENT_PAL_TAG_LIGHT)], sprite->oam.paletteNum); + } else if ((sprite->invisible = gTimeUpdateCounter & 1)) { + Weather_SetBlendCoeffs(12, 12); + if (GetSpritePaletteTagByPaletteNum(sprite->oam.paletteNum) == OBJ_EVENT_PAL_TAG_LIGHT) + LoadSpritePaletteInSlot(&sObjectEventSpritePalettes[FindObjectEventPaletteIndexByTag(OBJ_EVENT_PAL_TAG_LIGHT_2)], sprite->oam.paletteNum); + } + break; + case 1 ... 2: + Weather_SetBlendCoeffs(12, 12); + sprite->invisible = FALSE; + break; + } } -// Spawn a light at a map coordinate based on metatile behavior -static void SpawnLightSprite(s16 x, s16 y, s16 camX, s16 camY, u32 behavior) { - struct Sprite *sprite; - u8 i; - for (i = 0; i < MAX_SPRITES; i++) { - sprite = &gSprites[i]; - if (sprite->inUse && sprite->callback == UpdateLightSprite && sprite->data[6] == x && sprite->data[7] == y) - return; - } - sprite = &gSprites[CreateSprite(&gFieldEffectObjectTemplate_BallLight, 0, 0, 0)]; - UpdateSpritePaletteByTemplate(&gFieldEffectObjectTemplate_BallLight, sprite); - GetMapCoordsFromSpritePos(x + camX, y + camY, &sprite->x, &sprite->y); - sprite->data[6] = x; - sprite->data[7] = y; - sprite->affineAnims = gDummySpriteAffineAnimTable; - sprite->affineAnimBeginning = TRUE; - sprite->centerToCornerVecX = -(32 >> 1); - sprite->centerToCornerVecY = -(32 >> 1); - sprite->oam.priority = 1; - sprite->oam.objMode = 1; // BLEND - sprite->oam.affineMode = ST_OAM_AFFINE_NORMAL; - sprite->coordOffsetEnabled = TRUE; - sprite->x += 8; - sprite->y += 22 + sprite->centerToCornerVecY; +// Spawn a light at a map coordinate +static void SpawnLightSprite(s16 x, s16 y, s16 camX, s16 camY, u32 lightType) { + struct Sprite *sprite; + const struct SpriteTemplate *template; + u8 i; + for (i = 0; i < MAX_SPRITES; i++) { + sprite = &gSprites[i]; + if (sprite->inUse && sprite->callback == UpdateLightSprite && sprite->data[6] == x && sprite->data[7] == y) + return; + } + lightType = min(lightType, ARRAY_COUNT(gFieldEffectLightTemplates) - 1); // bounds checking + template = gFieldEffectLightTemplates[lightType]; + LoadSpriteSheetByTemplate(template, 0); + sprite = &gSprites[CreateSprite(template, 0, 0, 0)]; + if (lightType == 0 && (i = IndexOfSpritePaletteTag(template->paletteTag + 1)) < 16) + sprite->oam.paletteNum = i; + else + UpdateSpritePaletteByTemplate(template, sprite); + GetMapCoordsFromSpritePos(x + camX, y + camY, &sprite->x, &sprite->y); + sprite->data[5] = lightType; + sprite->data[6] = x; + sprite->data[7] = y; + sprite->affineAnims = gDummySpriteAffineAnimTable; + sprite->affineAnimBeginning = TRUE; + sprite->coordOffsetEnabled = TRUE; + switch (lightType) { + case 0: // Rustboro lanterns + sprite->centerToCornerVecX = -(32 >> 1); + sprite->centerToCornerVecY = -(32 >> 1); + sprite->oam.priority = 1; + sprite->oam.objMode = 1; // BLEND + sprite->oam.affineMode = ST_OAM_AFFINE_NORMAL; + sprite->x += 8; + sprite->y += 22 + sprite->centerToCornerVecY; + break; + case 1 ... 2: // Pokemon Center & mart + sprite->centerToCornerVecX = -(16 >> 1); + sprite->centerToCornerVecY = -(16 >> 1); + sprite->oam.priority = 2; + sprite->subpriority = 0xFF; + sprite->oam.objMode = 1; // BLEND + } } void TrySpawnLightSprites(s16 camX, s16 camY) { - s16 left = gSaveBlock1Ptr->pos.x - 2; - s16 right = gSaveBlock1Ptr->pos.x + 17; - s16 top = gSaveBlock1Ptr->pos.y; - s16 bottom = gSaveBlock1Ptr->pos.y + 16; - u8 i = 0; - s16 x, y; - u32 behavior; - if (gTimeOfDay != TIME_OF_DAY_NIGHT) - return; - for (i = 0; gLightMetatiles[i].x > 0; i++) { - x = gLightMetatiles[i].x; - y = gLightMetatiles[i].y; - if (x >= left && x <= right && y >= top && y <= bottom) { - behavior = MapGridGetMetatileBehaviorAt(x, y); - if (behavior == 0x04) // TODO: Use an actual constant for light metatiles - SpawnLightSprite(x, y, camX, camY, behavior); + u8 i; + u8 objectCount; + s16 left = gSaveBlock1Ptr->pos.x - 2; + s16 right = gSaveBlock1Ptr->pos.x + MAP_OFFSET_W + 2; + s16 top = gSaveBlock1Ptr->pos.y; + s16 bottom = gSaveBlock1Ptr->pos.y + MAP_OFFSET_H + 2; + if (gMapHeader.events == NULL) + return; + + if (InBattlePyramid()) + objectCount = GetNumBattlePyramidObjectEvents(); + else if (InTrainerHill()) + objectCount = 2; + else + objectCount = gMapHeader.events->objectEventCount; + + for (i = 0; i < objectCount; i++) { + struct ObjectEventTemplate *template = &gSaveBlock1Ptr->objectEventTemplates[i]; + s16 npcX = template->x + MAP_OFFSET; + s16 npcY = template->y + MAP_OFFSET; + if (top <= npcY && bottom >= npcY && left <= npcX && right >= npcX && !FlagGet(template->flagId)) + if (template->graphicsId == OBJ_EVENT_GFX_LIGHT_SPRITE) // event is light sprite instead + SpawnLightSprite(npcX, npcY, camX, camY, template->trainerRange_berryTreeId); } - } } void TrySpawnObjectEvents(s16 cameraX, s16 cameraY) @@ -2080,12 +2122,14 @@ void TrySpawnObjectEvents(s16 cameraX, s16 cameraY) s16 npcX = template->x + MAP_OFFSET; s16 npcY = template->y + MAP_OFFSET; - if (top <= npcY && bottom >= npcY && left <= npcX && right >= npcX - && !FlagGet(template->flagId)) - TrySpawnObjectEventTemplate(template, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, cameraX, cameraY); + if (top <= npcY && bottom >= npcY && left <= npcX && right >= npcX && !FlagGet(template->flagId)) { + if (template->graphicsId == OBJ_EVENT_GFX_LIGHT_SPRITE) { // light sprite instead + SpawnLightSprite(npcX, npcY, cameraX, cameraY, template->trainerRange_berryTreeId); + } else + TrySpawnObjectEventTemplate(template, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, cameraX, cameraY); + } } } - TrySpawnLightSprites(cameraX, cameraY); } void RemoveObjectEventsOutsideView(void) diff --git a/src/field_weather.c b/src/field_weather.c index 2c0fc5ca8cc7..fb07ec41f2ee 100644 --- a/src/field_weather.c +++ b/src/field_weather.c @@ -466,18 +466,21 @@ static void ApplyGammaShift(u8 startPalIndex, u8 numPalettes, s8 gammaIndex) if (gammaIndex > 0) { + // Create the palette mask + u32 palettes = PALETTES_ALL; + numPalettes += startPalIndex; + palettes = (palettes >> startPalIndex) << startPalIndex; + palettes = (palettes << (32-numPalettes)) >> (32-numPalettes); + numPalettes -= startPalIndex; gammaIndex--; palOffset = startPalIndex * 16; - CpuFastCopy(gPlttBufferUnfaded + palOffset, gPlttBufferFaded + palOffset, 32 * numPalettes); - numPalettes += startPalIndex; + UpdateAltBgPalettes(palettes & PALETTES_BG); // Thunder gamma-shift looks bad on night-blended palettes, so ignore time blending in some situations - if (!(gammaIndex > 3 && gWeatherPtr->currWeather == WEATHER_RAIN_THUNDERSTORM)) { - // Create the palette mask - u32 palettes = PALETTES_ALL; - palettes = (palettes >> startPalIndex) << startPalIndex; - palettes = (palettes << (32-numPalettes)) >> (32-numPalettes); + if (!(gammaIndex > 3 && gWeatherPtr->currWeather == WEATHER_RAIN_THUNDERSTORM) && MapHasNaturalLight(gMapHeader.mapType)) UpdatePalettesWithTime(palettes); - } + else + CpuFastCopy(gPlttBufferUnfaded + palOffset, gPlttBufferFaded + palOffset, 32 * numPalettes); + numPalettes += startPalIndex; curPalIndex = startPalIndex; // Loop through the speficied palette range and apply necessary gamma shifts to the colors. while (curPalIndex < numPalettes) @@ -546,6 +549,7 @@ static void ApplyGammaShift(u8 startPalIndex, u8 numPalettes, s8 gammaIndex) numPalettes += startPalIndex; palettes = (palettes >> startPalIndex) << startPalIndex; palettes = (palettes << (32-numPalettes)) >> (32-numPalettes); + UpdateAltBgPalettes(palettes & PALETTES_BG); UpdatePalettesWithTime(palettes); } else { // copy CpuFastCopy(gPlttBufferUnfaded + startPalIndex * 16, gPlttBufferFaded + startPalIndex * 16, numPalettes * 16 * sizeof(u16)); @@ -570,6 +574,7 @@ static void ApplyGammaShiftWithBlend(u8 startPalIndex, u8 numPalettes, s8 gammaI while (curPalIndex < numPalettes) { + UpdateAltBgPalettes((1 << (palOffset >> 4)) & PALETTES_BG); CpuFastCopy(gPlttBufferUnfaded + palOffset, gPlttBufferFaded + palOffset, 16 * sizeof(u16)); UpdatePalettesWithTime(1 << (palOffset >> 4)); // Apply TOD blend if (sPaletteGammaTypes[curPalIndex] == GAMMA_NONE) @@ -670,6 +675,7 @@ static void ApplyFogBlend(u8 blendCoeff, u16 blendColor) // TODO: Optimize this u16 curPalIndex; // First blend all palettes with time + UpdateAltBgPalettes(PALETTES_BG); CpuFastCopy(gPlttBufferUnfaded, gPlttBufferFaded, 0x400); UpdatePalettesWithTime(PALETTES_ALL); // Then blend tile palettes [0, 12] faded->faded @@ -816,6 +822,7 @@ void FadeScreen(u8 mode, s8 delay) gWeatherPtr->fadeScreenCounter = 0; // Triggers gamma-shift-based fade-in else { if (MapHasNaturalLight(gMapHeader.mapType)) { + UpdateAltBgPalettes(PALETTES_BG); BeginTimeOfDayPaletteFade(PALETTES_ALL, delay, 16, 0, (struct BlendSettings *)&gTimeOfDayBlend[currentTimeBlend.time0], (struct BlendSettings *)&gTimeOfDayBlend[currentTimeBlend.time1], @@ -883,11 +890,15 @@ void UpdateSpritePaletteWithWeather(u8 spritePaletteIndex, bool8 allowFog) } } -void ApplyWeatherGammaShiftToPal(u8 paletteIndex) +void ApplyWeatherGammaShiftToPal(u8 paletteIndex) // now unused / obselete { ApplyGammaShift(paletteIndex, 1, gWeatherPtr->gammaIndex); } +void ApplyWeatherGammaShiftToPals(u8 startPalIndex, u8 numPalettes) { + ApplyGammaShift(startPalIndex, numPalettes, gWeatherPtr->gammaIndex); +} + // Unused static bool8 IsFirstFrameOfWeatherFadeIn(void) { diff --git a/src/fieldmap.c b/src/fieldmap.c index 245562c93f16..7fb479ae268f 100644 --- a/src/fieldmap.c +++ b/src/fieldmap.c @@ -30,7 +30,6 @@ EWRAM_DATA struct MapHeader gMapHeader = {0}; EWRAM_DATA struct Camera gCamera = {0}; EWRAM_DATA static struct ConnectionFlags gMapConnectionFlags = {0}; EWRAM_DATA static u32 sFiller = 0; // without this, the next file won't align properly -EWRAM_DATA struct Coords16 gLightMetatiles[32] = {0}; struct BackupMapLayout gBackupMapLayout; @@ -63,7 +62,6 @@ static bool8 IsCoordInIncomingConnectingMap(int coord, int srcMax, int destMax, #define AreCoordsWithinMapGridBounds(x, y) (x >= 0 && x < gBackupMapLayout.width && y >= 0 && y < gBackupMapLayout.height) #define MapGridGetTileAt(x, y) (AreCoordsWithinMapGridBounds(x, y) ? gBackupMapLayout.map[x + gBackupMapLayout.width * y] : MapGridGetBorderTileAt(x, y)) -static void CacheLightMetatiles(void); struct MapHeader const *const GetMapHeaderFromConnection(struct MapConnection *connection) { @@ -75,7 +73,6 @@ void InitMap(void) InitMapLayoutData(&gMapHeader); SetOccupiedSecretBaseEntranceMetatiles(gMapHeader.events); RunOnLoadMapScript(); - CacheLightMetatiles(); } void InitMapFromSavedGame(void) @@ -85,7 +82,6 @@ void InitMapFromSavedGame(void) SetOccupiedSecretBaseEntranceMetatiles(gMapHeader.events); LoadSavedMapView(); RunOnLoadMapScript(); - CacheLightMetatiles(); UpdateTVScreensOnMap(gBackupMapLayout.width, gBackupMapLayout.height); } @@ -382,23 +378,6 @@ u32 MapGridGetMetatileBehaviorAt(int x, int y) return GetBehaviorByMetatileId(metatile) & METATILE_BEHAVIOR_MASK; } -// Caches light metatile coordinates -static void CacheLightMetatiles(void) { // TODO: Better way to dynamically generate lights - u8 i = 0; - s16 x, y; - for (x = 0; x < gBackupMapLayout.width; x++) { - for (y = 0; y < gBackupMapLayout.height; y++) { - if (MapGridGetMetatileBehaviorAt(x, y) == 0x04) { - gLightMetatiles[i].x = x; - gLightMetatiles[i].y = y; - i++; - } - } - } - gLightMetatiles[i].x = -1; - gLightMetatiles[i].y = -1; -} - u8 MapGridGetMetatileLayerTypeAt(int x, int y) { u16 metatile = MapGridGetMetatileIdAt(x, y); diff --git a/src/overworld.c b/src/overworld.c index b9b69acffd8c..332fa6d8c7dc 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -184,7 +184,6 @@ static u16 (*sPlayerKeyInterceptCallback)(u32); static bool8 sReceivingFromLink; static u8 sRfuKeepAliveTimer; -static u16 sTimeUpdateCounter; // playTimeVBlanks will eventually overflow, so this is used to update TOD // IWRAM common @@ -199,6 +198,7 @@ u8 gFieldLinkPlayerCount; u8 gTimeOfDay; struct TimeBlendSettings currentTimeBlend; +u16 gTimeUpdateCounter; // playTimeVBlanks will eventually overflow, so this is used to update TOD // EWRAM vars EWRAM_DATA static u8 sObjectEventLoadFlag = 0; @@ -822,8 +822,7 @@ void LoadMapFromCameraTransition(u8 mapGroup, u8 mapNum) CopySecondaryTilesetToVramUsingHeap(gMapHeader.mapLayout); LoadSecondaryTilesetPalette(gMapHeader.mapLayout); - for (paletteIndex = 6; paletteIndex < 13; paletteIndex++) // TODO: Optimize gamma shifts - ApplyWeatherGammaShiftToPal(paletteIndex); + ApplyWeatherGammaShiftToPals(6, 6); // palettes [6,12] InitSecondaryTilesetAnimation(); UpdateLocationHistoryForRoamer(); @@ -1481,29 +1480,34 @@ u8 UpdateTimeOfDay(void) { minutes = gLocalTime.minutes; if (hours >= 22 || hours < 4) { // night currentTimeBlend.weight = 256; + currentTimeBlend.altWeight = 0; return gTimeOfDay = currentTimeBlend.time0 = currentTimeBlend.time1 = TIME_OF_DAY_NIGHT; } else if (hours >= 4 && hours < 7) { // night->twilight currentTimeBlend.time0 = TIME_OF_DAY_NIGHT; currentTimeBlend.time1 = TIME_OF_DAY_TWILIGHT; currentTimeBlend.weight = 256 - 256 * ((hours - 4) * 60 + minutes) / ((7-4)*60); + currentTimeBlend.altWeight = (256 - currentTimeBlend.weight) / 2; return gTimeOfDay = TIME_OF_DAY_DAY; } else if (hours >= 7 && hours < 10) { // twilight->day currentTimeBlend.time0 = TIME_OF_DAY_TWILIGHT; currentTimeBlend.time1 = TIME_OF_DAY_DAY; currentTimeBlend.weight = 256 - 256 * ((hours - 7) * 60 + minutes) / ((10-7)*60); + currentTimeBlend.altWeight = (256 - currentTimeBlend.weight) / 2 + 128; return gTimeOfDay = TIME_OF_DAY_DAY; } else if (hours >= 10 && hours < 18) { // day - currentTimeBlend.weight = 256; + currentTimeBlend.weight = currentTimeBlend.altWeight = 256; return gTimeOfDay = currentTimeBlend.time0 = currentTimeBlend.time1 = TIME_OF_DAY_DAY; } else if (hours >= 18 && hours < 20) { // day->twilight currentTimeBlend.time0 = TIME_OF_DAY_DAY; currentTimeBlend.time1 = TIME_OF_DAY_TWILIGHT; currentTimeBlend.weight = 256 - 256 * ((hours - 18) * 60 + minutes) / ((20-18)*60); + currentTimeBlend.altWeight = currentTimeBlend.weight / 2 + 128; return gTimeOfDay = TIME_OF_DAY_TWILIGHT; } else if (hours >= 20 && hours < 22) { // twilight->night currentTimeBlend.time0 = TIME_OF_DAY_TWILIGHT; currentTimeBlend.time1 = TIME_OF_DAY_NIGHT; currentTimeBlend.weight = 256 - 256 * ((hours - 20) * 60 + minutes) / ((22-20)*60); + currentTimeBlend.altWeight = currentTimeBlend.weight / 2; return gTimeOfDay = TIME_OF_DAY_NIGHT; } else { // This should never occur currentTimeBlend.weight = 256; @@ -1516,16 +1520,41 @@ bool8 MapHasNaturalLight(u8 mapType) { // Whether a map type is naturally lit/ou || mapType == MAP_TYPE_OCEAN_ROUTE; } +// Update & mix day / night bg palettes (into unfaded) +void UpdateAltBgPalettes(u16 palettes) { + struct Tileset *primary = gMapHeader.mapLayout->primaryTileset; + struct Tileset *secondary = gMapHeader.mapLayout->secondaryTileset; + u32 i = 1; + if (!MapHasNaturalLight(gMapHeader.mapType)) + return; + palettes &= ~((1 << NUM_PALS_IN_PRIMARY) - 1) | primary->swapPalettes; + palettes &= ((1 << NUM_PALS_IN_PRIMARY) - 1) | (secondary->swapPalettes << NUM_PALS_IN_PRIMARY); + palettes &= 0x1FFE; // don't blend palette 0, [13,15] + palettes >>= 1; // start at palette 1 + if (!palettes) + return; + while (palettes) { + if (palettes & 1) { + if (i < NUM_PALS_IN_PRIMARY) + AvgPaletteWeighted(&((u16*)primary->palettes)[i*16], &((u16*)primary->palettes)[((i+9)%16)*16], gPlttBufferUnfaded + i * 16, currentTimeBlend.altWeight); + else + AvgPaletteWeighted(&((u16*)secondary->palettes)[i*16], &((u16*)secondary->palettes)[((i+9)%16)*16], gPlttBufferUnfaded + i * 16, currentTimeBlend.altWeight); + } + i++; + palettes >>= 1; + } +} + void UpdatePalettesWithTime(u32 palettes) { if (MapHasNaturalLight(gMapHeader.mapType)) { - u16 i; - u16 tempPaletteBuffer[16]; + u32 i; u32 mask = 1 << 16; - for (i = 0; i < 16; i++, mask <<= 1) { - if (GetSpritePaletteTagByPaletteNum(i) >> 15) // Don't blend special sprite palette tags - palettes &= ~(mask); - } - palettes &= 0xFFFF1FFF; // Don't blend tile palettes [13,15] + if (palettes >= 0x10000) + for (i = 0; i < 16; i++, mask <<= 1) + if (GetSpritePaletteTagByPaletteNum(i) >> 15) // Don't blend special sprite palette tags + palettes &= ~(mask); + + palettes &= 0xFFFF1FFF; // Don't blend UI BG palettes [13,15] if (!palettes) return; TimeMixPalettes(palettes, @@ -1565,18 +1594,20 @@ static void OverworldBasic(void) UpdateTilesetAnimations(); DoScheduledBgTilemapCopiesToVram(); // Every minute if no palette fade is active, update TOD blending as needed - if (!(gPaletteFade.active || (++sTimeUpdateCounter % 3600))) { + if (!(gPaletteFade.active || (++gTimeUpdateCounter % 3600))) { struct TimeBlendSettings cachedBlend = { .time0 = currentTimeBlend.time0, .time1 = currentTimeBlend.time1, .weight = currentTimeBlend.weight, }; - sTimeUpdateCounter = 0; + gTimeUpdateCounter = 0; UpdateTimeOfDay(); if (cachedBlend.time0 != currentTimeBlend.time0 || cachedBlend.time1 != currentTimeBlend.time1 - || cachedBlend.weight != currentTimeBlend.weight) - UpdatePalettesWithTime(PALETTES_ALL); + || cachedBlend.weight != currentTimeBlend.weight) { + UpdateAltBgPalettes(PALETTES_BG); + UpdatePalettesWithTime(PALETTES_ALL); + } } } diff --git a/src/palette.c b/src/palette.c index 9ea27d0f2549..2c9db82e2561 100644 --- a/src/palette.c +++ b/src/palette.c @@ -1211,6 +1211,31 @@ void TimeMixPalettes(u32 palettes, u16 *src, u16 *dst, struct BlendSettings *ble } while (palettes); } +// Apply weighted average to palettes, preserving high bits of dst throughout +void AvgPaletteWeighted(u16 *src0, u16 *src1, u16 *dst, u16 weight0) { + u16 *srcEnd = src0 + 16; + u16 weight1 = 256 - weight0; + src0++; + src1++; + dst++; // leave dst transparency unchanged + while (src0 != srcEnd) { + u32 src0Color = *src0++; + s32 r0 = (src0Color << 27) >> 27; + s32 g0 = (src0Color << 22) >> 27; + s32 b0 = (src0Color << 17) >> 27; + u32 src1Color = *src1++; + s32 r1 = (src1Color << 27) >> 27; + s32 g1 = (src1Color << 22) >> 27; + s32 b1 = (src1Color << 17) >> 27; + + // Average and bitwise-OR + r0 = (weight0*r0 + weight1*r1) >> 8; + g0 = (weight0*g0 + weight1*g1) >> 8; + b0 = (weight0*b0 + weight1*b1) >> 8; + *dst++ = (*dst & 0x8000) | RGB2(r0, g0, b0); // preserve high bit of dst + } +} + void BlendPalettesUnfaded(u32 selectedPalettes, u8 coeff, u16 color) { void *src = gPlttBufferUnfaded; diff --git a/src/trainer_see.c b/src/trainer_see.c index 3bf4e0c2fd32..0e478c94154e 100644 --- a/src/trainer_see.c +++ b/src/trainer_see.c @@ -287,7 +287,7 @@ static const union AnimCmd *const sSpriteAnimTable_Emotes[] = { // TODO: Move these declarations into even_object_movement.h #define OBJ_EVENT_PAL_TAG_MAY 0x1110 -#define OBJ_EVENT_PAL_TAG_EMOTES 0x8002 +#define OBJ_EVENT_PAL_TAG_EMOTES 0x8003 static const struct SpriteTemplate sSpriteTemplate_ExclamationQuestionMark = { From ea6c1a9e40afb2414c9d692b91e4047d8dc634cf Mon Sep 17 00:00:00 2001 From: Ariel A <24759293+aarant@users.noreply.github.com> Date: Sat, 16 Apr 2022 17:33:36 -0400 Subject: [PATCH 057/104] Optimized UpdateTimeOfDay. --- src/overworld.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/overworld.c b/src/overworld.c index 332fa6d8c7dc..9d929a24485f 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -1474,44 +1474,45 @@ const struct BlendSettings gTimeOfDayBlend[] = }; u8 UpdateTimeOfDay(void) { - s8 hours, minutes; + s32 hours, minutes; RtcCalcLocalTime(); hours = gLocalTime.hours; minutes = gLocalTime.minutes; - if (hours >= 22 || hours < 4) { // night + if (hours < 4) { // night currentTimeBlend.weight = 256; currentTimeBlend.altWeight = 0; return gTimeOfDay = currentTimeBlend.time0 = currentTimeBlend.time1 = TIME_OF_DAY_NIGHT; - } else if (hours >= 4 && hours < 7) { // night->twilight + } else if (hours < 7) { // night->twilight currentTimeBlend.time0 = TIME_OF_DAY_NIGHT; currentTimeBlend.time1 = TIME_OF_DAY_TWILIGHT; currentTimeBlend.weight = 256 - 256 * ((hours - 4) * 60 + minutes) / ((7-4)*60); currentTimeBlend.altWeight = (256 - currentTimeBlend.weight) / 2; return gTimeOfDay = TIME_OF_DAY_DAY; - } else if (hours >= 7 && hours < 10) { // twilight->day + } else if (hours < 10) { // twilight->day currentTimeBlend.time0 = TIME_OF_DAY_TWILIGHT; currentTimeBlend.time1 = TIME_OF_DAY_DAY; currentTimeBlend.weight = 256 - 256 * ((hours - 7) * 60 + minutes) / ((10-7)*60); currentTimeBlend.altWeight = (256 - currentTimeBlend.weight) / 2 + 128; return gTimeOfDay = TIME_OF_DAY_DAY; - } else if (hours >= 10 && hours < 18) { // day + } else if (hours < 18) { // day currentTimeBlend.weight = currentTimeBlend.altWeight = 256; return gTimeOfDay = currentTimeBlend.time0 = currentTimeBlend.time1 = TIME_OF_DAY_DAY; - } else if (hours >= 18 && hours < 20) { // day->twilight + } else if (hours < 20) { // day->twilight currentTimeBlend.time0 = TIME_OF_DAY_DAY; currentTimeBlend.time1 = TIME_OF_DAY_TWILIGHT; currentTimeBlend.weight = 256 - 256 * ((hours - 18) * 60 + minutes) / ((20-18)*60); currentTimeBlend.altWeight = currentTimeBlend.weight / 2 + 128; return gTimeOfDay = TIME_OF_DAY_TWILIGHT; - } else if (hours >= 20 && hours < 22) { // twilight->night + } else if (hours < 22) { // twilight->night currentTimeBlend.time0 = TIME_OF_DAY_TWILIGHT; currentTimeBlend.time1 = TIME_OF_DAY_NIGHT; currentTimeBlend.weight = 256 - 256 * ((hours - 20) * 60 + minutes) / ((22-20)*60); currentTimeBlend.altWeight = currentTimeBlend.weight / 2; return gTimeOfDay = TIME_OF_DAY_NIGHT; - } else { // This should never occur + } else { // 22-24, night currentTimeBlend.weight = 256; - return gTimeOfDay = currentTimeBlend.time0 = currentTimeBlend.time1 = TIME_OF_DAY_DAY; + currentTimeBlend.altWeight = 0; + return gTimeOfDay = currentTimeBlend.time0 = currentTimeBlend.time1 = TIME_OF_DAY_NIGHT; } } From bc2b50cd2ea4cce1835f924390072fc0740c343b Mon Sep 17 00:00:00 2001 From: Ariel A <24759293+aarant@users.noreply.github.com> Date: Sat, 16 Apr 2022 17:57:20 -0400 Subject: [PATCH 058/104] Added LoadPaletteFast function. --- gflib/sprite.c | 2 +- include/fieldmap.h | 2 +- include/palette.h | 1 + src/fieldmap.c | 24 +++++++++++++++--------- src/overworld.c | 2 +- src/palette.c | 7 +++++++ 6 files changed, 26 insertions(+), 12 deletions(-) diff --git a/gflib/sprite.c b/gflib/sprite.c index 7c2b759b235a..de7c4c307c99 100644 --- a/gflib/sprite.c +++ b/gflib/sprite.c @@ -1645,7 +1645,7 @@ u8 LoadSpritePaletteInSlot(const struct SpritePalette *palette, u8 paletteNum) { void DoLoadSpritePalette(const u16 *src, u16 paletteOffset) { - LoadPalette(src, paletteOffset + 0x100, 32); + LoadPaletteFast(src, paletteOffset + 0x100, 32); } u8 AllocSpritePalette(u16 tag) diff --git a/include/fieldmap.h b/include/fieldmap.h index 28da8da2a35d..9962c2cca7db 100644 --- a/include/fieldmap.h +++ b/include/fieldmap.h @@ -42,7 +42,7 @@ void InitTrainerHillMap(void); void InitBattlePyramidMap(bool8 setPlayerPosition); void CopyMapTilesetsToVram(struct MapLayout const *mapLayout); void LoadMapTilesetPalettes(struct MapLayout const *mapLayout); -void LoadSecondaryTilesetPalette(struct MapLayout const *mapLayout); +void LoadSecondaryTilesetPalette(struct MapLayout const *mapLayout, bool8 skipFaded); void CopySecondaryTilesetToVramUsingHeap(struct MapLayout const *mapLayout); void CopyPrimaryTilesetToVram(const struct MapLayout *); void CopySecondaryTilesetToVram(const struct MapLayout *); diff --git a/include/palette.h b/include/palette.h index c1b7dff5507d..d59ccbd902ec 100644 --- a/include/palette.h +++ b/include/palette.h @@ -66,6 +66,7 @@ extern u16 gPlttBufferFaded[PLTT_BUFFER_SIZE]; void LoadCompressedPalette(const u32 *, u16, u16); void LoadPalette(const void *, u16, u16); +void LoadPaletteFast(const void *src, u16 offset, u16 size); void FillPalette(u16, u16, u16); void TransferPlttBuffer(void); u8 UpdatePaletteFade(void); diff --git a/src/fieldmap.c b/src/fieldmap.c index 7fb479ae268f..bc494b59946a 100644 --- a/src/fieldmap.c +++ b/src/fieldmap.c @@ -870,9 +870,8 @@ static void FieldmapUnkDummy(void) } -void LoadTilesetPalette(struct Tileset const *tileset, u16 destOffset, u16 size) +void LoadTilesetPalette(struct Tileset const *tileset, u16 destOffset, u16 size, bool8 skipFaded) { - u16 black = RGB_BLACK; u32 low = 0; u32 high = 0; @@ -880,15 +879,22 @@ void LoadTilesetPalette(struct Tileset const *tileset, u16 destOffset, u16 size) { if (tileset->isSecondary == FALSE) { - LoadPalette(&black, destOffset, 2); - LoadPalette(((u16*)tileset->palettes) + 1, destOffset + 1, size - 2); + // LoadPalette(&black, destOffset, 2); + if (skipFaded) + CpuFastCopy(tileset->palettes, &gPlttBufferUnfaded[destOffset], size); + else + LoadPaletteFast(((u16*)tileset->palettes), destOffset, size); + gPlttBufferFaded[destOffset] = gPlttBufferUnfaded[destOffset] = RGB_BLACK; // why does it have to be black? FieldmapPaletteDummy(destOffset + 1, (size - 2) >> 1); low = 0; high = NUM_PALS_IN_PRIMARY; } else if (tileset->isSecondary == TRUE) { - LoadPalette(((u16*)tileset->palettes) + (NUM_PALS_IN_PRIMARY * 16), destOffset, size); + if (skipFaded) + CpuFastCopy(((u16*)tileset->palettes) + (NUM_PALS_IN_PRIMARY * 16), &gPlttBufferUnfaded[destOffset], size); + else + LoadPaletteFast(((u16*)tileset->palettes) + (NUM_PALS_IN_PRIMARY * 16), destOffset, size); low = NUM_PALS_IN_PRIMARY; high = NUM_PALS_TOTAL; } @@ -928,12 +934,12 @@ void CopySecondaryTilesetToVramUsingHeap(struct MapLayout const *mapLayout) static void LoadPrimaryTilesetPalette(struct MapLayout const *mapLayout) { - LoadTilesetPalette(mapLayout->primaryTileset, 0, NUM_PALS_IN_PRIMARY * 16 * 2); + LoadTilesetPalette(mapLayout->primaryTileset, 0, NUM_PALS_IN_PRIMARY * 16 * 2, FALSE); } -void LoadSecondaryTilesetPalette(struct MapLayout const *mapLayout) +void LoadSecondaryTilesetPalette(struct MapLayout const *mapLayout, bool8 skipFaded) { - LoadTilesetPalette(mapLayout->secondaryTileset, NUM_PALS_IN_PRIMARY * 16, (NUM_PALS_TOTAL - NUM_PALS_IN_PRIMARY) * 16 * 2); + LoadTilesetPalette(mapLayout->secondaryTileset, NUM_PALS_IN_PRIMARY * 16, (NUM_PALS_TOTAL - NUM_PALS_IN_PRIMARY) * 16 * 2, skipFaded); } void CopyMapTilesetsToVram(struct MapLayout const *mapLayout) @@ -950,6 +956,6 @@ void LoadMapTilesetPalettes(struct MapLayout const *mapLayout) if (mapLayout) { LoadPrimaryTilesetPalette(mapLayout); - LoadSecondaryTilesetPalette(mapLayout); + LoadSecondaryTilesetPalette(mapLayout, FALSE); } } diff --git a/src/overworld.c b/src/overworld.c index 9d929a24485f..c78a409c2c2b 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -820,7 +820,7 @@ void LoadMapFromCameraTransition(u8 mapGroup, u8 mapNum) RunOnTransitionMapScript(); InitMap(); CopySecondaryTilesetToVramUsingHeap(gMapHeader.mapLayout); - LoadSecondaryTilesetPalette(gMapHeader.mapLayout); + LoadSecondaryTilesetPalette(gMapHeader.mapLayout, TRUE); // skip copying to Faded, gamma shift will take care of it ApplyWeatherGammaShiftToPals(6, 6); // palettes [6,12] diff --git a/src/palette.c b/src/palette.c index 2c9db82e2561..6cb4f77df9bd 100644 --- a/src/palette.c +++ b/src/palette.c @@ -96,6 +96,13 @@ void LoadPalette(const void *src, u16 offset, u16 size) CpuCopy16(src, &gPlttBufferFaded[offset], size); } +// Drop in replacement for LoadPalette, uses CpuFastCopy, size must be 0 % 32 +void LoadPaletteFast(const void *src, u16 offset, u16 size) { + CpuFastCopy(src, &gPlttBufferUnfaded[offset], size); + // Copying from EWRAM->EWRAM is faster than ROM->EWRAM + CpuFastCopy(&gPlttBufferUnfaded[offset], &gPlttBufferFaded[offset], size); +} + void FillPalette(u16 value, u16 offset, u16 size) { CpuFill16(value, &gPlttBufferUnfaded[offset], size); From 2d376d83178e0f05761181146e413a18daa1ee68 Mon Sep 17 00:00:00 2001 From: Ariel A <24759293+aarant@users.noreply.github.com> Date: Mon, 18 Apr 2022 00:37:15 -0400 Subject: [PATCH 059/104] Removed shadows in puddles or sand piles. Optimized shadow tile loading. --- include/constants/field_effects.h | 6 ++++++ src/data/field_effects/field_effect_objects.h | 8 ++++---- src/event_object_movement.c | 2 +- src/field_effect_helpers.c | 7 +++++-- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/include/constants/field_effects.h b/include/constants/field_effects.h index 65ccc3ec7e16..0f00ac653385 100644 --- a/include/constants/field_effects.h +++ b/include/constants/field_effects.h @@ -128,4 +128,10 @@ #define FLDEFF_PAL_TAG_HOF_MONITOR 0x1010 #define FLDEFF_PAL_TAG_UNKNOWN 0x1011 +// tile tags, for field effects that may have many copies on screen at once +#define FLDEFF_TILE_TAG_SHADOW_SMALL 0x1300 +#define FLDEFF_TILE_TAG_SHADOW_MEDIUM 0x1301 +#define FLDEFF_TILE_TAG_SHADOW_LARGE 0x1302 +#define FLDEFF_TILE_TAG_SHADOW_EXTRA_LARGE 0x1303 + #endif // GUARD_FIELD_EFFECT_CONSTANTS_H diff --git a/src/data/field_effects/field_effect_objects.h b/src/data/field_effects/field_effect_objects.h index 219700cdd8da..a61bcb0364cf 100755 --- a/src/data/field_effects/field_effect_objects.h +++ b/src/data/field_effects/field_effect_objects.h @@ -69,7 +69,7 @@ const struct SpriteTemplate *const gFieldEffectLightTemplates[] = { }; const struct SpriteTemplate gFieldEffectObjectTemplate_ShadowSmall = { - .tileTag = TAG_NONE, + .tileTag = FLDEFF_TILE_TAG_SHADOW_SMALL, .paletteTag = TAG_WEATHER_START, .oam = &gObjectEventBaseOam_8x8, .anims = sAnimTable_Shadow, @@ -79,7 +79,7 @@ const struct SpriteTemplate gFieldEffectObjectTemplate_ShadowSmall = { }; const struct SpriteTemplate gFieldEffectObjectTemplate_ShadowMedium = { - .tileTag = TAG_NONE, + .tileTag = FLDEFF_TILE_TAG_SHADOW_MEDIUM, .paletteTag = TAG_WEATHER_START, .oam = &gObjectEventBaseOam_16x8, .anims = sAnimTable_Shadow, @@ -89,7 +89,7 @@ const struct SpriteTemplate gFieldEffectObjectTemplate_ShadowMedium = { }; const struct SpriteTemplate gFieldEffectObjectTemplate_ShadowLarge = { - .tileTag = TAG_NONE, + .tileTag = FLDEFF_TILE_TAG_SHADOW_LARGE, .paletteTag = TAG_WEATHER_START, .oam = &gObjectEventBaseOam_32x8, .anims = sAnimTable_Shadow, @@ -99,7 +99,7 @@ const struct SpriteTemplate gFieldEffectObjectTemplate_ShadowLarge = { }; const struct SpriteTemplate gFieldEffectObjectTemplate_ShadowExtraLarge = { - .tileTag = TAG_NONE, + .tileTag = FLDEFF_TILE_TAG_SHADOW_EXTRA_LARGE, .paletteTag = TAG_WEATHER_START, .oam = &gObjectEventBaseOam_64x32, .anims = sAnimTable_Shadow, diff --git a/src/event_object_movement.c b/src/event_object_movement.c index c3eb81622a58..fb9ca34d9bc6 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -8996,7 +8996,7 @@ static void DoFlaggedGroundEffects(struct ObjectEvent *objEvent, struct Sprite * for (i = 0; i < ARRAY_COUNT(sGroundEffectFuncs); i++, flags >>= 1) if (flags & 1) sGroundEffectFuncs[i](objEvent, sprite); - if (!(gWeatherPtr->noShadows || objEvent->inHotSprings)) + if (!(gWeatherPtr->noShadows || objEvent->inHotSprings || objEvent->inSandPile || MetatileBehavior_IsPuddle(objEvent->currentMetatileBehavior))) GroundEffect_Shadow(objEvent, sprite); } diff --git a/src/field_effect_helpers.c b/src/field_effect_helpers.c index 0418a1ef13d0..91efae9e1acb 100755 --- a/src/field_effect_helpers.c +++ b/src/field_effect_helpers.c @@ -314,8 +314,8 @@ u32 FldEff_Shadow(void) u8 objectEventId; const struct ObjectEventGraphicsInfo *graphicsInfo; u8 spriteId; - u8 i; - for (i = 0; i < MAX_SPRITES; i++) { + s32 i; + for (i = MAX_SPRITES - 1; i > -1; i--) { // Search backwards, because of CreateSpriteAtEnd // Return early if a shadow sprite already exists if (gSprites[i].data[0] == gFieldEffectArguments[0] && gSprites[i].callback == UpdateShadowFieldEffect) return 0; @@ -324,6 +324,7 @@ u32 FldEff_Shadow(void) graphicsInfo = GetObjectEventGraphicsInfo(gObjectEvents[objectEventId].graphicsId); if (graphicsInfo->shadowSize == SHADOW_SIZE_NONE) // don't create a shadow at all return 0; + LoadSpriteSheetByTemplate(gFieldEffectObjectTemplatePointers[sShadowEffectTemplateIds[graphicsInfo->shadowSize]], 0); spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[sShadowEffectTemplateIds[graphicsInfo->shadowSize]], 0, 0, 0x94); if (spriteId != MAX_SPRITES) { @@ -359,8 +360,10 @@ void UpdateShadowFieldEffect(struct Sprite *sprite) if (!objectEvent->active || objectEvent->noShadow || objectEvent->inHotSprings + || objectEvent->inSandPile || gWeatherPtr->noShadows || MetatileBehavior_IsPokeGrass(objectEvent->currentMetatileBehavior) + || MetatileBehavior_IsPuddle(objectEvent->currentMetatileBehavior) || MetatileBehavior_IsSurfableWaterOrUnderwater(objectEvent->currentMetatileBehavior) || MetatileBehavior_IsSurfableWaterOrUnderwater(objectEvent->previousMetatileBehavior)) { From f94a92fe1f7687115e7da8fe35cb6480f8f2f7f2 Mon Sep 17 00:00:00 2001 From: Ariel A <24759293+aarant@users.noreply.github.com> Date: Mon, 18 Apr 2022 23:17:41 -0400 Subject: [PATCH 060/104] Fixed shadow brightness during battle transition. --- include/field_weather.h | 1 + src/battle_transition.c | 47 ++++++++++++++++++++++++++++---------- src/field_weather_effect.c | 2 +- 3 files changed, 37 insertions(+), 13 deletions(-) diff --git a/include/field_weather.h b/include/field_weather.h index 091080f549b6..677155c95323 100644 --- a/include/field_weather.h +++ b/include/field_weather.h @@ -193,6 +193,7 @@ void Thunderstorm_Main(void); void Thunderstorm_InitAll(void); bool8 Thunderstorm_Finish(void); void FogHorizontal_InitVars(void); +u8 UpdateShadowColor(u16 color); void FogHorizontal_Main(void); void FogHorizontal_InitAll(void); bool8 FogHorizontal_Finish(void); diff --git a/src/battle_transition.c b/src/battle_transition.c index 1e421b5e470a..b940eb39f83b 100644 --- a/src/battle_transition.c +++ b/src/battle_transition.c @@ -1390,6 +1390,7 @@ static void InitPatternWeaveTransition(struct Task *task) sTransitionData->WIN0V = DISPLAY_HEIGHT; sTransitionData->BLDCNT = BLDCNT_TGT1_BG0 | BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_ALL; sTransitionData->BLDALPHA = BLDALPHA_BLEND(task->tBlendTarget2, task->tBlendTarget1); + UpdateShadowColor(0x3DEF); // force shadows to gray for (i = 0; i < DISPLAY_HEIGHT; i++) gScanlineEffectRegBuffers[1][i] = DISPLAY_WIDTH; @@ -2434,7 +2435,7 @@ static bool8 Mugshot_WaitStartPlayerSlide(struct Task *task) { sTransitionData->BG0HOFS_Lower -= 8; sTransitionData->BG0HOFS_Upper += 8; - + // Start player's slide in once the opponent is finished if (IsTrainerPicSlideDone(task->tOpponentSpriteId)) { @@ -2770,7 +2771,7 @@ static bool8 Slice_Main(struct Task *task) { u16 *storeLoc1 = &gScanlineEffectRegBuffers[0][i]; u16 *storeLoc2 = &gScanlineEffectRegBuffers[0][i + DISPLAY_HEIGHT]; - + // Alternate rows if (i % 2) { @@ -3251,7 +3252,7 @@ static bool8 RectangularSpiral_Main(struct Task *task) // The line moved to a new position, draw the tile. done = FALSE; position = sRectangularSpiralLines[j].position; - + // Invert position for the two lines that start at the bottom. if ((j % 2) == 1) position = 637 - position; @@ -3281,7 +3282,7 @@ static bool8 RectangularSpiral_End(struct Task *task) static bool16 UpdateRectangularSpiralLine(const s16 * const *moveDataTable, struct RectangularSpiralLine *line) { const s16 *moveData = moveDataTable[line->state]; - + // Has spiral finished? // Note that most move data arrays endsin SPIRAL_END but it is // only ever reached on the final array of spiraling outward. @@ -3294,9 +3295,9 @@ static bool16 UpdateRectangularSpiralLine(const s16 * const *moveDataTable, stru sDebug_RectangularSpiralData = moveData[2]; sDebug_RectangularSpiralData = moveData[3]; - // Note that for the two lines originating at the bottom the + // Note that for the two lines originating at the bottom the // position is inverted, so the directions are flipped. - // i.e. position += 1 is right for the top lines and left + // i.e. position += 1 is right for the top lines and left // for their inverted partners on the bottom. switch (moveData[0]) { @@ -3961,6 +3962,8 @@ static void VBlankCB_AngledWipes(void) #define tFadeFromGrayIncrement data[5] #define tDelayTimer data[6] #define tBlend data[7] +#define tBldCntSaved data[8] +#define tShadowColor data[9] static void CreateIntroTask(s16 fadeToGrayDelay, s16 fadeFromGrayDelay, s16 numFades, s16 fadeToGrayIncrement, s16 fadeFromGrayIncrement) { @@ -3988,17 +3991,29 @@ void Task_BattleTransition_Intro(u8 taskId) static bool8 TransitionIntro_FadeToGray(struct Task *task) { + u8 paletteNum = IndexOfSpritePaletteTag(TAG_WEATHER_START); + u16 index = (paletteNum+16)*16+9; // SHADOW_COLOR_INDEX if (task->tDelayTimer == 0 || --task->tDelayTimer == 0) { + task->tDelayTimer = task->tFadeToGrayDelay; task->tBlend += task->tFadeToGrayIncrement; if (task->tBlend > 16) task->tBlend = 16; + if (paletteNum < 16) + task->tShadowColor = gPlttBufferFaded[index]; BlendPalettes(PALETTES_ALL, task->tBlend, RGB(11, 11, 11)); + if (paletteNum < 16) + gPlttBufferFaded[index] = task->tShadowColor; } if (task->tBlend >= 16) { // Fade to gray complete, start fade back + // Save BLDCNT and turn off targets temporarily + task->tBldCntSaved = GetGpuReg(REG_OFFSET_BLDCNT); + SetGpuReg(REG_OFFSET_BLDCNT, task->tBldCntSaved & ~BLDCNT_TGT2_BG_ALL); + if (paletteNum < 16) + gPlttBufferFaded[index] = RGB(11, 11, 11); task->tState++; task->tDelayTimer = task->tFadeFromGrayDelay; } @@ -4009,11 +4024,18 @@ static bool8 TransitionIntro_FadeFromGray(struct Task *task) { if (task->tDelayTimer == 0 || --task->tDelayTimer == 0) { + u8 paletteNum = IndexOfSpritePaletteTag(TAG_WEATHER_START); task->tDelayTimer = task->tFadeFromGrayDelay; task->tBlend -= task->tFadeFromGrayIncrement; if (task->tBlend < 0) task->tBlend = 0; BlendPalettes(PALETTES_ALL, task->tBlend, RGB(11, 11, 11)); + // Restore BLDCNT + SetGpuReg(REG_OFFSET_BLDCNT, task->tBldCntSaved); + if (paletteNum < 16) { + u16 index = (paletteNum+16)*16+9; // SHADOW_COLOR_INDEX + gPlttBufferFaded[index] = task->tShadowColor; + } } if (task->tBlend == 0) { @@ -4170,13 +4192,13 @@ static void InitBlackWipe(s16 *data, s16 startX, s16 startY, s16 endX, s16 endY, static bool8 UpdateBlackWipe(s16 *data, bool8 xExact, bool8 yExact) { u8 numFinished; - + if (tWipeXDist > tWipeYDist) { // X has further to move, move it first tWipeCurrX += tWipeXMove; - // If it has been far enough since Y's + // If it has been far enough since Y's // last move then move it too tWipeTemp += tWipeYDist; if (tWipeTemp > tWipeXDist) @@ -4190,7 +4212,7 @@ static bool8 UpdateBlackWipe(s16 *data, bool8 xExact, bool8 yExact) // Y has further to move, move it first tWipeCurrY += tWipeYMove; - // If it has been far enough since X's + // If it has been far enough since X's // last move then move it too tWipeTemp += tWipeXDist; if (tWipeTemp > tWipeYDist) @@ -4201,9 +4223,9 @@ static bool8 UpdateBlackWipe(s16 *data, bool8 xExact, bool8 yExact) } numFinished = 0; - + // Has X coord reached end? - if ((tWipeXMove > 0 && tWipeCurrX >= tWipeEndX) + if ((tWipeXMove > 0 && tWipeCurrX >= tWipeEndX) || (tWipeXMove < 0 && tWipeCurrX <= tWipeEndX)) { numFinished++; @@ -4212,7 +4234,7 @@ static bool8 UpdateBlackWipe(s16 *data, bool8 xExact, bool8 yExact) } // Has Y coord reached end? - if ((tWipeYMove > 0 && tWipeCurrY >= tWipeEndY) + if ((tWipeYMove > 0 && tWipeCurrY >= tWipeEndY) || (tWipeYMove < 0 && tWipeCurrY <= tWipeEndY)) { numFinished++; @@ -4306,6 +4328,7 @@ static bool8 FrontierLogoWave_Init(struct Task *task) LZ77UnCompVram(sFrontierLogo_Tileset, tileset); LoadPalette(sFrontierLogo_Palette, 0xF0, sizeof(sFrontierLogo_Palette)); sTransitionData->cameraY = 0; + UpdateShadowColor(0x3DEF); // force shadows to gray task->tState++; return FALSE; diff --git a/src/field_weather_effect.c b/src/field_weather_effect.c index eafb6823979e..5889dd79fbda 100644 --- a/src/field_weather_effect.c +++ b/src/field_weather_effect.c @@ -1377,7 +1377,7 @@ static void DestroyFogHorizontalSprites(void); #define SHADOW_COLOR_INDEX 9 // Updates just the color of shadows to match special weather blending -static u8 UpdateShadowColor(u16 color) { +u8 UpdateShadowColor(u16 color) { u8 paletteNum = IndexOfSpritePaletteTag(TAG_WEATHER_START); u16 tempBuffer[16]; u16 blendedColor; From b46a8b16cabff0d0f44e026879b31592100147fc Mon Sep 17 00:00:00 2001 From: Ariel A <24759293+aarant@users.noreply.github.com> Date: Tue, 3 May 2022 23:14:00 -0400 Subject: [PATCH 061/104] Added time-of-day related follower messages. --- emotions.txt | 5 ----- follower_emotions.py | 2 +- src/event_object_movement.c | 7 +++---- src/follower_helper.c | 23 ++++++++++++++++++++++- 4 files changed, 26 insertions(+), 11 deletions(-) diff --git a/emotions.txt b/emotions.txt index 590be935302c..39857a7cda77 100644 --- a/emotions.txt +++ b/emotions.txt @@ -81,9 +81,7 @@ Your pokemon turned to face the other way, showing a defiant expression. Music (Special): Map feature: {STR_VAR_1} is pulling out the grass. -{STR_VAR_1} is happy to see what's out doors! {STR_VAR_1} is listening intently to the sound of the waves. -Your pokemon is staring spellbound at the night sky! Your pokemon seems to be enjoying sliding around! {STR_VAR_1} is steadily observing the flow of the river. {STR_VAR_1} is noticing the scent of the grass. @@ -95,7 +93,6 @@ Misc: {STR_VAR_1} is playing around in the fallen leaves. {STR_VAR_1} is playing around with a leaf. {STR_VAR_1} is playing around, touching the leaves. -Your pokemon is happily gazing at the beautiful, starry sky! {STR_VAR_1} is rolling around in the grass. {STR_VAR_1} seems to want to return to the lab (after you receive the Mystery egg). Your pokemon is staring at the various items. @@ -106,10 +103,8 @@ Your pokemon is staring at the various items. {STR_VAR_1} swayed around, dancing in a strange manner.(Seems to occur more for Bellsprout)(sprout tower). {STR_VAR_1} swayed and danced around as it pleased (Seems to occur more for Bellsprout)(sprout tower). Your Pokemon is playing around and splashing in the water! (Water's edge). -{STR_VAR_1} is looking up at the sky. {STR_VAR_1} is poking at garbage (Goldenrods underground path). Your pokemon is rolling a screw from a bicycle around. -{STR_VAR_1} is looking up at the sky. {STR_VAR_1} is clawing the grass! {STR_VAR_1} is looking around restlessly at the Forest. {STR_VAR_1} is playfully nibbling at the ground. diff --git a/follower_emotions.py b/follower_emotions.py index 522634803102..ff04b048a029 100644 --- a/follower_emotions.py +++ b/follower_emotions.py @@ -47,4 +47,4 @@ def export_messages(infile, outfile, n=None, indent=0, start=0): if __name__ == '__main__': - export_messages('emotions.txt', 'emotions.h', n=1, start=7) + export_messages('emotions.txt', 'emotions.h', n=4, start=42) diff --git a/src/event_object_movement.c b/src/event_object_movement.c index 0750e20e5159..b48835117fe0 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -1944,9 +1944,6 @@ bool8 ScrFunc_getfolloweraction(struct ScriptContext *ctx) // Essentially a big emotion_weight[FOLLOWER_EMOTION_LOVE] = 30; } // Conditional messages follow - // Weather-related - if (GetCurrentWeather() == WEATHER_SUNNY_CLOUDS) - cond_emotes[n_choices++] = (struct SpecialEmote) {.emotion=FOLLOWER_EMOTION_HAPPY, .index=31}; // Health & status-related multi = mon->hp * 100 / mon->maxHP; if (multi < 20) { @@ -2027,7 +2024,7 @@ bool8 ScrFunc_getfolloweraction(struct ScriptContext *ctx) // Essentially a big } // Match scripted conditional messages // With 50% chance, try to match scripted conditional messages - for (i = (Random() & 1) ? 28 : 0, j = 1; i < 28; i++) { + for (i = (Random() & 1) ? 30 : 0, j = 1; i < 30; i++) { const struct FollowerMsgInfoExtended *info = &gFollowerConditionalMessages[i]; if (info->stFlags == 1 && species != info->st.species) continue; @@ -2045,6 +2042,8 @@ bool8 ScrFunc_getfolloweraction(struct ScriptContext *ctx) // Essentially a big continue; if (info->wtFlags == 2 && GetCurrentMapMusic() != info->wt.song) continue; + if (info->wtFlags == 3 && (!MapHasNaturalLight(gMapHeader.mapType) || gTimeOfDay != info->wt.timeOfDay || GetCurrentWeather() >= WEATHER_RAIN)) + continue; if (info->nearFlags == 1) { if ((multi2 = FindMetatileBehaviorWithinRange(objEvent->currentCoords.x, objEvent->currentCoords.y, info->near.mb.behavior, info->near.mb.distance))) gSpecialVar_Result = multi2; diff --git a/src/follower_helper.c b/src/follower_helper.c index b477f1d1e931..9b0350e0c8d7 100644 --- a/src/follower_helper.c +++ b/src/follower_helper.c @@ -2,6 +2,7 @@ #include "data.h" #include "event_scripts.h" #include "follower_helper.h" +#include "overworld.h" #include "constants/battle.h" #include "constants/metatile_behaviors.h" #include "constants/pokemon.h" @@ -65,9 +66,15 @@ static const u8 sCondMsg40[] = _("{STR_VAR_1} is gnawing at the ice."); static const u8 sCondMsg41[] = _("{STR_VAR_1} is touching the ice."); static const u8* const sIceTexts[] = {sCondMsg26, sCondMsg40, sCondMsg41, NULL}; static const u8 sCondMsg42[] = _("{STR_VAR_1}'s burn looks painful!"); +static const u8 sCondMsg43[] = _("{STR_VAR_1} is happy to see what's\noutdoors!"); +static const u8 sCondMsg44[] = _("{STR_VAR_1} is looking up at the\nsky."); +static const u8* const sDayTexts[] = {sCondMsg43, sCondMsg44, NULL}; +static const u8 sCondMsg45[] = _("Your POKéMON is staring spellbound\nat the night sky!"); +static const u8 sCondMsg46[] = _("Your POKéMON is happily gazing at\nthe beautiful, starry sky!"); +static const u8* const sNightTexts[] = {sCondMsg45, sCondMsg46, NULL}; // Note that the size of this array must also be correct in event_object_movement -const struct FollowerMsgInfoExtended gFollowerConditionalMessages[28] = { +const struct FollowerMsgInfoExtended gFollowerConditionalMessages[30] = { { .text = (u8*)sCelebiTexts, .textSpread = 1, @@ -266,4 +273,18 @@ const struct FollowerMsgInfoExtended gFollowerConditionalMessages[28] = { .stFlags 3, // STATUS .emotion = FOLLOWER_EMOTION_SAD, }, + { + .text = (u8*)sDayTexts, + .textSpread = 1, + .wt = {.timeOfDay = TIME_OF_DAY_DAY}, + .wtFlags = 3, // time + .emotion = FOLLOWER_EMOTION_MUSIC, + }, + { + .text = (u8*)sNightTexts, + .textSpread = 1, + .wt = {.timeOfDay = TIME_OF_DAY_NIGHT}, + .wtFlags = 3, // time + .emotion = FOLLOWER_EMOTION_MUSIC, + }, }; From c82510e22bffb98fd9c63dc246c332dd1da602cd Mon Sep 17 00:00:00 2001 From: Ariel A <24759293+aarant@users.noreply.github.com> Date: Tue, 3 May 2022 23:46:07 -0400 Subject: [PATCH 062/104] Gamma shift now ignores special sprite palette tags (lights, emotes). --- src/field_weather.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/field_weather.c b/src/field_weather.c index 7a45e4ebc663..721660addeed 100644 --- a/src/field_weather.c +++ b/src/field_weather.c @@ -494,7 +494,10 @@ static void ApplyGammaShift(u8 startPalIndex, u8 numPalettes, s8 gammaIndex) { u8 r, g, b; - if (sPaletteGammaTypes[curPalIndex] == GAMMA_ALT || curPalIndex - 16 == gWeatherPtr->altGammaSpritePalIndex) + // don't blend special sprite palette tags + if (sPaletteGammaTypes[curPalIndex] == GAMMA_ALT || + (curPalIndex >= 16 && (curPalIndex - 16 == gWeatherPtr->altGammaSpritePalIndex || + GetSpritePaletteTagByPaletteNum(curPalIndex - 16) >> 15))) gammaTable = gWeatherPtr->altGammaShifts[gammaIndex]; else gammaTable = gWeatherPtr->gammaShifts[gammaIndex]; From b5cf90a931e8ba282d6311a56df3480f54cac683 Mon Sep 17 00:00:00 2001 From: Ariel A <24759293+aarant@users.noreply.github.com> Date: Sun, 8 May 2022 00:14:15 -0400 Subject: [PATCH 063/104] Fixed shadow brightness during orb effect. --- src/field_screen_effect.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/field_screen_effect.c b/src/field_screen_effect.c index 676bebf0df5b..c5714cbf5626 100644 --- a/src/field_screen_effect.c +++ b/src/field_screen_effect.c @@ -1144,6 +1144,7 @@ static void Task_OrbEffect(u8 taskId) ClearGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_WIN1_ON); SetGpuRegBits(REG_OFFSET_BLDCNT, gOrbEffectBackgroundLayerFlags[0]); SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(12, 7)); + UpdateShadowColor(0x2109); // force shadows to gray SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG_ALL | WININ_WIN0_OBJ | WININ_WIN0_CLR); SetGpuReg(REG_OFFSET_WINOUT, WINOUT_WIN01_BG1 | WINOUT_WIN01_BG2 | WINOUT_WIN01_BG3 | WINOUT_WIN01_OBJ); SetBgTilemapPalette(0, 0, 0, 0x1E, 0x14, 0xF); @@ -1208,6 +1209,7 @@ static void Task_OrbEffect(u8 taskId) SetGpuReg(REG_OFFSET_DISPCNT, tDispCnt); SetGpuReg(REG_OFFSET_BLDCNT, tBldCnt); SetGpuReg(REG_OFFSET_BLDALPHA, tBldAlpha); + UpdateShadowColor(RGB_BLACK); // force shadows to gray SetGpuReg(REG_OFFSET_WININ, tWinIn); SetGpuReg(REG_OFFSET_WINOUT, tWinOut); EnableBothScriptContexts(); From d731485a1f0e06fc3e57d048dd75ec43ccef213d Mon Sep 17 00:00:00 2001 From: Ariel A <24759293+aarant@users.noreply.github.com> Date: Sun, 29 May 2022 01:16:19 -0400 Subject: [PATCH 064/104] Fixed shadows appearing above freshly spawned object events. Removed shadows from cuttable trees. --- src/data/object_events/object_event_graphics_info.h | 2 +- src/field_effect_helpers.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/data/object_events/object_event_graphics_info.h b/src/data/object_events/object_event_graphics_info.h index 16677f9bba96..71d98268bbc7 100755 --- a/src/data/object_events/object_event_graphics_info.h +++ b/src/data/object_events/object_event_graphics_info.h @@ -80,7 +80,7 @@ const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedSquirtleDoll const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedWooperDoll = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 4, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_UnusedWooperDoll, gDummySpriteAffineAnimTable}; const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedPikachuDoll = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 3, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_UnusedPikachuDoll, gDummySpriteAffineAnimTable}; const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedPorygon2Doll = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_UnusedPorygon2Doll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_CuttableTree = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 4, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_CuttableTree, sPicTable_CuttableTree, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_CuttableTree = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 4, SHADOW_SIZE_NONE, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_CuttableTree, sPicTable_CuttableTree, gDummySpriteAffineAnimTable}; const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MartEmployee = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_MartEmployee, gDummySpriteAffineAnimTable}; const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RooftopSaleWoman = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_RooftopSaleWoman, gDummySpriteAffineAnimTable}; const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Teala = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Teala, gDummySpriteAffineAnimTable}; diff --git a/src/field_effect_helpers.c b/src/field_effect_helpers.c index 5fe15936eefd..f3d434b115a6 100755 --- a/src/field_effect_helpers.c +++ b/src/field_effect_helpers.c @@ -325,7 +325,7 @@ u32 FldEff_Shadow(void) if (graphicsInfo->shadowSize == SHADOW_SIZE_NONE) // don't create a shadow at all return 0; LoadSpriteSheetByTemplate(gFieldEffectObjectTemplatePointers[sShadowEffectTemplateIds[graphicsInfo->shadowSize]], 0); - spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[sShadowEffectTemplateIds[graphicsInfo->shadowSize]], 0, 0, 0x94); + spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[sShadowEffectTemplateIds[graphicsInfo->shadowSize]], 0, 0, 0x94 + 1); // higher = farther back; shadows should be behind object events if (spriteId != MAX_SPRITES) { // SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(8, 12)); From 9fe3a50f2a03fb4781039fbe7947f3bdba65eb25 Mon Sep 17 00:00:00 2001 From: Ariel A <24759293+aarant@users.noreply.github.com> Date: Sat, 4 Jun 2022 17:50:29 -0400 Subject: [PATCH 065/104] Optimized time of day update. --- src/overworld.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/overworld.c b/src/overworld.c index c78a409c2c2b..5177fab193ec 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -1595,7 +1595,7 @@ static void OverworldBasic(void) UpdateTilesetAnimations(); DoScheduledBgTilemapCopiesToVram(); // Every minute if no palette fade is active, update TOD blending as needed - if (!(gPaletteFade.active || (++gTimeUpdateCounter % 3600))) { + if (!(gPaletteFade.active || (++gTimeUpdateCounter >= 3600))) { struct TimeBlendSettings cachedBlend = { .time0 = currentTimeBlend.time0, .time1 = currentTimeBlend.time1, From 7fca787f1dfdf1c00e8a039d06e25c06b9b75a2d Mon Sep 17 00:00:00 2001 From: Ariel A <24759293+aarant@users.noreply.github.com> Date: Tue, 28 Jun 2022 18:57:27 -0400 Subject: [PATCH 066/104] Fixed time of day optimization. --- src/overworld.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/overworld.c b/src/overworld.c index 5177fab193ec..8cfeab4b63bc 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -1595,7 +1595,7 @@ static void OverworldBasic(void) UpdateTilesetAnimations(); DoScheduledBgTilemapCopiesToVram(); // Every minute if no palette fade is active, update TOD blending as needed - if (!(gPaletteFade.active || (++gTimeUpdateCounter >= 3600))) { + if (!gPaletteFade.active && ++gTimeUpdateCounter >= 3600) { struct TimeBlendSettings cachedBlend = { .time0 = currentTimeBlend.time0, .time1 = currentTimeBlend.time1, From 8e436e3add955164fd1a739332986e21bfd1227d Mon Sep 17 00:00:00 2001 From: Ariel A <24759293+aarant@users.noreply.github.com> Date: Mon, 4 Jul 2022 03:56:02 -0400 Subject: [PATCH 067/104] Fixed fadescreen interaction with weather on outdoor maps. --- asm/macros/event.inc | 12 +++++++----- data/event_scripts.s | 6 ++++-- data/maps/MtChimney/scripts.inc | 4 ++-- data/maps/MtPyre_Summit/scripts.inc | 5 ++--- src/field_weather.c | 6 ++++-- src/scrcmd.c | 9 +++++++++ 6 files changed, 28 insertions(+), 14 deletions(-) diff --git a/asm/macros/event.inc b/asm/macros/event.inc index 643d78561862..046fa176583c 100644 --- a/asm/macros/event.inc +++ b/asm/macros/event.inc @@ -276,7 +276,7 @@ .2byte SPECIAL_\function .endm - @ Blocks script execution until a command or C code manually unblocks it. Generally used with specific + @ Blocks script execution until a command or C code manually unblocks it. Generally used with specific @ commands and specials. Calling EnableBothScriptContexts for instance will allow execution to continue. .macro waitstate .byte 0x27 @@ -998,7 +998,7 @@ .endm @ Gives the player an Egg of the specified species. - @ VAR_RESULT will be set to MON_GIVEN_TO_PARTY, MON_GIVEN_TO_PC, or MON_CANT_GIVE depending on the outcome. + @ VAR_RESULT will be set to MON_GIVEN_TO_PARTY, MON_GIVEN_TO_PC, or MON_CANT_GIVE depending on the outcome. .macro giveegg species:req .byte 0x7a .2byte \species @@ -1416,7 +1416,7 @@ .2byte \out .endm - @ Gives 'count' coins to the player, up to a total of MAX_COINS. + @ Gives 'count' coins to the player, up to a total of MAX_COINS. @ If the player already has MAX_COINS then VAR_RESULT is set to TRUE, otherwise it is set to FALSE. .macro addcoins count:req .byte 0xb4 @@ -1677,9 +1677,11 @@ @ Equivalent to fadescreen but copies gPlttBufferUnfaded to gPaletteDecompressionBuffer on the fade out @ and the reverse on the fade in, in effect saving gPlttBufferUnfaded to restore it. - .macro fadescreenswapbuffers mode:req + @ If nowait set, does not wait for the fade to complete + .macro fadescreenswapbuffers mode:req, nowait=0 .byte 0xdc .byte \mode + .byte \nowait .endm @ Buffers the specified trainer's class name to the given string var. @@ -1893,7 +1895,7 @@ @ Gives 'amount' of the specified 'item' to the player and prints a message with fanfare. @ If the player doesn't have space for all the items then as many are added as possible, the - @ message indicates there is no room, and VAR_RESULT is set to FALSE. + @ message indicates there is no room, and VAR_RESULT is set to FALSE. @ Otherwise VAR_RESULT is set to TRUE, and the message indicates they have received the item(s). .macro giveitem item:req, amount=1 setorcopyvar VAR_0x8000, \item diff --git a/data/event_scripts.s b/data/event_scripts.s index 4318ca2eb031..19e18768471a 100644 --- a/data/event_scripts.s +++ b/data/event_scripts.s @@ -716,12 +716,14 @@ Common_EventScript_PlayGymBadgeFanfare:: return Common_EventScript_OutOfCenterPartyHeal:: - fadescreen FADE_TO_BLACK + fadescreenswapbuffers FADE_TO_BLACK playfanfare MUS_HEAL waitfanfare special HealPlayerParty + @ start fade then immediately load following pokemon, and wait for fade + fadescreenswapbuffers FADE_FROM_BLACK, 1 callnative UpdateFollowingPokemon - fadescreen FADE_FROM_BLACK + callfunc ScrFunc_WaitPaletteNotActive return EventScript_RegionMap:: diff --git a/data/maps/MtChimney/scripts.inc b/data/maps/MtChimney/scripts.inc index 1931633258c0..6e8df888279b 100644 --- a/data/maps/MtChimney/scripts.inc +++ b/data/maps/MtChimney/scripts.inc @@ -54,13 +54,13 @@ MtChimney_EventScript_Maxie:: msgbox MtChimney_Text_MaxieYouHaventSeenLastOfMagma, MSGBOX_DEFAULT closemessage delay 30 - fadescreen FADE_TO_BLACK + fadescreenswapbuffers FADE_TO_BLACK removeobject LOCALID_MAXIE removeobject LOCALID_MAGMA_GRUNT_1 removeobject LOCALID_TABITHA removeobject LOCALID_MAGMA_GRUNT_2 setflag FLAG_HIDE_MT_CHIMNEY_TEAM_MAGMA - fadescreen FADE_FROM_BLACK + fadescreenswapbuffers FADE_FROM_BLACK setobjectxyperm LOCALID_ARCHIE, 10, 12 addobject LOCALID_ARCHIE call_if_eq VAR_FACING, DIR_EAST, MtChimney_EventScript_ArchieApproachPlayerEast diff --git a/data/maps/MtPyre_Summit/scripts.inc b/data/maps/MtPyre_Summit/scripts.inc index 3de60df3f2fb..5a6d23797a9a 100644 --- a/data/maps/MtPyre_Summit/scripts.inc +++ b/data/maps/MtPyre_Summit/scripts.inc @@ -49,7 +49,7 @@ MtPyre_Summit_EventScript_TeamAquaExits:: call_if_eq VAR_0x8008, 2, MtPyre_Summit_EventScript_ArchieFacePlayer2 msgbox MtPyre_Summit_Text_ArchieWeGotTheOrbLetsGo, MSGBOX_DEFAULT closemessage - fadescreen FADE_TO_BLACK + fadescreenswapbuffers FADE_TO_BLACK removeobject LOCALID_ARCHIE removeobject LOCALID_GRUNT_1 removeobject LOCALID_GRUNT_2 @@ -58,7 +58,7 @@ MtPyre_Summit_EventScript_TeamAquaExits:: setflag FLAG_HIDE_MT_PYRE_SUMMIT_ARCHIE setflag FLAG_HIDE_MT_PYRE_SUMMIT_TEAM_AQUA fadedefaultbgm - fadescreen FADE_FROM_BLACK + fadescreenswapbuffers FADE_FROM_BLACK delay 20 setvar VAR_MT_PYRE_STATE, 1 call_if_eq VAR_0x8008, 0, MtPyre_Summit_EventScript_OldLadyApproachPlayer0 @@ -622,4 +622,3 @@ MtPyre_Summit_Text_HoennTrioTale: .string "becalmed the two enraged POKéMON.\p" .string "Then, its duty done, the green POKéMON\n" .string "flew off into the wild blue yonder…$" - diff --git a/src/field_weather.c b/src/field_weather.c index 721660addeed..2d1f2a809624 100644 --- a/src/field_weather.c +++ b/src/field_weather.c @@ -811,8 +811,10 @@ void FadeScreen(u8 mode, s8 delay) if (fadeOut) { - if (TRUE || useWeatherPal) // TODO: Can copying Faded to Unfaded before fadeout cause problems ? - CpuFastCopy(gPlttBufferFaded, gPlttBufferUnfaded, PLTT_BUFFER_SIZE * 2); + // Note: Copying faded -> unfaded like this works fine, except if the screen is faded back in + // without transitioning to a different screen + // For cases like that, use fadescreenswapbuffers + CpuFastCopy(gPlttBufferFaded, gPlttBufferUnfaded, PLTT_BUFFER_SIZE * 2); BeginNormalPaletteFade(PALETTES_ALL, delay, 0, 16, fadeColor); gWeatherPtr->palProcessingState = WEATHER_PAL_STATE_SCREEN_FADING_OUT; diff --git a/src/scrcmd.c b/src/scrcmd.c index 58be7085f59e..1cef351d83df 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -632,6 +632,12 @@ static bool8 IsPaletteNotActive(void) return FALSE; } +// pauses script until palette fade inactive +bool8 ScrFunc_WaitPaletteNotActive(struct ScriptContext *ctx) { + SetupNativeScript(ctx, IsPaletteNotActive); + return TRUE; +} + bool8 ScrCmd_fadescreen(struct ScriptContext *ctx) { FadeScreen(ScriptReadByte(ctx), 0); @@ -652,6 +658,7 @@ bool8 ScrCmd_fadescreenspeed(struct ScriptContext *ctx) bool8 ScrCmd_fadescreenswapbuffers(struct ScriptContext *ctx) { u8 mode = ScriptReadByte(ctx); + u8 nowait = ScriptReadByte(ctx); switch (mode) { @@ -668,6 +675,8 @@ bool8 ScrCmd_fadescreenswapbuffers(struct ScriptContext *ctx) break; } + if (nowait) + return FALSE; SetupNativeScript(ctx, IsPaletteNotActive); return TRUE; } From b4cc3ca7b72f42fd54e4eaea67489dd2c510ef7c Mon Sep 17 00:00:00 2001 From: Ariel A <24759293+aarant@users.noreply.github.com> Date: Fri, 15 Jul 2022 19:02:34 -0400 Subject: [PATCH 068/104] Tileset swapPalettes can now use palette 12 for swapping. Fixed Slateport Fan Club lights. --- data/tilesets/headers.inc | 18 +++++++++--------- include/global.fieldmap.h | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/data/tilesets/headers.inc b/data/tilesets/headers.inc index 8a1e8f444beb..8be4c796520e 100644 --- a/data/tilesets/headers.inc +++ b/data/tilesets/headers.inc @@ -1,6 +1,6 @@ .align 2 gTileset_General:: - .byte 0x41 @ is compressed, swapPalettes 4 + .byte 0x21 @ is compressed, swapPalettes 4 .byte FALSE @ is secondary tileset .2byte 0x10 @ lightPalettes 4 .4byte gTilesetTiles_General @@ -11,7 +11,7 @@ gTileset_General:: .align 2 gTileset_Petalburg:: - .byte 0x21 @ is compressed, swapPalettes 9 + .byte 0x11 @ is compressed, swapPalettes 9 .byte TRUE @ is secondary tileset .2byte 0x00B @ lightPalettes 6,7,9, custom 9 .4byte gTilesetTiles_Petalburg @@ -44,9 +44,9 @@ gTileset_Dewford:: .align 2 gTileset_Slateport:: - .byte 5 @ is compressed, swapPalettes 6 + .byte 3 @ is compressed, swapPalettes 6 .byte TRUE @ is secondary tileset - .2byte 0x1 @ lightPalettes 6 + .2byte 0x41 @ lightPalettes 6,12 .4byte gTilesetTiles_Slateport .4byte gTilesetPalettes_Slateport .4byte gMetatiles_Slateport @@ -77,7 +77,7 @@ gTileset_Lavaridge:: .align 2 gTileset_Fallarbor:: - .byte 9 @ is compressed, swapPalettes 7 + .byte 5 @ is compressed, swapPalettes 7 .byte TRUE @ is secondary tileset .2byte 2 @ lightPalettes 7 .4byte gTilesetTiles_Fallarbor @@ -99,7 +99,7 @@ gTileset_Fortree:: .align 2 gTileset_Lilycove:: - .byte 5 @ is compressed, swapPalettes 6 + .byte 3 @ is compressed, swapPalettes 6 .byte TRUE @ is secondary tileset .2byte 0x01 @ lightPalettes 6 .4byte gTilesetTiles_Lilycove @@ -111,7 +111,7 @@ gTileset_Lilycove:: .align 2 gTileset_Mossdeep:: - .byte 0x11 @ is compressed, swapPalettes 8 + .byte 0x09 @ is compressed, swapPalettes 8 .byte TRUE @ is secondary tileset .2byte 0x4 @ lightPalettes 8 .4byte gTilesetTiles_Mossdeep @@ -134,7 +134,7 @@ gTileset_EverGrande:: .align 2 gTileset_Pacifidlog:: - .byte 0x21 @ is compressed, swapPalettes 9 + .byte 0x11 @ is compressed, swapPalettes 9 .byte TRUE @ is secondary tileset .2byte 8 @ lightPalettes 9 .4byte gTilesetTiles_Pacifidlog @@ -145,7 +145,7 @@ gTileset_Pacifidlog:: .align 2 gTileset_Sootopolis:: - .byte 5 @ is compressed, swapPalettes 6 + .byte 3 @ is compressed, swapPalettes 6 .byte TRUE @ is secondary tileset .2byte 0x101 @ lightPalettes 6, customLights 6 .4byte gTilesetTiles_Sootopolis diff --git a/include/global.fieldmap.h b/include/global.fieldmap.h index 9882428ce19b..ac8c6e3e643d 100644 --- a/include/global.fieldmap.h +++ b/include/global.fieldmap.h @@ -32,8 +32,8 @@ typedef void (*TilesetCB)(void); struct Tileset { - /*0x00*/ u8 isCompressed:2; - /*0x00*/ u8 swapPalettes:6; // bitmask determining whether palette has an alternate, night-time palette + /*0x00*/ u8 isCompressed:1; + /*0x00*/ u8 swapPalettes:7; // bitmask determining whether palette has an alternate, night-time palette /*0x01*/ bool8 isSecondary; /*0x02*/ u8 lightPalettes; // Bitmask determining whether a palette should be time-blended as a light /*0x03*/ u8 customLightColor; // Bitmask determining which light palettes have custom light colors (color 15) From 8aef50c7977b0daf79c7045de5876beefcfd7d73 Mon Sep 17 00:00:00 2001 From: Ariel A <24759293+aarant@users.noreply.github.com> Date: Thu, 21 Jul 2022 21:36:40 -0400 Subject: [PATCH 069/104] Fixed leftover Slateport light metatiles. --- .../secondary/slateport/metatiles.bin | Bin 6496 -> 6496 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/data/tilesets/secondary/slateport/metatiles.bin b/data/tilesets/secondary/slateport/metatiles.bin index 3ba541bfbd4a2a77a00b1a692ed22bf48377f019..81c28bc3c6104e5a8da3344bce8e14b65db96f88 100644 GIT binary patch delta 22 ccmaE0^uTDt9)2c?=E?i`tANyID*-i50Bb7;-~a#s delta 22 ccmaE0^uTDt9)2dt!;|;%R{^QbRsw3A0B`^ZVgLXD From 891b43266965081a92e423111ca9aeb898663f8a Mon Sep 17 00:00:00 2001 From: Ariel A <24759293+aarant@users.noreply.github.com> Date: Mon, 15 Aug 2022 23:18:11 -0400 Subject: [PATCH 070/104] Fixed shadow tile tag. --- include/constants/field_effects.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/constants/field_effects.h b/include/constants/field_effects.h index a29fd4e60c75..05d8d777db99 100644 --- a/include/constants/field_effects.h +++ b/include/constants/field_effects.h @@ -129,10 +129,10 @@ #define FLDEFF_PAL_TAG_UNKNOWN 0x1011 // tile tags, for field effects that may have many copies on screen at once -#define FLDEFF_TILE_TAG_SHADOW_SMALL 0x1300 -#define FLDEFF_TILE_TAG_SHADOW_MEDIUM 0x1301 -#define FLDEFF_TILE_TAG_SHADOW_LARGE 0x1302 -#define FLDEFF_TILE_TAG_SHADOW_EXTRA_LARGE 0x1303 +#define FLDEFF_TILE_TAG_SHADOW_SMALL 0x1400 +#define FLDEFF_TILE_TAG_SHADOW_MEDIUM 0x1401 +#define FLDEFF_TILE_TAG_SHADOW_LARGE 0x1402 +#define FLDEFF_TILE_TAG_SHADOW_EXTRA_LARGE 0x1403 // Duplicates of event_object_movement tags #define FLDEFF_PAL_TAG_MAY 0x1110 // OBJ_EVENT_PAL_TAG_MAY From 4654913cb694843b38800aa31b9d7a55a823a92d Mon Sep 17 00:00:00 2001 From: Ariel A <24759293+aarant@users.noreply.github.com> Date: Sun, 21 Aug 2022 16:44:17 -0400 Subject: [PATCH 071/104] Fixed gamma shift not blending the right palettes. Refactored/improved some lighting code. --- src/field_weather.c | 12 +++---- src/overworld.c | 83 +++++++++++++++++++++++---------------------- 2 files changed, 46 insertions(+), 49 deletions(-) diff --git a/src/field_weather.c b/src/field_weather.c index 3c8d82f81616..1a337f52e2ac 100644 --- a/src/field_weather.c +++ b/src/field_weather.c @@ -547,15 +547,11 @@ static void ApplyGammaShift(u8 startPalIndex, u8 numPalettes, s8 gammaIndex) else { if (MapHasNaturalLight(gMapHeader.mapType)) { // Time-blend - // Create the palette mask - u32 palettes = PALETTES_ALL; - numPalettes += startPalIndex; - palettes = (palettes >> startPalIndex) << startPalIndex; - palettes = (palettes << (32-numPalettes)) >> (32-numPalettes); - UpdateAltBgPalettes(palettes & PALETTES_BG); - UpdatePalettesWithTime(palettes); + u32 palettes = ((1 << numPalettes) - 1) << startPalIndex; + UpdateAltBgPalettes(palettes & PALETTES_BG); + UpdatePalettesWithTime(palettes); } else { // copy - CpuFastCopy(gPlttBufferUnfaded + startPalIndex * 16, gPlttBufferFaded + startPalIndex * 16, numPalettes * 16 * sizeof(u16)); + CpuFastCopy(gPlttBufferUnfaded + startPalIndex * 16, gPlttBufferFaded + startPalIndex * 16, numPalettes * 16 * sizeof(u16)); } } } diff --git a/src/overworld.c b/src/overworld.c index 8a3d2c57da37..889b2e9f92c2 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -819,7 +819,7 @@ void LoadMapFromCameraTransition(u8 mapGroup, u8 mapNum) CopySecondaryTilesetToVramUsingHeap(gMapHeader.mapLayout); LoadSecondaryTilesetPalette(gMapHeader.mapLayout, TRUE); // skip copying to Faded, gamma shift will take care of it - ApplyWeatherGammaShiftToPals(6, 6); // palettes [6,12] + ApplyWeatherGammaShiftToPals(NUM_PALS_IN_PRIMARY, NUM_PALS_TOTAL - NUM_PALS_IN_PRIMARY); // palettes [6,12] InitSecondaryTilesetAnimation(); UpdateLocationHistoryForRoamer(); @@ -1468,46 +1468,47 @@ const struct BlendSettings gTimeOfDayBlend[] = }; u8 UpdateTimeOfDay(void) { - s32 hours, minutes; - RtcCalcLocalTime(); - hours = gLocalTime.hours; - minutes = gLocalTime.minutes; - if (hours < 4) { // night - currentTimeBlend.weight = 256; - currentTimeBlend.altWeight = 0; - return gTimeOfDay = currentTimeBlend.time0 = currentTimeBlend.time1 = TIME_OF_DAY_NIGHT; - } else if (hours < 7) { // night->twilight - currentTimeBlend.time0 = TIME_OF_DAY_NIGHT; - currentTimeBlend.time1 = TIME_OF_DAY_TWILIGHT; - currentTimeBlend.weight = 256 - 256 * ((hours - 4) * 60 + minutes) / ((7-4)*60); - currentTimeBlend.altWeight = (256 - currentTimeBlend.weight) / 2; - return gTimeOfDay = TIME_OF_DAY_DAY; - } else if (hours < 10) { // twilight->day - currentTimeBlend.time0 = TIME_OF_DAY_TWILIGHT; - currentTimeBlend.time1 = TIME_OF_DAY_DAY; - currentTimeBlend.weight = 256 - 256 * ((hours - 7) * 60 + minutes) / ((10-7)*60); - currentTimeBlend.altWeight = (256 - currentTimeBlend.weight) / 2 + 128; - return gTimeOfDay = TIME_OF_DAY_DAY; - } else if (hours < 18) { // day - currentTimeBlend.weight = currentTimeBlend.altWeight = 256; - return gTimeOfDay = currentTimeBlend.time0 = currentTimeBlend.time1 = TIME_OF_DAY_DAY; - } else if (hours < 20) { // day->twilight - currentTimeBlend.time0 = TIME_OF_DAY_DAY; - currentTimeBlend.time1 = TIME_OF_DAY_TWILIGHT; - currentTimeBlend.weight = 256 - 256 * ((hours - 18) * 60 + minutes) / ((20-18)*60); - currentTimeBlend.altWeight = currentTimeBlend.weight / 2 + 128; - return gTimeOfDay = TIME_OF_DAY_TWILIGHT; - } else if (hours < 22) { // twilight->night - currentTimeBlend.time0 = TIME_OF_DAY_TWILIGHT; - currentTimeBlend.time1 = TIME_OF_DAY_NIGHT; - currentTimeBlend.weight = 256 - 256 * ((hours - 20) * 60 + minutes) / ((22-20)*60); - currentTimeBlend.altWeight = currentTimeBlend.weight / 2; - return gTimeOfDay = TIME_OF_DAY_NIGHT; - } else { // 22-24, night - currentTimeBlend.weight = 256; - currentTimeBlend.altWeight = 0; - return gTimeOfDay = currentTimeBlend.time0 = currentTimeBlend.time1 = TIME_OF_DAY_NIGHT; - } + s32 hours, minutes; + RtcCalcLocalTime(); + hours = gLocalTime.hours; + minutes = gLocalTime.minutes; + if (hours < 4) { // night + currentTimeBlend.weight = 256; + currentTimeBlend.altWeight = 0; + gTimeOfDay = currentTimeBlend.time0 = currentTimeBlend.time1 = TIME_OF_DAY_NIGHT; + } else if (hours < 7) { // night->twilight + currentTimeBlend.time0 = TIME_OF_DAY_NIGHT; + currentTimeBlend.time1 = TIME_OF_DAY_TWILIGHT; + currentTimeBlend.weight = 256 - 256 * ((hours - 4) * 60 + minutes) / ((7-4)*60); + currentTimeBlend.altWeight = (256 - currentTimeBlend.weight) / 2; + gTimeOfDay = TIME_OF_DAY_DAY; + } else if (hours < 10) { // twilight->day + currentTimeBlend.time0 = TIME_OF_DAY_TWILIGHT; + currentTimeBlend.time1 = TIME_OF_DAY_DAY; + currentTimeBlend.weight = 256 - 256 * ((hours - 7) * 60 + minutes) / ((10-7)*60); + currentTimeBlend.altWeight = (256 - currentTimeBlend.weight) / 2 + 128; + gTimeOfDay = TIME_OF_DAY_DAY; + } else if (hours < 18) { // day + currentTimeBlend.weight = currentTimeBlend.altWeight = 256; + gTimeOfDay = currentTimeBlend.time0 = currentTimeBlend.time1 = TIME_OF_DAY_DAY; + } else if (hours < 20) { // day->twilight + currentTimeBlend.time0 = TIME_OF_DAY_DAY; + currentTimeBlend.time1 = TIME_OF_DAY_TWILIGHT; + currentTimeBlend.weight = 256 - 256 * ((hours - 18) * 60 + minutes) / ((20-18)*60); + currentTimeBlend.altWeight = currentTimeBlend.weight / 2 + 128; + gTimeOfDay = TIME_OF_DAY_TWILIGHT; + } else if (hours < 22) { // twilight->night + currentTimeBlend.time0 = TIME_OF_DAY_TWILIGHT; + currentTimeBlend.time1 = TIME_OF_DAY_NIGHT; + currentTimeBlend.weight = 256 - 256 * ((hours - 20) * 60 + minutes) / ((22-20)*60); + currentTimeBlend.altWeight = currentTimeBlend.weight / 2; + gTimeOfDay = TIME_OF_DAY_NIGHT; + } else { // 22-24, night + currentTimeBlend.weight = 256; + currentTimeBlend.altWeight = 0; + gTimeOfDay = currentTimeBlend.time0 = currentTimeBlend.time1 = TIME_OF_DAY_NIGHT; + } + return gTimeOfDay; } bool8 MapHasNaturalLight(u8 mapType) { // Whether a map type is naturally lit/outside From c704591c8c769373f58736361c6f85f5e7b18c6a Mon Sep 17 00:00:00 2001 From: Ariel A <24759293+aarant@users.noreply.github.com> Date: Mon, 29 Aug 2022 01:04:26 -0400 Subject: [PATCH 072/104] Fixed field move mon palette at night. --- include/constants/field_effects.h | 1 + src/field_effect.c | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/include/constants/field_effects.h b/include/constants/field_effects.h index 05d8d777db99..25edea1af984 100644 --- a/include/constants/field_effects.h +++ b/include/constants/field_effects.h @@ -127,6 +127,7 @@ #define FLDEFF_PAL_TAG_SMALL_SPARKLE 0x100F #define FLDEFF_PAL_TAG_HOF_MONITOR 0x1010 #define FLDEFF_PAL_TAG_UNKNOWN 0x1011 +#define FLDEFF_PAL_TAG_FIELD_MOVE_MON 0x8400 // tile tags, for field effects that may have many copies on screen at once #define FLDEFF_TILE_TAG_SHADOW_SMALL 0x1400 diff --git a/src/field_effect.c b/src/field_effect.c index cbf1be0bbc39..6165d515ee56 100644 --- a/src/field_effect.c +++ b/src/field_effect.c @@ -914,8 +914,10 @@ u8 CreateMonSprite_PicBox(u16 species, s16 x, s16 y, u8 subpriority) u8 CreateMonSprite_FieldMove(u16 species, u32 otId, u32 personality, s16 x, s16 y, u8 subpriority) { const struct CompressedSpritePalette *spritePalette = GetMonSpritePalStructFromOtIdPersonality(species, otId, personality); - u16 spriteId = CreateMonPicSprite_HandleDeoxys(species, otId, personality, 1, x, y, 0, spritePalette->tag); - PreservePaletteInWeather(IndexOfSpritePaletteTag(spritePalette->tag) + 0x10); + // force load unique tag here to avoid collision with follower pokemon + u8 paletteSlot = AllocSpritePalette(FLDEFF_PAL_TAG_FIELD_MOVE_MON); + u16 spriteId = CreateMonPicSprite_HandleDeoxys(species, otId, personality, 1, x, y, paletteSlot, TAG_NONE); + PreservePaletteInWeather(IndexOfSpritePaletteTag(FLDEFF_PAL_TAG_FIELD_MOVE_MON) + 0x10); if (spriteId == 0xFFFF) return MAX_SPRITES; else From f7759760e0f319757d2e92aadb429c170fee205e Mon Sep 17 00:00:00 2001 From: Ariel A <24759293+aarant@users.noreply.github.com> Date: Sun, 28 Aug 2022 01:39:53 -0400 Subject: [PATCH 073/104] Improved shadows for Lavaridge, escalator, Escape warps. --- src/field_effect.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/field_effect.c b/src/field_effect.c index 6165d515ee56..bebf8e4051e8 100644 --- a/src/field_effect.c +++ b/src/field_effect.c @@ -1587,6 +1587,7 @@ static bool8 EscalatorWarpOut_WaitForPlayer(struct Task *task) if (!ObjectEventIsMovementOverridden(objectEvent) || ObjectEventClearHeldMovementIfFinished(objectEvent)) { ObjectEventSetHeldMovement(objectEvent, GetFaceDirectionMovementAction(GetPlayerFacingDirection())); + objectEvent->noShadow = TRUE; // hide shadow for cleaner movement task->tState++; task->data[2] = 0; task->data[3] = 0; @@ -1708,6 +1709,7 @@ static bool8 EscalatorWarpIn_Init(struct Task *task) u8 behavior; CameraObjectReset2(); objectEvent = &gObjectEvents[gPlayerAvatar.objectEventId]; + objectEvent->noShadow = TRUE; ObjectEventSetHeldMovement(objectEvent, GetFaceDirectionMovementAction(DIR_EAST)); PlayerGetDestCoords(&x, &y); behavior = MapGridGetMetatileBehaviorAt(x, y); @@ -1804,6 +1806,7 @@ static bool8 EscalatorWarpIn_End(struct Task *task) { struct ObjectEvent *objectEvent; objectEvent = &gObjectEvents[gPlayerAvatar.objectEventId]; + objectEvent->noShadow = FALSE; if (ObjectEventClearHeldMovementIfFinished(objectEvent)) { CameraObjectReset1(); @@ -1956,6 +1959,7 @@ static bool8 LavaridgeGymB1FWarpEffect_Init(struct Task *task, struct ObjectEven SetCameraPanningCallback(NULL); gPlayerAvatar.preventStep = TRUE; objectEvent->fixedPriority = 1; + objectEvent->noShadow = TRUE; task->data[1] = 1; task->data[0]++; return TRUE; @@ -2148,6 +2152,7 @@ static bool8 LavaridgeGym1FWarpEffect_Init(struct Task *task, struct ObjectEvent CameraObjectReset2(); gPlayerAvatar.preventStep = TRUE; objectEvent->fixedPriority = 1; + objectEvent->noShadow = TRUE; task->data[0]++; return FALSE; } From d6bac9895d4681c0916541e1aac27c2dba955a53 Mon Sep 17 00:00:00 2001 From: Ariel A <24759293+aarant@users.noreply.github.com> Date: Sat, 3 Sep 2022 15:23:49 -0400 Subject: [PATCH 074/104] Fixed shadow palette during contests. --- src/contest_util.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/contest_util.c b/src/contest_util.c index d8726d860f56..6289f2cdc565 100644 --- a/src/contest_util.c +++ b/src/contest_util.c @@ -2505,6 +2505,12 @@ void SetLinkContestPlayerGfx(void) } } +// copied from event_object_movement +#define OBJ_EVENT_PAL_TAG_BRENDAN 0x1100 +#define OBJ_EVENT_PAL_TAG_MAY 0x1110 +#define OBJ_EVENT_PAL_TAG_RS_BRENDAN 0x1122 +#define OBJ_EVENT_PAL_TAG_RS_MAY 0x1123 + void LoadLinkContestPlayerPalettes(void) { int i; @@ -2513,28 +2519,28 @@ void LoadLinkContestPlayerPalettes(void) struct Sprite *sprite; static const u8 sContestantLocalIds[CONTESTANT_COUNT] = { 3, 4, 5, 14 }; - gReservedSpritePaletteCount = 12; + // gReservedSpritePaletteCount = 12; + // TODO: Does dynamically allocating link player palettes break link contests? if (gLinkContestFlags & LINK_CONTEST_FLAG_IS_LINK) { for (i = 0; i < gNumLinkContestPlayers; i++) { objectEventId = GetObjectEventIdByLocalIdAndMap(sContestantLocalIds[i], gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup); sprite = &gSprites[gObjectEvents[objectEventId].spriteId]; - sprite->oam.paletteNum = 6 + i; version = (u8)gLinkPlayers[i].version; if (version == VERSION_RUBY || version == VERSION_SAPPHIRE) { if (gLinkPlayers[i].gender == MALE) - LoadPalette(gObjectEventPal_RubySapphireBrendan, 0x160 + i * 0x10, 0x20); + sprite->oam.paletteNum = LoadObjectEventPalette(OBJ_EVENT_PAL_TAG_RS_BRENDAN); else - LoadPalette(gObjectEventPal_RubySapphireMay, 0x160 + i * 0x10, 0x20); + sprite->oam.paletteNum = LoadObjectEventPalette(OBJ_EVENT_PAL_TAG_RS_MAY); } else { if (gLinkPlayers[i].gender == MALE) - LoadPalette(gObjectEventPal_Brendan, 0x160 + i * 0x10, 0x20); + sprite->oam.paletteNum = LoadObjectEventPalette(OBJ_EVENT_PAL_TAG_BRENDAN); else - LoadPalette(gObjectEventPal_May, 0x160 + i * 0x10, 0x20); + sprite->oam.paletteNum = LoadObjectEventPalette(OBJ_EVENT_PAL_TAG_MAY); } } } From 782889d5334b4a7bf78449ce903fbb1f8c9ba2f7 Mon Sep 17 00:00:00 2001 From: Ariel A <24759293+aarant@users.noreply.github.com> Date: Fri, 25 Nov 2022 15:02:07 -0500 Subject: [PATCH 075/104] Fixed potentially unaligned tileset palettes. Credit to SBird --- src/data/tilesets/graphics.h | 148 +++++++++++++++++------------------ src/graphics.c | 2 +- src/palette.c | 2 + 3 files changed, 77 insertions(+), 75 deletions(-) diff --git a/src/data/tilesets/graphics.h b/src/data/tilesets/graphics.h index 2fdc28d21385..a6ca2746bf01 100644 --- a/src/data/tilesets/graphics.h +++ b/src/data/tilesets/graphics.h @@ -1,6 +1,6 @@ const u32 gTilesetTiles_Petalburg[] = INCBIN_U32("data/tilesets/secondary/petalburg/tiles.4bpp.lz"); -const u16 gTilesetPalettes_Petalburg[][16] = +const u16 ALIGNED(4) gTilesetPalettes_Petalburg[][16] = { INCBIN_U16("data/tilesets/secondary/petalburg/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/petalburg/palettes/01.gbapal"), @@ -22,7 +22,7 @@ const u16 gTilesetPalettes_Petalburg[][16] = const u32 gTilesetTiles_Rustboro[] = INCBIN_U32("data/tilesets/secondary/rustboro/tiles.4bpp.lz"); -const u16 gTilesetPalettes_Rustboro[][16] = +const u16 ALIGNED(4) gTilesetPalettes_Rustboro[][16] = { INCBIN_U16("data/tilesets/secondary/rustboro/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/rustboro/palettes/01.gbapal"), @@ -44,7 +44,7 @@ const u16 gTilesetPalettes_Rustboro[][16] = const u32 gTilesetTiles_Dewford[] = INCBIN_U32("data/tilesets/secondary/dewford/tiles.4bpp.lz"); -const u16 gTilesetPalettes_Dewford[][16] = +const u16 ALIGNED(4) gTilesetPalettes_Dewford[][16] = { INCBIN_U16("data/tilesets/secondary/dewford/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/dewford/palettes/01.gbapal"), @@ -66,7 +66,7 @@ const u16 gTilesetPalettes_Dewford[][16] = const u32 gTilesetTiles_Slateport[] = INCBIN_U32("data/tilesets/secondary/slateport/tiles.4bpp.lz"); -const u16 gTilesetPalettes_Slateport[][16] = +const u16 ALIGNED(4) gTilesetPalettes_Slateport[][16] = { INCBIN_U16("data/tilesets/secondary/slateport/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/slateport/palettes/01.gbapal"), @@ -88,7 +88,7 @@ const u16 gTilesetPalettes_Slateport[][16] = const u32 gTilesetTiles_Mauville[] = INCBIN_U32("data/tilesets/secondary/mauville/tiles.4bpp.lz"); -const u16 gTilesetPalettes_Mauville[][16] = +const u16 ALIGNED(4) gTilesetPalettes_Mauville[][16] = { INCBIN_U16("data/tilesets/secondary/mauville/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/mauville/palettes/01.gbapal"), @@ -110,7 +110,7 @@ const u16 gTilesetPalettes_Mauville[][16] = const u32 gTilesetTiles_Lavaridge[] = INCBIN_U32("data/tilesets/secondary/lavaridge/tiles.4bpp.lz"); -const u16 gTilesetPalettes_Lavaridge[][16] = +const u16 ALIGNED(4) gTilesetPalettes_Lavaridge[][16] = { INCBIN_U16("data/tilesets/secondary/lavaridge/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/lavaridge/palettes/01.gbapal"), @@ -132,7 +132,7 @@ const u16 gTilesetPalettes_Lavaridge[][16] = const u32 gTilesetTiles_Fallarbor[] = INCBIN_U32("data/tilesets/secondary/fallarbor/tiles.4bpp.lz"); -const u16 gTilesetPalettes_Fallarbor[][16] = +const u16 ALIGNED(4) gTilesetPalettes_Fallarbor[][16] = { INCBIN_U16("data/tilesets/secondary/fallarbor/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/fallarbor/palettes/01.gbapal"), @@ -154,7 +154,7 @@ const u16 gTilesetPalettes_Fallarbor[][16] = const u32 gTilesetTiles_Fortree[] = INCBIN_U32("data/tilesets/secondary/fortree/tiles.4bpp.lz"); -const u16 gTilesetPalettes_Fortree[][16] = +const u16 ALIGNED(4) gTilesetPalettes_Fortree[][16] = { INCBIN_U16("data/tilesets/secondary/fortree/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/fortree/palettes/01.gbapal"), @@ -176,7 +176,7 @@ const u16 gTilesetPalettes_Fortree[][16] = const u32 gTilesetTiles_Lilycove[] = INCBIN_U32("data/tilesets/secondary/lilycove/tiles.4bpp.lz"); -const u16 gTilesetPalettes_Lilycove[][16] = +const u16 ALIGNED(4) gTilesetPalettes_Lilycove[][16] = { INCBIN_U16("data/tilesets/secondary/lilycove/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/lilycove/palettes/01.gbapal"), @@ -198,7 +198,7 @@ const u16 gTilesetPalettes_Lilycove[][16] = const u32 gTilesetTiles_Mossdeep[] = INCBIN_U32("data/tilesets/secondary/mossdeep/tiles.4bpp.lz"); -const u16 gTilesetPalettes_Mossdeep[][16] = +const u16 ALIGNED(4) gTilesetPalettes_Mossdeep[][16] = { INCBIN_U16("data/tilesets/secondary/mossdeep/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/mossdeep/palettes/01.gbapal"), @@ -220,7 +220,7 @@ const u16 gTilesetPalettes_Mossdeep[][16] = const u32 gTilesetTiles_EverGrande[] = INCBIN_U32("data/tilesets/secondary/ever_grande/tiles.4bpp.lz"); -const u16 gTilesetPalettes_EverGrande[][16] = +const u16 ALIGNED(4) gTilesetPalettes_EverGrande[][16] = { INCBIN_U16("data/tilesets/secondary/ever_grande/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/ever_grande/palettes/01.gbapal"), @@ -242,7 +242,7 @@ const u16 gTilesetPalettes_EverGrande[][16] = const u32 gTilesetTiles_Pacifidlog[] = INCBIN_U32("data/tilesets/secondary/pacifidlog/tiles.4bpp.lz"); -const u16 gTilesetPalettes_Pacifidlog[][16] = +const u16 ALIGNED(4) gTilesetPalettes_Pacifidlog[][16] = { INCBIN_U16("data/tilesets/secondary/pacifidlog/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/pacifidlog/palettes/01.gbapal"), @@ -264,7 +264,7 @@ const u16 gTilesetPalettes_Pacifidlog[][16] = const u32 gTilesetTiles_Sootopolis[] = INCBIN_U32("data/tilesets/secondary/sootopolis/tiles.4bpp.lz"); -const u16 gTilesetPalettes_Sootopolis[][16] = +const u16 ALIGNED(4) gTilesetPalettes_Sootopolis[][16] = { INCBIN_U16("data/tilesets/secondary/sootopolis/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/sootopolis/palettes/01.gbapal"), @@ -286,7 +286,7 @@ const u16 gTilesetPalettes_Sootopolis[][16] = const u32 gTilesetTiles_BattleFrontierOutsideWest[] = INCBIN_U32("data/tilesets/secondary/battle_frontier_outside_west/tiles.4bpp.lz"); -const u16 gTilesetPalettes_BattleFrontierOutsideWest[][16] = +const u16 ALIGNED(4) gTilesetPalettes_BattleFrontierOutsideWest[][16] = { INCBIN_U16("data/tilesets/secondary/battle_frontier_outside_west/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/battle_frontier_outside_west/palettes/01.gbapal"), @@ -308,7 +308,7 @@ const u16 gTilesetPalettes_BattleFrontierOutsideWest[][16] = const u32 gTilesetTiles_BattleFrontierOutsideEast[] = INCBIN_U32("data/tilesets/secondary/battle_frontier_outside_east/tiles.4bpp.lz"); -const u16 gTilesetPalettes_BattleFrontierOutsideEast[][16] = +const u16 ALIGNED(4) gTilesetPalettes_BattleFrontierOutsideEast[][16] = { INCBIN_U16("data/tilesets/secondary/battle_frontier_outside_east/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/battle_frontier_outside_east/palettes/01.gbapal"), @@ -330,7 +330,7 @@ const u16 gTilesetPalettes_BattleFrontierOutsideEast[][16] = const u32 gTilesetTiles_InsideBuilding[] = INCBIN_U32("data/tilesets/primary/building/tiles.4bpp.lz"); -const u16 gTilesetPalettes_InsideBuilding[][16] = +const u16 ALIGNED(4) gTilesetPalettes_InsideBuilding[][16] = { INCBIN_U16("data/tilesets/primary/building/palettes/00.gbapal"), INCBIN_U16("data/tilesets/primary/building/palettes/01.gbapal"), @@ -352,7 +352,7 @@ const u16 gTilesetPalettes_InsideBuilding[][16] = const u32 gTilesetTiles_Shop[] = INCBIN_U32("data/tilesets/secondary/shop/tiles.4bpp.lz"); -const u16 gTilesetPalettes_Shop[][16] = +const u16 ALIGNED(4) gTilesetPalettes_Shop[][16] = { INCBIN_U16("data/tilesets/secondary/shop/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/shop/palettes/01.gbapal"), @@ -374,7 +374,7 @@ const u16 gTilesetPalettes_Shop[][16] = const u32 gTilesetTiles_PokemonCenter[] = INCBIN_U32("data/tilesets/secondary/pokemon_center/tiles.4bpp.lz"); -const u16 gTilesetPalettes_PokemonCenter[][16] = +const u16 ALIGNED(4) gTilesetPalettes_PokemonCenter[][16] = { INCBIN_U16("data/tilesets/secondary/pokemon_center/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/pokemon_center/palettes/01.gbapal"), @@ -396,7 +396,7 @@ const u16 gTilesetPalettes_PokemonCenter[][16] = const u32 gTilesetTiles_Cave[] = INCBIN_U32("data/tilesets/secondary/cave/tiles.4bpp.lz"); -const u16 gTilesetPalettes_Cave[][16] = +const u16 ALIGNED(4) gTilesetPalettes_Cave[][16] = { INCBIN_U16("data/tilesets/secondary/cave/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/cave/palettes/01.gbapal"), @@ -418,7 +418,7 @@ const u16 gTilesetPalettes_Cave[][16] = const u32 gTilesetTiles_PokemonSchool[] = INCBIN_U32("data/tilesets/secondary/pokemon_school/tiles.4bpp.lz"); -const u16 gTilesetPalettes_PokemonSchool[][16] = +const u16 ALIGNED(4) gTilesetPalettes_PokemonSchool[][16] = { INCBIN_U16("data/tilesets/secondary/pokemon_school/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/pokemon_school/palettes/01.gbapal"), @@ -440,7 +440,7 @@ const u16 gTilesetPalettes_PokemonSchool[][16] = const u32 gTilesetTiles_PokemonFanClub[] = INCBIN_U32("data/tilesets/secondary/pokemon_fan_club/tiles.4bpp.lz"); -const u16 gTilesetPalettes_PokemonFanClub[][16] = +const u16 ALIGNED(4) gTilesetPalettes_PokemonFanClub[][16] = { INCBIN_U16("data/tilesets/secondary/pokemon_fan_club/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/pokemon_fan_club/palettes/01.gbapal"), @@ -462,7 +462,7 @@ const u16 gTilesetPalettes_PokemonFanClub[][16] = const u32 gTilesetTiles_Unused1[] = INCBIN_U32("data/tilesets/secondary/unused_1/tiles.4bpp.lz"); -const u16 gTilesetPalettes_Unused1[][16] = +const u16 ALIGNED(4) gTilesetPalettes_Unused1[][16] = { INCBIN_U16("data/tilesets/secondary/unused_1/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/unused_1/palettes/01.gbapal"), @@ -484,7 +484,7 @@ const u16 gTilesetPalettes_Unused1[][16] = const u32 gTilesetTiles_MeteorFalls[] = INCBIN_U32("data/tilesets/secondary/meteor_falls/tiles.4bpp.lz"); -const u16 gTilesetPalettes_MeteorFalls[][16] = +const u16 ALIGNED(4) gTilesetPalettes_MeteorFalls[][16] = { INCBIN_U16("data/tilesets/secondary/meteor_falls/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/meteor_falls/palettes/01.gbapal"), @@ -506,7 +506,7 @@ const u16 gTilesetPalettes_MeteorFalls[][16] = const u32 gTilesetTiles_OceanicMuseum[] = INCBIN_U32("data/tilesets/secondary/oceanic_museum/tiles.4bpp.lz"); -const u16 gTilesetPalettes_OceanicMuseum[][16] = +const u16 ALIGNED(4) gTilesetPalettes_OceanicMuseum[][16] = { INCBIN_U16("data/tilesets/secondary/oceanic_museum/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/oceanic_museum/palettes/01.gbapal"), @@ -529,7 +529,7 @@ const u16 gTilesetPalettes_OceanicMuseum[][16] = const u32 gTilesetTiles_CableClub[] = INCBIN_U32("data/tilesets/secondary/cable_club/tiles.4bpp"); const u32 gTilesetTiles_UnknownCableClub[] = INCBIN_U32("data/tilesets/secondary/cable_club/unknown_tiles.4bpp"); -const u16 gTilesetPalettes_CableClub[][16] = +const u16 ALIGNED(4) gTilesetPalettes_CableClub[][16] = { INCBIN_U16("data/tilesets/secondary/cable_club/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/cable_club/palettes/01.gbapal"), @@ -551,7 +551,7 @@ const u16 gTilesetPalettes_CableClub[][16] = const u32 gTilesetTiles_SeashoreHouse[] = INCBIN_U32("data/tilesets/secondary/seashore_house/tiles.4bpp.lz"); -const u16 gTilesetPalettes_SeashoreHouse[][16] = +const u16 ALIGNED(4) gTilesetPalettes_SeashoreHouse[][16] = { INCBIN_U16("data/tilesets/secondary/seashore_house/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/seashore_house/palettes/01.gbapal"), @@ -573,7 +573,7 @@ const u16 gTilesetPalettes_SeashoreHouse[][16] = const u32 gTilesetTiles_PrettyPetalFlowerShop[] = INCBIN_U32("data/tilesets/secondary/pretty_petal_flower_shop/tiles.4bpp.lz"); -const u16 gTilesetPalettes_PrettyPetalFlowerShop[][16] = +const u16 ALIGNED(4) gTilesetPalettes_PrettyPetalFlowerShop[][16] = { INCBIN_U16("data/tilesets/secondary/pretty_petal_flower_shop/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/pretty_petal_flower_shop/palettes/01.gbapal"), @@ -595,7 +595,7 @@ const u16 gTilesetPalettes_PrettyPetalFlowerShop[][16] = const u32 gTilesetTiles_PokemonDayCare[] = INCBIN_U32("data/tilesets/secondary/pokemon_day_care/tiles.4bpp.lz"); -const u16 gTilesetPalettes_PokemonDayCare[][16] = +const u16 ALIGNED(4) gTilesetPalettes_PokemonDayCare[][16] = { INCBIN_U16("data/tilesets/secondary/pokemon_day_care/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/pokemon_day_care/palettes/01.gbapal"), @@ -617,7 +617,7 @@ const u16 gTilesetPalettes_PokemonDayCare[][16] = const u32 gTilesetTiles_Facility[] = INCBIN_U32("data/tilesets/secondary/facility/tiles.4bpp.lz"); -const u16 gTilesetPalettes_Facility[][16] = +const u16 ALIGNED(4) gTilesetPalettes_Facility[][16] = { INCBIN_U16("data/tilesets/secondary/facility/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/facility/palettes/01.gbapal"), @@ -639,7 +639,7 @@ const u16 gTilesetPalettes_Facility[][16] = const u32 gTilesetTiles_BikeShop[] = INCBIN_U32("data/tilesets/secondary/bike_shop/tiles.4bpp.lz"); -const u16 gTilesetPalettes_BikeShop[][16] = +const u16 ALIGNED(4) gTilesetPalettes_BikeShop[][16] = { INCBIN_U16("data/tilesets/secondary/bike_shop/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/bike_shop/palettes/01.gbapal"), @@ -661,7 +661,7 @@ const u16 gTilesetPalettes_BikeShop[][16] = const u32 gTilesetTiles_RusturfTunnel[] = INCBIN_U32("data/tilesets/secondary/rusturf_tunnel/tiles.4bpp.lz"); -const u16 gTilesetPalettes_RusturfTunnel[][16] = +const u16 ALIGNED(4) gTilesetPalettes_RusturfTunnel[][16] = { INCBIN_U16("data/tilesets/secondary/rusturf_tunnel/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/rusturf_tunnel/palettes/01.gbapal"), @@ -683,7 +683,7 @@ const u16 gTilesetPalettes_RusturfTunnel[][16] = const u32 gTilesetTiles_SecretBaseBrownCaveCompressed[] = INCBIN_U32("data/tilesets/secondary/secret_base/brown_cave/unused_tiles.4bpp.lz"); -const u16 gTilesetPalettes_SecretBaseBrownCave[][16] = +const u16 ALIGNED(4) gTilesetPalettes_SecretBaseBrownCave[][16] = { INCBIN_U16("data/tilesets/secondary/secret_base/brown_cave/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/secret_base/brown_cave/palettes/01.gbapal"), @@ -705,7 +705,7 @@ const u16 gTilesetPalettes_SecretBaseBrownCave[][16] = const u32 gTilesetTiles_SecretBaseTreeCompressed[] = INCBIN_U32("data/tilesets/secondary/secret_base/tree/unused_tiles.4bpp.lz"); -const u16 gTilesetPalettes_SecretBaseTree[][16] = +const u16 ALIGNED(4) gTilesetPalettes_SecretBaseTree[][16] = { INCBIN_U16("data/tilesets/secondary/secret_base/tree/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/secret_base/tree/palettes/01.gbapal"), @@ -727,7 +727,7 @@ const u16 gTilesetPalettes_SecretBaseTree[][16] = const u32 gTilesetTiles_SecretBaseShrubCompressed[] = INCBIN_U32("data/tilesets/secondary/secret_base/shrub/unused_tiles.4bpp.lz"); -const u16 gTilesetPalettes_SecretBaseShrub[][16] = +const u16 ALIGNED(4) gTilesetPalettes_SecretBaseShrub[][16] = { INCBIN_U16("data/tilesets/secondary/secret_base/shrub/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/secret_base/shrub/palettes/01.gbapal"), @@ -749,7 +749,7 @@ const u16 gTilesetPalettes_SecretBaseShrub[][16] = const u32 gTilesetTiles_SecretBaseBlueCaveCompressed[] = INCBIN_U32("data/tilesets/secondary/secret_base/blue_cave/unused_tiles.4bpp.lz"); -const u16 gTilesetPalettes_SecretBaseBlueCave[][16] = +const u16 ALIGNED(4) gTilesetPalettes_SecretBaseBlueCave[][16] = { INCBIN_U16("data/tilesets/secondary/secret_base/blue_cave/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/secret_base/blue_cave/palettes/01.gbapal"), @@ -771,7 +771,7 @@ const u16 gTilesetPalettes_SecretBaseBlueCave[][16] = const u32 gTilesetTiles_SecretBaseYellowCaveCompressed[] = INCBIN_U32("data/tilesets/secondary/secret_base/yellow_cave/unused_tiles.4bpp.lz"); -const u16 gTilesetPalettes_SecretBaseYellowCave[][16] = +const u16 ALIGNED(4) gTilesetPalettes_SecretBaseYellowCave[][16] = { INCBIN_U16("data/tilesets/secondary/secret_base/yellow_cave/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/secret_base/yellow_cave/palettes/01.gbapal"), @@ -793,7 +793,7 @@ const u16 gTilesetPalettes_SecretBaseYellowCave[][16] = const u32 gTilesetTiles_SecretBaseRedCaveCompressed[] = INCBIN_U32("data/tilesets/secondary/secret_base/red_cave/unused_tiles.4bpp.lz"); -const u16 gTilesetPalettes_SecretBaseRedCave[][16] = +const u16 ALIGNED(4) gTilesetPalettes_SecretBaseRedCave[][16] = { INCBIN_U16("data/tilesets/secondary/secret_base/red_cave/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/secret_base/red_cave/palettes/01.gbapal"), @@ -822,7 +822,7 @@ const u32 gTilesetTiles_SecretBaseRedCave[] = INCBIN_U32("data/tilesets/secondar const u32 gTilesetTiles_InsideOfTruck[] = INCBIN_U32("data/tilesets/secondary/inside_of_truck/tiles.4bpp.lz"); -const u16 gTilesetPalettes_InsideOfTruck[][16] = +const u16 ALIGNED(4) gTilesetPalettes_InsideOfTruck[][16] = { INCBIN_U16("data/tilesets/secondary/inside_of_truck/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/inside_of_truck/palettes/01.gbapal"), @@ -844,7 +844,7 @@ const u16 gTilesetPalettes_InsideOfTruck[][16] = const u32 gTilesetTiles_Contest[] = INCBIN_U32("data/tilesets/secondary/contest/tiles.4bpp.lz"); -const u16 gTilesetPalettes_Contest[][16] = +const u16 ALIGNED(4) gTilesetPalettes_Contest[][16] = { INCBIN_U16("data/tilesets/secondary/contest/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/contest/palettes/01.gbapal"), @@ -866,7 +866,7 @@ const u16 gTilesetPalettes_Contest[][16] = const u32 gTilesetTiles_LilycoveMuseum[] = INCBIN_U32("data/tilesets/secondary/lilycove_museum/tiles.4bpp.lz"); -const u16 gTilesetPalettes_LilycoveMuseum[][16] = +const u16 ALIGNED(4) gTilesetPalettes_LilycoveMuseum[][16] = { INCBIN_U16("data/tilesets/secondary/lilycove_museum/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/lilycove_museum/palettes/01.gbapal"), @@ -888,7 +888,7 @@ const u16 gTilesetPalettes_LilycoveMuseum[][16] = const u32 gTilesetTiles_BrendansMaysHouse[] = INCBIN_U32("data/tilesets/secondary/brendans_mays_house/tiles.4bpp.lz"); -const u16 gTilesetPalettes_BrendansMaysHouse[][16] = +const u16 ALIGNED(4) gTilesetPalettes_BrendansMaysHouse[][16] = { INCBIN_U16("data/tilesets/secondary/brendans_mays_house/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/brendans_mays_house/palettes/01.gbapal"), @@ -910,7 +910,7 @@ const u16 gTilesetPalettes_BrendansMaysHouse[][16] = const u32 gTilesetTiles_Lab[] = INCBIN_U32("data/tilesets/secondary/lab/tiles.4bpp.lz"); -const u16 gTilesetPalettes_Lab[][16] = +const u16 ALIGNED(4) gTilesetPalettes_Lab[][16] = { INCBIN_U16("data/tilesets/secondary/lab/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/lab/palettes/01.gbapal"), @@ -932,7 +932,7 @@ const u16 gTilesetPalettes_Lab[][16] = const u32 gTilesetTiles_Underwater[] = INCBIN_U32("data/tilesets/secondary/underwater/tiles.4bpp.lz"); -const u16 gTilesetPalettes_Underwater[][16] = +const u16 ALIGNED(4) gTilesetPalettes_Underwater[][16] = { INCBIN_U16("data/tilesets/secondary/underwater/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/underwater/palettes/01.gbapal"), @@ -954,7 +954,7 @@ const u16 gTilesetPalettes_Underwater[][16] = const u32 gTilesetTiles_GenericBuilding[] = INCBIN_U32("data/tilesets/secondary/generic_building/tiles.4bpp.lz"); -const u16 gTilesetPalettes_GenericBuilding[][16] = +const u16 ALIGNED(4) gTilesetPalettes_GenericBuilding[][16] = { INCBIN_U16("data/tilesets/secondary/generic_building/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/generic_building/palettes/01.gbapal"), @@ -976,7 +976,7 @@ const u16 gTilesetPalettes_GenericBuilding[][16] = const u32 gTilesetTiles_MauvilleGameCorner[] = INCBIN_U32("data/tilesets/secondary/mauville_game_corner/tiles.4bpp.lz"); -const u16 gTilesetPalettes_MauvilleGameCorner[][16] = +const u16 ALIGNED(4) gTilesetPalettes_MauvilleGameCorner[][16] = { INCBIN_U16("data/tilesets/secondary/mauville_game_corner/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/mauville_game_corner/palettes/01.gbapal"), @@ -998,7 +998,7 @@ const u16 gTilesetPalettes_MauvilleGameCorner[][16] = const u32 gTilesetTiles_Unused2[] = INCBIN_U32("data/tilesets/secondary/unused_2/tiles.4bpp.lz"); -const u16 gTilesetPalettes_Unused2[][16] = +const u16 ALIGNED(4) gTilesetPalettes_Unused2[][16] = { INCBIN_U16("data/tilesets/secondary/unused_2/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/unused_2/palettes/01.gbapal"), @@ -1020,7 +1020,7 @@ const u16 gTilesetPalettes_Unused2[][16] = const u32 gTilesetTiles_RustboroGym[] = INCBIN_U32("data/tilesets/secondary/rustboro_gym/tiles.4bpp.lz"); -const u16 gTilesetPalettes_RustboroGym[][16] = +const u16 ALIGNED(4) gTilesetPalettes_RustboroGym[][16] = { INCBIN_U16("data/tilesets/secondary/rustboro_gym/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/rustboro_gym/palettes/01.gbapal"), @@ -1042,7 +1042,7 @@ const u16 gTilesetPalettes_RustboroGym[][16] = const u32 gTilesetTiles_DewfordGym[] = INCBIN_U32("data/tilesets/secondary/dewford_gym/tiles.4bpp.lz"); -const u16 gTilesetPalettes_DewfordGym[][16] = +const u16 ALIGNED(4) gTilesetPalettes_DewfordGym[][16] = { INCBIN_U16("data/tilesets/secondary/dewford_gym/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/dewford_gym/palettes/01.gbapal"), @@ -1064,7 +1064,7 @@ const u16 gTilesetPalettes_DewfordGym[][16] = const u32 gTilesetTiles_MauvilleGym[] = INCBIN_U32("data/tilesets/secondary/mauville_gym/tiles.4bpp.lz"); -const u16 gTilesetPalettes_MauvilleGym[][16] = +const u16 ALIGNED(4) gTilesetPalettes_MauvilleGym[][16] = { INCBIN_U16("data/tilesets/secondary/mauville_gym/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/mauville_gym/palettes/01.gbapal"), @@ -1086,7 +1086,7 @@ const u16 gTilesetPalettes_MauvilleGym[][16] = const u32 gTilesetTiles_LavaridgeGym[] = INCBIN_U32("data/tilesets/secondary/lavaridge_gym/tiles.4bpp.lz"); -const u16 gTilesetPalettes_LavaridgeGym[][16] = +const u16 ALIGNED(4) gTilesetPalettes_LavaridgeGym[][16] = { INCBIN_U16("data/tilesets/secondary/lavaridge_gym/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/lavaridge_gym/palettes/01.gbapal"), @@ -1108,7 +1108,7 @@ const u16 gTilesetPalettes_LavaridgeGym[][16] = const u32 gTilesetTiles_PetalburgGym[] = INCBIN_U32("data/tilesets/secondary/petalburg_gym/tiles.4bpp.lz"); -const u16 gTilesetPalettes_PetalburgGym[][16] = +const u16 ALIGNED(4) gTilesetPalettes_PetalburgGym[][16] = { INCBIN_U16("data/tilesets/secondary/petalburg_gym/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/petalburg_gym/palettes/01.gbapal"), @@ -1130,7 +1130,7 @@ const u16 gTilesetPalettes_PetalburgGym[][16] = const u32 gTilesetTiles_FortreeGym[] = INCBIN_U32("data/tilesets/secondary/fortree_gym/tiles.4bpp.lz"); -const u16 gTilesetPalettes_FortreeGym[][16] = +const u16 ALIGNED(4) gTilesetPalettes_FortreeGym[][16] = { INCBIN_U16("data/tilesets/secondary/fortree_gym/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/fortree_gym/palettes/01.gbapal"), @@ -1152,7 +1152,7 @@ const u16 gTilesetPalettes_FortreeGym[][16] = const u32 gTilesetTiles_MossdeepGym[] = INCBIN_U32("data/tilesets/secondary/mossdeep_gym/tiles.4bpp.lz"); -const u16 gTilesetPalettes_MossdeepGym[][16] = +const u16 ALIGNED(4) gTilesetPalettes_MossdeepGym[][16] = { INCBIN_U16("data/tilesets/secondary/mossdeep_gym/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/mossdeep_gym/palettes/01.gbapal"), @@ -1174,7 +1174,7 @@ const u16 gTilesetPalettes_MossdeepGym[][16] = const u32 gTilesetTiles_SootopolisGym[] = INCBIN_U32("data/tilesets/secondary/sootopolis_gym/tiles.4bpp.lz"); -const u16 gTilesetPalettes_SootopolisGym[][16] = +const u16 ALIGNED(4) gTilesetPalettes_SootopolisGym[][16] = { INCBIN_U16("data/tilesets/secondary/sootopolis_gym/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/sootopolis_gym/palettes/01.gbapal"), @@ -1196,7 +1196,7 @@ const u16 gTilesetPalettes_SootopolisGym[][16] = const u32 gTilesetTiles_TrickHousePuzzle[] = INCBIN_U32("data/tilesets/secondary/trick_house_puzzle/tiles.4bpp.lz"); -const u16 gTilesetPalettes_TrickHousePuzzle[][16] = +const u16 ALIGNED(4) gTilesetPalettes_TrickHousePuzzle[][16] = { INCBIN_U16("data/tilesets/secondary/trick_house_puzzle/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/trick_house_puzzle/palettes/01.gbapal"), @@ -1218,7 +1218,7 @@ const u16 gTilesetPalettes_TrickHousePuzzle[][16] = const u32 gTilesetTiles_InsideShip[] = INCBIN_U32("data/tilesets/secondary/inside_ship/tiles.4bpp.lz"); -const u16 gTilesetPalettes_InsideShip[][16] = +const u16 ALIGNED(4) gTilesetPalettes_InsideShip[][16] = { INCBIN_U16("data/tilesets/secondary/inside_ship/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/inside_ship/palettes/01.gbapal"), @@ -1241,7 +1241,7 @@ const u16 gTilesetPalettes_InsideShip[][16] = const u32 gTilesetTiles_SecretBase[] = INCBIN_U32("data/tilesets/primary/secret_base/tiles.4bpp"); const u32 gTilesetTiles_UnknownSecretBase[] = INCBIN_U32("data/tilesets/primary/secret_base/unknown_tiles.4bpp"); -const u16 gTilesetPalettes_SecretBase[][16] = +const u16 ALIGNED(4) gTilesetPalettes_SecretBase[][16] = { INCBIN_U16("data/tilesets/primary/secret_base/palettes/00.gbapal"), INCBIN_U16("data/tilesets/primary/secret_base/palettes/01.gbapal"), @@ -1263,7 +1263,7 @@ const u16 gTilesetPalettes_SecretBase[][16] = const u32 gTilesetTiles_EliteFour[] = INCBIN_U32("data/tilesets/secondary/elite_four/tiles.4bpp.lz"); -const u16 gTilesetPalettes_EliteFour[][16] = +const u16 ALIGNED(4) gTilesetPalettes_EliteFour[][16] = { INCBIN_U16("data/tilesets/secondary/elite_four/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/elite_four/palettes/01.gbapal"), @@ -1285,7 +1285,7 @@ const u16 gTilesetPalettes_EliteFour[][16] = const u32 gTilesetTiles_BattleFrontier[] = INCBIN_U32("data/tilesets/secondary/battle_frontier/tiles.4bpp.lz"); -const u16 gTilesetPalettes_BattleFrontier[][16] = +const u16 ALIGNED(4) gTilesetPalettes_BattleFrontier[][16] = { INCBIN_U16("data/tilesets/secondary/battle_frontier/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/battle_frontier/palettes/01.gbapal"), @@ -1307,7 +1307,7 @@ const u16 gTilesetPalettes_BattleFrontier[][16] = const u32 gTilesetTiles_BattlePalace[] = INCBIN_U32("data/tilesets/secondary/battle_palace/tiles.4bpp.lz"); -const u16 gTilesetPalettes_BattlePalace[][16] = +const u16 ALIGNED(4) gTilesetPalettes_BattlePalace[][16] = { INCBIN_U16("data/tilesets/secondary/battle_palace/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/battle_palace/palettes/01.gbapal"), @@ -1329,7 +1329,7 @@ const u16 gTilesetPalettes_BattlePalace[][16] = const u32 gTilesetTiles_BattleDome[] = INCBIN_U32("data/tilesets/secondary/battle_dome/tiles.4bpp.lz"); -const u16 gTilesetPalettes_BattleDome[][16] = +const u16 ALIGNED(4) gTilesetPalettes_BattleDome[][16] = { INCBIN_U16("data/tilesets/secondary/battle_dome/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/battle_dome/palettes/01.gbapal"), @@ -1351,7 +1351,7 @@ const u16 gTilesetPalettes_BattleDome[][16] = const u32 gTilesetTiles_BattleFactory[] = INCBIN_U32("data/tilesets/secondary/battle_factory/tiles.4bpp.lz"); -const u16 gTilesetPalettes_BattleFactory[][16] = +const u16 ALIGNED(4) gTilesetPalettes_BattleFactory[][16] = { INCBIN_U16("data/tilesets/secondary/battle_factory/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/battle_factory/palettes/01.gbapal"), @@ -1373,7 +1373,7 @@ const u16 gTilesetPalettes_BattleFactory[][16] = const u32 gTilesetTiles_BattlePike[] = INCBIN_U32("data/tilesets/secondary/battle_pike/tiles.4bpp.lz"); -const u16 gTilesetPalettes_BattlePike[][16] = +const u16 ALIGNED(4) gTilesetPalettes_BattlePike[][16] = { INCBIN_U16("data/tilesets/secondary/battle_pike/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/battle_pike/palettes/01.gbapal"), @@ -1395,7 +1395,7 @@ const u16 gTilesetPalettes_BattlePike[][16] = const u32 gTilesetTiles_BattleArena[] = INCBIN_U32("data/tilesets/secondary/battle_arena/tiles.4bpp.lz"); -const u16 gTilesetPalettes_BattleArena[][16] = +const u16 ALIGNED(4) gTilesetPalettes_BattleArena[][16] = { INCBIN_U16("data/tilesets/secondary/battle_arena/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/battle_arena/palettes/01.gbapal"), @@ -1417,7 +1417,7 @@ const u16 gTilesetPalettes_BattleArena[][16] = const u32 gTilesetTiles_BattlePyramid[] = INCBIN_U32("data/tilesets/secondary/battle_pyramid/tiles.4bpp.lz"); -const u16 gTilesetPalettes_BattlePyramid[][16] = +const u16 ALIGNED(4) gTilesetPalettes_BattlePyramid[][16] = { INCBIN_U16("data/tilesets/secondary/battle_pyramid/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/battle_pyramid/palettes/01.gbapal"), @@ -1439,7 +1439,7 @@ const u16 gTilesetPalettes_BattlePyramid[][16] = const u32 gTilesetTiles_MirageTower[] = INCBIN_U32("data/tilesets/secondary/mirage_tower/tiles.4bpp.lz"); -const u16 gTilesetPalettes_MirageTower[][16] = +const u16 ALIGNED(4) gTilesetPalettes_MirageTower[][16] = { INCBIN_U16("data/tilesets/secondary/mirage_tower/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/mirage_tower/palettes/01.gbapal"), @@ -1461,7 +1461,7 @@ const u16 gTilesetPalettes_MirageTower[][16] = const u32 gTilesetTiles_MossdeepGameCorner[] = INCBIN_U32("data/tilesets/secondary/mossdeep_game_corner/tiles.4bpp.lz"); -const u16 gTilesetPalettes_MossdeepGameCorner[][16] = +const u16 ALIGNED(4) gTilesetPalettes_MossdeepGameCorner[][16] = { INCBIN_U16("data/tilesets/secondary/mossdeep_game_corner/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/mossdeep_game_corner/palettes/01.gbapal"), @@ -1483,7 +1483,7 @@ const u16 gTilesetPalettes_MossdeepGameCorner[][16] = const u32 gTilesetTiles_IslandHarbor[] = INCBIN_U32("data/tilesets/secondary/island_harbor/tiles.4bpp.lz"); -const u16 gTilesetPalettes_IslandHarbor[][16] = +const u16 ALIGNED(4) gTilesetPalettes_IslandHarbor[][16] = { INCBIN_U16("data/tilesets/secondary/island_harbor/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/island_harbor/palettes/01.gbapal"), @@ -1505,7 +1505,7 @@ const u16 gTilesetPalettes_IslandHarbor[][16] = const u32 gTilesetTiles_TrainerHill[] = INCBIN_U32("data/tilesets/secondary/trainer_hill/tiles.4bpp.lz"); -const u16 gTilesetPalettes_TrainerHill[][16] = +const u16 ALIGNED(4) gTilesetPalettes_TrainerHill[][16] = { INCBIN_U16("data/tilesets/secondary/trainer_hill/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/trainer_hill/palettes/01.gbapal"), @@ -1527,7 +1527,7 @@ const u16 gTilesetPalettes_TrainerHill[][16] = const u32 gTilesetTiles_NavelRock[] = INCBIN_U32("data/tilesets/secondary/navel_rock/tiles.4bpp.lz"); -const u16 gTilesetPalettes_NavelRock[][16] = +const u16 ALIGNED(4) gTilesetPalettes_NavelRock[][16] = { INCBIN_U16("data/tilesets/secondary/navel_rock/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/navel_rock/palettes/01.gbapal"), @@ -1549,7 +1549,7 @@ const u16 gTilesetPalettes_NavelRock[][16] = const u32 gTilesetTiles_BattleFrontierRankingHall[] = INCBIN_U32("data/tilesets/secondary/battle_frontier_ranking_hall/tiles.4bpp.lz"); -const u16 gTilesetPalettes_BattleFrontierRankingHall[][16] = +const u16 ALIGNED(4) gTilesetPalettes_BattleFrontierRankingHall[][16] = { INCBIN_U16("data/tilesets/secondary/battle_frontier_ranking_hall/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/battle_frontier_ranking_hall/palettes/01.gbapal"), @@ -1571,7 +1571,7 @@ const u16 gTilesetPalettes_BattleFrontierRankingHall[][16] = const u32 gTilesetTiles_BattleTent[] = INCBIN_U32("data/tilesets/secondary/battle_tent/tiles.4bpp.lz"); -const u16 gTilesetPalettes_BattleTent[][16] = +const u16 ALIGNED(4) gTilesetPalettes_BattleTent[][16] = { INCBIN_U16("data/tilesets/secondary/battle_tent/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/battle_tent/palettes/01.gbapal"), @@ -1593,7 +1593,7 @@ const u16 gTilesetPalettes_BattleTent[][16] = const u32 gTilesetTiles_MysteryEventsHouse[] = INCBIN_U32("data/tilesets/secondary/mystery_events_house/tiles.4bpp.lz"); -const u16 gTilesetPalettes_MysteryEventsHouse[][16] = +const u16 ALIGNED(4) gTilesetPalettes_MysteryEventsHouse[][16] = { INCBIN_U16("data/tilesets/secondary/mystery_events_house/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/mystery_events_house/palettes/01.gbapal"), @@ -1613,7 +1613,7 @@ const u16 gTilesetPalettes_MysteryEventsHouse[][16] = INCBIN_U16("data/tilesets/secondary/mystery_events_house/palettes/15.gbapal"), }; -const u16 gTilesetPalettes_UnionRoom[][16] = +const u16 ALIGNED(4) gTilesetPalettes_UnionRoom[][16] = { INCBIN_U16("data/tilesets/secondary/union_room/palettes/00.gbapal"), INCBIN_U16("data/tilesets/secondary/union_room/palettes/01.gbapal"), diff --git a/src/graphics.c b/src/graphics.c index 8a6bbc88a642..0913aeece0c6 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -1437,7 +1437,7 @@ const u32 gUnionRoomChat_Border_Gfx[] = INCBIN_U32("graphics/union_room_chat/bor const u32 gUnionRoomChat_Border_Tilemap[] = INCBIN_U32("graphics/union_room_chat/border.bin.lz"); const u32 gUnionRoomChat_RButtonLabels[] = INCBIN_U32("graphics/union_room_chat/r_button_labels.4bpp.lz"); -const u16 gTilesetPalettes_General[][16] = +const u16 ALIGNED(4) gTilesetPalettes_General[][16] = { INCBIN_U16("data/tilesets/primary/general/palettes/00.gbapal"), INCBIN_U16("data/tilesets/primary/general/palettes/01.gbapal"), diff --git a/src/palette.c b/src/palette.c index 60635a5d5347..d2a8476ddeb3 100644 --- a/src/palette.c +++ b/src/palette.c @@ -98,6 +98,8 @@ void LoadPalette(const void *src, u16 offset, u16 size) // Drop in replacement for LoadPalette, uses CpuFastCopy, size must be 0 % 32 void LoadPaletteFast(const void *src, u16 offset, u16 size) { + if ((u32)src & 3) // In case palette is not 4 byte aligned + return LoadPalette(src, offset, size); CpuFastCopy(src, &gPlttBufferUnfaded[offset], size); // Copying from EWRAM->EWRAM is faster than ROM->EWRAM CpuFastCopy(&gPlttBufferUnfaded[offset], &gPlttBufferFaded[offset], size); From 6fe4ce05e15a6a30618fd9a9aa06ce1ec53c6055 Mon Sep 17 00:00:00 2001 From: Ariel A <24759293+aarant@users.noreply.github.com> Date: Sat, 4 Feb 2023 19:25:49 -0500 Subject: [PATCH 076/104] Added lighting to Sootopolis lava. --- data/tilesets/secondary/sootopolis/palettes/10.pal | 4 ++-- src/data/tilesets/headers.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/data/tilesets/secondary/sootopolis/palettes/10.pal b/data/tilesets/secondary/sootopolis/palettes/10.pal index 6ca963250f82..46457797ed95 100644 --- a/data/tilesets/secondary/sootopolis/palettes/10.pal +++ b/data/tilesets/secondary/sootopolis/palettes/10.pal @@ -1,7 +1,7 @@ JASC-PAL 0100 16 -115 197 164 +0 230 25 139 115 106 115 90 82 90 65 65 @@ -16,4 +16,4 @@ JASC-PAL 148 74 41 82 139 197 74 115 172 -0 0 0 +246 74 65 diff --git a/src/data/tilesets/headers.h b/src/data/tilesets/headers.h index 0e8d4dca90d4..d204bb45cf1d 100644 --- a/src/data/tilesets/headers.h +++ b/src/data/tilesets/headers.h @@ -174,8 +174,8 @@ const struct Tileset gTileset_Sootopolis = .isCompressed = TRUE, .swapPalettes = SWAP_PAL(6), .isSecondary = TRUE, - .lightPalettes = LIGHT_PAL(6), - .customLightColor = LIGHT_PAL(6), + .lightPalettes = LIGHT_PAL(6) | LIGHT_PAL(10), + .customLightColor = LIGHT_PAL(6) | LIGHT_PAL(10), .tiles = gTilesetTiles_Sootopolis, .palettes = gTilesetPalettes_Sootopolis, .metatiles = gMetatiles_Sootopolis, From 9fd7542629e0ae8f8a7426298608ffcf95600fea Mon Sep 17 00:00:00 2001 From: Ariel A <24759293+aarant@users.noreply.github.com> Date: Thu, 9 Feb 2023 00:15:18 -0500 Subject: [PATCH 077/104] Fixed nighttime WEATHER_DOWNPOUR gamma shift. --- src/field_weather.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/field_weather.c b/src/field_weather.c index 4f9b72ea7511..a875b7ec3910 100644 --- a/src/field_weather.c +++ b/src/field_weather.c @@ -483,7 +483,7 @@ static void ApplyColorMap(u8 startPalIndex, u8 numPalettes, s8 colorMapIndex) palOffset = startPalIndex * 16; UpdateAltBgPalettes(palettes & PALETTES_BG); // Thunder gamma-shift looks bad on night-blended palettes, so ignore time blending in some situations - if (!(colorMapIndex > 3 && gWeatherPtr->currWeather == WEATHER_RAIN_THUNDERSTORM) && MapHasNaturalLight(gMapHeader.mapType)) + if (!(colorMapIndex > 3) && MapHasNaturalLight(gMapHeader.mapType)) UpdatePalettesWithTime(palettes); else CpuFastCopy(gPlttBufferUnfaded + palOffset, gPlttBufferFaded + palOffset, 32 * numPalettes); From 3b3e45cff7f666f44fa06279b13fb26fadcf1217 Mon Sep 17 00:00:00 2001 From: Ariel A <24759293+aarant@users.noreply.github.com> Date: Fri, 10 Feb 2023 21:31:10 -0500 Subject: [PATCH 078/104] Fixed shadow positioning bug in some battle facilities. --- data/maps/BattleFrontier_BattleDomeBattleRoom/scripts.inc | 1 + data/maps/SlateportCity_BattleTentBattleRoom/scripts.inc | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/data/maps/BattleFrontier_BattleDomeBattleRoom/scripts.inc b/data/maps/BattleFrontier_BattleDomeBattleRoom/scripts.inc index 31314b598273..cdd08fc77774 100644 --- a/data/maps/BattleFrontier_BattleDomeBattleRoom/scripts.inc +++ b/data/maps/BattleFrontier_BattleDomeBattleRoom/scripts.inc @@ -476,6 +476,7 @@ BattleFrontier_BattleDomeBattleRoom_EventScript_SetUpObjects:: call BattleFrontier_EventScript_SetBrainObjectGfx setobjectxyperm LOCALID_OPPONENT, 13, 9 removeobject LOCALID_OPPONENT + delay 1 addobject LOCALID_OPPONENT applymovement LOCALID_OPPONENT, BattleFrontier_BattleDomeBattleRoom_Movement_SetInvisibleFacingUp BattleFrontier_BattleDomeBattleRoom_EventScript_EndSetUpObjects:: diff --git a/data/maps/SlateportCity_BattleTentBattleRoom/scripts.inc b/data/maps/SlateportCity_BattleTentBattleRoom/scripts.inc index 53514bb5e95d..fd6567cb654d 100644 --- a/data/maps/SlateportCity_BattleTentBattleRoom/scripts.inc +++ b/data/maps/SlateportCity_BattleTentBattleRoom/scripts.inc @@ -48,6 +48,7 @@ SlateportCity_BattleTentBattleRoom_EventScript_EnterRoom:: factory_setopponentgfx setobjectxyperm LOCALID_OPPONENT, 5, 1 removeobject LOCALID_OPPONENT + delay 1 addobject LOCALID_OPPONENT applymovement LOCALID_OPPONENT, SlateportCity_BattleTentBattleRoom_Movement_OpponentEnter waitmovement 0 @@ -102,4 +103,3 @@ SlateportCity_BattleTentBattleRoom_Movement_OpponentEnter: walk_down walk_in_place_faster_left step_end - From 07995f8925f2c81522b390b5e86228d1e4f73b51 Mon Sep 17 00:00:00 2001 From: Ariel A <24759293+aarant@users.noreply.github.com> Date: Tue, 7 Mar 2023 20:39:41 -0500 Subject: [PATCH 079/104] Fixed some decoration icons being darkened at night in outdoor shops. --- include/event_object_movement.h | 1 + src/decoration.c | 2 +- src/event_object_movement.c | 28 +++++++++++++++++++++++++--- src/shop.c | 2 +- 4 files changed, 28 insertions(+), 5 deletions(-) diff --git a/include/event_object_movement.h b/include/event_object_movement.h index 4a4904f62611..683160820ae4 100644 --- a/include/event_object_movement.h +++ b/include/event_object_movement.h @@ -131,6 +131,7 @@ struct ObjectEvent * GetFollowerObject(void); u8 GetDirectionToFace(s16, s16, s16, s16); void UpdateLightSprite(struct Sprite *); void TrySpawnObjectEvents(s16 cameraX, s16 cameraY); +u8 CreateObjectGraphicsSpriteWithTag(u16 graphicsId, void (*callback)(struct Sprite *), s16 x, s16 y, u8 subpriority, u16 paletteTag); u8 CreateObjectGraphicsSprite(u16, void (*)(struct Sprite *), s16 x, s16 y, u8 subpriority); u8 TrySpawnObjectEvent(u8 localId, u8 mapNum, u8 mapGroup); u8 SpawnSpecialObjectEventParameterized(u8 graphicsId, u8 movementBehavior, u8 localId, s16 x, s16 y, u8 elevation); diff --git a/src/decoration.c b/src/decoration.c index 6d95cfbdc307..d33ded155f90 100644 --- a/src/decoration.c +++ b/src/decoration.c @@ -2110,7 +2110,7 @@ static u8 AddDecorationIconObjectFromObjectEvent(u16 tilesTag, u16 paletteTag, u } else { - spriteId = CreateObjectGraphicsSprite(sPlaceDecorationGraphicsDataBuffer.decoration->tiles[0], SpriteCallbackDummy, 0, 0, 1); + spriteId = CreateObjectGraphicsSpriteWithTag(sPlaceDecorationGraphicsDataBuffer.decoration->tiles[0], SpriteCallbackDummy, 0, 0, 1, paletteTag); } return spriteId; } diff --git a/src/event_object_movement.c b/src/event_object_movement.c index 49523559ddf7..6d956d1da58e 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -1607,8 +1607,20 @@ static void MakeSpriteTemplateFromObjectEventTemplate(struct ObjectEventTemplate CopyObjectGraphicsInfoToSpriteTemplate_WithMovementType(objectEventTemplate->graphicsId, objectEventTemplate->movementType, spriteTemplate, subspriteTables); } +// Like LoadObjectEventPalette, but overwrites the palette tag that is loaded +static u8 LoadObjectEventPaletteWithTag(u16 paletteTag, u16 overTag) { + u32 i = FindObjectEventPaletteIndexByTag(paletteTag); + struct SpritePalette spritePalette; + if (i == 0xFF) + return i; + spritePalette = sObjectEventSpritePalettes[i]; + if (overTag != TAG_NONE) + spritePalette.tag = overTag; // overwrite palette tag + return LoadSpritePaletteIfTagExists(&spritePalette); +} + // Used to create a sprite using a graphicsId associated with object events. -u8 CreateObjectGraphicsSprite(u16 graphicsId, void (*callback)(struct Sprite *), s16 x, s16 y, u8 subpriority) +u8 CreateObjectGraphicsSpriteWithTag(u16 graphicsId, void (*callback)(struct Sprite *), s16 x, s16 y, u8 subpriority, u16 paletteTag) { struct SpriteTemplate *spriteTemplate; const struct SubspriteTable *subspriteTables; @@ -1637,8 +1649,14 @@ u8 CreateObjectGraphicsSprite(u16 graphicsId, void (*callback)(struct Sprite *), const struct CompressedSpritePalette *spritePalette = &(shiny ? gMonShinyPaletteTable : gMonPaletteTable)[species]; paletteNum = LoadDynamicFollowerPalette(species, form, shiny); spriteTemplate->paletteTag = spritePalette->tag; - } else if (spriteTemplate->paletteTag != TAG_NONE) - LoadObjectEventPalette(spriteTemplate->paletteTag); + } else if (spriteTemplate->paletteTag != TAG_NONE) { + if (paletteTag == TAG_NONE) + LoadObjectEventPalette(spriteTemplate->paletteTag); + else { + LoadObjectEventPaletteWithTag(spriteTemplate->paletteTag, paletteTag); + spriteTemplate->paletteTag = paletteTag; + } + } spriteId = CreateSprite(spriteTemplate, x, y, subpriority); Free(spriteTemplate); @@ -1652,6 +1670,10 @@ u8 CreateObjectGraphicsSprite(u16 graphicsId, void (*callback)(struct Sprite *), return spriteId; } +u8 CreateObjectGraphicsSprite(u16 graphicsId, void (*callback)(struct Sprite *), s16 x, s16 y, u8 subpriority) { + return CreateObjectGraphicsSpriteWithTag(graphicsId, callback, x, y, subpriority, TAG_NONE); +} + #define sVirtualObjId data[0] #define sVirtualObjElev data[1] diff --git a/src/shop.c b/src/shop.c index 222ee181b7a7..23699f07ba32 100644 --- a/src/shop.c +++ b/src/shop.c @@ -41,7 +41,7 @@ #include "constants/songs.h" #define TAG_SCROLL_ARROW 2100 -#define TAG_ITEM_ICON_BASE 2110 +#define TAG_ITEM_ICON_BASE 9110 // immune to time blending #define MAX_ITEMS_SHOWN 8 From 6b2e49ffbc2a5c8b0edfdb5983ad1365c6b54d5b Mon Sep 17 00:00:00 2001 From: Ariel A <24759293+aarant@users.noreply.github.com> Date: Sat, 11 Mar 2023 16:16:51 -0500 Subject: [PATCH 080/104] Updated Ever Grande window lights. --- .../secondary/ever_grande/palettes/01.pal | 24 +++++++++---------- .../secondary/ever_grande/palettes/08.pal | 2 +- src/data/tilesets/headers.h | 2 ++ 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/data/tilesets/secondary/ever_grande/palettes/01.pal b/data/tilesets/secondary/ever_grande/palettes/01.pal index 3c6e40c2e9cd..2c02767613f1 100644 --- a/data/tilesets/secondary/ever_grande/palettes/01.pal +++ b/data/tilesets/secondary/ever_grande/palettes/01.pal @@ -1,19 +1,19 @@ JASC-PAL 0100 16 -24 41 82 -255 255 255 -222 230 238 -189 205 230 -156 180 222 +0 197 0 +246 197 123 +238 156 90 +205 115 41 +164 90 49 131 131 139 98 98 123 65 74 106 41 49 90 -115 189 246 -98 172 238 -255 189 131 -238 148 115 -222 106 98 -205 65 82 -115 197 164 +224 226 171 +216 200 152 +255 255 238 +222 222 197 +197 197 164 +164 172 123 +255 255 115 diff --git a/data/tilesets/secondary/ever_grande/palettes/08.pal b/data/tilesets/secondary/ever_grande/palettes/08.pal index 083dd5080a4e..67b9146fd084 100644 --- a/data/tilesets/secondary/ever_grande/palettes/08.pal +++ b/data/tilesets/secondary/ever_grande/palettes/08.pal @@ -1,7 +1,7 @@ JASC-PAL 0100 16 -24 41 82 +0 197 0 246 197 123 238 156 90 205 115 41 diff --git a/src/data/tilesets/headers.h b/src/data/tilesets/headers.h index d204bb45cf1d..8a7907c6c8d8 100644 --- a/src/data/tilesets/headers.h +++ b/src/data/tilesets/headers.h @@ -154,6 +154,8 @@ const struct Tileset gTileset_EverGrande = .metatiles = gMetatiles_EverGrande, .metatileAttributes = gMetatileAttributes_EverGrande, .callback = InitTilesetAnim_EverGrande, + .lightPalettes = LIGHT_PAL(8), + .swapPalettes = SWAP_PAL(8), }; const struct Tileset gTileset_Pacifidlog = From 095994dc96666f3d9d6866339c6fcef191d35ea2 Mon Sep 17 00:00:00 2001 From: Ariel A <24759293+aarant@users.noreply.github.com> Date: Sun, 16 Apr 2023 20:07:41 -0400 Subject: [PATCH 081/104] Fixed gamma shift for special sprite palette tags (lights, emotes). Supersedes c82510e22bffb98fd9c63dc246c332dd1da602cd --- src/field_weather.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/field_weather.c b/src/field_weather.c index a875b7ec3910..92673a35bbf0 100644 --- a/src/field_weather.c +++ b/src/field_weather.c @@ -493,7 +493,9 @@ static void ApplyColorMap(u8 startPalIndex, u8 numPalettes, s8 colorMapIndex) // Loop through the specified palette range and apply necessary color maps. while (curPalIndex < numPalettes) { - if (sPaletteColorMapTypes[curPalIndex] == COLOR_MAP_NONE) + // don't blend special palettes immune to blending + if (sPaletteColorMapTypes[curPalIndex] == COLOR_MAP_NONE || + (curPalIndex >= 16 && GetSpritePaletteTagByPaletteNum(curPalIndex - 16) >> 15)) { // No palette change. palOffset += 16; @@ -502,10 +504,7 @@ static void ApplyColorMap(u8 startPalIndex, u8 numPalettes, s8 colorMapIndex) { u8 r, g, b; - // don't blend special sprite palette tags - if (sPaletteColorMapTypes[curPalIndex] == COLOR_MAP_CONTRAST || - (curPalIndex >= 16 && (curPalIndex - 16 == gWeatherPtr->contrastColorMapSpritePalIndex || - GetSpritePaletteTagByPaletteNum(curPalIndex - 16) >> 15))) + if (sPaletteColorMapTypes[curPalIndex] == COLOR_MAP_CONTRAST || curPalIndex - 16 == gWeatherPtr->contrastColorMapSpritePalIndex) colorMap = gWeatherPtr->contrastColorMaps[colorMapIndex]; else colorMap = gWeatherPtr->darkenedContrastColorMaps[colorMapIndex]; From 159faf8ff424941f70de810b621accb11bb5fefc Mon Sep 17 00:00:00 2001 From: Ariel A <24759293+aarant@users.noreply.github.com> Date: Sun, 23 Apr 2023 00:35:52 -0400 Subject: [PATCH 082/104] Fixed tall grass field effect discoloration in fog. Improved/optimized fog blending during fades. --- src/field_effect.c | 2 +- src/field_weather.c | 81 ++++++++++++++++----------------------------- 2 files changed, 29 insertions(+), 54 deletions(-) diff --git a/src/field_effect.c b/src/field_effect.c index 6fd17aa73d7e..b120449ec6a6 100644 --- a/src/field_effect.c +++ b/src/field_effect.c @@ -782,7 +782,7 @@ void FieldEffectScript_LoadFadedPalette(u8 **script) { struct SpritePalette *palette = (struct SpritePalette *)FieldEffectScript_ReadWord(script); LoadSpritePalette(palette); - UpdateSpritePaletteWithWeather(IndexOfSpritePaletteTag(palette->tag), FALSE); + UpdateSpritePaletteWithWeather(IndexOfSpritePaletteTag(palette->tag), TRUE); (*script) += 4; } diff --git a/src/field_weather.c b/src/field_weather.c index 92673a35bbf0..9ed5c0c7462d 100644 --- a/src/field_weather.c +++ b/src/field_weather.c @@ -672,56 +672,27 @@ static void ApplyDroughtColorMapWithBlend(s8 colorMapIndex, u8 blendCoeff, u16 b } } -static void ApplyFogBlend(u8 blendCoeff, u16 blendColor) // TODO: Optimize this with time blending +// This is only called during fade-in/fade-out in fog +// blendCoeff & blendColor are the *fade* colors, not fog colors +static void ApplyFogBlend(u8 blendCoeff, u16 blendColor) { - struct RGBColor color; - u8 rBlend; - u8 gBlend; - u8 bBlend; - u16 curPalIndex; + u32 curPalIndex; + u16 fogCoeff = min((gTimeOfDay + 1) * 4, 12); // First blend all palettes with time UpdateAltBgPalettes(PALETTES_BG); - CpuFastCopy(gPlttBufferUnfaded, gPlttBufferFaded, 0x400); + CpuFastCopy(gPlttBufferUnfaded, gPlttBufferFaded, PLTT_BUFFER_SIZE * 2); UpdatePalettesWithTime(PALETTES_ALL); - // Then blend tile palettes [0, 12] faded->faded + // Then blend tile palettes [0, 12] faded->faded with fadeIn color BlendPalettesFine(0x1FFF, gPlttBufferFaded, gPlttBufferFaded, blendCoeff, blendColor); - color = *(struct RGBColor *)&blendColor; - rBlend = color.r; - gBlend = color.g; - bBlend = color.b; - for (curPalIndex = 16; curPalIndex < 32; curPalIndex++) - { + // Do fog blending on marked sprite palettes + for (curPalIndex = 16; curPalIndex < 32; curPalIndex++) { if (LightenSpritePaletteInFog(curPalIndex)) - { - u16 palEnd = (curPalIndex + 1) * 16; - u16 palOffset = curPalIndex * 16; - - while (palOffset < palEnd) - { - struct RGBColor color = *(struct RGBColor *)&gPlttBufferFaded[palOffset]; - u8 r = color.r; - u8 g = color.g; - u8 b = color.b; - - r += ((28 - r) * 3) >> 2; - g += ((31 - g) * 3) >> 2; - b += ((28 - b) * 3) >> 2; - - r += ((rBlend - r) * blendCoeff) >> 4; - g += ((gBlend - g) * blendCoeff) >> 4; - b += ((bBlend - b) * blendCoeff) >> 4; - - gPlttBufferFaded[palOffset] = RGB2(r, g, b); - palOffset++; - } - } - else - { - BlendPalettesFine(1, gPlttBufferFaded + curPalIndex * 16, gPlttBufferFaded + curPalIndex * 16, blendCoeff, blendColor); - } + BlendPalettesFine(1, gPlttBufferFaded + PLTT_ID(curPalIndex), gPlttBufferFaded + PLTT_ID(curPalIndex), fogCoeff, RGB(28, 31, 28)); } + // Finally blend all sprite palettes faded->faded with fadeIn color + BlendPalettesFine(PALETTES_OBJECTS, gPlttBufferFaded, gPlttBufferFaded, blendCoeff, blendColor); } static void MarkFogSpritePalToLighten(u8 paletteIndex) @@ -737,6 +708,9 @@ static bool8 LightenSpritePaletteInFog(u8 paletteIndex) { u16 i; + if (paletteIndex >= 16 && (GetSpritePaletteTagByPaletteNum(i - 16) >> 15)) // don't blend specialpalette tags + return FALSE; + for (i = 0; i < gWeatherPtr->lightenedFogSpritePalsCount; i++) { if (gWeatherPtr->lightenedFogSpritePals[i] == paletteIndex) @@ -879,20 +853,21 @@ void UpdateSpritePaletteWithWeather(u8 spritePaletteIndex, bool8 allowFog) default: if (gWeatherPtr->currWeather != WEATHER_FOG_HORIZONTAL) { if (gWeatherPtr->colorMapIndex) - ApplyColorMap(paletteIndex, 1, gWeatherPtr->colorMapIndex); + ApplyColorMap(paletteIndex, 1, gWeatherPtr->colorMapIndex); else - UpdateSpritePaletteWithTime(spritePaletteIndex); + UpdateSpritePaletteWithTime(spritePaletteIndex); } else { // In horizontal fog, only specific palettes should be fog-blended - if (allowFog) { - paletteIndex = PLTT_ID(paletteIndex); - // First blend with time - CpuFastCopy(gPlttBufferUnfaded + paletteIndex, gPlttBufferFaded + paletteIndex, 32); - UpdateSpritePaletteWithTime(spritePaletteIndex); - // Then blend faded->faded - BlendPalettesFine(1 << (spritePaletteIndex + 16), gPlttBufferFaded + paletteIndex, gPlttBufferFaded + paletteIndex, 12, RGB(28, 31, 28)); - } else { // Otherwise, just time-blend the palette - UpdateSpritePaletteWithTime(spritePaletteIndex); - } + if (allowFog) { + i = min((gTimeOfDay + 1) * 4, 12); // fog coeff, highest in day and lowest at night + paletteIndex = PLTT_ID(paletteIndex); + // First blend with time + CpuFastCopy(gPlttBufferUnfaded + paletteIndex, gPlttBufferFaded + paletteIndex, PLTT_SIZE_4BPP); + UpdateSpritePaletteWithTime(spritePaletteIndex); + // Then blend faded->faded with fog coeff + BlendPalettesFine(1, gPlttBufferFaded + paletteIndex, gPlttBufferFaded + paletteIndex, i, RGB(28, 31, 28)); + } else { // Otherwise, just time-blend the palette + UpdateSpritePaletteWithTime(spritePaletteIndex); + } } break; } From 91794286b51c7ae3dfe8e8c453a25cc008055b6b Mon Sep 17 00:00:00 2001 From: Ariel A <24759293+aarant@users.noreply.github.com> Date: Thu, 8 Jun 2023 20:49:18 -0400 Subject: [PATCH 083/104] Improved light color blending logic. Added auxiliary .pla files to gbafx, to support setting color high bits. Updated light palettes to new system. --- README.md | 17 + data/tilesets/primary/general/palettes/04.pal | 2 +- data/tilesets/primary/general/palettes/04.pla | 6 + .../secondary/ever_grande/palettes/08.pal | 2 +- .../secondary/ever_grande/palettes/08.pla | 3 + .../secondary/fallarbor/palettes/07.pal | 2 +- .../secondary/fallarbor/palettes/07.pla | 3 + .../secondary/fortree/palettes/08.pal | 2 +- .../secondary/fortree/palettes/08.pla | 6 + .../secondary/lavaridge/palettes/06.pal | 2 +- .../secondary/lavaridge/palettes/06.pla | 7 + .../secondary/lilycove/palettes/06.pal | 2 +- .../secondary/lilycove/palettes/06.pla | 6 + .../secondary/mauville/palettes/07.pal | 2 +- .../secondary/mauville/palettes/07.pla | 3 + .../secondary/mauville/palettes/10.pal | 2 +- .../secondary/mauville/palettes/10.pla | 4 + .../secondary/mauville/palettes/11.pal | 2 +- .../secondary/mauville/palettes/11.pla | 3 + .../secondary/mossdeep/palettes/08.pal | 2 +- .../secondary/mossdeep/palettes/08.pla | 3 + .../secondary/pacifidlog/palettes/09.pal | 2 +- .../secondary/pacifidlog/palettes/09.pla | 2 + .../secondary/petalburg/palettes/06.pal | 2 +- .../secondary/petalburg/palettes/06.pla | 3 + .../secondary/petalburg/palettes/07.pal | 2 +- .../secondary/petalburg/palettes/07.pla | 3 + .../secondary/petalburg/palettes/09.pal | 2 +- .../secondary/petalburg/palettes/09.pla | 3 + .../secondary/rustboro/palettes/06.pal | 2 +- .../secondary/rustboro/palettes/06.pla | 7 + .../secondary/slateport/palettes/06.pal | 2 +- .../secondary/slateport/palettes/06.pla | 2 + .../secondary/slateport/palettes/12.pal | 2 +- .../secondary/slateport/palettes/12.pla | 6 + .../secondary/sootopolis/palettes/06.pal | 2 +- .../secondary/sootopolis/palettes/06.pla | 5 + .../secondary/sootopolis/palettes/10.pal | 2 +- .../secondary/sootopolis/palettes/10.pla | 8 + graphics/pokemon/ampharos/normal.pal | 4 +- graphics/pokemon/ampharos/normal.pla | 7 + graphics/pokemon/ampharos/shiny.pal | 4 +- graphics/pokemon/ampharos/shiny.pla | 7 + src/data/tilesets/headers.h | 23 +- src/event_object_movement.c | 13 +- src/fieldmap.c | 17 +- src/palette.c | 382 +++++++++--------- tools/gbagfx/gfx.c | 4 +- tools/gbagfx/gfx.h | 1 + tools/gbagfx/jasc_pal.c | 39 +- tools/gbagfx/main.c | 8 +- 51 files changed, 388 insertions(+), 259 deletions(-) create mode 100644 data/tilesets/primary/general/palettes/04.pla create mode 100644 data/tilesets/secondary/ever_grande/palettes/08.pla create mode 100644 data/tilesets/secondary/fallarbor/palettes/07.pla create mode 100644 data/tilesets/secondary/fortree/palettes/08.pla create mode 100644 data/tilesets/secondary/lavaridge/palettes/06.pla create mode 100644 data/tilesets/secondary/lilycove/palettes/06.pla create mode 100644 data/tilesets/secondary/mauville/palettes/07.pla create mode 100644 data/tilesets/secondary/mauville/palettes/10.pla create mode 100644 data/tilesets/secondary/mauville/palettes/11.pla create mode 100644 data/tilesets/secondary/mossdeep/palettes/08.pla create mode 100644 data/tilesets/secondary/pacifidlog/palettes/09.pla create mode 100644 data/tilesets/secondary/petalburg/palettes/06.pla create mode 100644 data/tilesets/secondary/petalburg/palettes/07.pla create mode 100644 data/tilesets/secondary/petalburg/palettes/09.pla create mode 100644 data/tilesets/secondary/rustboro/palettes/06.pla create mode 100644 data/tilesets/secondary/slateport/palettes/06.pla create mode 100644 data/tilesets/secondary/slateport/palettes/12.pla create mode 100644 data/tilesets/secondary/sootopolis/palettes/06.pla create mode 100644 data/tilesets/secondary/sootopolis/palettes/10.pla create mode 100644 graphics/pokemon/ampharos/normal.pla create mode 100644 graphics/pokemon/ampharos/shiny.pla diff --git a/README.md b/README.md index 893678a2dcd2..00cdde2992ec 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,23 @@ Additional branches to mention: To set up the repository, see [INSTALL.md](INSTALL.md). +## FAQ +### Q: How do I mark certain colors in a palette as light-blended? +A: Create a `.pla` file in the same folder as the `.pal` with the same name. + +In this file you can enter color indices [0,15] +on separate lines to mark those colors as being light-blended, i.e: + +`06.pla:` +``` +# A comment +0 # if color 0 is listed, uses it to blend with instead of the default! +1 +9 +10 +``` + +You might have to `make mostlyclean` or change the `.pal` file to pick up the changes. ## See also Other disassembly and/or decompilation projects: diff --git a/data/tilesets/primary/general/palettes/04.pal b/data/tilesets/primary/general/palettes/04.pal index 57d4faa34d65..313337d6da7e 100644 --- a/data/tilesets/primary/general/palettes/04.pal +++ b/data/tilesets/primary/general/palettes/04.pal @@ -1,7 +1,7 @@ JASC-PAL 0100 16 -232 0 128 +0 0 0 216 224 232 222 230 238 184 200 224 diff --git a/data/tilesets/primary/general/palettes/04.pla b/data/tilesets/primary/general/palettes/04.pla new file mode 100644 index 000000000000..5f08f88f3543 --- /dev/null +++ b/data/tilesets/primary/general/palettes/04.pla @@ -0,0 +1,6 @@ +# Color indices to set high bit +1 +3 +4 +5 +15 \ No newline at end of file diff --git a/data/tilesets/secondary/ever_grande/palettes/08.pal b/data/tilesets/secondary/ever_grande/palettes/08.pal index 67b9146fd084..fcd13d772339 100644 --- a/data/tilesets/secondary/ever_grande/palettes/08.pal +++ b/data/tilesets/secondary/ever_grande/palettes/08.pal @@ -1,7 +1,7 @@ JASC-PAL 0100 16 -0 197 0 +0 0 0 246 197 123 238 156 90 205 115 41 diff --git a/data/tilesets/secondary/ever_grande/palettes/08.pla b/data/tilesets/secondary/ever_grande/palettes/08.pla new file mode 100644 index 000000000000..5eb702de8041 --- /dev/null +++ b/data/tilesets/secondary/ever_grande/palettes/08.pla @@ -0,0 +1,3 @@ +# Color indices to set high bit +9 +10 \ No newline at end of file diff --git a/data/tilesets/secondary/fallarbor/palettes/07.pal b/data/tilesets/secondary/fallarbor/palettes/07.pal index f3a70207315e..6cb1ea50e73b 100644 --- a/data/tilesets/secondary/fallarbor/palettes/07.pal +++ b/data/tilesets/secondary/fallarbor/palettes/07.pal @@ -1,7 +1,7 @@ JASC-PAL 0100 16 -0 192 0 +0 0 0 222 230 164 180 197 115 148 156 82 diff --git a/data/tilesets/secondary/fallarbor/palettes/07.pla b/data/tilesets/secondary/fallarbor/palettes/07.pla new file mode 100644 index 000000000000..5eb702de8041 --- /dev/null +++ b/data/tilesets/secondary/fallarbor/palettes/07.pla @@ -0,0 +1,3 @@ +# Color indices to set high bit +9 +10 \ No newline at end of file diff --git a/data/tilesets/secondary/fortree/palettes/08.pal b/data/tilesets/secondary/fortree/palettes/08.pal index 11b51b107115..1d8a56f8e78b 100644 --- a/data/tilesets/secondary/fortree/palettes/08.pal +++ b/data/tilesets/secondary/fortree/palettes/08.pal @@ -1,7 +1,7 @@ JASC-PAL 0100 16 -0 96 8 +176 184 200 255 255 255 246 238 189 230 213 172 diff --git a/data/tilesets/secondary/fortree/palettes/08.pla b/data/tilesets/secondary/fortree/palettes/08.pla new file mode 100644 index 000000000000..69488b50cbbc --- /dev/null +++ b/data/tilesets/secondary/fortree/palettes/08.pla @@ -0,0 +1,6 @@ +# Color indices to set high bit +0 +8 +9 +11 +15 \ No newline at end of file diff --git a/data/tilesets/secondary/lavaridge/palettes/06.pal b/data/tilesets/secondary/lavaridge/palettes/06.pal index a858e623d1f1..3ea0c4254218 100644 --- a/data/tilesets/secondary/lavaridge/palettes/06.pal +++ b/data/tilesets/secondary/lavaridge/palettes/06.pal @@ -1,7 +1,7 @@ JASC-PAL 0100 16 -0 192 24 +224 40 0 64 72 104 192 200 0 224 232 232 diff --git a/data/tilesets/secondary/lavaridge/palettes/06.pla b/data/tilesets/secondary/lavaridge/palettes/06.pla new file mode 100644 index 000000000000..26f59249a8a0 --- /dev/null +++ b/data/tilesets/secondary/lavaridge/palettes/06.pla @@ -0,0 +1,7 @@ +# Color indices to set high bit +0 +9 +10 +11 +12 +15 \ No newline at end of file diff --git a/data/tilesets/secondary/lilycove/palettes/06.pal b/data/tilesets/secondary/lilycove/palettes/06.pal index b612065ed972..a40ff7909ce7 100644 --- a/data/tilesets/secondary/lilycove/palettes/06.pal +++ b/data/tilesets/secondary/lilycove/palettes/06.pal @@ -1,7 +1,7 @@ JASC-PAL 0100 16 -24 200 0 +0 0 0 168 184 240 112 144 208 115 148 213 diff --git a/data/tilesets/secondary/lilycove/palettes/06.pla b/data/tilesets/secondary/lilycove/palettes/06.pla new file mode 100644 index 000000000000..77b77f073c0e --- /dev/null +++ b/data/tilesets/secondary/lilycove/palettes/06.pla @@ -0,0 +1,6 @@ +# Color indices to set high bit +1 +2 +6 +9 +10 \ No newline at end of file diff --git a/data/tilesets/secondary/mauville/palettes/07.pal b/data/tilesets/secondary/mauville/palettes/07.pal index 6f43490ad677..f3618ff7146a 100644 --- a/data/tilesets/secondary/mauville/palettes/07.pal +++ b/data/tilesets/secondary/mauville/palettes/07.pal @@ -1,7 +1,7 @@ JASC-PAL 0100 16 -8 0 128 +123 180 189 255 255 180 238 238 90 213 213 65 diff --git a/data/tilesets/secondary/mauville/palettes/07.pla b/data/tilesets/secondary/mauville/palettes/07.pla new file mode 100644 index 000000000000..5e51fe661a2a --- /dev/null +++ b/data/tilesets/secondary/mauville/palettes/07.pla @@ -0,0 +1,3 @@ +# Color indices to set high bit +1 +15 \ No newline at end of file diff --git a/data/tilesets/secondary/mauville/palettes/10.pal b/data/tilesets/secondary/mauville/palettes/10.pal index b87549f6d19e..b0d6736e5ef8 100644 --- a/data/tilesets/secondary/mauville/palettes/10.pal +++ b/data/tilesets/secondary/mauville/palettes/10.pal @@ -1,7 +1,7 @@ JASC-PAL 0100 16 -8 192 0 +123 180 189 255 255 255 148 222 205 123 180 172 diff --git a/data/tilesets/secondary/mauville/palettes/10.pla b/data/tilesets/secondary/mauville/palettes/10.pla new file mode 100644 index 000000000000..24701d55f56d --- /dev/null +++ b/data/tilesets/secondary/mauville/palettes/10.pla @@ -0,0 +1,4 @@ +# Color indices to set high bit +1 +9 +10 \ No newline at end of file diff --git a/data/tilesets/secondary/mauville/palettes/11.pal b/data/tilesets/secondary/mauville/palettes/11.pal index 48166182aef3..a48424b133a0 100644 --- a/data/tilesets/secondary/mauville/palettes/11.pal +++ b/data/tilesets/secondary/mauville/palettes/11.pal @@ -1,7 +1,7 @@ JASC-PAL 0100 16 -0 48 0 +123 180 189 255 255 255 222 230 238 164 180 197 diff --git a/data/tilesets/secondary/mauville/palettes/11.pla b/data/tilesets/secondary/mauville/palettes/11.pla new file mode 100644 index 000000000000..0dcbee208775 --- /dev/null +++ b/data/tilesets/secondary/mauville/palettes/11.pla @@ -0,0 +1,3 @@ +# Color indices to set high bit +7 +8 \ No newline at end of file diff --git a/data/tilesets/secondary/mossdeep/palettes/08.pal b/data/tilesets/secondary/mossdeep/palettes/08.pal index 34e9db9806ed..5b086f051162 100644 --- a/data/tilesets/secondary/mossdeep/palettes/08.pal +++ b/data/tilesets/secondary/mossdeep/palettes/08.pal @@ -1,7 +1,7 @@ JASC-PAL 0100 16 -0 192 0 +0 0 0 255 255 255 205 205 197 180 180 164 diff --git a/data/tilesets/secondary/mossdeep/palettes/08.pla b/data/tilesets/secondary/mossdeep/palettes/08.pla new file mode 100644 index 000000000000..5eb702de8041 --- /dev/null +++ b/data/tilesets/secondary/mossdeep/palettes/08.pla @@ -0,0 +1,3 @@ +# Color indices to set high bit +9 +10 \ No newline at end of file diff --git a/data/tilesets/secondary/pacifidlog/palettes/09.pal b/data/tilesets/secondary/pacifidlog/palettes/09.pal index 4f27efece10c..653ffdfb3ea4 100644 --- a/data/tilesets/secondary/pacifidlog/palettes/09.pal +++ b/data/tilesets/secondary/pacifidlog/palettes/09.pal @@ -1,7 +1,7 @@ JASC-PAL 0100 16 -0 0 128 +0 0 0 222 230 164 180 189 123 156 164 98 diff --git a/data/tilesets/secondary/pacifidlog/palettes/09.pla b/data/tilesets/secondary/pacifidlog/palettes/09.pla new file mode 100644 index 000000000000..321117092b72 --- /dev/null +++ b/data/tilesets/secondary/pacifidlog/palettes/09.pla @@ -0,0 +1,2 @@ +# Color indices to set high bit +15 \ No newline at end of file diff --git a/data/tilesets/secondary/petalburg/palettes/06.pal b/data/tilesets/secondary/petalburg/palettes/06.pal index 0d0fbb48ca5a..f4190e865c54 100644 --- a/data/tilesets/secondary/petalburg/palettes/06.pal +++ b/data/tilesets/secondary/petalburg/palettes/06.pal @@ -1,7 +1,7 @@ JASC-PAL 0100 16 -0 192 0 +0 0 0 255 255 255 230 222 222 213 213 197 diff --git a/data/tilesets/secondary/petalburg/palettes/06.pla b/data/tilesets/secondary/petalburg/palettes/06.pla new file mode 100644 index 000000000000..5eb702de8041 --- /dev/null +++ b/data/tilesets/secondary/petalburg/palettes/06.pla @@ -0,0 +1,3 @@ +# Color indices to set high bit +9 +10 \ No newline at end of file diff --git a/data/tilesets/secondary/petalburg/palettes/07.pal b/data/tilesets/secondary/petalburg/palettes/07.pal index 75b06af26e5c..41d133994245 100644 --- a/data/tilesets/secondary/petalburg/palettes/07.pal +++ b/data/tilesets/secondary/petalburg/palettes/07.pal @@ -1,7 +1,7 @@ JASC-PAL 0100 16 -0 192 0 +0 0 0 213 222 172 0 0 0 189 189 131 diff --git a/data/tilesets/secondary/petalburg/palettes/07.pla b/data/tilesets/secondary/petalburg/palettes/07.pla new file mode 100644 index 000000000000..5eb702de8041 --- /dev/null +++ b/data/tilesets/secondary/petalburg/palettes/07.pla @@ -0,0 +1,3 @@ +# Color indices to set high bit +9 +10 \ No newline at end of file diff --git a/data/tilesets/secondary/petalburg/palettes/09.pal b/data/tilesets/secondary/petalburg/palettes/09.pal index 1a6a5c771344..4d052b9c3027 100644 --- a/data/tilesets/secondary/petalburg/palettes/09.pal +++ b/data/tilesets/secondary/petalburg/palettes/09.pal @@ -1,7 +1,7 @@ JASC-PAL 0100 16 -0 192 0 +0 0 0 232 224 200 208 200 144 200 176 120 diff --git a/data/tilesets/secondary/petalburg/palettes/09.pla b/data/tilesets/secondary/petalburg/palettes/09.pla new file mode 100644 index 000000000000..5eb702de8041 --- /dev/null +++ b/data/tilesets/secondary/petalburg/palettes/09.pla @@ -0,0 +1,3 @@ +# Color indices to set high bit +9 +10 \ No newline at end of file diff --git a/data/tilesets/secondary/rustboro/palettes/06.pal b/data/tilesets/secondary/rustboro/palettes/06.pal index be88a09cf90a..1a3e98a28efb 100644 --- a/data/tilesets/secondary/rustboro/palettes/06.pal +++ b/data/tilesets/secondary/rustboro/palettes/06.pal @@ -1,7 +1,7 @@ JASC-PAL 0100 16 -240 192 0 +115 197 164 255 255 255 216 224 232 184 200 224 diff --git a/data/tilesets/secondary/rustboro/palettes/06.pla b/data/tilesets/secondary/rustboro/palettes/06.pla new file mode 100644 index 000000000000..7fe6c388e7f8 --- /dev/null +++ b/data/tilesets/secondary/rustboro/palettes/06.pla @@ -0,0 +1,7 @@ +# Colors in palette to set high (alpha) bit +2 +3 +4 +5 +9 +10 \ No newline at end of file diff --git a/data/tilesets/secondary/slateport/palettes/06.pal b/data/tilesets/secondary/slateport/palettes/06.pal index 2c624776cfc3..1e7d9a82208e 100644 --- a/data/tilesets/secondary/slateport/palettes/06.pal +++ b/data/tilesets/secondary/slateport/palettes/06.pal @@ -1,7 +1,7 @@ JASC-PAL 0100 16 -0 32 0 +0 0 0 255 255 255 230 230 238 205 205 222 diff --git a/data/tilesets/secondary/slateport/palettes/06.pla b/data/tilesets/secondary/slateport/palettes/06.pla new file mode 100644 index 000000000000..07f021d4b4f2 --- /dev/null +++ b/data/tilesets/secondary/slateport/palettes/06.pla @@ -0,0 +1,2 @@ +# Color indices to set high bit +8 \ No newline at end of file diff --git a/data/tilesets/secondary/slateport/palettes/12.pal b/data/tilesets/secondary/slateport/palettes/12.pal index 589258c21f40..7ef1f4f2db61 100644 --- a/data/tilesets/secondary/slateport/palettes/12.pal +++ b/data/tilesets/secondary/slateport/palettes/12.pal @@ -1,7 +1,7 @@ JASC-PAL 0100 16 -96 160 72 +0 0 0 222 205 148 184 168 80 168 224 200 diff --git a/data/tilesets/secondary/slateport/palettes/12.pla b/data/tilesets/secondary/slateport/palettes/12.pla new file mode 100644 index 000000000000..27f716b90ddf --- /dev/null +++ b/data/tilesets/secondary/slateport/palettes/12.pla @@ -0,0 +1,6 @@ +# Color indices to set high bit +3 +4 +8 +10 +11 \ No newline at end of file diff --git a/data/tilesets/secondary/sootopolis/palettes/06.pal b/data/tilesets/secondary/sootopolis/palettes/06.pal index 6bb529da6bf3..44cd60931bc5 100644 --- a/data/tilesets/secondary/sootopolis/palettes/06.pal +++ b/data/tilesets/secondary/sootopolis/palettes/06.pal @@ -1,7 +1,7 @@ JASC-PAL 0100 16 -0 192 0 +248 240 176 255 255 255 238 238 213 222 222 180 diff --git a/data/tilesets/secondary/sootopolis/palettes/06.pla b/data/tilesets/secondary/sootopolis/palettes/06.pla new file mode 100644 index 000000000000..82b8d1306fa5 --- /dev/null +++ b/data/tilesets/secondary/sootopolis/palettes/06.pla @@ -0,0 +1,5 @@ +# Color indices to set high bit +0 +9 +10 +15 \ No newline at end of file diff --git a/data/tilesets/secondary/sootopolis/palettes/10.pal b/data/tilesets/secondary/sootopolis/palettes/10.pal index 46457797ed95..01d065e528e4 100644 --- a/data/tilesets/secondary/sootopolis/palettes/10.pal +++ b/data/tilesets/secondary/sootopolis/palettes/10.pal @@ -1,7 +1,7 @@ JASC-PAL 0100 16 -0 230 25 +246 74 65 139 115 106 115 90 82 90 65 65 diff --git a/data/tilesets/secondary/sootopolis/palettes/10.pla b/data/tilesets/secondary/sootopolis/palettes/10.pla new file mode 100644 index 000000000000..2b4c8a150e47 --- /dev/null +++ b/data/tilesets/secondary/sootopolis/palettes/10.pla @@ -0,0 +1,8 @@ +# Color indices to set high bit +0 +8 +9 +10 +11 +12 +15 \ No newline at end of file diff --git a/graphics/pokemon/ampharos/normal.pal b/graphics/pokemon/ampharos/normal.pal index f26721738f0d..78e36ba3a2ca 100644 --- a/graphics/pokemon/ampharos/normal.pal +++ b/graphics/pokemon/ampharos/normal.pal @@ -1,7 +1,7 @@ JASC-PAL 0100 16 -0 8 248 +197 65 0 255 255 255 255 238 74 255 197 16 @@ -16,4 +16,4 @@ JASC-PAL 197 65 0 139 32 0 90 0 0 -197 65 0 +255 0 255 diff --git a/graphics/pokemon/ampharos/normal.pla b/graphics/pokemon/ampharos/normal.pla new file mode 100644 index 000000000000..88043ac888d3 --- /dev/null +++ b/graphics/pokemon/ampharos/normal.pla @@ -0,0 +1,7 @@ +# Color indices to set high bit +0 +6 +11 +12 +13 +14 \ No newline at end of file diff --git a/graphics/pokemon/ampharos/shiny.pal b/graphics/pokemon/ampharos/shiny.pal index 719c6b87f01a..a1b88cfd3c0f 100644 --- a/graphics/pokemon/ampharos/shiny.pal +++ b/graphics/pokemon/ampharos/shiny.pal @@ -1,7 +1,7 @@ JASC-PAL 0100 16 -0 8 248 +65 106 205 255 255 255 246 180 213 213 148 180 @@ -16,4 +16,4 @@ JASC-PAL 65 106 205 32 65 156 49 74 139 -65 106 205 +255 0 255 diff --git a/graphics/pokemon/ampharos/shiny.pla b/graphics/pokemon/ampharos/shiny.pla new file mode 100644 index 000000000000..88043ac888d3 --- /dev/null +++ b/graphics/pokemon/ampharos/shiny.pla @@ -0,0 +1,7 @@ +# Color indices to set high bit +0 +6 +11 +12 +13 +14 \ No newline at end of file diff --git a/src/data/tilesets/headers.h b/src/data/tilesets/headers.h index 8a7907c6c8d8..4144369af81e 100644 --- a/src/data/tilesets/headers.h +++ b/src/data/tilesets/headers.h @@ -2,6 +2,13 @@ // Whether a palette has a night version, located at ((x + 9) % 16).pal #define SWAP_PAL(x) ((x) < NUM_PALS_IN_PRIMARY ? 1 << (x) : 1 << ((x) - NUM_PALS_IN_PRIMARY)) + +// NOTE: Instead of using LIGHT_PAL, +// consider taking a look at the .pla files +// to mark colors as lights, instead. +// The old method *should* still work, however. +// See the README for details. + // Whether a palette has lights // the color indices to blend are stored in the palette's color 0 #define LIGHT_PAL(x) ((x) < NUM_PALS_IN_PRIMARY ? 1 << (x) : 1 << ((x) - NUM_PALS_IN_PRIMARY)) @@ -11,7 +18,6 @@ const struct Tileset gTileset_General = .isCompressed = TRUE, .swapPalettes = SWAP_PAL(4), .isSecondary = FALSE, - .lightPalettes = LIGHT_PAL(4), .tiles = gTilesetTiles_General, .palettes = gTilesetPalettes_General, .metatiles = gMetatiles_General, @@ -24,7 +30,6 @@ const struct Tileset gTileset_Petalburg = .isCompressed = TRUE, .swapPalettes = SWAP_PAL(9), .isSecondary = TRUE, - .lightPalettes = LIGHT_PAL(6) | LIGHT_PAL(7) | LIGHT_PAL(9), .tiles = gTilesetTiles_Petalburg, .palettes = gTilesetPalettes_Petalburg, .metatiles = gMetatiles_Petalburg, @@ -36,7 +41,6 @@ const struct Tileset gTileset_Rustboro = { .isCompressed = TRUE, .isSecondary = TRUE, - .lightPalettes = LIGHT_PAL(6), .tiles = gTilesetTiles_Rustboro, .palettes = gTilesetPalettes_Rustboro, .metatiles = gMetatiles_Rustboro, @@ -60,7 +64,6 @@ const struct Tileset gTileset_Slateport = .isCompressed = TRUE, .swapPalettes = SWAP_PAL(6), .isSecondary = TRUE, - .lightPalettes = LIGHT_PAL(6) | LIGHT_PAL(12), .tiles = gTilesetTiles_Slateport, .palettes = gTilesetPalettes_Slateport, .metatiles = gMetatiles_Slateport, @@ -72,7 +75,6 @@ const struct Tileset gTileset_Mauville = { .isCompressed = TRUE, .isSecondary = TRUE, - .lightPalettes = LIGHT_PAL(7) | LIGHT_PAL(10) | LIGHT_PAL(11), .tiles = gTilesetTiles_Mauville, .palettes = gTilesetPalettes_Mauville, .metatiles = gMetatiles_Mauville, @@ -84,8 +86,6 @@ const struct Tileset gTileset_Lavaridge = { .isCompressed = TRUE, .isSecondary = TRUE, - .lightPalettes = LIGHT_PAL(6), - .customLightColor = LIGHT_PAL(6), .tiles = gTilesetTiles_Lavaridge, .palettes = gTilesetPalettes_Lavaridge, .metatiles = gMetatiles_Lavaridge, @@ -98,7 +98,6 @@ const struct Tileset gTileset_Fallarbor = .isCompressed = TRUE, .swapPalettes = SWAP_PAL(7), .isSecondary = TRUE, - .lightPalettes = LIGHT_PAL(7), .tiles = gTilesetTiles_Fallarbor, .palettes = gTilesetPalettes_Fallarbor, .metatiles = gMetatiles_Fallarbor, @@ -110,8 +109,6 @@ const struct Tileset gTileset_Fortree = { .isCompressed = TRUE, .isSecondary = TRUE, - .lightPalettes = LIGHT_PAL(8), - .customLightColor = LIGHT_PAL(8), .tiles = gTilesetTiles_Fortree, .palettes = gTilesetPalettes_Fortree, .metatiles = gMetatiles_Fortree, @@ -124,7 +121,6 @@ const struct Tileset gTileset_Lilycove = .isCompressed = TRUE, .swapPalettes = SWAP_PAL(6), .isSecondary = TRUE, - .lightPalettes = LIGHT_PAL(6), .tiles = gTilesetTiles_Lilycove, .palettes = gTilesetPalettes_Lilycove, .metatiles = gMetatiles_Lilycove, @@ -137,7 +133,6 @@ const struct Tileset gTileset_Mossdeep = .isCompressed = TRUE, .swapPalettes = SWAP_PAL(8), .isSecondary = TRUE, - .lightPalettes = LIGHT_PAL(8), .tiles = gTilesetTiles_Mossdeep, .palettes = gTilesetPalettes_Mossdeep, .metatiles = gMetatiles_Mossdeep, @@ -154,7 +149,6 @@ const struct Tileset gTileset_EverGrande = .metatiles = gMetatiles_EverGrande, .metatileAttributes = gMetatileAttributes_EverGrande, .callback = InitTilesetAnim_EverGrande, - .lightPalettes = LIGHT_PAL(8), .swapPalettes = SWAP_PAL(8), }; @@ -163,7 +157,6 @@ const struct Tileset gTileset_Pacifidlog = .isCompressed = TRUE, .swapPalettes = SWAP_PAL(9), .isSecondary = TRUE, - .lightPalettes = LIGHT_PAL(9), .tiles = gTilesetTiles_Pacifidlog, .palettes = gTilesetPalettes_Pacifidlog, .metatiles = gMetatiles_Pacifidlog, @@ -176,8 +169,6 @@ const struct Tileset gTileset_Sootopolis = .isCompressed = TRUE, .swapPalettes = SWAP_PAL(6), .isSecondary = TRUE, - .lightPalettes = LIGHT_PAL(6) | LIGHT_PAL(10), - .customLightColor = LIGHT_PAL(6) | LIGHT_PAL(10), .tiles = gTilesetTiles_Sootopolis, .palettes = gTilesetPalettes_Sootopolis, .metatiles = gMetatiles_Sootopolis, diff --git a/src/event_object_movement.c b/src/event_object_movement.c index 8d96a70fa72b..e29e4450ac2e 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -1765,16 +1765,11 @@ static u8 LoadDynamicFollowerPalette(u16 species, u8 form, bool8 shiny) { // so that palette tags do not overlap const struct CompressedSpritePalette *spritePalette = &(shiny ? gMonShinyPaletteTable : gMonPaletteTable)[species]; if ((paletteNum = IndexOfSpritePaletteTag(spritePalette->tag)) == 0xFF) { // Load compressed palette - LoadCompressedSpritePalette(spritePalette); - paletteNum = IndexOfSpritePaletteTag(spritePalette->tag); // Tag is always present - if (species == SPECIES_AMPHAROS) { // palette should be light-blended TODO: Add more glowing pokemon + LoadCompressedSpritePalette(spritePalette); + paletteNum = IndexOfSpritePaletteTag(spritePalette->tag); // Tag is always present + // TODO: Add more glowing pokemon besides Ampharos // CHARIZARD LINE ? CHINCHOU LANTERN FLAAFY MAREEP UMBREON VOLBEAT ? - u16 * palette = &gPlttBufferUnfaded[(paletteNum+16)*16]; - palette[0] |= 0x8000; - if (palette[0] & 0x4000) // If color 15 is blended, use it as the alternate color - palette[15] |= 0x8000; - } - UpdateSpritePaletteWithWeather(paletteNum, FALSE); + UpdateSpritePaletteWithWeather(paletteNum, FALSE); } return paletteNum; } diff --git a/src/fieldmap.c b/src/fieldmap.c index 83d1697adb3d..f4411038fac1 100644 --- a/src/fieldmap.c +++ b/src/fieldmap.c @@ -904,14 +904,17 @@ void LoadTilesetPalette(struct Tileset const *tileset, u16 destOffset, u16 size, LoadCompressedPalette((const u32 *)tileset->palettes, destOffset, size); ApplyGlobalTintToPaletteEntries(destOffset, size >> 1); } - if (tileset->isSecondary == FALSE || tileset->isSecondary == TRUE) { - u32 i; + // convert legacy light palette system to current + if (tileset->lightPalettes) { + u32 i, j, color; for (i = low; i < high; i++) { - if (tileset->lightPalettes & (1 << (i - low))) { // Mark as light palette - u32 index = i * 16; - gPlttBufferFaded[index] = gPlttBufferUnfaded[index] |= 0x8000; - if (tileset->customLightColor & (1 << (i - low))) // Mark as custom light color - gPlttBufferFaded[index+15] = gPlttBufferUnfaded[index+15] |= 0x8000; + if (tileset->lightPalettes & (1 << (i - low))) { // Mark light colors + for (j = 1, color = gPlttBufferUnfaded[PLTT_ID(i)]; j < 16 && color; j++, color >>= 1) { + if (color & 1) + gPlttBufferFaded[PLTT_ID(i)+j] = gPlttBufferUnfaded[PLTT_ID(i)+j] |= RGB_ALPHA; + } + if (tileset->customLightColor & (1 << (i - low))) // Copy old custom light color to index 0 + gPlttBufferFaded[PLTT_ID(i)] = gPlttBufferUnfaded[PLTT_ID(i)] = gPlttBufferUnfaded[PLTT_ID(i)+15] | RGB_ALPHA; } } } diff --git a/src/palette.c b/src/palette.c index d2a8476ddeb3..b17ba8214df6 100644 --- a/src/palette.c +++ b/src/palette.c @@ -1003,40 +1003,40 @@ static bool8 IsSoftwarePaletteFadeFinishing(void) // optimized based on lucktyphlosion's BlendPalettesFine void BlendPalettesFine(u32 palettes, u16 *src, u16 *dst, u32 coeff, u32 color) { - s32 newR, newG, newB; - - if (!palettes) - return; - - coeff *= 2; - newR = (color << 27) >> 27; - newG = (color << 22) >> 27; - newB = (color << 17) >> 27; - - do { - if (palettes & 1) { - u16 *srcEnd = src + 16; - while (src != srcEnd) { // Transparency is blended because it can matter for tile palettes - u32 srcColor = *src; - s32 r = (srcColor << 27) >> 27; - s32 g = (srcColor << 22) >> 27; - s32 b = (srcColor << 17) >> 27; - - *dst++ = ((r + (((newR - r) * coeff) >> 5)) << 0) - | ((g + (((newG - g) * coeff) >> 5)) << 5) - | ((b + (((newB - b) * coeff) >> 5)) << 10); - src++; - } - } else { - src += 16; - dst += 16; - } - palettes >>= 1; - } while (palettes); + s32 newR, newG, newB; + + if (!palettes) + return; + + coeff *= 2; + newR = (color << 27) >> 27; + newG = (color << 22) >> 27; + newB = (color << 17) >> 27; + + do { + if (palettes & 1) { + u16 *srcEnd = src + 16; + while (src != srcEnd) { // Transparency is blended (for backdrop reasons) + u32 srcColor = *src; + s32 r = (srcColor << 27) >> 27; + s32 g = (srcColor << 22) >> 27; + s32 b = (srcColor << 16) >> 26; + + *dst++ = ((r + (((newR - r) * (s32)coeff) >> 5)) << 0) + | ((g + (((newG - g) * (s32)coeff) >> 5)) << 5) + | ((b + (((newB - (b & 31)) * (s32)coeff) >> 5)) << 10); + src++; + } + } else { + src += 16; + dst += 16; + } + palettes >>= 1; + } while (palettes); } void BlendPalettes(u32 palettes, u8 coeff, u16 color) { - BlendPalettesFine(palettes, gPlttBufferUnfaded, gPlttBufferFaded, coeff, color); + BlendPalettesFine(palettes, gPlttBufferUnfaded, gPlttBufferFaded, coeff, color); } #define DEFAULT_LIGHT_COLOR 0x3f9f @@ -1044,186 +1044,172 @@ void BlendPalettes(u32 palettes, u8 coeff, u16 color) { // Like BlendPalette, but ignores blendColor if the transparency high bit is set // Optimization help by lucktyphlosion void TimeBlendPalette(u16 palOffset, u32 coeff, u32 blendColor) { - s32 newR, newG, newB, defR, defG, defB; - u16 * src = gPlttBufferUnfaded + palOffset; - u16 * dst = gPlttBufferFaded + palOffset; - u32 defaultBlendColor = DEFAULT_LIGHT_COLOR; - u16 *srcEnd = src + 16; - u16 altBlendIndices = *dst++ = *src++; // color 0 is copied through unchanged - u32 altBlendColor; - - coeff *= 2; - newR = (blendColor << 27) >> 27; - newG = (blendColor << 22) >> 27; - newB = (blendColor << 17) >> 27; - - if (altBlendIndices >> 15) { // High bit set; bitmask of which colors to alt-blend - // Note that bit 0 of altBlendIndices specifies color 1 - altBlendColor = src[14]; // color 15 - if (altBlendColor >> 15) { // Set alternate blend color - defR = (altBlendColor << 27) >> 27; - defG = (altBlendColor << 22) >> 27; - defB = (altBlendColor << 17) >> 27; - } else { // Set default blend color - defR = (defaultBlendColor << 27) >> 27; - defG = (defaultBlendColor << 22) >> 27; - defB = (defaultBlendColor << 17) >> 27; + s32 newR, newG, newB, defR, defG, defB; + u16 * src = gPlttBufferUnfaded + palOffset; + u16 * dst = gPlttBufferFaded + palOffset; + u32 defaultBlendColor = DEFAULT_LIGHT_COLOR; + u16 *srcEnd = src + 16; + u32 altBlendColor = *dst++ = *src++; // color 0 is copied through unchanged + + coeff *= 2; + newR = (blendColor << 27) >> 27; + newG = (blendColor << 22) >> 27; + newB = (blendColor << 17) >> 27; + + if (altBlendColor >> 15) { // Transparency high bit set; alt blend color + defR = (altBlendColor << 27) >> 27; + defG = (altBlendColor << 22) >> 27; + defB = (altBlendColor << 17) >> 27; + } else { + defR = (defaultBlendColor << 27) >> 27; + defG = (defaultBlendColor << 22) >> 27; + defB = (defaultBlendColor << 17) >> 27; + altBlendColor = 0; } - } else { - altBlendIndices = 0; - } - while (src != srcEnd) { - u32 srcColor = *src; - s32 r = (srcColor << 27) >> 27; - s32 g = (srcColor << 22) >> 27; - s32 b = (srcColor << 17) >> 27; - - if (altBlendIndices & 1) { - *dst = ((r + (((defR - r) * coeff) >> 5)) << 0) - | ((g + (((defG - g) * coeff) >> 5)) << 5) - | ((b + (((defB - b) * coeff) >> 5)) << 10); - } else { // Use provided blend color - *dst = ((r + (((newR - r) * coeff) >> 5)) << 0) - | ((g + (((newG - g) * coeff) >> 5)) << 5) - | ((b + (((newB - b) * coeff) >> 5)) << 10); + while (src != srcEnd) { + u32 srcColor = *src; + s32 r = (srcColor << 27) >> 27; + s32 g = (srcColor << 22) >> 27; + s32 b = (srcColor << 16) >> 26; + + if (srcColor >> 15) { + *dst = ((r + (((defR - r) * (s32)coeff) >> 5)) << 0) + | ((g + (((defG - g) * (s32)coeff) >> 5)) << 5) + | ((b + (((defB - (b & 31)) * (s32)coeff) >> 5)) << 10); + } else { // Use provided blend color + *dst = ((r + (((newR - r) * (s32)coeff) >> 5)) << 0) + | ((g + (((newG - g) * (s32)coeff) >> 5)) << 5) + | ((b + (((newB - (b & 31)) * (s32)coeff) >> 5)) << 10); + } + src++; + dst++; } - src++; - dst++; - altBlendIndices >>= 1; - } } // Blends a weighted average of two blend parameters // Parameters can be either blended (as in BlendPalettes) or tinted (as in TintPaletteRGB_Copy) void TimeMixPalettes(u32 palettes, u16 *src, u16 *dst, struct BlendSettings *blend0, struct BlendSettings *blend1, u16 weight0) { - s32 r0, g0, b0, r1, g1, b1, defR, defG, defB, altR, altG, altB; - u32 color0, coeff0, color1, coeff1; - bool8 tint0, tint1; - u16 weight1; - u32 defaultColor = DEFAULT_LIGHT_COLOR; + s32 r0, g0, b0, r1, g1, b1, defR, defG, defB, altR, altG, altB; + u32 color0, coeff0, color1, coeff1; + bool8 tint0, tint1; + u32 defaultColor = DEFAULT_LIGHT_COLOR; - if (!palettes) + if (!palettes) return; - color0 = blend0->blendColor; - tint0 = blend0->isTint; - coeff0 = tint0 ? 8*2 : blend0->coeff*2; - color1 = blend1->blendColor; - tint1 = blend1->isTint; - coeff1 = tint1 ? 8*2 : blend1->coeff*2; - - if (tint0) { - r0 = (color0 << 24) >> 24; - g0 = (color0 << 16) >> 24; - b0 = (color0 << 8) >> 24; - } else { - r0 = (color0 << 27) >> 27; - g0 = (color0 << 22) >> 27; - b0 = (color0 << 17) >> 27; - } - if (tint1) { - r1 = (color1 << 24) >> 24; - g1 = (color1 << 16) >> 24; - b1 = (color1 << 8) >> 24; - } else { - r1 = (color1 << 27) >> 27; - g1 = (color1 << 22) >> 27; - b1 = (color1 << 17) >> 27; - } - defR = (defaultColor << 27) >> 27; - defG = (defaultColor << 22) >> 27; - defB = (defaultColor << 17) >> 27; - weight1 = 256 - weight0; - - do { - if (palettes & 1) { - u16 *srcEnd = src + 16; - u16 altBlendIndices = *dst++ = *src++; // color 0 is copied through - u32 altBlendColor; - if (altBlendIndices >> 15) { // High bit set; bitmask of which colors to alt-blend - // Note that bit 0 of altBlendIndices specifies color 1 - altBlendColor = src[14]; // color 15 - if (altBlendColor >> 15) { // Set alternate blend color - altR = (altBlendColor << 27) >> 27; - altG = (altBlendColor << 22) >> 27; - altB = (altBlendColor << 17) >> 27; - } else { - altBlendColor = 0; - } - } else { - altBlendIndices = 0; - } - while (src != srcEnd) { - u32 srcColor = *src; - s32 r = (srcColor << 27) >> 27; - s32 g = (srcColor << 22) >> 27; - s32 b = (srcColor << 17) >> 27; - - if (altBlendIndices & 1) { - if (altBlendColor) { // Use alternate blend color - r = (weight0*(r + (((altR - r) * coeff0) >> 5)) + weight1*(r + (((altR - r) * coeff1) >> 5))) >> 8; - g = (weight0*(g + (((altG - g) * coeff0) >> 5)) + weight1*(g + (((altG - g) * coeff1) >> 5))) >> 8; - b = (weight0*(b + (((altB - b) * coeff0) >> 5)) + weight1*(b + (((altB - b) * coeff1) >> 5))) >> 8; - *dst = RGB2(r, g, b); - } else { // Use default blend color - r = (weight0*(r + (((defR - r) * coeff0) >> 5)) + weight1*(r + (((defR - r) * coeff1) >> 5))) >> 8; - g = (weight0*(g + (((defG - g) * coeff0) >> 5)) + weight1*(g + (((defG - g) * coeff1) >> 5))) >> 8; - b = (weight0*(b + (((defB - b) * coeff0) >> 5)) + weight1*(b + (((defB - b) * coeff1) >> 5))) >> 8; - *dst = RGB2(r, g, b); - } - } else { // Use provided blend colors - s32 r2, g2, b2, r3, g3, b3; - if (!tint0) { // blend-based - r2 = (r + (((r0 - r) * coeff0) >> 5)); - g2 = (g + (((g0 - g) * coeff0) >> 5)); - b2 = (b + (((b0 - b) * coeff0) >> 5)); - } else { // tint-based - r2 = (u16)((r0 * r)) >> 8; - g2 = (u16)((g0 * g)) >> 8; - b2 = (u16)((b0 * b)) >> 8; - if (r2 > 31) - r2 = 31; - if (g2 > 31) - g2 = 31; - if (b2 > 31) - b2 = 31; - } - if (!tint1) { // blend-based - r3 = (r + (((r1 - r) * coeff1) >> 5)); - g3 = (g + (((g1 - g) * coeff1) >> 5)); - b3 = (b + (((b1 - b) * coeff1) >> 5)); - } else { // tint-based - r3 = (u16)((r1 * r)) >> 8; - g3 = (u16)((g1 * g)) >> 8; - b3 = (u16)((b1 * b)) >> 8; - if (r3 > 31) - r3 = 31; - if (g3 > 31) - g3 = 31; - if (b3 > 31) - b3 = 31; - } - r = (weight0*r2 + weight1*r3) >> 8; - g = (weight0*g2 + weight1*g3) >> 8; - b = (weight0*b2 + weight1*b3) >> 8; - *dst = RGB2(r, g, b); - } - src++; - dst++; - altBlendIndices >>= 1; - } + color0 = blend0->blendColor; + tint0 = blend0->isTint; + coeff0 = tint0 ? 8*2 : blend0->coeff*2; + color1 = blend1->blendColor; + tint1 = blend1->isTint; + coeff1 = tint1 ? 8*2 : blend1->coeff*2; + + if (tint0) { + r0 = (color0 << 24) >> 24; + g0 = (color0 << 16) >> 24; + b0 = (color0 << 8) >> 24; + } else { + r0 = (color0 << 27) >> 27; + g0 = (color0 << 22) >> 27; + b0 = (color0 << 17) >> 27; + } + if (tint1) { + r1 = (color1 << 24) >> 24; + g1 = (color1 << 16) >> 24; + b1 = (color1 << 8) >> 24; } else { - src += 16; - dst += 16; + r1 = (color1 << 27) >> 27; + g1 = (color1 << 22) >> 27; + b1 = (color1 << 17) >> 27; } - palettes >>= 1; - } while (palettes); + defR = (defaultColor << 27) >> 27; + defG = (defaultColor << 22) >> 27; + defB = (defaultColor << 17) >> 27; + + do { + if (palettes & 1) { + u16 *srcEnd = src + 16; + u32 altBlendColor = *dst++ = *src++; // color 0 is copied through + if (altBlendColor >> 15) { // Transparency high bit set; alt blend color + altR = (altBlendColor << 27) >> 27; + altG = (altBlendColor << 22) >> 27; + altB = (altBlendColor << 17) >> 27; + } else { + altBlendColor = 0; + } + while (src != srcEnd) { + u32 srcColor = *src; + s32 r = (srcColor << 27) >> 27; + s32 g = (srcColor << 22) >> 27; + s32 b = (srcColor << 17) >> 27; + s32 r2, g2, b2; + + if (srcColor >> 15) { + if (altBlendColor) { // Use alternate blend color + r2 = r + (((altR - r) * (s32)coeff1) >> 5); + g2 = g + (((altG - g) * (s32)coeff1) >> 5); + b2 = b + (((altB - b) * (s32)coeff1) >> 5); + r = r + (((altR - r) * (s32)coeff0) >> 5); + g = g + (((altG - g) * (s32)coeff0) >> 5); + b = b + (((altB - b) * (s32)coeff0) >> 5); + } else { // Use default blend color + r2 = r + (((defR - r) * (s32)coeff1) >> 5); + g2 = g + (((defG - g) * (s32)coeff1) >> 5); + b2 = b + (((defB - b) * (s32)coeff1) >> 5); + r = r + (((defR - r) * (s32)coeff0) >> 5); + g = g + (((defG - g) * (s32)coeff0) >> 5); + b = b + (((defB - b) * (s32)coeff0) >> 5); + } + } else { // Use provided blend colors + if (!tint1) { // blend-based + r2 = (r + (((r1 - r) * (s32)coeff1) >> 5)); + g2 = (g + (((g1 - g) * (s32)coeff1) >> 5)); + b2 = (b + (((b1 - b) * (s32)coeff1) >> 5)); + } else { // tint-based + r2 = (u16)((r1 * r)) >> 8; + g2 = (u16)((g1 * g)) >> 8; + b2 = (u16)((b1 * b)) >> 8; + if (r2 > 31) + r2 = 31; + if (g2 > 31) + g2 = 31; + if (b2 > 31) + b2 = 31; + } + if (!tint0) { // blend-based + r = (r + (((r0 - r) * (s32)coeff0) >> 5)); + g = (g + (((g0 - g) * (s32)coeff0) >> 5)); + b = (b + (((b0 - b) * (s32)coeff0) >> 5)); + } else { // tint-based + r = (u16)((r0 * r)) >> 8; + g = (u16)((g0 * g)) >> 8; + b = (u16)((b0 * b)) >> 8; + if (r > 31) + r = 31; + if (g > 31) + g = 31; + if (b > 31) + b = 31; + } + } + r = r2 + (((r - r2) * (s32)weight0) >> 8); + g = g2 + (((g - g2) * (s32)weight0) >> 8); + b = b2 + (((b - b2) * (s32)weight0) >> 8); + *dst++ = RGB2(r, g, b); + // *dst++ = RGB2(r, g, b) | (srcColor >> 15) << 15; + src++; + } + } else { + src += 16; + dst += 16; + } + palettes >>= 1; + } while (palettes); } // Apply weighted average to palettes, preserving high bits of dst throughout void AvgPaletteWeighted(u16 *src0, u16 *src1, u16 *dst, u16 weight0) { u16 *srcEnd = src0 + 16; - u16 weight1 = 256 - weight0; src0++; src1++; dst++; // leave dst transparency unchanged @@ -1238,10 +1224,10 @@ void AvgPaletteWeighted(u16 *src0, u16 *src1, u16 *dst, u16 weight0) { s32 b1 = (src1Color << 17) >> 27; // Average and bitwise-OR - r0 = (weight0*r0 + weight1*r1) >> 8; - g0 = (weight0*g0 + weight1*g1) >> 8; - b0 = (weight0*b0 + weight1*b1) >> 8; - *dst++ = (*dst & 0x8000) | RGB2(r0, g0, b0); // preserve high bit of dst + r0 = r1 + (((r0 - r1) * weight0) >> 8); + g0 = g1 + (((g0 - g1) * weight0) >> 8); + b0 = b1 + (((b0 - b1) * weight0) >> 8); + *dst++ = (*dst & RGB_ALPHA) | RGB2(r0, g0, b0); // preserve high bit of dst } } diff --git a/tools/gbagfx/gfx.c b/tools/gbagfx/gfx.c index 832e9bb39710..a751a366ff20 100644 --- a/tools/gbagfx/gfx.c +++ b/tools/gbagfx/gfx.c @@ -14,6 +14,7 @@ #define GET_GBA_PAL_BLUE(x) (((x) >> 10) & 0x1F) #define SET_GBA_PAL(r, g, b) (((b) << 10) | ((g) << 5) | (r)) +#define SET_GBA_PAL_RGBA(r, g, b, a) (((a) << 15) | ((b) << 10) | ((g) << 5) | (r)) #define UPCONVERT_BIT_DEPTH(x) (((x) * 255) / 31) @@ -516,8 +517,9 @@ void WriteGbaPalette(char *path, struct Palette *palette) unsigned char red = DOWNCONVERT_BIT_DEPTH(palette->colors[i].red); unsigned char green = DOWNCONVERT_BIT_DEPTH(palette->colors[i].green); unsigned char blue = DOWNCONVERT_BIT_DEPTH(palette->colors[i].blue); + bool alpha = palette->colors[i].alpha; - uint16_t paletteEntry = SET_GBA_PAL(red, green, blue); + uint16_t paletteEntry = SET_GBA_PAL_RGBA(red, green, blue, alpha); fputc(paletteEntry & 0xFF, fp); fputc(paletteEntry >> 8, fp); diff --git a/tools/gbagfx/gfx.h b/tools/gbagfx/gfx.h index f1dbfcf4f720..33b27ac4c0b0 100644 --- a/tools/gbagfx/gfx.h +++ b/tools/gbagfx/gfx.h @@ -10,6 +10,7 @@ struct Color { unsigned char red; unsigned char green; unsigned char blue; + bool alpha; }; struct Palette { diff --git a/tools/gbagfx/jasc_pal.c b/tools/gbagfx/jasc_pal.c index e5ba9c3c2f25..0bf2b52ad0a5 100644 --- a/tools/gbagfx/jasc_pal.c +++ b/tools/gbagfx/jasc_pal.c @@ -22,7 +22,7 @@ // Blue - "0 0 255\r\n" // Brown - "150 75 0\r\n" -#define MAX_LINE_LENGTH 11 +#define MAX_LINE_LENGTH 64 void ReadJascPaletteLine(FILE *fp, char *line) { @@ -152,6 +152,43 @@ void ReadJascPalette(char *path, struct Palette *palette) FATAL_ERROR("Garbage after color data.\n"); fclose(fp); + + // Try to parse alpha/high bit info for colors from auxiliary .pla file + char *dot = strrchr(path, '.'); + if (strcmp(dot, ".pal") != 0) + return; + strcpy(dot, ".pla"); // replace .pal with .pla + fp = fopen(path, "rb"); + + if (fp == NULL) + return; + // fprintf(stderr, "Opened auxiliary .pla file for reading: %s\n", path); + + int i = 0; + // Keep reading lines until number of colors is reached or we run out + while (i < palette->numColors && fgets(line, MAX_LINE_LENGTH, fp) != NULL) + { + if (line[0] == '#') // comment line; ignore + continue; + + char *s = line; + char *end; + int colorIndex; + + if (!ParseNumber(s, &end, 10, &colorIndex)) + FATAL_ERROR("Failed to parse aux color index.\n"); + + s = end; + + if (colorIndex >= palette->numColors) + FATAL_ERROR("Aux color index %d out of bounds.\n", colorIndex); + + palette->colors[colorIndex].alpha = 1; // set alpha color + // fprintf(stderr, "Color index: %d\n", colorIndex); + i++; + } + + fclose(fp); } void WriteJascPalette(char *path, struct Palette *palette) diff --git a/tools/gbagfx/main.c b/tools/gbagfx/main.c index 5d4faacab044..0c4c4ab1b96f 100644 --- a/tools/gbagfx/main.c +++ b/tools/gbagfx/main.c @@ -247,7 +247,7 @@ void HandlePngToGbaCommand(char *inputPath, char *outputPath, int argc, char **a void HandlePngToJascPaletteCommand(char *inputPath, char *outputPath, int argc UNUSED, char **argv UNUSED) { - struct Palette palette = {}; + struct Palette palette = {0}; ReadPngPalette(inputPath, &palette); WriteJascPalette(outputPath, &palette); @@ -255,7 +255,7 @@ void HandlePngToJascPaletteCommand(char *inputPath, char *outputPath, int argc U void HandlePngToGbaPaletteCommand(char *inputPath, char *outputPath, int argc UNUSED, char **argv UNUSED) { - struct Palette palette = {}; + struct Palette palette = {0}; ReadPngPalette(inputPath, &palette); WriteGbaPalette(outputPath, &palette); @@ -263,7 +263,7 @@ void HandlePngToGbaPaletteCommand(char *inputPath, char *outputPath, int argc UN void HandleGbaToJascPaletteCommand(char *inputPath, char *outputPath, int argc UNUSED, char **argv UNUSED) { - struct Palette palette = {}; + struct Palette palette = {0}; ReadGbaPalette(inputPath, &palette); WriteJascPalette(outputPath, &palette); @@ -296,7 +296,7 @@ void HandleJascToGbaPaletteCommand(char *inputPath, char *outputPath, int argc, } } - struct Palette palette = {}; + struct Palette palette = {0}; ReadJascPalette(inputPath, &palette); From c1953e5d4bb3130e53c38a9d578000c7359d8cef Mon Sep 17 00:00:00 2001 From: Ariel A <24759293+aarant@users.noreply.github.com> Date: Fri, 23 Jun 2023 11:32:55 +0100 Subject: [PATCH 084/104] Improved OutOfCenterPartyHeal interaction with followers. --- data/event_scripts.s | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/data/event_scripts.s b/data/event_scripts.s index 05f550358f73..db57f2662531 100644 --- a/data/event_scripts.s +++ b/data/event_scripts.s @@ -719,10 +719,8 @@ Common_EventScript_OutOfCenterPartyHeal:: playfanfare MUS_HEAL waitfanfare special HealPlayerParty - @ start fade then immediately load following pokemon, and wait for fade - fadescreenswapbuffers FADE_FROM_BLACK, 1 - callnative UpdateFollowingPokemon - callfunc ScrFunc_WaitPaletteNotActive + callnative UpdateFollowingPokemon + fadescreenswapbuffers FADE_FROM_BLACK return EventScript_RegionMap:: From 4689f0b0d012c715e9106b3216bd9308de8abfec Mon Sep 17 00:00:00 2001 From: Ariel A <24759293+aarant@users.noreply.github.com> Date: Sun, 15 Oct 2023 00:52:34 -0400 Subject: [PATCH 085/104] Fixes for `make modern`. --- src/field_weather_effect.c | 2 +- src/fieldmap.c | 4 +++- src/follower_helper.c | 2 +- src/palette.c | 3 ++- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/field_weather_effect.c b/src/field_weather_effect.c index f0c1c4eebad4..94ae288d60ba 100644 --- a/src/field_weather_effect.c +++ b/src/field_weather_effect.c @@ -1387,7 +1387,7 @@ static void DestroyFogHorizontalSprites(void); // Updates just the color of shadows to match special weather blending u8 UpdateShadowColor(u16 color) { u8 paletteNum = IndexOfSpritePaletteTag(TAG_WEATHER_START); - u16 tempBuffer[16]; + u16 ALIGNED(4) tempBuffer[16]; u16 blendedColor; if (paletteNum != 0xFF) { u16 index = (paletteNum+16)*16+SHADOW_COLOR_INDEX; diff --git a/src/fieldmap.c b/src/fieldmap.c index c41a3b616bd6..0e48065a21e8 100644 --- a/src/fieldmap.c +++ b/src/fieldmap.c @@ -892,8 +892,10 @@ static void LoadTilesetPalette(struct Tileset const *tileset, u16 destOffset, u1 } else if (tileset->isSecondary == TRUE) { + // (void*) is to silence 'source potentially unaligned' error + // All 'gTilesetPalettes_' arrays should have ALIGNED(4) in them if (skipFaded) - CpuFastCopy(tileset->palettes[NUM_PALS_IN_PRIMARY], &gPlttBufferUnfaded[destOffset], size); + CpuFastCopy((void*)tileset->palettes[NUM_PALS_IN_PRIMARY], &gPlttBufferUnfaded[destOffset], size); else LoadPaletteFast(tileset->palettes[NUM_PALS_IN_PRIMARY], destOffset, size); low = NUM_PALS_IN_PRIMARY; diff --git a/src/follower_helper.c b/src/follower_helper.c index f146db6a7405..af455658486c 100644 --- a/src/follower_helper.c +++ b/src/follower_helper.c @@ -297,7 +297,7 @@ const struct FollowerMsgInfoExtended gFollowerConditionalMessages[COND_MSG_COUNT [COND_MSG_BURN] = { .text = sCondMsg42, - .st = {.status STATUS1_BURN}, + .st = {.status = STATUS1_BURN}, .stFlags = ST_FLAGS_STATUS, .emotion = FOLLOWER_EMOTION_SAD, }, diff --git a/src/palette.c b/src/palette.c index bda52a457adf..f7584cd28fd9 100644 --- a/src/palette.c +++ b/src/palette.c @@ -1227,7 +1227,8 @@ void AvgPaletteWeighted(u16 *src0, u16 *src1, u16 *dst, u16 weight0) { r0 = r1 + (((r0 - r1) * weight0) >> 8); g0 = g1 + (((g0 - g1) * weight0) >> 8); b0 = b1 + (((b0 - b1) * weight0) >> 8); - *dst++ = (*dst & RGB_ALPHA) | RGB2(r0, g0, b0); // preserve high bit of dst + *dst = (*dst & RGB_ALPHA) | RGB2(r0, g0, b0); // preserve high bit of dst + dst++; } } From b1bdd3e0b7e3a0eeea46de74d749aa06fef5c67b Mon Sep 17 00:00:00 2001 From: Ariel A <24759293+aarant@users.noreply.github.com> Date: Thu, 12 Oct 2023 00:34:38 -0400 Subject: [PATCH 086/104] Fixed Deoxys rock palette with lighting. --- src/field_specials.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/field_specials.c b/src/field_specials.c index 87674d8ce724..7e76556d2735 100644 --- a/src/field_specials.c +++ b/src/field_specials.c @@ -3343,6 +3343,7 @@ static void ChangeDeoxysRockLevel(u8 rockLevel) { u8 paletteNum = IndexOfSpritePaletteTag(OBJ_EVENT_PAL_TAG_BIRTH_ISLAND_STONE); LoadPalette(&sDeoxysRockPalettes[rockLevel], OBJ_PLTT_ID(paletteNum), PLTT_SIZEOF(4)); + UpdateSpritePaletteWithWeather(paletteNum, FALSE); if (rockLevel == 0) PlaySE(SE_M_CONFUSE_RAY); // Failure sound From 05a6147e5c623bd0560170222ab00865a83c19ca Mon Sep 17 00:00:00 2001 From: Ariel A <24759293+aarant@users.noreply.github.com> Date: Tue, 12 Dec 2023 22:41:10 -0500 Subject: [PATCH 087/104] Fixed `showmonpic` palette being affected by time of day and weather. Fixed #8. --- src/field_effect.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/field_effect.c b/src/field_effect.c index 89934be49914..74bb101b183c 100644 --- a/src/field_effect.c +++ b/src/field_effect.c @@ -913,29 +913,25 @@ u8 AddNewGameBirchObject(s16 x, s16 y, u8 subpriority) return CreateSprite(&sSpriteTemplate_NewGameBirch, x, y, subpriority); } -u8 CreateMonSprite_PicBox(u16 species, s16 x, s16 y, u8 subpriority) -{ - s32 spriteId = CreateMonPicSprite_HandleDeoxys(species, 0, 0x8000, TRUE, x, y, 0, gMonPaletteTable[species].tag); - PreservePaletteInWeather(IndexOfSpritePaletteTag(gMonPaletteTable[species].tag) + 0x10); - if (spriteId == 0xFFFF) - return MAX_SPRITES; - else - return spriteId; -} u8 CreateMonSprite_FieldMove(u16 species, u32 otId, u32 personality, s16 x, s16 y, u8 subpriority) { - const struct CompressedSpritePalette *spritePalette = GetMonSpritePalStructFromOtIdPersonality(species, otId, personality); // force load unique tag here to avoid collision with follower pokemon - u8 paletteSlot = AllocSpritePalette(FLDEFF_PAL_TAG_FIELD_MOVE_MON); + u32 paletteSlot = AllocSpritePalette(FLDEFF_PAL_TAG_FIELD_MOVE_MON); u16 spriteId = CreateMonPicSprite_HandleDeoxys(species, otId, personality, TRUE, x, y, paletteSlot, TAG_NONE); - PreservePaletteInWeather(IndexOfSpritePaletteTag(FLDEFF_PAL_TAG_FIELD_MOVE_MON) + 0x10); + PreservePaletteInWeather(paletteSlot + 0x10); if (spriteId == 0xFFFF) return MAX_SPRITES; else return spriteId; } +u8 CreateMonSprite_PicBox(u16 species, s16 x, s16 y, u8 subpriority) +{ + // Reuse logic; (otId ^ pid) >= SHINY_ODDS ensures non-shiny + return CreateMonSprite_FieldMove(species, 0, SHINY_ODDS, x, y, subpriority); +} + void FreeResourcesAndDestroySprite(struct Sprite *sprite, u8 spriteId) { u8 paletteNum = sprite->oam.paletteNum; From 7939894b183d6fa0741ae4bebead5a94324b0ff9 Mon Sep 17 00:00:00 2001 From: Ariel A <24759293+aarant@users.noreply.github.com> Date: Sat, 27 Apr 2024 23:31:37 -0400 Subject: [PATCH 088/104] fix: object event palettes can be loaded during fadeout --- src/field_weather.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/field_weather.c b/src/field_weather.c index e859cf856a7f..bd15ad074244 100644 --- a/src/field_weather.c +++ b/src/field_weather.c @@ -871,6 +871,15 @@ void UpdateSpritePaletteWithWeather(u8 spritePaletteIndex, bool8 allowFog) } break; } + // If faded out, i.e due to fadescreenswapbuffers, + // Copy unfaded palette to pal decomp buffer + // so it will be restored on fade-in + if (gPaletteFade.y == 16) + CpuFastCopy( + gPlttBufferUnfaded + OBJ_PLTT_ID(spritePaletteIndex), + gPaletteDecompressionBuffer + 2*OBJ_PLTT_ID(spritePaletteIndex), + PLTT_SIZE_4BPP + ); } void ApplyWeatherColorMapToPal(u8 paletteIndex) // now unused / obselete From 9b6843442ac56062630511d497774af9f8231f98 Mon Sep 17 00:00:00 2001 From: Ariel A <24759293+aarant@users.noreply.github.com> Date: Tue, 21 May 2024 22:10:53 -0400 Subject: [PATCH 089/104] fix: add mart light sprite to Route102 --- data/maps/Route102/map.json | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/data/maps/Route102/map.json b/data/maps/Route102/map.json index 68e3549dbb24..f129a2a79521 100644 --- a/data/maps/Route102/map.json +++ b/data/maps/Route102/map.json @@ -141,10 +141,27 @@ "trainer_sight_or_berry_tree_id": "3", "script": "Route102_EventScript_Allen", "flag": "0" + }, + { + "graphics_id": "OBJ_EVENT_GFX_LIGHT_SPRITE", + "x": -3, + "y": 2, + "elevation": 3, + "movement_type": "MOVEMENT_TYPE_NONE", + "movement_range_x": 0, + "movement_range_y": 0, + "trainer_type": "TRAINER_TYPE_NONE", + "trainer_sight_or_berry_tree_id": "2", + "script": "NULL", + "flag": "0" } ], - "warp_events": [], - "coord_events": [], + "warp_events": [ + + ], + "coord_events": [ + + ], "bg_events": [ { "type": "sign", From ed98b0b8ba3ff93a4192ee17ac2960caf0d38bd0 Mon Sep 17 00:00:00 2001 From: Ariel A <24759293+aarant@users.noreply.github.com> Date: Tue, 21 May 2024 22:12:03 -0400 Subject: [PATCH 090/104] fix: added shadows on direct corner map Fixed #18 --- include/constants/event_objects.h | 3 +++ src/event_object_movement.c | 2 +- src/overworld.c | 4 ++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/include/constants/event_objects.h b/include/constants/event_objects.h index 2d911538bc49..b7dea260a7d7 100644 --- a/include/constants/event_objects.h +++ b/include/constants/event_objects.h @@ -312,6 +312,9 @@ #define OBJ_KIND_CLONE 255 // Exclusive to FRLG // Special object event local ids +// Used for link player OWs in CreateLinkPlayerSprite +#define OBJ_EVENT_ID_DYNAMIC_BASE 0xF0 + #define OBJ_EVENT_ID_PLAYER 0xFF #define OBJ_EVENT_ID_CAMERA 0x7F #define OBJ_EVENT_ID_FOLLOWER 0xFE diff --git a/src/event_object_movement.c b/src/event_object_movement.c index 3db73d88a1d4..fe9304e0ccf6 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -1345,7 +1345,7 @@ u8 GetFirstInactiveObjectEventId(void) u8 GetObjectEventIdByLocalIdAndMap(u8 localId, u8 mapNum, u8 mapGroupId) { - if (localId < OBJ_EVENT_ID_FOLLOWER) + if (localId < OBJ_EVENT_ID_DYNAMIC_BASE) return GetObjectEventIdByLocalIdAndMapInternal(localId, mapNum, mapGroupId); return GetObjectEventIdByLocalId(localId); diff --git a/src/overworld.c b/src/overworld.c index 507caad7780c..7a39a2a6ba9c 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -12,6 +12,7 @@ #include "field_camera.h" #include "field_control_avatar.h" #include "field_effect.h" +#include "field_effect_helpers.h" #include "field_message_box.h" #include "field_player_avatar.h" #include "field_screen_effect.h" @@ -61,6 +62,7 @@ #include "wild_encounter.h" #include "frontier_util.h" #include "constants/abilities.h" +#include "constants/event_objects.h" #include "constants/layouts.h" #include "constants/map_types.h" #include "constants/region_map_sections.h" @@ -3345,6 +3347,8 @@ static void CreateLinkPlayerSprite(u8 linkPlayerId, u8 gameVersion) sprite->coordOffsetEnabled = TRUE; sprite->data[0] = linkPlayerId; objEvent->triggerGroundEffectsOnMove = 0; + objEvent->localId = OBJ_EVENT_ID_DYNAMIC_BASE + linkPlayerId; + SetUpShadow(objEvent, sprite); } } From e899218dfb0be7168f1d3ca31bddea3af5d5384f Mon Sep 17 00:00:00 2001 From: Ariel A <24759293+aarant@users.noreply.github.com> Date: Tue, 25 Jun 2024 01:38:52 -0400 Subject: [PATCH 091/104] fix: MSG_COND_TIME_OF_DAY now checks whether map is outdoors and not raining --- src/event_object_movement.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/event_object_movement.c b/src/event_object_movement.c index 39f81f4681a3..878aeac807c9 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -2158,7 +2158,9 @@ bool32 CheckMsgCondition(const struct MsgCondition *cond, struct Pokemon *mon, u case MSG_COND_MUSIC: return (cond->data.raw == GetCurrentMapMusic()); case MSG_COND_TIME_OF_DAY: - return (cond->data.raw == gTimeOfDay); + // Must match time of day, have natural light on the map, + // and not have weather that obscures the sky + return (cond->data.raw == gTimeOfDay && MapHasNaturalLight(gMapHeader.mapType) && GetCurrentWeather() < WEATHER_RAIN); case MSG_COND_NEAR_MB: multi = FindMetatileBehaviorWithinRange( obj->currentCoords.x, obj->currentCoords.y, From 0745eaf2e07873639778fb29258fefe157070980 Mon Sep 17 00:00:00 2001 From: Ariel A <24759293+aarant@users.noreply.github.com> Date: Mon, 12 Aug 2024 22:42:31 -0400 Subject: [PATCH 092/104] fix: Uninitialized value used in `LightenSpritePaletteInFog` --- include/palette.h | 7 +++++++ src/field_weather.c | 6 +++--- src/overworld.c | 14 ++++++-------- src/palette.c | 6 +++--- 4 files changed, 19 insertions(+), 14 deletions(-) diff --git a/include/palette.h b/include/palette.h index fa41b2d0db7f..930499b877f4 100644 --- a/include/palette.h +++ b/include/palette.h @@ -14,6 +14,8 @@ #define PALETTE_FADE_STATUS_LOADING 0xFF #define PALETTES_BG 0x0000FFFF +// like PALETTES_BG but excludes UI pals [13, 15] +#define PALETTES_MAP 0x00001FFF #define PALETTES_OBJECTS 0xFFFF0000 #define PALETTES_ALL (PALETTES_BG | PALETTES_OBJECTS) @@ -24,6 +26,11 @@ #define OBJ_PLTT_ID(n) (OBJ_PLTT_OFFSET + PLTT_ID(n)) #define OBJ_PLTT_ID2(n) (PLTT_ID((n) + 16)) +// Used to determine whether a sprite palette tag +// should be excluded from time (and weather) blending +#define BLEND_IMMUNE_FLAG (1 << 15) +#define IS_BLEND_IMMUNE_TAG(tag) ((tag) & BLEND_IMMUNE_FLAG) + enum { FAST_FADE_IN_FROM_WHITE, diff --git a/src/field_weather.c b/src/field_weather.c index bd15ad074244..1a3a150c4c1b 100644 --- a/src/field_weather.c +++ b/src/field_weather.c @@ -495,7 +495,7 @@ static void ApplyColorMap(u8 startPalIndex, u8 numPalettes, s8 colorMapIndex) { // don't blend special palettes immune to blending if (sPaletteColorMapTypes[curPalIndex] == COLOR_MAP_NONE || - (curPalIndex >= 16 && GetSpritePaletteTagByPaletteNum(curPalIndex - 16) >> 15)) + (curPalIndex >= 16 && IS_BLEND_IMMUNE_TAG(GetSpritePaletteTagByPaletteNum(curPalIndex - 16)))) { // No palette change. palOffset += 16; @@ -684,7 +684,7 @@ static void ApplyFogBlend(u8 blendCoeff, u16 blendColor) CpuFastCopy(gPlttBufferUnfaded, gPlttBufferFaded, PLTT_BUFFER_SIZE * 2); UpdatePalettesWithTime(PALETTES_ALL); // Then blend tile palettes [0, 12] faded->faded with fadeIn color - BlendPalettesFine(0x1FFF, gPlttBufferFaded, gPlttBufferFaded, blendCoeff, blendColor); + BlendPalettesFine(PALETTES_MAP, gPlttBufferFaded, gPlttBufferFaded, blendCoeff, blendColor); // Do fog blending on marked sprite palettes for (curPalIndex = 16; curPalIndex < 32; curPalIndex++) { @@ -708,7 +708,7 @@ static bool8 LightenSpritePaletteInFog(u8 paletteIndex) { u16 i; - if (paletteIndex >= 16 && (GetSpritePaletteTagByPaletteNum(i - 16) >> 15)) // don't blend specialpalette tags + if (paletteIndex >= 16 && IS_BLEND_IMMUNE_TAG(GetSpritePaletteTagByPaletteNum(paletteIndex - 16))) return FALSE; for (i = 0; i < gWeatherPtr->lightenedFogSpritePalsCount; i++) diff --git a/src/overworld.c b/src/overworld.c index 7a39a2a6ba9c..9c4bd0cdfbe9 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -1536,7 +1536,7 @@ void UpdateAltBgPalettes(u16 palettes) { return; palettes &= ~((1 << NUM_PALS_IN_PRIMARY) - 1) | primary->swapPalettes; palettes &= ((1 << NUM_PALS_IN_PRIMARY) - 1) | (secondary->swapPalettes << NUM_PALS_IN_PRIMARY); - palettes &= 0x1FFE; // don't blend palette 0, [13,15] + palettes &= PALETTES_MAP ^ (1 << 0); // don't blend palette 0, [13,15] palettes >>= 1; // start at palette 1 if (!palettes) return; @@ -1558,10 +1558,10 @@ void UpdatePalettesWithTime(u32 palettes) { u32 mask = 1 << 16; if (palettes >= 0x10000) for (i = 0; i < 16; i++, mask <<= 1) - if (GetSpritePaletteTagByPaletteNum(i) >> 15) // Don't blend special sprite palette tags + if (IS_BLEND_IMMUNE_TAG(GetSpritePaletteTagByPaletteNum(i))) palettes &= ~(mask); - palettes &= 0xFFFF1FFF; // Don't blend UI BG palettes [13,15] + palettes &= PALETTES_MAP | PALETTES_OBJECTS; // Don't blend UI pals if (!palettes) return; TimeMixPalettes(palettes, @@ -1575,13 +1575,11 @@ void UpdatePalettesWithTime(u32 palettes) { u8 UpdateSpritePaletteWithTime(u8 paletteNum) { if (MapHasNaturalLight(gMapHeader.mapType)) { - u16 offset; - if (GetSpritePaletteTagByPaletteNum(paletteNum) >> 15) + if (IS_BLEND_IMMUNE_TAG(GetSpritePaletteTagByPaletteNum(paletteNum))) return paletteNum; - offset = (paletteNum + 16) << 4; TimeMixPalettes(1, - gPlttBufferUnfaded + offset, - gPlttBufferFaded + offset, + &gPlttBufferUnfaded[OBJ_PLTT_ID(paletteNum)], + &gPlttBufferFaded[OBJ_PLTT_ID(paletteNum)], (struct BlendSettings *)&gTimeOfDayBlend[currentTimeBlend.time0], (struct BlendSettings *)&gTimeOfDayBlend[currentTimeBlend.time1], currentTimeBlend.weight); diff --git a/src/palette.c b/src/palette.c index 0093a4bf6922..a8be1867a7ce 100644 --- a/src/palette.c +++ b/src/palette.c @@ -515,11 +515,11 @@ static u8 UpdateTimeOfDayPaletteFade(void) u32 i; u32 j = 1; for (i = 0; i < 16; i++, j <<= 1) { // Mask out palettes that should not be light blended - if ((selectedPalettes & j) && !(GetSpritePaletteTagByPaletteNum(i) >> 15)) - timePalettes |= j; + if ((selectedPalettes & j) && !IS_BLEND_IMMUNE_TAG(GetSpritePaletteTagByPaletteNum(i))) + timePalettes |= j; } } else { // tile palettes, don't blend [13, 15] - timePalettes = selectedPalettes & 0x1FFF; + timePalettes = selectedPalettes & PALETTES_MAP; } TimeMixPalettes(timePalettes, src, dst, gPaletteFade.bld0, gPaletteFade.bld1, gPaletteFade.weight); From 0ae5cb1e39f64955107707bbacd1d6dfc117fc01 Mon Sep 17 00:00:00 2001 From: Ariel A <24759293+aarant@users.noreply.github.com> Date: Mon, 12 Aug 2024 23:04:41 -0400 Subject: [PATCH 093/104] meta: cleaned up spacing of lighting code --- src/field_specials.c | 3 +- src/field_weather_effect.c | 28 ++++----- src/overworld.c | 93 ++++++++++++++++------------- src/palette.c | 119 +++++++++++++++++++------------------ src/palette_util.c | 3 +- 5 files changed, 128 insertions(+), 118 deletions(-) diff --git a/src/field_specials.c b/src/field_specials.c index 1c5cfa987b21..33ed0319185a 100644 --- a/src/field_specials.c +++ b/src/field_specials.c @@ -64,6 +64,7 @@ #include "constants/battle_frontier.h" #include "constants/weather.h" #include "constants/metatile_labels.h" +#include "constants/rgb.h" #include "palette.h" #define TAG_ITEM_ICON 5500 @@ -3395,7 +3396,7 @@ void SetDeoxysRockPalette(void) u32 paletteNum = IndexOfSpritePaletteTag(OBJ_EVENT_PAL_TAG_BIRTH_ISLAND_STONE); LoadPalette(&sDeoxysRockPalettes[(u8)VarGet(VAR_DEOXYS_ROCK_LEVEL)], OBJ_PLTT_ID(paletteNum), PLTT_SIZEOF(4)); // Set faded to all black, weather blending handled during fade-in - CpuFill16(0, &gPlttBufferFaded[OBJ_PLTT_ID(paletteNum)], 32); + CpuFill16(RGB_BLACK, &gPlttBufferFaded[OBJ_PLTT_ID(paletteNum)], PLTT_SIZE_4BPP); } void SetPCBoxToSendMon(u8 boxId) diff --git a/src/field_weather_effect.c b/src/field_weather_effect.c index 1d24927859ba..f8d8fa0ac4f1 100644 --- a/src/field_weather_effect.c +++ b/src/field_weather_effect.c @@ -1386,20 +1386,20 @@ static void DestroyFogHorizontalSprites(void); // Updates just the color of shadows to match special weather blending u8 UpdateShadowColor(u16 color) { - u8 paletteNum = IndexOfSpritePaletteTag(TAG_WEATHER_START); - u16 ALIGNED(4) tempBuffer[16]; - u16 blendedColor; - if (paletteNum != 0xFF) { - u16 index = (paletteNum+16)*16+SHADOW_COLOR_INDEX; - gPlttBufferUnfaded[index] = gPlttBufferFaded[index] = color; - // Copy to temporary buffer, blend, and keep just the shadow color index - CpuFastCopy(&gPlttBufferFaded[index-SHADOW_COLOR_INDEX], tempBuffer, 32); - UpdateSpritePaletteWithTime(paletteNum); - blendedColor = gPlttBufferFaded[index]; - CpuFastCopy(tempBuffer, &gPlttBufferFaded[index-SHADOW_COLOR_INDEX], 32); - gPlttBufferFaded[index] = blendedColor; - } - return paletteNum; + u8 paletteNum = IndexOfSpritePaletteTag(TAG_WEATHER_START); + u16 ALIGNED(4) tempBuffer[16]; + u16 blendedColor; + if (paletteNum < 16) { + u16 index = OBJ_PLTT_ID(paletteNum)+SHADOW_COLOR_INDEX; + gPlttBufferUnfaded[index] = gPlttBufferFaded[index] = color; + // Copy to temporary buffer, blend, and keep just the shadow color index + CpuFastCopy(&gPlttBufferFaded[index-SHADOW_COLOR_INDEX], tempBuffer, PLTT_SIZE_4BPP); + UpdateSpritePaletteWithTime(paletteNum); + blendedColor = gPlttBufferFaded[index]; + CpuFastCopy(tempBuffer, &gPlttBufferFaded[index-SHADOW_COLOR_INDEX], PLTT_SIZE_4BPP); + gPlttBufferFaded[index] = blendedColor; + } + return paletteNum; } void FogHorizontal_InitVars(void) diff --git a/src/overworld.c b/src/overworld.c index 9c4bd0cdfbe9..cbe03477685e 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -1473,9 +1473,9 @@ void CB1_Overworld(void) const struct BlendSettings gTimeOfDayBlend[] = { - [TIME_OF_DAY_NIGHT] = {.coeff = 10, .blendColor = TINT_NIGHT, .isTint = TRUE}, - [TIME_OF_DAY_TWILIGHT] = {.coeff = 4, .blendColor = 0xA8B0E0, .isTint = TRUE}, - [TIME_OF_DAY_DAY] = {.coeff = 0, .blendColor = 0}, + [TIME_OF_DAY_NIGHT] = {.coeff = 10, .blendColor = TINT_NIGHT, .isTint = TRUE}, + [TIME_OF_DAY_TWILIGHT] = {.coeff = 4, .blendColor = 0xA8B0E0, .isTint = TRUE}, + [TIME_OF_DAY_DAY] = {.coeff = 0, .blendColor = 0}, }; u8 UpdateTimeOfDay(void) { @@ -1523,8 +1523,12 @@ u8 UpdateTimeOfDay(void) { } bool8 MapHasNaturalLight(u8 mapType) { // Whether a map type is naturally lit/outside - return mapType == MAP_TYPE_TOWN || mapType == MAP_TYPE_CITY || mapType == MAP_TYPE_ROUTE - || mapType == MAP_TYPE_OCEAN_ROUTE; + return ( + mapType == MAP_TYPE_TOWN + || mapType == MAP_TYPE_CITY + || mapType == MAP_TYPE_ROUTE + || mapType == MAP_TYPE_OCEAN_ROUTE + ); } // Update & mix day / night bg palettes (into unfaded) @@ -1553,38 +1557,42 @@ void UpdateAltBgPalettes(u16 palettes) { } void UpdatePalettesWithTime(u32 palettes) { - if (MapHasNaturalLight(gMapHeader.mapType)) { - u32 i; - u32 mask = 1 << 16; - if (palettes >= 0x10000) - for (i = 0; i < 16; i++, mask <<= 1) - if (IS_BLEND_IMMUNE_TAG(GetSpritePaletteTagByPaletteNum(i))) - palettes &= ~(mask); + if (MapHasNaturalLight(gMapHeader.mapType)) { + u32 i; + u32 mask = 1 << 16; + if (palettes >= (1 << 16)) + for (i = 0; i < 16; i++, mask <<= 1) + if (IS_BLEND_IMMUNE_TAG(GetSpritePaletteTagByPaletteNum(i))) + palettes &= ~(mask); palettes &= PALETTES_MAP | PALETTES_OBJECTS; // Don't blend UI pals if (!palettes) - return; - TimeMixPalettes(palettes, - gPlttBufferUnfaded, - gPlttBufferFaded, - (struct BlendSettings *)&gTimeOfDayBlend[currentTimeBlend.time0], - (struct BlendSettings *)&gTimeOfDayBlend[currentTimeBlend.time1], - currentTimeBlend.weight); - } + return; + TimeMixPalettes( + palettes, + gPlttBufferUnfaded, + gPlttBufferFaded, + (struct BlendSettings *)&gTimeOfDayBlend[currentTimeBlend.time0], + (struct BlendSettings *)&gTimeOfDayBlend[currentTimeBlend.time1], + currentTimeBlend.weight + ); + } } u8 UpdateSpritePaletteWithTime(u8 paletteNum) { - if (MapHasNaturalLight(gMapHeader.mapType)) { - if (IS_BLEND_IMMUNE_TAG(GetSpritePaletteTagByPaletteNum(paletteNum))) - return paletteNum; - TimeMixPalettes(1, - &gPlttBufferUnfaded[OBJ_PLTT_ID(paletteNum)], - &gPlttBufferFaded[OBJ_PLTT_ID(paletteNum)], - (struct BlendSettings *)&gTimeOfDayBlend[currentTimeBlend.time0], - (struct BlendSettings *)&gTimeOfDayBlend[currentTimeBlend.time1], - currentTimeBlend.weight); - } - return paletteNum; + if (MapHasNaturalLight(gMapHeader.mapType)) { + if (IS_BLEND_IMMUNE_TAG(GetSpritePaletteTagByPaletteNum(paletteNum))) + return paletteNum; + TimeMixPalettes( + 1, + &gPlttBufferUnfaded[OBJ_PLTT_ID(paletteNum)], + &gPlttBufferFaded[OBJ_PLTT_ID(paletteNum)], + (struct BlendSettings *)&gTimeOfDayBlend[currentTimeBlend.time0], + (struct BlendSettings *)&gTimeOfDayBlend[currentTimeBlend.time1], + currentTimeBlend.weight + ); + } + return paletteNum; } static void OverworldBasic(void) @@ -1600,19 +1608,20 @@ static void OverworldBasic(void) DoScheduledBgTilemapCopiesToVram(); // Every minute if no palette fade is active, update TOD blending as needed if (!gPaletteFade.active && ++gTimeUpdateCounter >= 3600) { - struct TimeBlendSettings cachedBlend = { - .time0 = currentTimeBlend.time0, - .time1 = currentTimeBlend.time1, - .weight = currentTimeBlend.weight, - }; - gTimeUpdateCounter = 0; - UpdateTimeOfDay(); - if (cachedBlend.time0 != currentTimeBlend.time0 - || cachedBlend.time1 != currentTimeBlend.time1 - || cachedBlend.weight != currentTimeBlend.weight) { + struct TimeBlendSettings cachedBlend = { + .time0 = currentTimeBlend.time0, + .time1 = currentTimeBlend.time1, + .weight = currentTimeBlend.weight, + }; + gTimeUpdateCounter = 0; + UpdateTimeOfDay(); + if (cachedBlend.time0 != currentTimeBlend.time0 + || cachedBlend.time1 != currentTimeBlend.time1 + || cachedBlend.weight != currentTimeBlend.weight) + { UpdateAltBgPalettes(PALETTES_BG); UpdatePalettesWithTime(PALETTES_ALL); - } + } } } diff --git a/src/palette.c b/src/palette.c index a8be1867a7ce..ddc0688209a4 100644 --- a/src/palette.c +++ b/src/palette.c @@ -525,15 +525,15 @@ static u8 UpdateTimeOfDayPaletteFade(void) // palettes that were not blended above must be copied through if ((copyPalettes = ~timePalettes)) { - u16 * src1 = src; - u16 * dst1 = dst; - while (copyPalettes) { - if (copyPalettes & 1) - CpuFastCopy(src1, dst1, 32); - copyPalettes >>= 1; - src1 += 16; - dst1 += 16; - } + u16 * src1 = src; + u16 * dst1 = dst; + while (copyPalettes) { + if (copyPalettes & 1) + CpuFastCopy(src1, dst1, 32); + copyPalettes >>= 1; + src1 += 16; + dst1 += 16; + } } // Then, blend from faded->faded with native BlendPalettes @@ -1330,58 +1330,59 @@ void TintPalette_CustomTone(u16 *palette, u16 count, u16 rTone, u16 gTone, u16 b // Tints from Unfaded to Faded, using a 15-bit GBA color void TintPalette_RGB_Copy(u16 palOffset, u32 blendColor) { - s32 newR, newG, newB, rTone, gTone, bTone; - u16 * src = gPlttBufferUnfaded + palOffset; - u16 * dst = gPlttBufferFaded + palOffset; - u32 defaultBlendColor = DEFAULT_LIGHT_COLOR; - u16 *srcEnd = src + 16; - u16 altBlendIndices = *dst++ = *src++; // color 0 is copied through unchanged - u32 altBlendColor; - - newR = ((blendColor << 27) >> 27) << 3; - newG = ((blendColor << 22) >> 27) << 3; - newB = ((blendColor << 17) >> 27) << 3; - - if (altBlendIndices >> 15) { // High bit set; bitmask of which colors to alt-blend - // Note that bit 0 of altBlendIndices specifies color 1 - altBlendColor = src[14]; // color 15 - if (altBlendColor >> 15) { // Set alternate blend color - rTone = ((altBlendColor << 27) >> 27) << 3; - gTone = ((altBlendColor << 22) >> 27) << 3; - bTone = ((altBlendColor << 17) >> 27) << 3; - } else { // Set default blend color - rTone = ((defaultBlendColor << 27) >> 27) << 3; - gTone = ((defaultBlendColor << 22) >> 27) << 3; - bTone = ((defaultBlendColor << 17) >> 27) << 3; + s32 newR, newG, newB, rTone, gTone, bTone; + u16 * src = gPlttBufferUnfaded + palOffset; + u16 * dst = gPlttBufferFaded + palOffset; + u32 defaultBlendColor = DEFAULT_LIGHT_COLOR; + u16 *srcEnd = src + 16; + u16 altBlendIndices = *dst++ = *src++; // color 0 is copied through unchanged + u32 altBlendColor; + + newR = ((blendColor << 27) >> 27) << 3; + newG = ((blendColor << 22) >> 27) << 3; + newB = ((blendColor << 17) >> 27) << 3; + + if (altBlendIndices >> 15) { // High bit set; bitmask of which colors to alt-blend + // Note that bit 0 of altBlendIndices specifies color 1 + altBlendColor = src[14]; // color 15 + if (altBlendColor >> 15) { // Set alternate blend color + rTone = ((altBlendColor << 27) >> 27) << 3; + gTone = ((altBlendColor << 22) >> 27) << 3; + bTone = ((altBlendColor << 17) >> 27) << 3; + } else { // Set default blend color + rTone = ((defaultBlendColor << 27) >> 27) << 3; + gTone = ((defaultBlendColor << 22) >> 27) << 3; + bTone = ((defaultBlendColor << 17) >> 27) << 3; + } + } else { + altBlendIndices = 0; } - } else { - altBlendIndices = 0; - } - while (src != srcEnd) { - u32 srcColor = *src; - s32 r = (srcColor << 27) >> 27; - s32 g = (srcColor << 22) >> 27; - s32 b = (srcColor << 17) >> 27; - - if (altBlendIndices & 1) { - r = (u16)((rTone * r)) >> 8; - g = (u16)((gTone * g)) >> 8; - b = (u16)((bTone * b)) >> 8; - } else { // Use provided blend color - r = (u16)((newR * r)) >> 8; - g = (u16)((newG * g)) >> 8; - b = (u16)((newB * b)) >> 8; + + while (src != srcEnd) { + u32 srcColor = *src; + s32 r = (srcColor << 27) >> 27; + s32 g = (srcColor << 22) >> 27; + s32 b = (srcColor << 17) >> 27; + + if (altBlendIndices & 1) { + r = (u16)((rTone * r)) >> 8; + g = (u16)((gTone * g)) >> 8; + b = (u16)((bTone * b)) >> 8; + } else { // Use provided blend color + r = (u16)((newR * r)) >> 8; + g = (u16)((newG * g)) >> 8; + b = (u16)((newB * b)) >> 8; + } + if (r > 31) + r = 31; + if (g > 31) + g = 31; + if (b > 31) + b = 31; + src++; + *dst++ = RGB2(r, g, b); + altBlendIndices >>= 1; } - if (r > 31) - r = 31; - if (g > 31) - g = 31; - if (b > 31) - b = 31; - src++; - *dst++ = RGB2(r, g, b); - altBlendIndices >>= 1; - } } #define tCoeff data[0] diff --git a/src/palette_util.c b/src/palette_util.c index bcf8c348198a..54549ffcce00 100755 --- a/src/palette_util.c +++ b/src/palette_util.c @@ -385,8 +385,7 @@ void UpdatePulseBlend(struct PulseBlend *pulseBlend) if (--pulseBlendPalette->delayCounter == 0xFF) { pulseBlendPalette->delayCounter = pulseBlendPalette->pulseBlendSettings.delay; - // TODO: Optimize pulse blending - CpuFastCopy(gPlttBufferUnfaded + pulseBlendPalette->pulseBlendSettings.paletteOffset, gPlttBufferFaded + pulseBlendPalette->pulseBlendSettings.paletteOffset, 32); + CpuFastCopy(gPlttBufferUnfaded + pulseBlendPalette->pulseBlendSettings.paletteOffset, gPlttBufferFaded + pulseBlendPalette->pulseBlendSettings.paletteOffset, PLTT_SIZE_4BPP); UpdatePalettesWithTime(1 << (pulseBlendPalette->pulseBlendSettings.paletteOffset >> 4)); // pulseBlendSettings has a numColors field, but it is only ever set to 16 (for mirage tower) // So, it's ok to use the fine blending here which blends the entire palette From ca755420edfa15ce273b2aab471464850953eb2c Mon Sep 17 00:00:00 2001 From: Ariel A <24759293+aarant@users.noreply.github.com> Date: Mon, 12 Aug 2024 23:06:30 -0400 Subject: [PATCH 094/104] meta: ignored refactoring change --- .git-blame-ignore-revs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 54f7faa471ab..09a56f526152 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -1,4 +1,7 @@ 725252905baf28dbb9298dd5fa0daaf0e804a455 afbb88d77ada8a636a318ec32b61b4ea849d85ab f861504cfc50941768286c0703d24ab0aaceb88e -ebbcb7d025cff716eec5008b5dd2b7d55aa8c3f3 \ No newline at end of file +ebbcb7d025cff716eec5008b5dd2b7d55aa8c3f3 +# 24759293+aarant@users.noreply.github.com +# meta: cleaned up spacing of lighting code +0ae5cb1e39f64955107707bbacd1d6dfc117fc01 From fc3a700357cfca61a452fbf21ba7a04d3ceddd14 Mon Sep 17 00:00:00 2001 From: Greenphx9 <55181320+Greenphx9@users.noreply.github.com> Date: Sun, 25 Aug 2024 18:01:23 +1000 Subject: [PATCH 095/104] Fix up some auto merge stuff --- include/global.h | 2 ++ include/overworld.h | 4 ++++ src/decompress.c | 4 ++-- src/field_weather_effect.c | 1 - 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/include/global.h b/include/global.h index 88892bd60e04..c09f8af779c4 100644 --- a/include/global.h +++ b/include/global.h @@ -536,6 +536,8 @@ struct SaveBlock2 extern struct SaveBlock2 *gSaveBlock2Ptr; +extern u8 UpdateSpritePaletteWithTime(u8); + struct SecretBaseParty { u32 personality[PARTY_SIZE]; diff --git a/include/overworld.h b/include/overworld.h index 0cc0ab5dcef1..06b8cf1ee80c 100644 --- a/include/overworld.h +++ b/include/overworld.h @@ -25,6 +25,10 @@ #define MOVEMENT_MODE_SCRIPTED 2 #define SKIP_OBJECT_EVENT_LOAD 1 +#define TIME_OF_DAY_NIGHT 0 +#define TIME_OF_DAY_TWILIGHT 1 +#define TIME_OF_DAY_DAY 2 +#define TIME_OF_DAY_MAX TIME_OF_DAY_DAY struct InitialPlayerAvatarState { diff --git a/src/decompress.c b/src/decompress.c index 30337f5a8dc3..d9ad044ebbfd 100644 --- a/src/decompress.c +++ b/src/decompress.c @@ -60,7 +60,7 @@ u16 LoadCompressedSpriteSheetByTemplate(const struct SpriteTemplate *template, s // Check for LZ77 header and read uncompressed size, or fallback if not compressed (zero size) if ((size = IsLZ77Data(template->images->data, TILE_SIZE_4BPP, sizeof(gDecompressionBuffer))) == 0) - return LoadSpriteSheetByTemplate(template, 0, offset); + return LoadSpriteSheetByTemplateWithOffset(template, 0, offset); LZ77UnCompWram(template->images->data, gDecompressionBuffer); myImage.data = gDecompressionBuffer; @@ -68,7 +68,7 @@ u16 LoadCompressedSpriteSheetByTemplate(const struct SpriteTemplate *template, s myTemplate.images = &myImage; myTemplate.tileTag = template->tileTag; - return LoadSpriteSheetByTemplate(&myTemplate, 0, offset); + return LoadSpriteSheetByTemplateWithOffset(&myTemplate, 0, offset); } void LoadCompressedSpriteSheetOverrideBuffer(const struct CompressedSpriteSheet *src, void *buffer) diff --git a/src/field_weather_effect.c b/src/field_weather_effect.c index efd80a7178f8..9810cdfcaa6c 100644 --- a/src/field_weather_effect.c +++ b/src/field_weather_effect.c @@ -1410,7 +1410,6 @@ void FogHorizontal_Main(void) case 0: CreateFogHorizontalSprites(); if (gWeatherPtr->currWeather == WEATHER_FOG_HORIZONTAL) { - u8 paletteNum = IndexOfSpritePaletteTag(TAG_WEATHER_START); Weather_SetTargetBlendCoeffs(12, 8, 3); UpdateShadowColor(0x3DEF); // Gray } else From d80bf06daabdacd6911471983d52306d46ae0147 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Thu, 29 Aug 2024 20:38:22 -0400 Subject: [PATCH 096/104] Removed unused fields --- src/overworld.c | 2 -- src/palette.c | 1 - 2 files changed, 3 deletions(-) diff --git a/src/overworld.c b/src/overworld.c index 371c1797cce1..10ba8f7368fe 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -827,8 +827,6 @@ bool8 SetDiveWarpDive(u16 x, u16 y) void LoadMapFromCameraTransition(u8 mapGroup, u8 mapNum) { - s32 paletteIndex; - SetWarpDestination(mapGroup, mapNum, WARP_ID_NONE, -1, -1); // Dont transition map music between BF Outside West/East diff --git a/src/palette.c b/src/palette.c index 867b96ddfbe5..ee03b5d6a934 100644 --- a/src/palette.c +++ b/src/palette.c @@ -226,7 +226,6 @@ void ResetPaletteFadeControl(void) // Like normal palette fade, but respects sprite/tile palettes immune to time of day fading static u8 UpdateTimeOfDayPaletteFade(void) { - u8 paletteNum; u16 paletteOffset; u16 selectedPalettes; u16 timePalettes = 0; // palettes passed to the time-blender From aa6d540b7520b1a2c0489a9fb263412f1798d019 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Fri, 30 Aug 2024 12:17:31 -0400 Subject: [PATCH 097/104] Code style adjustments --- asm/macros/event.inc | 4 +- gflib/sprite.c | 8 +- include/global.h | 2 +- src/battle_transition.c | 5 +- src/contest_effect.c | 37 ++++---- src/event_object_movement.c | 78 ++++++++++------ src/field_effect.c | 15 ++- src/field_effect_helpers.c | 15 ++- src/field_weather.c | 50 ++++++---- src/field_weather_effect.c | 14 ++- src/fieldmap.c | 14 ++- src/heal_location.c | 8 +- src/overworld.c | 84 ++++++++++------- src/palette.c | 171 +++++++++++++++++++++++++---------- src/pokemon_summary_screen.c | 6 +- src/scrcmd.c | 3 +- src/tv.c | 3 +- 17 files changed, 339 insertions(+), 178 deletions(-) diff --git a/asm/macros/event.inc b/asm/macros/event.inc index 559573f5442b..17420538cd68 100644 --- a/asm/macros/event.inc +++ b/asm/macros/event.inc @@ -1800,11 +1800,11 @@ @ Equivalent to fadescreen but copies gPlttBufferUnfaded to gDecompressionBuffer on the fade out @ and the reverse on the fade in, in effect saving gPlttBufferUnfaded to restore it. - @ If nowait set, does not wait for the fade to complete + @ If nowait set, does not wait for the fade to complete .macro fadescreenswapbuffers mode:req, nowait=0 .byte 0xdc .byte \mode - .byte \nowait + .byte \nowait .endm @ Buffers the specified trainer's class name to the given string var. diff --git a/gflib/sprite.c b/gflib/sprite.c index 7e0d61a7f0f5..67192aabab2c 100644 --- a/gflib/sprite.c +++ b/gflib/sprite.c @@ -1478,7 +1478,8 @@ u16 LoadSpriteSheetByTemplateWithOffset(const struct SpriteTemplate *template, u return LoadSpriteSheetWithOffset(&sheet, offset); } // Like LoadSpriteSheet, but checks if already, and uses template image frames -u16 LoadSpriteSheetByTemplate(const struct SpriteTemplate *template, u8 frame) { +u16 LoadSpriteSheetByTemplate(const struct SpriteTemplate *template, u8 frame) +{ u16 tileStart; struct SpriteSheet tempSheet; // error if template is null or tile tag or images not set @@ -1608,7 +1609,8 @@ void LoadSpritePalettes(const struct SpritePalette *palettes) break; } -u8 LoadSpritePaletteInSlot(const struct SpritePalette *palette, u8 paletteNum) { +u8 LoadSpritePaletteInSlot(const struct SpritePalette *palette, u8 paletteNum) +{ paletteNum = min(15, paletteNum); sSpritePaletteTags[paletteNum] = palette->tag; DoLoadSpritePalette(palette->data, paletteNum * 16); @@ -1617,7 +1619,7 @@ u8 LoadSpritePaletteInSlot(const struct SpritePalette *palette, u8 paletteNum) { void DoLoadSpritePalette(const u16 *src, u16 paletteOffset) { - LoadPaletteFast(src, paletteOffset + OBJ_PLTT_OFFSET, PLTT_SIZE_4BPP); + LoadPaletteFast(src, OBJ_PLTT_OFFSET + paletteOffset, PLTT_SIZE_4BPP); } u8 AllocSpritePalette(u16 tag) diff --git a/include/global.h b/include/global.h index 634ce6e5ecab..ada0bbb2f3e9 100644 --- a/include/global.h +++ b/include/global.h @@ -954,7 +954,7 @@ struct MysteryGiftSave struct WonderCardMetadata cardMetadata; u16 questionnaireWords[NUM_QUESTIONNAIRE_WORDS]; struct WonderNewsMetadata newsMetadata; - u32 trainerIds[2][5]; // Saved ids for 10 trainers, 5 each for battles and trades + u32 trainerIds[2][5]; // Saved ids for 10 trainers, 5 each for battles and trades }; // 0x36C 0x3598 // For external event data storage. The majority of these may have never been used. diff --git a/src/battle_transition.c b/src/battle_transition.c index d2177070f244..6fc7d1ea4772 100644 --- a/src/battle_transition.c +++ b/src/battle_transition.c @@ -3952,8 +3952,9 @@ static bool8 TransitionIntro_FadeFromGray(struct Task *task) BlendPalettes(PALETTES_ALL, task->tBlend, RGB(11, 11, 11)); // Restore BLDCNT SetGpuReg(REG_OFFSET_BLDCNT, task->tBldCntSaved); - if (paletteNum < 16) { - u16 index = (paletteNum+16)*16+9; // SHADOW_COLOR_INDEX + if (paletteNum < 16) + { + u16 index = ((paletteNum + 16) * 16) + 9; // SHADOW_COLOR_INDEX gPlttBufferFaded[index] = task->tShadowColor; } } diff --git a/src/contest_effect.c b/src/contest_effect.c index aa22f1d13dc8..e6735a869852 100644 --- a/src/contest_effect.c +++ b/src/contest_effect.c @@ -132,7 +132,7 @@ static void ContestEffect_UserLessEasilyStartled(void) SetContestantEffectStringID(eContestAppealResults.contestant,CONTEST_STRING_STOPPED_CARING); } -// Slightly startles the POKéMON in front. +// Slightly startles the POK�MON in front. static void ContestEffect_StartleFrontMon(void) { u8 idx = 0; @@ -180,7 +180,7 @@ static void ContestEffect_StartlePrevMons(void) SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_ATTEMPT_STARTLE); } -// Startles the POKéMON that appealed before the user. +// Startles the POK�MON that appealed before the user. static void ContestEffect_StartlePrevMon2(void) { u8 rval = Random() % 10; @@ -197,7 +197,7 @@ static void ContestEffect_StartlePrevMon2(void) ContestEffect_StartleFrontMon(); } -// Startles all POKéMON that appealed before the user. +// Startles all POK�MON that appealed before the user. static void ContestEffect_StartlePrevMons2(void) { u8 numStartled = 0; @@ -273,7 +273,7 @@ static void ContestEffect_ShiftJudgeAttention(void) } } -// Startles the POKéMON that has the JUDGE's attention. +// Startles the POK�MON that has the JUDGE's attention. static void ContestEffect_StartleMonWithJudgesAttention(void) { u8 numStartled = 0; @@ -311,7 +311,7 @@ static void ContestEffect_JamsOthersButMissOneTurn(void) SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_ATTEMPT_STARTLE); } -// Startles POKéMON that made a same-type appeal. +// Startles POK�MON that made a same-type appeal. static void ContestEffect_StartleMonsSameTypeAppeal(void) { u16 move = eContestantStatus[eContestAppealResults.contestant].currMove; @@ -319,42 +319,42 @@ static void ContestEffect_StartleMonsSameTypeAppeal(void) SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_ATTEMPT_STARTLE); } -// Badly startles POKéMON that made COOL appeals. +// Badly startles POK�MON that made COOL appeals. static void ContestEffect_StartleMonsCoolAppeal(void) { JamByMoveCategory(CONTEST_CATEGORY_COOL); SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_ATTEMPT_STARTLE); } -// Badly startles POKéMON that made BEAUTY appeals. +// Badly startles POK�MON that made BEAUTY appeals. static void ContestEffect_StartleMonsBeautyAppeal(void) { JamByMoveCategory(CONTEST_CATEGORY_BEAUTY); SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_ATTEMPT_STARTLE); } -// Badly startles POKéMON that made CUTE appeals. +// Badly startles POK�MON that made CUTE appeals. static void ContestEffect_StartleMonsCuteAppeal(void) { JamByMoveCategory(CONTEST_CATEGORY_CUTE); SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_ATTEMPT_STARTLE); } -// Badly startles POKéMON that made SMART appeals. +// Badly startles POK�MON that made SMART appeals. static void ContestEffect_StartleMonsSmartAppeal(void) { JamByMoveCategory(CONTEST_CATEGORY_SMART); SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_ATTEMPT_STARTLE); } -// Badly startles POKéMON that made TOUGH appeals. +// Badly startles POK�MON that made TOUGH appeals. static void ContestEffect_StartleMonsToughAppeal(void) { JamByMoveCategory(CONTEST_CATEGORY_TOUGH); SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_ATTEMPT_STARTLE); } -// Makes one POKéMON after the user nervous. +// Makes one POK�MON after the user nervous. static void ContestEffect_MakeFollowingMonNervous(void) { bool32 hitAny = FALSE; @@ -386,7 +386,7 @@ static void ContestEffect_MakeFollowingMonNervous(void) SetContestantEffectStringID2(eContestAppealResults.contestant, CONTEST_STRING_MESSED_UP2); } -// Makes all POKéMON after the user nervous. +// Makes all POK�MON after the user nervous. static void ContestEffect_MakeFollowingMonsNervous(void) { u8 numUnnerved = 0; @@ -493,7 +493,7 @@ static void ContestEffect_WorsenConditionOfPrevMons(void) SetContestantEffectStringID2(eContestAppealResults.contestant, CONTEST_STRING_IGNORED); } -// Badly startles POKéMON in good condition. +// Badly startles POK�MON in good condition. static void ContestEffect_BadlyStartlesMonsInGoodCondition(void) { u8 numHit = 0; @@ -619,15 +619,18 @@ static void ContestEffect_QualityDependsOnTiming(void) { appeal = 10; SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_APPEAL_NOT_VERY_WELL); - } else if (rval < 6) + } + else if (rval < 6) { appeal = 20; SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_APPEAL_SLIGHTLY_WELL2); - } else if (rval < 8) + } + else if (rval < 8) { appeal = 40; SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_APPEAL_PRETTY_WELL2); - } else if (rval < 9) + } + else if (rval < 9) { appeal = 60; SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_APPEAL_VERY_WELL); @@ -892,7 +895,7 @@ static void ContestEffect_ExciteAudienceInAnyContest(void) } } -// Badly startles all POKéMON that made good appeals. +// Badly startles all POK�MON that made good appeals. static void ContestEffect_BadlyStartleMonsWithGoodAppeals(void) { int i; diff --git a/src/event_object_movement.c b/src/event_object_movement.c index 075664a31e6a..42f68473a1d5 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -1534,11 +1534,13 @@ u16 LoadSheetGraphicsInfo(const struct ObjectEventGraphicsInfo *info, u16 uuid, // Load, then free, in order to avoid displaying garbage data // before sprite's `sheetTileStart` is repointed tileStart = LoadCompressedSpriteSheetByTemplate(&template, TILE_SIZE_4BPP << sheetSpan); - if (oldTiles) { + if (oldTiles) + { FieldEffectFreeTilesIfUnused(oldTiles); // We weren't able to load the sheet; // retry (after having freed), and set sprite to invisible until done - if (tileStart <= 0) { + if (tileStart <= 0) + { if (sprite) sprite->invisible = TRUE; tileStart = LoadCompressedSpriteSheetByTemplate(&template, TILE_SIZE_4BPP << sheetSpan); @@ -1764,7 +1766,8 @@ static u8 LoadDynamicFollowerPaletteFromGraphicsId(u16 graphicsId, bool8 shiny, } // Like LoadObjectEventPalette, but overwrites the palette tag that is loaded -static u8 LoadObjectEventPaletteWithTag(u16 paletteTag, u16 overTag) { +static u8 LoadObjectEventPaletteWithTag(u16 paletteTag, u16 overTag) +{ u32 i = FindObjectEventPaletteIndexByTag(paletteTag); struct SpritePalette spritePalette; if (i == 0xFF) @@ -1795,17 +1798,17 @@ u8 CreateObjectGraphicsSpriteWithTag(u16 graphicsId, void (*callback)(struct Spr { u32 paletteNum = LoadDynamicFollowerPaletteFromGraphicsId(graphicsId, isShiny, spriteTemplate); spriteTemplate->paletteTag = GetSpritePaletteTagByPaletteNum(paletteNum); - } - else if (spriteTemplate->paletteTag != TAG_NONE) + } + else if (spriteTemplate->paletteTag != TAG_NONE) { if (paletteTag == TAG_NONE) LoadObjectEventPalette(spriteTemplate->paletteTag); - else + else { LoadObjectEventPaletteWithTag(spriteTemplate->paletteTag, paletteTag); spriteTemplate->paletteTag = paletteTag; } - } + } if (OW_GFX_COMPRESS) { @@ -1829,7 +1832,8 @@ u8 CreateObjectGraphicsSpriteWithTag(u16 graphicsId, void (*callback)(struct Spr return spriteId; } -u8 CreateObjectGraphicsSprite(u16 graphicsId, void (*callback)(struct Sprite *), s16 x, s16 y, u8 subpriority) { +u8 CreateObjectGraphicsSprite(u16 graphicsId, void (*callback)(struct Sprite *), s16 x, s16 y, u8 subpriority) +{ return CreateObjectGraphicsSpriteWithTag(graphicsId, callback, x, y, subpriority, TAG_NONE); } @@ -1977,7 +1981,7 @@ static u8 LoadDynamicFollowerPalette(u16 species, u8 form, bool32 shiny) if (gWeatherPtr->currWeather != WEATHER_FOG_HORIZONTAL) // don't want to weather blend in fog UpdateSpritePaletteWithWeather(paletteNum, FALSE); - + return paletteNum; } @@ -2479,7 +2483,8 @@ void GetFollowerAction(struct ScriptContext *ctx) // Essentially a big switch fo } // Sprite callback for light sprites -void UpdateLightSprite(struct Sprite *sprite) { +void UpdateLightSprite(struct Sprite *sprite) +{ s16 left = gSaveBlock1Ptr->pos.x - 2; s16 right = gSaveBlock1Ptr->pos.x + 17; s16 top = gSaveBlock1Ptr->pos.y; @@ -2489,7 +2494,8 @@ void UpdateLightSprite(struct Sprite *sprite) { u16 sheetTileStart; u32 paletteNum; // Ripped from RemoveObjectEventIfOutsideView - if (!(x >= left && x <= right && y >= top && y <= bottom)) { + if (!(x >= left && x <= right && y >= top && y <= bottom)) + { sheetTileStart = sprite->sheetTileStart; paletteNum = sprite->oam.paletteNum; DestroySprite(sprite); @@ -2499,22 +2505,29 @@ void UpdateLightSprite(struct Sprite *sprite) { return; } - if (gTimeOfDay != TIME_OF_DAY_NIGHT) { + if (gTimeOfDay != TIME_OF_DAY_NIGHT) + { sprite->invisible = TRUE; return; } - switch (sprite->data[5]) { // lightType + switch (sprite->data[5]) // lightType + { case 0: - if (gPaletteFade.active) { // if palette fade is active, don't flicker since the timer won't be updated + if (gPaletteFade.active) // if palette fade is active, don't flicker since the timer won't be updated + { Weather_SetBlendCoeffs(7, 12); sprite->invisible = FALSE; - } else if (gPlayerAvatar.tileTransitionState) { + } + else if (gPlayerAvatar.tileTransitionState) + { Weather_SetBlendCoeffs(7, 12); // As long as the second coefficient stays 12, shadows will not change sprite->invisible = FALSE; if (GetSpritePaletteTagByPaletteNum(sprite->oam.paletteNum) == OBJ_EVENT_PAL_TAG_LIGHT_2) LoadSpritePaletteInSlot(&sObjectEventSpritePalettes[FindObjectEventPaletteIndexByTag(OBJ_EVENT_PAL_TAG_LIGHT)], sprite->oam.paletteNum); - } else if ((sprite->invisible = gTimeUpdateCounter & 1)) { + } + else if ((sprite->invisible = gTimeUpdateCounter & 1)) + { Weather_SetBlendCoeffs(12, 12); if (GetSpritePaletteTagByPaletteNum(sprite->oam.paletteNum) == OBJ_EVENT_PAL_TAG_LIGHT) LoadSpritePaletteInSlot(&sObjectEventSpritePalettes[FindObjectEventPaletteIndexByTag(OBJ_EVENT_PAL_TAG_LIGHT_2)], sprite->oam.paletteNum); @@ -2528,11 +2541,13 @@ void UpdateLightSprite(struct Sprite *sprite) { } // Spawn a light at a map coordinate -static void SpawnLightSprite(s16 x, s16 y, s16 camX, s16 camY, u32 lightType) { +static void SpawnLightSprite(s16 x, s16 y, s16 camX, s16 camY, u32 lightType) +{ struct Sprite *sprite; const struct SpriteTemplate *template; u8 i; - for (i = 0; i < MAX_SPRITES; i++) { + for (i = 0; i < MAX_SPRITES; i++) + { sprite = &gSprites[i]; if (sprite->inUse && sprite->callback == UpdateLightSprite && sprite->data[6] == x && sprite->data[7] == y) return; @@ -2552,7 +2567,8 @@ static void SpawnLightSprite(s16 x, s16 y, s16 camX, s16 camY, u32 lightType) { sprite->affineAnims = gDummySpriteAffineAnimTable; sprite->affineAnimBeginning = TRUE; sprite->coordOffsetEnabled = TRUE; - switch (lightType) { + switch (lightType) + { case 0: // Rustboro lanterns sprite->centerToCornerVecX = -(32 >> 1); sprite->centerToCornerVecY = -(32 >> 1); @@ -2571,7 +2587,8 @@ static void SpawnLightSprite(s16 x, s16 y, s16 camX, s16 camY, u32 lightType) { } } -void TrySpawnLightSprites(s16 camX, s16 camY) { +void TrySpawnLightSprites(s16 camX, s16 camY) +{ u8 i; u8 objectCount; s16 left = gSaveBlock1Ptr->pos.x - 2; @@ -2588,7 +2605,8 @@ void TrySpawnLightSprites(s16 camX, s16 camY) { else objectCount = gMapHeader.events->objectEventCount; - for (i = 0; i < objectCount; i++) { + for (i = 0; i < objectCount; i++) + { struct ObjectEventTemplate *template = &gSaveBlock1Ptr->objectEventTemplates[i]; s16 npcX = template->x + MAP_OFFSET; s16 npcY = template->y + MAP_OFFSET; @@ -2623,10 +2641,11 @@ void TrySpawnObjectEvents(s16 cameraX, s16 cameraY) s16 npcX = template->x + MAP_OFFSET; s16 npcY = template->y + MAP_OFFSET; - if (top <= npcY && bottom >= npcY && left <= npcX && right >= npcX && !FlagGet(template->flagId)) { - if (template->graphicsId == OBJ_EVENT_GFX_LIGHT_SPRITE) { // light sprite instead - SpawnLightSprite(npcX, npcY, cameraX, cameraY, template->trainerRange_berryTreeId); - } else + if (top <= npcY && bottom >= npcY && left <= npcX && right >= npcX && !FlagGet(template->flagId)) + { + if (template->graphicsId == OBJ_EVENT_GFX_LIGHT_SPRITE) + SpawnLightSprite(npcX, npcY, cameraX, cameraY, template->trainerRange_berryTreeId); // light sprite instead + else TrySpawnObjectEventTemplate(template, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, cameraX, cameraY); } } @@ -2776,10 +2795,13 @@ static u8 UpdateSpritePalette(const struct SpritePalette *spritePalette, struct sprite->inUse = FALSE; FieldEffectFreePaletteIfUnused(sprite->oam.paletteNum); sprite->inUse = TRUE; - if (IndexOfSpritePaletteTag(spritePalette->tag) == 0xFF) { + if (IndexOfSpritePaletteTag(spritePalette->tag) == 0xFF) + { sprite->oam.paletteNum = LoadSpritePalette(spritePalette); UpdateSpritePaletteWithWeather(sprite->oam.paletteNum, FALSE); - } else { + } + else + { sprite->oam.paletteNum = LoadSpritePalette(spritePalette); } @@ -9795,7 +9817,7 @@ static void (*const sGroundEffectFuncs[])(struct ObjectEvent *objEvent, struct S GroundEffect_Seaweed // GROUND_EFFECT_FLAG_SEAWEED }; -static void GroundEffect_Shadow(struct ObjectEvent *objEvent, struct Sprite *sprite) +static void GroundEffect_Shadow(struct ObjectEvent *objEvent, struct Sprite *sprite) { SetUpShadow(objEvent, sprite); } diff --git a/src/field_effect.c b/src/field_effect.c index ed5286218fab..9c85771397d8 100644 --- a/src/field_effect.c +++ b/src/field_effect.c @@ -1301,7 +1301,8 @@ static void CreateHofMonitorSprite(s16 taskId, s16 x, s16 y, bool8 isSmallMonito { spriteId = CreateSpriteAtEnd(&sSpriteTemplate_HofMonitorBig, x, y, 0); SetSubspriteTables(&gSprites[spriteId], &sSubspriteTable_HofMonitorBig); - } else + } + else { spriteId = CreateSpriteAtEnd(&sSpriteTemplate_HofMonitorSmall, x, y, 0); } @@ -2027,7 +2028,8 @@ static bool8 LavaridgeGymB1FWarpEffect_Rise(struct Task *task, struct ObjectEven { task->data[1] <<= 1; } - } else if (!(task->data[2] & 4) && (task->data[1] > 0)) + } + else if (!(task->data[2] & 4) && (task->data[1] > 0)) { task->data[1] >>= 1; } @@ -2041,7 +2043,8 @@ static bool8 LavaridgeGymB1FWarpEffect_Rise(struct Task *task, struct ObjectEven { task->data[3]++; } - } else + } + else { task->data[4] = 1; } @@ -2196,7 +2199,8 @@ static bool8 LavaridgeGym1FWarpEffect_AshPuff(struct Task *task, struct ObjectEv gFieldEffectArguments[3] = sprite->oam.priority; task->data[1] = FieldEffectStart(FLDEFF_ASH_PUFF); task->data[0]++; - } else + } + else { task->data[1]++; ObjectEventSetHeldMovement(objectEvent, GetWalkInPlaceFasterMovementAction(objectEvent->facingDirection)); @@ -2527,7 +2531,8 @@ static void TeleportWarpInFieldEffect_SpinEnter(struct Task *task) objectEvent->triggerGroundEffectsOnMove = TRUE; sprite->subspriteMode = task->data[14]; } - } else + } + else { sprite->oam.priority = 1; if (sprite->subspriteMode != SUBSPRITES_OFF) diff --git a/src/field_effect_helpers.c b/src/field_effect_helpers.c index df676bb540cc..cd23ea5bac8c 100644 --- a/src/field_effect_helpers.c +++ b/src/field_effect_helpers.c @@ -112,12 +112,14 @@ static void LoadObjectReflectionPalette(struct ObjectEvent *objectEvent, struct } // Apply a blue tint effect to a palette -static void ApplyPondFilter(u8 paletteNum, u16 *dest) { +static void ApplyPondFilter(u8 paletteNum, u16 *dest) +{ u32 i; s32 r, g, b; u16 *src = gPlttBufferUnfaded + OBJ_PLTT_ID(paletteNum); *dest++ = *src++; // copy transparency - for (i = 0; i < 16 - 1; i++) { + for (i = 0; i < 16 - 1; i++) + { u32 color = *src++; r = (color << 27) >> 27; g = (color << 22) >> 27; @@ -130,12 +132,14 @@ static void ApplyPondFilter(u8 paletteNum, u16 *dest) { } // Apply a ice tint effect to a palette -static void ApplyIceFilter(u8 paletteNum, u16 *dest) { +static void ApplyIceFilter(u8 paletteNum, u16 *dest) +{ u32 i; s32 r, g, b; u16 *src = gPlttBufferUnfaded + OBJ_PLTT_ID(paletteNum); *dest++ = *src++; // copy transparency - for (i = 0; i < 16 - 1; i++) { + for (i = 0; i < 16 - 1; i++) + { u32 color = *src++; r = (color << 27) >> 27; g = (color << 22) >> 27; @@ -332,7 +336,8 @@ u32 FldEff_Shadow(void) const struct ObjectEventGraphicsInfo *graphicsInfo; u8 spriteId; s32 i; - for (i = MAX_SPRITES - 1; i > -1; i--) { // Search backwards, because of CreateSpriteAtEnd + for (i = MAX_SPRITES - 1; i > -1; i--) // Search backwards, because of CreateSpriteAtEnd + { // Return early if a shadow sprite already exists if (gSprites[i].data[0] == gFieldEffectArguments[0] && gSprites[i].callback == UpdateShadowFieldEffect) return 0; diff --git a/src/field_weather.c b/src/field_weather.c index 73e83bcc980a..b7a640642f12 100644 --- a/src/field_weather.c +++ b/src/field_weather.c @@ -551,11 +551,16 @@ static void ApplyColorMap(u8 startPalIndex, u8 numPalettes, s8 colorMapIndex) } else { - if (MapHasNaturalLight(gMapHeader.mapType)) { // Time-blend + if (MapHasNaturalLight(gMapHeader.mapType)) + { + // Time-blend u32 palettes = ((1 << numPalettes) - 1) << startPalIndex; UpdateAltBgPalettes(palettes & PALETTES_BG); UpdatePalettesWithTime(palettes); - } else { // copy + } + else + { + // copy CpuFastCopy(&gPlttBufferUnfaded[PLTT_ID(startPalIndex)], &gPlttBufferFaded[PLTT_ID(startPalIndex)], numPalettes * PLTT_SIZE_4BPP); } } @@ -685,7 +690,8 @@ static void ApplyFogBlend(u8 blendCoeff, u32 blendColor) BlendPalettesFine(PALETTES_MAP, gPlttBufferFaded, gPlttBufferFaded, blendCoeff, blendColor); // Do fog blending on marked sprite palettes - for (curPalIndex = 16; curPalIndex < 32; curPalIndex++) { + for (curPalIndex = 16; curPalIndex < 32; curPalIndex++) + { if (LightenSpritePaletteInFog(curPalIndex)) BlendPalettesFine(1, gPlttBufferFaded + PLTT_ID(curPalIndex), gPlttBufferFaded + PLTT_ID(curPalIndex), fogCoeff, RGB(28, 31, 28)); } @@ -798,17 +804,20 @@ void FadeScreen(u8 mode, s8 delay) gWeatherPtr->fadeDestColor = fadeColor; UpdateTimeOfDay(); if (useWeatherPal) - gWeatherPtr->fadeScreenCounter = 0; // Triggers gamma-shift-based fade-in - else { - if (MapHasNaturalLight(gMapHeader.mapType)) { + { + gWeatherPtr->fadeScreenCounter = 0; // Triggers gamma-shift-based fade-in + } + else if (MapHasNaturalLight(gMapHeader.mapType)) + { UpdateAltBgPalettes(PALETTES_BG); BeginTimeOfDayPaletteFade(PALETTES_ALL, delay, 16, 0, - (struct BlendSettings *)&gTimeOfDayBlend[currentTimeBlend.time0], - (struct BlendSettings *)&gTimeOfDayBlend[currentTimeBlend.time1], - currentTimeBlend.weight, fadeColor); - } else { + (struct BlendSettings *)&gTimeOfDayBlend[currentTimeBlend.time0], + (struct BlendSettings *)&gTimeOfDayBlend[currentTimeBlend.time1], + currentTimeBlend.weight, fadeColor); + } + else + { BeginNormalPaletteFade(PALETTES_ALL, delay, 16, 0, fadeColor); - } } gWeatherPtr->palProcessingState = WEATHER_PAL_STATE_SCREEN_FADING_IN; @@ -848,13 +857,18 @@ void UpdateSpritePaletteWithWeather(u8 spritePaletteIndex, bool8 allowFog) // WEATHER_PAL_STATE_CHANGING_WEATHER // WEATHER_PAL_STATE_CHANGING_IDLE default: - if (gWeatherPtr->currWeather != WEATHER_FOG_HORIZONTAL) { + if (gWeatherPtr->currWeather != WEATHER_FOG_HORIZONTAL) + { if (gWeatherPtr->colorMapIndex) ApplyColorMap(paletteIndex, 1, gWeatherPtr->colorMapIndex); else UpdateSpritePaletteWithTime(spritePaletteIndex); - } else { // In horizontal fog, only specific palettes should be fog-blended - if (allowFog) { + } + else + { + // In horizontal fog, only specific palettes should be fog-blended + if (allowFog) + { i = min((gTimeOfDay + 1) * 4, 12); // fog coeff, highest in day and lowest at night paletteIndex = PLTT_ID(paletteIndex); // First blend with time @@ -862,7 +876,10 @@ void UpdateSpritePaletteWithWeather(u8 spritePaletteIndex, bool8 allowFog) UpdateSpritePaletteWithTime(spritePaletteIndex); // Then blend faded->faded with fog coeff BlendPalettesFine(1, gPlttBufferFaded + paletteIndex, gPlttBufferFaded + paletteIndex, i, RGB(28, 31, 28)); - } else { // Otherwise, just time-blend the palette + } + else + { + // Otherwise, just time-blend the palette UpdateSpritePaletteWithTime(spritePaletteIndex); } } @@ -884,7 +901,8 @@ void ApplyWeatherColorMapToPal(u8 paletteIndex) // now unused / obselete ApplyColorMap(paletteIndex, 1, gWeatherPtr->colorMapIndex); } -void ApplyWeatherColorMapToPals(u8 startPalIndex, u8 numPalettes) { +void ApplyWeatherColorMapToPals(u8 startPalIndex, u8 numPalettes) +{ ApplyColorMap(startPalIndex, numPalettes, gWeatherPtr->colorMapIndex); } diff --git a/src/field_weather_effect.c b/src/field_weather_effect.c index 9810cdfcaa6c..724ad76ae878 100644 --- a/src/field_weather_effect.c +++ b/src/field_weather_effect.c @@ -1357,11 +1357,13 @@ static void DestroyFogHorizontalSprites(void); #define SHADOW_COLOR_INDEX 9 // Updates just the color of shadows to match special weather blending -u8 UpdateShadowColor(u16 color) { +u8 UpdateShadowColor(u16 color) +{ u8 paletteNum = IndexOfSpritePaletteTag(TAG_WEATHER_START); u16 ALIGNED(4) tempBuffer[16]; u16 blendedColor; - if (paletteNum < 16) { + if (paletteNum < 16) + { u16 index = OBJ_PLTT_ID(paletteNum)+SHADOW_COLOR_INDEX; gPlttBufferUnfaded[index] = gPlttBufferFaded[index] = color; // Copy to temporary buffer, blend, and keep just the shadow color index @@ -1409,11 +1411,15 @@ void FogHorizontal_Main(void) { case 0: CreateFogHorizontalSprites(); - if (gWeatherPtr->currWeather == WEATHER_FOG_HORIZONTAL) { + if (gWeatherPtr->currWeather == WEATHER_FOG_HORIZONTAL) + { Weather_SetTargetBlendCoeffs(12, 8, 3); UpdateShadowColor(0x3DEF); // Gray - } else + } + else + { Weather_SetTargetBlendCoeffs(4, 16, 0); + } gWeatherPtr->initStep++; break; case 1: diff --git a/src/fieldmap.c b/src/fieldmap.c index 17e3f2843f30..0fa60b964f5f 100644 --- a/src/fieldmap.c +++ b/src/fieldmap.c @@ -914,16 +914,20 @@ static void LoadTilesetPalette(struct Tileset const *tileset, u16 destOffset, u1 ApplyGlobalTintToPaletteEntries(destOffset, size >> 1); } // convert legacy light palette system to current - if (tileset->lightPalettes) { + if (tileset->lightPalettes) + { u32 i, j, color; - for (i = low; i < high; i++) { - if (tileset->lightPalettes & (1 << (i - low))) { // Mark light colors - for (j = 1, color = gPlttBufferUnfaded[PLTT_ID(i)]; j < 16 && color; j++, color >>= 1) { + for (i = low; i < high; i++) + { + if (tileset->lightPalettes & (1 << (i - low))) // Mark light colors + { + for (j = 1, color = gPlttBufferUnfaded[PLTT_ID(i)]; j < 16 && color; j++, color >>= 1) + { if (color & 1) gPlttBufferFaded[PLTT_ID(i)+j] = gPlttBufferUnfaded[PLTT_ID(i)+j] |= RGB_ALPHA; } if (tileset->customLightColor & (1 << (i - low))) // Copy old custom light color to index 0 - gPlttBufferFaded[PLTT_ID(i)] = gPlttBufferUnfaded[PLTT_ID(i)] = gPlttBufferUnfaded[PLTT_ID(i)+15] | RGB_ALPHA; + gPlttBufferFaded[PLTT_ID(i)] = gPlttBufferUnfaded[PLTT_ID(i)] = gPlttBufferUnfaded[PLTT_ID(i) + 15] | RGB_ALPHA; } } } diff --git a/src/heal_location.c b/src/heal_location.c index 7193ea338e10..17439258850e 100644 --- a/src/heal_location.c +++ b/src/heal_location.c @@ -34,9 +34,9 @@ u32 GetHealLocationIndexByWarpData(struct WarpData *warp) u32 i; for (i = 0; i < ARRAY_COUNT(sHealLocations); i++) { - if (sHealLocations[i].group == warp->mapGroup - && sHealLocations[i].map == warp->mapNum - && sHealLocations[i].x == warp->x + if (sHealLocations[i].group == warp->mapGroup + && sHealLocations[i].map == warp->mapNum + && sHealLocations[i].x == warp->x && sHealLocations[i].y == warp->y) return i + 1; } @@ -89,7 +89,7 @@ void SetWhiteoutRespawnWarpAndHealerNPC(struct WarpData *warp) u32 healLocationId = GetHealLocationIndexByWarpData(&gSaveBlock1Ptr->lastHealLocation); u32 healNpcLocalId = GetHealNpcLocalId(healLocationId); struct HealLocation pkmCenterHealLocation; - + if (!healNpcLocalId) { *(warp) = gSaveBlock1Ptr->lastHealLocation; diff --git a/src/overworld.c b/src/overworld.c index 10ba8f7368fe..0a788dcd3f88 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -1533,43 +1533,57 @@ const struct BlendSettings gTimeOfDayBlend[] = [TIME_OF_DAY_DAY] = {.coeff = 0, .blendColor = 0}, }; -u8 UpdateTimeOfDay(void) { +u8 UpdateTimeOfDay(void) +{ s32 hours, minutes; RtcCalcLocalTime(); hours = gLocalTime.hours; minutes = gLocalTime.minutes; - if (hours < 4) { // night + if (hours < 4) // night + { currentTimeBlend.weight = 256; currentTimeBlend.altWeight = 0; gTimeOfDay = currentTimeBlend.time0 = currentTimeBlend.time1 = TIME_OF_DAY_NIGHT; - } else if (hours < 7) { // night->twilight + } + else if (hours < 7) // night->twilight + { currentTimeBlend.time0 = TIME_OF_DAY_NIGHT; currentTimeBlend.time1 = TIME_OF_DAY_TWILIGHT; currentTimeBlend.weight = 256 - 256 * ((hours - 4) * 60 + minutes) / ((7-4)*60); currentTimeBlend.altWeight = (256 - currentTimeBlend.weight) / 2; gTimeOfDay = TIME_OF_DAY_DAY; - } else if (hours < 10) { // twilight->day + } + else if (hours < 10) // twilight->day + { currentTimeBlend.time0 = TIME_OF_DAY_TWILIGHT; currentTimeBlend.time1 = TIME_OF_DAY_DAY; currentTimeBlend.weight = 256 - 256 * ((hours - 7) * 60 + minutes) / ((10-7)*60); currentTimeBlend.altWeight = (256 - currentTimeBlend.weight) / 2 + 128; gTimeOfDay = TIME_OF_DAY_DAY; - } else if (hours < 18) { // day + } + else if (hours < 18) // day + { currentTimeBlend.weight = currentTimeBlend.altWeight = 256; gTimeOfDay = currentTimeBlend.time0 = currentTimeBlend.time1 = TIME_OF_DAY_DAY; - } else if (hours < 20) { // day->twilight + } + else if (hours < 20) + { currentTimeBlend.time0 = TIME_OF_DAY_DAY; currentTimeBlend.time1 = TIME_OF_DAY_TWILIGHT; currentTimeBlend.weight = 256 - 256 * ((hours - 18) * 60 + minutes) / ((20-18)*60); currentTimeBlend.altWeight = currentTimeBlend.weight / 2 + 128; gTimeOfDay = TIME_OF_DAY_TWILIGHT; - } else if (hours < 22) { // twilight->night + } + else if (hours < 22) // twilight->night + { currentTimeBlend.time0 = TIME_OF_DAY_TWILIGHT; currentTimeBlend.time1 = TIME_OF_DAY_NIGHT; currentTimeBlend.weight = 256 - 256 * ((hours - 20) * 60 + minutes) / ((22-20)*60); currentTimeBlend.altWeight = currentTimeBlend.weight / 2; gTimeOfDay = TIME_OF_DAY_NIGHT; - } else { // 22-24, night + } + else // 22-24, night + { currentTimeBlend.weight = 256; currentTimeBlend.altWeight = 0; gTimeOfDay = currentTimeBlend.time0 = currentTimeBlend.time1 = TIME_OF_DAY_NIGHT; @@ -1577,17 +1591,19 @@ u8 UpdateTimeOfDay(void) { return gTimeOfDay; } -bool8 MapHasNaturalLight(u8 mapType) { // Whether a map type is naturally lit/outside - return ( - mapType == MAP_TYPE_TOWN - || mapType == MAP_TYPE_CITY - || mapType == MAP_TYPE_ROUTE - || mapType == MAP_TYPE_OCEAN_ROUTE +// Whether a map type is naturally lit/outside +bool8 MapHasNaturalLight(u8 mapType) +{ + return (mapType == MAP_TYPE_TOWN + || mapType == MAP_TYPE_CITY + || mapType == MAP_TYPE_ROUTE + || mapType == MAP_TYPE_OCEAN_ROUTE ); } // Update & mix day / night bg palettes (into unfaded) -void UpdateAltBgPalettes(u16 palettes) { +void UpdateAltBgPalettes(u16 palettes) +{ const struct Tileset *primary = gMapHeader.mapLayout->primaryTileset; const struct Tileset *secondary = gMapHeader.mapLayout->secondaryTileset; u32 i = 1; @@ -1599,8 +1615,10 @@ void UpdateAltBgPalettes(u16 palettes) { palettes >>= 1; // start at palette 1 if (!palettes) return; - while (palettes) { - if (palettes & 1) { + while (palettes) + { + if (palettes & 1) + { if (i < NUM_PALS_IN_PRIMARY) AvgPaletteWeighted(&((u16*)primary->palettes)[i*16], &((u16*)primary->palettes)[((i+9)%16)*16], gPlttBufferUnfaded + i * 16, currentTimeBlend.altWeight); else @@ -1611,8 +1629,10 @@ void UpdateAltBgPalettes(u16 palettes) { } } -void UpdatePalettesWithTime(u32 palettes) { - if (MapHasNaturalLight(gMapHeader.mapType)) { +void UpdatePalettesWithTime(u32 palettes) +{ + if (MapHasNaturalLight(gMapHeader.mapType)) + { u32 i; u32 mask = 1 << 16; if (palettes >= (1 << 16)) @@ -1634,18 +1654,19 @@ void UpdatePalettesWithTime(u32 palettes) { } } -u8 UpdateSpritePaletteWithTime(u8 paletteNum) { - if (MapHasNaturalLight(gMapHeader.mapType)) { +u8 UpdateSpritePaletteWithTime(u8 paletteNum) +{ + if (MapHasNaturalLight(gMapHeader.mapType)) + { if (IS_BLEND_IMMUNE_TAG(GetSpritePaletteTagByPaletteNum(paletteNum))) - return paletteNum; - TimeMixPalettes( - 1, - &gPlttBufferUnfaded[OBJ_PLTT_ID(paletteNum)], - &gPlttBufferFaded[OBJ_PLTT_ID(paletteNum)], - (struct BlendSettings *)&gTimeOfDayBlend[currentTimeBlend.time0], - (struct BlendSettings *)&gTimeOfDayBlend[currentTimeBlend.time1], - currentTimeBlend.weight - ); + return paletteNum; + TimeMixPalettes(1, + &gPlttBufferUnfaded[OBJ_PLTT_ID(paletteNum)], + &gPlttBufferFaded[OBJ_PLTT_ID(paletteNum)], + (struct BlendSettings *)&gTimeOfDayBlend[currentTimeBlend.time0], + (struct BlendSettings *)&gTimeOfDayBlend[currentTimeBlend.time1], + currentTimeBlend.weight + ); } return paletteNum; } @@ -1662,7 +1683,8 @@ static void OverworldBasic(void) UpdateTilesetAnimations(); DoScheduledBgTilemapCopiesToVram(); // Every minute if no palette fade is active, update TOD blending as needed - if (!gPaletteFade.active && ++gTimeUpdateCounter >= 3600) { + if (!gPaletteFade.active && ++gTimeUpdateCounter >= 3600) + { struct TimeBlendSettings cachedBlend = { .time0 = currentTimeBlend.time0, .time1 = currentTimeBlend.time1, diff --git a/src/palette.c b/src/palette.c index ee03b5d6a934..f2fdac9fdc9e 100644 --- a/src/palette.c +++ b/src/palette.c @@ -54,7 +54,7 @@ void LoadPalette(const void *src, u32 offset, u32 size) } // Drop in replacement for LoadPalette, uses CpuFastCopy, size must be 0 % 32 -void LoadPaletteFast(const void *src, u32 offset, u32 size) +void LoadPaletteFast(const void *src, u32 offset, u32 size) { if ((u32)src & 3) // In case palette is not 4 byte aligned return LoadPalette(src, offset, size); @@ -265,23 +265,29 @@ static u8 UpdateTimeOfDayPaletteFade(void) dst = gPlttBufferFaded + paletteOffset; // First pply TOD blend to relevant subset of palettes - if (gPaletteFade.objPaletteToggle) { // Sprite palettes, don't blend those with tags + if (gPaletteFade.objPaletteToggle) // Sprite palettes, don't blend those with tags + { u32 i; u32 j = 1; - for (i = 0; i < 16; i++, j <<= 1) { // Mask out palettes that should not be light blended + for (i = 0; i < 16; i++, j <<= 1) // Mask out palettes that should not be light blended + { if ((selectedPalettes & j) && !IS_BLEND_IMMUNE_TAG(GetSpritePaletteTagByPaletteNum(i))) timePalettes |= j; } - } else { // tile palettes, don't blend [13, 15] + } + else // tile palettes, don't blend [13, 15] + { timePalettes = selectedPalettes & PALETTES_MAP; } TimeMixPalettes(timePalettes, src, dst, gPaletteFade.bld0, gPaletteFade.bld1, gPaletteFade.weight); // palettes that were not blended above must be copied through - if ((copyPalettes = ~timePalettes)) { + if ((copyPalettes = ~timePalettes)) + { u16 * src1 = src; u16 * dst1 = dst; - while (copyPalettes) { + while (copyPalettes) + { if (copyPalettes & 1) CpuFastCopy(src1, dst1, 32); copyPalettes >>= 1; @@ -755,7 +761,8 @@ static bool32 IsSoftwarePaletteFadeFinishing(void) } // optimized based on lucktyphlosion's BlendPalettesFine -void BlendPalettesFine(u32 palettes, u16 *src, u16 *dst, u32 coeff, u32 color) { +void BlendPalettesFine(u32 palettes, u16 *src, u16 *dst, u32 coeff, u32 color) +{ s32 newR, newG, newB; if (!palettes) @@ -766,10 +773,13 @@ void BlendPalettesFine(u32 palettes, u16 *src, u16 *dst, u32 coeff, u32 color) { newG = (color << 22) >> 27; newB = (color << 17) >> 27; - do { - if (palettes & 1) { + do + { + if (palettes & 1) + { u16 *srcEnd = src + 16; - while (src != srcEnd) { // Transparency is blended (for backdrop reasons) + while (src != srcEnd) // Transparency is blended (for backdrop reasons) + { u32 srcColor = *src; s32 r = (srcColor << 27) >> 27; s32 g = (srcColor << 22) >> 27; @@ -780,7 +790,9 @@ void BlendPalettesFine(u32 palettes, u16 *src, u16 *dst, u32 coeff, u32 color) { | ((b + (((newB - (b & 31)) * (s32)coeff) >> 5)) << 10); src++; } - } else { + } + else + { src += 16; dst += 16; } @@ -788,7 +800,8 @@ void BlendPalettesFine(u32 palettes, u16 *src, u16 *dst, u32 coeff, u32 color) { } while (palettes); } -void BlendPalettes(u32 selectedPalettes, u8 coeff, u32 color) { +void BlendPalettes(u32 selectedPalettes, u8 coeff, u32 color) +{ BlendPalettesFine(selectedPalettes, gPlttBufferUnfaded, gPlttBufferFaded, coeff, color); } @@ -796,7 +809,8 @@ void BlendPalettes(u32 selectedPalettes, u8 coeff, u32 color) { // Like BlendPalette, but ignores blendColor if the transparency high bit is set // Optimization help by lucktyphlosion -void TimeBlendPalette(u16 palOffset, u32 coeff, u32 blendColor) { +void TimeBlendPalette(u16 palOffset, u32 coeff, u32 blendColor) +{ s32 newR, newG, newB, defR, defG, defB; u16 * src = gPlttBufferUnfaded + palOffset; u16 * dst = gPlttBufferFaded + palOffset; @@ -809,27 +823,34 @@ void TimeBlendPalette(u16 palOffset, u32 coeff, u32 blendColor) { newG = (blendColor << 22) >> 27; newB = (blendColor << 17) >> 27; - if (altBlendColor >> 15) { // Transparency high bit set; alt blend color + if (altBlendColor >> 15) // Transparency high bit set; alt blend color + { defR = (altBlendColor << 27) >> 27; defG = (altBlendColor << 22) >> 27; defB = (altBlendColor << 17) >> 27; - } else { + } + else + { defR = (defaultBlendColor << 27) >> 27; defG = (defaultBlendColor << 22) >> 27; defB = (defaultBlendColor << 17) >> 27; altBlendColor = 0; } - while (src != srcEnd) { + while (src != srcEnd) + { u32 srcColor = *src; s32 r = (srcColor << 27) >> 27; s32 g = (srcColor << 22) >> 27; s32 b = (srcColor << 16) >> 26; - if (srcColor >> 15) { + if (srcColor >> 15) + { *dst = ((r + (((defR - r) * (s32)coeff) >> 5)) << 0) | ((g + (((defG - g) * (s32)coeff) >> 5)) << 5) | ((b + (((defB - (b & 31)) * (s32)coeff) >> 5)) << 10); - } else { // Use provided blend color + } + else // Use provided blend color + { *dst = ((r + (((newR - r) * (s32)coeff) >> 5)) << 0) | ((g + (((newG - g) * (s32)coeff) >> 5)) << 5) | ((b + (((newB - (b & 31)) * (s32)coeff) >> 5)) << 10); @@ -841,7 +862,8 @@ void TimeBlendPalette(u16 palOffset, u32 coeff, u32 blendColor) { // Blends a weighted average of two blend parameters // Parameters can be either blended (as in BlendPalettes) or tinted (as in TintPaletteRGB_Copy) -void TimeMixPalettes(u32 palettes, u16 *src, u16 *dst, struct BlendSettings *blend0, struct BlendSettings *blend1, u16 weight0) { +void TimeMixPalettes(u32 palettes, u16 *src, u16 *dst, struct BlendSettings *blend0, struct BlendSettings *blend1, u16 weight0) +{ s32 r0, g0, b0, r1, g1, b1, defR, defG, defB, altR, altG, altB; u32 color0, coeff0, color1, coeff1; bool8 tint0, tint1; @@ -857,20 +879,26 @@ void TimeMixPalettes(u32 palettes, u16 *src, u16 *dst, struct BlendSettings *ble tint1 = blend1->isTint; coeff1 = tint1 ? 8*2 : blend1->coeff*2; - if (tint0) { + if (tint0) + { r0 = (color0 << 24) >> 24; g0 = (color0 << 16) >> 24; b0 = (color0 << 8) >> 24; - } else { + } + else + { r0 = (color0 << 27) >> 27; g0 = (color0 << 22) >> 27; b0 = (color0 << 17) >> 27; } - if (tint1) { + if (tint1) + { r1 = (color1 << 24) >> 24; g1 = (color1 << 16) >> 24; b1 = (color1 << 8) >> 24; - } else { + } + else + { r1 = (color1 << 27) >> 27; g1 = (color1 << 22) >> 27; b1 = (color1 << 17) >> 27; @@ -879,33 +907,45 @@ void TimeMixPalettes(u32 palettes, u16 *src, u16 *dst, struct BlendSettings *ble defG = (defaultColor << 22) >> 27; defB = (defaultColor << 17) >> 27; - do { - if (palettes & 1) { + do + { + if (palettes & 1) + { u16 *srcEnd = src + 16; u32 altBlendColor = *dst++ = *src++; // color 0 is copied through - if (altBlendColor >> 15) { // Transparency high bit set; alt blend color + if (altBlendColor >> 15) // Transparency high bit set; alt blend color + { altR = (altBlendColor << 27) >> 27; altG = (altBlendColor << 22) >> 27; altB = (altBlendColor << 17) >> 27; - } else { + } + else + { altBlendColor = 0; } - while (src != srcEnd) { + while (src != srcEnd) + { u32 srcColor = *src; s32 r = (srcColor << 27) >> 27; s32 g = (srcColor << 22) >> 27; s32 b = (srcColor << 17) >> 27; s32 r2, g2, b2; - if (srcColor >> 15) { - if (altBlendColor) { // Use alternate blend color + if (srcColor >> 15) + { + if (altBlendColor) + { + // Use alternate blend color r2 = r + (((altR - r) * (s32)coeff1) >> 5); g2 = g + (((altG - g) * (s32)coeff1) >> 5); b2 = b + (((altB - b) * (s32)coeff1) >> 5); r = r + (((altR - r) * (s32)coeff0) >> 5); g = g + (((altG - g) * (s32)coeff0) >> 5); b = b + (((altB - b) * (s32)coeff0) >> 5); - } else { // Use default blend color + } + else + { + // Use default blend color r2 = r + (((defR - r) * (s32)coeff1) >> 5); g2 = g + (((defG - g) * (s32)coeff1) >> 5); b2 = b + (((defB - b) * (s32)coeff1) >> 5); @@ -913,12 +953,20 @@ void TimeMixPalettes(u32 palettes, u16 *src, u16 *dst, struct BlendSettings *ble g = g + (((defG - g) * (s32)coeff0) >> 5); b = b + (((defB - b) * (s32)coeff0) >> 5); } - } else { // Use provided blend colors - if (!tint1) { // blend-based + } + else + { + // Use provided blend colors + if (!tint1) + { + // blend-based r2 = (r + (((r1 - r) * (s32)coeff1) >> 5)); g2 = (g + (((g1 - g) * (s32)coeff1) >> 5)); b2 = (b + (((b1 - b) * (s32)coeff1) >> 5)); - } else { // tint-based + } + else + { + // tint-based r2 = (u16)((r1 * r)) >> 8; g2 = (u16)((g1 * g)) >> 8; b2 = (u16)((b1 * b)) >> 8; @@ -929,11 +977,16 @@ void TimeMixPalettes(u32 palettes, u16 *src, u16 *dst, struct BlendSettings *ble if (b2 > 31) b2 = 31; } - if (!tint0) { // blend-based + if (!tint0) + { + // blend-based r = (r + (((r0 - r) * (s32)coeff0) >> 5)); g = (g + (((g0 - g) * (s32)coeff0) >> 5)); b = (b + (((b0 - b) * (s32)coeff0) >> 5)); - } else { // tint-based + } + else + { + // tint-based r = (u16)((r0 * r)) >> 8; g = (u16)((g0 * g)) >> 8; b = (u16)((b0 * b)) >> 8; @@ -943,7 +996,7 @@ void TimeMixPalettes(u32 palettes, u16 *src, u16 *dst, struct BlendSettings *ble g = 31; if (b > 31) b = 31; - } + } } r = r2 + (((r - r2) * (s32)weight0) >> 8); g = g2 + (((g - g2) * (s32)weight0) >> 8); @@ -952,7 +1005,9 @@ void TimeMixPalettes(u32 palettes, u16 *src, u16 *dst, struct BlendSettings *ble // *dst++ = RGB2(r, g, b) | (srcColor >> 15) << 15; src++; } - } else { + } + else + { src += 16; dst += 16; } @@ -961,12 +1016,14 @@ void TimeMixPalettes(u32 palettes, u16 *src, u16 *dst, struct BlendSettings *ble } // Apply weighted average to palettes, preserving high bits of dst throughout -void AvgPaletteWeighted(u16 *src0, u16 *src1, u16 *dst, u16 weight0) { +void AvgPaletteWeighted(u16 *src0, u16 *src1, u16 *dst, u16 weight0) +{ u16 *srcEnd = src0 + 16; src0++; src1++; dst++; // leave dst transparency unchanged - while (src0 != srcEnd) { + while (src0 != srcEnd) + { u32 src0Color = *src0++; s32 r0 = (src0Color << 27) >> 27; s32 g0 = (src0Color << 22) >> 27; @@ -1085,7 +1142,8 @@ void TintPalette_CustomTone(u16 *palette, u32 count, u16 rTone, u16 gTone, u16 b } // Tints from Unfaded to Faded, using a 15-bit GBA color -void TintPalette_RGB_Copy(u16 palOffset, u32 blendColor) { +void TintPalette_RGB_Copy(u16 palOffset, u32 blendColor) +{ s32 newR, newG, newB, rTone = 0, gTone = 0, bTone = 0; u16 * src = gPlttBufferUnfaded + palOffset; u16 * dst = gPlttBufferFaded + palOffset; @@ -1093,38 +1151,51 @@ void TintPalette_RGB_Copy(u16 palOffset, u32 blendColor) { u16 *srcEnd = src + 16; u16 altBlendIndices = *dst++ = *src++; // color 0 is copied through unchanged u32 altBlendColor; - + newR = ((blendColor << 27) >> 27) << 3; newG = ((blendColor << 22) >> 27) << 3; newB = ((blendColor << 17) >> 27) << 3; - - if (altBlendIndices >> 15) { // High bit set; bitmask of which colors to alt-blend + + if (altBlendIndices >> 15) // High bit set; bitmask of which colors to alt-blend + { // Note that bit 0 of altBlendIndices specifies color 1 altBlendColor = src[14]; // color 15 - if (altBlendColor >> 15) { // Set alternate blend color + if (altBlendColor >> 15) + { + // Set alternate blend color rTone = ((altBlendColor << 27) >> 27) << 3; gTone = ((altBlendColor << 22) >> 27) << 3; bTone = ((altBlendColor << 17) >> 27) << 3; - } else { // Set default blend color + } + else + { + // Set default blend color rTone = ((defaultBlendColor << 27) >> 27) << 3; gTone = ((defaultBlendColor << 22) >> 27) << 3; bTone = ((defaultBlendColor << 17) >> 27) << 3; } - } else { + } + else + { altBlendIndices = 0; } - while (src != srcEnd) { + while (src != srcEnd) + { u32 srcColor = *src; s32 r = (srcColor << 27) >> 27; s32 g = (srcColor << 22) >> 27; s32 b = (srcColor << 17) >> 27; - if (altBlendIndices & 1) { + if (altBlendIndices & 1) + { r = (u16)((rTone * r)) >> 8; g = (u16)((gTone * g)) >> 8; b = (u16)((bTone * b)) >> 8; - } else { // Use provided blend color + } + else + { + // Use provided blend color r = (u16)((newR * r)) >> 8; g = (u16)((newG * g)) >> 8; b = (u16)((newB * b)) >> 8; diff --git a/src/pokemon_summary_screen.c b/src/pokemon_summary_screen.c index a1ebc2b18818..9552055373d0 100644 --- a/src/pokemon_summary_screen.c +++ b/src/pokemon_summary_screen.c @@ -3969,17 +3969,17 @@ static void SetMoveTypeIcons(void) if (P_SHOW_DYNAMIC_TYPES) { type = CheckDynamicMoveType(mon, summary->moves[i], 0); - SetTypeSpritePosAndPal(type, 85, 32 + (i * 16), i + SPRITE_ARR_ID_TYPE); + SetTypeSpritePosAndPal(type, 85, 32 + (i * 16), i + SPRITE_ARR_ID_TYPE); } else { - SetTypeSpritePosAndPal(gMovesInfo[summary->moves[i]].type, 85, 32 + (i * 16), i + SPRITE_ARR_ID_TYPE); + SetTypeSpritePosAndPal(gMovesInfo[summary->moves[i]].type, 85, 32 + (i * 16), i + SPRITE_ARR_ID_TYPE); } } else { SetSpriteInvisibility(i + SPRITE_ARR_ID_TYPE, TRUE); - } + } } } diff --git a/src/scrcmd.c b/src/scrcmd.c index d8b2643f434d..f2660be65ba3 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -632,7 +632,8 @@ static bool8 IsPaletteNotActive(void) } // pauses script until palette fade inactive -bool8 ScrFunc_WaitPaletteNotActive(struct ScriptContext *ctx) { +bool8 ScrFunc_WaitPaletteNotActive(struct ScriptContext *ctx) +{ SetupNativeScript(ctx, IsPaletteNotActive); return TRUE; } diff --git a/src/tv.c b/src/tv.c index c0e207ce8a15..8fc8bb684b65 100644 --- a/src/tv.c +++ b/src/tv.c @@ -5334,7 +5334,8 @@ static void DoTVShow3CheersForPokeblocks(void) if (show->threeCheers.sheen > 24) { StringCopy(gStringVar2, gText_Excellent); - } else if (show->threeCheers.sheen > 22) + } + else if (show->threeCheers.sheen > 22) { StringCopy(gStringVar2, gText_VeryGood); } From fb360b1e418e517f224bc6f9576d636a68587724 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Wed, 11 Sep 2024 09:33:34 -0300 Subject: [PATCH 098/104] DNS tinting uses fake RTC's rate --- src/overworld.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/overworld.c b/src/overworld.c index df44574d0fea..c7f3e15d7a6d 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -9,6 +9,7 @@ #include "event_data.h" #include "event_object_movement.h" #include "event_scripts.h" +#include "fake_rtc.h" #include "field_camera.h" #include "field_control_avatar.h" #include "field_effect.h" @@ -1686,7 +1687,7 @@ static void OverworldBasic(void) UpdateTilesetAnimations(); DoScheduledBgTilemapCopiesToVram(); // Every minute if no palette fade is active, update TOD blending as needed - if (!gPaletteFade.active && ++gTimeUpdateCounter >= 3600) + if (!gPaletteFade.active && ++gTimeUpdateCounter >= (SECONDS_PER_MINUTE * 60 / FakeRtc_GetSecondsRatio())) { struct TimeBlendSettings cachedBlend = { .time0 = currentTimeBlend.time0, From 757ed7054d5773d8007c8eb38ce7c3e2f8d8d401 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Wed, 11 Sep 2024 11:17:09 -0300 Subject: [PATCH 099/104] Secondary map popup window updates time while active --- src/map_name_popup.c | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/src/map_name_popup.c b/src/map_name_popup.c index 5cc1f3cfd5d9..3af55ee4cdc1 100644 --- a/src/map_name_popup.c +++ b/src/map_name_popup.c @@ -41,6 +41,7 @@ enum MapPopUp_Themes_BW // static functions static void Task_MapNamePopUpWindow(u8 taskId); +static void UpdateSecondaryPopUpWindow(u8 secondaryPopUpWindowId); static void ShowMapNamePopUpWindow(void); static void LoadMapNamePopUpWindowBg(void); @@ -423,6 +424,7 @@ static void Task_MapNamePopUpWindow(u8 taskId) break; case STATE_WAIT: // Wait while the window is fully onscreen. + UpdateSecondaryPopUpWindow(GetSecondaryPopUpWindowId()); if (++task->tOnscreenTimer > 120) { task->tOnscreenTimer = 0; @@ -500,6 +502,20 @@ void HideMapNamePopUpWindow(void) } } +static void UpdateSecondaryPopUpWindow(u8 secondaryPopUpWindowId) +{ + u8 mapDisplayHeader[24]; + u8 *withoutPrefixPtr = &(mapDisplayHeader[0]); + + if (OW_POPUP_BW_TIME_MODE != OW_POPUP_BW_TIME_NONE) + { + RtcCalcLocalTime(); + FormatDecimalTimeWithoutSeconds(withoutPrefixPtr, gLocalTime.hours, gLocalTime.minutes, OW_POPUP_BW_TIME_MODE == OW_POPUP_BW_TIME_24_HR); + AddTextPrinterParameterized(secondaryPopUpWindowId, FONT_SMALL, mapDisplayHeader, GetStringRightAlignXOffset(FONT_SMALL, mapDisplayHeader, DISPLAY_WIDTH) - 5, 8, TEXT_SKIP_DRAW, NULL); + } + CopyWindowToVram(secondaryPopUpWindowId, COPYWIN_FULL); +} + static void ShowMapNamePopUpWindow(void) { u8 mapDisplayHeader[24]; @@ -550,16 +566,8 @@ static void ShowMapNamePopUpWindow(void) if (OW_POPUP_GENERATION == GEN_5) { AddTextPrinterParameterized(mapNamePopUpWindowId, FONT_SHORT, mapDisplayHeader, 8, 2, TEXT_SKIP_DRAW, NULL); - - if (OW_POPUP_BW_TIME_MODE != OW_POPUP_BW_TIME_NONE) - { - RtcCalcLocalTime(); - FormatDecimalTimeWithoutSeconds(withoutPrefixPtr, gLocalTime.hours, gLocalTime.minutes, OW_POPUP_BW_TIME_MODE == OW_POPUP_BW_TIME_24_HR); - AddTextPrinterParameterized(secondaryPopUpWindowId, FONT_SMALL, mapDisplayHeader, GetStringRightAlignXOffset(FONT_SMALL, mapDisplayHeader, DISPLAY_WIDTH) - 5, 8, TEXT_SKIP_DRAW, NULL); - } - CopyWindowToVram(mapNamePopUpWindowId, COPYWIN_FULL); - CopyWindowToVram(secondaryPopUpWindowId, COPYWIN_FULL); + UpdateSecondaryPopUpWindow(secondaryPopUpWindowId); } else { From 56859e35e0d779ce06d899be142a189a1024e336 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Thu, 12 Sep 2024 10:26:58 -0300 Subject: [PATCH 100/104] Using TIME instead of TIME_OF_DAY --- include/overworld.h | 4 ---- src/event_object_movement.c | 3 ++- src/follower_helper.c | 5 +++-- src/overworld.c | 45 +++++++++++++++++++------------------ 4 files changed, 28 insertions(+), 29 deletions(-) diff --git a/include/overworld.h b/include/overworld.h index 62761ecdb0ca..5805bb8d6bbc 100644 --- a/include/overworld.h +++ b/include/overworld.h @@ -25,10 +25,6 @@ #define MOVEMENT_MODE_SCRIPTED 2 #define SKIP_OBJECT_EVENT_LOAD 1 -#define TIME_OF_DAY_NIGHT 0 -#define TIME_OF_DAY_TWILIGHT 1 -#define TIME_OF_DAY_DAY 2 -#define TIME_OF_DAY_MAX TIME_OF_DAY_DAY struct InitialPlayerAvatarState { diff --git a/src/event_object_movement.c b/src/event_object_movement.c index 42f68473a1d5..122f774ebfe5 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -29,6 +29,7 @@ #include "pokeball.h" #include "random.h" #include "region_map.h" +#include "rtc.h" #include "script.h" #include "sound.h" #include "sprite.h" @@ -2505,7 +2506,7 @@ void UpdateLightSprite(struct Sprite *sprite) return; } - if (gTimeOfDay != TIME_OF_DAY_NIGHT) + if (gTimeOfDay != TIME_NIGHT) { sprite->invisible = TRUE; return; diff --git a/src/follower_helper.c b/src/follower_helper.c index f1a365532fc0..26e9f25fab5c 100644 --- a/src/follower_helper.c +++ b/src/follower_helper.c @@ -3,6 +3,7 @@ #include "event_scripts.h" #include "follower_helper.h" #include "overworld.h" +#include "rtc.h" #include "constants/battle.h" #include "constants/followers.h" #include "constants/metatile_behaviors.h" @@ -362,14 +363,14 @@ const struct FollowerMsgInfoExtended gFollowerConditionalMessages[COND_MSG_COUNT .text = (u8*)sDayTexts, .textSpread = 1, .emotion = FOLLOWER_EMOTION_MUSIC, - .conditions = {MATCH_TIME_OF_DAY(TIME_OF_DAY_DAY)}, + .conditions = {MATCH_TIME_OF_DAY(TIME_DAY)}, }, [COND_MSG_NIGHT] = { .text = (u8*)sNightTexts, .textSpread = 1, .emotion = FOLLOWER_EMOTION_MUSIC, - .conditions = {MATCH_TIME_OF_DAY(TIME_OF_DAY_NIGHT)}, + .conditions = {MATCH_TIME_OF_DAY(TIME_NIGHT)}, }, }; diff --git a/src/overworld.c b/src/overworld.c index c7f3e15d7a6d..889b35effcae 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -1532,9 +1532,10 @@ void CB1_Overworld(void) const struct BlendSettings gTimeOfDayBlend[] = { - [TIME_OF_DAY_NIGHT] = {.coeff = 10, .blendColor = TINT_NIGHT, .isTint = TRUE}, - [TIME_OF_DAY_TWILIGHT] = {.coeff = 4, .blendColor = 0xA8B0E0, .isTint = TRUE}, - [TIME_OF_DAY_DAY] = {.coeff = 0, .blendColor = 0}, + [TIME_MORNING] = {.coeff = 4, .blendColor = 0xA8B0E0, .isTint = TRUE}, // Originally TIME_OF_DAY_TWILIGHT + [TIME_DAY] = {.coeff = 0, .blendColor = 0, .isTint = FALSE}, + [TIME_EVENING] = {.coeff = 4, .blendColor = 0xA8B0E0, .isTint = TRUE}, // Originally TIME_OF_DAY_TWILIGHT + [TIME_NIGHT] = {.coeff = 10, .blendColor = TINT_NIGHT, .isTint = TRUE}, }; u8 UpdateTimeOfDay(void) @@ -1547,50 +1548,50 @@ u8 UpdateTimeOfDay(void) { currentTimeBlend.weight = 256; currentTimeBlend.altWeight = 0; - gTimeOfDay = currentTimeBlend.time0 = currentTimeBlend.time1 = TIME_OF_DAY_NIGHT; + gTimeOfDay = currentTimeBlend.time0 = currentTimeBlend.time1 = TIME_NIGHT; } - else if (hours < 7) // night->twilight + else if (hours < 7) // night->morning { - currentTimeBlend.time0 = TIME_OF_DAY_NIGHT; - currentTimeBlend.time1 = TIME_OF_DAY_TWILIGHT; + currentTimeBlend.time0 = TIME_NIGHT; + currentTimeBlend.time1 = TIME_MORNING; currentTimeBlend.weight = 256 - 256 * ((hours - 4) * 60 + minutes) / ((7-4)*60); currentTimeBlend.altWeight = (256 - currentTimeBlend.weight) / 2; - gTimeOfDay = TIME_OF_DAY_DAY; + gTimeOfDay = TIME_MORNING; } - else if (hours < 10) // twilight->day + else if (hours < 10) // morning->day { - currentTimeBlend.time0 = TIME_OF_DAY_TWILIGHT; - currentTimeBlend.time1 = TIME_OF_DAY_DAY; + currentTimeBlend.time0 = TIME_MORNING; + currentTimeBlend.time1 = TIME_DAY; currentTimeBlend.weight = 256 - 256 * ((hours - 7) * 60 + minutes) / ((10-7)*60); currentTimeBlend.altWeight = (256 - currentTimeBlend.weight) / 2 + 128; - gTimeOfDay = TIME_OF_DAY_DAY; + gTimeOfDay = TIME_DAY; } else if (hours < 18) // day { currentTimeBlend.weight = currentTimeBlend.altWeight = 256; - gTimeOfDay = currentTimeBlend.time0 = currentTimeBlend.time1 = TIME_OF_DAY_DAY; + gTimeOfDay = currentTimeBlend.time0 = currentTimeBlend.time1 = TIME_DAY; } - else if (hours < 20) + else if (hours < 20) // evening { - currentTimeBlend.time0 = TIME_OF_DAY_DAY; - currentTimeBlend.time1 = TIME_OF_DAY_TWILIGHT; + currentTimeBlend.time0 = TIME_DAY; + currentTimeBlend.time1 = TIME_EVENING; currentTimeBlend.weight = 256 - 256 * ((hours - 18) * 60 + minutes) / ((20-18)*60); currentTimeBlend.altWeight = currentTimeBlend.weight / 2 + 128; - gTimeOfDay = TIME_OF_DAY_TWILIGHT; + gTimeOfDay = TIME_EVENING; } - else if (hours < 22) // twilight->night + else if (hours < 22) // evening->night { - currentTimeBlend.time0 = TIME_OF_DAY_TWILIGHT; - currentTimeBlend.time1 = TIME_OF_DAY_NIGHT; + currentTimeBlend.time0 = TIME_EVENING; + currentTimeBlend.time1 = TIME_NIGHT; currentTimeBlend.weight = 256 - 256 * ((hours - 20) * 60 + minutes) / ((22-20)*60); currentTimeBlend.altWeight = currentTimeBlend.weight / 2; - gTimeOfDay = TIME_OF_DAY_NIGHT; + gTimeOfDay = TIME_NIGHT; } else // 22-24, night { currentTimeBlend.weight = 256; currentTimeBlend.altWeight = 0; - gTimeOfDay = currentTimeBlend.time0 = currentTimeBlend.time1 = TIME_OF_DAY_NIGHT; + gTimeOfDay = currentTimeBlend.time0 = currentTimeBlend.time1 = TIME_NIGHT; } return gTimeOfDay; } From 53414cb8bbf4e9b78ceba93ebd3682a86bae5bb5 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Mon, 16 Sep 2024 16:15:30 -0300 Subject: [PATCH 101/104] Form changes and evolutions happen based on fake RTC --- include/clock.h | 1 + include/overworld.h | 2 +- include/rtc.h | 2 +- src/clock.c | 5 ++--- src/overworld.c | 3 ++- src/rtc.c | 10 ++-------- 6 files changed, 9 insertions(+), 14 deletions(-) diff --git a/include/clock.h b/include/clock.h index 0cfd3db9ed7a..95d0929950e9 100644 --- a/include/clock.h +++ b/include/clock.h @@ -5,5 +5,6 @@ void InitTimeBasedEvents(void); void DoTimeBasedEvents(void); +void FormChangeTimeUpdate(); #endif // GUARD_CLOCK_H diff --git a/include/overworld.h b/include/overworld.h index 5805bb8d6bbc..2e6bb8a922ec 100644 --- a/include/overworld.h +++ b/include/overworld.h @@ -141,7 +141,7 @@ void CleanupOverworldWindowsAndTilemaps(void); bool32 IsOverworldLinkActive(void); void CB1_Overworld(void); void CB2_OverworldBasic(void); -u8 UpdateTimeOfDay(void); +void UpdateTimeOfDay(void); bool8 MapHasNaturalLight(u8 mapType); void UpdateAltBgPalettes(u16 palettes); void UpdatePalettesWithTime(u32); diff --git a/include/rtc.h b/include/rtc.h index bf8ff9aa936d..c60e63deb110 100644 --- a/include/rtc.h +++ b/include/rtc.h @@ -18,7 +18,7 @@ #define RTC_ERR_FLAG_MASK 0x0FF0 //Morning and evening don't exist in Gen 3 -#if OW_TIMES_OF_DAY == GEN_3 +#if OW_TIMES_OF_DAY <= GEN_3 #define MORNING_HOUR_BEGIN 0 #define MORNING_HOUR_END 0 diff --git a/src/clock.c b/src/clock.c index 54c9422bbe47..f9cfee4ad4b0 100644 --- a/src/clock.c +++ b/src/clock.c @@ -1,4 +1,5 @@ #include "global.h" +#include "clock.h" #include "event_data.h" #include "rtc.h" #include "time_events.h" @@ -15,7 +16,6 @@ static void UpdatePerDay(struct Time *localTime); static void UpdatePerMinute(struct Time *localTime); -static void FormChangeTimeUpdate(); void InitTimeBasedEvents(void) { @@ -72,12 +72,11 @@ static void UpdatePerMinute(struct Time *localTime) { BerryTreeTimeUpdate(minutes); gSaveBlock2Ptr->lastBerryTreeUpdate = *localTime; - FormChangeTimeUpdate(); } } } -static void FormChangeTimeUpdate() +void FormChangeTimeUpdate() { s32 i; for (i = 0; i < PARTY_SIZE; i++) diff --git a/src/overworld.c b/src/overworld.c index 889b35effcae..de3bc00ff2d4 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -1538,7 +1538,7 @@ const struct BlendSettings gTimeOfDayBlend[] = [TIME_NIGHT] = {.coeff = 10, .blendColor = TINT_NIGHT, .isTint = TRUE}, }; -u8 UpdateTimeOfDay(void) +void UpdateTimeOfDay(void) { s32 hours, minutes; RtcCalcLocalTime(); @@ -1697,6 +1697,7 @@ static void OverworldBasic(void) }; gTimeUpdateCounter = 0; UpdateTimeOfDay(); + FormChangeTimeUpdate(); if (cachedBlend.time0 != currentTimeBlend.time0 || cachedBlend.time1 != currentTimeBlend.time1 || cachedBlend.weight != currentTimeBlend.weight) diff --git a/src/rtc.c b/src/rtc.c index 5ccafec621bd..9ec96350c80e 100644 --- a/src/rtc.c +++ b/src/rtc.c @@ -4,6 +4,7 @@ #include "strings.h" #include "text.h" #include "fake_rtc.h" +#include "overworld.h" // iwram bss static u16 sErrorStatus; @@ -327,14 +328,7 @@ bool8 IsBetweenHours(s32 hours, s32 begin, s32 end) u8 GetTimeOfDay(void) { - RtcCalcLocalTime(); - if (IsBetweenHours(gLocalTime.hours, MORNING_HOUR_BEGIN, MORNING_HOUR_END)) - return TIME_MORNING; - else if (IsBetweenHours(gLocalTime.hours, EVENING_HOUR_BEGIN, EVENING_HOUR_END)) - return TIME_EVENING; - else if (IsBetweenHours(gLocalTime.hours, NIGHT_HOUR_BEGIN, NIGHT_HOUR_END)) - return TIME_NIGHT; - return TIME_DAY; + return gTimeOfDay; } void RtcInitLocalTimeOffset(s32 hour, s32 minute) From 18485ca4cf80a55dcacb80bda99fdd6e5b6686a8 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Mon, 30 Sep 2024 15:19:54 -0300 Subject: [PATCH 102/104] Time blending uses OW_TIMES_OF_DAY --- src/overworld.c | 53 +++++++++++++++++++++++++------------------------ 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/src/overworld.c b/src/overworld.c index de3bc00ff2d4..dc802c95bc39 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -1538,64 +1538,65 @@ const struct BlendSettings gTimeOfDayBlend[] = [TIME_NIGHT] = {.coeff = 10, .blendColor = TINT_NIGHT, .isTint = TRUE}, }; +#define DEFAULT_WEIGHT 256 +#define TIME_BLEND_WEIGHT(begin, end) (DEFAULT_WEIGHT - (DEFAULT_WEIGHT * ((hours - begin) * MINUTES_PER_HOUR + minutes) / ((end - begin) * MINUTES_PER_HOUR))) + +#define MORNING_HOUR_MIDDLE (MORNING_HOUR_BEGIN + ((MORNING_HOUR_END - MORNING_HOUR_BEGIN) / 2)) + void UpdateTimeOfDay(void) { s32 hours, minutes; RtcCalcLocalTime(); hours = gLocalTime.hours; minutes = gLocalTime.minutes; - if (hours < 4) // night - { - currentTimeBlend.weight = 256; - currentTimeBlend.altWeight = 0; - gTimeOfDay = currentTimeBlend.time0 = currentTimeBlend.time1 = TIME_NIGHT; - } - else if (hours < 7) // night->morning + + if (IsBetweenHours(hours, MORNING_HOUR_BEGIN, MORNING_HOUR_MIDDLE)) // night->morning { currentTimeBlend.time0 = TIME_NIGHT; currentTimeBlend.time1 = TIME_MORNING; - currentTimeBlend.weight = 256 - 256 * ((hours - 4) * 60 + minutes) / ((7-4)*60); - currentTimeBlend.altWeight = (256 - currentTimeBlend.weight) / 2; + currentTimeBlend.weight = TIME_BLEND_WEIGHT(MORNING_HOUR_BEGIN, MORNING_HOUR_MIDDLE); + currentTimeBlend.altWeight = (DEFAULT_WEIGHT - currentTimeBlend.weight) / 2; gTimeOfDay = TIME_MORNING; } - else if (hours < 10) // morning->day + else if (IsBetweenHours(hours, MORNING_HOUR_MIDDLE, MORNING_HOUR_END)) // morning->day { currentTimeBlend.time0 = TIME_MORNING; currentTimeBlend.time1 = TIME_DAY; - currentTimeBlend.weight = 256 - 256 * ((hours - 7) * 60 + minutes) / ((10-7)*60); - currentTimeBlend.altWeight = (256 - currentTimeBlend.weight) / 2 + 128; - gTimeOfDay = TIME_DAY; - } - else if (hours < 18) // day - { - currentTimeBlend.weight = currentTimeBlend.altWeight = 256; - gTimeOfDay = currentTimeBlend.time0 = currentTimeBlend.time1 = TIME_DAY; + currentTimeBlend.weight = TIME_BLEND_WEIGHT(MORNING_HOUR_MIDDLE, MORNING_HOUR_END); + currentTimeBlend.altWeight = (DEFAULT_WEIGHT - currentTimeBlend.weight) / 2 + (DEFAULT_WEIGHT / 2); + gTimeOfDay = TIME_MORNING; } - else if (hours < 20) // evening + else if (IsBetweenHours(hours, EVENING_HOUR_BEGIN, EVENING_HOUR_END)) // evening { currentTimeBlend.time0 = TIME_DAY; currentTimeBlend.time1 = TIME_EVENING; - currentTimeBlend.weight = 256 - 256 * ((hours - 18) * 60 + minutes) / ((20-18)*60); - currentTimeBlend.altWeight = currentTimeBlend.weight / 2 + 128; + currentTimeBlend.weight = TIME_BLEND_WEIGHT(EVENING_HOUR_BEGIN, EVENING_HOUR_END); + currentTimeBlend.altWeight = currentTimeBlend.weight / 2 + (DEFAULT_WEIGHT / 2); gTimeOfDay = TIME_EVENING; } - else if (hours < 22) // evening->night + else if (IsBetweenHours(hours, NIGHT_HOUR_BEGIN, NIGHT_HOUR_BEGIN + 1)) // evening->night { currentTimeBlend.time0 = TIME_EVENING; currentTimeBlend.time1 = TIME_NIGHT; - currentTimeBlend.weight = 256 - 256 * ((hours - 20) * 60 + minutes) / ((22-20)*60); + currentTimeBlend.weight = TIME_BLEND_WEIGHT(NIGHT_HOUR_BEGIN, NIGHT_HOUR_BEGIN + 1); currentTimeBlend.altWeight = currentTimeBlend.weight / 2; gTimeOfDay = TIME_NIGHT; } - else // 22-24, night + else if (IsBetweenHours(hours, NIGHT_HOUR_BEGIN, NIGHT_HOUR_END)) // night { - currentTimeBlend.weight = 256; + currentTimeBlend.weight = DEFAULT_WEIGHT; currentTimeBlend.altWeight = 0; gTimeOfDay = currentTimeBlend.time0 = currentTimeBlend.time1 = TIME_NIGHT; } - return gTimeOfDay; + else // day + { + currentTimeBlend.weight = currentTimeBlend.altWeight = DEFAULT_WEIGHT; + gTimeOfDay = currentTimeBlend.time0 = currentTimeBlend.time1 = TIME_DAY; + } } +#undef TIME_BLEND_WEIGHT + // Whether a map type is naturally lit/outside bool8 MapHasNaturalLight(u8 mapType) { From f913f2884bd0905729bd8f6d905018e6debb63d6 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Tue, 8 Oct 2024 12:21:06 -0300 Subject: [PATCH 103/104] Add config for shadow intensity --- include/config/overworld.h | 5 ++++- include/constants/field_weather.h | 4 ++++ src/field_weather.c | 2 +- src/field_weather_effect.c | 14 ++++++++------ 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/include/config/overworld.h b/include/config/overworld.h index 3298a03209a9..0762197c7b7d 100644 --- a/include/config/overworld.h +++ b/include/config/overworld.h @@ -72,11 +72,14 @@ // These generational defines only make a distinction for OW_ALTERED_TIME_RATIO #define GEN_8_PLA GEN_LATEST + 2 -//Time +// Time #define OW_TIMES_OF_DAY GEN_LATEST // Different generations have the times of day change at different times. #define OW_USE_FAKE_RTC FALSE // When TRUE, seconds on the in-game clock will only advance once every 60 playTimeVBlanks (every 60 frames). #define OW_ALTERED_TIME_RATIO GEN_LATEST // In GEN_8_PLA, the time in game moves forward 60 seconds for every second in the RTC. In GEN_9, it is 20 seconds. This has no effect if OW_USE_FAKE_RTC is FALSE. +// Lighting +#define OW_SHADOW_INTENSITY 4 // Ranges from 0 to 16, where 0 is fully transparent and 16 is black. + // Overworld flags // To use the following features in scripting, replace the 0s with the flag ID you're assigning it to. // Eg: Replace with FLAG_UNUSED_0x264 so you can use that flag to toggle the feature. diff --git a/include/constants/field_weather.h b/include/constants/field_weather.h index fe7eb6a1ae7c..bc4826ee36fb 100644 --- a/include/constants/field_weather.h +++ b/include/constants/field_weather.h @@ -1,6 +1,8 @@ #ifndef GUARD_CONSTANTS_FIELD_WEATHER_H #define GUARD_CONSTANTS_FIELD_WEATHER_H +#include "config/overworld.h" + #define MAX_RAIN_SPRITES 24 #define NUM_CLOUD_SPRITES 3 #define NUM_FOG_HORIZONTAL_SPRITES 20 @@ -22,4 +24,6 @@ #define FADE_FROM_WHITE 2 #define FADE_TO_WHITE 3 +#define BASE_SHADOW_INTENSITY (16 - OW_SHADOW_INTENSITY) + #endif // GUARD_CONSTANTS_FIELD_WEATHER_H diff --git a/src/field_weather.c b/src/field_weather.c index 232255078040..d3ca7ee0527b 100644 --- a/src/field_weather.c +++ b/src/field_weather.c @@ -301,7 +301,7 @@ static void Task_WeatherMain(u8 taskId) static void None_Init(void) { - Weather_SetBlendCoeffs(8, 12); // Indoor shadows + Weather_SetBlendCoeffs(8, BASE_SHADOW_INTENSITY); // Indoor shadows gWeatherPtr->noShadows = FALSE; gWeatherPtr->targetColorMapIndex = 0; gWeatherPtr->colorMapStepDelay = 0; diff --git a/src/field_weather_effect.c b/src/field_weather_effect.c index 724ad76ae878..f7203ab4454b 100644 --- a/src/field_weather_effect.c +++ b/src/field_weather_effect.c @@ -153,11 +153,13 @@ bool8 Clouds_Finish(void) return FALSE; } +STATIC_ASSERT(OW_SHADOW_INTENSITY >= 0 && OW_SHADOW_INTENSITY <= 16, ObjEventShadowTransparencyNotInRange) + void Sunny_InitVars(void) { gWeatherPtr->targetColorMapIndex = 0; gWeatherPtr->colorMapStepDelay = 20; - Weather_SetBlendCoeffs(8, 12); + Weather_SetBlendCoeffs(8, BASE_SHADOW_INTENSITY); // preserve shadow darkness gWeatherPtr->noShadows = FALSE; } @@ -485,7 +487,7 @@ void Rain_InitVars(void) gWeatherPtr->targetColorMapIndex = 3; gWeatherPtr->colorMapStepDelay = 20; SetRainStrengthFromSoundEffect(SE_RAIN); - Weather_SetBlendCoeffs(8, 12); // preserve shadow darkness + Weather_SetBlendCoeffs(8, BASE_SHADOW_INTENSITY); // preserve shadow darkness gWeatherPtr->noShadows = FALSE; } @@ -780,7 +782,7 @@ void Snow_InitVars(void) gWeatherPtr->colorMapStepDelay = 20; gWeatherPtr->targetSnowflakeSpriteCount = NUM_SNOWFLAKE_SPRITES; gWeatherPtr->snowflakeVisibleCounter = 0; - Weather_SetBlendCoeffs(8, 12); // preserve shadow darkness + Weather_SetBlendCoeffs(8, BASE_SHADOW_INTENSITY); // preserve shadow darkness gWeatherPtr->noShadows = FALSE; } @@ -1029,7 +1031,7 @@ void Thunderstorm_InitVars(void) gWeatherPtr->weatherGfxLoaded = FALSE; // duplicate assignment gWeatherPtr->thunderEnqueued = FALSE; SetRainStrengthFromSoundEffect(SE_THUNDERSTORM); - Weather_SetBlendCoeffs(8, 12); // preserve shadow darkness + Weather_SetBlendCoeffs(8, BASE_SHADOW_INTENSITY); // preserve shadow darkness gWeatherPtr->noShadows = FALSE; } @@ -1059,7 +1061,7 @@ void Downpour_InitVars(void) gWeatherPtr->colorMapStepDelay = 20; gWeatherPtr->weatherGfxLoaded = FALSE; // duplicate assignment SetRainStrengthFromSoundEffect(SE_DOWNPOUR); - Weather_SetBlendCoeffs(8, 12); // preserve shadow darkness + Weather_SetBlendCoeffs(8, BASE_SHADOW_INTENSITY); // preserve shadow darkness gWeatherPtr->noShadows = FALSE; } @@ -2272,7 +2274,7 @@ void Shade_InitVars(void) gWeatherPtr->initStep = 0; gWeatherPtr->targetColorMapIndex = 3; gWeatherPtr->colorMapStepDelay = 20; - Weather_SetBlendCoeffs(8, 12); // preserve shadow darkness + Weather_SetBlendCoeffs(8, BASE_SHADOW_INTENSITY); // preserve shadow darkness gWeatherPtr->noShadows = FALSE; } From e68cdfeb3c50ac6c635a2f7f5b1d384d4edc0b48 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Tue, 8 Oct 2024 16:35:33 -0300 Subject: [PATCH 104/104] Fixed missing call to UpdateTimeOfDay in GetTimeOfDay for inside buildings check --- src/rtc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/rtc.c b/src/rtc.c index 9ec96350c80e..ae5b3f9e8f8b 100644 --- a/src/rtc.c +++ b/src/rtc.c @@ -328,6 +328,7 @@ bool8 IsBetweenHours(s32 hours, s32 begin, s32 end) u8 GetTimeOfDay(void) { + UpdateTimeOfDay(); return gTimeOfDay; }