Port berry_crush_3 from Emerald

This commit is contained in:
PikalaxALT 2020-03-03 12:24:18 -05:00
parent 8594e7f72d
commit 8a7c2ded11
13 changed files with 1903 additions and 3768 deletions

File diff suppressed because it is too large Load Diff

View File

@ -3,295 +3,3 @@
.section .rodata
.align 2
gUnknown_846E3CC:: @ 846E3CC
.4byte 0x000000f8
@ {
@ .bg = 0,
@ .charBaseIndex = 2,
@ .mapBaseIndex = 15,
@ .screenSize = 0,
@ .paletteMode = 0,
@ .priority = 0,
@ .baseTile = 0x0000
@ }
.4byte 0x000014d1
@ {
@ .bg = 1,
@ .charBaseIndex = 0,
@ .mapBaseIndex = 13,
@ .screenSize = 2,
@ .paletteMode = 0,
@ .priority = 1,
@ .baseTile = 0x0000
@ }
.4byte 0x000020c2
@ {
@ .bg = 2,
@ .charBaseIndex = 0,
@ .mapBaseIndex = 12,
@ .screenSize = 0,
@ .paletteMode = 0,
@ .priority = 2,
@ .baseTile = 0x0000
@ }
.4byte 0x000030b3
@ {
@ .bg = 3,
@ .charBaseIndex = 0,
@ .mapBaseIndex = 11,
@ .screenSize = 0,
@ .paletteMode = 0,
@ .priority = 3,
@ .baseTile = 0x0000
@ }
gUnknown_846E3DC:: @ 846E3DC
.byte 0x01, 0x02, 0x03
gUnknown_846E3DF:: @ 846E3DF
.byte 0x00, 0x01, 0x02
gUnknown_846E3E2:: @ 846E3E2
.byte 0x00, 0x03, 0x04
gUnknown_846E3E5:: @ 846E3E5
.byte 0x01, 0x08, 0x09
.byte 0x01, 0x06, 0x07
gUnknown_846E3EB:: @ 846E3EB
.byte 0x01, 0x04, 0x05
.align 2
gUnknown_846E3F0:: @ 846E3F0
.byte 0, 3, 4, 24, 13, 15
.2byte 0x0001
gUnknown_846E3F8:: @ 846E3F8
.byte 0, 0, 0, 9, 2, 8
.2byte 0x03ed
.byte 0, 0, 3, 9, 2, 8
.2byte 0x03db
.byte 0, 0, 6, 9, 2, 8
.2byte 0x03c9
.byte 0, 21, 3, 9, 2, 8
.2byte 0x03b7
.byte 0, 21, 6, 9, 2, 8
.2byte 0x03a5
.byte 255, 0, 0, 0, 0, 0
.2byte 0x0000
.byte 0, 4, 2, 22, 16, 15
.2byte 0x0001
.byte 0, 4, 2, 22, 16, 15
.2byte 0x0001
.byte 0, 3, 2, 24, 16, 15
.2byte 0x0001
.byte 255, 0, 0, 0, 0, 0
.2byte 0x0000
gUnknown_846E448:: @ 846E448
.byte 0x06, 0x08, 0x09, 0x0b
.byte 0x0c, 0x0e, 0x0f, 0x10
gUnknown_846E450:: @ 846E450
.4byte 50000000, 25000000, 12500000, 6250000, 3125000, 1562500, 781250, 390625
gUnknown_846E470:: @ 846E470 gbapal
.incbin "graphics/link_games/unk_846E4D0.gbapal"
gUnknown_846E490:: @ 846E490 gbapal
.incbin "graphics/link_games/unk_846E7FC.gbapal"
gUnknown_846E4B0:: @ 846E4B0 gbapal
.incbin "graphics/link_games/unk_846ECC4.gbapal"
gUnknown_846E4D0:: @ 846E4D0 4bpp.lz
.incbin "graphics/link_games/unk_846E4D0.4bpp.lz"
gUnknown_846E7FC:: @ 846E7FC 4bpp.lz
.incbin "graphics/link_games/unk_846E7FC.4bpp.lz"
gUnknown_846EB78:: @ 846EB78 4bpp.lz
.incbin "graphics/link_games/unk_846EB78.4bpp.lz"
gUnknown_846ECC4:: @ 846ECC4 4bpp.lz
.incbin "graphics/link_games/unk_846ECC4.4bpp.lz"
gUnknown_846ED90:: @ 846ED90 bin.lz
.incbin "graphics/link_games/unk_846ED90.bin.lz"
gUnknown_846EEC0:: @ 846EEC0 bin.lz
.incbin "graphics/link_games/unk_846EEC0.bin.lz"
gUnknown_846F058:: @ 846F058 bin.lz
.incbin "graphics/link_games/unk_846F058.bin.lz"
gUnknown_846F280:: @ 846F280
.byte 0x01, 0x03, 0x00, 0x00, 0x00
.byte 0x00, 0x01, 0x03, 0x00, 0x00
.byte 0x01, 0x03, 0x02, 0x04, 0x00
.byte 0x00, 0x01, 0x03, 0x02, 0x04
gUnknown_846F294:: @ 846F294
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x00, 0x00, 0x00, 0x00
.byte 0x01, 0x00, 0x03, 0x00, 0xe4, 0xff, 0xfc, 0xff, 0xe8, 0xff, 0x10, 0x00
.byte 0x02, 0x00, 0x06, 0x00, 0xf0, 0xff, 0x14, 0x00, 0xf8, 0xff, 0x10, 0x00
.byte 0x03, 0x14, 0x03, 0x00, 0x1c, 0x00, 0xfc, 0xff, 0x20, 0x00, 0xf8, 0xff
.byte 0x04, 0x14, 0x06, 0x00, 0x10, 0x00, 0x14, 0x00, 0x10, 0x00, 0xf8, 0xff
gUnknown_846F2D0:: @ 846F2D0
.byte 0x00, 0x00
.byte 0xff, 0x00
.byte 0x01, 0x01
gUnknown_846F2D6:: @ 846F2D6
.byte 0x00, 0x00
.byte 0xf0, 0xfc
.byte 0x10, 0xfc
.byte 0xf8, 0xfe
.byte 0x08, 0xfe
.byte 0xe8, 0xf8
.byte 0x18, 0xf8
.byte 0xe0, 0xf4
.byte 0x20, 0xf4
.byte 0xd8, 0xf0
.byte 0x28, 0xf0
gUnknown_846F2EC:: @ 846F2EC
.2byte 5, 6, 7, 8, 9
.align 2
gUnknown_846F2F8:: @ 846F2F8
obj_tiles gUnknown_846E4D0, 0x0800, 1
obj_tiles gUnknown_846E7FC, 0x0e00, 2
obj_tiles gUnknown_846EB78, 0x0700, 3
obj_tiles gUnknown_846ECC4, 0x02c0, 4
obj_tiles NULL, 0x0000, 0
gUnknown_846F320:: @ 846F320
obj_pal gUnknown_846E470, 1
obj_pal gUnknown_846E490, 2
obj_pal gUnknown_846E4B0, 4
obj_pal NULL, 0
gUnknown_846F340::
obj_image_anim_frame 0x0000, 0
obj_image_anim_end
gUnknown_846F348::
obj_image_anim_frame 0x0000, 4
obj_image_anim_frame 0x0010, 4
obj_image_anim_frame 0x0020, 4
obj_image_anim_end
gUnknown_846F358::
obj_image_anim_frame 0x0030, 2
obj_image_anim_frame 0x0040, 2
obj_image_anim_frame 0x0050, 2
obj_image_anim_frame 0x0060, 2
obj_image_anim_end
gUnknown_846F36C::
obj_image_anim_frame 0x0000, 2
obj_image_anim_frame 0x0004, 2
obj_image_anim_frame 0x0008, 2
obj_image_anim_frame 0x000c, 2
obj_image_anim_frame 0x0010, 2
obj_image_anim_frame 0x0014, 2
obj_image_anim_jump 0
gUnknown_846F388::
obj_image_anim_frame 0x0018, 4
obj_image_anim_frame 0x001c, 4
obj_image_anim_frame 0x0020, 4
obj_image_anim_frame 0x0024, 4
obj_image_anim_frame 0x0028, 4
obj_image_anim_frame 0x002c, 4
obj_image_anim_frame 0x0030, 4
obj_image_anim_frame 0x0034, 4
obj_image_anim_jump 0
gUnknown_846F3AC::
obj_image_anim_frame 0x0014, 0
obj_image_anim_end
gUnknown_846F3B4::
obj_image_anim_frame 0x0000, 0
obj_image_anim_end
gUnknown_846F3BC::
obj_rot_scal_anim_frame 256, 256, 0, 0
obj_rot_scal_anim_frame 0, 0, 2, 1
obj_rot_scal_anim_jump 1
gUnknown_846F3D4::
obj_rot_scal_anim_frame 256, 256, 0, 0
obj_rot_scal_anim_frame 0, 0, 254, 1
obj_rot_scal_anim_jump 1
gUnknown_846F3EC::
.4byte gUnknown_846F340
gUnknown_846F3F0::
.4byte gUnknown_846F348
.4byte gUnknown_846F358
gUnknown_846F3F8::
.4byte gUnknown_846F36C
.4byte gUnknown_846F388
gUnknown_846F400::
.4byte gUnknown_846F3AC
gUnknown_846F404::
.4byte gUnknown_846F3B4
gUnknown_846F408::
.4byte gUnknown_846F3BC
.4byte gUnknown_846F3D4
gUnknown_846F410:: @ 846F410
spr_template 1, 1, gOamData_AffineOff_ObjNormal_64x64, gUnknown_846F3EC, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy
gUnknown_846F428:: @ 846F428
spr_template 2, 2, gOamData_AffineOff_ObjNormal_32x32, gUnknown_846F3F0, NULL, gDummySpriteAffineAnimTable, sub_814EFD0
gUnknown_846F440:: @ 846F440
spr_template 3, 2, gOamData_AffineOff_ObjNormal_16x16, gUnknown_846F3F8, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy
gUnknown_846F458:: @ 846F458
spr_template 4, 4, gOamData_AffineOff_ObjNormal_8x16, gUnknown_846F400, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy
gUnknown_846F470:: @ 846F470
spr_template 5, 5, gOamData_AffineDouble_ObjNormal_32x32, gUnknown_846F404, NULL, gUnknown_846F408, SpriteCallbackDummy
gUnknown_846F488:: @ 846F488 DigitObjUtilTemplate
@ strConvMode, shape, size, priority
.byte 1 | (2 /*ST_OAM_V_RECTANGLE*/ << 2) | (0 << 4) | (0 << 6) @ 9
.byte 2, 8 @ ndigits, width
.align 2
.2byte 0x9c, 0x00 @ x, y
.4byte gUnknown_846F2F8 + 0x18 @ spriteSheet
.4byte gUnknown_846F320 + 0x10 @ spritePalette
@ strConvMode, shape, size, priority
.byte 0 | (2 /*ST_OAM_V_RECTANGLE*/ << 2) | (0 << 4) | (0 << 6) @ 8
.byte 2, 8 @ ndigits, width
.align 2
.2byte 0xb4, 0x00 @ x, y
.4byte gUnknown_846F2F8 + 0x18 @ spriteSheet
.4byte gUnknown_846F320 + 0x10 @ spritePalette
@ strConvMode, shape, size, priority
.byte 0 | (2 /*ST_OAM_V_RECTANGLE*/ << 2) | (0 << 4) | (0 << 6) @ 8
.byte 2, 8 @ ndigits, width
.align 2
.2byte 0xcc, 0x00 @ x, y
.4byte gUnknown_846F2F8 + 0x18 @ spriteSheet
.4byte gUnknown_846F320 + 0x10 @ spritePalette
gUnknown_846F4B8:: @ 846F4B8
.4byte gUnknown_841D034
.4byte gUnknown_841D03C
.4byte gUnknown_841D044
.4byte gUnknown_841D0D4
.4byte gUnknown_841D0E8
.4byte gUnknown_841D100

