First round of fixes

This commit is contained in:
Phlosioneer 2019-04-07 18:31:01 -04:00
parent d352999cd8
commit 8de9c2d912
6 changed files with 45 additions and 56 deletions

View File

@ -1132,7 +1132,7 @@ static void sub_80B0318(u8 taskId)
data[0] = 1;
break;
case 1:
sub_8199DF0(0, 17, 0, 1);
sub_8199DF0(0, PIXEL_FILL(1), 0, 1);
sub_80B028C(data[1]);
sub_80B003C(data[2], data[3], 1, 160, 1, 2);
data[0] = 2;
@ -1179,7 +1179,7 @@ static void sub_80B0318(u8 taskId)
if (sub_80B02C8(data[5]) == TRUE)
{
data[0] = 5;
sub_8199DF0(0, 0, 0, 1);
sub_8199DF0(0, PIXEL_FILL(0), 0, 1);
}
}
break;

View File

@ -278,7 +278,6 @@ u32 (*const PokenavMenuCallbacks[15][7])(void) =
},
};
EWRAM_DATA u8 gNextLoopedTaskId = 0;
EWRAM_DATA struct PokenavResources *gPokenavResources = NULL;

View File

@ -71,7 +71,7 @@ void ShowLeftHeaderSubmenuSprites(u32 arg0, bool32 arg1);
void MoveLeftHeader(struct Sprite *sprite, s32 arg1, s32 arg2, s32 arg3);
void SpriteCB_MoveLeftHeader(struct Sprite *sprite);
void InitPokenavMainMenuResources(void);
void InitHoenMapHeaderSprites(void);
void InitHoennMapHeaderSprites(void);
void sub_81C7B74(void);
void CopyPaletteIntoBufferUnfaded(const u16 *palette, u32 a1, u32 a2);
u32 LoopedTask_ScrollMenuHeaderDown(s32 a0);
@ -121,7 +121,7 @@ const struct WindowTemplate gUnknown_0861FA08[2] =
},
};
const u8 *const (sMenuButtonReminders[12]) =
const u8 *const sMenuButtonReminders[12] =
{
gText_Pokenav_ClearButtonList,
gText_PokenavMap_ZoomedOutButtons,
@ -137,9 +137,9 @@ const u8 *const (sMenuButtonReminders[12]) =
gText_PokenavRibbons_RibbonCheckButtons,
};
const u8 gMenuButtonReminderColor[4] =
const u8 gMenuButtonReminderColor[3] =
{
4, 1, 2, 0
4, 1, 2
};
static const struct CompressedSpriteSheet gSpinningPokenavSpriteSheet[] =
@ -151,7 +151,7 @@ static const struct CompressedSpriteSheet gSpinningPokenavSpriteSheet[] =
}
};
static const struct SpritePalette gSpinningPokenavPalette[] =
static const struct SpritePalette gSpinningNavgearPalettes[] =
{
{
.data = gSpinningPokenavPaletteData,
@ -160,7 +160,7 @@ static const struct SpritePalette gSpinningPokenavPalette[] =
{}
};
static const struct CompressedSpriteSheet sPokenavHoenMapLeftHeaderSpriteSheet =
static const struct CompressedSpriteSheet sPokenavHoennMapLeftHeaderSpriteSheet =
{
.data = gPokenavLeftHeaderHoennMap_Gfx,
.size = 0xC00,
@ -236,18 +236,15 @@ static const struct CompressedSpriteSheetNoSize sPokenavSubMenuLeftHeaderSpriteS
static const struct OamData sSpinningPokenavSpriteOam =
{
.y = 0,
.affineMode = 0,
.objMode = 0,
.mosaic = 0,
.bpp = 0,
.shape = 0, // FIXME: Use SPRITE_SHAPE
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_NORMAL,
.bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(32x32),
.x = 0,
.matrixNum = 0,
.size = 2, // FIXME: Use SPRITE_SIZE
.size = SPRITE_SIZE(32x32),
.tileNum = 0,
.priority = 0,
.paletteNum = 0,
.affineParam = 0
};
static const union AnimCmd sSpinningPokenavAnims[] =
@ -279,45 +276,40 @@ static const struct SpriteTemplate sSpinningPokenavSpriteTemplate =
.callback = SpriteCB_SpinningPokenav
};
static const struct OamData sPokenavLeftHeaderHoenMapSpriteOam =
static const struct OamData sPokenavLeftHeaderHoennMapSpriteOam =
{
.y = 0,
.affineMode = 0,
.objMode = 0,
.mosaic = 0,
.bpp = 0,
.shape = 1,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_NORMAL,
.bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(64x32),
.x = 0,
.matrixNum = 0,
.size = 3,
.size = SPRITE_SIZE(64x32),
.tileNum = 0,
.priority = 1,
.paletteNum = 0,
.affineParam = 0
};
static const struct OamData sUnknown_0861FB24 =
{
.y = 0,
.affineMode = 0,
.objMode = 0,
.mosaic = 0,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_NORMAL,
.bpp = 0,
.shape = 1,
.shape = SPRITE_SHAPE(32x16),
.x = 0,
.matrixNum = 0,
.size = 2,
.size = SPRITE_SIZE(32x16),
.tileNum = 0,
.priority = 1,
.paletteNum = 0,
.affineParam = 0
};
static const struct SpriteTemplate sPokenavLeftHeaderHoenMapSpriteTemplate =
static const struct SpriteTemplate sPokenavLeftHeaderHoennMapSpriteTemplate =
{
.tileTag = 2,
.paletteTag = 1,
.oam = &sPokenavLeftHeaderHoenMapSpriteOam,
.oam = &sPokenavLeftHeaderHoennMapSpriteOam,
.anims = gDummySpriteAnimTable,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
@ -408,7 +400,7 @@ u32 LoopedTask_InitPokenavMenu(s32 a0)
return LT_PAUSE;
InitPokenavMainMenuResources();
InitHoenMapHeaderSprites();
InitHoennMapHeaderSprites();
ShowBg(0);
return LT_FINISH;
default:
@ -730,7 +722,7 @@ void InitPokenavMainMenuResources(void)
for (i = 0; i < ARRAY_COUNT(gSpinningPokenavSpriteSheet); i++)
LoadCompressedSpriteSheet(&gSpinningPokenavSpriteSheet[i]);
Pokenav_AllocAndLoadPalettes(gSpinningPokenavPalette);
Pokenav_AllocAndLoadPalettes(gSpinningNavgearPalettes);
structPtr->unk14 = ~1 & ~(0x10000 << IndexOfSpritePaletteTag(0));
spriteId = CreateSprite(&sSpinningPokenavSpriteTemplate, 220, 12, 0);
structPtr->spinningPokenav = &gSprites[spriteId];
@ -771,17 +763,17 @@ void ResumeSpinningPokenavSprite(void)
structPtr->spinningPokenav->subpriority = 0;
}
void InitHoenMapHeaderSprites(void)
void InitHoennMapHeaderSprites(void)
{
s32 i, spriteId;
struct PokenavMainMenuResources *structPtr = GetSubstructPtr(0);
LoadCompressedSpriteSheet(&sPokenavHoenMapLeftHeaderSpriteSheet);
LoadCompressedSpriteSheet(&sPokenavHoennMapLeftHeaderSpriteSheet);
AllocSpritePalette(1);
AllocSpritePalette(2);
for (i = 0; i < (s32)ARRAY_COUNT(structPtr->leftHeaderSprites); i++)
{
spriteId = CreateSprite(&sPokenavLeftHeaderHoenMapSpriteTemplate, 0, 0, 1);
spriteId = CreateSprite(&sPokenavLeftHeaderHoennMapSpriteTemplate, 0, 0, 1);
structPtr->leftHeaderSprites[i] = &gSprites[spriteId];
structPtr->leftHeaderSprites[i]->invisible = TRUE;
structPtr->leftHeaderSprites[i]->pos2.x = i * 64;

View File

@ -422,7 +422,7 @@ static const match_call_text_data_t sMayTextScripts[] = {
{ NULL, 0xFFFF, 0xFFFF }
};
static const struct MatchCallStruct4 sMayMatchCallHeader =
static const struct MatchCallStruct4 sBrendanMatchCallHeader =
{
.type = 4,
.gender = MALE,
@ -451,7 +451,7 @@ static const match_call_text_data_t sBrendanTextScripts[] = {
{ NULL, 0xFFFF, 0xFFFF }
};
static const struct MatchCallStruct4 sBrendanMatchCallHeader =
static const struct MatchCallStruct4 sMayMatchCallHeader =
{
.type = 4,
.gender = FEMALE,
@ -728,8 +728,8 @@ static const struct MatchCallStruct5 sWallaceMatchCallHeader =
static const match_call_t sMatchCallHeaders[] = {
{.type0 = &sMrStoneMatchCallHeader},
{.type3 = &sProfBirchMatchCallHeader},
{.type4 = &sBrendanMatchCallHeader},
{.type4 = &sMayMatchCallHeader},
{.type4 = &sBrendanMatchCallHeader},
{.type2 = &sWallyMatchCallHeader},
{.type5 = &sNormanMatchCallHeader},
{.type0 = &sMomMatchCallHeader},

View File

@ -136,7 +136,7 @@ static const u8 sUnknown_0861FBF7[] =
2, 4, 6, 7, 0
};
static const struct CompressedSpriteSheet sMatchcallArrowSpriteSheet[] =
static const struct CompressedSpriteSheet sMatchcallArrowSpriteSheets[] =
{
{
.data = sMatchcallArrowSpriteSheetData,
@ -145,7 +145,7 @@ static const struct CompressedSpriteSheet sMatchcallArrowSpriteSheet[] =
}
};
static const struct SpritePalette sMatchcallArrowPalette[] =
static const struct SpritePalette sMatchcallArrowPalettes[] =
{
{
.data = sMatchcallArrowPaletteData,
@ -160,9 +160,9 @@ static const struct OamData sMatchCallRightArrowSpriteOam =
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_NORMAL,
.bpp = ST_OAM_4BPP,
.shape = 2, //SPRITE_SHAPE(16x8),
.shape = SPRITE_SHAPE(8x16),
.x = 0,
.size = 0, //SPRITE_SIZE(16x8),
.size = SPRITE_SIZE(8x16),
.tileNum = 0,
.priority = 2,
.paletteNum = 0
@ -185,9 +185,9 @@ static const struct OamData sMatchCallUpDownArrowSpriteOam =
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_NORMAL,
.bpp = ST_OAM_4BPP,
.shape = 1, //SPRITE_SHAPE(8x16),
.shape = SPRITE_SHAPE(16x8),
.x = 0,
.size = 0, //SPRITE_SIZE(8x16),
.size = SPRITE_SIZE(16x8),
.tileNum = 0,
.priority = 2,
.paletteNum = 0
@ -282,10 +282,8 @@ u32 LoopedTask_sub_81C8254(s32 a0)
void sub_81C82E4(struct UnknownSubStruct_81C81D4 *a0)
{
u16 v1 = (a0->unk0.unk0.unk1 << 12) | a0->unk0.unk0.unk6;
// TODO: When #553 is merged, use a PALETTE_NUM_TO_FILL_VALUE(1) macro here...
sub_8199DF0(a0->unk0.unk0.bg, 0x11, a0->unk0.unk0.unk6, 1);
// ...and PALETTE_NUM_TO_FILL_VALUE(4) here.
sub_8199DF0(a0->unk0.unk0.bg, 0x44, a0->unk0.unk0.unk6 + 1, 1);
sub_8199DF0(a0->unk0.unk0.bg, PIXEL_FILL(1), a0->unk0.unk0.unk6, 1);
sub_8199DF0(a0->unk0.unk0.bg, PIXEL_FILL(4), a0->unk0.unk0.unk6 + 1, 1);
SetBgTilemapBuffer(a0->unk0.unk0.bg, a0->tilemapBuffer);
FillBgTilemapBufferRect_Palette0(a0->unk0.unk0.bg, v1, 0, 0, 32, 32);
ChangeBgY(a0->unk0.unk0.bg, 0, 0);
@ -1086,11 +1084,11 @@ void sub_81C8ED0(void)
u32 i;
const struct CompressedSpriteSheet *ptr;
for (i = 0, ptr = sMatchcallArrowSpriteSheet; i < ARRAY_COUNT(sMatchcallArrowSpriteSheet); ptr++, i++)
for (i = 0, ptr = sMatchcallArrowSpriteSheets; i < ARRAY_COUNT(sMatchcallArrowSpriteSheets); ptr++, i++)
{
LoadCompressedSpriteSheet(ptr);
}
Pokenav_AllocAndLoadPalettes(sMatchcallArrowPalette);
Pokenav_AllocAndLoadPalettes(sMatchcallArrowPalettes);
}
void sub_81C8EF8(struct MatchCallWindowState *a0, struct UnknownInnerStruct_81C81D4 *a1)

View File

@ -168,8 +168,8 @@ gUnknown_02022D00: @ 2022D00
.include "src/pokemon_summary_screen.o"
.include "src/unk_pokedex_area_screen_helper.o"
.include "src/battle_pyramid_bag.o"
.include "src/pokenav.o"
.include "src/pokenav_match_call_ui.o"
.include "src/pokenav.o"
.include "src/pokenav_match_call_ui.o"
.include "src/menu_specialized.o"
.include "src/faraway_island.o"
.include "src/trainer_hill.o"