through ScrCmd_fadescreenspeed
This commit is contained in:
-198
@@ -5,204 +5,6 @@
|
|||||||
|
|
||||||
.text
|
.text
|
||||||
|
|
||||||
thumb_func_start ScrCmd_setflag
|
|
||||||
ScrCmd_setflag: @ 806A82C
|
|
||||||
push {lr}
|
|
||||||
bl ScriptReadHalfword
|
|
||||||
lsls r0, 16
|
|
||||||
lsrs r0, 16
|
|
||||||
bl FlagSet
|
|
||||||
movs r0, 0
|
|
||||||
pop {r1}
|
|
||||||
bx r1
|
|
||||||
thumb_func_end ScrCmd_setflag
|
|
||||||
|
|
||||||
thumb_func_start ScrCmd_clearflag
|
|
||||||
ScrCmd_clearflag: @ 806A840
|
|
||||||
push {lr}
|
|
||||||
bl ScriptReadHalfword
|
|
||||||
lsls r0, 16
|
|
||||||
lsrs r0, 16
|
|
||||||
bl FlagClear
|
|
||||||
movs r0, 0
|
|
||||||
pop {r1}
|
|
||||||
bx r1
|
|
||||||
thumb_func_end ScrCmd_clearflag
|
|
||||||
|
|
||||||
thumb_func_start ScrCmd_checkflag
|
|
||||||
ScrCmd_checkflag: @ 806A854
|
|
||||||
push {r4,lr}
|
|
||||||
adds r4, r0, 0
|
|
||||||
bl ScriptReadHalfword
|
|
||||||
lsls r0, 16
|
|
||||||
lsrs r0, 16
|
|
||||||
bl FlagGet
|
|
||||||
strb r0, [r4, 0x2]
|
|
||||||
movs r0, 0
|
|
||||||
pop {r4}
|
|
||||||
pop {r1}
|
|
||||||
bx r1
|
|
||||||
thumb_func_end ScrCmd_checkflag
|
|
||||||
|
|
||||||
thumb_func_start ScrCmd_incrementgamestat
|
|
||||||
ScrCmd_incrementgamestat: @ 806A870
|
|
||||||
push {lr}
|
|
||||||
ldr r1, [r0, 0x8]
|
|
||||||
ldrb r2, [r1]
|
|
||||||
adds r1, 0x1
|
|
||||||
str r1, [r0, 0x8]
|
|
||||||
adds r0, r2, 0
|
|
||||||
bl IncrementGameStat
|
|
||||||
movs r0, 0
|
|
||||||
pop {r1}
|
|
||||||
bx r1
|
|
||||||
thumb_func_end ScrCmd_incrementgamestat
|
|
||||||
|
|
||||||
thumb_func_start sub_806A888
|
|
||||||
sub_806A888: @ 806A888
|
|
||||||
push {r4-r6,lr}
|
|
||||||
adds r5, r0, 0
|
|
||||||
ldr r0, [r5, 0x8]
|
|
||||||
ldrb r4, [r0]
|
|
||||||
adds r0, 0x1
|
|
||||||
str r0, [r5, 0x8]
|
|
||||||
adds r0, r5, 0
|
|
||||||
bl ScriptReadWord
|
|
||||||
adds r6, r0, 0
|
|
||||||
adds r0, r4, 0
|
|
||||||
bl GetGameStat
|
|
||||||
cmp r0, r6
|
|
||||||
bcs _0806A8AA
|
|
||||||
movs r0, 0
|
|
||||||
b _0806A8B4
|
|
||||||
_0806A8AA:
|
|
||||||
cmp r0, r6
|
|
||||||
bne _0806A8B2
|
|
||||||
movs r0, 0x1
|
|
||||||
b _0806A8B4
|
|
||||||
_0806A8B2:
|
|
||||||
movs r0, 0x2
|
|
||||||
_0806A8B4:
|
|
||||||
strb r0, [r5, 0x2]
|
|
||||||
movs r0, 0
|
|
||||||
pop {r4-r6}
|
|
||||||
pop {r1}
|
|
||||||
bx r1
|
|
||||||
thumb_func_end sub_806A888
|
|
||||||
|
|
||||||
thumb_func_start sub_806A8C0
|
|
||||||
sub_806A8C0: @ 806A8C0
|
|
||||||
push {r4,lr}
|
|
||||||
bl ScriptReadHalfword
|
|
||||||
adds r4, r0, 0
|
|
||||||
lsls r4, 16
|
|
||||||
lsrs r4, 16
|
|
||||||
adds r0, r4, 0
|
|
||||||
bl sub_8115748
|
|
||||||
adds r0, r4, 0
|
|
||||||
bl sub_80F85BC
|
|
||||||
movs r0, 0
|
|
||||||
pop {r4}
|
|
||||||
pop {r1}
|
|
||||||
bx r1
|
|
||||||
thumb_func_end sub_806A8C0
|
|
||||||
|
|
||||||
thumb_func_start ScrCmd_animateflash
|
|
||||||
ScrCmd_animateflash: @ 806A8E0
|
|
||||||
push {lr}
|
|
||||||
ldr r1, [r0, 0x8]
|
|
||||||
ldrb r2, [r1]
|
|
||||||
adds r1, 0x1
|
|
||||||
str r1, [r0, 0x8]
|
|
||||||
adds r0, r2, 0
|
|
||||||
bl sub_807F028
|
|
||||||
bl ScriptContext1_Stop
|
|
||||||
movs r0, 0x1
|
|
||||||
pop {r1}
|
|
||||||
bx r1
|
|
||||||
thumb_func_end ScrCmd_animateflash
|
|
||||||
|
|
||||||
thumb_func_start ScrCmd_setflashradius
|
|
||||||
ScrCmd_setflashradius: @ 806A8FC
|
|
||||||
push {lr}
|
|
||||||
bl ScriptReadHalfword
|
|
||||||
lsls r0, 16
|
|
||||||
lsrs r0, 16
|
|
||||||
bl VarGet
|
|
||||||
lsls r0, 16
|
|
||||||
lsrs r0, 16
|
|
||||||
bl Overworld_SetFlashLevel
|
|
||||||
movs r0, 0
|
|
||||||
pop {r1}
|
|
||||||
bx r1
|
|
||||||
thumb_func_end ScrCmd_setflashradius
|
|
||||||
|
|
||||||
thumb_func_start sub_806A918
|
|
||||||
sub_806A918: @ 806A918
|
|
||||||
push {lr}
|
|
||||||
ldr r0, _0806A92C @ =gPaletteFade
|
|
||||||
ldrb r1, [r0, 0x7]
|
|
||||||
movs r0, 0x80
|
|
||||||
ands r0, r1
|
|
||||||
cmp r0, 0
|
|
||||||
beq _0806A930
|
|
||||||
movs r0, 0
|
|
||||||
b _0806A932
|
|
||||||
.align 2, 0
|
|
||||||
_0806A92C: .4byte gPaletteFade
|
|
||||||
_0806A930:
|
|
||||||
movs r0, 0x1
|
|
||||||
_0806A932:
|
|
||||||
pop {r1}
|
|
||||||
bx r1
|
|
||||||
thumb_func_end sub_806A918
|
|
||||||
|
|
||||||
thumb_func_start ScrCmd_fadescreen
|
|
||||||
ScrCmd_fadescreen: @ 806A938
|
|
||||||
push {r4,lr}
|
|
||||||
adds r4, r0, 0
|
|
||||||
ldr r1, [r4, 0x8]
|
|
||||||
ldrb r0, [r1]
|
|
||||||
adds r1, 0x1
|
|
||||||
str r1, [r4, 0x8]
|
|
||||||
movs r1, 0
|
|
||||||
bl fade_screen
|
|
||||||
ldr r1, _0806A95C @ =sub_806A918
|
|
||||||
adds r0, r4, 0
|
|
||||||
bl SetupNativeScript
|
|
||||||
movs r0, 0x1
|
|
||||||
pop {r4}
|
|
||||||
pop {r1}
|
|
||||||
bx r1
|
|
||||||
.align 2, 0
|
|
||||||
_0806A95C: .4byte sub_806A918
|
|
||||||
thumb_func_end ScrCmd_fadescreen
|
|
||||||
|
|
||||||
thumb_func_start ScrCmd_fadescreenspeed
|
|
||||||
ScrCmd_fadescreenspeed: @ 806A960
|
|
||||||
push {r4,lr}
|
|
||||||
adds r4, r0, 0
|
|
||||||
ldr r2, [r4, 0x8]
|
|
||||||
ldrb r0, [r2]
|
|
||||||
adds r2, 0x1
|
|
||||||
str r2, [r4, 0x8]
|
|
||||||
ldrb r1, [r2]
|
|
||||||
adds r2, 0x1
|
|
||||||
str r2, [r4, 0x8]
|
|
||||||
lsls r1, 24
|
|
||||||
asrs r1, 24
|
|
||||||
bl fade_screen
|
|
||||||
ldr r1, _0806A98C @ =sub_806A918
|
|
||||||
adds r0, r4, 0
|
|
||||||
bl SetupNativeScript
|
|
||||||
movs r0, 0x1
|
|
||||||
pop {r4}
|
|
||||||
pop {r1}
|
|
||||||
bx r1
|
|
||||||
.align 2, 0
|
|
||||||
_0806A98C: .4byte sub_806A918
|
|
||||||
thumb_func_end ScrCmd_fadescreenspeed
|
|
||||||
|
|
||||||
thumb_func_start RunPauseTimer
|
thumb_func_start RunPauseTimer
|
||||||
RunPauseTimer: @ 806A990
|
RunPauseTimer: @ 806A990
|
||||||
push {lr}
|
push {lr}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
#include "global.h"
|
#include "global.h"
|
||||||
|
|
||||||
void sub_80AF79C(void);
|
void sub_80AF79C(void);
|
||||||
void sub_80B009C(u8);
|
void sub_807F028(u8);
|
||||||
void sub_80B0244(void);
|
void sub_80B0244(void);
|
||||||
|
|
||||||
#endif // GUARD_FIELD_SCREEN_EFFECT_H
|
#endif // GUARD_FIELD_SCREEN_EFFECT_H
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
#ifndef GUARD_MAP_PREVIEW_SCREEN_H
|
||||||
|
#define GUARD_MAP_PREVIEW_SCREEN_H
|
||||||
|
|
||||||
|
void sub_80F85BC(u16 a0);
|
||||||
|
|
||||||
|
#endif //GUARD_MAP_PREVIEW_SCREEN_H
|
||||||
@@ -21,5 +21,6 @@ extern struct UnkStruct_203AE98 * gUnknown_3005E94;
|
|||||||
|
|
||||||
void sub_8112720(u8);
|
void sub_8112720(u8);
|
||||||
void sub_8113550(u16, const u16 *);
|
void sub_8113550(u16, const u16 *);
|
||||||
|
void sub_8115748(u16);
|
||||||
|
|
||||||
#endif //GUARD_QUEST_LOG_H
|
#endif //GUARD_QUEST_LOG_H
|
||||||
|
|||||||
@@ -1,10 +1,16 @@
|
|||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "gba/isagbprint.h"
|
#include "gba/isagbprint.h"
|
||||||
|
#include "palette.h"
|
||||||
#include "script.h"
|
#include "script.h"
|
||||||
#include "mystery_event_script.h"
|
#include "mystery_event_script.h"
|
||||||
#include "event_data.h"
|
#include "event_data.h"
|
||||||
#include "random.h"
|
#include "random.h"
|
||||||
#include "item.h"
|
#include "item.h"
|
||||||
|
#include "overworld.h"
|
||||||
|
#include "field_screen_effect.h"
|
||||||
|
#include "quest_log.h"
|
||||||
|
#include "map_preview_screen.h"
|
||||||
|
#include "field_weather.h"
|
||||||
|
|
||||||
extern u16 (*const gSpecials[])(void);
|
extern u16 (*const gSpecials[])(void);
|
||||||
extern u16 (*const gSpecialsEnd[])(void);
|
extern u16 (*const gSpecialsEnd[])(void);
|
||||||
@@ -528,3 +534,89 @@ SCRCMD_DEF(ScrCmd_checkdecor)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SCRCMD_DEF(ScrCmd_setflag)
|
||||||
|
{
|
||||||
|
FlagSet(ScriptReadHalfword(ctx));
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
SCRCMD_DEF(ScrCmd_clearflag)
|
||||||
|
{
|
||||||
|
FlagClear(ScriptReadHalfword(ctx));
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
SCRCMD_DEF(ScrCmd_checkflag)
|
||||||
|
{
|
||||||
|
ctx->comparisonResult = FlagGet(ScriptReadHalfword(ctx));
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
SCRCMD_DEF(ScrCmd_incrementgamestat)
|
||||||
|
{
|
||||||
|
IncrementGameStat(ScriptReadByte(ctx));
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
SCRCMD_DEF(sub_806A888)
|
||||||
|
{
|
||||||
|
u8 statIdx = ScriptReadByte(ctx);
|
||||||
|
u32 value = ScriptReadWord(ctx);
|
||||||
|
u32 statValue = GetGameStat(statIdx);
|
||||||
|
|
||||||
|
if (statValue < value)
|
||||||
|
ctx ->comparisonResult = 0;
|
||||||
|
else if (statValue == value)
|
||||||
|
ctx->comparisonResult = 1;
|
||||||
|
else
|
||||||
|
ctx->comparisonResult = 2;
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
SCRCMD_DEF(sub_806A8C0)
|
||||||
|
{
|
||||||
|
u16 value = ScriptReadHalfword(ctx);
|
||||||
|
sub_8115748(value);
|
||||||
|
sub_80F85BC(value);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
SCRCMD_DEF(ScrCmd_animateflash)
|
||||||
|
{
|
||||||
|
sub_807F028(ScriptReadByte(ctx));
|
||||||
|
ScriptContext1_Stop();
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
SCRCMD_DEF(ScrCmd_setflashradius)
|
||||||
|
{
|
||||||
|
u16 flashLevel = VarGet(ScriptReadHalfword(ctx));
|
||||||
|
|
||||||
|
Overworld_SetFlashLevel(flashLevel);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool8 IsPaletteNotActive(void)
|
||||||
|
{
|
||||||
|
if (!gPaletteFade.active)
|
||||||
|
return TRUE;
|
||||||
|
else
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
SCRCMD_DEF(ScrCmd_fadescreen)
|
||||||
|
{
|
||||||
|
fade_screen(ScriptReadByte(ctx), 0);
|
||||||
|
SetupNativeScript(ctx, IsPaletteNotActive);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
SCRCMD_DEF(ScrCmd_fadescreenspeed)
|
||||||
|
{
|
||||||
|
u8 mode = ScriptReadByte(ctx);
|
||||||
|
u8 speed = ScriptReadByte(ctx);
|
||||||
|
|
||||||
|
fade_screen(mode, speed);
|
||||||
|
SetupNativeScript(ctx, IsPaletteNotActive);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user