View File

@ -3448,90 +3448,90 @@ gUnknown_841D008:: @ 841D008
.string "Communication standby$"
.align 2
gUnknown_841D020:: @ 841D020
gText_1_ClrLtGryShdwBlk_Dynamic0:: @ 841D020
.string "1. {COLOR LIGHT_GRAY}{SHADOW BLACK}{DYNAMIC 0x00}$"
gUnknown_841D02C:: @ 841D02C
gText_1_Dynamic0:: @ 841D02C
.string "1. {DYNAMIC 0x00}$"
.align 2
gUnknown_841D034:: @ 0x841D034
gText_SpaceTimes:: @ 0x841D034
.string " times$"
.align 2
gUnknown_841D03C:: @ 0x841D03C
gText_XDotY:: @ 0x841D03C
.string "{STR_VAR_1}.{STR_VAR_2}$"
.align 2
gUnknown_841D044:: @ 0x841D044
gText_StrVar1Berry:: @ 0x841D044
.string "{STR_VAR_1} BERRY$"
.align 2
gUnknown_841D050:: @ 841D050
gText_TimeColon:: @ 841D050
.string "Time:$"
.align 2
gUnknown_841D058:: @ 841D058
gText_PressingSpeed:: @ 841D058
.string "Pressing Speed:$"
gUnknown_841D068:: @ 841D068
gText_Silkiness:: @ 841D068
.string "Silkiness:$"
.align 2
gUnknown_841D074:: @ 841D074
gText_StrVar1:: @ 841D074
.string "{STR_VAR_1}$"
.align 2
gUnknown_841D078:: @ 841D078
gText_SpaceMin:: @ 841D078
.string "min.$"
.align 2
gUnknown_841D080:: @ 841D080
gText_XDotY2:: @ 841D080
.string "{STR_VAR_1}.{STR_VAR_2}$"
.align 2
gUnknown_841D088:: @ 841D088
gText_SpaceSec:: @ 841D088
.string "sec.$"
.align 2
gUnknown_841D090:: @ 841D090
gText_XDotY3:: @ 841D090
.string "{STR_VAR_1}.{STR_VAR_2}$"
.align 2
gUnknown_841D098:: @ 841D098
gText_TimesPerSec:: @ 841D098
.string "Times/sec.$"
.align 2
gUnknown_841D0A4:: @ 841D0A4
.string "{STR_VAR_1}$"
gText_Var1Percent:: @ 841D0A4
.string "{STR_VAR_1}%$"
.align 2
gUnknown_841D0A8:: @ 841D0A8
gText_PressesRankings:: @ 841D0A8
.string "No. of Presses Rankings$"
.align 2
gUnknown_841D0C0:: @ 841D0C0
gText_CrushingResults:: @ 841D0C0
.string "Crushing Results$"
.align 2
gUnknown_841D0D4:: @ 0x841D0D4
gText_NeatnessRankings:: @ 0x841D0D4
.string "Neatness Rankings$"
.align 2
gUnknown_841D0E8:: @ 0x841D0E8
gText_CooperativeRankings:: @ 0x841D0E8
.string "Cooperative Rankings$"
.align 2
gUnknown_841D100:: @ 0x841D100
gText_PressingPowerRankings:: @ 0x841D100
.string "Pressing-Power Rankings$"
gUnknown_841D118:: @ 841D118
gText_BerryCrush2:: @ 841D118
.string "BERRY CRUSH$"
gUnknown_841D124:: @ 841D124
gText_PressingSpeedRankings:: @ 841D124
.string "Pressing-Speed Rankings$"
gUnknown_841D13C:: @ 841D13C
gText_Var1Players:: @ 841D13C
.string "{STR_VAR_1} PLAYERS$"
.align 2

