Merge pull request #249 from mateon1/palette
Some checks are pending
GithubCI / build (push) Waiting to run

Palette (builds on top of #248)
This commit is contained in:
AnonymousRandomPerson 2024-11-01 17:40:05 -04:00 committed by GitHub
commit a169714523
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
46 changed files with 232 additions and 248 deletions

View File

@ -249,6 +249,6 @@ _0803E454: .4byte gUnknown_80F61EC
_0803E458: .4byte gDungeon
_0803E45C: .4byte 0x00018217
_0803E460: .4byte 0x00018218
_0803E464: .4byte gUnknown_202EDC8
_0803E464: .4byte gDungeonBrightness
_0803E468: .4byte gUnknown_202D058
thumb_func_end sub_803E250

View File

@ -1566,7 +1566,7 @@ _08040D48:
_08040D58: .4byte gUnknown_203B40D
_08040D5C: .4byte gUnknown_2026E4E
_08040D60: .4byte 0x00000101
_08040D64: .4byte gUnknown_202EDC8
_08040D64: .4byte gDungeonBrightness
_08040D68:
movs r0, 0
str r0, [r1]

View File

@ -411,7 +411,7 @@ _08085E70: .4byte gDungeonPaletteFile
_08085E74: .4byte 0xffffff00
_08085E78: .4byte 0xffff00ff
_08085E7C: .4byte 0xff00ffff
_08085E80: .4byte gUnknown_202EDC8
_08085E80: .4byte gDungeonBrightness
_08085E84: .4byte gDungeon
_08085E88: .4byte 0xffff0000
_08085E8C: .4byte gUnknown_202EE8C

View File

@ -4,10 +4,10 @@
#include "structs/rgb.h"
void InitBGPaletteBuffer(void);
void nullsub_4(s32 index, const u8 *colorArray, s32, u8 *);
void nullsub_5(s32 index, const Rgb32 *colorArray);
void SetBGPaletteBufferColorArray(s32 index, const Rgb32 *color32);
void SetBGPaletteBufferColorRGB(s32 index, const u8 *colorArray, s32, u8 *);
void nullsub_4(s32 index, const RGB *color, s32 brightness, const RGB *ramp);
void nullsub_5(s32 index, const RGB *color);
void SetBGPaletteBufferColorArray(s32 index, const RGB *color);
void SetBGPaletteBufferColorRGB(s32 index, const RGB *color, s32 brightness, const RGB *ramp);
void TransferBGPaletteBuffer(void);
#endif // GUARD_BG_PALETTE_BUFFER_H

View File

@ -10,10 +10,10 @@ typedef struct unkStruct_202EE8C
u32 unk0;
u16 unk4;
s16 unk6;
Rgb32 *unk8;
Rgb32 *unkC;
Rgb32 *unk10;
Rgb32 unk14;
RGB *unk8;
RGB *unkC;
RGB *unk10;
RGB unk14;
} unkStruct_202EE8C;
extern unkStruct_202EE8C gUnknown_202EE8C[32];
@ -37,12 +37,12 @@ typedef struct unkDataFor8004AA4
{
/* 0x0 */ s16 colorCount;
s16 unk2;
/* 0x4 */ Rgb32 colors[0];
/* 0x4 */ RGB colors[0];
} unkDataFor8004AA4;
void nullsub_6(void);
void sub_8004AA4(unkStruct_202EE8C *, OpenedFile *, s32);
bool8 sub_8004AF0(bool8, unkStruct_202EE8C *, s32, s32, s32, u8 *);
bool8 sub_8004AF0(bool8, unkStruct_202EE8C *, s32, s32, s32, const RGB *);
bool8 sub_8004D14(unkStruct_202EE8C *, s32);
bool8 sub_8004D40(unkStruct_202EE8C *, s32);

View File

@ -1,15 +1,17 @@
#ifndef GUARD_CODE_800558C_H
#define GUARD_CODE_800558C_H
#include "structs/rgb.h"
#include "structs/axdata.h"
#include "file_system.h"
// size: ? 0x20 for now
struct unkStructFor800561C
// size: 0x20
struct axMapSprite
{
u8 fill0[0x14 - 0x0];
void *unk14;
s32 *unk18;
s32 unk1C;
axmain axmain;
const u32 *tiles;
const RGB *pal;
s32 tileCount;
};
extern s16 *gUnknown_203B078;
@ -21,10 +23,10 @@ void nullsub_10(bool8);
void nullsub_12(void);
void nullsub_13(void);
void nullsub_14(void);
void sub_8005610(OpenedFile *, s32, s32, u8 *);
void sub_8005770(s32, u8 *colorArray, s32, u8 *);
void sub_8005610(OpenedFile *, s32, s32, const RGB *);
void sub_8005770(s32, const RGB *color, s32, const RGB *ramp);
void sub_80057E8(void);
void sub_8005838(s32 *, u8 kind);
void sub_80060EC(void);
#endif // GUARD_CODE_800558C_H
#endif // GUARD_CODE_800558C_H

View File

@ -19,6 +19,6 @@ void sub_80098BC(u32 *, const u32 *, u32);
void sub_80098F8(u32);
void sub_8009908(void);
void sub_80099C0(void);
void sub_80099F0(Rgb32);
void sub_80099F0(RGB);
#endif // GUARD_CODE_8009804_H

View File

@ -28,7 +28,7 @@ struct unk_203B250
struct TeamBadgeData
{
/* 0x0 */ u8 *pics; // probably a pointer to an arrays of pixels?
/* 0x4 */ Rgb32 *pallete; // Pics share common pallete
/* 0x4 */ RGB *palette; // Pics share common palette
};
bool8 sub_801D014(PokemonStruct1 *);

View File

@ -20,7 +20,7 @@ void sub_80155F0(void);
struct PortraitGfxSub
{
const Rgb32 *pal;
const RGB *pal;
const u8 *gfx;
};

View File

@ -1,16 +1,16 @@
#ifndef GUARD_RGB_H
#define GUARD_RGB_H
typedef struct Rgb32
typedef struct RGB
{
u8 r;
u8 g;
u8 b;
} Rgb32;
} RGB;
typedef struct Palette32
{
Rgb32 pal[16];
RGB pal[16];
} Palette32;
#endif // GUARD_RGB_H

View File

