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