View File

@ -151,6 +151,12 @@ struct BerryCrushGame
u8 unk31C0[0x1000];
};
#define PLAYER_UNK14(game, i) \
((u8 *)(game) \
+ offsetof(struct BerryCrushGame, unk68) \
+ offsetof(struct BerryCrushGame_68_x, unk30) \
+ sizeof(struct BerryCrushGame_Player) * (i))
struct BerryCrushGame *sub_814B6F0(void);
void StartBerryCrush(MainCallback callback);
u32 sub_814B6FC(MainCallback callback);
@ -161,9 +167,9 @@ void sub_814B930(void);
void sub_814BABC(struct BerryCrushGame *arg0);
void sub_814BB4C(u16, u8, u8 *);
void sub_814D564(u8 *, u32, s32, u32, u32, u32, u32);
void sub_814D9CC(struct BerryCrushGame *arg0);
bool32 sub_814D5C8(void);
bool32 sub_814D888(void);
int sub_814D9CC(struct BerryCrushGame *arg0);
int sub_814D5C8(void);
int sub_814D888(void);
void sub_814DA24(struct BerryCrushGame *arg0, struct BerryCrushGame_138 *arg1);
void sub_814DC24(struct BerryCrushGame *arg0, struct BerryCrushGame_138 *arg1);
void sub_814DC5C(struct BerryCrushGame *arg0, struct BerryCrushGame_138 *arg1);
@ -173,5 +179,6 @@ void sub_814E80C(struct BerryCrushGame *arg0);
void sub_814DA04(struct BerryCrushGame *arg0);
void sub_814EB04(struct BerryCrushGame_138 *arg0);
void sub_814DB84(struct Sprite * sprite);
void ShowBerryCrushRankings(void);
#endif //GUARD_BERRY_CRUSH_H

