mirror of
https://github.com/zeldaret/tmc
synced 2026-07-08 22:44:46 -04:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
Executable
+43
@@ -0,0 +1,43 @@
|
||||
#include "global.h"
|
||||
|
||||
extern void LoadPalettes(const u8*, int, int);
|
||||
|
||||
extern u32 gUsedPalettes;
|
||||
extern u16 gPaletteBuffer[];
|
||||
|
||||
typedef struct {
|
||||
u16 paletteId;
|
||||
u8 destPaletteNum;
|
||||
u8 numPalettes;
|
||||
} PaletteGroup;
|
||||
|
||||
extern const PaletteGroup* gPaletteGroups[];
|
||||
extern const u8 gGlobalGfxAndPalettes[];
|
||||
|
||||
void LoadPaletteGroup(u32 group) {
|
||||
const PaletteGroup* paletteGroup = gPaletteGroups[group];
|
||||
while (1) {
|
||||
u32 destPaletteNum = paletteGroup->destPaletteNum;
|
||||
u32 numPalettes = paletteGroup->numPalettes & 0xF;
|
||||
if (numPalettes == 0) {
|
||||
numPalettes = 16;
|
||||
}
|
||||
LoadPalettes(&gGlobalGfxAndPalettes[paletteGroup->paletteId * 32], destPaletteNum, numPalettes);
|
||||
if ((paletteGroup->numPalettes & 0x80) == 0) {
|
||||
break;
|
||||
}
|
||||
paletteGroup++;
|
||||
}
|
||||
}
|
||||
|
||||
void LoadPalettes(const u8* src, int destPaletteNum, int numPalettes) {
|
||||
u16* dest;
|
||||
u32 size = numPalettes * 32;
|
||||
u32 usedPalettesMask = 1 << destPaletteNum;
|
||||
while (--numPalettes > 0) {
|
||||
usedPalettesMask |= (usedPalettesMask << 1);
|
||||
}
|
||||
gUsedPalettes |= usedPalettesMask;
|
||||
dest = &gPaletteBuffer[destPaletteNum * 16];
|
||||
DmaCopy32(3, src, dest, size);
|
||||
}
|
||||
Executable
+96
@@ -0,0 +1,96 @@
|
||||
#include "global.h"
|
||||
#include "screen.h"
|
||||
#include "structures.h"
|
||||
|
||||
extern u16 gPaletteBuffer[];
|
||||
extern u32 gUsedPalettes;
|
||||
|
||||
typedef struct {
|
||||
union {
|
||||
int raw;
|
||||
struct {
|
||||
u8 filler0[0x3];
|
||||
u8 unk3;
|
||||
} bytes;
|
||||
} unk0;
|
||||
u32 dest;
|
||||
u32 unk8;
|
||||
} GfxItem;
|
||||
|
||||
extern const GfxItem* gUnk_08100AA8[];
|
||||
extern const u8 gGlobalGfxAndPalettes[];
|
||||
|
||||
void sub_0801D79C(u32 colorIndex, u32 color) {
|
||||
gPaletteBuffer[colorIndex] = color;
|
||||
gUsedPalettes |= 1 << (colorIndex / 16);
|
||||
}
|
||||
|
||||
void sub_0801D7BC(u32 color, u32 arg1) {
|
||||
if (arg1) {
|
||||
gScreen.lcd.unk6 = 0xE0FF;
|
||||
} else {
|
||||
gScreen.lcd.unk6 = 0xFFFF;
|
||||
}
|
||||
sub_0801D79C(0, color);
|
||||
}
|
||||
|
||||
void LoadGfxGroup(u32 group) {
|
||||
u32 terminator;
|
||||
u32 dmaCtrl;
|
||||
int gfxOffset;
|
||||
const u8* src;
|
||||
u32 dest;
|
||||
int size;
|
||||
const GfxItem* gfxItem = gUnk_08100AA8[group];
|
||||
while (1) {
|
||||
u32 loadGfx = FALSE;
|
||||
u32 ctrl = gfxItem->unk0.bytes.unk3;
|
||||
ctrl &= 0xF;
|
||||
switch (ctrl) {
|
||||
case 0x7:
|
||||
loadGfx = TRUE;
|
||||
break;
|
||||
case 0xD:
|
||||
return;
|
||||
case 0xE:
|
||||
if (((struct_02000000 *)0x2000000)->gameLanguage > 1) {
|
||||
loadGfx = TRUE;
|
||||
}
|
||||
break;
|
||||
case 0xF:
|
||||
if (((struct_02000000 *)0x2000000)->gameLanguage != 0) {
|
||||
loadGfx = TRUE;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (ctrl == ((struct_02000000 *)0x2000000)->gameLanguage) {
|
||||
loadGfx = TRUE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (loadGfx) {
|
||||
gfxOffset = gfxItem->unk0.raw & 0xFFFFFF;
|
||||
src = &gGlobalGfxAndPalettes[gfxOffset];
|
||||
dest = gfxItem->dest;
|
||||
size = gfxItem->unk8;
|
||||
dmaCtrl = 0x80000000;
|
||||
if (size < 0) {
|
||||
if (dest >= VRAM) {
|
||||
LZ77UnCompVram(src, (void*)dest);
|
||||
} else {
|
||||
LZ77UnCompWram(src, (void*)dest);
|
||||
}
|
||||
} else {
|
||||
DmaSet(3, src, dest, dmaCtrl | ((u32)size >> 1));
|
||||
}
|
||||
}
|
||||
|
||||
terminator = gfxItem->unk0.bytes.unk3;
|
||||
terminator &= 0x80;
|
||||
gfxItem++;
|
||||
if (!terminator) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
+3
-4
@@ -17,7 +17,6 @@ extern void (*const gUnk_080D412C[])();
|
||||
|
||||
|
||||
extern struct_02018EB0 gUnk_02018EB0;
|
||||
extern u8 gUnk_03000FD0;
|
||||
|
||||
u32 sub_0804AA84(void)
|
||||
{
|
||||
@@ -62,12 +61,12 @@ void sub_0804AB04(void)
|
||||
|
||||
void sub_0804AB24(void)
|
||||
{
|
||||
if (gUnk_03000FD0 == 0) {
|
||||
gScreen.lcd.lcdControl2 = 0;
|
||||
if (!gFadeControl.active) {
|
||||
gScreen.lcd.displayControl = 0;
|
||||
sub_0801E104();
|
||||
gArea.filler[8] = 0;
|
||||
MenuFadeIn(6, 0);
|
||||
gUnk_03000FD0 = 0;
|
||||
gFadeControl.active = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+367
@@ -0,0 +1,367 @@
|
||||
#include "global.h"
|
||||
#include "menu.h"
|
||||
#include "main.h"
|
||||
#include "entity.h"
|
||||
#include "functions.h"
|
||||
#include "readKeyInput.h"
|
||||
#include "screen.h"
|
||||
#include "structures.h"
|
||||
|
||||
typedef struct {
|
||||
u8 filler0[0x4];
|
||||
u8 gameLanguage;
|
||||
u8 state;
|
||||
u8 subState;
|
||||
u8 filler7[0x1];
|
||||
u16 timer;
|
||||
u8 fillerA[0x6];
|
||||
u8 lightRaysPaletteGroup;
|
||||
u8 lightRaysAlphaBlendIndex;
|
||||
u8 counter;
|
||||
u8 filler13[0x19];
|
||||
int swordBgScaleRatio;
|
||||
} IntroState;
|
||||
|
||||
extern IntroState gIntroState;
|
||||
|
||||
enum {
|
||||
ADVANCE_NONE,
|
||||
ADVANCE_TIMER_EXPIRED,
|
||||
ADVANCE_KEY_PRESSED,
|
||||
};
|
||||
|
||||
static void HandleNintendoCapcomLogos(void);
|
||||
static void HandleTitlescreen(void);
|
||||
static void UpdateSwordBgAffineData(void);
|
||||
static void ExitTitlescreen(void);
|
||||
static void HandleJapaneseTitlescreenAnimationIntro(void);
|
||||
static void HandleTitlescreenAnimationIntro(void);
|
||||
static u32 GetAdvanceState(void);
|
||||
static void UpdateLightRays(void);
|
||||
static void UpdatePressStartIcon(void);
|
||||
|
||||
static void (*const sIntroSequenceHandlers[])(void) = {
|
||||
HandleNintendoCapcomLogos,
|
||||
HandleTitlescreen,
|
||||
ExitTitlescreen,
|
||||
};
|
||||
|
||||
static const u16 sLightRaysAlphaBlends[] = {
|
||||
BLDALPHA_BLEND(9, 9),
|
||||
BLDALPHA_BLEND(8, 10),
|
||||
BLDALPHA_BLEND(7, 11),
|
||||
BLDALPHA_BLEND(6, 12),
|
||||
BLDALPHA_BLEND(5, 13),
|
||||
BLDALPHA_BLEND(6, 12),
|
||||
BLDALPHA_BLEND(7, 11),
|
||||
BLDALPHA_BLEND(8, 10),
|
||||
};
|
||||
|
||||
static u32 AdvanceIntroSequence(u32 transition)
|
||||
{
|
||||
gUnk_02032EC0.transitionType = transition;
|
||||
gUnk_03001000.funcIndex = 2;
|
||||
_DmaZero(&gIntroState, sizeof(gIntroState));
|
||||
DoFade(7, 8);
|
||||
}
|
||||
|
||||
void HandleIntroScreen(void)
|
||||
{
|
||||
sub_080AD90C();
|
||||
switch (gUnk_03001000.funcIndex) {
|
||||
case 0:
|
||||
sub_08056418();
|
||||
_DmaZero(&gUnk_02032EC0, 0x3b4);
|
||||
AdvanceIntroSequence(0);
|
||||
break;
|
||||
case 1:
|
||||
sIntroSequenceHandlers[gUnk_02032EC0.transitionType]();
|
||||
break;
|
||||
case 2:
|
||||
if (gFadeControl.active) {
|
||||
return;
|
||||
}
|
||||
sub_0801DA90(1);
|
||||
gUnk_03001000.funcIndex = 1;
|
||||
break;
|
||||
}
|
||||
sub_080AD918();
|
||||
}
|
||||
|
||||
static void HandleNintendoCapcomLogos(void)
|
||||
{
|
||||
u32 advance;
|
||||
u32 paletteGroup;
|
||||
|
||||
advance = GetAdvanceState();
|
||||
if (gIntroState.state == 0) {
|
||||
sub_0801DA90(1);
|
||||
gIntroState.state = 1;
|
||||
gIntroState.timer = 120;
|
||||
LoadGfxGroup(16);
|
||||
LoadGfxGroup(1);
|
||||
if (((struct_02000000 *)0x2000000)->gameLanguage == 0) {
|
||||
paletteGroup = 1;
|
||||
}
|
||||
else {
|
||||
paletteGroup = 2;
|
||||
}
|
||||
LoadPaletteGroup(paletteGroup);
|
||||
gScreen.lcd.displayControl |= 0x400;
|
||||
gScreen.bg.bg2yOffset = 1;
|
||||
DoFade(6, 8);
|
||||
advance = ADVANCE_NONE;
|
||||
} else {
|
||||
if (advance == ADVANCE_TIMER_EXPIRED) {
|
||||
advance = ADVANCE_KEY_PRESSED;
|
||||
}
|
||||
}
|
||||
|
||||
if (advance == ADVANCE_KEY_PRESSED) {
|
||||
gUnk_02000010.listenForKeyPresses = 1;
|
||||
AdvanceIntroSequence(1);
|
||||
}
|
||||
}
|
||||
|
||||
extern u16 gUnk_03001010[5];
|
||||
|
||||
extern u8 gUnk_02024490;
|
||||
|
||||
static void HandleTitlescreen(void)
|
||||
{
|
||||
int advance;
|
||||
u32 paletteGroup;
|
||||
|
||||
gIntroState.counter++;
|
||||
switch (gIntroState.state) {
|
||||
case 0:
|
||||
gIntroState.state = 1;
|
||||
gIntroState.subState = 0;
|
||||
gIntroState.timer = 30;
|
||||
gIntroState.gameLanguage = 7;
|
||||
EraseAllEntities();
|
||||
sub_0801CFA8(0);
|
||||
sub_080ADD30();
|
||||
gUnk_02024490 = 1;
|
||||
LoadGfxGroup(2);
|
||||
if (((struct_02000000*)0x2000000)->gameLanguage == 0) {
|
||||
paletteGroup = 3;
|
||||
}
|
||||
else {
|
||||
paletteGroup = 4;
|
||||
}
|
||||
LoadPaletteGroup(paletteGroup);
|
||||
if (((struct_02000000*)0x2000000)->gameLanguage == 0) {
|
||||
gScreen.controls.layerFXControl = 0x844;
|
||||
gScreen.controls.alphaBlend = BLDALPHA_BLEND(9, 9);
|
||||
gScreen.bg.bg1xOffset = 0x1c09;
|
||||
gScreen.affine.bg2Control = 0x1d02;
|
||||
gScreen.affine.bg3Control = 0x1e03;
|
||||
gScreen.lcd.displayControl |= 0x1e00;
|
||||
gScreen.bg.bg2xOffset = 0xff60;
|
||||
}
|
||||
else {
|
||||
gScreen.controls.layerFXControl = 0x241;
|
||||
gScreen.controls.alphaBlend = BLDALPHA_BLEND(9, 9);
|
||||
gScreen.bg.bg0Control = 0x1d02;
|
||||
gScreen.bg.bg1xOffset = 0x1E03;
|
||||
gScreen.affine.bg2Control = 0x7C89;
|
||||
gScreen.lcd.displayControl |= 1;
|
||||
gScreen.lcd.displayControl |= 0x1300;
|
||||
gIntroState.swordBgScaleRatio = 0x10;
|
||||
UpdateSwordBgAffineData();
|
||||
}
|
||||
sub_080A3210();
|
||||
PlaySFX(3); //fanfare
|
||||
DoFade(6, 8);
|
||||
break;
|
||||
case 1:
|
||||
if (gFadeControl.active) {
|
||||
return;
|
||||
}
|
||||
if (((struct_02000000*)0x2000000)->gameLanguage == 0) {
|
||||
HandleJapaneseTitlescreenAnimationIntro();
|
||||
}
|
||||
else {
|
||||
HandleTitlescreenAnimationIntro();
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (--gIntroState.timer == 0) {
|
||||
gIntroState.timer = 3600;
|
||||
gIntroState.state++;
|
||||
}
|
||||
UpdatePressStartIcon();
|
||||
break;
|
||||
default:
|
||||
advance = GetAdvanceState();
|
||||
if (advance != ADVANCE_NONE) {
|
||||
if (advance == ADVANCE_KEY_PRESSED) {
|
||||
PlaySFX(0x6a);
|
||||
}
|
||||
else {
|
||||
advance = ADVANCE_NONE;
|
||||
}
|
||||
AdvanceIntroSequence(advance);
|
||||
PlaySFX(0x80080000);
|
||||
}
|
||||
UpdatePressStartIcon();
|
||||
if ((gIntroState.timer & 0x20) == 0) {
|
||||
gUnk_03001010[4] = 0xe000;
|
||||
gUnk_03001010[1] = 0x84;
|
||||
sub_080ADA14(0x1ff,0);
|
||||
}
|
||||
}
|
||||
if (gIntroState.gameLanguage != ((struct_02000000*)0x2000000)->gameLanguage) {
|
||||
gIntroState.gameLanguage = ((struct_02000000*)0x2000000)->gameLanguage;
|
||||
LoadGfxGroup(3);
|
||||
}
|
||||
UpdateLightRays();
|
||||
sub_0805E5C0();
|
||||
sub_080AD9B0();
|
||||
}
|
||||
|
||||
static void UpdatePressStartIcon(void) {
|
||||
gUnk_03001010[2] = 0;
|
||||
gUnk_03001010[3] = 0;
|
||||
gUnk_03001010[4] = 0xE020;
|
||||
gUnk_03001010[0] = 120;
|
||||
gUnk_03001010[1] = 152;
|
||||
sub_080ADA14(511, 1);
|
||||
return;
|
||||
}
|
||||
|
||||
static void UpdateSwordBgAffineData(void)
|
||||
{
|
||||
struct BgAffineSrcData aff;
|
||||
aff.texY = 0x8000;
|
||||
aff.texX = 0x8000;
|
||||
aff.scrX = 0x78;
|
||||
aff.scrY = 0x48;
|
||||
aff.alpha = 0;
|
||||
aff.sy = aff.sx = gIntroState.swordBgScaleRatio;
|
||||
BgAffineSet(&aff, (struct BgAffineDstData*)&gBgControls, 1);
|
||||
}
|
||||
|
||||
static void HandleJapaneseTitlescreenAnimationIntro(void)
|
||||
{
|
||||
Entity *pEVar2;
|
||||
|
||||
switch (gIntroState.subState) {
|
||||
case 0:
|
||||
if (!gFadeControl.active) {
|
||||
if ((gIntroState.counter & 1) == 0) {
|
||||
gScreen.bg.bg2xOffset++;
|
||||
}
|
||||
|
||||
if (GetAdvanceState() == ADVANCE_KEY_PRESSED || gScreen.bg.bg2xOffset == 0) {
|
||||
gIntroState.subState++;
|
||||
gScreen.bg.bg2xOffset = 0;
|
||||
gScreen.bg.bg1xOffset = 0xc09;
|
||||
gFadeControl.field_0x4 = 0x40;
|
||||
DoFade(6, 0x10);
|
||||
PlaySFX(0xf8);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (!gFadeControl.active) {
|
||||
gFadeControl.field_0x4 = -1;
|
||||
gIntroState.subState++;
|
||||
gIntroState.timer = 90;
|
||||
pEVar2 = CreateObject(0xb4,0,0);
|
||||
if (pEVar2 != NULL) {
|
||||
pEVar2->x.HALF.HI = 0;
|
||||
pEVar2->y.HALF.HI = 0x48;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (GetAdvanceState() != ADVANCE_NONE) {
|
||||
gIntroState.state++;
|
||||
gIntroState.timer = 60;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void HandleTitlescreenAnimationIntro(void) {
|
||||
switch (gIntroState.subState) {
|
||||
case 0:
|
||||
if (!gFadeControl.active) {
|
||||
gIntroState.subState = 1;
|
||||
gScreen.lcd.displayControl |= 0x400;
|
||||
PlaySFX(0xF6);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
gIntroState.swordBgScaleRatio += 0x10;
|
||||
if (gIntroState.swordBgScaleRatio > 0x100) {
|
||||
gIntroState.swordBgScaleRatio = 0x100;
|
||||
gIntroState.timer = 40;
|
||||
gIntroState.subState++;
|
||||
DoFade(6, 16);
|
||||
}
|
||||
UpdateSwordBgAffineData();
|
||||
break;
|
||||
case 2:
|
||||
if (--gIntroState.timer == 0) {
|
||||
gIntroState.timer = 300;
|
||||
gIntroState.subState++;
|
||||
CreateObject(0xBD, 0, 0);
|
||||
DoFade(6, 16);
|
||||
PlaySFX(0xF8);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (!gFadeControl.active && GetAdvanceState() != ADVANCE_NONE) {
|
||||
gIntroState.state++;
|
||||
gIntroState.timer = 60;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void ExitTitlescreen(void) {
|
||||
if (!gFadeControl.active) {
|
||||
InitScreen(SCREEN_CHOOSE_FILE);
|
||||
}
|
||||
}
|
||||
|
||||
static u32 GetAdvanceState(void) {
|
||||
u32 newKeys;
|
||||
|
||||
if (gFadeControl.active) {
|
||||
return ADVANCE_NONE;
|
||||
}
|
||||
|
||||
if (!gUnk_02000010.listenForKeyPresses) {
|
||||
newKeys = 0;
|
||||
} else {
|
||||
newKeys = gUnk_03000FF0.newKeys & (A_BUTTON | START_BUTTON);
|
||||
}
|
||||
|
||||
if (--gIntroState.timer == 0) {
|
||||
return ADVANCE_TIMER_EXPIRED;
|
||||
}
|
||||
|
||||
if (newKeys) {
|
||||
return ADVANCE_KEY_PRESSED;
|
||||
}
|
||||
|
||||
return ADVANCE_NONE;
|
||||
}
|
||||
|
||||
static void UpdateLightRays(void) {
|
||||
// Periodically rotate the palette to give a shimmeriming effect.
|
||||
if ((gIntroState.counter & 0x7) == 0) {
|
||||
gIntroState.lightRaysPaletteGroup++;
|
||||
gIntroState.lightRaysPaletteGroup &= 0x3;
|
||||
LoadPaletteGroup(5 + gIntroState.lightRaysPaletteGroup);
|
||||
}
|
||||
|
||||
// Periodiccally update the transparency of the light rays.
|
||||
if ((gIntroState.counter & 0x1F) == 0) {
|
||||
gIntroState.lightRaysAlphaBlendIndex = (gIntroState.lightRaysAlphaBlendIndex + 1) & 0x7;
|
||||
gScreen.controls.alphaBlend = sLightRaysAlphaBlends[gIntroState.lightRaysAlphaBlendIndex];
|
||||
}
|
||||
}
|
||||
@@ -1,252 +0,0 @@
|
||||
#include "global.h"
|
||||
#include "menu.h"
|
||||
#include "main.h"
|
||||
#include "entity.h"
|
||||
#include "functions.h"
|
||||
#include "screen.h"
|
||||
#include "structures.h"
|
||||
|
||||
extern void (*const gUnk_081320F0[])();
|
||||
|
||||
typedef struct {
|
||||
u8 field_0x0;
|
||||
u8 field_0x1;
|
||||
u8 field_0x2;
|
||||
u8 field_0x3;
|
||||
u32 field_0x4;
|
||||
} struct_03000FD0;
|
||||
|
||||
extern struct_03000FD0 gUnk_03000FD0;
|
||||
|
||||
u32 IntroSetTransition(u32 transition)
|
||||
{
|
||||
gUnk_02032EC0.transitionType = transition;
|
||||
gUnk_03001000.funcIndex = 2;
|
||||
_DmaZero((u32 *)&gMenu, 48);
|
||||
DoFade(7, 8);
|
||||
}
|
||||
|
||||
void sub_080AD380()
|
||||
{
|
||||
sub_080AD90C();
|
||||
switch (gUnk_03001000.funcIndex) {
|
||||
case 0:
|
||||
sub_08056418();
|
||||
_DmaZero(&gUnk_02032EC0, 0x3b4);
|
||||
IntroSetTransition(0);
|
||||
break;
|
||||
case 1:
|
||||
gUnk_081320F0[gUnk_02032EC0.transitionType]();
|
||||
break;
|
||||
case 2:
|
||||
if (gUnk_03000FD0.field_0x0 != 0) {
|
||||
return;
|
||||
}
|
||||
sub_0801DA90(1);
|
||||
gUnk_03001000.funcIndex = 1;
|
||||
break;
|
||||
}
|
||||
sub_080AD918();
|
||||
}
|
||||
|
||||
void sub_080AD3F4(void)
|
||||
{
|
||||
u32 iVar1;
|
||||
u32 uVar2;
|
||||
|
||||
iVar1 = sub_080AD84C();
|
||||
if (gMenu.menuType == 0) {
|
||||
sub_0801DA90(1);
|
||||
gMenu.menuType = 1;
|
||||
gMenu.transitionTimer = 0x78;
|
||||
sub_0801D7EC(0x10);
|
||||
sub_0801D7EC(1);
|
||||
if (((struct_02000000 *)0x2000000)->gameLanguage == 0) {
|
||||
uVar2 = 1;
|
||||
}
|
||||
else {
|
||||
uVar2 = 2;
|
||||
}
|
||||
LoadPalettesByPaletteGroupIndex(uVar2);
|
||||
gScreen.lcd.lcdControl2 |= 0x400;
|
||||
gScreen.bg2.bg0xOffset = 1;
|
||||
DoFade(6, 8);
|
||||
iVar1 = 0;
|
||||
}
|
||||
else {
|
||||
if (iVar1 == 1) {
|
||||
iVar1 = 2;
|
||||
}
|
||||
}
|
||||
if (iVar1 == 2) {
|
||||
gUnk_02000010.field_0x5 = 1;
|
||||
IntroSetTransition(1);
|
||||
}
|
||||
}
|
||||
|
||||
// typedef struct {
|
||||
// u16 field_0x0[5];
|
||||
// } struct_03001010;
|
||||
|
||||
extern u16 gUnk_03001010[5];
|
||||
|
||||
extern u8 gUnk_02024490;
|
||||
|
||||
void sub_080AD474(void)
|
||||
{
|
||||
int iVar2;
|
||||
u32 uVar3;
|
||||
|
||||
gMenu.field_0x12++;
|
||||
switch (gMenu.menuType) {
|
||||
case 0:
|
||||
gMenu.menuType = 1;
|
||||
gMenu.overlayType = 0;
|
||||
gMenu.transitionTimer = 0x1e;
|
||||
gMenu.field_0x4 = 7;
|
||||
EraseAllEntities();
|
||||
sub_0801CFA8(0);
|
||||
sub_080ADD30();
|
||||
gUnk_02024490 = 1;
|
||||
sub_0801D7EC(2);
|
||||
if (((struct_02000000*)0x2000000)->gameLanguage == 0) {
|
||||
uVar3 = 3;
|
||||
}
|
||||
else {
|
||||
uVar3 = 4;
|
||||
}
|
||||
LoadPalettesByPaletteGroupIndex(uVar3);
|
||||
if (((struct_02000000*)0x2000000)->gameLanguage == 0) {
|
||||
gScreen.controls.windowOutsideControl = 0x844;
|
||||
gScreen.controls.mosaicSize = 0x909;
|
||||
gScreen.bg1.unk = 0x1c09;
|
||||
gScreen.bg2.unk = 0x1d02;
|
||||
gScreen.affine.unk2 = 0x1e03;
|
||||
gScreen.lcd.lcdControl2 |= 0x1e00;
|
||||
gScreen.bg2.bg0Control = 0xff60;
|
||||
}
|
||||
else {
|
||||
gScreen.controls.windowOutsideControl = 0x241;
|
||||
gScreen.controls.mosaicSize = 0x909;
|
||||
gScreen.lcd.lcdControl1 = 0x1d02;
|
||||
gScreen.bg1.unk = 0x1E03;
|
||||
gScreen.bg2.unk = 0x7C89;
|
||||
gScreen.lcd.lcdControl2 |= 1;
|
||||
gScreen.lcd.lcdControl2 |= 0x1300;
|
||||
gMenu.field_0x2c = 0x10;
|
||||
sub_080AD670();
|
||||
}
|
||||
sub_080A3210();
|
||||
PlaySFX(3); //fanfare
|
||||
DoFade(6, 8);
|
||||
break;
|
||||
case 1:
|
||||
if (gUnk_03000FD0.field_0x0 != 0) {
|
||||
return;
|
||||
}
|
||||
if (((struct_02000000*)0x2000000)->gameLanguage == 0) {
|
||||
sub_080AD6AC();
|
||||
}
|
||||
else {
|
||||
sub_080AD76C();
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
gMenu.transitionTimer--;
|
||||
if (gMenu.transitionTimer == 0) {
|
||||
gMenu.transitionTimer = 0xe10;
|
||||
gMenu.menuType++;
|
||||
}
|
||||
sub_080AD644();
|
||||
break;
|
||||
default:
|
||||
iVar2 = sub_080AD84C();
|
||||
if (iVar2 != 0) {
|
||||
if (iVar2 == 2) {
|
||||
PlaySFX(0x6a);
|
||||
}
|
||||
else {
|
||||
iVar2 = 0;
|
||||
}
|
||||
IntroSetTransition(iVar2);
|
||||
PlaySFX(0x80080000);
|
||||
}
|
||||
sub_080AD644();
|
||||
if ((gMenu.transitionTimer & 0x20) == 0) {
|
||||
gUnk_03001010[4] = 0xe000;
|
||||
gUnk_03001010[1] = 0x84;
|
||||
sub_080ADA14(0x1ff,0);
|
||||
}
|
||||
}
|
||||
if (gMenu.field_0x4 != ((struct_02000000*)0x2000000)->gameLanguage) {
|
||||
gMenu.field_0x4 = ((struct_02000000*)0x2000000)->gameLanguage;
|
||||
sub_0801D7EC(3);
|
||||
}
|
||||
sub_080AD89C();
|
||||
sub_0805E5C0();
|
||||
sub_080AD9B0();
|
||||
}
|
||||
|
||||
void sub_080AD644(void) {
|
||||
|
||||
gUnk_03001010[2] = 0;
|
||||
gUnk_03001010[3] = 0;
|
||||
gUnk_03001010[4] = 57376;
|
||||
gUnk_03001010[0] = 120;
|
||||
gUnk_03001010[1] = 152;
|
||||
sub_080ADA14(511, 1);
|
||||
return;
|
||||
}
|
||||
|
||||
void sub_080AD670(void)
|
||||
{
|
||||
struct BgAffineSrcData aff;
|
||||
aff.texY = 0x8000;
|
||||
aff.texX = 0x8000;
|
||||
aff.scrX = 0x78;
|
||||
aff.scrY = 0x48;
|
||||
aff.alpha = 0;
|
||||
aff.sy = aff.sx = gMenu.field_0x2c;
|
||||
BgAffineSet(&aff, (struct BgAffineDstData*)&gBgControls, 1);
|
||||
}
|
||||
|
||||
void sub_080AD6AC(void)
|
||||
{
|
||||
Entity *pEVar2;
|
||||
|
||||
switch (gMenu.overlayType) {
|
||||
case 0:
|
||||
if (gUnk_03000FD0.field_0x0 == 0) {
|
||||
if ((gMenu.field_0x12 & 1) == 0) {
|
||||
gScreen.bg2.bg0Control++;
|
||||
}
|
||||
|
||||
if ((sub_080AD84C() == 2) || (gScreen.bg2.bg0Control == 0)) {
|
||||
gMenu.overlayType++;
|
||||
gScreen.bg2.bg0Control = 0;
|
||||
gScreen.bg1.unk = 0xc09;
|
||||
gUnk_03000FD0.field_0x4 = 0x40;
|
||||
DoFade(6,0x10);
|
||||
PlaySFX(0xf8);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (gUnk_03000FD0.field_0x0 == '\0') {
|
||||
gUnk_03000FD0.field_0x4 = -1;
|
||||
gMenu.overlayType++;
|
||||
gMenu.transitionTimer = 0x5a;
|
||||
pEVar2 = CreateObject(0xb4,0,0);
|
||||
if (pEVar2 != NULL) {
|
||||
pEVar2->x.HALF.HI = 0;
|
||||
pEVar2->y.HALF.HI = 0x48;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (sub_080AD84C()) {
|
||||
gMenu.menuType++;
|
||||
gMenu.transitionTimer = 0x3c;
|
||||
}
|
||||
}
|
||||
}
|
||||
+13
-5
@@ -5,8 +5,7 @@
|
||||
#include "readKeyInput.h"
|
||||
|
||||
extern void sub_0804FF84(u32);
|
||||
extern u32 gUnk_020176A0;
|
||||
extern const void (*gUnk_08100CBC[])();
|
||||
extern u16 gPaletteBuffer[];
|
||||
extern void VBlankInterruptWait(void);
|
||||
extern void DisableInterruptsAndDMA(void);
|
||||
extern void sub_0801D66C(void*, u8*, int);
|
||||
@@ -15,6 +14,15 @@ extern void sub_08016B34(void);
|
||||
static void sub_08055F70(void);
|
||||
static bool32 SoftResetKeysPressed(void);
|
||||
|
||||
static void (*const sScreenHandlers[])(void) = {
|
||||
[SCREEN_INTRO] = HandleIntroScreen,
|
||||
[SCREEN_CHOOSE_FILE] = HandleChooseFileScreen,
|
||||
[SCREEN_GAMEPLAY] = HandleGameplayScreen,
|
||||
[SCREEN_GAME_OVER] = HandleGameOverScreen,
|
||||
[SCREEN_CREDITS] = HandleCreditsScreen,
|
||||
[SCREEN_DEBUG_TEXT] = HandleDebugTextScreen,
|
||||
};
|
||||
|
||||
void MainLoop(void) {
|
||||
int var0;
|
||||
|
||||
@@ -26,12 +34,12 @@ void MainLoop(void) {
|
||||
sub_08056208();
|
||||
gUnk_02000010.field_0x4 = 193;
|
||||
sub_0804FFE4();
|
||||
DmaSet(3, 0x5000000U, &gUnk_020176A0, 0x84000080U);
|
||||
DmaSet(3, 0x5000000U, gPaletteBuffer, 0x84000080U);
|
||||
sub_0804FF84(1);
|
||||
sub_08056418();
|
||||
sub_080ADD30();
|
||||
gRand = 0x1234567;
|
||||
_DmaZero(&gUnk_03001000, 16);
|
||||
_DmaZero(&gUnk_03001000, sizeof(gUnk_03001000));
|
||||
InitScreen(SCREEN_INTRO);
|
||||
while (1) {
|
||||
ReadKeyInput();
|
||||
@@ -60,7 +68,7 @@ void MainLoop(void) {
|
||||
}
|
||||
|
||||
gUnk_03001000.ticks++;
|
||||
gUnk_08100CBC[gUnk_03001000.screen]();
|
||||
sScreenHandlers[gUnk_03001000.screen]();
|
||||
sub_08056458();
|
||||
sub_08050154();
|
||||
sub_080A3480();
|
||||
|
||||
+10
-10
@@ -2,7 +2,7 @@
|
||||
#include "entity.h"
|
||||
#include "screen.h"
|
||||
|
||||
extern void sub_0801D7EC(u32);
|
||||
extern void LoadGfxGroup(u32);
|
||||
extern void sub_08056250(void);
|
||||
extern void sub_080570B8(Entity*);
|
||||
void sub_080570F8(void);
|
||||
@@ -23,7 +23,7 @@ void Manager1(Entity *this)
|
||||
bVar1 = gUnk_08107C40[((u8*)&this->field_0x20)[1]];
|
||||
if ((bVar1 != 0) && (*(u8 *)&this->field_0x20 != bVar1)) {
|
||||
((u8*)&this->field_0x20)[0] = bVar1;
|
||||
sub_0801D7EC(bVar1);
|
||||
LoadGfxGroup(bVar1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,11 +31,11 @@ void sub_080570B8(Entity *this)
|
||||
{
|
||||
u8 *pbVar1;
|
||||
|
||||
sub_0801D7EC(((u8 *)&this->field_0x20)[0]);
|
||||
LoadGfxGroup(((u8 *)&this->field_0x20)[0]);
|
||||
this->height.WORD = 0;
|
||||
pbVar1 = ((u8 *)&this->field_0x20 + 1);
|
||||
if (*pbVar1 == 3) {
|
||||
gScreen.affine.bg3xOffset = 1;
|
||||
gScreen.affine.unk4 = 1;
|
||||
}
|
||||
else {
|
||||
gUnk_08107C48[*pbVar1](this);
|
||||
@@ -44,8 +44,8 @@ void sub_080570B8(Entity *this)
|
||||
|
||||
void sub_080570F8(void)
|
||||
{
|
||||
gScreen.lcd.lcdControl2 &= 0xf7ff;
|
||||
gScreen.controls.windowOutsideControl = 0;
|
||||
gScreen.lcd.displayControl &= 0xf7ff;
|
||||
gScreen.controls.layerFXControl = 0;
|
||||
sub_08056250();
|
||||
}
|
||||
|
||||
@@ -56,9 +56,9 @@ void sub_08057118(Entity *this)
|
||||
((u8 *)&this->field_0x20)[1] = 0;
|
||||
((u8 *)&this->field_0x20)[2] = 0;
|
||||
this->action = 1;
|
||||
gScreen.affine.unk2 = 0x1e04;
|
||||
*(u16 *)&gScreen.lcd.lcdControl2 |= 0x800;
|
||||
gScreen.controls.windowOutsideControl = 0x3648;
|
||||
gScreen.controls.mosaicSize = 0x1000;
|
||||
gScreen.affine.bg3Control = 0x1e04;
|
||||
gScreen.lcd.displayControl |= 0x800;
|
||||
gScreen.controls.layerFXControl = 0x3648;
|
||||
gScreen.controls.alphaBlend = 0x1000;
|
||||
sub_08052D74(this, sub_080570B8, sub_080570F8);
|
||||
}
|
||||
@@ -10,8 +10,8 @@ void Manager2(Entity *this)
|
||||
{
|
||||
if (this->action == 0) {
|
||||
this->action = 1;
|
||||
gScreen.affine.bg3xOffset = 0;
|
||||
gScreen.bg2.bg0xOffset = 0;
|
||||
gScreen.affine.unk4 = 0;
|
||||
gScreen.bg.bg2yOffset = 0;
|
||||
sub_08052D74(this, sub_080576A0, 0);
|
||||
}
|
||||
sub_0805754C(this);
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "functions.h"
|
||||
|
||||
extern u32 sub_0805C920(Entity*);
|
||||
extern void LoadPalettesByPaletteGroupIndex(u32);
|
||||
extern void LoadPaletteGroup(u32);
|
||||
extern void (*const gUnk_08108D10[])(Entity*);
|
||||
|
||||
extern u8 gUnk_08108D20[];
|
||||
@@ -58,7 +58,7 @@ void sub_0805C8B4(Entity *this)
|
||||
if (5 < ++this->field_0xf) {
|
||||
this->field_0xf = 0;
|
||||
}
|
||||
LoadPalettesByPaletteGroupIndex(gUnk_08108D20[this->field_0xf]);
|
||||
LoadPaletteGroup(gUnk_08108D20[this->field_0xf]);
|
||||
if (this->field_0xf == 0) {
|
||||
PlaySFX(0x11a);
|
||||
}
|
||||
|
||||
@@ -152,8 +152,8 @@ void GreatFairy_WingsInit(Entity* this) {
|
||||
this->spritePriority.b0 = 5;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spriteRendering.alphaBlend = 1;
|
||||
gScreen.controls.windowOutsideControl = 3904;
|
||||
gScreen.controls.mosaicSize = 2057;
|
||||
gScreen.controls.layerFXControl = 0xF40;
|
||||
gScreen.controls.alphaBlend = BLDALPHA_BLEND(9, 8);
|
||||
this->nonPlanarMovement = 1024;
|
||||
sub_0805EC9C(this, 1024, 256, 0);
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include "structures.h"
|
||||
|
||||
extern int sub_0807A094(int);
|
||||
extern u32 sub_0801D754(const u8*, u8, u8);
|
||||
extern void LoadPalettes(const u8*, int, int);
|
||||
extern u32 sub_080041EC(int, int);
|
||||
extern u32 sub_080045DA(int, int);
|
||||
|
||||
@@ -39,7 +39,7 @@ typedef struct {
|
||||
extern void (*const gUnk_08121C64[])(Entity*);
|
||||
extern void (*const gUnk_08121CCC[])(Entity*);
|
||||
extern const int gUnk_08133368[];
|
||||
extern const u8 gUnk_085A2E80[];
|
||||
extern const u8 gGlobalGfxAndPalettes[];
|
||||
extern const struct_08121CD4 gUnk_08121CD4[][4];
|
||||
extern const u8 gUnk_08121D10[];
|
||||
extern const u8 gUnk_08121D38[][8];
|
||||
@@ -88,7 +88,7 @@ void sub_0808E818(Entity* this) {
|
||||
this->field_0x70.BYTES.byte0 = 4;
|
||||
this->animationState = 2;
|
||||
var1 = gUnk_08133368[sub_0807A094(1) - 22] & 0xFFFFFF;
|
||||
sub_0801D754(&gUnk_085A2E80[var1], 31, 1);
|
||||
LoadPalettes(&gGlobalGfxAndPalettes[var1], 31, 1);
|
||||
}
|
||||
|
||||
if (gUnk_02032EC0.transitionType == 0) {
|
||||
|
||||
+6
-7
@@ -1740,7 +1740,7 @@ extern struct_086D4460 gUnk_086D4460;
|
||||
void sub_0804C918(void) {
|
||||
LoadAssetAsync(&gUnk_086D4460.LO, 0x6000000, 0x4000);
|
||||
LoadAssetAsync(&gUnk_086D4460.HI, 0x6008000, 0x4000);
|
||||
LoadPalettesByPaletteGroupIndex(0x19);
|
||||
LoadPaletteGroup(0x19);
|
||||
}
|
||||
|
||||
u32 sub_0804C948() {
|
||||
@@ -2223,8 +2223,7 @@ u32 sub_0804CD44() {
|
||||
extern EntityData gUnk_080DF94C;
|
||||
|
||||
extern u8 gUnk_02000070;
|
||||
extern u8 gUnk_03000FD0;
|
||||
extern u32 gUnk_0200B644;
|
||||
extern u32 gUsedPalettes;
|
||||
|
||||
void sub_0804CD48(void) {
|
||||
|
||||
@@ -2232,8 +2231,8 @@ void sub_0804CD48(void) {
|
||||
SetLocalFlag(0x48);
|
||||
MenuFadeIn(5, 0);
|
||||
gUnk_02000070 = 0;
|
||||
gUnk_03000FD0 = 0;
|
||||
gUnk_0200B644 = 0;
|
||||
gFadeControl.active = 0;
|
||||
gUsedPalettes = 0;
|
||||
*(u16*)0x5000000 = 0x7fff;
|
||||
sub_0801DA90(1);
|
||||
}
|
||||
@@ -2424,7 +2423,7 @@ void sub_0804CED8(void) {
|
||||
|
||||
if (CheckGlobalFlag(LV2_CLEAR)) {
|
||||
gUnk_0200B650 = 0;
|
||||
gScreen.lcd.lcdControl2 &= 0xfdff;
|
||||
gScreen.lcd.displayControl &= 0xfdff;
|
||||
sub_0807AABC(&gPlayerEntity);
|
||||
LoadRoomEntityList(&gUnk_080E1814);
|
||||
} else {
|
||||
@@ -6552,5 +6551,5 @@ void nullsub_106() {}
|
||||
void sub_0804FF84(u32 arg0)
|
||||
{
|
||||
((struct_02000000 * )0x02000000)->brightnessPref = arg0;
|
||||
gUnk_0200B644 = (u32)-1;
|
||||
gUsedPalettes = (u32)-1;
|
||||
}
|
||||
+5
-5
@@ -1,17 +1,17 @@
|
||||
#include "global.h"
|
||||
|
||||
extern u8 gUnk_020176E0;
|
||||
extern const u8 gUnk_020176E0[];
|
||||
|
||||
extern void sub_0807C960();
|
||||
extern u32 sub_0801D754(const u8*, u8, u8);
|
||||
extern void LoadPalettes(const u8*, int, int);
|
||||
|
||||
u32 sub_0807C9D8(u32* a1) {
|
||||
void sub_0807C9D8(u32* a1) {
|
||||
u32* v1; // r5@1
|
||||
|
||||
v1 = a1;
|
||||
sub_0807C960(0x6004000, *a1);
|
||||
sub_0807C960(0x6000000, v1[1]);
|
||||
sub_0807C960(0x6008000, v1[2]);
|
||||
sub_0807C960(&gUnk_020176E0, v1[3]);
|
||||
return sub_0801D754(&gUnk_020176E0, 2, 13);
|
||||
sub_0807C960(gUnk_020176E0, v1[3]);
|
||||
LoadPalettes(gUnk_020176E0, 2, 13);
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
#include "global.h"
|
||||
|
||||
extern u32 gUnk_020354C0;
|
||||
extern s32 gUnk_03000FD0;
|
||||
extern s32 gFadeControl;
|
||||
extern void _DmaZero(u32, u32, u32);
|
||||
|
||||
void sub_08050008(u32 param_1, u32 param_2, u32 param_3) {
|
||||
@@ -9,7 +9,7 @@ void sub_08050008(u32 param_1, u32 param_2, u32 param_3) {
|
||||
|
||||
_DmaZero((u32)&gUnk_020354C0, 128, param_3);
|
||||
|
||||
unk = &gUnk_03000FD0;
|
||||
unk = &gFadeControl;
|
||||
*(unk + 1) = -1;
|
||||
|
||||
return;
|
||||
|
||||
+29
-48
@@ -2,25 +2,6 @@
|
||||
#include "functions.h"
|
||||
#include "screen.h"
|
||||
|
||||
typedef struct {
|
||||
u8 field_0x0;
|
||||
u8 field_0x1;
|
||||
u8 field_0x2;
|
||||
u8 field_0x3;
|
||||
u32 field_0x4;
|
||||
u16 fadeType; // fade in or out, are there others?
|
||||
u16 fadeSpeed; // subtracted from duration
|
||||
u16 fadeDuration;
|
||||
u16 field_0xe;
|
||||
s16 field_0x10;
|
||||
s16 field_0x12;
|
||||
s16 field_0x14;
|
||||
u16 field_0x16;
|
||||
u16 field_0x18;
|
||||
} struct_03000FD0;
|
||||
|
||||
extern struct_03000FD0 gUnk_03000FD0;
|
||||
|
||||
typedef struct {
|
||||
u8 field_0x0;
|
||||
u8 field_0x1;
|
||||
@@ -29,7 +10,7 @@ typedef struct {
|
||||
|
||||
extern struct_03000000 gUnk_03000000;
|
||||
|
||||
extern u32 gUnk_0200B644;
|
||||
extern u32 gUsedPalettes;
|
||||
|
||||
extern void sub_0801E104();
|
||||
extern void DoFade(u32, u32);
|
||||
@@ -42,63 +23,63 @@ void sub_08050024() {
|
||||
|
||||
void sub_08050038(u32 arg0)
|
||||
{
|
||||
if ((gUnk_03000FD0.fadeType & 1) != 0) {
|
||||
gUnk_03000FD0.field_0xe = arg0;
|
||||
if ((gFadeControl.fadeType & 1) != 0) {
|
||||
gFadeControl.field_0xe = arg0;
|
||||
}
|
||||
else {
|
||||
gUnk_03000FD0.fadeDuration = arg0;
|
||||
gFadeControl.fadeDuration = arg0;
|
||||
}
|
||||
}
|
||||
|
||||
void DoFade(u32 fadeType, u32 fadeSpeed)
|
||||
{
|
||||
gUnk_03000FD0.fadeSpeed = fadeSpeed;
|
||||
gUnk_03000FD0.fadeType = fadeType;
|
||||
gUnk_03000FD0.field_0x0 = 1;
|
||||
gUnk_03000FD0.fadeDuration = 0x100;
|
||||
gUnk_03000FD0.field_0xe = 0;
|
||||
if ((gUnk_03000FD0.fadeType & 2) != 0) {
|
||||
gUnk_03000FD0.field_0x2 = 0xf8;
|
||||
gFadeControl.fadeSpeed = fadeSpeed;
|
||||
gFadeControl.fadeType = fadeType;
|
||||
gFadeControl.active = 1;
|
||||
gFadeControl.fadeDuration = 0x100;
|
||||
gFadeControl.field_0xe = 0;
|
||||
if ((gFadeControl.fadeType & 2) != 0) {
|
||||
gFadeControl.field_0x2 = 0xf8;
|
||||
}
|
||||
else {
|
||||
gUnk_03000FD0.field_0x2 = 0;
|
||||
gFadeControl.field_0x2 = 0;
|
||||
}
|
||||
if ((fadeType & 8) != 0) {
|
||||
gUnk_03000000.spritesOffset = 1;
|
||||
gScreen.bg1.unk |= 0x40;
|
||||
gScreen.bg2.unk |= 0x40;
|
||||
gScreen.affine.unk2 |= 0x40;
|
||||
gScreen.bg.bg1xOffset |= 0x40;
|
||||
gScreen.affine.bg2Control |= 0x40;
|
||||
gScreen.affine.bg3Control |= 0x40;
|
||||
}
|
||||
if ((fadeType & 0x10) != 0) {
|
||||
sub_0801E1B8(gUnk_03000FD0.field_0x16, gUnk_03000FD0.field_0x18);
|
||||
sub_0801E1EC(gUnk_03000FD0.field_0x12, gUnk_03000FD0.field_0x14, gUnk_03000FD0.field_0x10);
|
||||
sub_0801E1B8(gFadeControl.field_0x16, gFadeControl.field_0x18);
|
||||
sub_0801E1EC(gFadeControl.field_0x12, gFadeControl.field_0x14, gFadeControl.field_0x10);
|
||||
if ((fadeType & 1) == 0) {
|
||||
gUnk_03000FD0.fadeType &= 0xfffb;
|
||||
gFadeControl.fadeType &= 0xfffb;
|
||||
sub_08050008();
|
||||
gUnk_0200B644 = 0xffffffff;
|
||||
gUsedPalettes = 0xffffffff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080500F4(u32 arg0)
|
||||
{
|
||||
gUnk_03000FD0.fadeSpeed = arg0;
|
||||
gUnk_03000FD0.fadeType ^= 1;
|
||||
gUnk_03000FD0.field_0x0 = 1;
|
||||
gUnk_03000FD0.fadeDuration = 0x100;
|
||||
gFadeControl.fadeSpeed = arg0;
|
||||
gFadeControl.fadeType ^= 1;
|
||||
gFadeControl.active = 1;
|
||||
gFadeControl.fadeDuration = 0x100;
|
||||
}
|
||||
|
||||
void sub_08050110(u32 param_1, u32 param_2, u32 fadeType, u32 fadeSpeed)
|
||||
{
|
||||
if ((fadeType & 1) != 0) {
|
||||
gUnk_03000FD0.field_0x10 = 0x96;
|
||||
gFadeControl.field_0x10 = 0x96;
|
||||
}
|
||||
else {
|
||||
gUnk_03000FD0.field_0x10 = 0;
|
||||
gFadeControl.field_0x10 = 0;
|
||||
}
|
||||
gUnk_03000FD0.field_0x12 = param_1;
|
||||
gUnk_03000FD0.field_0x14 = param_2;
|
||||
gUnk_03000FD0.field_0x16 = 0x3f3f;
|
||||
gUnk_03000FD0.field_0x18 = 0;
|
||||
gFadeControl.field_0x12 = param_1;
|
||||
gFadeControl.field_0x14 = param_2;
|
||||
gFadeControl.field_0x16 = 0x3f3f;
|
||||
gFadeControl.field_0x18 = 0;
|
||||
DoFade(fadeType, fadeSpeed);
|
||||
}
|
||||
+10
-10
@@ -31,8 +31,8 @@ void sub_080A3BD0(void)
|
||||
gMenu.field_0x1 = 1;
|
||||
gMenu.unk2a = 0;
|
||||
sub_080A4D34();
|
||||
LoadPalettesByPaletteGroupIndex(0xcb);
|
||||
sub_0801D7EC(0x75);
|
||||
LoadPaletteGroup(0xcb);
|
||||
LoadGfxGroup(0x75);
|
||||
|
||||
iVar1 = sub_080A4494();
|
||||
iVar2 = iVar1 + 7;
|
||||
@@ -44,14 +44,14 @@ void sub_080A3BD0(void)
|
||||
iVar1 = max(iVar1, 0);
|
||||
iVar1 = min(iVar1, 6);
|
||||
|
||||
sub_0801D7EC(iVar1 + 0x76);
|
||||
gScreen.lcd.lcdControl2 |= 0x1e00;
|
||||
gScreen.bg1.unk = 0x1c01;
|
||||
gScreen.bg2.unk = 0x1d02;
|
||||
gScreen.affine.unk2 = 0x1e0b;
|
||||
gScreen.bg2.bg0xOffset = 1;
|
||||
gScreen.affine.bg2xOffset = 1;
|
||||
gScreen.affine.bg3xOffset = 1;
|
||||
LoadGfxGroup(iVar1 + 0x76);
|
||||
gScreen.lcd.displayControl |= 0x1e00;
|
||||
gScreen.bg.bg1xOffset = 0x1c01;
|
||||
gScreen.affine.bg2Control = 0x1d02;
|
||||
gScreen.affine.bg3Control = 0x1e0b;
|
||||
gScreen.bg.bg2yOffset = 1;
|
||||
gScreen.affine.unk = 1;
|
||||
gScreen.affine.unk4 = 1;
|
||||
sub_080A4528();
|
||||
sub_080A4398();
|
||||
sub_0801E738(0);
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
#include "global.h"
|
||||
#include "main.h"
|
||||
|
||||
extern u8 gUnk_03000FD0;
|
||||
|
||||
void sub_080AD834(void) {
|
||||
if (gUnk_03000FD0 == 0) {
|
||||
InitScreen(SCREEN_CHOOSE_FILE);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user