Document remaining routines in field_specials
This commit is contained in:
@@ -10,6 +10,6 @@
|
||||
// Exported ROM declarations
|
||||
|
||||
void BlendPalette(u16, u16, u8, u16);
|
||||
void sub_8045314(u16 * palbuff, u16 blend_pal, u32 coefficient, s32 size);
|
||||
void BlendPalettesAt(u16 * palbuff, u16 blend_pal, u32 coefficient, s32 size);
|
||||
|
||||
#endif //GUARD_BLEND_PALETTE_H
|
||||
|
||||
@@ -1324,7 +1324,7 @@
|
||||
#define FLAG_SYS_FLASH_ACTIVE (SYS_FLAGS + 0x6)
|
||||
#define FLAG_SYS_SPECIAL_WILD_BATTLE (SYS_FLAGS + 0x7)
|
||||
|
||||
#define FLAG_0x808 (SYS_FLAGS + 0x8)
|
||||
#define FLAG_QL_DEPARTED (SYS_FLAGS + 0x8)
|
||||
#define FLAG_0x809 (SYS_FLAGS + 0x9)
|
||||
#define FLAG_0x80A (SYS_FLAGS + 0xA)
|
||||
#define FLAG_0x80B (SYS_FLAGS + 0xB)
|
||||
|
||||
@@ -8,6 +8,12 @@
|
||||
#define QL_START_NORMAL 1
|
||||
#define QL_START_WARP 2
|
||||
|
||||
// gGlobalFieldTintMode
|
||||
#define QL_TINT_NONE 0
|
||||
#define QL_TINT_GRAYSCALE 1
|
||||
#define QL_TINT_SEPIA 2
|
||||
#define QL_TINT_BACKUP_GRAYSCALE 3
|
||||
|
||||
#define QL_IS_PLAYBACK_STATE (gQuestLogState == QL_STATE_PLAYBACK || gQuestLogState == QL_STATE_PLAYBACK_LAST)
|
||||
|
||||
#define QL_EVENT_0 0 // Null
|
||||
|
||||
@@ -122,7 +122,7 @@
|
||||
#define VAR_EGG_BRAG_STATE 0x404A
|
||||
#define VAR_LINK_WIN_BRAG_STATE 0x404B
|
||||
#define VAR_POKELOT_RND2 0x404C
|
||||
#define VAR_0x404D 0x404D
|
||||
#define VAR_QL_ENTRANCE 0x404D
|
||||
#define VAR_0x404E 0x404E
|
||||
#define VAR_LOTAD_SIZE_RECORD 0x404F
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ void FieldCB_FallWarpExit(void);
|
||||
void StartEscalatorWarp(u8 metatileBehavior, u8 priority);
|
||||
void StartLavaridgeGymB1FWarp(u8 a0);
|
||||
void StartLavaridgeGym1FWarp(u8 a0);
|
||||
void sub_8083598(u8 a0);
|
||||
void ApplyGlobalFieldPaletteTint(u8 paletteIdx);
|
||||
void FreeResourcesAndDestroySprite(struct Sprite * sprite, u8 spriteId);
|
||||
u8 CreateMonSprite_PicBox(u16 species, s16 x, s16 y, bool8 unused);
|
||||
void ReturnToFieldFromFlyMapSelect(void);
|
||||
|
||||
@@ -34,7 +34,7 @@ void IncrementBirthIslandRockStepCount(void);
|
||||
void ResetCyclingRoadChallengeData(void);
|
||||
void ResetFieldTasksArgs(void);
|
||||
bool8 UsedPokemonCenterWarp(void);
|
||||
void sub_80CC534(void);
|
||||
void sub_80CC59C(void);
|
||||
void QuestLog_CheckDepartingIndoorsMap(void);
|
||||
void QuestLog_TryRecordDepartedLocation(void);
|
||||
|
||||
#endif // GUARD_FIELD_SPECIALS_H
|
||||
|
||||
@@ -119,7 +119,7 @@ void sub_80AEDBC(void);
|
||||
|
||||
void DoCurrentWeather(void);
|
||||
void SetSav1WeatherFromCurrMapHeader(void);
|
||||
void sub_807B0C4(u16 *, u16 *, u32);
|
||||
void SlightlyDarkenPalsInWeather(u16 *, u16 *, u32);
|
||||
void PlayRainStoppingSoundEffect(void);
|
||||
bool8 IsWeatherNotFadingIn(void);
|
||||
void SetWeatherScreenFadeOut(void);
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ bool32 CanCameraMoveInDirection(s32);
|
||||
u32 GetBehaviorByMetatileIdAndMapLayout(const struct MapLayout *mapLayout, u16 metatile, u8 attr);
|
||||
const struct MapHeader * mapconnection_get_mapheader(struct MapConnection * connection);
|
||||
struct MapConnection * GetMapConnectionAtPos(s16 x, s16 y);
|
||||
void sub_8059948(u8 a0, u8 a1);
|
||||
void Fieldmap_ApplyGlobalTintToPaletteSlot(u8 slot, u8 count);
|
||||
|
||||
void save_serialize_map(void);
|
||||
u32 GetMetatileAttributeFromRawMetatileBehavior(u32 original, u8 bit);
|
||||
|
||||
+1
-1
@@ -127,7 +127,7 @@ void CleanupOverworldWindowsAndTilemaps(void);
|
||||
u32 ComputeWhiteOutMoneyLoss(void);
|
||||
|
||||
extern u8 gDisableMapMusicChangeOnMapLoad;
|
||||
extern u8 gUnknown_2036E28;
|
||||
extern u8 gGlobalFieldTintMode;
|
||||
|
||||
extern bool8 (* gFieldCallback2)(void);
|
||||
|
||||
|
||||
+3
-3
@@ -39,7 +39,7 @@ void SetQLPlayedTheSlots(void);
|
||||
void QuestLog_RecordEnteredMap(u16);
|
||||
u8 sub_8112CAC(void);
|
||||
bool8 QuestLog_SchedulePlaybackCB(void (*func)(void));
|
||||
void sub_8111F38(u16 offset, u16 idx);
|
||||
void QuestLog_BackUpPalette(u16 offset, u16 size);
|
||||
void CommitQuestLogWindow1(void);
|
||||
void QuestLog_DrawPreviouslyOnQuestHeaderIfInPlaybackMode(void);
|
||||
void ResetQuestLog(void);
|
||||
@@ -77,7 +77,7 @@ bool8 QuestLogScenePlaybackIsEnding(void);
|
||||
void sub_8115798(void);
|
||||
bool8 QuestLog_ShouldEndSceneOnMapChange(void);
|
||||
void QuestLog_AdvancePlayhead_(void);
|
||||
void sub_8111F14(void);
|
||||
void QuestLog_InitPalettesBackup(void);
|
||||
void sub_8110FCC(void);
|
||||
u8 GetQuestLogStartType(void);
|
||||
void sub_81113E4(void);
|
||||
@@ -94,7 +94,7 @@ u16 *sub_8113CC8(u16 *, struct QuestLogEntry *);
|
||||
u16 *sub_8113D08(u16 *, struct QuestLogEntry *);
|
||||
u16 *sub_8113D48(u16 *, struct QuestLogEntry *);
|
||||
u16 *sub_8113D94(u16 *, struct QuestLogEntry *);
|
||||
void sub_811381C(void);
|
||||
void QL_EnableRecordingSteps(void);
|
||||
u16 *QuestLog_SkipCommand(u16 *, u16 **);
|
||||
void sub_8113ABC(const u16 *);
|
||||
u16 *sub_8113C20(u16 *, struct QuestLogEntry *);
|
||||
|
||||
+19
-7
@@ -81,10 +81,11 @@
|
||||
#define CHAR_x 0xEC
|
||||
#define CHAR_y 0xED
|
||||
#define CHAR_z 0xEE
|
||||
#define CHAR_SPECIAL_F7 0xF7
|
||||
#define CHAR_COLON 0xF0
|
||||
|
||||
#define CHAR_DYNAMIC_PLACEHOLDER 0xF7
|
||||
#define CHAR_KEYPAD_ICON 0xF8
|
||||
#define CHAR_EXTRA_EMOJI 0xF9
|
||||
#define CHAR_COLON 0xF0
|
||||
#define CHAR_PROMPT_SCROLL 0xFA // waits for button press and scrolls dialog
|
||||
#define CHAR_PROMPT_CLEAR 0xFB // waits for button press and clears dialog
|
||||
#define EXT_CTRL_CODE_BEGIN 0xFC // extended control code
|
||||
@@ -129,15 +130,26 @@
|
||||
#define EXT_CTRL_CODE_HIGHLIGHT 0x2
|
||||
#define EXT_CTRL_CODE_SHADOW 0x3
|
||||
#define EXT_CTRL_CODE_COLOR_HIGHLIGHT_SHADOW 0x4
|
||||
//
|
||||
#define EXT_CTRL_CODE_UNKNOWN_7 0x7
|
||||
//
|
||||
#define EXT_CTRL_CODE_PALETTE 0x5
|
||||
#define EXT_CTRL_CODE_FONT 0x6
|
||||
#define EXT_CTRL_CODE_RESET_FONT 0x7
|
||||
#define EXT_CTRL_CODE_PAUSE 0x8
|
||||
#define EXT_CTRL_CODE_WAIT_BUTTON 0x9
|
||||
#define EXT_CTRL_CODE_WAIT_SE 0xA
|
||||
#define EXT_CTRL_CODE_PLAY_BGM 0xB
|
||||
#define EXT_CTRL_CODE_ESCAPE 0xC
|
||||
#define EXT_CTRL_CODE_SHIFT_RIGHT 0xD
|
||||
#define EXT_CTRL_CODE_SHIFT_DOWN 0xE
|
||||
#define EXT_CTRL_CODE_FILL_WINDOW 0xF
|
||||
#define EXT_CTRL_CODE_PLAY_SE 0x10
|
||||
#define EXT_CTRL_CODE_CLEAR 0x11
|
||||
//
|
||||
#define EXT_CTRL_CODE_SKIP 0x12
|
||||
#define EXT_CTRL_CODE_CLEAR_TO 0x13
|
||||
#define EXT_CTRL_CODE_MIN_LETTER_SPACING 0x14
|
||||
#define EXT_CTRL_CODE_JPN 0x15
|
||||
#define EXT_CTRL_CODE_ENG 0x16
|
||||
#define EXT_CTRL_CODE_STOP_BGM 0x17
|
||||
#define EXT_CTRL_CODE_RESUME_BGM 0x18
|
||||
|
||||
#define NUM_TEXT_PRINTERS 32
|
||||
|
||||
@@ -305,7 +317,7 @@ void DecompressGlyphFont5(u16 glyphId, bool32 isJapanese);
|
||||
s32 GetGlyphWidthFont5(u16 glyphId, bool32 isJapanese);
|
||||
void sub_80062B0(struct Sprite *sprite);
|
||||
u8 CreateTextCursorSpriteForOakSpeech(u8 sheetId, u16 x, u16 y, u8 priority, u8 subpriority);
|
||||
void sub_8006398(u8 spriteId);
|
||||
void DestroyTextCursorSprite(u8 spriteId);
|
||||
s32 GetGlyphWidthFont6(u16 font_type, bool32 isJapanese);
|
||||
|
||||
#endif // GUARD_TEXT_H
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ void BlendPalette(u16 palOffset, u16 numEntries, u8 coeff, u16 blendColor)
|
||||
}
|
||||
}
|
||||
|
||||
void sub_8045314(u16 * palbuff, u16 blend_pal, u32 coefficient, s32 size)
|
||||
void BlendPalettesAt(u16 * palbuff, u16 blend_pal, u32 coefficient, s32 size)
|
||||
{
|
||||
if (coefficient == 16)
|
||||
{
|
||||
|
||||
+2
-1
@@ -11,6 +11,7 @@
|
||||
#include "trainer_pokemon_sprites.h"
|
||||
#include "menu.h"
|
||||
#include "field_weather.h"
|
||||
#include "quest_log.h"
|
||||
#include "constants/maps.h"
|
||||
#include "constants/field_weather.h"
|
||||
|
||||
@@ -791,7 +792,7 @@ static bool32 DoOverworldMapScrollScene(UNUSED u8 unused)
|
||||
sCreditsMgr->subseqno++;
|
||||
// fallthrough
|
||||
case 1:
|
||||
if (!Overworld_DoScrollSceneForCredits(&sCreditsMgr->ovwldseqno, sOverworldMapScenes[sCreditsMgr->whichMon], 0))
|
||||
if (!Overworld_DoScrollSceneForCredits(&sCreditsMgr->ovwldseqno, sOverworldMapScenes[sCreditsMgr->whichMon], QL_TINT_NONE))
|
||||
return FALSE;
|
||||
CreateCreditsWindow();
|
||||
SetGpuReg(REG_OFFSET_WIN0H, 0xF0);
|
||||
|
||||
@@ -108,7 +108,7 @@ u8 *DynamicPlaceholderTextUtil_ExpandPlaceholders(u8 *dest, const u8 *src)
|
||||
{
|
||||
while (*src != EOS)
|
||||
{
|
||||
if (*src != CHAR_SPECIAL_F7)
|
||||
if (*src != CHAR_DYNAMIC_PLACEHOLDER)
|
||||
{
|
||||
*dest++ = *src++;
|
||||
}
|
||||
|
||||
@@ -2452,7 +2452,7 @@ void PatchObjectPalette(u16 paletteTag, u8 paletteSlot)
|
||||
u8 paletteIndex = FindObjectEventPaletteIndexByTag(paletteTag);
|
||||
|
||||
LoadPalette(sObjectEventSpritePalettes[paletteIndex].data, 16 * paletteSlot + 0x100, 0x20);
|
||||
sub_8083598(paletteSlot);
|
||||
ApplyGlobalFieldPaletteTint(paletteSlot);
|
||||
}
|
||||
|
||||
void PatchObjectPaletteRange(const u16 *paletteTags, u8 minSlot, u8 maxSlot)
|
||||
|
||||
+5
-5
@@ -422,9 +422,9 @@ static void FieldEffectScript_LoadTiles(const u8 **script)
|
||||
*script += sizeof(u32);
|
||||
}
|
||||
|
||||
void sub_8083598(u8 paletteIdx)
|
||||
void ApplyGlobalFieldPaletteTint(u8 paletteIdx)
|
||||
{
|
||||
switch (gUnknown_2036E28)
|
||||
switch (gGlobalFieldTintMode)
|
||||
{
|
||||
case 0:
|
||||
return;
|
||||
@@ -435,7 +435,7 @@ void sub_8083598(u8 paletteIdx)
|
||||
TintPalette_SepiaTone(&gPlttBufferUnfaded[(paletteIdx + 16) * 16], 0x10);
|
||||
break;
|
||||
case 3:
|
||||
sub_8111F38((paletteIdx + 16) * 16, 0x10);
|
||||
QuestLog_BackUpPalette((paletteIdx + 16) * 16, 0x10);
|
||||
TintPalette_GrayScale(&gPlttBufferUnfaded[(paletteIdx + 16) * 16], 0x10);
|
||||
break;
|
||||
default:
|
||||
@@ -450,7 +450,7 @@ static void FieldEffectScript_LoadFadedPal(const u8 **script)
|
||||
u8 idx = IndexOfSpritePaletteTag(spritePalette->tag);
|
||||
LoadSpritePalette(spritePalette);
|
||||
if (idx == 0xFF)
|
||||
sub_8083598(IndexOfSpritePaletteTag(spritePalette->tag));
|
||||
ApplyGlobalFieldPaletteTint(IndexOfSpritePaletteTag(spritePalette->tag));
|
||||
UpdateSpritePaletteWithWeather(IndexOfSpritePaletteTag(spritePalette->tag));
|
||||
*script += sizeof(u32);
|
||||
}
|
||||
@@ -461,7 +461,7 @@ static void FieldEffectScript_LoadPal(const u8 **script)
|
||||
u8 idx = IndexOfSpritePaletteTag(spritePalette->tag);
|
||||
LoadSpritePalette(spritePalette);
|
||||
if (idx != 0xFF)
|
||||
sub_8083598(IndexOfSpritePaletteTag(spritePalette->tag));
|
||||
ApplyGlobalFieldPaletteTint(IndexOfSpritePaletteTag(spritePalette->tag));
|
||||
*script += sizeof(u32);
|
||||
}
|
||||
|
||||
|
||||
+51
-49
@@ -1800,10 +1800,10 @@ void SetUsedPkmnCenterQuestLogEvent(void)
|
||||
}
|
||||
|
||||
static const struct {
|
||||
u16 grp;
|
||||
u16 num;
|
||||
u16 grp2;
|
||||
u16 num2;
|
||||
u16 inside_grp;
|
||||
u16 inside_num;
|
||||
u16 outside_grp;
|
||||
u16 outside_num;
|
||||
} sInsideOutsidePairs[51] = {
|
||||
[QL_LOCATION_HOME] = {MAP(PALLET_TOWN_PLAYERS_HOUSE_1F), MAP(PALLET_TOWN)},
|
||||
[QL_LOCATION_OAKS_LAB] = {MAP(PALLET_TOWN_PROFESSOR_OAKS_LAB), MAP(PALLET_TOWN)},
|
||||
@@ -1858,85 +1858,87 @@ static const struct {
|
||||
[QL_LOCATION_CERULEAN_CAVE] = {MAP(CERULEAN_CAVE_1F), MAP(CERULEAN_CITY)}
|
||||
};
|
||||
|
||||
void sub_80CC534(void)
|
||||
void QuestLog_CheckDepartingIndoorsMap(void)
|
||||
{
|
||||
u8 i;
|
||||
for (i = 0; i < NELEMS(sInsideOutsidePairs); i++)
|
||||
{
|
||||
if (gSaveBlock1Ptr->location.mapGroup == sInsideOutsidePairs[i].grp && gSaveBlock1Ptr->location.mapNum == sInsideOutsidePairs[i].num)
|
||||
if (gSaveBlock1Ptr->location.mapGroup == sInsideOutsidePairs[i].inside_grp && gSaveBlock1Ptr->location.mapNum == sInsideOutsidePairs[i].inside_num)
|
||||
{
|
||||
if (VarGet(VAR_0x404D) != QL_LOCATION_ROCKET_HIDEOUT || i != QL_LOCATION_GAME_CORNER)
|
||||
if (VarGet(VAR_QL_ENTRANCE) != QL_LOCATION_ROCKET_HIDEOUT || i != QL_LOCATION_GAME_CORNER)
|
||||
{
|
||||
VarSet(VAR_0x404D, i);
|
||||
FlagSet(FLAG_0x808);
|
||||
VarSet(VAR_QL_ENTRANCE, i);
|
||||
FlagSet(FLAG_QL_DEPARTED);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_80CC59C(void)
|
||||
struct QuestLogDepartedData {
|
||||
u8 map_section_id;
|
||||
u8 entrance_id;
|
||||
};
|
||||
|
||||
void QuestLog_TryRecordDepartedLocation(void)
|
||||
{
|
||||
s16 x, y;
|
||||
struct {
|
||||
u8 unk0;
|
||||
u8 unk1;
|
||||
} sp0;
|
||||
u16 r5 = VarGet(VAR_0x404D);
|
||||
sp0.unk0 = 0;
|
||||
sp0.unk1 = 0;
|
||||
if (FlagGet(FLAG_0x808))
|
||||
struct QuestLogDepartedData event_buffer;
|
||||
u16 ql_entrance_id = VarGet(VAR_QL_ENTRANCE);
|
||||
event_buffer.map_section_id = 0;
|
||||
event_buffer.entrance_id = 0;
|
||||
if (FlagGet(FLAG_QL_DEPARTED))
|
||||
{
|
||||
if (r5 == QL_LOCATION_VIRIDIAN_FOREST_1)
|
||||
if (ql_entrance_id == QL_LOCATION_VIRIDIAN_FOREST_1)
|
||||
{
|
||||
if (gSaveBlock1Ptr->location.mapGroup == MAP_GROUP(ROUTE2_VIRIDIAN_FOREST_SOUTH_ENTRANCE) && (gSaveBlock1Ptr->location.mapNum == MAP_NUM(ROUTE2_VIRIDIAN_FOREST_SOUTH_ENTRANCE) || gSaveBlock1Ptr->location.mapNum == MAP_NUM(ROUTE2_VIRIDIAN_FOREST_NORTH_ENTRANCE)))
|
||||
{
|
||||
sp0.unk0 = MAPSEC_ROUTE_2;
|
||||
event_buffer.map_section_id = MAPSEC_ROUTE_2;
|
||||
if (gSaveBlock1Ptr->location.mapNum == MAP_NUM(ROUTE2_VIRIDIAN_FOREST_SOUTH_ENTRANCE))
|
||||
sp0.unk1 = r5;
|
||||
event_buffer.entrance_id = ql_entrance_id;
|
||||
else
|
||||
sp0.unk1 = r5 + 1;
|
||||
SetQuestLogEvent(QL_EVENT_DEPARTED, (void *)&sp0);
|
||||
FlagClear(FLAG_0x808);
|
||||
event_buffer.entrance_id = ql_entrance_id + 1;
|
||||
SetQuestLogEvent(QL_EVENT_DEPARTED, (void *)&event_buffer);
|
||||
FlagClear(FLAG_QL_DEPARTED);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (r5 == QL_LOCATION_LEAGUE_GATE_1)
|
||||
else if (ql_entrance_id == QL_LOCATION_LEAGUE_GATE_1)
|
||||
{
|
||||
if (gSaveBlock1Ptr->location.mapGroup == MAP_GROUP(ROUTE22) && (gSaveBlock1Ptr->location.mapNum == MAP_NUM(ROUTE22) || gSaveBlock1Ptr->location.mapNum == MAP_NUM(ROUTE23)))
|
||||
{
|
||||
sp0.unk0 = Overworld_GetMapHeaderByGroupAndId(sInsideOutsidePairs[r5].grp, sInsideOutsidePairs[r5].num)->regionMapSectionId;
|
||||
event_buffer.map_section_id = Overworld_GetMapHeaderByGroupAndId(sInsideOutsidePairs[ql_entrance_id].inside_grp, sInsideOutsidePairs[ql_entrance_id].inside_num)->regionMapSectionId;
|
||||
if (gSaveBlock1Ptr->location.mapNum == MAP_NUM(ROUTE22))
|
||||
sp0.unk1 = r5;
|
||||
event_buffer.entrance_id = ql_entrance_id;
|
||||
else
|
||||
sp0.unk1 = r5 + 1;
|
||||
SetQuestLogEvent(QL_EVENT_DEPARTED, (void *)&sp0);
|
||||
FlagClear(FLAG_0x808);
|
||||
event_buffer.entrance_id = ql_entrance_id + 1;
|
||||
SetQuestLogEvent(QL_EVENT_DEPARTED, (void *)&event_buffer);
|
||||
FlagClear(FLAG_QL_DEPARTED);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (gSaveBlock1Ptr->location.mapGroup == sInsideOutsidePairs[r5].grp2 && gSaveBlock1Ptr->location.mapNum == sInsideOutsidePairs[r5].num2)
|
||||
if (gSaveBlock1Ptr->location.mapGroup == sInsideOutsidePairs[ql_entrance_id].outside_grp && gSaveBlock1Ptr->location.mapNum == sInsideOutsidePairs[ql_entrance_id].outside_num)
|
||||
{
|
||||
sp0.unk0 = Overworld_GetMapHeaderByGroupAndId(sInsideOutsidePairs[r5].grp, sInsideOutsidePairs[r5].num)->regionMapSectionId;
|
||||
sp0.unk1 = r5;
|
||||
if (r5 == QL_LOCATION_ROCK_TUNNEL_1)
|
||||
event_buffer.map_section_id = Overworld_GetMapHeaderByGroupAndId(sInsideOutsidePairs[ql_entrance_id].inside_grp, sInsideOutsidePairs[ql_entrance_id].inside_num)->regionMapSectionId;
|
||||
event_buffer.entrance_id = ql_entrance_id;
|
||||
if (ql_entrance_id == QL_LOCATION_ROCK_TUNNEL_1)
|
||||
{
|
||||
PlayerGetDestCoords(&x, &y);
|
||||
if (x != 15 || y != 26)
|
||||
sp0.unk1++;
|
||||
event_buffer.entrance_id++;
|
||||
}
|
||||
else if (r5 == QL_LOCATION_SEAFOAM_ISLANDS_1)
|
||||
else if (ql_entrance_id == QL_LOCATION_SEAFOAM_ISLANDS_1)
|
||||
{
|
||||
PlayerGetDestCoords(&x, &y);
|
||||
if (x != 67 || y != 15)
|
||||
sp0.unk1++;
|
||||
event_buffer.entrance_id++;
|
||||
}
|
||||
SetQuestLogEvent(QL_EVENT_DEPARTED, (void *)&sp0);
|
||||
FlagClear(FLAG_0x808);
|
||||
if (r5 == QL_LOCATION_ROCKET_HIDEOUT)
|
||||
SetQuestLogEvent(QL_EVENT_DEPARTED, (void *)&event_buffer);
|
||||
FlagClear(FLAG_QL_DEPARTED);
|
||||
if (ql_entrance_id == QL_LOCATION_ROCKET_HIDEOUT)
|
||||
{
|
||||
VarSet(VAR_0x404D, QL_LOCATION_GAME_CORNER);
|
||||
FlagSet(FLAG_0x808);
|
||||
VarSet(VAR_QL_ENTRANCE, QL_LOCATION_GAME_CORNER);
|
||||
FlagSet(FLAG_QL_DEPARTED);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2143,7 +2145,7 @@ void DoPokemonLeagueLightingEffect(void)
|
||||
LoadPalette(sEliteFourLightingPalettes[0], 0x70, 0x20);
|
||||
}
|
||||
data[1] = 0;
|
||||
sub_8059948(7, 1);
|
||||
Fieldmap_ApplyGlobalTintToPaletteSlot(7, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2153,7 +2155,7 @@ static void Task_RunPokemonLeagueLightingEffect(u8 taskId)
|
||||
if (!gPaletteFade.active
|
||||
&& FlagGet(FLAG_TEMP_2) != FALSE
|
||||
&& FlagGet(FLAG_TEMP_5) != TRUE
|
||||
&& gUnknown_2036E28 != 3
|
||||
&& gGlobalFieldTintMode != QL_TINT_BACKUP_GRAYSCALE
|
||||
&& --data[0] == 0
|
||||
)
|
||||
{
|
||||
@@ -2170,7 +2172,7 @@ static void Task_RunPokemonLeagueLightingEffect(u8 taskId)
|
||||
data[0] = sEliteFourLightingTimers[data[1]];
|
||||
LoadPalette(sEliteFourLightingPalettes[data[1]], 0x70, 0x20);
|
||||
}
|
||||
sub_8059948(7, 1);
|
||||
Fieldmap_ApplyGlobalTintToPaletteSlot(7, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2187,7 +2189,7 @@ static void Task_CancelPokemonLeagueLightingEffect(u8 taskId)
|
||||
{
|
||||
LoadPalette(sEliteFourLightingPalettes[11], 0x70, 0x20);
|
||||
}
|
||||
sub_8059948(7, 1);
|
||||
Fieldmap_ApplyGlobalTintToPaletteSlot(7, 1);
|
||||
if (gPaletteFade.active)
|
||||
{
|
||||
BlendPalettes(0x00000080, 16, RGB_BLACK);
|
||||
@@ -2400,7 +2402,7 @@ static void MoveDeoxysObject(u8 num)
|
||||
{
|
||||
u8 mapObjId;
|
||||
LoadPalette(sDeoxysObjectPals[num], 0x1A0, 0x08);
|
||||
sub_8083598(10);
|
||||
ApplyGlobalFieldPaletteTint(10);
|
||||
TryGetObjectEventIdByLocalIdAndMap(1, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, &mapObjId);
|
||||
if (num == 0)
|
||||
PlaySE(SE_M_CONFUSE_RAY);
|
||||
@@ -2446,7 +2448,7 @@ void SetDeoxysTrianglePalette(void)
|
||||
{
|
||||
u8 num = VarGet(VAR_DEOXYS_INTERACTION_NUM);
|
||||
LoadPalette(sDeoxysObjectPals[num], 0x1A0, 0x08);
|
||||
sub_8083598(10);
|
||||
ApplyGlobalFieldPaletteTint(10);
|
||||
}
|
||||
|
||||
bool8 IsBadEggInParty(void)
|
||||
@@ -2481,7 +2483,7 @@ void BrailleCursorToggle(void)
|
||||
if (gSpecialVar_0x8006 == 0)
|
||||
sBrailleTextCursorSpriteID = CreateTextCursorSpriteForOakSpeech(0, x, gSpecialVar_0x8005, 0, 0);
|
||||
else
|
||||
sub_8006398(sBrailleTextCursorSpriteID);
|
||||
DestroyTextCursorSprite(sBrailleTextCursorSpriteID);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -147,7 +147,7 @@ void StartWeather(void)
|
||||
{
|
||||
u8 index = AllocSpritePalette(0x1200);
|
||||
CpuCopy32(gUnknown_83C2CE0, &gPlttBufferUnfaded[0x100 + index * 16], 32);
|
||||
sub_8083598(index);
|
||||
ApplyGlobalFieldPaletteTint(index);
|
||||
BuildGammaShiftTables();
|
||||
gWeatherPtr->altGammaSpritePalIndex = index;
|
||||
gWeatherPtr->weatherPicSpritePalIndex = index;
|
||||
@@ -1154,7 +1154,7 @@ void ResetPreservedPalettesInWeather(void)
|
||||
sPaletteGammaTypes = sBasePaletteGammaTypes;
|
||||
}
|
||||
|
||||
void sub_807B0C4(u16 *palbuf, u16 *unused, u32 size)
|
||||
void SlightlyDarkenPalsInWeather(u16 *palbuf, u16 *unused, u32 size)
|
||||
{
|
||||
switch (gWeatherPtr->currWeather)
|
||||
{
|
||||
@@ -1163,7 +1163,7 @@ void sub_807B0C4(u16 *palbuf, u16 *unused, u32 size)
|
||||
case WEATHER_RAIN_THUNDERSTORM:
|
||||
case WEATHER_SHADE:
|
||||
case WEATHER_DOWNPOUR:
|
||||
sub_8045314(palbuf, RGB_BLACK, 3, size);
|
||||
BlendPalettesAt(palbuf, RGB_BLACK, 3, size);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
+26
-26
@@ -31,7 +31,7 @@ EWRAM_DATA u16 gBackupMapData[VIRTUAL_MAP_SIZE] = {};
|
||||
EWRAM_DATA struct MapHeader gMapHeader = {};
|
||||
EWRAM_DATA struct Camera gCamera = {};
|
||||
static EWRAM_DATA struct ConnectionFlags gMapConnectionFlags = {};
|
||||
EWRAM_DATA u8 gUnknown_2036E28 = 0;
|
||||
EWRAM_DATA u8 gGlobalFieldTintMode = QL_TINT_NONE;
|
||||
|
||||
static const struct ConnectionFlags sDummyConnectionFlags = {};
|
||||
|
||||
@@ -890,48 +890,48 @@ static void copy_tileset_patterns_to_vram2(struct Tileset const *tileset, u16 nu
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_80598CC(u16 a0, u16 a1)
|
||||
static void Fieldmap_ApplyGlobalTintToPaletteEntries(u16 offset, u16 size)
|
||||
{
|
||||
switch (gUnknown_2036E28)
|
||||
switch (gGlobalFieldTintMode)
|
||||
{
|
||||
case 0:
|
||||
case QL_TINT_NONE:
|
||||
return;
|
||||
case 1:
|
||||
TintPalette_GrayScale(gPlttBufferUnfaded + a0, a1);
|
||||
case QL_TINT_GRAYSCALE:
|
||||
TintPalette_GrayScale(gPlttBufferUnfaded + offset, size);
|
||||
break;
|
||||
case 2:
|
||||
TintPalette_SepiaTone(gPlttBufferUnfaded + a0, a1);
|
||||
case QL_TINT_SEPIA:
|
||||
TintPalette_SepiaTone(gPlttBufferUnfaded + offset, size);
|
||||
break;
|
||||
case 3:
|
||||
sub_8111F38(a0, a1);
|
||||
TintPalette_GrayScale(gPlttBufferUnfaded + a0, a1);
|
||||
case QL_TINT_BACKUP_GRAYSCALE:
|
||||
QuestLog_BackUpPalette(offset, size);
|
||||
TintPalette_GrayScale(gPlttBufferUnfaded + offset, size);
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
CpuCopy16(gPlttBufferUnfaded + a0, gPlttBufferFaded + a0, a1 * sizeof(u16));
|
||||
CpuCopy16(gPlttBufferUnfaded + offset, gPlttBufferFaded + offset, size * sizeof(u16));
|
||||
}
|
||||
|
||||
void sub_8059948(u8 a0, u8 a1)
|
||||
void Fieldmap_ApplyGlobalTintToPaletteSlot(u8 slot, u8 count)
|
||||
{
|
||||
switch (gUnknown_2036E28)
|
||||
switch (gGlobalFieldTintMode)
|
||||
{
|
||||
case 0:
|
||||
case QL_TINT_NONE:
|
||||
return;
|
||||
case 1:
|
||||
TintPalette_GrayScale(gPlttBufferUnfaded + a0 * 16, a1 * 16);
|
||||
case QL_TINT_GRAYSCALE:
|
||||
TintPalette_GrayScale(gPlttBufferUnfaded + slot * 16, count * 16);
|
||||
break;
|
||||
case 2:
|
||||
TintPalette_SepiaTone(gPlttBufferUnfaded + a0 * 16, a1 * 16);
|
||||
case QL_TINT_SEPIA:
|
||||
TintPalette_SepiaTone(gPlttBufferUnfaded + slot * 16, count * 16);
|
||||
break;
|
||||
case 3:
|
||||
sub_8111F38(a0 * 16, a1 * 16);
|
||||
TintPalette_GrayScale(gPlttBufferUnfaded + a0 * 16, a1 * 16);
|
||||
case QL_TINT_BACKUP_GRAYSCALE:
|
||||
QuestLog_BackUpPalette(slot * 16, count * 16);
|
||||
TintPalette_GrayScale(gPlttBufferUnfaded + slot * 16, count * 16);
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
CpuFastCopy(gPlttBufferUnfaded + a0 * 16, gPlttBufferFaded + a0 * 16, a1 * 16 * sizeof(u16));
|
||||
CpuFastCopy(gPlttBufferUnfaded + slot * 16, gPlttBufferFaded + slot * 16, count * 16 * sizeof(u16));
|
||||
}
|
||||
|
||||
static void apply_map_tileset_palette(struct Tileset const *tileset, u16 destOffset, u16 size)
|
||||
@@ -944,17 +944,17 @@ static void apply_map_tileset_palette(struct Tileset const *tileset, u16 destOff
|
||||
{
|
||||
LoadPalette(&black, destOffset, 2);
|
||||
LoadPalette(((u16*)tileset->palettes) + 1, destOffset + 1, size - 2);
|
||||
sub_80598CC(destOffset + 1, (size - 2) >> 1);
|
||||
Fieldmap_ApplyGlobalTintToPaletteEntries(destOffset + 1, (size - 2) >> 1);
|
||||
}
|
||||
else if (tileset->isSecondary == TRUE)
|
||||
{
|
||||
LoadPalette(((u16*)tileset->palettes) + (NUM_PALS_IN_PRIMARY * 16), destOffset, size);
|
||||
sub_80598CC(destOffset, size >> 1);
|
||||
Fieldmap_ApplyGlobalTintToPaletteEntries(destOffset, size >> 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
LoadCompressedPalette((u32*)tileset->palettes, destOffset, size);
|
||||
sub_80598CC(destOffset, size >> 1);
|
||||
Fieldmap_ApplyGlobalTintToPaletteEntries(destOffset, size >> 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -317,7 +317,7 @@ static void sub_8145A98(void)
|
||||
}
|
||||
for (i = 0, r6 = 0; i < 40; i++)
|
||||
{
|
||||
if (sMEventScreenData->wonderCard.unk_122[i] != CHAR_SPECIAL_F7)
|
||||
if (sMEventScreenData->wonderCard.unk_122[i] != CHAR_DYNAMIC_PLACEHOLDER)
|
||||
{
|
||||
sMEventScreenData->recordStrings[sMEventScreenData->recordIdx].nameTxt[r6] = sMEventScreenData->wonderCard.unk_122[i];
|
||||
r6++;
|
||||
|
||||
+2
-2
@@ -704,7 +704,7 @@ static void Task_OakSpeech5(u8 taskId)
|
||||
}
|
||||
FillBgTilemapBufferRect_Palette0(1, 0x000, 0, 2, 30, 18);
|
||||
CopyBgTilemapBufferToVram(1);
|
||||
sub_8006398(gTasks[taskId].data[5]);
|
||||
DestroyTextCursorSprite(gTasks[taskId].data[5]);
|
||||
sOakSpeechResources->unk_0014[0] = RGB_BLACK;
|
||||
LoadPalette(sOakSpeechResources->unk_0014, 0, 2);
|
||||
gTasks[taskId].data[3] = 32;
|
||||
@@ -822,7 +822,7 @@ static void Task_OakSpeech7(u8 taskId)
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
sub_8006398(gTasks[taskId].data[5]);
|
||||
DestroyTextCursorSprite(gTasks[taskId].data[5]);
|
||||
PlayBGM(MUS_NEW_GAME_EXIT);
|
||||
data[15] = 24;
|
||||
gMain.state++;
|
||||
|
||||
+19
-19
@@ -292,8 +292,8 @@ void Overworld_ResetStateAfterFly(void)
|
||||
VarSet(VAR_MAP_SCENE_FUCHSIA_CITY_SAFARI_ZONE_ENTRANCE, 0);
|
||||
FlagClear(FLAG_SYS_USE_STRENGTH);
|
||||
FlagClear(FLAG_SYS_FLASH_ACTIVE);
|
||||
FlagClear(FLAG_0x808);
|
||||
VarSet(VAR_0x404D, 0);
|
||||
FlagClear(FLAG_QL_DEPARTED);
|
||||
VarSet(VAR_QL_ENTRANCE, 0);
|
||||
}
|
||||
|
||||
void Overworld_ResetStateAfterTeleport(void)
|
||||
@@ -306,8 +306,8 @@ void Overworld_ResetStateAfterTeleport(void)
|
||||
VarSet(VAR_MAP_SCENE_FUCHSIA_CITY_SAFARI_ZONE_ENTRANCE, 0);
|
||||
FlagClear(FLAG_SYS_USE_STRENGTH);
|
||||
FlagClear(FLAG_SYS_FLASH_ACTIVE);
|
||||
FlagClear(FLAG_0x808);
|
||||
VarSet(VAR_0x404D, 0);
|
||||
FlagClear(FLAG_QL_DEPARTED);
|
||||
VarSet(VAR_QL_ENTRANCE, 0);
|
||||
}
|
||||
|
||||
void Overworld_ResetStateAfterDigEscRope(void)
|
||||
@@ -320,8 +320,8 @@ void Overworld_ResetStateAfterDigEscRope(void)
|
||||
VarSet(VAR_MAP_SCENE_FUCHSIA_CITY_SAFARI_ZONE_ENTRANCE, 0);
|
||||
FlagClear(FLAG_SYS_USE_STRENGTH);
|
||||
FlagClear(FLAG_SYS_FLASH_ACTIVE);
|
||||
FlagClear(FLAG_0x808);
|
||||
VarSet(VAR_0x404D, 0);
|
||||
FlagClear(FLAG_QL_DEPARTED);
|
||||
VarSet(VAR_QL_ENTRANCE, 0);
|
||||
}
|
||||
|
||||
static void Overworld_ResetStateAfterWhitingOut(void)
|
||||
@@ -334,8 +334,8 @@ static void Overworld_ResetStateAfterWhitingOut(void)
|
||||
VarSet(VAR_MAP_SCENE_FUCHSIA_CITY_SAFARI_ZONE_ENTRANCE, 0);
|
||||
FlagClear(FLAG_SYS_USE_STRENGTH);
|
||||
FlagClear(FLAG_SYS_FLASH_ACTIVE);
|
||||
FlagClear(FLAG_0x808);
|
||||
VarSet(VAR_0x404D, 0);
|
||||
FlagClear(FLAG_QL_DEPARTED);
|
||||
VarSet(VAR_QL_ENTRANCE, 0);
|
||||
}
|
||||
|
||||
static void Overworld_ResetStateOnContinue(void)
|
||||
@@ -1848,7 +1848,7 @@ static bool32 load_map_stuff(u8 *state, bool32 a1)
|
||||
(*state)++;
|
||||
break;
|
||||
case 1:
|
||||
sub_8111F14();
|
||||
QuestLog_InitPalettesBackup();
|
||||
(*state)++;
|
||||
break;
|
||||
case 2:
|
||||
@@ -1865,8 +1865,8 @@ static bool32 load_map_stuff(u8 *state, bool32 a1)
|
||||
sub_8057114();
|
||||
if (gQuestLogState != QL_STATE_PLAYBACK)
|
||||
{
|
||||
sub_80CC534();
|
||||
sub_80CC59C();
|
||||
QuestLog_CheckDepartingIndoorsMap();
|
||||
QuestLog_TryRecordDepartedLocation();
|
||||
}
|
||||
SetHelpContextForMap();
|
||||
(*state)++;
|
||||
@@ -1931,7 +1931,7 @@ static bool32 sub_8056CD8(u8 *state)
|
||||
{
|
||||
case 0:
|
||||
InitOverworldBgs();
|
||||
sub_8111F14();
|
||||
QuestLog_InitPalettesBackup();
|
||||
sub_8057024(FALSE);
|
||||
sub_8057100();
|
||||
sub_8057114();
|
||||
@@ -1965,7 +1965,7 @@ static bool32 map_loading_iteration_2_link(u8 *state)
|
||||
(*state)++;
|
||||
break;
|
||||
case 1:
|
||||
sub_8111F14();
|
||||
QuestLog_InitPalettesBackup();
|
||||
sub_8057024(1);
|
||||
(*state)++;
|
||||
break;
|
||||
@@ -2203,7 +2203,7 @@ static void CreateLinkPlayerSprites(void)
|
||||
void CB2_SetUpOverworldForQLPlaybackWithWarpExit(void)
|
||||
{
|
||||
FieldClearVBlankHBlankCallbacks();
|
||||
gUnknown_2036E28 = 1;
|
||||
gGlobalFieldTintMode = QL_TINT_GRAYSCALE;
|
||||
ScriptContext1_Init();
|
||||
ScriptContext2_Disable();
|
||||
SetMainCallback1(NULL);
|
||||
@@ -2214,7 +2214,7 @@ void CB2_SetUpOverworldForQLPlaybackWithWarpExit(void)
|
||||
void CB2_SetUpOverworldForQLPlayback(void)
|
||||
{
|
||||
FieldClearVBlankHBlankCallbacks();
|
||||
gUnknown_2036E28 = 1;
|
||||
gGlobalFieldTintMode = QL_TINT_GRAYSCALE;
|
||||
LoadSaveblockMapHeader();
|
||||
ScriptContext1_Init();
|
||||
ScriptContext2_Disable();
|
||||
@@ -2243,7 +2243,7 @@ static bool32 LoadMap_QLPlayback(u8 *state)
|
||||
case 0:
|
||||
InitOverworldBgs();
|
||||
FieldClearVBlankHBlankCallbacks();
|
||||
sub_8111F14();
|
||||
QuestLog_InitPalettesBackup();
|
||||
sub_81113E4();
|
||||
sub_8111438();
|
||||
if (GetQuestLogStartType() == QL_START_WARP)
|
||||
@@ -2316,7 +2316,7 @@ void CB2_EnterFieldFromQuestLog(void)
|
||||
{
|
||||
FieldClearVBlankHBlankCallbacks();
|
||||
StopMapMusic();
|
||||
gUnknown_2036E28 = 3;
|
||||
gGlobalFieldTintMode = QL_TINT_BACKUP_GRAYSCALE;
|
||||
ResetSafariZoneFlag_();
|
||||
LoadSaveblockMapHeader();
|
||||
LoadSaveblockObjEventScripts();
|
||||
@@ -2367,10 +2367,10 @@ static bool8 FieldCB2_Credits_WaitFade(void)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool32 Overworld_DoScrollSceneForCredits(u8 *state_p, const struct CreditsOverworldCmd * script, u8 a2)
|
||||
bool32 Overworld_DoScrollSceneForCredits(u8 *state_p, const struct CreditsOverworldCmd * script, u8 tintMode)
|
||||
{
|
||||
sCreditsOverworld_Script = script;
|
||||
gUnknown_2036E28 = a2;
|
||||
gGlobalFieldTintMode = tintMode;
|
||||
return SetUpScrollSceneForCredits(state_p, 0);
|
||||
}
|
||||
|
||||
|
||||
+20
-20
@@ -77,7 +77,7 @@ EWRAM_DATA u16 *gUnknown_203AE04 = NULL;
|
||||
EWRAM_DATA u16 *sEventRecordingPointer = NULL;
|
||||
static EWRAM_DATA u16 *gUnknown_203AE0C[32] = {NULL};
|
||||
static EWRAM_DATA void (* sQuestLogCB)(void) = NULL;
|
||||
static EWRAM_DATA u16 *gUnknown_203AE90 = NULL;
|
||||
static EWRAM_DATA u16 *sPalettesBackup = NULL;
|
||||
static EWRAM_DATA struct UnkStruct_203AE94 sQuestLogCurrentScene = {0};
|
||||
static EWRAM_DATA struct QuestLogEntry sQuestLogSceneRecordBuffer[32] = {0};
|
||||
EWRAM_DATA u16 sQuestLogCursor = 0;
|
||||
@@ -121,7 +121,7 @@ static void Task_QuestLogScene_SavedGame(u8);
|
||||
static void Task_WaitAtEndOfQuestLog(u8);
|
||||
static void Task_EndQuestLog(u8);
|
||||
static bool8 sub_81121D8(u8);
|
||||
static void sub_811229C(void);
|
||||
static void QL_SlightlyDarkenSomePals(void);
|
||||
static void TogglePlaybackStateForOverworldLock(u8);
|
||||
static void SetUpQuestLogEntry(u8, struct QuestLogEntry *, u16);
|
||||
static bool8 RecordHeadAtEndOfEntryOrScriptContext2Enabled(void);
|
||||
@@ -420,7 +420,7 @@ void TrySetUpQuestLogScenes_ElseContinueFromSave(u8 taskId)
|
||||
{
|
||||
u8 i;
|
||||
|
||||
sub_811381C();
|
||||
QL_EnableRecordingSteps();
|
||||
sNumScenes = 0;
|
||||
for (i = 0; i < QUEST_LOG_SCENE_COUNT; i++)
|
||||
{
|
||||
@@ -1066,15 +1066,15 @@ static void QuestLog_WaitFadeAndCancelPlayback(void)
|
||||
}
|
||||
}
|
||||
|
||||
void sub_8111F14(void)
|
||||
void QuestLog_InitPalettesBackup(void)
|
||||
{
|
||||
if (gQuestLogState == QL_STATE_PLAYBACK_LAST)
|
||||
gUnknown_203AE90 = AllocZeroed(0x200 * sizeof(u16));
|
||||
sPalettesBackup = AllocZeroed(PLTT_SIZE);
|
||||
}
|
||||
|
||||
void sub_8111F38(u16 a0, u16 a1)
|
||||
void QuestLog_BackUpPalette(u16 offset, u16 size)
|
||||
{
|
||||
CpuSet(gPlttBufferUnfaded + a0, gUnknown_203AE90 + a0, a1);
|
||||
CpuSet(gPlttBufferUnfaded + offset, sPalettesBackup + offset, size);
|
||||
}
|
||||
|
||||
static bool8 FieldCB2_FinalScene(void)
|
||||
@@ -1152,7 +1152,7 @@ static void Task_EndQuestLog(u8 taskId)
|
||||
case 0:
|
||||
gDisableMapMusicChangeOnMapLoad = 0;
|
||||
Overworld_PlaySpecialMapMusic();
|
||||
sub_811229C();
|
||||
QL_SlightlyDarkenSomePals();
|
||||
FillWindowPixelRect(sQuestLogHeaderWindowIds[0], 0xF, 0, 0, sQuestLogHeaderWindowTemplates[0].width * 8, sQuestLogHeaderWindowTemplates[0].height * 8);
|
||||
tState++;
|
||||
break;
|
||||
@@ -1178,13 +1178,13 @@ static void Task_EndQuestLog(u8 taskId)
|
||||
default:
|
||||
if (sQuestLogCurrentScene.sceneEndMode == 1)
|
||||
ShowMapNamePopup(TRUE);
|
||||
CpuCopy16(gUnknown_203AE90, gPlttBufferUnfaded, 0x400);
|
||||
Free(gUnknown_203AE90);
|
||||
CpuCopy16(sPalettesBackup, gPlttBufferUnfaded, PLTT_SIZE);
|
||||
Free(sPalettesBackup);
|
||||
sQuestLogCurrentScene = (struct UnkStruct_203AE94){};
|
||||
ClearPlayerHeldMovementAndUnfreezeObjectEvents();
|
||||
ScriptContext2_Disable();
|
||||
gTextFlags.autoScroll = FALSE;
|
||||
gUnknown_2036E28 = 0;
|
||||
gGlobalFieldTintMode = QL_TINT_NONE;
|
||||
DisableWildEncounters(FALSE);
|
||||
gHelpSystemEnabled = TRUE;
|
||||
DestroyTask(taskId);
|
||||
@@ -1212,16 +1212,16 @@ static bool8 sub_81121D8(u8 taskId)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void sub_811229C(void)
|
||||
static void QL_SlightlyDarkenSomePals(void)
|
||||
{
|
||||
u16 *buffer = Alloc(0x400);
|
||||
CpuCopy16(gUnknown_203AE90, buffer, 0x400);
|
||||
sub_807B0C4(gUnknown_203AE90, gUnknown_203AE90, 0xd0);
|
||||
sub_807B0C4(gUnknown_203AE90 + 0x110, gUnknown_203AE90 + 0x110, 0x10);
|
||||
sub_807B0C4(gUnknown_203AE90 + 0x160, gUnknown_203AE90 + 0x160, 0x40);
|
||||
sub_807B0C4(gUnknown_203AE90 + 0x1b0, gUnknown_203AE90 + 0x1b0, 0x50);
|
||||
CpuCopy16(gUnknown_203AE90, gPlttBufferUnfaded, 0x400);
|
||||
CpuCopy16(buffer, gUnknown_203AE90, 0x400);
|
||||
u16 *buffer = Alloc(PLTT_SIZE);
|
||||
CpuCopy16(sPalettesBackup, buffer, PLTT_SIZE);
|
||||
SlightlyDarkenPalsInWeather(sPalettesBackup, sPalettesBackup, 13 * 16);
|
||||
SlightlyDarkenPalsInWeather(sPalettesBackup + 17 * 16, sPalettesBackup + 17 * 16, 1 * 16);
|
||||
SlightlyDarkenPalsInWeather(sPalettesBackup + 22 * 16, sPalettesBackup + 22 * 16, 4 * 16);
|
||||
SlightlyDarkenPalsInWeather(sPalettesBackup + 27 * 16, sPalettesBackup + 27 * 16, 5 * 16);
|
||||
CpuCopy16(sPalettesBackup, gPlttBufferUnfaded, PLTT_SIZE);
|
||||
CpuCopy16(buffer, sPalettesBackup, PLTT_SIZE);
|
||||
Free(buffer);
|
||||
}
|
||||
|
||||
|
||||
@@ -173,10 +173,10 @@ void SetQuestLogEvent(u16 eventId, const u16 *eventData)
|
||||
|
||||
if (eventId == QL_EVENT_DEPARTED && sEventShouldNotRecordSteps == 2)
|
||||
{
|
||||
sub_811381C();
|
||||
QL_EnableRecordingSteps();
|
||||
return;
|
||||
}
|
||||
sub_811381C();
|
||||
QL_EnableRecordingSteps();
|
||||
if (gQuestLogState == QL_STATE_PLAYBACK)
|
||||
return;
|
||||
|
||||
@@ -348,7 +348,7 @@ static bool8 ShouldRegisterEvent_HandleBeatStoryTrainer(u16 eventId, const u16 *
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void sub_811381C(void)
|
||||
void QL_EnableRecordingSteps(void)
|
||||
{
|
||||
sEventShouldNotRecordSteps = 0;
|
||||
}
|
||||
|
||||
+250
-250
@@ -657,22 +657,22 @@ u16 RenderText(struct TextPrinter *textPrinter)
|
||||
textPrinter->printerTemplate.currentChar++;
|
||||
switch (currChar)
|
||||
{
|
||||
case 1:
|
||||
case EXT_CTRL_CODE_COLOR:
|
||||
textPrinter->printerTemplate.fgColor = *textPrinter->printerTemplate.currentChar;
|
||||
textPrinter->printerTemplate.currentChar++;
|
||||
GenerateFontHalfRowLookupTable(textPrinter->printerTemplate.fgColor, textPrinter->printerTemplate.bgColor, textPrinter->printerTemplate.shadowColor);
|
||||
return 2;
|
||||
case 2:
|
||||
case EXT_CTRL_CODE_HIGHLIGHT:
|
||||
textPrinter->printerTemplate.bgColor = *textPrinter->printerTemplate.currentChar;
|
||||
textPrinter->printerTemplate.currentChar++;
|
||||
GenerateFontHalfRowLookupTable(textPrinter->printerTemplate.fgColor, textPrinter->printerTemplate.bgColor, textPrinter->printerTemplate.shadowColor);
|
||||
return 2;
|
||||
case 3:
|
||||
case EXT_CTRL_CODE_SHADOW:
|
||||
textPrinter->printerTemplate.shadowColor = *textPrinter->printerTemplate.currentChar;
|
||||
textPrinter->printerTemplate.currentChar++;
|
||||
GenerateFontHalfRowLookupTable(textPrinter->printerTemplate.fgColor, textPrinter->printerTemplate.bgColor, textPrinter->printerTemplate.shadowColor);
|
||||
return 2;
|
||||
case 4:
|
||||
case EXT_CTRL_CODE_COLOR_HIGHLIGHT_SHADOW:
|
||||
textPrinter->printerTemplate.fgColor = *textPrinter->printerTemplate.currentChar;
|
||||
textPrinter->printerTemplate.currentChar++;
|
||||
textPrinter->printerTemplate.bgColor = *textPrinter->printerTemplate.currentChar;
|
||||
@@ -681,29 +681,29 @@ u16 RenderText(struct TextPrinter *textPrinter)
|
||||
textPrinter->printerTemplate.currentChar++;
|
||||
GenerateFontHalfRowLookupTable(textPrinter->printerTemplate.fgColor, textPrinter->printerTemplate.bgColor, textPrinter->printerTemplate.shadowColor);
|
||||
return 2;
|
||||
case 5:
|
||||
case EXT_CTRL_CODE_PALETTE:
|
||||
textPrinter->printerTemplate.currentChar++;
|
||||
return 2;
|
||||
case 6:
|
||||
case EXT_CTRL_CODE_FONT:
|
||||
subStruct->glyphId = *textPrinter->printerTemplate.currentChar;
|
||||
textPrinter->printerTemplate.currentChar++;
|
||||
return 2;
|
||||
case EXT_CTRL_CODE_UNKNOWN_7:
|
||||
case EXT_CTRL_CODE_RESET_FONT:
|
||||
return 2;
|
||||
case 8:
|
||||
case EXT_CTRL_CODE_PAUSE:
|
||||
textPrinter->delayCounter = *textPrinter->printerTemplate.currentChar;
|
||||
textPrinter->printerTemplate.currentChar++;
|
||||
textPrinter->state = 6;
|
||||
return 2;
|
||||
case 9:
|
||||
case EXT_CTRL_CODE_WAIT_BUTTON:
|
||||
textPrinter->state = 1;
|
||||
if (gTextFlags.autoScroll)
|
||||
subStruct->autoScrollDelay = 0;
|
||||
return 3;
|
||||
case 10:
|
||||
case EXT_CTRL_CODE_WAIT_SE:
|
||||
textPrinter->state = 5;
|
||||
return 3;
|
||||
case 11:
|
||||
case EXT_CTRL_CODE_PLAY_BGM:
|
||||
currChar = *textPrinter->printerTemplate.currentChar;
|
||||
textPrinter->printerTemplate.currentChar++;
|
||||
currChar |= *textPrinter->printerTemplate.currentChar << 8;
|
||||
@@ -711,32 +711,32 @@ u16 RenderText(struct TextPrinter *textPrinter)
|
||||
if (!QL_IS_PLAYBACK_STATE)
|
||||
PlayBGM(currChar);
|
||||
return 2;
|
||||
case 16:
|
||||
case EXT_CTRL_CODE_PLAY_SE:
|
||||
currChar = *textPrinter->printerTemplate.currentChar;
|
||||
textPrinter->printerTemplate.currentChar++;
|
||||
currChar |= (*textPrinter->printerTemplate.currentChar << 8);
|
||||
textPrinter->printerTemplate.currentChar++;
|
||||
PlaySE(currChar);
|
||||
return 2;
|
||||
case 12:
|
||||
case EXT_CTRL_CODE_ESCAPE:
|
||||
textPrinter->printerTemplate.currentChar++;
|
||||
currChar = *textPrinter->printerTemplate.currentChar;
|
||||
break;
|
||||
case 13:
|
||||
case EXT_CTRL_CODE_SHIFT_RIGHT:
|
||||
textPrinter->printerTemplate.currentX = textPrinter->printerTemplate.x + *textPrinter->printerTemplate.currentChar;
|
||||
textPrinter->printerTemplate.currentChar++;
|
||||
return 2;
|
||||
case 14:
|
||||
case EXT_CTRL_CODE_SHIFT_DOWN:
|
||||
textPrinter->printerTemplate.currentY = textPrinter->printerTemplate.y + *textPrinter->printerTemplate.currentChar;
|
||||
textPrinter->printerTemplate.currentChar++;
|
||||
return 2;
|
||||
case 15:
|
||||
case EXT_CTRL_CODE_FILL_WINDOW:
|
||||
FillWindowPixelBuffer(textPrinter->printerTemplate.windowId, PIXEL_FILL(textPrinter->printerTemplate.bgColor));
|
||||
return 2;
|
||||
case 23:
|
||||
case EXT_CTRL_CODE_STOP_BGM:
|
||||
m4aMPlayStop(&gMPlayInfo_BGM);
|
||||
return 2;
|
||||
case 24:
|
||||
case EXT_CTRL_CODE_RESUME_BGM:
|
||||
m4aMPlayContinue(&gMPlayInfo_BGM);
|
||||
return 2;
|
||||
case EXT_CTRL_CODE_CLEAR:
|
||||
@@ -749,7 +749,7 @@ u16 RenderText(struct TextPrinter *textPrinter)
|
||||
return 0;
|
||||
}
|
||||
return 2;
|
||||
case 18:
|
||||
case EXT_CTRL_CODE_SKIP:
|
||||
textPrinter->printerTemplate.currentX = *textPrinter->printerTemplate.currentChar + textPrinter->printerTemplate.x;
|
||||
textPrinter->printerTemplate.currentChar++;
|
||||
return 2;
|
||||
@@ -924,61 +924,61 @@ s32 GetStringWidthFixedWidthFont(const u8 *str, u8 fontId, u8 letterSpacing)
|
||||
temp = strLocal[strPos++];
|
||||
switch (temp)
|
||||
{
|
||||
case 0xFE:
|
||||
case 0xFF:
|
||||
lineWidths[line] = width;
|
||||
width = 0;
|
||||
line++;
|
||||
break;
|
||||
case 0xFC:
|
||||
temp2 = strLocal[strPos++];
|
||||
switch (temp2)
|
||||
{
|
||||
case 0x4:
|
||||
++strPos;
|
||||
case 0xB:
|
||||
case 0x10:
|
||||
++strPos;
|
||||
case 0x1:
|
||||
case 0x2:
|
||||
case 0x3:
|
||||
case 0x5:
|
||||
case 0x6:
|
||||
case 0x8:
|
||||
case 0xC:
|
||||
case 0xD:
|
||||
case 0xE:
|
||||
case 0x11:
|
||||
case 0x12:
|
||||
case 0x13:
|
||||
case 0x14:
|
||||
++strPos;
|
||||
break;
|
||||
case 0x7:
|
||||
case 0x9:
|
||||
case 0xA:
|
||||
case 0xF:
|
||||
case 0x15:
|
||||
case 0x16:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 0xF7:
|
||||
case 0xFD:
|
||||
case CHAR_NEWLINE:
|
||||
case EOS:
|
||||
lineWidths[line] = width;
|
||||
width = 0;
|
||||
line++;
|
||||
break;
|
||||
case EXT_CTRL_CODE_BEGIN:
|
||||
temp2 = strLocal[strPos++];
|
||||
switch (temp2)
|
||||
{
|
||||
case EXT_CTRL_CODE_COLOR_HIGHLIGHT_SHADOW:
|
||||
++strPos;
|
||||
case EXT_CTRL_CODE_PLAY_BGM:
|
||||
case EXT_CTRL_CODE_PLAY_SE:
|
||||
++strPos;
|
||||
case EXT_CTRL_CODE_COLOR:
|
||||
case EXT_CTRL_CODE_HIGHLIGHT:
|
||||
case EXT_CTRL_CODE_SHADOW:
|
||||
case EXT_CTRL_CODE_PALETTE:
|
||||
case EXT_CTRL_CODE_FONT:
|
||||
case EXT_CTRL_CODE_PAUSE:
|
||||
case EXT_CTRL_CODE_ESCAPE:
|
||||
case EXT_CTRL_CODE_SHIFT_RIGHT:
|
||||
case EXT_CTRL_CODE_SHIFT_DOWN:
|
||||
case EXT_CTRL_CODE_CLEAR:
|
||||
case EXT_CTRL_CODE_SKIP:
|
||||
case EXT_CTRL_CODE_CLEAR_TO:
|
||||
case EXT_CTRL_CODE_MIN_LETTER_SPACING:
|
||||
++strPos;
|
||||
break;
|
||||
case 0xFA:
|
||||
case 0xFB:
|
||||
break;
|
||||
case 0xF8:
|
||||
case 0xF9:
|
||||
++strPos;
|
||||
case EXT_CTRL_CODE_RESET_FONT:
|
||||
case EXT_CTRL_CODE_WAIT_BUTTON:
|
||||
case EXT_CTRL_CODE_WAIT_SE:
|
||||
case EXT_CTRL_CODE_FILL_WINDOW:
|
||||
case EXT_CTRL_CODE_JPN:
|
||||
case EXT_CTRL_CODE_ENG:
|
||||
default:
|
||||
++width;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case CHAR_DYNAMIC_PLACEHOLDER:
|
||||
case PLACEHOLDER_BEGIN:
|
||||
++strPos;
|
||||
break;
|
||||
case CHAR_PROMPT_SCROLL:
|
||||
case CHAR_PROMPT_CLEAR:
|
||||
break;
|
||||
case CHAR_KEYPAD_ICON:
|
||||
case CHAR_EXTRA_EMOJI:
|
||||
++strPos;
|
||||
default:
|
||||
++width;
|
||||
break;
|
||||
}
|
||||
} while (temp != 0xFF);
|
||||
} while (temp != EOS);
|
||||
|
||||
for (width = 0, strPos = 0; strPos < 8; ++strPos)
|
||||
{
|
||||
@@ -1033,109 +1033,36 @@ s32 GetStringWidth(u8 fontId, const u8 *str, s16 letterSpacing)
|
||||
lineWidth = 0;
|
||||
bufferPointer = NULL;
|
||||
|
||||
while (*str != 0xFF)
|
||||
while (*str != EOS)
|
||||
{
|
||||
switch (*str)
|
||||
{
|
||||
case 0xFE:
|
||||
if (lineWidth > width)
|
||||
width = lineWidth;
|
||||
lineWidth = 0;
|
||||
break;
|
||||
case 0xFD:
|
||||
switch (*++str)
|
||||
{
|
||||
case 0x2:
|
||||
bufferPointer = gStringVar1;
|
||||
break;
|
||||
case 0x3:
|
||||
bufferPointer = gStringVar2;
|
||||
break;
|
||||
case 0x4:
|
||||
bufferPointer = gStringVar3;
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
case 0xF7:
|
||||
if (bufferPointer == NULL)
|
||||
bufferPointer = DynamicPlaceholderTextUtil_GetPlaceholderPtr(*++str);
|
||||
while (*bufferPointer != 0xFF)
|
||||
{
|
||||
glyphWidth = func(*bufferPointer++, isJapanese);
|
||||
if (minGlyphWidth > 0)
|
||||
{
|
||||
if (glyphWidth < minGlyphWidth)
|
||||
glyphWidth = minGlyphWidth;
|
||||
}
|
||||
else if (isJapanese)
|
||||
{
|
||||
glyphWidth += localLetterSpacing;
|
||||
}
|
||||
lineWidth += glyphWidth;
|
||||
}
|
||||
bufferPointer = NULL;
|
||||
break;
|
||||
case 0xFC:
|
||||
switch (*++str)
|
||||
{
|
||||
case 0x4:
|
||||
++str;
|
||||
case 0xB:
|
||||
case 0x10:
|
||||
++str;
|
||||
case 0x1:
|
||||
case 0x2:
|
||||
case 0x3:
|
||||
case 0x5:
|
||||
case 0x8:
|
||||
case 0xC:
|
||||
case 0xD:
|
||||
case 0xE:
|
||||
++str;
|
||||
break;
|
||||
case 0x6:
|
||||
func = GetFontWidthFunc(*++str);
|
||||
if (func == NULL)
|
||||
return 0;
|
||||
if (letterSpacing == -1)
|
||||
localLetterSpacing = GetFontAttribute(*str, 2);
|
||||
break;
|
||||
case 0x11:
|
||||
glyphWidth = *++str;
|
||||
lineWidth += glyphWidth;
|
||||
break;
|
||||
case 0x12:
|
||||
lineWidth = *++str;
|
||||
break;
|
||||
case 0x13:
|
||||
if (*++str > lineWidth)
|
||||
lineWidth = *str;
|
||||
break;
|
||||
case 0x14:
|
||||
minGlyphWidth = *++str;
|
||||
break;
|
||||
case 0x15:
|
||||
isJapanese = 1;
|
||||
break;
|
||||
case 0x16:
|
||||
isJapanese = 0;
|
||||
break;
|
||||
case 0x7:
|
||||
case 0x9:
|
||||
case 0xA:
|
||||
case 0xF:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 0xF8:
|
||||
case 0xF9:
|
||||
if (*str == 0xF9)
|
||||
glyphWidth = func(*++str | 0x100, isJapanese);
|
||||
else
|
||||
glyphWidth = GetKeypadIconWidth(*++str);
|
||||
|
||||
case CHAR_NEWLINE:
|
||||
if (lineWidth > width)
|
||||
width = lineWidth;
|
||||
lineWidth = 0;
|
||||
break;
|
||||
case PLACEHOLDER_BEGIN:
|
||||
switch (*++str)
|
||||
{
|
||||
case PLACEHOLDER_ID_STRING_VAR_1:
|
||||
bufferPointer = gStringVar1;
|
||||
break;
|
||||
case PLACEHOLDER_ID_STRING_VAR_2:
|
||||
bufferPointer = gStringVar2;
|
||||
break;
|
||||
case PLACEHOLDER_ID_STRING_VAR_3:
|
||||
bufferPointer = gStringVar3;
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
case CHAR_DYNAMIC_PLACEHOLDER:
|
||||
if (bufferPointer == NULL)
|
||||
bufferPointer = DynamicPlaceholderTextUtil_GetPlaceholderPtr(*++str);
|
||||
while (*bufferPointer != EOS)
|
||||
{
|
||||
glyphWidth = func(*bufferPointer++, isJapanese);
|
||||
if (minGlyphWidth > 0)
|
||||
{
|
||||
if (glyphWidth < minGlyphWidth)
|
||||
@@ -1146,27 +1073,100 @@ s32 GetStringWidth(u8 fontId, const u8 *str, s16 letterSpacing)
|
||||
glyphWidth += localLetterSpacing;
|
||||
}
|
||||
lineWidth += glyphWidth;
|
||||
}
|
||||
bufferPointer = NULL;
|
||||
break;
|
||||
case EXT_CTRL_CODE_BEGIN:
|
||||
switch (*++str)
|
||||
{
|
||||
case EXT_CTRL_CODE_COLOR_HIGHLIGHT_SHADOW:
|
||||
++str;
|
||||
case EXT_CTRL_CODE_PLAY_BGM:
|
||||
case EXT_CTRL_CODE_PLAY_SE:
|
||||
++str;
|
||||
case EXT_CTRL_CODE_COLOR:
|
||||
case EXT_CTRL_CODE_HIGHLIGHT:
|
||||
case EXT_CTRL_CODE_SHADOW:
|
||||
case EXT_CTRL_CODE_PALETTE:
|
||||
case EXT_CTRL_CODE_PAUSE:
|
||||
case EXT_CTRL_CODE_ESCAPE:
|
||||
case EXT_CTRL_CODE_SHIFT_RIGHT:
|
||||
case EXT_CTRL_CODE_SHIFT_DOWN:
|
||||
++str;
|
||||
break;
|
||||
case 0xFA:
|
||||
case 0xFB:
|
||||
case EXT_CTRL_CODE_FONT:
|
||||
func = GetFontWidthFunc(*++str);
|
||||
if (func == NULL)
|
||||
return 0;
|
||||
if (letterSpacing == -1)
|
||||
localLetterSpacing = GetFontAttribute(*str, 2);
|
||||
break;
|
||||
case EXT_CTRL_CODE_CLEAR:
|
||||
glyphWidth = *++str;
|
||||
lineWidth += glyphWidth;
|
||||
break;
|
||||
case EXT_CTRL_CODE_SKIP:
|
||||
lineWidth = *++str;
|
||||
break;
|
||||
case EXT_CTRL_CODE_CLEAR_TO:
|
||||
if (*++str > lineWidth)
|
||||
lineWidth = *str;
|
||||
break;
|
||||
case EXT_CTRL_CODE_MIN_LETTER_SPACING:
|
||||
minGlyphWidth = *++str;
|
||||
break;
|
||||
case EXT_CTRL_CODE_JPN:
|
||||
isJapanese = 1;
|
||||
break;
|
||||
case EXT_CTRL_CODE_ENG:
|
||||
isJapanese = 0;
|
||||
break;
|
||||
case EXT_CTRL_CODE_RESET_FONT:
|
||||
case EXT_CTRL_CODE_WAIT_BUTTON:
|
||||
case EXT_CTRL_CODE_WAIT_SE:
|
||||
case EXT_CTRL_CODE_FILL_WINDOW:
|
||||
default:
|
||||
glyphWidth = func(*str, isJapanese);
|
||||
if (minGlyphWidth > 0)
|
||||
{
|
||||
if (glyphWidth < minGlyphWidth)
|
||||
glyphWidth = minGlyphWidth;
|
||||
lineWidth += glyphWidth;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (fontId != 6 && isJapanese)
|
||||
{
|
||||
glyphWidth += localLetterSpacing;
|
||||
}
|
||||
lineWidth += glyphWidth;
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case CHAR_KEYPAD_ICON:
|
||||
case CHAR_EXTRA_EMOJI:
|
||||
if (*str == CHAR_EXTRA_EMOJI)
|
||||
glyphWidth = func(*++str | 0x100, isJapanese);
|
||||
else
|
||||
glyphWidth = GetKeypadIconWidth(*++str);
|
||||
|
||||
if (minGlyphWidth > 0)
|
||||
{
|
||||
if (glyphWidth < minGlyphWidth)
|
||||
glyphWidth = minGlyphWidth;
|
||||
}
|
||||
else if (isJapanese)
|
||||
{
|
||||
glyphWidth += localLetterSpacing;
|
||||
}
|
||||
lineWidth += glyphWidth;
|
||||
break;
|
||||
case CHAR_PROMPT_SCROLL:
|
||||
case CHAR_PROMPT_CLEAR:
|
||||
break;
|
||||
default:
|
||||
glyphWidth = func(*str, isJapanese);
|
||||
if (minGlyphWidth > 0)
|
||||
{
|
||||
if (glyphWidth < minGlyphWidth)
|
||||
glyphWidth = minGlyphWidth;
|
||||
lineWidth += glyphWidth;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (fontId != 6 && isJapanese)
|
||||
{
|
||||
glyphWidth += localLetterSpacing;
|
||||
}
|
||||
lineWidth += glyphWidth;
|
||||
}
|
||||
break;
|
||||
}
|
||||
++str;
|
||||
}
|
||||
@@ -1202,75 +1202,75 @@ u8 RenderTextFont9(u8 *pixels, u8 fontId, u8 *str, int a3, int a4, int a5, int a
|
||||
temp = strLocal[strPos++];
|
||||
switch (temp)
|
||||
{
|
||||
case 0xFC:
|
||||
temp2 = strLocal[strPos++];
|
||||
switch (temp2)
|
||||
{
|
||||
case 0x4:
|
||||
fgColor = strLocal[strPos++];
|
||||
bgColor = strLocal[strPos++];
|
||||
shadowColor = strLocal[strPos++];
|
||||
GenerateFontHalfRowLookupTable(fgColor, bgColor, shadowColor);
|
||||
continue;
|
||||
case 0x1:
|
||||
fgColor = strLocal[strPos++];
|
||||
GenerateFontHalfRowLookupTable(fgColor, bgColor, shadowColor);
|
||||
continue;
|
||||
case 0x2:
|
||||
bgColor = strLocal[strPos++];
|
||||
GenerateFontHalfRowLookupTable(fgColor, bgColor, shadowColor);
|
||||
continue;
|
||||
case 0x3:
|
||||
shadowColor = strLocal[strPos++];
|
||||
GenerateFontHalfRowLookupTable(fgColor, bgColor, shadowColor);
|
||||
continue;
|
||||
case 0x6:
|
||||
fontId = strLocal[strPos++];
|
||||
break;
|
||||
case 0xB:
|
||||
case 0x10:
|
||||
++strPos;
|
||||
case 0x5:
|
||||
case 0x8:
|
||||
case 0xC:
|
||||
case 0xD:
|
||||
case 0xE:
|
||||
case 0x11:
|
||||
case 0x12:
|
||||
case 0x13:
|
||||
case 0x14:
|
||||
++strPos;
|
||||
break;
|
||||
case 0x7:
|
||||
case 0x9:
|
||||
case 0xA:
|
||||
case 0xF:
|
||||
case 0x15:
|
||||
case 0x16:
|
||||
default:
|
||||
continue;
|
||||
}
|
||||
case EXT_CTRL_CODE_BEGIN:
|
||||
temp2 = strLocal[strPos++];
|
||||
switch (temp2)
|
||||
{
|
||||
case EXT_CTRL_CODE_COLOR_HIGHLIGHT_SHADOW:
|
||||
fgColor = strLocal[strPos++];
|
||||
bgColor = strLocal[strPos++];
|
||||
shadowColor = strLocal[strPos++];
|
||||
GenerateFontHalfRowLookupTable(fgColor, bgColor, shadowColor);
|
||||
continue;
|
||||
case EXT_CTRL_CODE_COLOR:
|
||||
fgColor = strLocal[strPos++];
|
||||
GenerateFontHalfRowLookupTable(fgColor, bgColor, shadowColor);
|
||||
continue;
|
||||
case EXT_CTRL_CODE_HIGHLIGHT:
|
||||
bgColor = strLocal[strPos++];
|
||||
GenerateFontHalfRowLookupTable(fgColor, bgColor, shadowColor);
|
||||
continue;
|
||||
case EXT_CTRL_CODE_SHADOW:
|
||||
shadowColor = strLocal[strPos++];
|
||||
GenerateFontHalfRowLookupTable(fgColor, bgColor, shadowColor);
|
||||
continue;
|
||||
case EXT_CTRL_CODE_FONT:
|
||||
fontId = strLocal[strPos++];
|
||||
break;
|
||||
case 0xF7:
|
||||
case 0xF8:
|
||||
case 0xF9:
|
||||
case 0xFD:
|
||||
case EXT_CTRL_CODE_PLAY_BGM:
|
||||
case EXT_CTRL_CODE_PLAY_SE:
|
||||
++strPos;
|
||||
case EXT_CTRL_CODE_PALETTE:
|
||||
case EXT_CTRL_CODE_PAUSE:
|
||||
case EXT_CTRL_CODE_ESCAPE:
|
||||
case EXT_CTRL_CODE_SHIFT_RIGHT:
|
||||
case EXT_CTRL_CODE_SHIFT_DOWN:
|
||||
case EXT_CTRL_CODE_CLEAR:
|
||||
case EXT_CTRL_CODE_SKIP:
|
||||
case EXT_CTRL_CODE_CLEAR_TO:
|
||||
case EXT_CTRL_CODE_MIN_LETTER_SPACING:
|
||||
++strPos;
|
||||
break;
|
||||
case 0xFA:
|
||||
case 0xFB:
|
||||
case 0xFE:
|
||||
case 0xFF:
|
||||
break;
|
||||
case EXT_CTRL_CODE_RESET_FONT:
|
||||
case EXT_CTRL_CODE_WAIT_BUTTON:
|
||||
case EXT_CTRL_CODE_WAIT_SE:
|
||||
case EXT_CTRL_CODE_FILL_WINDOW:
|
||||
case EXT_CTRL_CODE_JPN:
|
||||
case EXT_CTRL_CODE_ENG:
|
||||
default:
|
||||
DecompressGlyphFont9(temp);
|
||||
CpuCopy32(gGlyphInfo, pixels, 0x20);
|
||||
CpuCopy32(gGlyphInfo + 0x40, pixels + 0x20, 0x20);
|
||||
pixels += 0x40;
|
||||
break;
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
case CHAR_DYNAMIC_PLACEHOLDER:
|
||||
case CHAR_KEYPAD_ICON:
|
||||
case CHAR_EXTRA_EMOJI:
|
||||
case PLACEHOLDER_BEGIN:
|
||||
++strPos;
|
||||
break;
|
||||
case CHAR_PROMPT_SCROLL:
|
||||
case CHAR_PROMPT_CLEAR:
|
||||
case CHAR_NEWLINE:
|
||||
case EOS:
|
||||
break;
|
||||
default:
|
||||
DecompressGlyphFont9(temp);
|
||||
CpuCopy32(gGlyphInfo, pixels, 0x20);
|
||||
CpuCopy32(gGlyphInfo + 0x40, pixels + 0x20, 0x20);
|
||||
pixels += 0x40;
|
||||
break;
|
||||
}
|
||||
}
|
||||
while (temp != 0xFF);
|
||||
while (temp != EOS);
|
||||
|
||||
RestoreTextColors(&colorBackup[0], &colorBackup[1], &colorBackup[2]);
|
||||
return 1;
|
||||
@@ -1317,7 +1317,7 @@ u8 CreateTextCursorSpriteForOakSpeech(u8 sheetId, u16 x, u16 y, u8 priority, u8
|
||||
return spriteId;
|
||||
}
|
||||
|
||||
void sub_8006398(u8 spriteId)
|
||||
void DestroyTextCursorSprite(u8 spriteId)
|
||||
{
|
||||
DestroySprite(&gSprites[spriteId]);
|
||||
FreeSpriteTilesByTag(0x8000);
|
||||
|
||||
Reference in New Issue
Block a user