Merge branch 'master' of github.com:pret/pokeemerald

This commit is contained in:
Diegoisawesome 2019-01-27 00:11:44 -06:00
commit 6b2dda422b
40 changed files with 8732 additions and 9012 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1262,7 +1262,7 @@ VerdanturfTown_PokemonCenter_1F_EventScript_27191E:: @ 827191E
lock lock
faceplayer faceplayer
setvar VAR_0x8004, 0 setvar VAR_0x8004, 0
specialvar VAR_RESULT, sub_80C2E40 specialvar VAR_RESULT, CountPlayerTrainerStars
compare VAR_RESULT, 4 compare VAR_RESULT, 4
goto_if_eq OldaleTown_PokemonCenter_1F_EventScript_271A68 goto_if_eq OldaleTown_PokemonCenter_1F_EventScript_271A68
msgbox gUnknown_082726EB, MSGBOX_YESNO msgbox gUnknown_082726EB, MSGBOX_YESNO

View File

@ -157,7 +157,7 @@ LilycoveCity_EventScript_1E2D11:: @ 81E2D11
LilycoveCity_EventScript_1E2D1A:: @ 81E2D1A LilycoveCity_EventScript_1E2D1A:: @ 81E2D1A
lockall lockall
specialvar VAR_0x8004, sub_80F8940 specialvar VAR_0x8004, CountPlayerContestPaintings
switch VAR_0x8004 switch VAR_0x8004
case 0, LilycoveCity_EventScript_1E2D3A case 0, LilycoveCity_EventScript_1E2D3A
msgbox LilycoveCity_Text_1E4571, MSGBOX_DEFAULT msgbox LilycoveCity_Text_1E4571, MSGBOX_DEFAULT

View File

@ -100,7 +100,7 @@ LilycoveCity_ContestLobby_EventScript_21A314:: @ 821A314
return return
LilycoveCity_ContestLobby_EventScript_21A360:: @ 821A360 LilycoveCity_ContestLobby_EventScript_21A360:: @ 821A360
specialvar VAR_0x8004, sub_80F8940 specialvar VAR_0x8004, CountPlayerContestPaintings
switch VAR_0x8004 switch VAR_0x8004
case 1, LilycoveCity_ContestLobby_EventScript_21A3A2 case 1, LilycoveCity_ContestLobby_EventScript_21A3A2
case 2, LilycoveCity_ContestLobby_EventScript_21A3A6 case 2, LilycoveCity_ContestLobby_EventScript_21A3A6

View File

@ -6,7 +6,7 @@ LilycoveCity_CoveLilyMotel_2F_EventScript_2186D3:: @ 82186D3
faceplayer faceplayer
call_if_unset FLAG_TEMP_2, LilycoveCity_CoveLilyMotel_2F_EventScript_2186F9 call_if_unset FLAG_TEMP_2, LilycoveCity_CoveLilyMotel_2F_EventScript_2186F9
call_if_set FLAG_TEMP_2, LilycoveCity_CoveLilyMotel_2F_EventScript_21870F call_if_set FLAG_TEMP_2, LilycoveCity_CoveLilyMotel_2F_EventScript_21870F
specialvar VAR_RESULT, sub_80C08E4 specialvar VAR_RESULT, HasAllHoennMons
compare VAR_RESULT, 1 compare VAR_RESULT, 1
goto_if_eq LilycoveCity_CoveLilyMotel_2F_EventScript_218702 goto_if_eq LilycoveCity_CoveLilyMotel_2F_EventScript_218702
release release

View File

@ -92,7 +92,7 @@ LilycoveCity_LilycoveMuseum_2F_Movement_219863: @ 8219863
LilycoveCity_LilycoveMuseum_2F_EventScript_219866:: @ 8219866 LilycoveCity_LilycoveMuseum_2F_EventScript_219866:: @ 8219866
lockall lockall
goto_if_set FLAG_RECEIVED_GLASS_ORNAMENT, LilycoveCity_LilycoveMuseum_2F_EventScript_219921 goto_if_set FLAG_RECEIVED_GLASS_ORNAMENT, LilycoveCity_LilycoveMuseum_2F_EventScript_219921
specialvar VAR_0x8004, sub_80F8940 specialvar VAR_0x8004, CountPlayerContestPaintings
switch VAR_0x8004 switch VAR_0x8004
case 1, LilycoveCity_LilycoveMuseum_2F_EventScript_2198BA case 1, LilycoveCity_LilycoveMuseum_2F_EventScript_2198BA
case 2, LilycoveCity_LilycoveMuseum_2F_EventScript_2198BA case 2, LilycoveCity_LilycoveMuseum_2F_EventScript_2198BA

View File

@ -16,7 +16,7 @@ LittlerootTown_ProfessorBirchsLab_MapScript1_1F9CA1: @ 81F9CA1
end end
LittlerootTown_ProfessorBirchsLab_EventScript_1F9CCD:: @ 81F9CCD LittlerootTown_ProfessorBirchsLab_EventScript_1F9CCD:: @ 81F9CCD
specialvar VAR_RESULT, sub_80C08E4 specialvar VAR_RESULT, HasAllHoennMons
compare VAR_RESULT, 1 compare VAR_RESULT, 1
goto_if_eq LittlerootTown_ProfessorBirchsLab_EventScript_1F9CE9 goto_if_eq LittlerootTown_ProfessorBirchsLab_EventScript_1F9CE9
setobjectmovementtype 3, 3 setobjectmovementtype 3, 3

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -249,15 +249,3 @@ gUnknown_0862608C:: @ 862608C
gUnknown_0862609C:: @ 862609C gUnknown_0862609C:: @ 862609C
.incbin "data/unknown_jp_62609C.bin" .incbin "data/unknown_jp_62609C.bin"
gUnknown_08626814:: @ 8626814
.incbin "data/pokenav/unk_struct_1.bin"
gUnknown_086276FC:: @ 86276FC
.incbin "data/pokenav/unk_struct_2.bin"
gUnknown_086285E4:: @ 86285E4
.incbin "data/pokenav/unk_struct_3.bin"
gUnknown_086294CC:: @ 86294CC
.incbin "data/pokenav/unk_struct_4.bin"

View File

@ -148,7 +148,7 @@ gSpecials:: @ 81DBA64
def_special sub_80F88E8 def_special sub_80F88E8
def_special sub_80F88DC def_special sub_80F88DC
def_special sub_80F8864 def_special sub_80F8864
def_special sub_80F8940 def_special CountPlayerContestPaintings
def_special ShowContestWinner def_special ShowContestWinner
def_special MauvilleGymSpecial2 def_special MauvilleGymSpecial2
def_special MauvilleGymSpecial1 def_special MauvilleGymSpecial1
@ -345,7 +345,7 @@ gSpecials:: @ 81DBA64
def_special sub_80B05B4 def_special sub_80B05B4
def_special SetPacifidlogTMReceivedDay def_special SetPacifidlogTMReceivedDay
def_special GetDaysUntilPacifidlogTMAvailable def_special GetDaysUntilPacifidlogTMAvailable
def_special sub_80C08E4 def_special HasAllHoennMons
def_special MonOTNameMatchesPlayer def_special MonOTNameMatchesPlayer
def_special BufferLottoTicketNumber def_special BufferLottoTicketNumber
def_special sub_81653CC def_special sub_81653CC
@ -481,7 +481,7 @@ gSpecials:: @ 81DBA64
def_special sub_813B7D8 def_special sub_813B7D8
def_special sub_81C72A4 def_special sub_81C72A4
def_special sp106_CreateStartMenu def_special sp106_CreateStartMenu
def_special sub_80C2E40 def_special CountPlayerTrainerStars
def_special sub_813AC7C def_special sub_813AC7C
def_special sub_813ADB8 def_special sub_813ADB8
def_special sub_813ADD4 def_special sub_813ADD4

