add tiles.h

This commit is contained in:
theo3
2021-10-26 22:06:24 -07:00
parent d29468c30b
commit 6ecaea44c5
20 changed files with 69 additions and 55 deletions
+1 -3
View File
@@ -198,7 +198,6 @@ s32 fade(s32 target, s32 current) {
void doPlaySound(u32 sound) {
u32 volume;
u32 iVar2;
MusicPlayerInfo* musicPlayerInfo;
if (sound == 0)
@@ -209,8 +208,7 @@ void doPlaySound(u32 sound) {
} else {
volume = gSoundPlayingInfo.volumeSfx;
}
iVar2 = gSoundPlayingInfo.volumeMaster;
volume = iVar2 * volume / 0x100;
volume = gSoundPlayingInfo.volumeMaster * volume / 0x100;
musicPlayerInfo = gMusicPlayers[gSongTable[sound].musicPlayerIndex].info;
m4aMPlayImmInit(musicPlayerInfo);
m4aMPlayVolumeControl(musicPlayerInfo, 0xffff, volume);
+2 -2
View File
@@ -67,7 +67,7 @@ void sub_0805212C(void) {
#else
sub_08052418(0, 0);
gScreen.lcd.displayControl |= 0x600;
gFadeControl.field_0x4 = 0xffff;
gFadeControl.mask = 0x0000ffff;
DoFade(4, 0x10);
#endif
}
@@ -97,7 +97,7 @@ void sub_080521A0(void) {
gMenu.field_0x3 = 0;
sub_080A7114(1);
sub_08052418(0, 0);
gFadeControl.field_0x4 = 0xffffffff;
gFadeControl.mask = 0xffffffff;
break;
case 1:
if (gMenu.transitionTimer == 0) {
+2 -2
View File
@@ -285,7 +285,7 @@ static void HandleJapaneseTitlescreenAnimationIntro(void) {
gIntroState.subState++;
gScreen.bg.bg1yOffset = 0;
gScreen.bg.bg1Control = 0xc09;
gFadeControl.field_0x4 = 0x40;
gFadeControl.mask = 0x00000040;
DoFade(6, 0x10);
SoundReq(SFX_F8);
}
@@ -293,7 +293,7 @@ static void HandleJapaneseTitlescreenAnimationIntro(void) {
break;
case 1:
if (!gFadeControl.active) {
gFadeControl.field_0x4 = -1;
gFadeControl.mask = 0xFFFFFFFF;
gIntroState.subState++;
#if defined(JP) || defined(EU)
gIntroState.timer = 120;
+1 -1
View File
@@ -81,7 +81,7 @@ void AgbMain(void) {
gMain.ticks++;
sScreenHandlers[gMain.screen]();
MessageUpdate();
sub_08050154();
UpdateFade();
SoundLoop();
break;
}
+2 -1
View File
@@ -9,6 +9,7 @@
#include "textbox.h"
#include "script.h"
#include "utils.h"
#include "tiles.h"
void sub_08058ECC(ManagerF*);
@@ -335,7 +336,7 @@ void sub_0805930C(ManagerF* this) {
}
void SetDirtTile(u32 tile) {
SetTileType(0x1d, tile, 1);
SetTileType(CUT_GRASS, tile, 1);
SetTileType(0, tile, 2);
SetTileType(0, tile - 0x40, 2);
}
+4 -4
View File
@@ -75,7 +75,7 @@ void ScriptCommand_WaitForPlayerAction0x17(Entity* entity, ScriptExecutionContex
void ScriptCommand_WaitFor_1(Entity* entity, ScriptExecutionContext* context);
void ScriptCommand_WaitFor_2(Entity* entity, ScriptExecutionContext* context);
void ScriptCommand_0807E778(Entity* entity, ScriptExecutionContext* context);
void ScriptCommand_0807E788(Entity* entity, ScriptExecutionContext* context);
void ScriptCommand_SetFadeMask(Entity* entity, ScriptExecutionContext* context);
void ScriptCommand_0807E79C(Entity* entity, ScriptExecutionContext* context);
void ScriptCommandNop2(Entity* entity, ScriptExecutionContext* context);
void ScriptCommand_DoFade4(Entity* entity, ScriptExecutionContext* context);
@@ -220,7 +220,7 @@ const ScriptCommand gScriptCommands[] = { ScriptCommandNop,
ScriptCommand_WaitFor_1,
ScriptCommand_WaitFor_2,
ScriptCommand_0807E778,
ScriptCommand_0807E788,
ScriptCommand_SetFadeMask,
ScriptCommand_0807E79C,
ScriptCommandNop2,
ScriptCommand_DoFade4,
@@ -1005,8 +1005,8 @@ void ScriptCommand_0807E778(Entity* entity, ScriptExecutionContext* context) {
gActiveScriptInfo.unk_08 = context->scriptInstructionPointer[1];
}
void ScriptCommand_0807E788(Entity* entity, ScriptExecutionContext* context) {
gFadeControl.field_0x4 = GetNextScriptCommandWordAfterCommandMetadata(context->scriptInstructionPointer);
void ScriptCommand_SetFadeMask(Entity* entity, ScriptExecutionContext* context) {
gFadeControl.mask = GetNextScriptCommandWordAfterCommandMetadata(context->scriptInstructionPointer);
}
void ScriptCommand_0807E79C(Entity* entity, ScriptExecutionContext* context) {
+1 -1
View File
@@ -6,5 +6,5 @@ extern u32 gUnk_020354C0;
void sub_08050008() {
MemClear(&gUnk_020354C0, 128);
gFadeControl.field_0x4 = -1;
gFadeControl.mask = 0xFFFFFFFF;
}
+1 -1
View File
@@ -9,7 +9,7 @@ Entity* sub_0805E374(Entity* param_1) {
u8 r3 = gScreenTransition.field_0x24[8];
u8* array = gUnk_081091F8;
if (r3 != '\x02') {
if (r3 != 2) {
array = gUnk_081091EE;
}
return sub_0805E3A0(param_1, array[param_1->kind]);
+23 -23
View File
@@ -9,46 +9,46 @@ void sub_0807B7D8(u32 param_1, u32 param_2, u32 param_3) {
sub_08000152(53);
sub_0807B778(param_2, param_3);
sub_0807B778(param_2 + 1, param_3);
sub_0807B778(param_2 + -1, param_3);
sub_0807B778(param_2 - 1, param_3);
sub_0807B778(param_2 + 64, param_3);
sub_0807B778(param_2 + -64, param_3);
sub_0807B778(param_2 - 64, param_3);
} else {
SetTileType(param_1, param_2, param_3);
}
}
void sub_0807B820(u32 param_1) {
SetTileType(620, param_1 + -65, 1);
SetTileType(627, param_1 + -65, 2);
SetTileType(621, param_1 + -64, 1);
SetTileType(628, param_1 + -64, 2);
SetTileType(622, param_1 + -63, 1);
SetTileType(629, param_1 + -63, 2);
SetTileType(623, param_1 + -1, 1);
SetTileType(620, param_1 - 65, 1);
SetTileType(627, param_1 - 65, 2);
SetTileType(621, param_1 - 64, 1);
SetTileType(628, param_1 - 64, 2);
SetTileType(622, param_1 - 63, 1);
SetTileType(629, param_1 - 63, 2);
SetTileType(623, param_1 - 1, 1);
SetTileType(624, param_1, 1);
SetTileType(626, param_1 + 1, 1);
}
void sub_0807B8A8(u32 param_1) {
SetTileType(636, param_1 + -65, 1);
SetTileType(643, param_1 + -65, 2);
SetTileType(637, param_1 + -64, 1);
SetTileType(644, param_1 + -64, 2);
SetTileType(638, param_1 + -63, 1);
SetTileType(645, param_1 + -63, 2);
SetTileType(639, param_1 + -1, 1);
SetTileType(636, param_1 - 65, 1);
SetTileType(643, param_1 - 65, 2);
SetTileType(637, param_1 - 64, 1);
SetTileType(644, param_1 - 64, 2);
SetTileType(638, param_1 - 63, 1);
SetTileType(645, param_1 - 63, 2);
SetTileType(639, param_1 - 1, 1);
SetTileType(640, param_1, 1);
SetTileType(642, param_1 + 1, 1);
}
void sub_0807B930(int param_1) {
SetTileType(652, param_1 + -65, 1);
SetTileType(659, param_1 + -65, 2);
SetTileType(653, param_1 + -64, 1);
SetTileType(660, param_1 + -64, 2);
SetTileType(654, param_1 + -63, 1);
SetTileType(661, param_1 + -63, 2);
SetTileType(655, param_1 + -1, 1);
SetTileType(652, param_1 - 65, 1);
SetTileType(659, param_1 - 65, 2);
SetTileType(653, param_1 - 64, 1);
SetTileType(660, param_1 - 64, 2);
SetTileType(654, param_1 - 63, 1);
SetTileType(661, param_1 - 63, 2);
SetTileType(655, param_1 - 1, 1);
SetTileType(656, param_1, 1);
SetTileType(658, param_1 + 1, 1);
}
+1 -1
View File
@@ -11,7 +11,7 @@ u32 sub_080A554C(u32 arg0) {
if (arg0 != 0) {
for (i = 0; i < 17; i++) {
if (arg0 == (&gUnk_02000090)[i])
if (arg0 == gMenu.focusCoords[i])
return i;
}
}
-3
View File
@@ -3,8 +3,5 @@
extern u8 gUnk_08127D30[69];
u32 sub_08052654(u32 r0) {
// u32 r1 = gUnk_08127D30;
// u32 r1 = gUnk_08127D30;
return gUnk_08127D30[r0 * 4] == 129;
}