@ -5,6 +5,7 @@
#include "structs/dungeon_entity.h"
#include "file_system.h"
#include "structs/map.h"
#include "structs/rgb.h"
#include "structs/str_position.h"
#include "sprite.h"
@ -23,15 +24,6 @@ typedef struct DungeonLocation
/* 0x1 */ u8 floor;
} DungeonLocation;
// size: 0x4
// This might be "RGB"... see `SetDungeonBGColorRGB()`
typedef struct Dungeon_sub
{
u8 unk0;
u8 unk1;
u8 unk2;
} Dungeon_sub;
typedef struct Weather
{
/* 0xE264 */ u8 weather; // Uses the weather constants in weather.h.
@ -267,7 +259,7 @@ typedef struct Dungeon
Entity *unkBC;
u8 fillC0[0x134 - 0xC0];
struct unkStruct_Dungeon134_sub unk134;
Dungeon_sub unk17C[0x100];
RGB colorRamp[0x100];
/* 0x57C */ u8 fill57C[0x5C0 - 0x57c];
/* 0x5C0 */ s32 unk5C0;
/* 0x5C4 */ struct unkStruct_Dungeon5C4_sub unk5C4[3];

View File

@ -3,9 +3,9 @@
#include "cpu.h"
#define BG_PALETTE_BUFFER_SIZE 512
#define BG_PALETTE_BUFFER_CHUNK_SIZE 16
#define BG_PALETTE_ROW_SIZE 16
static EWRAM_DATA bool8 sBGPaletteUsed[BG_PALETTE_BUFFER_SIZE / BG_PALETTE_BUFFER_CHUNK_SIZE] = {0};
static EWRAM_DATA bool8 sBGPaletteRowDirty[BG_PALETTE_BUFFER_SIZE / BG_PALETTE_ROW_SIZE] = {0};
static EWRAM_DATA u16 sBGPaletteBuffer[BG_PALETTE_BUFFER_SIZE] = {0};
void InitBGPaletteBuffer(void)
@ -16,50 +16,51 @@ void InitBGPaletteBuffer(void)
sBGPaletteBuffer[i] = 0;
}
for (i = 0; i < BG_PALETTE_BUFFER_SIZE / BG_PALETTE_BUFFER_CHUNK_SIZE; i++) {
sBGPaletteUsed[i] = TRUE;
for (i = 0; i < BG_PALETTE_BUFFER_SIZE / BG_PALETTE_ROW_SIZE; i++) {
sBGPaletteRowDirty[i] = TRUE;
}
}
// 99.48% (r3/r4 regswap) https://decomp.me/scratch/7Yc8i
void SetBGPaletteBufferColorRGB(s32 index, const u8 *colorArray, s32 a1, u8 *a2)
void SetBGPaletteBufferColorRGB(s32 index, const RGB *color, s32 brightnessRaw, const RGB *ramp)
{
#ifdef NONMATCHING
s32 var;
#else
register s32 var asm("r1");
#endif // NONMATCHING
s32 brightness = brightnessRaw;
if (a1 < 0)
a1 = 0;
if (a1 > 31)
a1 = 31;
if (brightness < 0)
brightness = 0;
if (brightness > 31)
brightness = 31;
sBGPaletteUsed[index / 16] = 1;
sBGPaletteRowDirty[index / BG_PALETTE_ROW_SIZE] = TRUE;
if (a2 == NULL)
sBGPaletteBuffer[index] = var = ((colorArray[2] * a1 / 256 & 0x1F) << 10) | ((colorArray[1] * a1 / 256 & 0x1F) << 5) | (colorArray[0] * a1 / 256 & 0x1F);
if (ramp == NULL)
sBGPaletteBuffer[index] = RGB2(
color->r * brightness / 256 & 0x1F,
color->g * brightness / 256 & 0x1F,
color->b * brightness / 256 & 0x1F);
else
sBGPaletteBuffer[index] = var = ((a2[4 * colorArray[2] + 2] * a1 / 256 & 0x1F) << 10) | ((a2[4 * colorArray[1] + 1] * a1 / 256 & 0x1F) << 5) | (a2[4 * colorArray[0]] * a1 / 256 & 0x1F);
sBGPaletteBuffer[index] = RGB2(
ramp[color->r].r * brightness / 256 & 0x1F,
ramp[color->g].g * brightness / 256 & 0x1F,
ramp[color->b].b * brightness / 256 & 0x1F);
}
void SetBGPaletteBufferColorArray(s32 index, const Rgb32 *color32)
void SetBGPaletteBufferColorArray(s32 index, const RGB *color32)
{
sBGPaletteUsed[index / BG_PALETTE_BUFFER_CHUNK_SIZE] = TRUE;
sBGPaletteRowDirty[index / BG_PALETTE_ROW_SIZE] = TRUE;
sBGPaletteBuffer[index] = RGB2(color32->r >> 3, color32->g >> 3, color32->b >> 3);
}
void SetBGPaletteBufferColor(s32 index, u16 *color)
{
sBGPaletteUsed[index / BG_PALETTE_BUFFER_CHUNK_SIZE] = TRUE;
sBGPaletteRowDirty[index / BG_PALETTE_ROW_SIZE] = TRUE;
sBGPaletteBuffer[index] = *color;
}
void nullsub_4(s32 index, const u8 *colorArray, s32 a1, u8 *a2)
void nullsub_4(s32 index, const RGB *colorArray, s32 brightness, const RGB *ramp)
{
}
void nullsub_5(s32 index, const Rgb32 *colorArray)
void nullsub_5(s32 index, const RGB *colorArray)
{
}
@ -78,14 +79,14 @@ void TransferBGPaletteBuffer(void)
dest = (u16 *)PLTT;
do
{
if (sBGPaletteUsed[i])
if (sBGPaletteRowDirty[i])
{
sBGPaletteUsed[i] = 0;
CpuCopy(dest, &sBGPaletteBuffer[paletteBufferIndex], sizeof(u16) * 16);
sBGPaletteRowDirty[i] = 0;
CpuCopy(dest, &sBGPaletteBuffer[paletteBufferIndex], sizeof(u16) * BG_PALETTE_ROW_SIZE);
}
++i;
dest += 16;
paletteBufferIndex += 16;
dest += BG_PALETTE_ROW_SIZE;
paletteBufferIndex += BG_PALETTE_ROW_SIZE;
}
while (paletteBufferIndex < BG_PALETTE_BUFFER_SIZE);
}

View File