View File

@ -1,402 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.section .rodata
.macro unk_trainer_card_struct text1, text2, short1, short2, short3, short4
.4byte \text1
.4byte \text2
.2byte \short1
.2byte \short2
.2byte \short3
.2byte \short4
.endm
.align 2
gUnknown_0856F018:: @ 856F018
.incbin "graphics/trainer_card/stickers_fr.4bpp.lz"
.align 2
gUnknown_0856F18C:: @ 856F18C
.incbin "graphics/trainer_card/unknown_56F18C.gbapal"
.align 2
gEmeraldTrainerCard1Star_Pal:: @ 856F1AC
.incbin "graphics/trainer_card/one_star.gbapal"
.align 2
gFireRedTrainerCard1Star_Pal:: @ 856F20C
.incbin "graphics/trainer_card/one_star_fr.gbapal"
.align 2
gEmeraldTrainerCard2Star_Pal:: @ 856F26C
.incbin "graphics/trainer_card/two_stars.gbapal"
.align 2
gFireRedTrainerCard2Star_Pal:: @ 856F2CC
.incbin "graphics/trainer_card/two_stars_fr.gbapal"
.align 2
gEmeraldTrainerCard3Star_Pal:: @ 856F32C
.incbin "graphics/trainer_card/three_stars.gbapal"
.align 2
gFireRedTrainerCard3Star_Pal:: @ 856F38C
.incbin "graphics/trainer_card/three_stars_fr.gbapal"
.align 2
gEmeraldTrainerCard4Star_Pal:: @ 856F3EC
.incbin "graphics/trainer_card/four_stars.gbapal"
.align 2
gFireRedTrainerCard4Star_Pal:: @ 856F44C
.incbin "graphics/trainer_card/four_stars_fr.gbapal"
.align 2
gUnknown_0856F4AC:: @ 856F4AC
.incbin "graphics/trainer_card/female_bg.gbapal"
.align 2
gUnknown_0856F4CC:: @ 856F4CC
.incbin "graphics/trainer_card/female_bg_fr.gbapal"
.align 2
gUnknown_0856F4EC:: @ 856F4EC
.incbin "graphics/trainer_card/badges.gbapal"
.align 2
gUnknown_0856F50C:: @ 856F50C
.incbin "graphics/trainer_card/badges_fr.gbapal"
.align 2
gUnknown_0856F52C:: @ 856F52C
.incbin "graphics/trainer_card/gold.gbapal"
.align 2
gUnknown_0856F54C:: @ 856F54C
.incbin "graphics/trainer_card/stickers_fr1.gbapal"
.align 2
gUnknown_0856F56C:: @ 856F56C
.incbin "graphics/trainer_card/stickers_fr2.gbapal"
.align 2
gUnknown_0856F58C:: @ 856F58C
.incbin "graphics/trainer_card/stickers_fr3.gbapal"
.align 2
gUnknown_0856F5AC:: @ 856F5AC
.incbin "graphics/trainer_card/stickers_fr4.gbapal"
.align 2
gUnknown_0856F5CC:: @ 856F5CC
.incbin "graphics/trainer_card/badges.4bpp.lz"
.align 2
gUnknown_0856F814:: @ 856F814
.incbin "graphics/trainer_card/badges_fr.4bpp.lz"
.align 2
gUnknown_0856FAB4:: @ 856FAB4
.4byte 0x000025b0, 0x000001d9, 0x000031e2, 0x003011f3
.align 2
gUnknown_0856FAC4:: @ 856FAC4
window_template 0x01, 0x02, 0x0f, 0x1b, 0x04, 0x0f, 0x0253
window_template 0x01, 0x01, 0x01, 0x1c, 0x12, 0x0f, 0x0001
window_template 0x03, 0x13, 0x05, 0x09, 0x0a, 0x08, 0x0150
null_window_template
.align 2
gEmeraldTrainerCardStarPals:: @ 856FAE4
.4byte gEmeraldTrainerCard0Star_Pal
.4byte gEmeraldTrainerCard1Star_Pal
.4byte gEmeraldTrainerCard2Star_Pal
.4byte gEmeraldTrainerCard3Star_Pal
.4byte gEmeraldTrainerCard4Star_Pal
.align 2
gFireRedTrainerCardStarPals:: @ 856FAF8
.4byte gFireRedTrainerCard0Star_Pal
.4byte gFireRedTrainerCard1Star_Pal
.4byte gFireRedTrainerCard2Star_Pal
.4byte gFireRedTrainerCard3Star_Pal
.4byte gFireRedTrainerCard4Star_Pal
gUnknown_0856FB0C:: @ 856FB0C
.byte 0x00, 0x02, 0x03
gUnknown_0856FB0F:: @ 856FB0F
.byte 0x00, 0x04, 0x05
gUnknown_0856FB12:: @ 856FB12
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
gUnknown_0856FB18:: @ 856FB18
.byte 0x0d, 0x04, 0x0d, 0x04, 0x01, 0x00, 0x01, 0x00
gUnknown_0856FB20:: @ 856FB20
.byte 0x4e, 0x4f, 0x50, 0x51, 0x3c, 0x3f
.align 2
gUnknown_0856FB28:: @ 856FB28
.4byte sub_80C4998
.4byte sub_80C49D8
.4byte sub_80C4B08
.4byte sub_80C4C1C
.4byte sub_80C4C84
.4byte sub_80C4DB0
.align 2
gUnknown_0856FB40:: @ 856FB40
.4byte gUnknown_0856FB0C
.4byte gUnknown_0856FB12
gUnknown_0856FB48:: @ 856FB48
.byte 0x71, 0x68
gUnknown_0856FB4A:: @ 856FB4A
.byte 0x81, 0x78
gUnknown_0856FB4C:: @ 856FB4C
.byte 0xfd, 0x02, 0xf0, 0xfd, 0x03, 0xf0, 0xfd, 0x04, 0xff
gUnknown_0856FB55:: @ 856FB55
.byte 0x08, 0x10
gUnknown_0856FB57:: @ 856FB57
.byte 0xd8, 0xd8
.align 2
gUnknown_0856FB5C:: @ 856FB5C
.4byte gText_LinkBattles
.4byte gText_LinkCableBattles
.4byte gText_LinkBattles
gUnknown_0856FB68:: @ 856FB68
.byte 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a
gUnknown_0856FB6E:: @ 856FB6E
.byte 0x00, 0x04, 0x08, 0x0c, 0x10, 0x14
gUnknown_0856FB74:: @ 856FB74
.byte 0x0b, 0x0c, 0x0d, 0x0e
gUnknown_0856FB78:: @ 856FB78
.byte 0x07, 0x07
.align 2
gUnknown_0856FB7C:: @ 856FB7C
.incbin "graphics/frontier_pass/map_heads.gbapal"
.align 2
gUnknown_0856FB9C:: @ 856FB9C
.incbin "graphics/frontier_pass/map_heads_female.gbapal"
.align 2
gUnknown_0856FBBC:: @ 856FBBC
.incbin "graphics/frontier_pass/map_screen.4bpp.lz"
.align 2
gFrontierPassCursor_Gfx:: @ 8570BA8
.incbin "graphics/frontier_pass/cursor.4bpp.lz"
.align 2
gUnknown_08570C44:: @ 8570C44
.incbin "graphics/frontier_pass/map_heads.4bpp.lz"
.align 2
gFrontierPassMapCursor_Gfx:: @ 8570D00
.incbin "graphics/frontier_pass/map_cursor.4bpp.lz"
.align 2
gUnknown_08570E00:: @ 8570E00
.incbin "graphics/frontier_pass/map_screen.bin.lz"
.align 2
gUnknown_08571060:: @ 8571060
.incbin "graphics/frontier_pass/small_map_and_card.bin.lz"
.align 2
gUnknown_08571298:: @ 8571298
.incbin "graphics/frontier_pass/unknown_571298.bin"
.align 2
gUnknown_085712C0:: @ 85712C0
.incbin "graphics/frontier_pass/record_frame.bin.lz"
.align 2
gUnknown_085712F8:: @ 85712F8
.incbin "graphics/frontier_pass/small_map_and_card_affine.bin.lz"
gUnknown_085713E0:: @ 85713E0
.2byte 0x00d8, 0x0020, 0x00d8, 0x0080
.align 2
gUnknown_085713E8:: @ 85713E8
.4byte 0x000011f8, 0x000021e1, 0x00000bd6
.align 2
gUnknown_085713F4:: @ 85713F4
.4byte 0x000001f8, 0x000011e1, 0x000021d2
.align 2
gUnknown_08571400:: @ 8571400
window_template 0x00, 0x02, 0x03, 0x0c, 0x03, 0x0f, 0x0001
window_template 0x00, 0x02, 0x0a, 0x0c, 0x03, 0x0f, 0x0026
window_template 0x00, 0x02, 0x0d, 0x0c, 0x04, 0x0f, 0x004b
window_template 0x00, 0x00, 0x12, 0x1e, 0x03, 0x0f, 0x007c
window_template 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000
.align 2
gUnknown_08571428:: @ 8571428
window_template 0x00, 0x00, 0x01, 0x0f, 0x05, 0x0f, 0x0001
window_template 0x00, 0x14, 0x01, 0x0a, 0x0e, 0x0f, 0x004d
window_template 0x00, 0x02, 0x10, 0x1a, 0x04, 0x0f, 0x00da
window_template 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000
gUnknown_08571448:: @ 8571448
.byte 0x00, 0x02, 0x03
gUnknown_0857144B:: @ 857144B
.byte 0x00, 0x01, 0x09
gUnknown_0857144E:: @ 857144E
.byte 0x00, 0x04, 0x05
.align 2
gUnknown_08571454:: @ 8571454
.2byte 0x001c, 0x004c, 0x0084, 0x00dc, 0x0054, 0x0084, 0x0084, 0x00dc, 0x0050, 0x0066, 0x0014, 0x006c, 0x0000, 0x0010, 0x0098, 0x00f0
.2byte 0x006c, 0x0086, 0x0014, 0x006c, 0x0018, 0x0030, 0x0014, 0x006c, 0x0032, 0x0042, 0x0014, 0x0024, 0x0042, 0x0052, 0x0020, 0x0030
.2byte 0x0032, 0x0042, 0x002c, 0x003c, 0x0042, 0x0052, 0x0038, 0x0048, 0x0032, 0x0042, 0x0044, 0x0054, 0x0042, 0x0052, 0x0050, 0x0060
.2byte 0x0032, 0x0042, 0x005c, 0x006c
.align 2
gUnknown_085714BC:: @ 85714BC
obj_tiles gFrontierPassCursor_Gfx, 0x100, 0
obj_tiles gFrontierPassMapCursor_Gfx, 0x400, 1
obj_tiles gFrontierPassMedals_Gfx, 0x380, 2
.align 2
gUnknown_085714D4:: @ 85714D4
obj_tiles gUnknown_08570C44, 0x100, 4
null_obj_tiles
.align 2
gUnknown_085714E4:: @ 85714E4
obj_pal gFrontierPassCursor_Pal, 0
obj_pal gFrontierPassMapCursor_Pal, 1
obj_pal gFrontierPassMedalsSilver_Pal, 2
obj_pal gFrontierPassMedalsGold_Pal, 3
obj_pal gUnknown_0856FB7C, 4
obj_pal gUnknown_0856FB9C, 5
null_obj_pal
.align 2
gSpriteAnim_857151C:: @ 857151C
.2byte 0x0000, 0x0000, 0xffff, 0x0000
.align 2
gSpriteAnim_8571524:: @ 8571524
.2byte 0x0000, 0x0000, 0xffff, 0x0000
.align 2
gSpriteAnim_857152C:: @ 857152C
.2byte 0x0004, 0x0000, 0xffff, 0x0000
.align 2
gSpriteAnim_8571534:: @ 8571534
.2byte 0x0008, 0x0000, 0xffff, 0x0000
.align 2
gSpriteAnim_857153C:: @ 857153C
.2byte 0x000c, 0x0000, 0xffff, 0x0000
.align 2
gSpriteAnim_8571544:: @ 8571544
.2byte 0x0010, 0x0000, 0xffff, 0x0000
.align 2
gSpriteAnim_857154C:: @ 857154C
.2byte 0x0014, 0x0000, 0xffff, 0x0000
.align 2
gSpriteAnim_8571554:: @ 8571554
.2byte 0x0018, 0x0000, 0xffff, 0x0000
.align 2
gSpriteAnim_857155C:: @ 857155C
.2byte 0x0000, 0x002d, 0x0008, 0x002d, 0xfffe, 0x0000
.align 2
gSpriteAnim_8571568:: @ 8571568
.2byte 0x0010, 0x002d, 0x0018, 0x002d, 0xfffe, 0x0000
.align 2
gSpriteAnimTable_08571574:: @ 8571574
.4byte gSpriteAnim_8571524
.4byte gSpriteAnim_857152C
.align 2
gSpriteAnimTable_0857157C:: @ 857157C
.4byte gSpriteAnim_8571524
.4byte gSpriteAnim_857152C
.4byte gSpriteAnim_8571534
.4byte gSpriteAnim_857153C
.4byte gSpriteAnim_8571544
.4byte gSpriteAnim_857154C
.4byte gSpriteAnim_8571554
.align 2
gSpriteAnimTable_08571598:: @ 8571598
.4byte gSpriteAnim_857155C
.4byte gSpriteAnim_8571568
.align 2
gSpriteAffineAnim_085715A0:: @ 85715A0
.2byte 0x0100, 0x0100, 0x0000, 0x0000, 0x7fff, 0x0000, 0x0000, 0x0000
.align 2
gSpriteAffineAnimTable_085715B0:: @ 85715B0
.4byte gSpriteAffineAnim_085715A0
.align 2
gUnknown_085715B4:: @ 85715B4
spr_template 0, 0, gUnknown_0852490C, gSpriteAnimTable_08571574, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy
spr_template 1, 1, gUnknown_08524934, gSpriteAnimTable_08571598, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy
.align 2
gUnknown_085715E4:: @ 85715E4
spr_template 2, 2, gUnknown_0852490C, gSpriteAnimTable_0857157C, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy
.align 2
gUnknown_085715FC:: @ 85715FC
spr_template 4, 4, gUnknown_0852490C, gSpriteAnimTable_08571574, NULL, gDummySpriteAffineAnimTable, nullsub_39
.align 2
gUnknown_08571614:: @ 8571614
.4byte gUnknown_085EDA96
.4byte gUnknown_085ED932
.4byte gUnknown_085ED94D
.4byte gUnknown_085ED961
.4byte gUnknown_085ED977
.4byte gUnknown_085ED993
.4byte gUnknown_085ED9AF
.4byte gUnknown_085ED9C7
.4byte gUnknown_085ED9E5
.4byte gUnknown_085EDA02
.4byte gUnknown_085EDA21
.4byte gUnknown_085EDA3C
.4byte gUnknown_085EDA5E
.4byte gUnknown_085EDA78
.4byte gUnknown_085ED931
.align 2
gUnknown_08571650:: @ 8571650
unk_trainer_card_struct gUnknown_085EDAB1, gUnknown_085EDB0F, 0x59, 0x28, 1, 0
unk_trainer_card_struct gUnknown_085EDABE, gUnknown_085EDB4E, 0x21, 0x2A, 1, 0
unk_trainer_card_struct gUnknown_085EDACA, gUnknown_085EDB8B, 0x78, 0x56, 0, 0
unk_trainer_card_struct gUnknown_085EDAD8, gUnknown_085EDBC2, 0x72, 0x3B, 0, 0
unk_trainer_card_struct gUnknown_085EDAE5, gUnknown_085EDC00, 0x19, 0x43, 0, 0
unk_trainer_card_struct gUnknown_085EDAF4, gUnknown_085EDC45, 0x39, 0x39, 1, 0
unk_trainer_card_struct gUnknown_085EDB00, gUnknown_085EDC84, 0x86, 0x29, 1, 0