View File

@ -11,8 +11,12 @@ struct DigitObjUtilTemplate
u8 xDelta;
s16 x;
s16 y;
const struct SpriteSheet *spriteSheet;
const struct SpritePalette *spritePal;
union
{
const struct SpriteSheet * uncompressed;
const struct CompressedSpriteSheet * compressed;
} spriteSheet;
const struct SpritePalette * spritePal;
};
extern const u16 gUnknown_8479668[];

View File

@ -4875,10 +4875,15 @@ extern const u32 gLinkMiscMenu_Tilemap[];
// union_room_chat_objects
extern const u32 gUnionRoomChatIcons[];
//battle_bg
// battle_bg
extern const u32 gFile_graphics_battle_transitions_vs_frame_sheet[];
extern const u32 gVsLettersGfx[];
extern const u32 gFile_graphics_battle_transitions_vs_frame_palette[];
extern const u32 gFile_graphics_battle_transitions_vs_frame_tilemap[];
// berry_crush
extern const u16 gUnknown_8EAFEA0[];
extern const u32 gUnknown_8EAFFC0[];
extern const u32 gUnknown_8EB0ADC[];
#endif //GUARD_GRAPHICS_H

View File

@ -5,5 +5,7 @@ s16 sub_80D8B90(s16 y);
s16 sub_80D8AA0(s16 x, s16 y);
s32 sub_80D8B68(s32 x, s32 y);
s32 sub_80D8AE0(s32 x, s32 y);
s16 sub_80D8B40(u8 s, s16 x, s16 y);
s16 sub_80D8ABC(u8 s, s16 x, s16 y);
#endif //GUARD_MATH_UTIL_H