@ -44,7 +44,7 @@ extern void xxx_call_update_bg_vram(void);
extern u32 gUnknown_203B03C;
extern u16 gUnknown_2026E4E;
extern s32 gUnknown_2000A80;
extern s32 gTitleBrightness;
extern OpenedFile *gTitlePaletteFile;
extern char gPMDBuildVersion[];
@ -103,12 +103,12 @@ void GameLoop(void)
LoadTitleScreen();
SetBG2RegOffsets(0, 0);
SetBG3RegOffsets(0, 0);
gUnknown_2000A80 = 0;
while (gUnknown_2000A80 < 32) {
gTitleBrightness = 0;
while (gTitleBrightness < 32) {
s32 i;
gUnknown_2000A80++;
gTitleBrightness++;
for (i = 0; i < 240; i++)
SetBGPaletteBufferColorRGB(i, &gTitlePaletteFile->data[i * 4], gUnknown_2000A80, 0);
SetBGPaletteBufferColorRGB(i, &((RGB*)gTitlePaletteFile->data)[i], gTitleBrightness, NULL);
xxx_update_stuff(0);
}
if (tmp3) {
@ -145,11 +145,11 @@ void GameLoop(void)
if (nextMenu == MENU_NEW_GAME) break;
}
DeleteMainMenu();
while (gUnknown_2000A80 > 0) {
while (gTitleBrightness > 0) {
s32 i;
gUnknown_2000A80--;
gTitleBrightness--;
for (i = 0; i < 240; i++)
SetBGPaletteBufferColorRGB(i, &gTitlePaletteFile->data[i * 4], gUnknown_2000A80, 0);
SetBGPaletteBufferColorRGB(i, &((RGB*)gTitlePaletteFile->data)[i], gTitleBrightness, NULL);
xxx_update_stuff(0);
}
CloseFile(gTitlePaletteFile);

View File

@ -31,7 +31,7 @@ void sub_8004AA4(unkStruct_202EE8C *a0, OpenedFile *a1, s32 a2)
}
}
bool8 sub_8004AF0(bool8 a0, unkStruct_202EE8C *a1, s32 a2, s32 a3, s32 a4, u8 *a5)
bool8 sub_8004AF0(bool8 a0, unkStruct_202EE8C *a1, s32 a2, s32 a3, s32 a4, const RGB *a5)
{
bool8 bVar3;
bool8 ret;
@ -57,13 +57,13 @@ bool8 sub_8004AF0(bool8 a0, unkStruct_202EE8C *a1, s32 a2, s32 a3, s32 a4, u8 *a
}
if (bVar3)
SetBGPaletteBufferColorRGB(a2, (u8 *)&a1->unk14, a4, a5);
SetBGPaletteBufferColorRGB(a2, &a1->unk14, a4, a5);
}
return ret;
}
UNUSED static bool8 sub_8004B78(bool8 a0, unkStruct_202EE8C *a1, s32 a2, s32 a3, s32 a4, u8 *a5)
UNUSED static bool8 sub_8004B78(bool8 a0, unkStruct_202EE8C *a1, s32 a2, s32 a3, s32 a4, const RGB *a5)
{
bool8 bVar3;
bool8 ret;
@ -89,23 +89,20 @@ UNUSED static bool8 sub_8004B78(bool8 a0, unkStruct_202EE8C *a1, s32 a2, s32 a3,
}
if (bVar3)
nullsub_4(a2, (u8 *)&a1->unk14, a4, a5);
nullsub_4(a2, &a1->unk14, a4, a5);
}
return ret;
}
bool8 sub_8004C00(unkStruct_202EE8C *a0, s32 a1, s32 a2, s32 a3, u8 *a4, s16 *a5)
bool8 sub_8004C00(unkStruct_202EE8C *a0, s32 a1, s32 a2, s32 brightness, const RGB *ramp, s16 *a5)
{
bool8 ret;
s32 i;
s32 r1;
s32 r3;
s32 r5;
u32 color32;
u32 val;
u32 val2;
u32 val3;
s32 r;
s32 g;
s32 b;
RGB color;
ret = FALSE;
@ -124,36 +121,28 @@ bool8 sub_8004C00(unkStruct_202EE8C *a0, s32 a1, s32 a2, s32 a3, u8 *a4, s16 *a5
ret = TRUE;
}
r1 = a5[0] + a0->unk14.r;
r3 = a5[1] + a0->unk14.g;
r5 = a5[2] + a0->unk14.b;
r = a5[0] + a0->unk14.r;
g = a5[1] + a0->unk14.g;
b = a5[2] + a0->unk14.b;
if (r1 > 0xFF)
r1 = 0xFF;
if (r3 > 0xFF)
r3 = 0xFF;
if (r5 > 0xFF)
r5 = 0xFF;
if (r1 < 0)
r1 = 0;
if (r3 < 0)
r3 = 0;
if (r5 < 0)
r5 = 0;
if (r > 0xFF)
r = 0xFF;
if (g > 0xFF)
g = 0xFF;
if (b > 0xFF)
b = 0xFF;
if (r < 0)
r = 0;
if (g < 0)
g = 0;
if (b < 0)
b = 0;
val = (u8)r1;
color32 &= 0xFFFFFF00;
color32 |= val;
color.r = r;
color.g = g;
color.b = b;
val2 = (u8)r3 << 8;
color32 &= 0xFFFF00FF;
color32 |= val2;
val3 = (u8)r5 << 16;
color32 &= 0xFF00FFFF;
color32 |= val3;
SetBGPaletteBufferColorRGB(a1, (u8 *)&color32, a3, a4);
SetBGPaletteBufferColorRGB(a1, &color, brightness, ramp);
}
return ret;

View File

@ -31,8 +31,8 @@ extern const s16 gUnknown_80B83EA[16 * 10];
extern s32 sin_abs_4096(s32);
extern s32 cos_4096(s32);
static void sub_800561C(struct unkStructFor800561C *, s32, s32, u8 *);
s32 *sub_8005674(struct unkStructFor800561C *, s32);
static void sub_800561C(struct axMapSprite *, s32, s32, const RGB *);
const RGB *sub_8005674(struct axMapSprite *, s32);
void DoAxFrame_800558C(struct axObject *a0, s32 spriteX, s32 spriteY, u32 a3, u32 paletteNum, u16 *spriteMasks)
{
@ -56,35 +56,35 @@ void DoAxFrame_800558C(struct axObject *a0, s32 spriteX, s32 spriteY, u32 a3, u3
a0->axdata.flags &= 0xF7FF;
}
void sub_8005610(OpenedFile *a0, s32 a1, s32 a2, u8 *a3)
void sub_8005610(OpenedFile *a0, s32 vramIdx, s32 brightness, const RGB *ramp)
{
sub_800561C((struct unkStructFor800561C *)a0->data, a1, a2, a3);
sub_800561C((struct axMapSprite *)a0->data, vramIdx, brightness, ramp);
}
static void sub_800561C(struct unkStructFor800561C *a0, s32 a1, s32 a2, u8 *a3)
static void sub_800561C(struct axMapSprite *a0, s32 vramIdx, s32 brightness, const RGB *ramp)
{
s32 i;
if (a0->unk14 != NULL)
CpuCopy(OBJ_VRAM0 + a1 * 0x20, a0->unk14, a0->unk1C << 5);
if (a0->tiles != NULL)
CpuCopy(OBJ_VRAM0 + vramIdx * 0x20, a0->tiles, a0->tileCount * 0x20);
if (a0->unk18 != NULL) {
if (a0->pal != NULL) {
for (i = 0; i < 16; i++)
SetBGPaletteBufferColorRGB(i + 480, (u8 *)&a0->unk18[i], a2, a3);
SetBGPaletteBufferColorRGB(i + 480, &a0->pal[i], brightness, ramp);
}
}
UNUSED static s32 *sub_8005668(OpenedFile *a0, s32 a1)
UNUSED static const RGB *sub_8005668(OpenedFile *a0, s32 vramIdx)
{
return sub_8005674((struct unkStructFor800561C *)a0->data, a1);
return sub_8005674((struct axMapSprite *)a0->data, vramIdx);
}
s32 *sub_8005674(struct unkStructFor800561C *a0, s32 a1)
const RGB *sub_8005674(struct axMapSprite *a0, s32 vramIdx)
{
if (a0->unk14 != NULL)
CpuCopy(OBJ_VRAM0 + a1 * 0x20, a0->unk14, a0->unk1C << 5);
if (a0->tiles != NULL)
CpuCopy(OBJ_VRAM0 + vramIdx * 0x20, a0->tiles, a0->tileCount * 0x20);
return a0->unk18;
return a0->pal;
}
void sub_800569C(Position *a0, struct axObject *a1, u8 a2)
@ -149,17 +149,17 @@ void sub_8005700(Position *a0, struct axObject *a1)
}
}
UNUSED static void sub_8005764(s32 a0, OpenedFile *file, s32 a2, u8 *a3)
UNUSED static void sub_8005764(s32 a0, OpenedFile *file, s32 a2, const RGB *a3)
{
sub_8005770(a0, file->data, a2, a3);
sub_8005770(a0, (const RGB*)file->data, a2, a3);
}
void sub_8005770(s32 param_1, u8 *colorArray, s32 a1, u8 *a2)
void sub_8005770(s32 param_1, const RGB *color, s32 brightness, const RGB *ramp)
{
s32 i;
for (i = 0; i < 16; i++)
SetBGPaletteBufferColorRGB((param_1 + 0x10) * 0x10 + i, &colorArray[i * 4], a1, a2);
SetBGPaletteBufferColorRGB((param_1 + 0x10) * 0x10 + i, &color[i], brightness, ramp);
}
// Maybe Position