View File

@ -61,7 +61,7 @@ s32 GetBgX(u8 bg);
s32 ChangeBgY(u8 bg, s32 value, u8 op); s32 ChangeBgY(u8 bg, s32 value, u8 op);
s32 ChangeBgY_ScreenOff(u8 bg, u32 value, u8 op); s32 ChangeBgY_ScreenOff(u8 bg, u32 value, u8 op);
s32 GetBgY(u8 bg); s32 GetBgY(u8 bg);
void SetBgAffine(u8 bg, u32 srcCenterX, u32 srcCenterY, s16 dispCenterX, s16 dispCenterY, s16 scaleX, s16 scaleY, u16 rotationAngle); void SetBgAffine(u8 bg, s32 srcCenterX, s32 srcCenterY, s16 dispCenterX, s16 dispCenterY, s16 scaleX, s16 scaleY, u16 rotationAngle);
u8 Unused_AdjustBgMosaic(u8 a1, u8 a2); u8 Unused_AdjustBgMosaic(u8 a1, u8 a2);
void SetBgTilemapBuffer(u8 bg, void *tilemap); void SetBgTilemapBuffer(u8 bg, void *tilemap);
void UnsetBgTilemapBuffer(u8 bg); void UnsetBgTilemapBuffer(u8 bg);