View File

@ -1158,5 +1158,28 @@ extern const u8 gUnknown_841CF70[];
extern const u8 gUnknown_841CFA0[];
extern const u8 gUnknown_841CFD4[];
extern const u8 gUnknown_841D008[];
extern const u8 gText_1_ClrLtGryShdwBlk_Dynamic0[];
extern const u8 gText_1_Dynamic0[];
extern const u8 gText_SpaceTimes[];
extern const u8 gText_XDotY[];
extern const u8 gText_StrVar1Berry[];
extern const u8 gText_TimeColon[];
extern const u8 gText_PressingSpeed[];
extern const u8 gText_Silkiness[];
extern const u8 gText_StrVar1[];
extern const u8 gText_SpaceMin[];
extern const u8 gText_XDotY2[];
extern const u8 gText_SpaceSec[];
extern const u8 gText_XDotY3[];
extern const u8 gText_TimesPerSec[];
extern const u8 gText_Var1Percent[];
extern const u8 gText_PressesRankings[];
extern const u8 gText_CrushingResults[];
extern const u8 gText_BerryCrush2[];
extern const u8 gText_PressingSpeedRankings[];
extern const u8 gText_Var1Players[];
extern const u8 gText_NeatnessRankings[];
extern const u8 gText_CooperativeRankings[];
extern const u8 gText_PressingPowerRankings[];
#endif //GUARD_STRINGS_H

