summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorentrpntr <entrpntr@gmail.com>2020-04-12 13:36:23 -0400
committerentrpntr <entrpntr@gmail.com>2020-04-12 13:36:23 -0400
commit531e26c91a369d17c5f2a6105bcb3d345602ae27 (patch)
treef440b0496688efe063b778adc8dc243cd6644cfd
parent51ad0b240e70c0bebb0cfd921ad365ff27e7617c (diff)
Add engine/events/print_[photo|unown] and engine/pokemon/breeding.
-rw-r--r--constants.asm2
-rw-r--r--constants/menu_constants.asm12
-rw-r--r--constants/sprite_anim_constants.asm211
-rwxr-xr-xdata/text/common_1.asm10
-rw-r--r--data/text/common_2.asm22
-rw-r--r--engine/events/print_photo.asm50
-rw-r--r--engine/events/print_unown.asm209
-rwxr-xr-xengine/events/specials.asm2
-rwxr-xr-xengine/items/tmhm2.asm6
-rw-r--r--engine/menus/intro_menu.asm4
-rw-r--r--engine/menus/naming_screen.asm10
-rw-r--r--engine/movie/gamefreak_presents.asm6
-rw-r--r--engine/pokemon/breeding.asm935
-rw-r--r--gfx/evo/egg_hatch.2bpp1
-rw-r--r--gfx/overworld/celebi.2bppbin256 -> 0 bytes
-rw-r--r--gfx/overworld/kris_fish.2bppbin144 -> 0 bytes
-rw-r--r--gfx/printer/bold_a.1bppbin0 -> 8 bytes
-rw-r--r--gfx/printer/bold_b.1bppbin0 -> 8 bytes
-rw-r--r--main.asm47
-rw-r--r--wram.asm6
20 files changed, 1476 insertions, 57 deletions
diff --git a/constants.asm b/constants.asm
index bc74d1f2..9b10bbdb 100644
--- a/constants.asm
+++ b/constants.asm
@@ -46,7 +46,7 @@ INCLUDE "constants/scene_constants.asm"
INCLUDE "constants/script_constants.asm"
INCLUDE "constants/serial_constants.asm"
INCLUDE "constants/sfx_constants.asm"
-;INCLUDE "constants/sprite_anim_constants.asm"
+INCLUDE "constants/sprite_anim_constants.asm"
INCLUDE "constants/sprite_constants.asm"
INCLUDE "constants/sprite_data_constants.asm"
INCLUDE "constants/std_constants.asm"
diff --git a/constants/menu_constants.asm b/constants/menu_constants.asm
index 2c6c7910..97ed168e 100644
--- a/constants/menu_constants.asm
+++ b/constants/menu_constants.asm
@@ -98,3 +98,15 @@ HMENURETURN_ASM EQU %11111111
const PARTYMENUTEXT_REVIVE
const PARTYMENUTEXT_LEVEL_UP
const PARTYMENUTEXT_HEAL_CONFUSION
+
+; Naming types (see engine/menus/naming_screen.asm)
+ const_def
+ const NAME_MON
+ const NAME_PLAYER
+ const NAME_RIVAL
+ const NAME_MOM
+ const NAME_BOX
+ const NAME_FRIEND
+ const NAME_6 ; duplicate of NAME_MON
+ const NAME_7 ; duplicate of NAME_MON
+NUM_NAME_TYPES EQU const_value
diff --git a/constants/sprite_anim_constants.asm b/constants/sprite_anim_constants.asm
new file mode 100644
index 00000000..6f61a917
--- /dev/null
+++ b/constants/sprite_anim_constants.asm
@@ -0,0 +1,211 @@
+; sprite_anim_struct members (see macros/wram.asm)
+ const_def
+ const SPRITEANIMSTRUCT_INDEX ; 0
+ const SPRITEANIMSTRUCT_FRAMESET_ID ; 1
+ const SPRITEANIMSTRUCT_ANIM_SEQ_ID ; 2
+ const SPRITEANIMSTRUCT_TILE_ID ; 3
+ const SPRITEANIMSTRUCT_XCOORD ; 4
+ const SPRITEANIMSTRUCT_YCOORD ; 5
+ const SPRITEANIMSTRUCT_XOFFSET ; 6
+ const SPRITEANIMSTRUCT_YOFFSET ; 7
+ const SPRITEANIMSTRUCT_DURATION ; 8
+ const SPRITEANIMSTRUCT_DURATIONOFFSET ; 9
+ const SPRITEANIMSTRUCT_FRAME ; a
+ const SPRITEANIMSTRUCT_JUMPTABLE_INDEX ; b
+ const SPRITEANIMSTRUCT_0C ; c
+ const SPRITEANIMSTRUCT_0D ; d
+ const SPRITEANIMSTRUCT_0E ; e
+ const SPRITEANIMSTRUCT_0F ; f
+SPRITEANIMSTRUCT_LENGTH EQU const_value
+NUM_SPRITE_ANIM_STRUCTS EQU 10 ; see wSpriteAnimationStructs
+
+; SpriteAnimSeqData indexes (see data/sprite_anims/sequences.asm)
+SPRITE_ANIM_INDEX_EGG_CRACK EQU $2b
+SPRITE_ANIM_INDEX_EGG_HATCH EQU $2e
+
+; DoAnimFrame.Jumptable indexes (see engine/gfx/sprite_anims.asm)
+ const_def
+ const SPRITE_ANIM_SEQ_NULL ; 00
+ const SPRITE_ANIM_SEQ_PARTY_MON ; 01
+ const SPRITE_ANIM_SEQ_PARTY_MON_SWITCH ; 02
+ const SPRITE_ANIM_SEQ_PARTY_MON_SELECTED ; 03
+ const SPRITE_ANIM_SEQ_GS_TITLE_TRAIL ; 04
+ const SPRITE_ANIM_SEQ_NAMING_SCREEN_CURSOR ; 05
+ const SPRITE_ANIM_SEQ_GAMEFREAK_LOGO ; 06
+ const SPRITE_ANIM_SEQ_GS_INTRO_STAR ; 07
+ const SPRITE_ANIM_SEQ_GS_INTRO_SPARKLE ; 08
+ const SPRITE_ANIM_SEQ_SLOTS_GOLEM ; 09
+ const SPRITE_ANIM_SEQ_SLOTS_CHANSEY ; 0a
+ const SPRITE_ANIM_SEQ_SLOTS_EGG ; 0b
+ const SPRITE_ANIM_SEQ_MAIL_CURSOR ; 0c
+ const SPRITE_ANIM_SEQ_UNUSED_CURSOR ; 0d
+ const SPRITE_ANIM_SEQ_DUMMY_GAME_CURSOR ; 0e
+ const SPRITE_ANIM_SEQ_POKEGEAR_ARROW ; 0f
+ const SPRITE_ANIM_SEQ_TRADE_POKE_BALL ; 10
+ const SPRITE_ANIM_SEQ_TRADE_TUBE_BULGE ; 11
+ const SPRITE_ANIM_SEQ_TRADEMON_IN_TUBE ; 12
+ const SPRITE_ANIM_SEQ_REVEAL_NEW_MON ; 13
+ const SPRITE_ANIM_SEQ_RADIO_TUNING_KNOB ; 14
+ const SPRITE_ANIM_SEQ_CUT_LEAVES ; 15
+ const SPRITE_ANIM_SEQ_FLY_FROM ; 16
+ const SPRITE_ANIM_SEQ_FLY_LEAF ; 17
+ const SPRITE_ANIM_SEQ_FLY_TO ; 18
+ const SPRITE_ANIM_SEQ_GS_INTRO_HO_OH ; 19
+ const SPRITE_ANIM_SEQ_EZCHAT_CURSOR ; 1a
+
+; SpriteAnimFrameData indexes (see data/sprite_anims/framesets.asm)
+ const_def
+ const SPRITE_ANIM_FRAMESET_00 ; 00
+ const SPRITE_ANIM_FRAMESET_PARTY_MON ; 01
+ const SPRITE_ANIM_FRAMESET_PARTY_MON_WITH_MAIL ; 02
+ const SPRITE_ANIM_FRAMESET_PARTY_MON_WITH_ITEM ; 03
+ const SPRITE_ANIM_FRAMESET_PARTY_MON_FAST ; 04
+ const SPRITE_ANIM_FRAMESET_PARTY_MON_WITH_MAIL_FAST ; 05
+ const SPRITE_ANIM_FRAMESET_PARTY_MON_WITH_ITEM_FAST ; 06
+ const SPRITE_ANIM_FRAMESET_GS_TITLE_TRAIL ; 07
+ const SPRITE_ANIM_FRAMESET_TEXT_ENTRY_CURSOR ; 08
+ const SPRITE_ANIM_FRAMESET_TEXT_ENTRY_CURSOR_BIG ; 09
+ const SPRITE_ANIM_FRAMESET_GAMEFREAK_LOGO ; 0a
+ const SPRITE_ANIM_FRAMESET_GS_INTRO_STAR ; 0b
+ const SPRITE_ANIM_FRAMESET_GS_INTRO_SPARKLE ; 0c
+ const SPRITE_ANIM_FRAMESET_SLOTS_GOLEM ; 0d
+ const SPRITE_ANIM_FRAMESET_SLOTS_CHANSEY ; 0e
+ const SPRITE_ANIM_FRAMESET_SLOTS_CHANSEY_2 ; 0f
+ const SPRITE_ANIM_FRAMESET_SLOTS_EGG ; 10
+ const SPRITE_ANIM_FRAMESET_RED_WALK ; 11
+ const SPRITE_ANIM_FRAMESET_STILL_CURSOR ; 12
+ const SPRITE_ANIM_FRAMESET_TRADE_POKE_BALL ; 13
+ const SPRITE_ANIM_FRAMESET_TRADE_POKE_BALL_WOBBLE ; 14
+ const SPRITE_ANIM_FRAMESET_TRADE_POOF ; 15
+ const SPRITE_ANIM_FRAMESET_TRADE_TUBE_BULGE ; 16
+ const SPRITE_ANIM_FRAMESET_TRADEMON_ICON ; 17
+ const SPRITE_ANIM_FRAMESET_TRADEMON_BUBBLE ; 18
+ const SPRITE_ANIM_FRAMESET_EVOLUTION_BALL_OF_LIGHT ; 19
+ const SPRITE_ANIM_FRAMESET_RADIO_TUNING_KNOB ; 1a
+ const SPRITE_ANIM_FRAMESET_MAGNET_TRAIN_RED ; 1b
+ const SPRITE_ANIM_FRAMESET_UNUSED_1C ; 1c
+ const SPRITE_ANIM_FRAMESET_LEAF ; 1d
+ const SPRITE_ANIM_FRAMESET_CUT_TREE ; 1e
+ const SPRITE_ANIM_FRAMESET_EGG_CRACK ; 1f
+ const SPRITE_ANIM_FRAMESET_EGG_HATCH_1 ; 20
+ const SPRITE_ANIM_FRAMESET_EGG_HATCH_2 ; 21
+ const SPRITE_ANIM_FRAMESET_EGG_HATCH_3 ; 22
+ const SPRITE_ANIM_FRAMESET_EGG_HATCH_4 ; 23
+ const SPRITE_ANIM_FRAMESET_GS_INTRO_HO_OH ; 24
+ const SPRITE_ANIM_FRAMESET_HEADBUTT ; 25
+ const SPRITE_ANIM_FRAMESET_EZCHAT_CURSOR_1 ; 26
+ const SPRITE_ANIM_FRAMESET_EZCHAT_CURSOR_2 ; 27
+ const SPRITE_ANIM_FRAMESET_EZCHAT_CURSOR_3 ; 28
+ const SPRITE_ANIM_FRAMESET_EZCHAT_CURSOR_4 ; 29
+ const SPRITE_ANIM_FRAMESET_EZCHAT_CURSOR_5 ; 2a
+ const SPRITE_ANIM_FRAMESET_EZCHAT_CURSOR_6 ; 2b
+ const SPRITE_ANIM_FRAMESET_EZCHAT_CURSOR_7 ; 2c
+ const SPRITE_ANIM_FRAMESET_BLUE_WALK ; 2d
+ const SPRITE_ANIM_FRAMESET_MAGNET_TRAIN_BLUE ; 2e
+
+; SpriteAnimOAMData indexes (see data/sprite_anims/oam.asm)
+ const_def
+ const SPRITE_ANIM_OAMSET_RED_WALK_1 ; 00
+ const SPRITE_ANIM_OAMSET_RED_WALK_2 ; 01
+ const SPRITE_ANIM_OAMSET_GS_INTRO_BUBBLE_1 ; 02
+ const SPRITE_ANIM_OAMSET_GS_INTRO_BUBBLE_2 ; 03
+ const SPRITE_ANIM_OAMSET_GS_INTRO_SHELLDER_1 ; 04
+ const SPRITE_ANIM_OAMSET_GS_INTRO_SHELLDER_2 ; 05
+ const SPRITE_ANIM_OAMSET_GS_INTRO_MAGIKARP_1 ; 06
+ const SPRITE_ANIM_OAMSET_GS_INTRO_MAGIKARP_2 ; 07
+ const SPRITE_ANIM_OAMSET_GS_INTRO_LAPRAS_1 ; 08
+ const SPRITE_ANIM_OAMSET_GS_INTRO_LAPRAS_2 ; 09
+ const SPRITE_ANIM_OAMSET_GS_INTRO_LAPRAS_3 ; 0a
+ const SPRITE_ANIM_OAMSET_GS_INTRO_LAPRAS_4 ; 0b
+ const SPRITE_ANIM_OAMSET_GS_INTRO_NOTE ; 0c
+ const SPRITE_ANIM_OAMSET_GS_INTRO_INVISIBLE_NOTE ; 0d
+ const SPRITE_ANIM_OAMSET_GS_INTRO_JIGGLYPUFF_1 ; 0e
+ const SPRITE_ANIM_OAMSET_GS_INTRO_JIGGLYPUFF_2 ; 0f
+ const SPRITE_ANIM_OAMSET_GS_INTRO_JIGGLYPUFF_3 ; 10
+ const SPRITE_ANIM_OAMSET_GS_INTRO_PIKACHU_1 ; 11
+ const SPRITE_ANIM_OAMSET_GS_INTRO_PIKACHU_2 ; 12
+ const SPRITE_ANIM_OAMSET_GS_INTRO_PIKACHU_3 ; 13
+ const SPRITE_ANIM_OAMSET_GS_INTRO_PIKACHU_4 ; 14
+ const SPRITE_ANIM_OAMSET_GS_INTRO_PIKACHU_TAIL_1 ; 15
+ const SPRITE_ANIM_OAMSET_GS_INTRO_PIKACHU_TAIL_2 ; 16
+ const SPRITE_ANIM_OAMSET_GS_INTRO_PIKACHU_TAIL_3 ; 17
+ const SPRITE_ANIM_OAMSET_GS_INTRO_SMALL_FIREBALL ; 18
+ const SPRITE_ANIM_OAMSET_GS_INTRO_MED_FIREBALL ; 19
+ const SPRITE_ANIM_OAMSET_GS_INTRO_BIG_FIREBALL ; 1a
+ const SPRITE_ANIM_OAMSET_GS_INTRO_CHIKORITA ; 1b
+ const SPRITE_ANIM_OAMSET_GS_INTRO_CYNDAQUIL ; 1c
+ const SPRITE_ANIM_OAMSET_GS_INTRO_TOTODILE ; 1d
+ const SPRITE_ANIM_OAMSET_GS_TITLE_TRAIL_1 ; 1e
+ const SPRITE_ANIM_OAMSET_GS_TITLE_TRAIL_2 ; 1f
+ const SPRITE_ANIM_OAMSET_TEXT_ENTRY_CURSOR ; 20
+ const SPRITE_ANIM_OAMSET_TEXT_ENTRY_CURSOR_BIG ; 21
+ const SPRITE_ANIM_OAMSET_GS_INTRO_GAMEFREAK_LOGO ; 22
+ const SPRITE_ANIM_OAMSET_GS_INTRO_STAR ; 23
+ const SPRITE_ANIM_OAMSET_GS_INTRO_SPARKLE_1 ; 24
+ const SPRITE_ANIM_OAMSET_GS_INTRO_SPARKLE_2 ; 25
+ const SPRITE_ANIM_OAMSET_GS_INTRO_SPARKLE_3 ; 26
+ const SPRITE_ANIM_OAMSET_SLOTS_GOLEM_1 ; 27
+ const SPRITE_ANIM_OAMSET_SLOTS_GOLEM_2 ; 28
+ const SPRITE_ANIM_OAMSET_SLOTS_CHANSEY_1 ; 29
+ const SPRITE_ANIM_OAMSET_SLOTS_CHANSEY_2 ; 2a
+ const SPRITE_ANIM_OAMSET_SLOTS_CHANSEY_3 ; 2b
+ const SPRITE_ANIM_OAMSET_SLOTS_CHANSEY_4 ; 2c
+ const SPRITE_ANIM_OAMSET_SLOTS_CHANSEY_5 ; 2d
+ const SPRITE_ANIM_OAMSET_SLOTS_EGG ; 2e
+ const SPRITE_ANIM_OAMSET_STILL_CURSOR ; 2f
+ const SPRITE_ANIM_OAMSET_TRADE_POKE_BALL_1 ; 30
+ const SPRITE_ANIM_OAMSET_TRADE_POKE_BALL_2 ; 31
+ const SPRITE_ANIM_OAMSET_TRADE_POOF_1 ; 32
+ const SPRITE_ANIM_OAMSET_TRADE_POOF_2 ; 33
+ const SPRITE_ANIM_OAMSET_TRADE_POOF_3 ; 34
+ const SPRITE_ANIM_OAMSET_TRADE_TUBE_BULGE_1 ; 35
+ const SPRITE_ANIM_OAMSET_TRADE_TUBE_BULGE_2 ; 36
+ const SPRITE_ANIM_OAMSET_TRADEMON_ICON_1 ; 37
+ const SPRITE_ANIM_OAMSET_TRADEMON_ICON_2 ; 38
+ const SPRITE_ANIM_OAMSET_TRADEMON_BUBBLE ; 39
+ const SPRITE_ANIM_OAMSET_EVOLUTION_BALL_OF_LIGHT_1 ; 3a
+ const SPRITE_ANIM_OAMSET_EVOLUTION_BALL_OF_LIGHT_2 ; 3b
+ const SPRITE_ANIM_OAMSET_RADIO_TUNING_KNOB ; 3c
+ const SPRITE_ANIM_OAMSET_PARTY_MON_WITH_MAIL_1 ; 3d
+ const SPRITE_ANIM_OAMSET_PARTY_MON_WITH_MAIL_2 ; 3e
+ const SPRITE_ANIM_OAMSET_PARTY_MON_WITH_ITEM_1 ; 3f
+ const SPRITE_ANIM_OAMSET_PARTY_MON_WITH_ITEM_2 ; 40
+ const SPRITE_ANIM_OAMSET_MAGNET_TRAIN_RED_1 ; 41
+ const SPRITE_ANIM_OAMSET_MAGNET_TRAIN_RED_2 ; 42
+ const SPRITE_ANIM_OAMSET_UNUSED_43 ; 43
+ const SPRITE_ANIM_OAMSET_UNUSED_44 ; 44
+ const SPRITE_ANIM_OAMSET_UNUSED_45 ; 45
+ const SPRITE_ANIM_OAMSET_UNUSED_46 ; 46
+ const SPRITE_ANIM_OAMSET_UNUSED_47 ; 47
+ const SPRITE_ANIM_OAMSET_UNUSED_48 ; 48
+ const SPRITE_ANIM_OAMSET_UNUSED_49 ; 49
+ const SPRITE_ANIM_OAMSET_UNUSED_4A ; 4a
+ const SPRITE_ANIM_OAMSET_UNUSED_4B ; 4b
+ const SPRITE_ANIM_OAMSET_UNUSED_4C ; 4c
+ const SPRITE_ANIM_OAMSET_UNUSED_4D ; 4d
+ const SPRITE_ANIM_OAMSET_UNUSED_4E ; 4e
+ const SPRITE_ANIM_OAMSET_LEAF ; 4f
+ const SPRITE_ANIM_OAMSET_TREE_1 ; 50
+ const SPRITE_ANIM_OAMSET_CUT_TREE_2 ; 51
+ const SPRITE_ANIM_OAMSET_CUT_TREE_3 ; 52
+ const SPRITE_ANIM_OAMSET_CUT_TREE_4 ; 53
+ const SPRITE_ANIM_OAMSET_EGG_CRACK ; 54
+ const SPRITE_ANIM_OAMSET_EGG_HATCH ; 55
+ const SPRITE_ANIM_OAMSET_GS_INTRO_HO_OH_1 ; 56
+ const SPRITE_ANIM_OAMSET_GS_INTRO_HO_OH_2 ; 57
+ const SPRITE_ANIM_OAMSET_GS_INTRO_HO_OH_3 ; 58
+ const SPRITE_ANIM_OAMSET_GS_INTRO_HO_OH_4 ; 59
+ const SPRITE_ANIM_OAMSET_GS_INTRO_HO_OH_5 ; 5a
+ const SPRITE_ANIM_OAMSET_HEADBUTT_TREE_2 ; 5b
+ const SPRITE_ANIM_OAMSET_EZCHAT_CURSOR_1 ; 5c
+ const SPRITE_ANIM_OAMSET_EZCHAT_CURSOR_2 ; 5d
+ const SPRITE_ANIM_OAMSET_EZCHAT_CURSOR_3 ; 5e
+ const SPRITE_ANIM_OAMSET_EZCHAT_CURSOR_4 ; 5f
+ const SPRITE_ANIM_OAMSET_EZCHAT_CURSOR_5 ; 60
+ const SPRITE_ANIM_OAMSET_EZCHAT_CURSOR_6 ; 61
+ const SPRITE_ANIM_OAMSET_EZCHAT_CURSOR_7 ; 62
+ const SPRITE_ANIM_OAMSET_BLUE_WALK_1 ; 63
+ const SPRITE_ANIM_OAMSET_BLUE_WALK_2 ; 64
+ const SPRITE_ANIM_OAMSET_MAGNET_TRAIN_BLUE_1 ; 65
+ const SPRITE_ANIM_OAMSET_MAGNET_TRAIN_BLUE_2 ; 66
+
diff --git a/data/text/common_1.asm b/data/text/common_1.asm
index 2747f902..69e3c49e 100755
--- a/data/text/common_1.asm
+++ b/data/text/common_1.asm
@@ -1518,28 +1518,28 @@ _NoRoomForEggText::
cont "Come back later."
done
-UnknownText_0x1be024::
+_WhichMonPhotoText::
text "Which #MON"
line "should I photo-"
cont "graph?"
prompt
-UnknownText_0x1be047::
+_HoldStillText::
text "All righty. Hold"
line "still for a bit."
prompt
-UnknownText_0x1be06a::
+_PrestoAllDoneText::
text "Presto! All done."
line "Come again, OK?"
done
-UnknownText_0x1c0000::
+_NoPhotoText::
text "Oh, no picture?"
line "Come again, OK?"
done
-UnknownText_0x1c0021::
+_EggPhotoText::
text "An EGG? My talent"
line "is worth more…"
done
diff --git a/data/text/common_2.asm b/data/text/common_2.asm
index d5bc6741..355c88bb 100644
--- a/data/text/common_2.asm
+++ b/data/text/common_2.asm
@@ -435,16 +435,16 @@ UnknownText_0x1c0d6c::
line "dug a hole!"
prompt
-UnknownText_0x1c0db0::
+Text_BreedHuh::
text "Huh?"
para "@@"
-UnknownText_0x1c0db8::
+_BreedClearboxText::
text_start
done
-UnknownText_0x1c0dba::
+_BreedEggHatchText::
text_ram wStringBuffer1
text " came"
line "out of its EGG!@"
@@ -452,14 +452,14 @@ UnknownText_0x1c0dba::
text_promptbutton
db "@"
-UnknownText_0x1c0dd8::
+_BreedAskNicknameText::
text "Give a nickname to"
line "@"
text_ram wStringBuffer1
text "?"
done
-UnknownText_0x1c0df3::
+_LeftWithDayCareLadyText::
text "It's @"
text_ram wBreedMon2Nick
text_start
@@ -467,7 +467,7 @@ UnknownText_0x1c0df3::
cont "the DAY-CARE LADY."
done
-UnknownText_0x1c0e24::
+_LeftWithDayCareManText::
text "It's @"
text_ram wDayCareMan + 1
text_start
@@ -475,33 +475,33 @@ UnknownText_0x1c0e24::
cont "the DAY-CARE MAN."
done
-UnknownText_0x1c0e54::
+_BreedBrimmingWithEnergyText::
text "It's brimming with"
line "energy."
prompt
-UnknownText_0x1c0e6f::
+_BreedNoInterestText::
text "It has no interest"
line "in @"
text_ram wStringBuffer1
text "."
prompt
-UnknownText_0x1c0e8d::
+_BreedAppearsToCareForText::
text "It appears to care"
line "for @"
text_ram wStringBuffer1
text "."
prompt
-UnknownText_0x1c0eac::
+_BreedFriendlyText::
text "It's friendly with"
line "@"
text_ram wStringBuffer1
text "."
prompt
-UnknownText_0x1c0ec6::
+_BreedShowsInterestText::
text "It shows interest"
line "in @"
text_ram wStringBuffer1
diff --git a/engine/events/print_photo.asm b/engine/events/print_photo.asm
new file mode 100644
index 00000000..056788b9
--- /dev/null
+++ b/engine/events/print_photo.asm
@@ -0,0 +1,50 @@
+PhotoStudio:
+ ld hl, .WhichMonPhotoText
+ call PrintText
+ farcall SelectMonFromParty
+ jr c, .cancel
+ ld a, [wCurPartySpecies]
+ cp EGG
+ jr z, .egg
+
+ ld hl, .HoldStillText
+ call PrintText
+ call DisableSpriteUpdates
+ farcall PrintPartymon
+ call ReturnToMapWithSpeechTextbox
+ ldh a, [hPrinter]
+ and a
+ jr nz, .cancel
+ ld hl, .PrestoAllDoneText
+ jr .print_text
+
+.cancel
+ ld hl, .NoPhotoText
+ jr .print_text
+
+.egg
+ ld hl, .EggPhotoText
+
+.print_text
+ call PrintText
+ ret
+
+.WhichMonPhotoText:
+ text_far _WhichMonPhotoText
+ text_end
+
+.HoldStillText:
+ text_far _HoldStillText
+ text_end
+
+.PrestoAllDoneText:
+ text_far _PrestoAllDoneText
+ text_end
+
+.NoPhotoText:
+ text_far _NoPhotoText
+ text_end
+
+.EggPhotoText:
+ text_far _EggPhotoText
+ text_end
diff --git a/engine/events/print_unown.asm b/engine/events/print_unown.asm
new file mode 100644
index 00000000..893e8e6d
--- /dev/null
+++ b/engine/events/print_unown.asm
@@ -0,0 +1,209 @@
+UNOWNSTAMP_BOLD_A EQU "♂" ; $ef
+UNOWNSTAMP_BOLD_B EQU "♀" ; $f5
+
+_UnownPrinter:
+ ld a, [wUnownDex]
+ and a
+ ret z
+
+ ldh a, [hInMenu]
+ push af
+ ld a, $1
+ ldh [hInMenu], a
+ ld a, [wOptions]
+ push af
+ set NO_TEXT_SCROLL, a
+ ld [wOptions], a
+ call ClearBGPalettes
+ call ClearTilemap
+
+ ld de, UnownDexATile
+ ld hl, vTiles0 tile UNOWNSTAMP_BOLD_A
+ lb bc, BANK(UnownDexATile), 1
+ call Request1bpp
+
+ ld de, UnownDexBTile
+ ld hl, vTiles0 tile UNOWNSTAMP_BOLD_B
+ lb bc, BANK(UnownDexBTile), 1
+ call Request1bpp
+
+ hlcoord 0, 0
+ lb bc, 3, 18
+ call Textbox
+
+ hlcoord 0, 5
+ lb bc, 7, 7
+ call Textbox
+
+ hlcoord 0, 14
+ lb bc, 2, 18
+ call Textbox
+
+ hlcoord 1, 2
+ ld de, AlphRuinsStampString
+ call PlaceString
+
+ hlcoord 1, 16
+ ld de, UnownDexDoWhatString
+ call PlaceString
+
+ hlcoord 10, 6
+ ld de, UnownDexMenuString
+ call PlaceString
+
+ xor a
+ ld [wJumptableIndex], a
+ call .UpdateUnownFrontpic
+ call WaitBGMap
+
+ ld a, UNOWN
+ ld [wCurPartySpecies], a
+ xor a
+ ld [wTempMonDVs], a
+ ld [wTempMonDVs + 1], a
+
+ ld b, SCGB_TRAINER_OR_MON_FRONTPIC_PALS
+ call GetSGBLayout
+ call SetPalettes
+
+.joy_loop
+ call JoyTextDelay
+
+ ldh a, [hJoyPressed]
+ and B_BUTTON
+ jr nz, .pressed_b
+
+ ldh a, [hJoyPressed]
+ and A_BUTTON
+ jr nz, .pressed_a
+
+ call .LeftRight
+ call DelayFrame
+ jr .joy_loop
+
+.pressed_a
+ ld a, [wJumptableIndex]
+ push af
+ farcall PrintUnownStamp
+ call RestartMapMusic
+ pop af
+ ld [wJumptableIndex], a
+ jr .joy_loop
+
+.pressed_b
+ pop af
+ ld [wOptions], a
+ pop af
+ ldh [hInMenu], a
+ call ReturnToMapFromSubmenu
+ ret
+
+.LeftRight:
+ ldh a, [hJoyLast]
+ and D_RIGHT
+ jr nz, .press_right
+ ldh a, [hJoyLast]
+ and D_LEFT
+ jr nz, .press_left
+ ret
+
+.press_left
+ ld hl, wJumptableIndex
+ ld a, [hl]
+ and a
+ jr nz, .wrap_around_left
+ ld [hl], 26 + 1
+.wrap_around_left
+ dec [hl]
+ jr .return
+
+.press_right
+ ld hl, wJumptableIndex
+ ld a, [hl]
+ cp 26
+ jr c, .wrap_around_right
+ ld [hl], -1
+.wrap_around_right
+ inc [hl]
+
+.return
+ call .UpdateUnownFrontpic
+ ret
+
+.UpdateUnownFrontpic:
+ ld a, [wJumptableIndex]
+ cp 26
+ jr z, .vacant
+ inc a
+ ld [wUnownLetter], a
+ ld a, UNOWN
+ ld [wCurPartySpecies], a
+ xor a
+ ld [wBoxAlignment], a
+ ld de, vTiles2
+ predef GetMonFrontpic
+ hlcoord 1, 6
+ xor a
+ ldh [hGraphicStartTile], a
+ lb bc, 7, 7
+ predef PlaceGraphic
+ ld de, vTiles2 tile $31
+ farcall RotateUnownFrontpic
+ ret
+
+.vacant
+ hlcoord 1, 6
+ lb bc, 7, 7
+ call ClearBox
+ hlcoord 1, 9
+ ld de, UnownDexVacantString
+ call PlaceString
+ xor a ; sDecompressScratch
+ call OpenSRAM
+ ld hl, sDecompressScratch
+ ld bc, $31 tiles
+ xor a
+ call ByteFill
+ ld hl, vTiles2 tile $31
+ ld de, sDecompressScratch
+ ld c, $31
+ ldh a, [hROMBank]
+ ld b, a
+ call Get2bpp
+ call CloseSRAM
+ ld c, 20
+ call DelayFrames
+ ret
+
+AlphRuinsStampString:
+ db " ALPH RUINS STAMP@"
+
+UnownDexDoWhatString:
+ db "Do what?@"
+
+UnownDexMenuString:
+ db UNOWNSTAMP_BOLD_A, "▶PRINT"
+ next UNOWNSTAMP_BOLD_B, "▶CANCEL"
+ next "L▶BEFORE"
+ next "R▶NEXT"
+ db "@"
+
+UnownDexVacantString:
+ db "VACANT@"
+
+UnownDexATile:
+INCBIN "gfx/printer/bold_a.1bpp"
+UnownDexBTile:
+INCBIN "gfx/printer/bold_b.1bpp"
+
+PlaceUnownPrinterFrontpic:
+ hlcoord 0, 0
+ ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
+ ld a, " "
+ call ByteFill
+ hlcoord 7, 11
+ ld a, $31
+ ldh [hGraphicStartTile], a
+ lb bc, 7, 7
+ predef PlaceGraphic
+ ret
diff --git a/engine/events/specials.asm b/engine/events/specials.asm
index 11ae421e..605346b4 100755
--- a/engine/events/specials.asm
+++ b/engine/events/specials.asm
@@ -235,7 +235,7 @@ OverworldTownMap: ; c41a (3:441a)
UnownPrinter: ; c427 (3:4427)
call FadeToMenu
- farcall Function16e3a
+ farcall _UnownPrinter
call ExitAllMenus
ret
diff --git a/engine/items/tmhm2.asm b/engine/items/tmhm2.asm
index a7a135d9..18218a06 100755
--- a/engine/items/tmhm2.asm
+++ b/engine/items/tmhm2.asm
@@ -7,7 +7,7 @@ CanLearnTMHMMove: ; 11a25 (4:5a25)
ld a, [wPutativeTMHMMove]
ld b, a
ld c, $0
- ld hl, TMMovesList
+ ld hl, TMHMMoves
.asm_11a3b
ld a, [hli]
and a
@@ -34,7 +34,7 @@ CanLearnTMHMMove: ; 11a25 (4:5a25)
GetTMHMMove: ; 11a56 (4:5a56)
ld a, [wd151]
dec a
- ld hl, TMMovesList
+ ld hl, TMHMMoves
ld b, $0
ld c, a
add hl, bc
@@ -42,7 +42,7 @@ GetTMHMMove: ; 11a56 (4:5a56)
ld [wd151], a
ret
-TMMovesList:
+TMHMMoves:
db DYNAMICPUNCH
db HEADBUTT
db CURSE
diff --git a/engine/menus/intro_menu.asm b/engine/menus/intro_menu.asm
index db0d929a..0b5862ac 100644
--- a/engine/menus/intro_menu.asm
+++ b/engine/menus/intro_menu.asm
@@ -1152,7 +1152,7 @@ InitTitleScreen: ; 6291 (1:6291)
ld bc, $2000
xor a
call ByteFill
- farcall ClearAnimatedObjectBuffer
+ farcall ClearSpriteAnims
ld hl, TitleScreenGFX1
ld de, $9000
@@ -1331,7 +1331,7 @@ TitleScreenFrame: ; 63da (1:63da)
call Function640f
ld a, $1
ldh [hOAMUpdate], a
- farcall AnimatedObjects_PlayFrame
+ farcall PlaySpriteAnimations
xor a
ldh [hOAMUpdate], a
call Function64b1
diff --git a/engine/menus/naming_screen.asm b/engine/menus/naming_screen.asm
index 570a649b..937f4267 100644
--- a/engine/menus/naming_screen.asm
+++ b/engine/menus/naming_screen.asm
@@ -290,14 +290,14 @@ Function11cd4: ; 11cd4 (4:5cd4)
bit 7, a
jr nz, .asm_11cef
call Function11d27
- farcall AnimatedObjects_PlayFrameAndDelay
+ farcall PlaySpriteAnimationsAndDelay
call Function11cff
call DelayFrame
and a
ret
.asm_11cef
- callfar ClearAnimatedObjectBuffer
+ callfar ClearSpriteAnims
call ClearSprites
xor a
ldh [hSCX], a
@@ -817,7 +817,7 @@ Function11fde: ; 11fde (4:5fde)
Function1201e: ; 1201e (4:601e)
call ClearSprites
- callfar ClearAnimatedObjectBuffer
+ callfar ClearSpriteAnims
call LoadStandardFont
call LoadFontsExtra
ld de, NamingScreenGFX_MiddleLine ; $6232
@@ -1005,14 +1005,14 @@ Function1238d: ; 1238d (4:638d)
bit 7, a
jr nz, .asm_123a8
call Function123d5
- farcall AnimatedObjects_PlayFrameAndDelay
+ farcall PlaySpriteAnimationsAndDelay
call Function123b8
call DelayFrame
and a
ret
.asm_123a8
- callfar ClearAnimatedObjectBuffer
+ callfar ClearSpriteAnims
call ClearSprites
xor a
ldh [hSCX], a
diff --git a/engine/movie/gamefreak_presents.asm b/engine/movie/gamefreak_presents.asm
index e71f26bf..2676c9f6 100644
--- a/engine/movie/gamefreak_presents.asm
+++ b/engine/movie/gamefreak_presents.asm
@@ -68,7 +68,7 @@ GFPresents_Init: ; e49f3 (39:49f3)
lb bc, BANK(GFPresentsGFX2), 5
call Request2bpp
- farcall ClearAnimatedObjectBuffer
+ farcall ClearSpriteAnims
ld hl, wSpriteAnimDict
ld a, 6
@@ -108,7 +108,7 @@ GFPresents_PlayFrame: ; e4a37 (39:4a37)
bit 7, a
jr nz, .finish
- farcall AnimatedObjects_PlayFrame
+ farcall PlaySpriteAnimations
call GFPresents_HandleFrame
call DelayFrame
@@ -123,7 +123,7 @@ GFPresents_PlayFrame: ; e4a37 (39:4a37)
set 6, [hl]
.finish
- callfar ClearAnimatedObjectBuffer
+ callfar ClearSpriteAnims
call ClearTilemap
call ClearSprites
diff --git a/engine/pokemon/breeding.asm b/engine/pokemon/breeding.asm
new file mode 100644
index 00000000..b891df82
--- /dev/null
+++ b/engine/pokemon/breeding.asm
@@ -0,0 +1,935 @@
+CheckBreedmonCompatibility:
+ call .CheckBreedingGroupCompatibility
+ ld c, $0
+ jp nc, .done
+ ld a, [wBreedMon1Species]
+ ld [wCurPartySpecies], a
+ ld a, [wBreedMon1DVs]
+ ld [wTempMonDVs], a
+ ld a, [wBreedMon1DVs + 1]
+ ld [wTempMonDVs + 1], a
+ ld a, TEMPMON
+ ld [wMonType], a
+ predef GetGender
+ jr c, .genderless
+ ld b, $1
+ jr nz, .breedmon2
+ inc b
+
+.breedmon2
+ push bc
+ ld a, [wBreedMon2Species]
+ ld [wCurPartySpecies], a
+ ld a, [wBreedMon2DVs]
+ ld [wTempMonDVs], a
+ ld a, [wBreedMon2DVs + 1]
+ ld [wTempMonDVs + 1], a
+ ld a, TEMPMON
+ ld [wMonType], a
+ predef GetGender
+ pop bc
+ jr c, .genderless
+ ld a, $1
+ jr nz, .compare_gender
+ inc a
+
+.compare_gender
+ cp b
+ jr nz, .compute
+
+.genderless
+ ld c, $0
+ ld a, [wBreedMon1Species]
+ cp DITTO
+ jr z, .ditto1
+ ld a, [wBreedMon2Species]
+ cp DITTO
+ jr nz, .done
+ jr .compute
+
+.ditto1
+ ld a, [wBreedMon2Species]
+ cp DITTO
+ jr z, .done
+
+.compute
+ call .CheckDVs
+ ld c, 255
+ jp z, .done
+ ld a, [wBreedMon2Species]
+ ld b, a
+ ld a, [wBreedMon1Species]
+ cp b
+ ld c, 254
+ jr z, .compare_ids
+ ld c, 128
+.compare_ids
+ ; Speed up
+ ld a, [wBreedMon1ID]
+ ld b, a
+ ld a, [wBreedMon2ID]
+ cp b
+ jr nz, .done
+ ld a, [wBreedMon1ID + 1]
+ ld b, a
+ ld a, [wBreedMon2ID + 1]
+ cp b
+ jr nz, .done
+ ld a, c
+ sub 77
+ ld c, a
+
+.done
+ ld a, c
+ ld [wBreedingCompatibility], a
+ ret
+
+.CheckDVs:
+; If Defense DVs match and the lower 3 bits of the Special DVs match,
+; avoid breeding
+ ld a, [wBreedMon1DVs]
+ and %1111
+ ld b, a
+ ld a, [wBreedMon2DVs]
+ and %1111
+ cp b
+ ret nz
+ ld a, [wBreedMon1DVs + 1]
+ and %111
+ ld b, a
+ ld a, [wBreedMon2DVs + 1]
+ and %111
+ cp b
+ ret
+
+.CheckBreedingGroupCompatibility:
+; If either mon is in the No Eggs group,
+; they are not compatible.
+ ld a, [wBreedMon2Species]
+ ld [wCurSpecies], a
+ call GetBaseData
+ ld a, [wBaseEggGroups]
+ cp EGG_NONE * $11
+ jr z, .Incompatible
+
+ ld a, [wBreedMon1Species]
+ ld [wCurSpecies], a
+ call GetBaseData
+ ld a, [wBaseEggGroups]
+ cp EGG_NONE * $11
+ jr z, .Incompatible
+
+; Ditto is automatically compatible with everything.
+; If not Ditto, load the breeding groups into b/c and d/e.
+ ld a, [wBreedMon2Species]
+ cp DITTO
+ jr z, .Compatible
+ ld [wCurSpecies], a
+ call GetBaseData
+ ld a, [wBaseEggGroups]
+ push af
+ and $f
+ ld b, a
+ pop af
+ and $f0
+ swap a
+ ld c, a
+
+ ld a, [wBreedMon1Species]
+ cp DITTO
+ jr z, .Compatible
+ ld [wCurSpecies], a
+ push bc
+ call GetBaseData
+ pop bc
+ ld a, [wBaseEggGroups]
+ push af
+ and $f
+ ld d, a
+ pop af
+ and $f0
+ swap a
+ ld e, a
+
+ ld a, d
+ cp b
+ jr z, .Compatible
+ cp c
+ jr z, .Compatible
+
+ ld a, e
+ cp b
+ jr z, .Compatible
+ cp c
+ jr z, .Compatible
+
+.Incompatible:
+ and a
+ ret
+
+.Compatible:
+ scf
+ ret
+
+DoEggStep::
+ ld de, wPartySpecies
+ ld hl, wPartyMon1Happiness
+ ld c, 0
+.loop
+ ld a, [de]
+ inc de
+ cp -1
+ ret z
+ cp EGG
+ jr nz, .next
+ dec [hl]
+ jr nz, .next
+ ld a, 1
+ and a
+ ret
+
+.next
+ push de
+ ld de, PARTYMON_STRUCT_LENGTH
+ add hl, de
+ pop de
+ jr .loop
+
+OverworldHatchEgg::
+ call RefreshScreen
+ call LoadStandardMenuHeader
+ call HatchEggs
+ call ExitAllMenus
+ call RestartMapMusic
+ jp CloseText
+
+HatchEggs:
+ ld de, wPartySpecies
+ ld hl, wPartyMon1Happiness
+ xor a
+ ld [wCurPartyMon], a
+
+.loop
+ ld a, [de]
+ inc de
+ cp -1
+ jp z, .done
+ push de
+ push hl
+ cp EGG
+ jp nz, .next
+ ld a, [hl]
+ and a
+ jp nz, .next
+ ld [hl], $78
+
+ push de
+
+ ld a, [wCurPartyMon]
+ ld hl, wPartyMon1Species
+ ld bc, PARTYMON_STRUCT_LENGTH
+ call AddNTimes
+ ld a, [hl]
+ ld [wCurPartySpecies], a
+ dec a
+ call SetSeenAndCaughtMon
+
+ ld a, [wCurPartySpecies]
+ cp TOGEPI
+ jr nz, .nottogepi
+ ; set the event flag for hatching togepi
+ ld de, EVENT_TOGEPI_HATCHED
+ ld b, SET_FLAG
+ call EventFlagAction
+.nottogepi
+
+ pop de
+
+ ld a, [wCurPartySpecies]
+ dec de
+ ld [de], a
+ ld [wNamedObjectIndexBuffer], a
+ ld [wCurSpecies], a
+ call GetPokemonName
+ xor a
+ ld [wUnusedEggHatchFlag], a
+ call GetBaseData
+ ld a, [wCurPartyMon]
+ ld hl, wPartyMon1
+ ld bc, PARTYMON_STRUCT_LENGTH
+ call AddNTimes
+ push hl
+ ld bc, MON_MAXHP
+ add hl, bc
+ ld d, h
+ ld e, l
+ pop hl
+ push hl
+ ld bc, MON_LEVEL
+ add hl, bc
+ ld a, [hl]
+ ld [wCurPartyLevel], a
+ pop hl
+ push hl
+ ld bc, MON_STATUS
+ add hl, bc
+ xor a
+ ld [hli], a
+ ld [hl], a
+ pop hl
+ push hl
+ ld bc, MON_STAT_EXP - 1
+ add hl, bc
+ ld b, FALSE
+ predef CalcMonStats
+ pop bc
+ ld hl, MON_MAXHP
+ add hl, bc
+ ld d, h
+ ld e, l
+ ld hl, MON_HP
+ add hl, bc
+ ld a, [de]
+ inc de
+ ld [hli], a
+ ld a, [de]
+ ld [hl], a
+ ld hl, MON_ID
+ add hl, bc
+ ld a, [wPlayerID]
+ ld [hli], a
+ ld a, [wPlayerID + 1]
+ ld [hl], a
+ ld a, [wCurPartyMon]
+ ld hl, wPartyMonOT
+ ld bc, NAME_LENGTH
+ call AddNTimes
+ ld d, h
+ ld e, l
+ ld hl, wPlayerName
+ call CopyBytes
+ ld hl, .Text_HatchEgg
+ call PrintText
+ ld a, [wCurPartyMon]
+ ld hl, wPartyMonNicknames
+ ld bc, MON_NAME_LENGTH
+ call AddNTimes
+ ld d, h
+ ld e, l
+ push de
+ ld hl, .BreedAskNicknameText
+ call PrintText
+ call YesNoBox
+ pop de
+ jr c, .nonickname
+
+ ld a, TRUE
+ ld [wUnusedEggHatchFlag], a
+ xor a
+ ld [wMonType], a
+ push de
+ ld b, NAME_MON
+ farcall NamingScreen
+ pop hl
+ ld de, wStringBuffer1
+ call InitName
+ jr .next
+
+.nonickname
+ ld hl, wStringBuffer1
+ ld bc, MON_NAME_LENGTH
+ call CopyBytes
+
+.next
+ ld hl, wCurPartyMon
+ inc [hl]
+ pop hl
+ ld de, PARTYMON_STRUCT_LENGTH
+ add hl, de
+ pop de
+ jp .loop
+
+.done
+ ret
+
+.Text_HatchEgg:
+ ; Huh? @ @
+ text_far Text_BreedHuh
+ text_asm
+ ld hl, wVramState
+ res 0, [hl]
+ push hl
+ push de
+ push bc
+ ld a, [wCurPartySpecies]
+ push af
+ call EggHatch_AnimationSequence
+ ld hl, .BreedClearboxText
+ call PrintText
+ pop af
+ ld [wCurPartySpecies], a
+ pop bc
+ pop de
+ pop hl
+ ld hl, .BreedEggHatchText
+ ret
+
+.BreedClearboxText:
+ text_far _BreedClearboxText
+ text_end
+
+.BreedEggHatchText:
+ text_far _BreedEggHatchText
+ text_end
+
+.BreedAskNicknameText:
+ text_far _BreedAskNicknameText
+ text_end
+
+InitEggMoves:
+ call GetHeritableMoves
+ ld d, h
+ ld e, l
+ ld b, NUM_MOVES
+.loop
+ ld a, [de]
+ and a
+ jr z, .done
+ ld hl, wEggMonMoves
+ ld c, NUM_MOVES
+.next
+ ld a, [de]
+ cp [hl]
+ jr z, .skip
+ inc hl
+ dec c
+ jr nz, .next
+ call GetEggMove
+ jr nc, .skip
+ call LoadEggMove
+
+.skip
+ inc de
+ dec b
+ jr nz, .loop
+
+.done
+ ret
+
+GetEggMove:
+ push bc
+ ld a, [wEggMonSpecies]
+ dec a
+ ld c, a
+ ld b, 0
+ ld hl, EggMovePointers
+ add hl, bc
+ add hl, bc
+ ld a, BANK(EggMovePointers)
+ call GetFarHalfword
+.loop
+ ld a, BANK(EggMovePointers)
+ call GetFarByte
+ cp -1
+ jr z, .reached_end
+ ld b, a
+ ld a, [de]
+ cp b
+ jr z, .done_carry
+ inc hl
+ jr .loop
+
+.reached_end
+ call GetBreedmonMovePointer
+ ld b, NUM_MOVES
+.loop2
+ ld a, [de]
+ cp [hl]
+ jr z, .found_eggmove
+ inc hl
+ dec b
+ jr z, .inherit_tmhm
+ jr .loop2
+
+.found_eggmove
+ ld a, [wEggMonSpecies]
+ dec a
+ ld c, a
+ ld b, 0
+ ld hl, EvosAttacksPointers
+ add hl, bc
+ add hl, bc
+ ld a, BANK(EvosAttacksPointers)
+ call GetFarHalfword
+.loop3
+ ld a, BANK(EvosAttacksPointers)
+ call GetFarByte
+ inc hl
+ and a
+ jr nz, .loop3
+.loop4
+ ld a, BANK(EvosAttacksPointers)
+ call GetFarByte
+ and a
+ jr z, .inherit_tmhm
+ inc hl
+ ld a, BANK(EvosAttacksPointers)
+ call GetFarByte
+ ld b, a
+ ld a, [de]
+ cp b
+ jr z, .done_carry
+ inc hl
+ jr .loop4
+
+.inherit_tmhm
+ ld hl, TMHMMoves
+.loop5
+ ld a, BANK(TMHMMoves)
+ call GetFarByte
+ inc hl
+ and a
+ jr z, .done
+ ld b, a
+ ld a, [de]
+ cp b
+ jr nz, .loop5
+ ld [wPutativeTMHMMove], a
+ predef CanLearnTMHMMove
+ ld a, c
+ and a
+ jr z, .done
+
+.done_carry
+ pop bc
+ scf
+ ret
+
+.done
+ pop bc
+ and a
+ ret
+
+LoadEggMove:
+ push de
+ push bc
+ ld a, [de]
+ ld b, a
+ ld hl, wEggMonMoves
+ ld c, NUM_MOVES
+.loop
+ ld a, [hli]
+ and a
+ jr z, .done
+ dec c
+ jr nz, .loop
+ ld de, wEggMonMoves
+ ld hl, wEggMonMoves + 1
+ ld a, [hli]
+ ld [de], a
+ inc de
+ ld a, [hli]
+ ld [de], a
+ inc de
+ ld a, [hli]
+ ld [de], a
+
+.done
+ dec hl
+ ld [hl], b
+ ld hl, wEggMonMoves
+ ld de, wEggMonPP
+ predef FillPP
+ pop bc
+ pop de
+ ret
+
+GetHeritableMoves:
+ ld hl, wBreedMon2Moves
+ ld a, [wBreedMon1Species]
+ cp DITTO
+ jr z, .ditto1
+ ld a, [wBreedMon2Species]
+ cp DITTO
+ jr z, .ditto2
+ ld a, [wBreedMotherOrNonDitto]
+ and a
+ ret z
+ ld hl, wBreedMon1Moves
+ ret
+
+.ditto1
+ ld a, [wCurPartySpecies]
+ push af
+ ld a, [wBreedMon2Species]
+ ld [wCurPartySpecies], a
+ ld a, [wBreedMon2DVs]
+ ld [wTempMonDVs], a
+ ld a, [wBreedMon2DVs + 1]
+ ld [wTempMonDVs + 1], a
+ ld a, TEMPMON
+ ld [wMonType], a
+ predef GetGender
+ jr c, .inherit_mon2_moves
+ jr nz, .inherit_mon2_moves
+ jr .inherit_mon1_moves
+
+.ditto2
+ ld a, [wCurPartySpecies]
+ push af
+ ld a, [wBreedMon1Species]
+ ld [wCurPartySpecies], a
+ ld a, [wBreedMon1DVs]
+ ld [wTempMonDVs], a
+ ld a, [wBreedMon1DVs + 1]
+ ld [wTempMonDVs + 1], a
+ ld a, TEMPMON
+ ld [wMonType], a
+ predef GetGender
+ jr c, .inherit_mon1_moves
+ jr nz, .inherit_mon1_moves
+
+.inherit_mon2_moves
+ ld hl, wBreedMon2Moves
+ pop af
+ ld [wCurPartySpecies], a
+ ret
+
+.inherit_mon1_moves
+ ld hl, wBreedMon1Moves
+ pop af
+ ld [wCurPartySpecies], a
+ ret
+
+GetBreedmonMovePointer:
+ ld hl, wBreedMon1Moves
+ ld a, [wBreedMon1Species]
+ cp DITTO
+ ret z
+ ld a, [wBreedMon2Species]
+ cp DITTO
+ jr z, .ditto
+ ld a, [wBreedMotherOrNonDitto]
+ and a
+ ret z
+
+.ditto
+ ld hl, wBreedMon2Moves
+ ret
+
+GetHatchlingFrontpic:
+ push de
+ ld [wCurPartySpecies], a
+ ld [wCurSpecies], a
+ call GetBaseData
+ ld hl, wBattleMonDVs
+ predef GetUnownLetter
+ pop de
+ predef_jump GetMonFrontpic
+
+Hatch_UpdateFrontpicBGMapCenter:
+ push af
+ call WaitTop
+ push hl
+ push bc
+ hlcoord 0, 0
+ ld bc, SCREEN_HEIGHT * SCREEN_WIDTH
+ ld a, " "
+ call ByteFill
+ pop bc
+ pop hl
+ ld a, b
+ ldh [hBGMapAddress + 1], a
+ ld a, c
+ ldh [hGraphicStartTile], a
+ lb bc, 7, 7
+ predef PlaceGraphic
+ pop af
+ call Hatch_LoadFrontpicPal
+ call SetPalettes
+ jp WaitBGMap
+
+EggHatch_DoAnimFrame:
+ push hl
+ push de
+ push bc
+ callfar PlaySpriteAnimations
+ call DelayFrame
+ pop bc
+ pop de
+ pop hl
+ ret
+
+EggHatch_AnimationSequence:
+ ld a, [wNamedObjectIndexBuffer]
+ ld [wJumptableIndex], a
+ ld a, [wCurSpecies]
+ push af
+ ld de, MUSIC_NONE
+ call PlayMusic
+ farcall BlankScreen
+ call DisableLCD
+ ld hl, EggHatchGFX
+ ld de, vTiles0 tile $00
+ ld bc, 2 tiles
+ ld a, BANK(EggHatchGFX)
+ call FarCopyBytes
+ farcall ClearSpriteAnims
+ ld de, vTiles2 tile $00
+ ld a, [wJumptableIndex]
+ call GetHatchlingFrontpic
+ ld de, vTiles2 tile $31
+ ld a, EGG
+ call GetHatchlingFrontpic
+ ld de, MUSIC_EVOLUTION
+ call PlayMusic
+ call EnableLCD
+ hlcoord 7, 4
+ ld b, HIGH(vBGMap0)
+ ld c, $31 ; Egg tiles start here
+ ld a, EGG
+ call Hatch_UpdateFrontpicBGMapCenter
+ ld c, 80
+ call DelayFrames
+ xor a
+ ld [wFrameCounter], a
+ ldh a, [hSCX]
+ ld b, a
+.outerloop
+ ld hl, wFrameCounter
+ ld a, [hl]
+ inc [hl]
+ cp 8
+ jr nc, .done
+ ld e, [hl]
+.loop
+; wobble e times
+ ld a, 2
+ ldh [hSCX], a
+ ld a, -2
+ ld [wGlobalAnimXOffset], a
+ call EggHatch_DoAnimFrame
+ ld c, 2
+ call DelayFrames
+ ld a, -2
+ ldh [hSCX], a
+ ld a, 2
+ ld [wGlobalAnimXOffset], a
+ call EggHatch_DoAnimFrame
+ ld c, 2
+ call DelayFrames
+ dec e
+ jr nz, .loop
+ ld c, 16
+ call DelayFrames
+ call EggHatch_CrackShell
+ jr .outerloop
+
+.done
+ ld de, SFX_EGG_HATCH
+ call PlaySFX
+ xor a
+ ldh [hSCX], a
+ ld [wGlobalAnimXOffset], a
+ call ClearSprites
+ call Hatch_InitShellFragments
+ hlcoord 6, 3
+ ld b, HIGH(vBGMap0)
+ ld c, $00 ; Hatchling tiles start here
+ ld a, [wJumptableIndex]
+ call Hatch_UpdateFrontpicBGMapCenter
+ call Hatch_ShellFragmentLoop
+ call WaitSFX
+ ld a, [wJumptableIndex]
+ call PlayMonCry
+ pop af
+ ld [wCurSpecies], a
+ ret
+
+Hatch_LoadFrontpicPal:
+ ld [wPlayerHPPal], a
+ ld b, SCGB_EVOLUTION
+ ld c, $0
+ jp GetSGBLayout
+
+EggHatch_CrackShell:
+ ld a, [wFrameCounter]
+ dec a
+ and $7
+ cp $7
+ ret z
+ srl a
+ ret nc
+ swap a
+ srl a
+ add 9 * 8
+ ld d, a
+ ld e, 11 * 8
+ ld a, SPRITE_ANIM_INDEX_EGG_CRACK
+ call InitSpriteAnimStruct
+ ld hl, SPRITEANIMSTRUCT_TILE_ID
+ add hl, bc
+ ld [hl], $0
+ ld de, SFX_EGG_CRACK
+ jp PlaySFX
+
+EggHatchGFX:
+INCBIN "gfx/evo/egg_hatch.2bpp"
+
+Hatch_InitShellFragments:
+ farcall ClearSpriteAnims
+ ld hl, .SpriteData
+.loop
+ ld a, [hli]
+ cp -1
+ jr z, .done
+ ld e, a
+ ld a, [hli]
+ ld d, a
+ ld a, [hli]
+ ld c, a
+ ld a, [hli]
+ ld b, a
+ push hl
+ push bc
+
+ ld a, SPRITE_ANIM_INDEX_EGG_HATCH
+ call InitSpriteAnimStruct
+
+ ld hl, SPRITEANIMSTRUCT_TILE_ID
+ add hl, bc
+ ld [hl], $0
+
+ pop de
+ ld a, e
+ ld hl, SPRITEANIMSTRUCT_FRAMESET_ID
+ add hl, bc
+ add [hl]
+ ld [hl], a
+
+ ld hl, SPRITEANIMSTRUCT_JUMPTABLE_INDEX
+ add hl, bc
+ ld [hl], d
+
+ pop hl
+ jr .loop
+.done
+ ld de, SFX_EGG_HATCH
+ call PlaySFX
+ call EggHatch_DoAnimFrame
+ ret
+
+shell_fragment: MACRO
+; y tile, y pxl, x tile, x pxl, frameset offset, ???
+ db (\1 * 8) % $100 + \2, (\3 * 8) % $100 + \4, \5 - SPRITE_ANIM_FRAMESET_EGG_HATCH_1, \6
+ENDM
+
+.SpriteData:
+ shell_fragment 10, 4, 9, 0, SPRITE_ANIM_FRAMESET_EGG_HATCH_1, $3c
+ shell_fragment 11, 4, 9, 0, SPRITE_ANIM_FRAMESET_EGG_HATCH_2, $04
+ shell_fragment 10, 4, 10, 0, SPRITE_ANIM_FRAMESET_EGG_HATCH_1, $30
+ shell_fragment 11, 4, 10, 0, SPRITE_ANIM_FRAMESET_EGG_HATCH_2, $10
+ shell_fragment 10, 4, 11, 0, SPRITE_ANIM_FRAMESET_EGG_HATCH_3, $24
+ shell_fragment 11, 4, 11, 0, SPRITE_ANIM_FRAMESET_EGG_HATCH_4, $1c
+ shell_fragment 10, 0, 9, 4, SPRITE_ANIM_FRAMESET_EGG_HATCH_1, $36
+ shell_fragment 12, 0, 9, 4, SPRITE_ANIM_FRAMESET_EGG_HATCH_2, $0a
+ shell_fragment 10, 0, 10, 4, SPRITE_ANIM_FRAMESET_EGG_HATCH_3, $2a
+ shell_fragment 12, 0, 10, 4, SPRITE_ANIM_FRAMESET_EGG_HATCH_4, $16
+ db -1
+
+Hatch_ShellFragmentLoop:
+ ld c, 129
+.loop
+ call EggHatch_DoAnimFrame
+ dec c
+ jr nz, .loop
+ ret
+
+DayCareMon1:
+ ld hl, LeftWithDayCareManText
+ call PrintText
+ ld a, [wBreedMon1Species]
+ call PlayMonCry
+ ld a, [wDayCareLady]
+ bit DAYCARELADY_HAS_MON_F, a
+ jr z, DayCareMonCursor
+ call PromptButton
+ ld hl, wBreedMon2Nick
+ call DayCareMonCompatibilityText
+ jp PrintText
+
+DayCareMon2:
+ ld hl, LeftWithDayCareLadyText
+ call PrintText
+ ld a, [wBreedMon2Species]
+ call PlayMonCry
+ ld a, [wDayCareMan]
+ bit DAYCAREMAN_HAS_MON_F, a
+ jr z, DayCareMonCursor
+ call PromptButton
+ ld hl, wBreedMon1Nick
+ call DayCareMonCompatibilityText
+ jp PrintText
+
+DayCareMonCursor:
+ jp WaitPressAorB_BlinkCursor
+
+LeftWithDayCareLadyText:
+ text_far _LeftWithDayCareLadyText
+ text_end
+
+LeftWithDayCareManText:
+ text_far _LeftWithDayCareManText
+ text_end
+
+DayCareMonCompatibilityText:
+ push bc
+ ld de, wStringBuffer1
+ ld bc, NAME_LENGTH
+ call CopyBytes
+ call CheckBreedmonCompatibility
+ pop bc
+ ld a, [wBreedingCompatibility]
+ ld hl, .BreedBrimmingWithEnergyText
+ cp -1
+ jr z, .done
+ ld hl, .BreedNoInterestText
+ and a
+ jr z, .done
+ ld hl, .BreedAppearsToCareForText
+ cp 230
+ jr nc, .done
+ cp 70
+ ld hl, .BreedFriendlyText
+ jr nc, .done
+ ld hl, .BreedShowsInterestText
+
+.done
+ ret
+
+.BreedBrimmingWithEnergyText:
+ text_far _BreedBrimmingWithEnergyText
+ text_end
+
+.BreedNoInterestText:
+ text_far _BreedNoInterestText
+ text_end
+
+.BreedAppearsToCareForText:
+ text_far _BreedAppearsToCareForText
+ text_end
+
+.BreedFriendlyText:
+ text_far _BreedFriendlyText
+ text_end
+
+.BreedShowsInterestText:
+ text_far _BreedShowsInterestText
+ text_end
+
+Unreferenced_DayCareMonPrintEmptyString:
+ ld hl, .string
+ ret
+
+.string
+ db "@"
diff --git a/gfx/evo/egg_hatch.2bpp b/gfx/evo/egg_hatch.2bpp
new file mode 100644
index 00000000..4fc77ac3
--- /dev/null
+++ b/gfx/evo/egg_hatch.2bpp
@@ -0,0 +1 @@
+  @@?1A~~<< \ No newline at end of file
diff --git a/gfx/overworld/celebi.2bpp b/gfx/overworld/celebi.2bpp
deleted file mode 100644
index 80e9953e..00000000
--- a/gfx/overworld/celebi.2bpp
+++ /dev/null
Binary files differ
diff --git a/gfx/overworld/kris_fish.2bpp b/gfx/overworld/kris_fish.2bpp
deleted file mode 100644
index 9d47dc14..00000000
--- a/gfx/overworld/kris_fish.2bpp
+++ /dev/null
Binary files differ
diff --git a/gfx/printer/bold_a.1bpp b/gfx/printer/bold_a.1bpp
new file mode 100644
index 00000000..e24d140c
--- /dev/null
+++ b/gfx/printer/bold_a.1bpp
Binary files differ
diff --git a/gfx/printer/bold_b.1bpp b/gfx/printer/bold_b.1bpp
new file mode 100644
index 00000000..fc6de697
--- /dev/null
+++ b/gfx/printer/bold_b.1bpp
Binary files differ
diff --git a/main.asm b/main.asm
index a58a8b9a..adaf104a 100644
--- a/main.asm
+++ b/main.asm
@@ -89,19 +89,10 @@ INCLUDE "engine/events/money.asm"
INCLUDE "data/items/marts.asm"
INCLUDE "engine/events/mom.asm"
INCLUDE "engine/events/daycare.asm"
-Function16e3a:
- dr $16e3a, $16ff7
-PhotoStudio:
- dr $16ff7, $171d1
-
-CheckBreedmonCompatibility:
- dr $171d1, $17467
-InitEggMoves:
- dr $17467, $177a5
-DayCareMon1:
- dr $177a5, $177c4
-DayCareMon2:
- dr $177c4, $1783e
+INCLUDE "engine/events/print_unown.asm"
+INCLUDE "engine/events/print_photo.asm"
+ dr $1704d, $171d1 ; ?
+INCLUDE "engine/pokemon/breeding.asm"
SECTION "bank6", ROMX
dr $18000, $1bdbc
@@ -112,7 +103,9 @@ LoadMapGroupRoof::
dr $1c000, $1f84c
SECTION "bank8", ROMX
- dr $20000, $23e3d
+ dr $20000, $239fe
+EggMovePointers:
+ dr $239fe, $23e3d
SECTION "bank9", ROMX
@@ -495,9 +488,13 @@ INCBIN "gfx/pokemon/egg/front.2bpp.lz"
SECTION "bank21", ROMX
dr $84000, $842db
_PrinterReceive::
- dr $842db, $845d4
+ dr $842db, $84560
+PrintUnownStamp:
+ dr $84560, $845d4
PrintMailAndExit:
- dr $845d4, $84684
+ dr $845d4, $84616
+PrintPartymon:
+ dr $84616, $84684
Function84684:
dr $84684, $86632
@@ -505,6 +502,7 @@ _HallOfFamePC:
dr $86632, $87bfd
SECTION "bank23", ROMX
+
SaveMenu_CopyTilemapAtOnce:
dr $8c000, $8c17a
ResetClock_:
@@ -547,11 +545,11 @@ FlyToAnimation:
MagnetTrain:
dr $8ce7c, $8d174
-ClearAnimatedObjectBuffer:
+ClearSpriteAnims:
dr $8d174, $8d183
-AnimatedObjects_PlayFrameAndDelay:
+PlaySpriteAnimationsAndDelay:
dr $8d183, $8d18a
-AnimatedObjects_PlayFrame:
+PlaySpriteAnimations:
dr $8d18a, $8d1f7
_InitSpriteAnimStruct::
dr $8d1f7, $8d332
@@ -559,7 +557,6 @@ _ReinitSpriteAnimFrame::
IF DEF(_GOLD)
dr $8d332, $8e774
-
ClearSpriteAnims2::
dr $8e774, $8e78b
LoadOverworldMonIcon::
@@ -570,10 +567,8 @@ UnfreezeMonIcons::
dr $8e922, $8e93d
HoldSwitchmonIcon::
dr $8e93d, $8fe43
-
ELIF DEF(_SILVER)
dr $8d332, $8e75a
-
ClearSpriteAnims2::
dr $8e75a, $8e771
LoadOverworldMonIcon::
@@ -690,7 +685,7 @@ DummyPredef2F::
INCLUDE "data/moves/animations.asm"
LoadPoisonBGPals::
- dr $cbc76, $cc000
+ dr $cbc76, $cbdba
SECTION "bank33", ROMX
@@ -712,7 +707,9 @@ SECTION "bank36", ROMX
SECTION "bank38", ROMX
dr $e0000, $e0002
Functione0002:
- dr $e0002, $e0909
+ dr $e0002, $e081b
+RotateUnownFrontpic:
+ dr $e081b, $e0909
Functione0909:
dr $e0909, $e199d
@@ -729,7 +726,7 @@ MovePKMNWithoutMail_:
dr $e2f47, $e3d25
ChangeBox_:
- dr $e3d25, $e4000
+ dr $e3d25, $e3f74
SECTION "bank39", ROMX
diff --git a/wram.asm b/wram.asm
index af8cde81..4f28ee6e 100644
--- a/wram.asm
+++ b/wram.asm
@@ -2130,6 +2130,7 @@ wce63::
wJumptableIndex::
db
wce64::
+wFrameCounter::
wMomBankDigitCursorPosition::
db
wce65::
@@ -2880,7 +2881,7 @@ wd133:: ds 1 ; d133
wd134:: ds 1 ; d134
wd135:: ds 1 ; d135
wd136:: ds 1 ; d136
-wd137:: ds 1 ; d137
+wBaseEggGroups:: db
wd138:: ds 1 ; d138
wd139:: ds 1 ; d139
wd13a:: ds 1 ; d13a
@@ -3869,6 +3870,9 @@ wPokedexShowPointerBank:: db
ds 3
NEXTU ; dd40
+wUnusedEggHatchFlag:: db
+
+NEXTU ; dd40
; enemy party
wOTPlayerName:: ds NAME_LENGTH ; dd40
wOTPlayerID:: dw ; dd4b