7
include/frontier_pass.h Normal file
View File

@ -0,0 +1,7 @@
#ifndef GUARD_FRONTIER_PASS_H
#define GUARD_FRONTIER_PASS_H
void ShowFrontierPass(void (*callback)(void));
void CB2_ReshowFrontierPass(void);
#endif // GUARD_FRONTIER_PASS_H

View File

@ -4846,4 +4846,32 @@ extern const u16 gUnknown_08DC64E8[];
extern const u16 gUnknown_08DC64FC[]; extern const u16 gUnknown_08DC64FC[];
extern const u16 gUnknown_08DC6510[]; extern const u16 gUnknown_08DC6510[];
// Trainer Card.
extern const u16 gEmeraldTrainerCard0Star_Pal[];
extern const u32 gEmeraldTrainerCard_Gfx[];
extern const u16 gFireRedTrainerCard0Star_Pal[];
extern const u32 gFireRedTrainerCard_Gfx[];
extern const u32 gUnknown_08DD2AE0[];
extern const u32 gUnknown_08DD21B0[];
extern const u32 gUnknown_08DD2D30[];
extern const u32 gUnknown_08DD2010[];
extern const u32 gUnknown_08DD2B78[];
extern const u32 gUnknown_08DD228C[];
extern const u32 gUnknown_08DD2E5C[];
extern const u32 gUnknown_08DD1F78[];
// Frontier Pass
extern const u32 gUnknown_08DE08C8[];
extern const u32 gUnknown_08DE2084[];
extern const u32 gUnknown_08DE3350[];
extern const u32 gUnknown_08DE3374[];
extern const u32 gUnknown_08DE3060[];
extern const u32 gFrontierPassMedals_Gfx[];
extern const u16 gUnknown_08DE07C8[][16];
extern const u16 gFrontierPassCursor_Pal[];
extern const u16 gFrontierPassMedalsGold_Pal[];
extern const u16 gFrontierPassMedalsSilver_Pal[];
extern const u16 gFrontierPassMapCursor_Pal[];
#endif //GUARD_GRAPHICS_H #endif //GUARD_GRAPHICS_H

View File

@ -63,8 +63,12 @@ void TintPlttBuffer(u32, s8, s8, s8);
void UnfadePlttBuffer(u32); void UnfadePlttBuffer(u32);
void BeginFastPaletteFade(u8); void BeginFastPaletteFade(u8);
void BeginHardwarePaletteFade(u8, u8, u8, u8, u8); void BeginHardwarePaletteFade(u8, u8, u8, u8, u8);
void BlendPalettes(u32, u8, u16); void BlendPalettes(u32 selectedPalettes, u8 coeff, u16 color);
void BlendPalettesUnfaded(u32, u8, u16); void BlendPalettesUnfaded(u32, u8, u16);
void sub_80A2C44(u32 a1, s8 a2, u8 a3, u8 a4, u16 a5, u8 a6, u8 a7); void sub_80A2C44(u32 a1, s8 a2, u8 a3, u8 a4, u16 a5, u8 a6, u8 a7);
void TintPalette_GrayScale(u16 *palette, u16 count);
void TintPalette_GrayScale2(u16 *palette, u16 count);
void TintPalette_SepiaTone(u16 *palette, u16 count);
void TintPalette_CustomTone(u16 *palette, u16 count, u16 rTone, u16 gTone, u16 bTone);
#endif // GUARD_PALETTE_H #endif // GUARD_PALETTE_H

View File

@ -41,5 +41,6 @@ u16 GetHoennPokedexCount(u8);
u8 CreateDexDisplayMonDataTask(u16 dexNum, u32 trainerId, u32 personality); u8 CreateDexDisplayMonDataTask(u16 dexNum, u32 trainerId, u32 personality);
s8 GetSetPokedexFlag(u16 nationalNum, u8 caseId); s8 GetSetPokedexFlag(u16 nationalNum, u8 caseId);
u16 CreateMonSpriteFromNationalDexNumber(u16, s16, s16, u16); u16 CreateMonSpriteFromNationalDexNumber(u16, s16, s16, u16);
bool16 HasAllHoennMons(void);
#endif // GUARD_POKEDEX_H #endif // GUARD_POKEDEX_H

View File

@ -25,6 +25,7 @@ struct PokemonStorage
extern struct PokemonStorage *gPokemonStoragePtr; extern struct PokemonStorage *gPokemonStoragePtr;
void sub_80C6D80(const u8 *string, void *dst, u8 arg2, u8 arg3, s32 arg4);
u8 CountMonsInBox(u8 boxId); u8 CountMonsInBox(u8 boxId);
s16 GetFirstFreeBoxSpot(u8 boxId); s16 GetFirstFreeBoxSpot(u8 boxId);
u8 CountPartyAliveNonEggMonsExcept(u8 slotToIgnore); u8 CountPartyAliveNonEggMonsExcept(u8 slotToIgnore);

View File

@ -4,5 +4,6 @@
u16 sub_80F903C(void); u16 sub_80F903C(void);
void ReducePlayerPartyToSelectedMons(void); void ReducePlayerPartyToSelectedMons(void);
void HealPlayerParty(void); void HealPlayerParty(void);
u8 CountPlayerContestPaintings(void);
#endif // GUARD_SCRIPT_POKEMON_UTIL_80F87D8_H #endif // GUARD_SCRIPT_POKEMON_UTIL_80F87D8_H

View File

@ -34,7 +34,7 @@ u8 *StringFill(u8 *dest, u8 c, u16 n);
u8 *StringCopyPadded(u8 *dest, const u8 *src, u8 c, u16 n); u8 *StringCopyPadded(u8 *dest, const u8 *src, u8 c, u16 n);
u8 *StringFillWithTerminator(u8 *dest, u16 n); u8 *StringFillWithTerminator(u8 *dest, u16 n);
u8 *StringCopyN_Multibyte(u8 *dest, u8 *src, u32 n); u8 *StringCopyN_Multibyte(u8 *dest, u8 *src, u32 n);
u32 StringLength_Multibyte(u8 *str); u32 StringLength_Multibyte(const u8 *str);
u8 *WriteColorChangeControlCode(u8 *dest, u32 colorType, u8 color); u8 *WriteColorChangeControlCode(u8 *dest, u32 colorType, u8 color);
bool32 IsStringJapanese(u8 *str); bool32 IsStringJapanese(u8 *str);
bool32 sub_800924C(u8 *str, s32 n); bool32 sub_800924C(u8 *str, s32 n);