View File

@ -281,7 +281,7 @@ SECTIONS {
src/pokemon_jump_6.o(.text);
src/berry_crush.o(.text);
src/berry_crush_2.o(.text);
asm/berry_crush_3.o(.text);
src/berry_crush_3.o(.text);
src/wireless_communication_status_screen.o(.text);
src/braille_text.o(.text);
src/text_window.o(.text);
@ -573,7 +573,7 @@ SECTIONS {
src/pokemon_jump_5.o(.rodata);
src/pokemon_jump_6.o(.rodata);
src/berry_crush_2.o(.rodata);
data/berry_crush.o(.rodata);
src/berry_crush_3.o(.rodata);
src/wireless_communication_status_screen.o(.rodata);
src/braille_text.o(.rodata);
src/text_window_graphics.o(.rodata);

View File

@ -198,12 +198,6 @@ static void sub_814BA98(u8 taskId)
sub_814D9CC(gUnknown_203F3DC);
}
#define PLAYER_UNK14(game, i) \
((u8 *)(game) \
+ offsetof(struct BerryCrushGame, unk68) \
+ offsetof(struct BerryCrushGame_68_x, unk30) \
+ sizeof(struct BerryCrushGame_Player) * (i))
void sub_814BABC(struct BerryCrushGame *arg0)
{
u8 i;

1823
src/berry_crush_3.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -125,19 +125,19 @@ bool32 DigitObjUtil_CreatePrinter(u32 id, s32 num, const struct DigitObjUtilTemp
if (sOamWork->array[id].firstOamId == 0xFF)
return FALSE;
sOamWork->array[id].tileStart = GetSpriteTileStartByTag(template->spriteSheet->tag);
sOamWork->array[id].tileStart = GetSpriteTileStartByTag(template->spriteSheet.uncompressed->tag);
if (sOamWork->array[id].tileStart == 0xFFFF)
{
if (template->spriteSheet->size != 0)
if (template->spriteSheet.uncompressed->size != 0)
{
sOamWork->array[id].tileStart = LoadSpriteSheet(template->spriteSheet);
sOamWork->array[id].tileStart = LoadSpriteSheet(template->spriteSheet.uncompressed);
}
else
{
struct CompressedSpriteSheet compObjectPic;
compObjectPic = *(struct CompressedSpriteSheet*)(template->spriteSheet);
compObjectPic.size = GetDecompressedDataSize(template->spriteSheet->data);
compObjectPic = *template->spriteSheet.compressed;
compObjectPic.size = GetDecompressedDataSize((const void *)template->spriteSheet.compressed->data);
sOamWork->array[id].tileStart = LoadCompressedSpriteSheet(&compObjectPic);
}
@ -158,7 +158,7 @@ bool32 DigitObjUtil_CreatePrinter(u32 id, s32 num, const struct DigitObjUtilTemp
sOamWork->array[id].priority = template->priority;
sOamWork->array[id].xDelta = template->xDelta;
sOamWork->array[id].tilesPerImage = GetTilesPerImage(template->shape, template->size);
sOamWork->array[id].tileTag = template->spriteSheet->tag;
sOamWork->array[id].tileTag = template->spriteSheet.uncompressed->tag;
sOamWork->array[id].palTag = template->spritePal->tag;
sOamWork->array[id].isActive = TRUE;

View File

@ -766,7 +766,7 @@ static void sub_814A9C8(void)
ptr->xDelta = 8;
ptr->x = 108;
ptr->y = 6;
ptr->spriteSheet = (void*) &gUnknown_846D960;
ptr->spriteSheet.compressed = &gUnknown_846D960;
ptr->spritePal = &gUnknown_846D968;
DigitObjUtil_Init(2);