mirror of
https://github.com/pret/pokeruby.git
synced 2026-10-03 08:06:46 -04:00
begin decompiling intro functions
This commit is contained in:
@@ -48,7 +48,8 @@ C_OBJS := $(C_SRCS:%.c=%.o)
|
||||
|
||||
ASM_OBJS := asm/crt0.o asm/rom3.o asm/rom_8040EB4.o asm/rom4.o asm/rom_8074BAC.o asm/rom5.o asm/rom6.o\
|
||||
asm/libgcnmultiboot.o asm/m4a_1.o asm/m4a_3.o asm/libagbsyscall.o \
|
||||
asm/rom_8072DF8.o asm/rom_8065394.o asm/rom_803D1FC.o asm/rom_803BA2C.o
|
||||
asm/rom_8072DF8.o asm/rom_8065394.o asm/rom_803D1FC.o asm/rom_803BA2C.o \
|
||||
asm/rom_813BA94.o
|
||||
|
||||
DATA_ASM_OBJS := data/data2.o data/graphics.o data/sound_data.o \
|
||||
data/event_scripts.o data/battle_anim_scripts.o \
|
||||
|
||||
+1
-31062
File diff suppressed because it is too large
Load Diff
+30707
File diff suppressed because it is too large
Load Diff
@@ -76,6 +76,8 @@ SECTIONS {
|
||||
src/starter_choose.o(.text);
|
||||
src/wallclock.o(.text);
|
||||
asm/rom6.o(.text);
|
||||
src/intro.o(.text);
|
||||
asm/rom_813BA94.o(.text);
|
||||
} =0
|
||||
|
||||
script_data :
|
||||
|
||||
+147
@@ -0,0 +1,147 @@
|
||||
#include "global.h"
|
||||
#include "main.h"
|
||||
#include "palette.h"
|
||||
#include "task.h"
|
||||
#include "link.h"
|
||||
|
||||
struct GcmbStruct
|
||||
{
|
||||
u16 gcmb_field_0;
|
||||
u8 gcmb_field_2;
|
||||
};
|
||||
|
||||
extern s32 gUnknown_03005ED0;
|
||||
extern struct GcmbStruct gUnknown_03005EE0;
|
||||
extern u16 gSaveFileStatus;
|
||||
|
||||
extern const u8 gIntroCopyright_Gfx[];
|
||||
extern const u16 gIntroCopyright_Pal[];
|
||||
extern const u16 gIntroCopyright_Tilemap[];
|
||||
|
||||
extern void CB2_InitTitleScreen(void);
|
||||
|
||||
void CB2_813B7EC(void);
|
||||
void task_intro_1(u8);
|
||||
|
||||
void sub_813B784(void)
|
||||
{
|
||||
LoadOam();
|
||||
ProcessSpriteCopyRequests();
|
||||
TransferPlttBuffer();
|
||||
}
|
||||
|
||||
void CB2_813B798(void)
|
||||
{
|
||||
RunTasks();
|
||||
AnimateSprites();
|
||||
BuildOamBuffer();
|
||||
UpdatePaletteFade();
|
||||
if (gMain.newKeys && !gPaletteFade.active)
|
||||
SetMainCallback2(CB2_813B7EC);
|
||||
else if (gUnknown_03005ED0 != -1)
|
||||
gUnknown_03005ED0++;
|
||||
}
|
||||
|
||||
void CB2_813B7EC(void)
|
||||
{
|
||||
if (!UpdatePaletteFade())
|
||||
SetMainCallback2(CB2_InitTitleScreen);
|
||||
}
|
||||
|
||||
void sub_813B808(u16 a1, u16 a2, u16 a3)
|
||||
{
|
||||
LZ77UnCompVram(gIntroCopyright_Gfx, (void *)(VRAM + a1));
|
||||
LoadPalette(gIntroCopyright_Pal, a3, 0x20);
|
||||
CpuCopy16(gIntroCopyright_Tilemap, (void *)(VRAM + a2), 0x500);
|
||||
}
|
||||
|
||||
void SerialCb_CopyrightScreen(void)
|
||||
{
|
||||
GameCubeMultiBoot_HandleSerialInterrupt(&gUnknown_03005EE0);
|
||||
}
|
||||
|
||||
u8 SetUpCopyrightScreen(void)
|
||||
{
|
||||
u16 ime;
|
||||
|
||||
switch (gMain.state)
|
||||
{
|
||||
case 0:
|
||||
SetVBlankCallback(NULL);
|
||||
REG_BLDCNT = 0;
|
||||
REG_BLDALPHA = 0;
|
||||
REG_BLDY = 0;
|
||||
*(u16 *)PLTT = 0x7FFF;
|
||||
REG_DISPCNT = 0;
|
||||
REG_BG0HOFS = 0;
|
||||
REG_BG0VOFS = 0;
|
||||
DmaFill16(3, 0, (void *)VRAM, VRAM_SIZE);
|
||||
DmaFill32(3, 0, (void *)OAM, OAM_SIZE);
|
||||
DmaFill16(3, 0, (void *)(PLTT + 2), PLTT_SIZE - 2);
|
||||
ResetPaletteFade();
|
||||
sub_813B808(0, 14336, 0);
|
||||
remove_some_task();
|
||||
ResetTasks();
|
||||
ResetSpriteData();
|
||||
FreeAllSpritePalettes();
|
||||
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, 0xFFFF);
|
||||
REG_BG0CNT = 1792;
|
||||
ime = REG_IME;
|
||||
REG_IME = 0;
|
||||
REG_IE |= INTR_FLAG_VBLANK;
|
||||
REG_IME = ime;
|
||||
REG_DISPSTAT |= 8;
|
||||
SetVBlankCallback(sub_813B784);
|
||||
REG_DISPCNT = 320;
|
||||
SetSerialCallback(SerialCb_CopyrightScreen);
|
||||
GameCubeMultiBoot_Init(&gUnknown_03005EE0);
|
||||
default:
|
||||
UpdatePaletteFade();
|
||||
gMain.state++;
|
||||
GameCubeMultiBoot_Main(&gUnknown_03005EE0);
|
||||
break;
|
||||
case 140:
|
||||
GameCubeMultiBoot_Main(&gUnknown_03005EE0);
|
||||
if (gUnknown_03005EE0.gcmb_field_2 != 1)
|
||||
{
|
||||
BeginNormalPaletteFade(0xFFFFFFFFu, 0, 0, 0x10, 0);
|
||||
gMain.state++;
|
||||
}
|
||||
break;
|
||||
case 141:
|
||||
if (UpdatePaletteFade())
|
||||
break;
|
||||
CreateTask(task_intro_1, 0);
|
||||
SetMainCallback2(CB2_813B798);
|
||||
if (gUnknown_03005EE0.gcmb_field_2)
|
||||
{
|
||||
GameCubeMultiBoot_ExecuteProgram(&gUnknown_03005EE0);
|
||||
}
|
||||
else
|
||||
{
|
||||
GameCubeMultiBoot_Quit();
|
||||
SetSerialCallback(SerialCB);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
void c2_copyright_1(void)
|
||||
{
|
||||
if (!SetUpCopyrightScreen())
|
||||
{
|
||||
sub_8052E4C();
|
||||
sub_81251B8();
|
||||
sub_8125EC8(0);
|
||||
if (gSaveFileStatus == 0 || gSaveFileStatus == 2)
|
||||
ClearSav2();
|
||||
SetPokemonCryStereo(gSaveBlock2.optionsSound);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_813BA88(void)
|
||||
{
|
||||
SetUpCopyrightScreen();
|
||||
}
|
||||
Reference in New Issue
Block a user