View File

@ -2222,4 +2222,65 @@ extern const u8 gText_PreliminaryResults[];
extern const u8 gText_Round2Results[]; extern const u8 gText_Round2Results[];
extern const u8 gText_Var1sVar2Won[]; extern const u8 gText_Var1sVar2Won[];
#endif //GUARD_STRINGS_H // Trainer Card
extern const u8 gText_LinkCableBattles[];
extern const u8 gText_LinkBattles[];
extern const u8 gText_WaitingTrainerFinishReading[];
extern const u8 gText_TrainerCardName[];
extern const u8 gText_TrainerCardIDNo[];
extern const u8 gText_TrainerCardMoney[];
extern const u8 gText_PokedollarVar1[];
extern const u8 gText_EmptyString6[];
extern const u8 gText_TrainerCardPokedex[];
extern const u8 gText_TrainerCardTime[];
extern const u8 gText_Colon2[];
extern const u8 gText_Var1sTrainerCard[];
extern const u8 gText_HallOfFameDebut[];
extern const u8 gText_WinsLosses[];
extern const u8 gText_PokemonTrades[];
extern const u8 gText_BerryCrush[];
extern const u8 gText_UnionTradesAndBattles[];
extern const u8 gText_Var1DarkGreyShadowLightGrey[];
extern const u8 gText_PokeblocksWithFriends[];
extern const u8 gText_WonContestsWFriends[];
extern const u8 gText_WSlashStraightSlash[];
extern const u8 gText_Var1DarkLightGreyBP[];
extern const u8 gText_BattleTower[];
extern const u8 gText_BattlePtsWon[];
// Frontier Pass
extern const u8 gText_SymbolsEarned[];
extern const u8 gText_BattleRecord[];
extern const u8 gText_BattlePoints[];
extern const u8 gUnknown_085EDA96[];
extern const u8 gUnknown_085ED932[];
extern const u8 gUnknown_085ED94D[];
extern const u8 gUnknown_085ED961[];
extern const u8 gUnknown_085ED977[];
extern const u8 gUnknown_085ED993[];
extern const u8 gUnknown_085ED9AF[];
extern const u8 gUnknown_085ED9C7[];
extern const u8 gUnknown_085ED9E5[];
extern const u8 gUnknown_085EDA02[];
extern const u8 gUnknown_085EDA21[];
extern const u8 gUnknown_085EDA3C[];
extern const u8 gUnknown_085EDA5E[];
extern const u8 gUnknown_085EDA78[];
extern const u8 gUnknown_085ED931[];
extern const u8 gUnknown_085EDAB1[];
extern const u8 gUnknown_085EDB0F[];
extern const u8 gUnknown_085EDABE[];
extern const u8 gUnknown_085EDB4E[];
extern const u8 gUnknown_085EDACA[];
extern const u8 gUnknown_085EDB8B[];
extern const u8 gUnknown_085EDAD8[];
extern const u8 gUnknown_085EDBC2[];
extern const u8 gUnknown_085EDAE5[];
extern const u8 gUnknown_085EDC00[];
extern const u8 gUnknown_085EDAF4[];
extern const u8 gUnknown_085EDC45[];
extern const u8 gUnknown_085EDB00[];
extern const u8 gUnknown_085EDC84[];
#endif // GUARD_STRINGS_H

View File

@ -6,38 +6,47 @@ struct TrainerCard
/*0x00*/ u8 gender; /*0x00*/ u8 gender;
/*0x01*/ u8 stars; /*0x01*/ u8 stars;
/*0x02*/ bool8 hasPokedex; /*0x02*/ bool8 hasPokedex;
/*0x03*/ bool8 var_3; /*0x03*/ bool8 caughtAllHoenn;
/*0x04*/ bool8 var_4; /*0x04*/ bool8 hasAllPaintings;
/*0x05*/ u8 var_5; /*0x06*/ u16 hofDebutHours;
/*0x06*/ u16 firstHallOfFameA; /*0x08*/ u16 hofDebutMinutes;
/*0x08*/ u16 firstHallOfFameB; /*0x0A*/ u16 hofDebutSeconds;
/*0x0A*/ u16 firstHallOfFameC; /*0x0C*/ u16 caughtMonsCount;
/*0x0C*/ u16 pokedexSeen;
/*0x0E*/ u16 trainerId; /*0x0E*/ u16 trainerId;
/*0x10*/ u16 playTimeHours; /*0x10*/ u16 playTimeHours;
/*0x12*/ u16 playTimeMinutes; /*0x12*/ u16 playTimeMinutes;
/*0x14*/ u16 linkBattleWins; /*0x14*/ u16 linkBattleWins;
/*0x16*/ u16 linkBattleLosses; /*0x16*/ u16 linkBattleLosses;
/*0x18*/ u16 battleTowerWins; /*0x18*/ u16 battleTowerWins;
/*0x1A*/ u16 battleTowerLosses; /*0x1A*/ u16 battleTowerStraightWins;
/*0x1C*/ u16 contestsWithFriends; /*0x1C*/ u16 contestsWithFriends;
/*0x1E*/ u16 pokeblocksWithFriends; /*0x1E*/ u16 pokeblocksWithFriends;
/*0x20*/ u16 pokemonTrades; /*0x20*/ u16 pokemonTrades;
/*0x22*/ u16 var_22;
/*0x24*/ u32 money; /*0x24*/ u32 money;
/*0x28*/ u16 var_28[4]; /*0x28*/ u16 var_28[4];
/*0x30*/ u8 playerName[8]; /*0x30*/ u8 playerName[PLAYER_NAME_LENGTH + 1];
/*0x38*/ u8 emeraldAddedUnknownFields[0x54-0x38]; /*0x38*/ u8 version;
/*0x54*/ u16 monSpecies[2]; /*0x3A*/ u16 var_3A;
/*0x58*/ u8 emeraldAddedUnknownFields2[0x64-0x58]; /*0x3C*/ u32 berryCrushPoints;
/*0x40*/ u32 unionRoomNum;
/*0x44*/ u8 filler44[0x8];
/*0x4C*/ u8 var_4C;
/*0x4D*/ u8 var_4D;
/*0x4E*/ u8 var_4E;
/*0x4F*/ u8 var_4F;
/*0x50*/ u8 var_50[0x4];
/*0x54*/ u16 monSpecies[PARTY_SIZE];
/*0x60*/ bool16 hasAllSymbols;
/*0x62*/ u16 frontierBP;
}; };
extern struct TrainerCard gTrainerCards[4]; extern struct TrainerCard gTrainerCards[4];
void sub_80C3120(struct TrainerCard *arg0, u16 *arg1, u8 gameVersion); u32 CountPlayerTrainerStars(void);
void TrainerCard_ShowLinkCard(u8 arg0, void (*callback)(void)); u8 sub_80C4904(u8 cardId);
void CopyTrainerCardData(struct TrainerCard *dst, u16 *src, u8 gameVersion);
void ShowPlayerTrainerCard(void (*callback)(void));
void ShowTrainerCardInLink(u8 arg0, void (*callback)(void));
void TrainerCard_GenerateCardForPlayer(struct TrainerCard *); void TrainerCard_GenerateCardForPlayer(struct TrainerCard *);
u8 sub_80C4904(u8);
void sub_80C6D80(const u8 *, u8 *, u8, u8, u8);
#endif // GUARD_TRAINER_CARD_H #endif // GUARD_TRAINER_CARD_H

