Write palette IDs in hex

This commit is contained in:
Martin Griffin
2022-08-19 15:29:35 +01:00
parent cce9918908
commit 6fed961ed6
129 changed files with 1262 additions and 1240 deletions
+23 -23
View File
@@ -789,7 +789,7 @@ static const struct WindowTemplate sWindowTemplates[] =
.tilemapTop = 15,
.width = 27,
.height = 4,
.paletteNum = 15,
.paletteNum = 0xF,
.baseBlock = 0x194
},
DUMMY_WIN_TEMPLATE
@@ -802,7 +802,7 @@ static const struct WindowTemplate sWindowTemplate_InfoBox =
.tilemapTop = 3,
.width = 20,
.height = 13,
.paletteNum = 13,
.paletteNum = 0xD,
.baseBlock = 1
};
@@ -1247,8 +1247,8 @@ static void SlotMachineSetup_LoadGfxAndTilemaps(void)
LoadMenuGfx();
LoadMenuAndReelOverlayTilemaps();
LoadSlotMachineGfx();
LoadMessageBoxGfx(0, 0x200, 0xF0);
LoadUserWindowBorderGfx(0, 0x214, 0xE0);
LoadMessageBoxGfx(0, 0x200, BG_PLTT_ID(0xF));
LoadUserWindowBorderGfx(0, 0x214, BG_PLTT_ID(0xE));
PutWindowTilemap(0);
}
@@ -3211,12 +3211,12 @@ static void StopReelButton_Unpress(struct Task *task, u8 taskId)
static void LightenMatchLine(u8 matchLineId)
{
LoadPalette(sLitMatchLinePalTable[matchLineId], sMatchLinePalOffsets[matchLineId], 2);
LoadPalette(sLitMatchLinePalTable[matchLineId], sMatchLinePalOffsets[matchLineId], PLTT_SIZEOF(1));
}
static void DarkenMatchLine(u8 matchLineId)
{
LoadPalette(sDarkMatchLinePalTable[matchLineId], sMatchLinePalOffsets[matchLineId], 2);
LoadPalette(sDarkMatchLinePalTable[matchLineId], sMatchLinePalOffsets[matchLineId], PLTT_SIZEOF(1));
}
// light up the match line for each bet by the player
@@ -3360,7 +3360,7 @@ static bool8 TryStopSlotMachineLights(void)
if (gTasks[taskId].sFlashState == 0)
{
DestroyTask(taskId);
LoadPalette(sSlotMachineMenu_Pal, 0x10, 0x20);
LoadPalette(sSlotMachineMenu_Pal, BG_PLTT_ID(0x1), PLTT_SIZE_4BPP);
return TRUE;
}
return FALSE;
@@ -3376,7 +3376,7 @@ static void Task_FlashSlotMachineLights(u8 taskId)
if (task->sFlashState == 0 || task->sFlashState == 2)
task->sFlashDir = -task->sFlashDir;
}
LoadPalette(sFlashingLightsPalTable[task->sFlashState], 0x10, 0x20);
LoadPalette(sFlashingLightsPalTable[task->sFlashState], BG_PLTT_ID(0x1), PLTT_SIZE_4BPP);
}
#undef sDelayTimer
@@ -4857,7 +4857,7 @@ static void SpriteCB_DigitalDisplay_PokeballShining(struct Sprite *sprite)
{
if (sprite->sCounter < 3)
{
LoadPalette(sPokeballShiningPalTable[sprite->sCounter], (IndexOfSpritePaletteTag(PALTAG_DIG_DISPLAY) << 4) + 0x100, 32);
LoadPalette(sPokeballShiningPalTable[sprite->sCounter], OBJ_PLTT_ID(IndexOfSpritePaletteTag(PALTAG_DIG_DISPLAY)), PLTT_SIZE_4BPP);
if (++sprite->data[2] >= 4)
{
sprite->data[1]++;
@@ -4866,7 +4866,7 @@ static void SpriteCB_DigitalDisplay_PokeballShining(struct Sprite *sprite)
}
else
{
LoadPalette(sPokeballShiningPalTable[sprite->sCounter], (IndexOfSpritePaletteTag(PALTAG_DIG_DISPLAY) << 4) + 0x100, 32);
LoadPalette(sPokeballShiningPalTable[sprite->sCounter], OBJ_PLTT_ID(IndexOfSpritePaletteTag(PALTAG_DIG_DISPLAY)), PLTT_SIZE_4BPP);
if (++sprite->data[2] >= 25)
{
sprite->sCounter = 0;
@@ -4995,7 +4995,7 @@ static void EndDigitalDisplayScene_StopReel(void)
static void EndDigitalDisplayScene_Win(void)
{
LoadPalette(sDigitalDisplay_Pal, (IndexOfSpritePaletteTag(PALTAG_DIG_DISPLAY) << 4) + 0x100, 0x20);
LoadPalette(sDigitalDisplay_Pal, OBJ_PLTT_ID(IndexOfSpritePaletteTag(PALTAG_DIG_DISPLAY)), PLTT_SIZE_4BPP);
}
static void EndDigitalDisplayScene_InsertBet(void)
@@ -5054,8 +5054,8 @@ static void LoadMenuGfx(void)
sMenuGfx = Alloc(0x2200);
LZDecompressWram(gSlotMachineMenu_Gfx, sMenuGfx);
LoadBgTiles(2, sMenuGfx, 0x2200, 0);
LoadPalette(gSlotMachineMenu_Pal, 0, 160);
LoadPalette(sUnkPalette, 208, 32);
LoadPalette(gSlotMachineMenu_Pal, BG_PLTT_ID(0x0), 5 * PLTT_SIZE_4BPP);
LoadPalette(sUnkPalette, BG_PLTT_ID(0xD), PLTT_SIZE_4BPP);
}
static void LoadMenuAndReelOverlayTilemaps(void)
@@ -7728,19 +7728,19 @@ static const u16 *const sLitMatchLinePalTable[NUM_MATCH_LINES] =
static const u16 *const sDarkMatchLinePalTable[NUM_MATCH_LINES] =
{
[MATCH_MIDDLE_ROW] = &gSlotMachineMenu_Pal[74],
[MATCH_TOP_ROW] = &gSlotMachineMenu_Pal[75],
[MATCH_BOTTOM_ROW] = &gSlotMachineMenu_Pal[76],
[MATCH_NWSE_DIAG] = &gSlotMachineMenu_Pal[77],
[MATCH_NESW_DIAG] = &gSlotMachineMenu_Pal[78],
[MATCH_MIDDLE_ROW] = &gSlotMachineMenu_Pal[BG_PLTT_ID(0x4) + 10],
[MATCH_TOP_ROW] = &gSlotMachineMenu_Pal[BG_PLTT_ID(0x4) + 11],
[MATCH_BOTTOM_ROW] = &gSlotMachineMenu_Pal[BG_PLTT_ID(0x4) + 12],
[MATCH_NWSE_DIAG] = &gSlotMachineMenu_Pal[BG_PLTT_ID(0x4) + 13],
[MATCH_NESW_DIAG] = &gSlotMachineMenu_Pal[BG_PLTT_ID(0x4) + 14],
};
static const u8 sMatchLinePalOffsets[NUM_MATCH_LINES] = {
[MATCH_MIDDLE_ROW] = 74,
[MATCH_TOP_ROW] = 75,
[MATCH_BOTTOM_ROW] = 76,
[MATCH_NWSE_DIAG] = 78, // Diag colors flipped for some reason
[MATCH_NESW_DIAG] = 77 // Doesn't matter as both are identical
[MATCH_MIDDLE_ROW] = BG_PLTT_ID(0x4) + 10,
[MATCH_TOP_ROW] = BG_PLTT_ID(0x4) + 11,
[MATCH_BOTTOM_ROW] = BG_PLTT_ID(0x4) + 12,
[MATCH_NWSE_DIAG] = BG_PLTT_ID(0x4) + 14, // Diag colors flipped for some reason
[MATCH_NESW_DIAG] = BG_PLTT_ID(0x4) + 13 // Doesn't matter as both are identical
};
static const u8 sBetToMatchLineIds[MAX_BET][2] =