Skip to content

Commit

Permalink
Rgb32 back to RGB
Browse files Browse the repository at this point in the history
  • Loading branch information
mateon1 committed Nov 1, 2024
1 parent 021809d commit d950923
Show file tree
Hide file tree
Showing 19 changed files with 53 additions and 53 deletions.
8 changes: 4 additions & 4 deletions include/bg_palette_buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
#include "structs/rgb.h"

void InitBGPaletteBuffer(void);
void nullsub_4(s32 index, const Rgb32 *color, s32 brightness, const Rgb32 *ramp);
void nullsub_5(s32 index, const Rgb32 *color);
void SetBGPaletteBufferColorArray(s32 index, const Rgb32 *color);
void SetBGPaletteBufferColorRGB(s32 index, const Rgb32 *color, s32 brightness, const Rgb32 *ramp);
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
12 changes: 6 additions & 6 deletions include/code_8004AA0.h
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand All @@ -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, const Rgb32 *);
bool8 sub_8004AF0(bool8, unkStruct_202EE8C *, s32, s32, s32, const RGB *);
bool8 sub_8004D14(unkStruct_202EE8C *, s32);
bool8 sub_8004D40(unkStruct_202EE8C *, s32);

Expand Down
6 changes: 3 additions & 3 deletions include/code_800558C.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ struct axMapSprite
{
axmain axmain;
const u32 *tiles;
const Rgb32 *pal;
const RGB *pal;
s32 tileCount;
};

Expand All @@ -23,8 +23,8 @@ void nullsub_10(bool8);
void nullsub_12(void);
void nullsub_13(void);
void nullsub_14(void);
void sub_8005610(OpenedFile *, s32, s32, const Rgb32 *);
void sub_8005770(s32, const Rgb32 *color, s32, const Rgb32 *ramp);
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);
Expand Down
2 changes: 1 addition & 1 deletion include/code_8009804.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion include/code_801D014.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ struct unk_203B250
struct TeamBadgeData
{
/* 0x0 */ u8 *pics; // probably a pointer to an arrays of pixels?
/* 0x4 */ Rgb32 *palette; // Pics share common palette
/* 0x4 */ RGB *palette; // Pics share common palette
};

bool8 sub_801D014(PokemonStruct1 *);
Expand Down
2 changes: 1 addition & 1 deletion include/string_format.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ void sub_80155F0(void);

struct PortraitGfxSub
{
const Rgb32 *pal;
const RGB *pal;
const u8 *gfx;
};

Expand Down
6 changes: 3 additions & 3 deletions include/structs/rgb.h
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion include/structs/str_dungeon.h
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ typedef struct Dungeon
Entity *unkBC;
u8 fillC0[0x134 - 0xC0];
struct unkStruct_Dungeon134_sub unk134;
Rgb32 colorRamp[0x100];
RGB colorRamp[0x100];
/* 0x57C */ u8 fill57C[0x5C0 - 0x57c];
/* 0x5C0 */ s32 unk5C0;
/* 0x5C4 */ struct unkStruct_Dungeon5C4_sub unk5C4[3];
Expand Down
8 changes: 4 additions & 4 deletions src/bg_palette_buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ void InitBGPaletteBuffer(void)
}
}

void SetBGPaletteBufferColorRGB(s32 index, const Rgb32 *color, s32 brightnessRaw, const Rgb32 *ramp)
void SetBGPaletteBufferColorRGB(s32 index, const RGB *color, s32 brightnessRaw, const RGB *ramp)
{
s32 brightness = brightnessRaw;

Expand All @@ -44,7 +44,7 @@ void SetBGPaletteBufferColorRGB(s32 index, const Rgb32 *color, s32 brightnessRaw
ramp[color->b].b * brightness / 256 & 0x1F);
}

void SetBGPaletteBufferColorArray(s32 index, const Rgb32 *color32)
void SetBGPaletteBufferColorArray(s32 index, const RGB *color32)
{
sBGPaletteRowDirty[index / BG_PALETTE_ROW_SIZE] = TRUE;
sBGPaletteBuffer[index] = RGB2(color32->r >> 3, color32->g >> 3, color32->b >> 3);
Expand All @@ -56,11 +56,11 @@ void SetBGPaletteBufferColor(s32 index, u16 *color)
sBGPaletteBuffer[index] = *color;
}

void nullsub_4(s32 index, const Rgb32 *colorArray, s32 brightness, const Rgb32 *ramp)
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)
{
}