View File

@ -124,7 +124,8 @@ SECTIONS {
src/scanline_effect.o(.text); src/scanline_effect.o(.text);
src/option_menu.o(.text); src/option_menu.o(.text);
src/pokedex.o(.text); src/pokedex.o(.text);
asm/trainer_card.o(.text); src/trainer_card.o(.text);
src/frontier_pass.o(.text);
src/pokemon_storage_system.o(.text); src/pokemon_storage_system.o(.text);
src/pokemon_icon.o(.text); src/pokemon_icon.o(.text);
src/script_movement.o(.text); src/script_movement.o(.text);
@ -457,7 +458,8 @@ SECTIONS {
src/field_effect.o(.rodata); src/field_effect.o(.rodata);
src/option_menu.o(.rodata); src/option_menu.o(.rodata);
src/pokedex.o(.rodata); src/pokedex.o(.rodata);
data/trainer_card.o(.rodata); src/trainer_card.o(.rodata);
src/frontier_pass.o(.rodata);
src/pokemon_storage_system.o(.rodata); src/pokemon_storage_system.o(.rodata);
src/pokemon_icon.o(.rodata); src/pokemon_icon.o(.rodata);
src/fldeff_cut.o(.rodata); src/fldeff_cut.o(.rodata);

View File

@ -246,7 +246,7 @@ void SetTextModeAndHideBgs(void)
SetGpuReg(REG_OFFSET_DISPCNT, GetGpuReg(REG_OFFSET_DISPCNT) & ~DISPCNT_ALL_BG_AND_MODE_BITS); SetGpuReg(REG_OFFSET_DISPCNT, GetGpuReg(REG_OFFSET_DISPCNT) & ~DISPCNT_ALL_BG_AND_MODE_BITS);
} }
static void SetBgAffineInternal(u8 bg, u32 srcCenterX, u32 srcCenterY, s16 dispCenterX, s16 dispCenterY, s16 scaleX, s16 scaleY, u16 rotationAngle) static void SetBgAffineInternal(u8 bg, s32 srcCenterX, s32 srcCenterY, s16 dispCenterX, s16 dispCenterY, s16 scaleX, s16 scaleY, u16 rotationAngle)
{ {
struct BgAffineSrcData src; struct BgAffineSrcData src;
struct BgAffineDstData dest; struct BgAffineDstData dest;
@ -777,7 +777,7 @@ s32 GetBgY(u8 bg)
return sGpuBgConfigs2[bg].bg_y; return sGpuBgConfigs2[bg].bg_y;
} }
void SetBgAffine(u8 bg, u32 srcCenterX, u32 srcCenterY, s16 dispCenterX, s16 dispCenterY, s16 scaleX, s16 scaleY, u16 rotationAngle) void SetBgAffine(u8 bg, s32 srcCenterX, s32 srcCenterY, s16 dispCenterX, s16 dispCenterY, s16 scaleX, s16 scaleY, u16 rotationAngle)
{ {
SetBgAffineInternal(bg, srcCenterX, srcCenterY, dispCenterX, dispCenterY, scaleX, scaleY, rotationAngle); SetBgAffineInternal(bg, srcCenterX, srcCenterY, dispCenterX, dispCenterY, scaleX, scaleY, rotationAngle);
} }

View File

@ -498,7 +498,7 @@ static void sub_80B2C30(u8 taskId)
for (index = 0; index < GetLinkPlayerCount(); index++) for (index = 0; index < GetLinkPlayerCount(); index++)
{ {
sub_80C3120(&gTrainerCards[index], gBlockRecvBuffer[index], gLinkPlayers[index].version); CopyTrainerCardData(&gTrainerCards[index], gBlockRecvBuffer[index], gLinkPlayers[index].version);
} }
SetSuppressLinkErrorMessage(FALSE); SetSuppressLinkErrorMessage(FALSE);
@ -1176,7 +1176,7 @@ static void sub_80B39A4(void)
void sp02A_crash_sound(void) void sp02A_crash_sound(void)
{ {
TrainerCard_ShowLinkCard(gSpecialVar_0x8006, CB2_ReturnToFieldContinueScriptPlayMapMusic); ShowTrainerCardInLink(gSpecialVar_0x8006, CB2_ReturnToFieldContinueScriptPlayMapMusic);
} }
bool32 sub_80B39D4(u8 linkPlayerIndex) bool32 sub_80B39D4(u8 linkPlayerIndex)

File diff suppressed because it is too large Load Diff