View File

@ -20,7 +20,7 @@ void InitFontPalette(void)
{
OpenedFile *fontpalFile;
s32 i;
Rgb32 *ptr;
RGB *ptr;
fontpalFile = OpenFileAndGetFileDataPtr(gUnknown_80B88CC, &gSystemFileArchive); // fontpal
CpuCopy(gFontPalette, fontpalFile->data, sizeof(gFontPalette));
@ -126,7 +126,7 @@ void sub_80099C0(void)
CpuCopy(BG_SCREEN_ADDR(13), gUnknown_202B038[1], BG_SCREEN_SIZE);
}
void sub_80099F0(Rgb32 a0)
void sub_80099F0(RGB a0)
{
s32 i;

View File

@ -595,17 +595,17 @@ static void sub_801D894(void)
static void LoadTeamRankBadge(u32 a0, u32 a1, u32 a2)
{
OpenedFile *teamBadgeFile;
s32 palleteIndex;
s32 paletteIndex;
u8 rank;
Rgb32 *colorArray;
RGB *colorArray;
u8 *teamBadgePic;
teamBadgeFile = OpenFileAndGetFileDataPtr(sTeamRankBadgeFileName, &gTitleMenuFileArchive);
teamBadgePic = ((struct TeamBadgeData *)(teamBadgeFile->data))->pics;
colorArray = ((struct TeamBadgeData *)(teamBadgeFile->data))->pallete;
colorArray = ((struct TeamBadgeData *)(teamBadgeFile->data))->palette;
for (palleteIndex = 0; palleteIndex < 16; palleteIndex++) {
SetBGPaletteBufferColorArray(palleteIndex + 224, colorArray);
for (paletteIndex = 0; paletteIndex < 16; paletteIndex++) {
SetBGPaletteBufferColorArray(paletteIndex + 224, colorArray);
colorArray++;
}

View File

@ -52,7 +52,7 @@ bool8 sub_802DB28(u8 jobSlotIndex, u8 dungeon)
sUnknown_203B2FC->monPortrait.pos.y = 8;
if (sUnknown_203B2FC->monPortrait.faceFile != NULL)
sUnknown_203B2FC->monPortrait.faceData = (void *) sUnknown_203B2FC->monPortrait.faceFile->data;
sUnknown_203B2FC->monPortrait.faceData = (struct PortraitGfx *) sUnknown_203B2FC->monPortrait.faceFile->data;
sub_802DC28(0);
return TRUE;

View File

@ -546,7 +546,7 @@ struct DungeonNameFontFileData
struct DungeonNamePaletteFileData
{
Rgb32 pal[16];
RGB pal[16];
};
void ShowDungeonNameBanner(void)
@ -1050,7 +1050,7 @@ NAKED void sub_803E02C(void)
void sub_803E13C(void)
{
s32 i;
Rgb32 *pal;
RGB *pal;
SetWindowBGColor();
if (gGameOptionsRef->playerGender != 0)

View File

@ -18,7 +18,7 @@
extern u8 gUnknown_203B40C;
extern u8 gUnknown_203B40D;
extern s32 gUnknown_202EDC8;
extern s32 gDungeonBrightness;
extern s32 gUnknown_202EDCC;
extern u32 gUnknown_202EDD0;
extern s32 gUnknown_202EDD4;
@ -87,7 +87,7 @@ void sub_803E490(u32 unused)
if(gDungeon->unk181e8.unk18215 != 0 && gDungeon->unk1BDD4.unk1C06C != 3)
sub_8004AF0(gUnknown_203B40D, gUnknown_202EE8C, 0xA0, 0x20, gUnknown_202EDC8, (u8 *)gDungeon->unk17C);
sub_8004AF0(gUnknown_203B40D, gUnknown_202EE8C, 0xA0, 0x20, gDungeonBrightness, gDungeon->colorRamp);
nullsub_8(gGameOptionsRef->unkA);
sub_8005180();
@ -169,7 +169,7 @@ void sub_803E748(void) {
index2 = 0x1F;
gUnknown_203B40D = 1;
gUnknown_202EDC8 = 0;
gDungeonBrightness = 0;
sub_803E874(1, 0x1F);
@ -186,13 +186,13 @@ void sub_803E748(void) {
}
}
if(index1 > 0xB)
if(gUnknown_202EDC8 <= 0x1E)
gUnknown_202EDC8++;
if(gDungeonBrightness <= 0x1E)
gDungeonBrightness++;
sub_803E874(1, index2);
sub_803E46C(5);
}
gUnknown_203B40D = 0;
gUnknown_202EDC8 = 0x1F;
gDungeonBrightness = 0x1F;
}
void sub_803E7C8(void)
@ -203,7 +203,7 @@ void sub_803E7C8(void)
index2 = 0x1F;
gUnknown_203B40D = 1;
gUnknown_202EDC8 = 0;
gDungeonBrightness = 0;
sub_803E46C(5);
@ -234,9 +234,9 @@ void sub_803E830(void)
{
sub_803E874(0, 0);
sub_803E46C(5);
if(gUnknown_202EDC8 > 0)
gUnknown_202EDC8--;
if(gDungeonBrightness > 0)
gDungeonBrightness--;
}
gUnknown_202EDC8 = 0;
gDungeonBrightness = 0;
gUnknown_203B40D = 0;
}

View File

@ -23,7 +23,7 @@
#include "constants/item.h"
#include "constants/status.h"
extern s32 gUnknown_202EDC8;
extern s32 gDungeonBrightness;
extern u32 gUnknown_202EDD0;
extern s32 gUnknown_202EDD8;
extern u32 gUnknown_202EDFC;
@ -37,13 +37,13 @@ struct DungeonPalFile
extern struct DungeonPalFile *gDungeonPaletteFile;
extern struct DungeonPalFile *gDungeonNameBannerPalette;
extern struct DungeonPalFile *gUnknown_202EC94;
extern u8 gUnknown_202ECA4[];
extern u8 gUnknown_202D058[];
extern RGB gUnknown_202ECA4[];
extern RGB gUnknown_202D058;
extern u8 gUnknown_203B40C;
extern MenuInputStruct gUnknown_202EE10;
extern SpriteOAM gUnknown_202EDDC;
extern const u8 gUnknown_80F62AC[];
extern const RGB gUnknown_80F62AC;
extern const struct UnkTextStruct2 gUnknown_80F62B0[];
extern const struct UnkTextStruct2 gUnknown_80F6310[];
extern const struct UnkTextStruct2 gUnknown_80F6370[];
@ -85,52 +85,52 @@ void sub_803FF18(s32 a0, u16 *a1, bool8 a2);
void sub_803E874(bool8 r10, s32 r9)
{
s32 i, index, count;
const u8 *colorArray;
const RGB *color;
colorArray = gDungeonPaletteFile->unk4;
SetBGPaletteBufferColorRGB(0, gUnknown_80F62AC, gUnknown_202EDC8, (void *) &gDungeon->unk17C);
colorArray += 4;
color = gDungeonPaletteFile->unk4;
SetBGPaletteBufferColorRGB(0, &gUnknown_80F62AC, gDungeonBrightness, gDungeon->colorRamp);
color++;
index = 1;
count = 159;
for (i = 0; i < count; i++) {
SetBGPaletteBufferColorRGB(index, colorArray, gUnknown_202EDC8, (void *) &gDungeon->unk17C);
colorArray += 4;
SetBGPaletteBufferColorRGB(index, color, gDungeonBrightness, gDungeon->colorRamp);
color++;
index++;
}
if (gDungeon->unk181e8.unk18215 == 0 || gDungeon->unk1BDD4.unk1C06C == 3) {
sub_8004AF0(TRUE, gUnknown_202EE8C, 0xA0, 0x20, gUnknown_202EDC8, (void *) &gDungeon->unk17C);
sub_8004AF0(TRUE, gUnknown_202EE8C, 0xA0, 0x20, gDungeonBrightness, gDungeon->colorRamp);
}
index += 32;
colorArray = gUnknown_202ECA4;
color = gUnknown_202ECA4;
count = 32;
for (i = 0; i < count; i++) {
SetBGPaletteBufferColorRGB(index, colorArray, gUnknown_202EDC8, (void *) &gDungeon->unk17C);
colorArray += 4;
SetBGPaletteBufferColorRGB(index, color, gDungeonBrightness, gDungeon->colorRamp);
color++;
index++;
}
if (r10) {
index = 224;
colorArray = gDungeonNameBannerPalette->unk4;
color = gDungeonNameBannerPalette->unk4;
count = 16;
for (i = 0; i < count; i++) {
SetBGPaletteBufferColorRGB(index, colorArray, r9, NULL);
colorArray += 4;
SetBGPaletteBufferColorRGB(index, color, r9, NULL);
color++;
index++;
}
}
SetBGPaletteBufferColorRGB(248, gUnknown_202D058, gUnknown_202EDC8, NULL);
SetBGPaletteBufferColorRGB(248, &gUnknown_202D058, gDungeonBrightness, NULL);
colorArray = ((struct DungeonPalFile*) gDungeon->paletFile)->unk4;
color = ((struct DungeonPalFile*) gDungeon->paletFile)->unk4;
index = 256;
count = 208;
for (i = 0; i < count; i++) {
SetBGPaletteBufferColorRGB(index, colorArray, gUnknown_202EDC8, (void *) &gDungeon->unk17C);
nullsub_4(index, colorArray, gUnknown_202EDC8, NULL);
colorArray += 4;
SetBGPaletteBufferColorRGB(index, color, gDungeonBrightness, gDungeon->colorRamp);
nullsub_4(index, color, gDungeonBrightness, NULL);
color++;
index++;
}
}
@ -138,14 +138,14 @@ void sub_803E874(bool8 r10, s32 r9)
void BgColorCallNullsub4(void)
{
s32 i, index, count;
const u8 *colorArray;
const RGB *color;
colorArray = ((struct DungeonPalFile*) gDungeon->paletFile)->unk4;
color = ((struct DungeonPalFile*) gDungeon->paletFile)->unk4;
index = 256;
count = 208;
for (i = 0; i < count; i++) {
nullsub_4(index, colorArray, gUnknown_202EDC8, NULL);
colorArray += 4;
nullsub_4(index, color, gDungeonBrightness, NULL);
color++;
index++;
}
}
@ -153,33 +153,33 @@ void BgColorCallNullsub4(void)
void sub_803EA10(void)
{
s32 i, index, count;
const u8 *colorArray;
const RGB *color;
colorArray = gDungeonPaletteFile->unk4;
SetBGPaletteBufferColorRGB(0, gUnknown_80F62AC, gUnknown_202EDC8, (void *) &gDungeon->unk17C);
colorArray += 4;
color= gDungeonPaletteFile->unk4;
SetBGPaletteBufferColorRGB(0, &gUnknown_80F62AC, gDungeonBrightness, gDungeon->colorRamp);
color++;
index = 1;
count = 159;
for (i = 0; i < count; i++) {
SetBGPaletteBufferColorRGB(index, colorArray, gUnknown_202EDC8, (void *) &gDungeon->unk17C);
colorArray += 4;
SetBGPaletteBufferColorRGB(index, color, gDungeonBrightness, gDungeon->colorRamp);
color++;
index++;
}
if (gDungeon->unk181e8.unk18215 == 0 || gDungeon->unk1BDD4.unk1C06C == 3) {
sub_8004AF0(TRUE, gUnknown_202EE8C, 0xA0, 0x20, gUnknown_202EDC8, (void *) &gDungeon->unk17C);
sub_8004AF0(TRUE, gUnknown_202EE8C, 0xA0, 0x20, gDungeonBrightness, gDungeon->colorRamp);
}
index += 32;
colorArray = gUnknown_202ECA4;
color = gUnknown_202ECA4;
count = 32;
for (i = 0; i < count; i++) {
SetBGPaletteBufferColorRGB(index, colorArray, gUnknown_202EDC8, (void *) &gDungeon->unk17C);
colorArray += 4;
SetBGPaletteBufferColorRGB(index, color, gDungeonBrightness, gDungeon->colorRamp);
color++;
index++;
}
SetBGPaletteBufferColorRGB(248, gUnknown_202D058, gUnknown_202EDC8, NULL);
SetBGPaletteBufferColorRGB(248, &gUnknown_202D058, gDungeonBrightness, NULL);
}
void sub_803EAF0(u32 a0, u8 *a1)

View File

@ -40,7 +40,7 @@ extern void sub_8041550(Entity *pokemon, u32, u32, u32, u32, u32);
void sub_80421C0(Entity *pokemon, u16 r1);
void EntityUpdateStatusSprites(Entity *entity);
extern s32 gUnknown_202EDC8;
extern s32 gDungeonBrightness;
extern u8 gUnknown_203B40D;
extern s16 gUnknown_2026E4E;
@ -119,23 +119,23 @@ void sub_804178C(u8 param_1)
if ((counter == 1000) || (param_1 != 0)) {
sub_800DBBC();
}
if (gUnknown_202EDC8 < 0x1f) {
if (gDungeonBrightness < 0x1f) {
temp = gUnknown_203B40D;
gUnknown_203B40D = 1;
for(counter = 0; counter < 1000; counter++)
{
if (gUnknown_202EDC8 < 0x1f) {
gUnknown_202EDC8 += 4;
if (gDungeonBrightness < 0x1f) {
gDungeonBrightness += 4;
if (gUnknown_2026E4E != 0x808) {
gUnknown_2026E4E -= 0x101;
}
}
else {
gUnknown_202EDC8 = 0x1f;
gDungeonBrightness = 0x1f;
}
sub_803EA10();
sub_803E46C(0x4a);
if(gUnknown_202EDC8 == 0x1f) break;
if(gDungeonBrightness == 0x1f) break;
};
gUnknown_2026E4E = 0x808;
gUnknown_203B40D = temp;

View File

@ -384,7 +384,7 @@ extern void sub_8042B0C(Entity *);
extern s16 gUnknown_2026E4E;
extern u8 gUnknown_202F32C;
extern u8 gUnknown_202F1A8;
extern s32 gUnknown_202EDC8;
extern s32 gDungeonBrightness;
extern Entity *gLeaderPointer;
void sub_8044124(void);
@ -416,7 +416,7 @@ void xxx_dungeon_8042F6C(struct UnkStruct_xxx_dungeon_8042F6C *r8)
bool8 r9;
bool8 r10;
u8 sp;
Rgb32 colorArray;
RGB color;
gUnknown_203B40C = 0;
r6 = r8->unk8;
@ -631,7 +631,7 @@ void xxx_dungeon_8042F6C(struct UnkStruct_xxx_dungeon_8042F6C *r8)
}
sub_8049840();
sub_803E178();
gUnknown_202EDC8 = 0;
gDungeonBrightness = 0;
sub_8040124();
sub_803EAF0(4, 0);
sub_8052210(0);
@ -806,10 +806,10 @@ void xxx_dungeon_8042F6C(struct UnkStruct_xxx_dungeon_8042F6C *r8)
}
SetBGOBJEnableFlags(0);
colorArray.r = 0x60;
colorArray.g = 0x80;
colorArray.b = 0xF8;
SetBGPaletteBufferColorRGB(253, (void*) &colorArray, gUnknown_202EDC8, 0); // Todo: Fix SetBGPaletteBufferColorRGB to take RGB*
color.r = 0x60;
color.g = 0x80;
color.b = 0xF8;
SetBGPaletteBufferColorRGB(253, &color, gDungeonBrightness, NULL);
sub_8040094(1);
gDungeon->unk181e8.unk18218 = 1;
if ((gDungeon->unk10 == 2 || gDungeon->unk10 == 3) && gDungeon->unk6 != 0) {

View File

@ -12,7 +12,7 @@
// This file may originally be merged with code_8086A3C.c and code_8057824_1.c
// ???
extern u32 gUnknown_202EDC8;
extern u32 gDungeonBrightness;
EWRAM_DATA unkStruct_202F3D0 gUnknown_202F3D0 = {0};
@ -342,7 +342,7 @@ void sub_8086794(void)
{
s32 i;
gUnknown_202EDC8 = 0;
gDungeonBrightness = 0;
for (i = 0; i < 200; i++) {
SetDungeonBGColorRGB(0, 0, 0, 1, 0);
@ -350,8 +350,8 @@ void sub_8086794(void)
sub_803E46C(70);
if ((i & 3) == 0) {
gUnknown_202EDC8++;
if (gUnknown_202EDC8 == 31)
gDungeonBrightness++;
if (gDungeonBrightness == 31)
break;
}
}

View File

@ -30,7 +30,7 @@
#include "exclusive_pokemon.h"
#include "trap.h"
extern u32 gUnknown_202EDC8;
extern u32 gDungeonBrightness;
extern const s16 gUnknown_80F57CA;
extern const s16 gUnknown_80F57CC;
@ -3554,7 +3554,7 @@ void LatiosScreenFlash(void)
s32 iVar1;
PlaySoundEffect(0x1ee);
gUnknown_202EDC8 = 0x1f;
gDungeonBrightness = 0x1f;
for(iVar1 = 250; iVar1 > 149; iVar1 -= 10)
{
SetDungeonBGColorRGB(iVar1,iVar1,iVar1,1,1);
@ -4195,7 +4195,7 @@ void JirachiWishGrantFlash(void)
s32 iVar1;
PlaySoundEffect(0x2c1);
gUnknown_202EDC8 = 0x1f;
gDungeonBrightness = 0x1f;
for(iVar1 = 0xFA; iVar1 > 0x95; iVar1 -= 10)
{
@ -4493,7 +4493,7 @@ void LugiaScreenFlash2(void)
void sub_808C0CC(void)
{
gUnknown_202EDC8 = 0x1f;
gDungeonBrightness = 0x1f;
SetDungeonBGColorRGB(0,0,0,1,1);
BgColorCallNullsub4();
sub_803E46C(0x46);
@ -4614,7 +4614,7 @@ void KyogreScreenFlash(void)
void sub_808C360(void)
{
gUnknown_202EDC8 = 0x1f;
gDungeonBrightness = 0x1f;
SetDungeonBGColorRGB(0,0,0,1,1);
BgColorCallNullsub4();
sub_803E46C(0x46);
@ -4701,7 +4701,7 @@ void DeoxysScreenFlash(void)
void sub_808C550(void)
{
gUnknown_202EDC8 = 0x1f;
gDungeonBrightness = 0x1f;
SetDungeonBGColorRGB(0,0,0,1,1);
BgColorCallNullsub4();
sub_803E46C(0x46);

View File

@ -376,7 +376,7 @@ void DisplayDungeonMessage(struct MonDialogueSpriteInfo *monSpriteInfo, const u8
&& IsPokemonDialogueSpriteAvail(monSpriteInfo->species, monSpriteInfo->spriteId))
{
monPortrait.faceFile = GetDialogueSpriteDataPtr(monSpriteInfo->species);
monPortrait.faceData = (void *) monPortrait.faceFile->data;
monPortrait.faceData = (struct PortraitGfx *) monPortrait.faceFile->data;
monPortrait.pos.x = 2;
monPortrait.pos.y = 9;
monPortrait.spriteId = monSpriteInfo->spriteId;
@ -501,7 +501,7 @@ void DisplayDungeonDialogue(const struct DungeonDialogueStruct *dialogueInfo)
monPortraitPtr = &monPortrait;
monPortraitPtr->faceFile = GetDialogueSpriteDataPtr(dialogueMonId);
if (monPortraitPtr->faceFile != NULL) {
monPortraitPtr->faceData = (void *) monPortraitPtr->faceFile->data;
monPortraitPtr->faceData = (struct PortraitGfx *) monPortraitPtr->faceFile->data;
monPortraitPtr->unkE = 0;
monPortraitPtr->spriteId = dialogueInfo->unk2;
monPortraitPtr->flip = strPtr->flip;
@ -551,7 +551,7 @@ bool32 DisplayDungeonYesNoMessage(struct MonDialogueSpriteInfo *monSpriteInfo, c
&& IsPokemonDialogueSpriteAvail(monSpriteInfo->species, monSpriteInfo->spriteId))
{
monPortrait.faceFile = GetDialogueSpriteDataPtr(monSpriteInfo->species);
monPortrait.faceData = (void *) monPortrait.faceFile->data;
monPortrait.faceData = (struct PortraitGfx *) monPortrait.faceFile->data;
monPortrait.pos.x = 2;
monPortrait.pos.y = 9;
monPortrait.spriteId = monSpriteInfo->spriteId;
@ -600,7 +600,7 @@ s32 DisplayDungeonMenuMessage(struct MonDialogueSpriteInfo *monSpriteInfo, const
&& IsPokemonDialogueSpriteAvail(monSpriteInfo->species, monSpriteInfo->spriteId))
{
monPortrait.faceFile = GetDialogueSpriteDataPtr(monSpriteInfo->species);
monPortrait.faceData = (void *) monPortrait.faceFile->data;
monPortrait.faceData = (struct PortraitGfx *) monPortrait.faceFile->data;
monPortrait.pos.x = 2;
monPortrait.pos.y = 9;
monPortrait.spriteId = monSpriteInfo->spriteId;
@ -763,7 +763,7 @@ void sub_8052FB8(const u8 *str)
if (r8 < 62) {
r8++;
for (j = 0; j < 8; j++) {
SetBGPaletteBufferColorRGB(240 + j, (void*) &gFontPalette[0].pal[j], r8 / 2, NULL);
SetBGPaletteBufferColorRGB(240 + j, &gFontPalette[0].pal[j], r8 / 2, NULL);
}
}
else {
@ -816,7 +816,7 @@ void sub_8052FB8(const u8 *str)
while (r8 >= 0) {
for (j = 0; j < 8; j++) {
SetBGPaletteBufferColorRGB(240 + j, (void*) &gFontPalette[0].pal[j], r8 / 2, NULL);
SetBGPaletteBufferColorRGB(240 + j, &gFontPalette[0].pal[j], r8 / 2, NULL);
}
DrawDialogueBoxString();
sub_803E46C(9);

View File

@ -71,7 +71,7 @@ bool8 CreateFelicityBank(s32 mode)
faceFile = GetDialogueSpriteDataPtr(MONSTER_PERSIAN);
sFelicityBankWork->monPortrait.faceFile = faceFile;
sFelicityBankWork->monPortrait.faceData = (void *) faceFile->data;
sFelicityBankWork->monPortrait.faceData = (struct PortraitGfx *) faceFile->data;
sFelicityBankWork->monPortrait.spriteId = 0;
sFelicityBankWork->monPortrait.flip = FALSE;
sFelicityBankWork->monPortrait.unkE = 0;

View File

@ -191,7 +191,7 @@ void ReadGameOptions(struct unkStruct_8094924 *param_1)
void SetWindowBGColor(void)
{
struct Rgb32 winColors[] = {
struct RGB winColors[] = {
{0x20, 0x48, 0x68}, // Blue
{0x80, 0x38, 0x20}, // Red
{0x28, 0x80, 0x48}, // Green

View File

@ -49,7 +49,7 @@ bool8 CreateGulpinShop(u32 mode, s16 pokeSpecies, Move *moves)
faceFile = GetDialogueSpriteDataPtr(MONSTER_GULPIN);
sGulpinShopWork->monPortrait.faceFile = faceFile;
sGulpinShopWork->monPortrait.faceData = (void *) faceFile->data;
sGulpinShopWork->monPortrait.faceData = (struct PortraitGfx *) faceFile->data;
sGulpinShopWork->monPortrait.spriteId = 0;
sGulpinShopWork->monPortrait.flip = FALSE;

View File

@ -101,7 +101,7 @@ bool8 sub_801FB50(u32 mode)
faceFile = GetDialogueSpriteDataPtr(MONSTER_GULPIN);
gUnknown_203B27C->monPortrait.faceFile = faceFile;
gUnknown_203B27C->monPortrait.faceData = (void *) faceFile->data;
gUnknown_203B27C->monPortrait.faceData = (struct PortraitGfx *) faceFile->data;
gUnknown_203B27C->monPortrait.spriteId = 0;
gUnknown_203B27C->monPortrait.flip = FALSE;
gUnknown_203B27C->monPortrait.unkE = 0;

View File

@ -67,7 +67,7 @@ bool8 CreateKangaskhanStorage(u32 mode)
faceFile = GetDialogueSpriteDataPtr(MONSTER_KANGASKHAN);
gKangaskhanStorageWork->monPortrait.faceFile = faceFile;
gKangaskhanStorageWork->monPortrait.faceData = (void *) faceFile->data;
gKangaskhanStorageWork->monPortrait.faceData = (struct PortraitGfx *) faceFile->data;
gKangaskhanStorageWork->monPortrait.spriteId = FALSE;
gKangaskhanStorageWork->monPortrait.flip = FALSE;
gKangaskhanStorageWork->monPortrait.unkE = 0;

View File

@ -107,7 +107,7 @@ bool8 CreateKecleonBros(u32 mode)
faceFile = GetDialogueSpriteDataPtr(MONSTER_KECLEON);
sKecleonBrosWork1->monPortrait.faceFile = faceFile;
sKecleonBrosWork1->monPortrait.faceData = (void *) faceFile->data;
sKecleonBrosWork1->monPortrait.faceData = (struct PortraitGfx *) faceFile->data;
sKecleonBrosWork1->monPortrait.spriteId = 0;
sKecleonBrosWork1->monPortrait.flip = FALSE;
sKecleonBrosWork1->monPortrait.unkE = 0;

View File

@ -365,11 +365,11 @@ void DrawLoadScreenText(void)
sub_80073E0(0);
}
// Think structure of clmkFile is like Team Rank Badges except each pic has a diff pallete
// Think structure of clmkFile is like Team Rank Badges except each pic has a diff palette
struct ClmkFileData
{
/* 0x0 */ u32 *pics;
/* 0x4 */ Rgb32 *pallete;
/* 0x4 */ RGB *palette;
};
void sub_80397B4(void)
@ -383,7 +383,7 @@ void sub_80397B4(void)
for(index = 0; index < 64; index++)
{
SetBGPaletteBufferColorArray(index + 176, &((struct ClmkFileData *)(clmkFile->data))->pallete[index]);
SetBGPaletteBufferColorArray(index + 176, &((struct ClmkFileData *)(clmkFile->data))->palette[index]);
}
x = 8;

View File

@ -98,7 +98,7 @@ bool8 MakuhitaDojo_New(u32 mode)
faceFile = GetDialogueSpriteDataPtr(MONSTER_MAKUHITA);
sMakuhitaDojoWork1->monPortrait.faceFile = faceFile;
sMakuhitaDojoWork1->monPortrait.faceData = (void *) faceFile->data;
sMakuhitaDojoWork1->monPortrait.faceData = (struct PortraitGfx *) faceFile->data;
sMakuhitaDojoWork1->monPortrait.spriteId = 0;
sMakuhitaDojoWork1->monPortrait.flip = FALSE;
sMakuhitaDojoWork1->monPortrait.unkE = 0;

View File

@ -139,7 +139,7 @@ u32 sub_802F204(unkStruct_802F204 *r0, bool8 displayClientSprite)
if(gUnknown_203B310->monPortrait.faceFile != NULL)
{
gUnknown_203B310->monPortrait.faceData = (void *) gUnknown_203B310->monPortrait.faceFile->data;
gUnknown_203B310->monPortrait.faceData = (struct PortraitGfx *) gUnknown_203B310->monPortrait.faceFile->data;
}
SetRewardSceneState(PREP_MONEY_REWARD);

View File

@ -384,7 +384,7 @@ static void PersonalityTest_DisplayStarterSprite(void)
{
s32 starterID;
struct OpenedFile *faceFile;
s32 palleteIndex;
s32 paletteIndex;
s32 emotionId;
const u8 *gfx;
UnkTextStruct2 stackArray[4];
@ -400,8 +400,8 @@ static void PersonalityTest_DisplayStarterSprite(void)
faceFile = GetDialogueSpriteDataPtr(starterID);
gfx = ((struct PortraitGfx *)(faceFile->data))->sprites[EMOTION_HAPPY].gfx;
emotionId = EMOTION_HAPPY;
for (palleteIndex = 0; palleteIndex < 0x10; palleteIndex++) {
SetBGPaletteBufferColorArray(palleteIndex + 0xE0, &((struct PortraitGfx *)(faceFile->data))->sprites[emotionId].pal[palleteIndex]);
for (paletteIndex = 0; paletteIndex < 0x10; paletteIndex++) {
SetBGPaletteBufferColorArray(paletteIndex + 0xE0, &((struct PortraitGfx *)(faceFile->data))->sprites[emotionId].pal[paletteIndex]);
}
DisplayMonPortraitSpriteFlipped(1, gfx, 14);

View File

@ -245,7 +245,7 @@ static void PersonalityTest_DisplayPartnerSprite(void)
{
s32 partnerID;
struct OpenedFile *faceFile;
s32 palleteIndex;
s32 paletteIndex;
const u8 *gfx;
s32 emotionId;
@ -255,8 +255,8 @@ static void PersonalityTest_DisplayPartnerSprite(void)
faceFile = GetDialogueSpriteDataPtr(partnerID);
gfx = ((struct PortraitGfx *)(faceFile->data))->sprites[EMOTION_NORMAL].gfx;
emotionId = EMOTION_NORMAL;
for (palleteIndex = 0; palleteIndex < 0x10; palleteIndex++) {
SetBGPaletteBufferColorArray(palleteIndex + 0xE0, &((struct PortraitGfx *)(faceFile->data))->sprites[emotionId].pal[palleteIndex]);
for (paletteIndex = 0; paletteIndex < 0x10; paletteIndex++) {
SetBGPaletteBufferColorArray(paletteIndex + 0xE0, &((struct PortraitGfx *)(faceFile->data))->sprites[emotionId].pal[paletteIndex]);
}
DisplayMonPortraitSpriteFlipped(1, gfx, 14);

View File

@ -65,7 +65,7 @@ bool8 CreateHelperPelipperMenu(s16 speciesID)
sPostOfficeHelper->monPortrait.pos.y = 8;
if (sPostOfficeHelper->monPortrait.faceFile != NULL)
sPostOfficeHelper->monPortrait.faceData = (void *) sPostOfficeHelper->monPortrait.faceFile->data;
sPostOfficeHelper->monPortrait.faceData = (struct PortraitGfx *) sPostOfficeHelper->monPortrait.faceFile->data;
}
sPostOfficeHelper->currMenuChoice = 0;

View File

@ -26,7 +26,7 @@ void PrepareSavePakWrite(s16 pokemonID)
if (pokemonID != MONSTER_NONE) {
file = GetDialogueSpriteDataPtr(pokemonID);
sSavePakWrite->monPortrait.faceFile = file;
sSavePakWrite->monPortrait.faceData = (void *) file->data;
sSavePakWrite->monPortrait.faceData = (struct PortraitGfx *) file->data;
sSavePakWrite->monPortrait.spriteId = 0;
sSavePakWrite->monPortrait.flip = FALSE;
sSavePakWrite->monPortrait.unkE = 0;

View File

@ -249,7 +249,7 @@ u32 CreateThankYouMailPelipper(void)
faceFile = GetDialogueSpriteDataPtr(MONSTER_PELIPPER);
sUnknown_203B2C4->monPortrait.faceFile = faceFile;
sUnknown_203B2C4->monPortrait.faceData = (void *) faceFile->data;
sUnknown_203B2C4->monPortrait.faceData = (struct PortraitGfx *) faceFile->data;
sUnknown_203B2C4->monPortrait.spriteId = 0;
sUnknown_203B2C4->monPortrait.flip = FALSE;
sUnknown_203B2C4->monPortrait.unkE = 0;

View File

@ -51,8 +51,8 @@ void sub_807E5E4(u8 weather)
gDungeon->weather.waterSportTurns = 0;
for(index = 0; index < 0x100; index++)
{
gDungeon->unk17C[index].unk0 = index;
gDungeon->unk17C[index].unk1 = index;
gDungeon->unk17C[index].unk2 = index;
gDungeon->colorRamp[index].r = index;
gDungeon->colorRamp[index].g = index;
gDungeon->colorRamp[index].b = index;
}
}

View File

@ -75,7 +75,7 @@ bool8 CreateWigglytuffShop(u32 mode)
file = GetDialogueSpriteDataPtr(MONSTER_WIGGLYTUFF);
sWigglytuffShop3Work->monPortrait.faceFile = file;
sWigglytuffShop3Work->monPortrait.faceData = (void *) file->data;
sWigglytuffShop3Work->monPortrait.faceData = (struct PortraitGfx *) file->data;
sWigglytuffShop3Work->monPortrait.spriteId = 0;
sWigglytuffShop3Work->monPortrait.flip = FALSE;
sWigglytuffShop3Work->monPortrait.unkE = 0;

View File

@ -200,7 +200,7 @@ u32 sub_8027F88(void)
strcpy(gFormatBuffer_Monsters[0], monName);
faceFile = GetDialogueSpriteDataPtr(MONSTER_PELIPPER);
sUnknown_203B2C0->monPortrait.faceFile = faceFile;
sUnknown_203B2C0->monPortrait.faceData = (void *) faceFile->data;
sUnknown_203B2C0->monPortrait.faceData = (struct PortraitGfx *) faceFile->data;
sUnknown_203B2C0->monPortrait.spriteId = 0;
sUnknown_203B2C0->monPortrait.flip = FALSE;
sUnknown_203B2C0->monPortrait.unkE = 0;

View File

@ -86,7 +86,7 @@ s32 sub_802B2D4(void)
CopyYellowMonsterNametoBuffer(gSpeakerNameBuffer, MONSTER_PELIPPER);
faceFile = GetDialogueSpriteDataPtr(MONSTER_PELIPPER);
sUnknown_203B2C8->monPortrait.faceFile = faceFile;
sUnknown_203B2C8->monPortrait.faceData = (void *) faceFile->data;
sUnknown_203B2C8->monPortrait.faceData = (struct PortraitGfx *) faceFile->data;
sUnknown_203B2C8->monPortrait.spriteId = 0;
sUnknown_203B2C8->monPortrait.flip = FALSE;
sUnknown_203B2C8->monPortrait.unkE = 0;

View File

@ -110,7 +110,7 @@ bool8 sub_8030F58(u32 wonderMailType)
gUnknown_203B328->wonderMailType = wonderMailType;
file = GetDialogueSpriteDataPtr(MONSTER_PELIPPER);
gUnknown_203B328->monPortrait.faceFile = file;
gUnknown_203B328->monPortrait.faceData = (void *) file->data;
gUnknown_203B328->monPortrait.faceData = (struct PortraitGfx *) file->data;
gUnknown_203B328->monPortrait.spriteId = 0;
gUnknown_203B328->monPortrait.flip = FALSE;
gUnknown_203B328->monPortrait.unkE = 0;

View File

@ -1,7 +1,7 @@
.include "src/m4a.o"
gUnknown_2000A80: /* 2000A80 (GameLoop) */
gTitleBrightness: /* 2000A80 (GameLoop) */
.space 0x8
gScriptVarBuffer: /* 2000A88 (ThoroughlyResetScriptVars - RestoreGlobalScriptVars) */
@ -221,7 +221,7 @@ gUnknown_202EDB8: /* 202EDB8 (sub_803E250) */
.space 0x8
gUnknown_202EDC0: /* 202EDC0 (sub_803E250 - sub_80462AC) */
.space 0x8
gUnknown_202EDC8: /* 202EDC8 (sub_803E250 - sub_8086794) */
gDungeonBrightness: /* 202EDC8 (sub_803E250 - sub_8086794) */
.space 0x4
gUnknown_202EDCC: /* 202EDCC (sub_803E490 - sub_807D148) */
.space 0x4