Expand Down
4 changes: 2 additions & 2 deletions src/code_2.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ void GameLoop(void)
s32 i;
gTitleBrightness++;
for (i = 0; i < 240; i++)
SetBGPaletteBufferColorRGB(i, &((Rgb32*)gTitlePaletteFile->data)[i], gTitleBrightness, NULL);
SetBGPaletteBufferColorRGB(i, &((RGB*)gTitlePaletteFile->data)[i], gTitleBrightness, NULL);
xxx_update_stuff(0);
}
if (tmp3) {
Expand Down Expand Up @@ -149,7 +149,7 @@ void GameLoop(void)
s32 i;
gTitleBrightness--;
for (i = 0; i < 240; i++)
SetBGPaletteBufferColorRGB(i, &((Rgb32*)gTitlePaletteFile->data)[i], gTitleBrightness, NULL);
SetBGPaletteBufferColorRGB(i, &((RGB*)gTitlePaletteFile->data)[i], gTitleBrightness, NULL);
xxx_update_stuff(0);
}
CloseFile(gTitlePaletteFile);
Expand Down
8 changes: 4 additions & 4 deletions src/code_8004AA0.c
Original file line number Diff line number Diff line change
Expand Up @@ -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, const Rgb32 *a5)
bool8 sub_8004AF0(bool8 a0, unkStruct_202EE8C *a1, s32 a2, s32 a3, s32 a4, const RGB *a5)
{
bool8 bVar3;
bool8 ret;
Expand Down Expand Up @@ -63,7 +63,7 @@ bool8 sub_8004AF0(bool8 a0, unkStruct_202EE8C *a1, s32 a2, s32 a3, s32 a4, const
return ret;
}

UNUSED static bool8 sub_8004B78(bool8 a0, unkStruct_202EE8C *a1, s32 a2, s32 a3, s32 a4, const Rgb32 *a5)
UNUSED static bool8 sub_8004B78(bool8 a0, unkStruct_202EE8C *a1, s32 a2, s32 a3, s32 a4, const RGB *a5)
{
bool8 bVar3;
bool8 ret;
Expand Down Expand Up @@ -95,14 +95,14 @@ UNUSED static bool8 sub_8004B78(bool8 a0, unkStruct_202EE8C *a1, s32 a2, s32 a3,
return ret;
}

bool8 sub_8004C00(unkStruct_202EE8C *a0, s32 a1, s32 a2, s32 brightness, const Rgb32 *ramp, s16 *a5)
bool8 sub_8004C00(unkStruct_202EE8C *a0, s32 a1, s32 a2, s32 brightness, const RGB *ramp, s16 *a5)
{
bool8 ret;
s32 i;
s32 r;
s32 g;
s32 b;
Rgb32 color;
RGB color;

ret = FALSE;

Expand Down
18 changes: 9 additions & 9 deletions src/code_800558C.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 axMapSprite *, s32, s32, const Rgb32 *);
const Rgb32 *sub_8005674(struct axMapSprite *, 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)
{
Expand All @@ -56,12 +56,12 @@ void DoAxFrame_800558C(struct axObject *a0, s32 spriteX, s32 spriteY, u32 a3, u3
a0->axdata.flags &= 0xF7FF;
}

void sub_8005610(OpenedFile *a0, s32 vramIdx, s32 brightness, const Rgb32 *ramp)
void sub_8005610(OpenedFile *a0, s32 vramIdx, s32 brightness, const RGB *ramp)
{
sub_800561C((struct axMapSprite *)a0->data, vramIdx, brightness, ramp);
}

static void sub_800561C(struct axMapSprite *a0, s32 vramIdx, s32 brightness, const Rgb32 *ramp)
static void sub_800561C(struct axMapSprite *a0, s32 vramIdx, s32 brightness, const RGB *ramp)
{
s32 i;

Expand All @@ -74,12 +74,12 @@ static void sub_800561C(struct axMapSprite *a0, s32 vramIdx, s32 brightness, con
}
}

UNUSED static const Rgb32 *sub_8005668(OpenedFile *a0, s32 vramIdx)
UNUSED static const RGB *sub_8005668(OpenedFile *a0, s32 vramIdx)
{
return sub_8005674((struct axMapSprite *)a0->data, vramIdx);
}

const Rgb32 *sub_8005674(struct axMapSprite *a0, s32 vramIdx)
const RGB *sub_8005674(struct axMapSprite *a0, s32 vramIdx)
{
if (a0->tiles != NULL)
CpuCopy(OBJ_VRAM0 + vramIdx * 0x20, a0->tiles, a0->tileCount * 0x20);
Expand Down Expand Up @@ -149,12 +149,12 @@ void sub_8005700(Position *a0, struct axObject *a1)
}
}

UNUSED static void sub_8005764(s32 a0, OpenedFile *file, s32 a2, const Rgb32 *a3)
UNUSED static void sub_8005764(s32 a0, OpenedFile *file, s32 a2, const RGB *a3)
{
sub_8005770(a0, (const Rgb32*)file->data, a2, a3);
sub_8005770(a0, (const RGB*)file->data, a2, a3);
}

void sub_8005770(s32 param_1, const Rgb32 *color, s32 brightness, const Rgb32 *ramp)
void sub_8005770(s32 param_1, const RGB *color, s32 brightness, const RGB *ramp)
{
s32 i;

Expand Down
4 changes: 2 additions & 2 deletions src/code_8009804.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/code_801D014.c
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ static void LoadTeamRankBadge(u32 a0, u32 a1, u32 a2)
OpenedFile *teamBadgeFile;
s32 paletteIndex;
u8 rank;
Rgb32 *colorArray;
RGB *colorArray;
u8 *teamBadgePic;

teamBadgeFile = OpenFileAndGetFileDataPtr(sTeamRankBadgeFileName, &gTitleMenuFileArchive);
Expand Down
4 changes: 2 additions & 2 deletions src/code_803D110.c
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ struct DungeonNameFontFileData

struct DungeonNamePaletteFileData
{
Rgb32 pal[16];
RGB pal[16];
};

void ShowDungeonNameBanner(void)
Expand Down Expand Up @@ -1050,7 +1050,7 @@ NAKED void sub_803E02C(void)
void sub_803E13C(void)
{
s32 i;
Rgb32 *pal;
RGB *pal;

SetWindowBGColor();
if (gGameOptionsRef->playerGender != 0)
Expand Down
12 changes: 6 additions & 6 deletions src/code_803E724.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ struct DungeonPalFile
extern struct DungeonPalFile *gDungeonPaletteFile;
extern struct DungeonPalFile *gDungeonNameBannerPalette;
extern struct DungeonPalFile *gUnknown_202EC94;
extern Rgb32 gUnknown_202ECA4[];
extern Rgb32 gUnknown_202D058;
extern RGB gUnknown_202ECA4[];
extern RGB gUnknown_202D058;
extern u8 gUnknown_203B40C;
extern MenuInputStruct gUnknown_202EE10;
extern SpriteOAM gUnknown_202EDDC;

extern const Rgb32 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[];
Expand Down Expand Up @@ -85,7 +85,7 @@ void sub_803FF18(s32 a0, u16 *a1, bool8 a2);
void sub_803E874(bool8 r10, s32 r9)
{
s32 i, index, count;
const Rgb32 *color;
const RGB *color;

color = gDungeonPaletteFile->unk4;
SetBGPaletteBufferColorRGB(0, &gUnknown_80F62AC, gUnknown_202EDC8, gDungeon->colorRamp);
Expand Down Expand Up @@ -138,7 +138,7 @@ void sub_803E874(bool8 r10, s32 r9)
void BgColorCallNullsub4(void)
{
s32 i, index, count;
const Rgb32 *color;
const RGB *color;

color = ((struct DungeonPalFile*) gDungeon->paletFile)->unk4;
index = 256;
Expand All @@ -153,7 +153,7 @@ void BgColorCallNullsub4(void)
void sub_803EA10(void)
{
s32 i, index, count;
const Rgb32 *color;
const RGB *color;

color= gDungeonPaletteFile->unk4;
SetBGPaletteBufferColorRGB(0, &gUnknown_80F62AC, gUnknown_202EDC8, gDungeon->colorRamp);
Expand Down
2 changes: 1 addition & 1 deletion src/code_8042B34.c
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ void xxx_dungeon_8042F6C(struct UnkStruct_xxx_dungeon_8042F6C *r8)
bool8 r9;
bool8 r10;
u8 sp;
Rgb32 colorArray;
RGB colorArray;

gUnknown_203B40C = 0;
r6 = r8->unk8;
Expand Down
2 changes: 1 addition & 1 deletion src/game_options.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/load_screen.c
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ void DrawLoadScreenText(void)
struct ClmkFileData
{
/* 0x0 */ u32 *pics;
/* 0x4 */ Rgb32 *palette;
/* 0x4 */ RGB *palette;
};

void sub_80397B4(void)
Expand Down

0 comments on commit d950923

Please sign in to comment.