1709
src/frontier_pass.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1590,7 +1590,7 @@ const u32 gUnknown_08DE0644[] = INCBIN_U32("graphics/title_screen/title_screen2.
// more trainer card stuff // more trainer card stuff
const u16 gUnknown_08DE07C8[] = INCBIN_U16("graphics/frontier_pass/tiles.gbapal");// size in LoadPalette calls is reported as 0xD0 << 1, which is 0x1A0, but palette is only 0x100 bytes long so it loads garbage as well const u16 gUnknown_08DE07C8[][16] = INCBIN_U16("graphics/frontier_pass/tiles.gbapal");// size in LoadPalette calls is reported as 0xD0 << 1, which is 0x1A0, but palette is only 0x100 bytes long so it loads garbage as well
const u32 gUnknown_08DE08C8[] = INCBIN_U32("graphics/frontier_pass/tiles.4bpp.lz"); const u32 gUnknown_08DE08C8[] = INCBIN_U32("graphics/frontier_pass/tiles.4bpp.lz");
const u32 gUnknown_08DE2084[] = INCBIN_U32("graphics/frontier_pass/tiles2.8bpp.lz"); const u32 gUnknown_08DE2084[] = INCBIN_U32("graphics/frontier_pass/tiles2.8bpp.lz");
const u32 gUnknown_08DE3060[] = INCBIN_U32("graphics/frontier_pass/tiles.bin.lz"); const u32 gUnknown_08DE3060[] = INCBIN_U32("graphics/frontier_pass/tiles.bin.lz");

View File

@ -4381,7 +4381,7 @@ u16 sub_80C089C(u8 caseID)
return count; return count;
} }
bool8 sub_80C08E4(void) bool16 HasAllHoennMons(void)
{ {
u16 i; u16 i;

View File

@ -463,8 +463,6 @@ EWRAM_DATA static u8 sMovingMonOrigBoxId = 0;
EWRAM_DATA static u8 sMovingMonOrigBoxPos = 0; EWRAM_DATA static u8 sMovingMonOrigBoxPos = 0;
EWRAM_DATA static bool8 sCanOnlyMove = 0; EWRAM_DATA static bool8 sCanOnlyMove = 0;
extern void sub_80C6D80(u8 *arg0, void *arg1, u8 arg2, u8 arg3, s32 arg4);
extern const struct CompressedSpriteSheet gMonFrontPicTable[]; extern const struct CompressedSpriteSheet gMonFrontPicTable[];
// This file's functions. // This file's functions.
@ -1543,6 +1541,76 @@ static const u8 gHandCursorTiles[] = INCBIN_U8("graphics/pokemon_storage/hand_cu
static const u8 gHandCursorShadowTiles[] = INCBIN_U8("graphics/pokemon_storage/hand_cursor_shadow.4bpp"); static const u8 gHandCursorShadowTiles[] = INCBIN_U8("graphics/pokemon_storage/hand_cursor_shadow.4bpp");
// code // code
void sub_80C6D80(const u8 *string, void *dst, u8 arg2, u8 arg3, s32 arg4)
{
s32 i, val, val2;
u16 windowId;
u8 txtColor[3];
u8 *tileData1, *tileData2;
struct WindowTemplate winTemplate = {0};
winTemplate.width = 24;
winTemplate.height = 2;
windowId = AddWindow(&winTemplate);
FillWindowPixelBuffer(windowId, (arg3 << 4) | arg3);
tileData1 = (u8*) GetWindowAttribute(windowId, WINDOW_TILE_DATA);
tileData2 = (winTemplate.width * 32) + tileData1;
if (!arg2)
txtColor[0] = 0;
else
txtColor[0] = arg3;
txtColor[1] = 0xF;
txtColor[2] = 0xE;
AddTextPrinterParameterized4(windowId, 1, 0, 1, 0, 0, txtColor, -1, string);
val = arg4;
if (val > 6u)
val = 6;
val2 = arg4 - 6;
if (val > 0)
{
for (i = val; i != 0; i--)
{
CpuCopy16(tileData1, dst, 0x80);
CpuCopy16(tileData2, dst + 0x80, 0x80);
tileData1 += 0x80;
tileData2 += 0x80;
dst += 0x100;
}
}
if (val2 > 0)
CpuFill16((arg3 << 4) | arg3, dst, (u32)(val2) * 0x100);
RemoveWindow(windowId);
}
// Unused
void sub_80C6EAC(const u8 *string, void *dst, u16 arg2, u8 arg3, u8 clr2, u8 clr3)
{
u32 var;
u8 windowId;
u8 txtColor[3];
u8 *tileData1, *tileData2;
struct WindowTemplate winTemplate = {0};
winTemplate.width = StringLength_Multibyte(string);
winTemplate.height = 2;
var = winTemplate.width * 32;
windowId = AddWindow(&winTemplate);
FillWindowPixelBuffer(windowId, (arg3 << 4) | arg3);
tileData1 = (u8*) GetWindowAttribute(windowId, WINDOW_TILE_DATA);
tileData2 = (winTemplate.width * 32) + tileData1;
txtColor[0] = arg3;
txtColor[1] = clr2;
txtColor[2] = clr3;
AddTextPrinterParameterized4(windowId, 1, 0, 2, 0, 0, txtColor, -1, string);
CpuCopy16(tileData1, dst, var);
CpuCopy16(tileData2, dst + arg2, var);
RemoveWindow(windowId);
}
u8 CountMonsInBox(u8 boxId) u8 CountMonsInBox(u8 boxId)
{ {
u16 i, count; u16 i, count;

View File

@ -1577,7 +1577,7 @@ void sub_80140E0(u8 taskId)
for (i = 0; i < GetLinkPlayerCount(); i++) for (i = 0; i < GetLinkPlayerCount(); i++)
{ {
recvBuff = gBlockRecvBuffer[i]; recvBuff = gBlockRecvBuffer[i];
sub_80C3120(&gTrainerCards[i], recvBuff, gLinkPlayers[i].version); CopyTrainerCardData(&gTrainerCards[i], recvBuff, gLinkPlayers[i].version);
} }
if (GetLinkPlayerCount() == 2) if (GetLinkPlayerCount() == 2)
@ -1607,7 +1607,7 @@ void sub_80141A4(void)
break; break;
case 1: case 1:
if (!FuncIsActiveTask(sub_80140E0)) if (!FuncIsActiveTask(sub_80140E0))
TrainerCard_ShowLinkCard(GetMultiplayerId() ^ 1, CB2_ReturnToField); ShowTrainerCardInLink(GetMultiplayerId() ^ 1, CB2_ReturnToField);
break; break;
} }

View File

@ -128,18 +128,18 @@ void sub_80F88E8(void)
} }
} }
u8 sub_80F8940(void) u8 CountPlayerContestPaintings(void)
{ {
int i; int i;
u8 var0 = 0; u8 count = 0;
for (i = 0; i < 5; i++) for (i = 0; i < 5; i++)
{ {
if (gSaveBlock1Ptr->contestWinners[8 + i].species) if (gSaveBlock1Ptr->contestWinners[8 + i].species)
var0++; count++;
} }
return var0; return count;
} }
void sub_80F8970(void) void sub_80F8970(void)

View File

@ -9,6 +9,8 @@
#include "strings.h" #include "strings.h"
#include "bg.h" #include "bg.h"
#include "field_effect.h" #include "field_effect.h"
#include "party_menu.h"
#include "frontier_pass.h"
#include "task.h" #include "task.h"
#include "overworld.h" #include "overworld.h"
#include "link.h" #include "link.h"
@ -30,6 +32,7 @@
#include "scanline_effect.h" #include "scanline_effect.h"
#include "text_window.h" #include "text_window.h"
#include "load_save.h" #include "load_save.h"
#include "trainer_card.h"
#include "international_string_util.h" #include "international_string_util.h"
#include "constants/songs.h" #include "constants/songs.h"
#include "field_player_avatar.h" #include "field_player_avatar.h"
@ -89,11 +92,7 @@ extern void var_800D_set_xB(void);
extern void sub_808B864(void); extern void sub_808B864(void);
extern void CB2_Pokedex(void); extern void CB2_Pokedex(void);
extern void PlayRainSoundEffect(void); extern void PlayRainSoundEffect(void);
extern void CB2_PartyMenuFromStartMenu(void);
extern void CB2_PokeNav(void); extern void CB2_PokeNav(void);
extern void sub_80C4DDC(void (*)(void));
extern void sub_80C51C4(void (*)(void));
extern void TrainerCard_ShowLinkCard(u8, void (*)(void));
extern void ScriptUnfreezeEventObjects(void); extern void ScriptUnfreezeEventObjects(void);
extern void sub_81A9EC8(void); extern void sub_81A9EC8(void);
extern void save_serialize_map(void); extern void save_serialize_map(void);
@ -422,16 +421,19 @@ static bool32 PrintStartMenuActions(s8 *pIndex, u32 count)
do do
{ {
if (sStartMenuItems[sCurrentStartMenuActions[index]].func.u8_void == StartMenuPlayerNameCallback) { if (sStartMenuItems[sCurrentStartMenuActions[index]].func.u8_void == StartMenuPlayerNameCallback)
{
PrintPlayerNameOnWindow(GetStartMenuWindowId(), sStartMenuItems[sCurrentStartMenuActions[index]].text, 8, (index << 4) + 9); PrintPlayerNameOnWindow(GetStartMenuWindowId(), sStartMenuItems[sCurrentStartMenuActions[index]].text, 8, (index << 4) + 9);
} }
else { else
{
StringExpandPlaceholders(gStringVar4, sStartMenuItems[sCurrentStartMenuActions[index]].text); StringExpandPlaceholders(gStringVar4, sStartMenuItems[sCurrentStartMenuActions[index]].text);
AddTextPrinterParameterized(GetStartMenuWindowId(), 1, gStringVar4, 8, (index << 4) + 9, 0xFF, NULL); AddTextPrinterParameterized(GetStartMenuWindowId(), 1, gStringVar4, 8, (index << 4) + 9, 0xFF, NULL);
} }
index++; index++;
if (index >= sNumStartMenuActions) { if (index >= sNumStartMenuActions)
{
*pIndex = index; *pIndex = index;
return TRUE; return TRUE;
} }
@ -465,20 +467,13 @@ static bool32 InitStartMenuStep(void)
break; break;
case 3: case 3:
if (GetSafariZoneFlag()) if (GetSafariZoneFlag())
{
ShowSafariBallsWindow(); ShowSafariBallsWindow();
}
if (InBattlePyramid()) if (InBattlePyramid())
{
ShowPyramidFloorWindow(); ShowPyramidFloorWindow();
}
sUnknown_02037619[0]++; sUnknown_02037619[0]++;
break; break;
case 4: case 4:
if (!PrintStartMenuActions(&sUnknown_02037619[1], 2)) if (PrintStartMenuActions(&sUnknown_02037619[1], 2))
{
break;
}
sUnknown_02037619[0]++; sUnknown_02037619[0]++;
break; break;
case 5: case 5:
@ -494,15 +489,14 @@ static void InitStartMenu(void)
{ {
sUnknown_02037619[0] = 0; sUnknown_02037619[0] = 0;
sUnknown_02037619[1] = 0; sUnknown_02037619[1] = 0;
while (!InitStartMenuStep()); while (!InitStartMenuStep())
;
} }
static void StartMenuTask(u8 taskId) static void StartMenuTask(u8 taskId)
{ {
if (InitStartMenuStep() == TRUE) if (InitStartMenuStep() == TRUE)
{
SwitchTaskToFollowupFunc(taskId); SwitchTaskToFollowupFunc(taskId);
}
} }
static void CreateStartMenuTask(TaskFunc followupFunc) static void CreateStartMenuTask(TaskFunc followupFunc)
@ -541,18 +535,14 @@ void sub_809FA34(u8 taskId) // Referenced in field_screen.s and rom_8011DC0.s
{ {
case 0: case 0:
if (InUnionRoom() == TRUE) if (InUnionRoom() == TRUE)
{
var_800D_set_xB(); var_800D_set_xB();
}
gMenuCallback = HandleStartMenuInput; gMenuCallback = HandleStartMenuInput;
task->data[0]++; task->data[0]++;
break; break;
case 1: case 1:
if (gMenuCallback() == TRUE) if (gMenuCallback() == TRUE)
{
DestroyTask(taskId); DestroyTask(taskId);
}
break; break;
} }
} }
@ -588,10 +578,9 @@ static bool8 HandleStartMenuInput(void)
PlaySE(SE_SELECT); PlaySE(SE_SELECT);
if (sStartMenuItems[sCurrentStartMenuActions[sStartMenuCursorPos]].func.u8_void == StartMenuPokedexCallback) if (sStartMenuItems[sCurrentStartMenuActions[sStartMenuCursorPos]].func.u8_void == StartMenuPokedexCallback)
{ {
if (GetNationalPokedexCount(0) == 0) { if (GetNationalPokedexCount(0) == 0)
return FALSE; return FALSE;
} }
}
gMenuCallback = sStartMenuItems[sCurrentStartMenuActions[sStartMenuCursorPos]].func.u8_void; gMenuCallback = sStartMenuItems[sCurrentStartMenuActions[sStartMenuCursorPos]].func.u8_void;
@ -686,17 +675,11 @@ static bool8 StartMenuPlayerNameCallback(void)
CleanupOverworldWindowsAndTilemaps(); CleanupOverworldWindowsAndTilemaps();
if (is_c1_link_related_active() || InUnionRoom()) if (is_c1_link_related_active() || InUnionRoom())
{ ShowPlayerTrainerCard(CB2_ReturnToFieldWithOpenMenu); // Display trainer card
sub_80C4DDC(CB2_ReturnToFieldWithOpenMenu); // Display trainer card
}
else if (FlagGet(FLAG_SYS_FRONTIER_PASS)) else if (FlagGet(FLAG_SYS_FRONTIER_PASS))
{ ShowFrontierPass(CB2_ReturnToFieldWithOpenMenu); // Display frontier pass
sub_80C51C4(CB2_ReturnToFieldWithOpenMenu); // Display frontier pass
}
else else
{ ShowPlayerTrainerCard(CB2_ReturnToFieldWithOpenMenu); // Display trainer card
sub_80C4DDC(CB2_ReturnToFieldWithOpenMenu); // Display trainer card
}
return TRUE; return TRUE;
} }
@ -707,9 +690,7 @@ static bool8 StartMenuPlayerNameCallback(void)
static bool8 StartMenuSaveCallback(void) static bool8 StartMenuSaveCallback(void)
{ {
if (InBattlePyramid()) if (InBattlePyramid())
{
RemoveExtraStartMenuWindows(); RemoveExtraStartMenuWindows();
}
gMenuCallback = SaveStartCallback; // Display save menu gMenuCallback = SaveStartCallback; // Display save menu
@ -755,7 +736,7 @@ static bool8 StartMenuLinkModePlayerNameCallback(void)
{ {
PlayRainSoundEffect(); PlayRainSoundEffect();
CleanupOverworldWindowsAndTilemaps(); CleanupOverworldWindowsAndTilemaps();
TrainerCard_ShowLinkCard(gUnknown_03005DB4, CB2_ReturnToFieldWithOpenMenu); ShowTrainerCardInLink(gUnknown_03005DB4, CB2_ReturnToFieldWithOpenMenu);
return TRUE; return TRUE;
} }

View File

@ -587,7 +587,7 @@ u8 *StringCopyN_Multibyte(u8 *dest, u8 *src, u32 n)
return dest; return dest;
} }
u32 StringLength_Multibyte(u8 *str) u32 StringLength_Multibyte(const u8 *str)
{ {
u32 length = 0; u32 length = 0;

View File

@ -26,6 +26,7 @@
#include "pokedex.h" #include "pokedex.h"
#include "pokemon_icon.h" #include "pokemon_icon.h"
#include "pokemon_summary_screen.h" #include "pokemon_summary_screen.h"
#include "pokemon_storage_system.h"
#include "random.h" #include "random.h"
#include "rom_8011DC0.h" #include "rom_8011DC0.h"
#include "save.h" #include "save.h"

1856
src/trainer_card.c Executable file

File diff suppressed because it is too large Load Diff

View File

@ -24,8 +24,11 @@
#include "constants/event_object_movement_constants.h" #include "constants/event_object_movement_constants.h"
#include "constants/event_objects.h" #include "constants/event_objects.h"
#include "constants/items.h" #include "constants/items.h"
#include "constants/moves.h"
#include "constants/maps.h" #include "constants/maps.h"
#include "constants/species.h"
#include "constants/trainers.h" #include "constants/trainers.h"
#include "constants/easy_chat.h"
extern bool32 sub_81D3B34(void); extern bool32 sub_81D3B34(void);
@ -118,11 +121,7 @@ static void sub_81D642C(struct Pokemon *mon, u8 level);
static u16 sub_81D6640(void); static u16 sub_81D6640(void);
// const data // const data
// I will decompile these soon, no worries :) #include "data/battle_frontier/trainer_hill.h"
extern const struct TrHillTag gUnknown_08626814;
extern const struct TrHillTag gUnknown_086276FC;
extern const struct TrHillTag gUnknown_086285E4;
extern const struct TrHillTag gUnknown_086294CC;
struct struct
{ {
@ -246,10 +245,10 @@ static const u8 sRecordWinColors[] = {0, 2, 3};
static const struct TrHillTag *const sDataPerTag[] = static const struct TrHillTag *const sDataPerTag[] =
{ {
&gUnknown_08626814, &sDataTagNormal,
&gUnknown_086276FC, &sDataTagVariety,
&gUnknown_086285E4, &sDataTagUnique,
&gUnknown_086294CC, &sDataTagExpert,
}; };
// Unused. // Unused.

View File

@ -153,21 +153,8 @@ gUnknown_02039B6E: @ 2039B6E
gUnknown_02039B88: @ 2039B88 gUnknown_02039B88: @ 2039B88
.space 0x160 .space 0x160
gUnknown_02039CE8: @ 2039CE8 .include "src/trainer_card.o"
.space 0x4 .include "src/frontier_pass.o"
gUnknown_02039CEC: @ 2039CEC
.space 0x4
gUnknown_02039CF0: @ 2039CF0
.space 0x4
gUnknown_02039CF4: @ 2039CF4
.space 0x4
gUnknown_02039CF8: @ 2039CF8
.space 0x8
.include "src/pokemon_storage_system.o" .include "src/pokemon_storage_system.o"
.include "src/script_movement.o" .include "src/script_movement.o"
.include "src/fldeff_cut.o" .include "src/fldeff_cut.o"