From 5f60cc24cf0935c4908151f0462e67a08d59558d Mon Sep 17 00:00:00 2001 From: mid-kid Date: Tue, 15 Jan 2019 13:06:16 +0100 Subject: [PATCH 1/4] Fix some constants Glass ting SFX were added in crystal. PicAnimations and UnownAnimations are expected to be in the same bank as their pointers, because the pointers are not BANK()-referenced separately. --- constants/sfx_constants.asm | 4 ++-- engine/events/mom_phone.asm | 2 +- engine/gfx/pic_animation.asm | 4 ++-- gfx/pokemon/anims.asm | 2 -- gfx/pokemon/unown_anims.asm | 2 -- 5 files changed, 5 insertions(+), 9 deletions(-) diff --git a/constants/sfx_constants.asm b/constants/sfx_constants.asm index 37fd908db..b58af59ea 100644 --- a/constants/sfx_constants.asm +++ b/constants/sfx_constants.asm @@ -189,10 +189,10 @@ const SFX_TRAIN_ARRIVED ; b9 const SFX_STOP_SLOT ; ba const SFX_2_BOOPS ; bb - const SFX_GLASS_TING ; bc - const SFX_GLASS_TING_2 ; bd ; new to Crystal + const SFX_GLASS_TING ; bc + const SFX_GLASS_TING_2 ; bd const SFX_INTRO_UNOWN_1 ; be const SFX_INTRO_UNOWN_2 ; bf const SFX_INTRO_UNOWN_3 ; c0 diff --git a/engine/events/mom_phone.asm b/engine/events/mom_phone.asm index 6e14e33d9..0a8dbef29 100644 --- a/engine/events/mom_phone.asm +++ b/engine/events/mom_phone.asm @@ -1,7 +1,7 @@ NUM_MOM_ITEMS_1 EQUS "((MomItems_1.End - MomItems_1) / 8)" NUM_MOM_ITEMS_2 EQUS "((MomItems_2.End - MomItems_2) / 8)" -const_value = 1 + const_def 1 const MOM_ITEM const MOM_DOLL diff --git a/engine/gfx/pic_animation.asm b/engine/gfx/pic_animation.asm index 6d8b52d44..88dc1f6d9 100644 --- a/engine/gfx/pic_animation.asm +++ b/engine/gfx/pic_animation.asm @@ -892,12 +892,12 @@ GetMonAnimPointer: call PokeAnim_IsEgg jr z, .egg - ld c, BANK(UnownAnimations) + ld c, BANK(UnownAnimationPointers) ; aka BANK(UnownAnimationIdlePointers) ld hl, UnownAnimationPointers ld de, UnownAnimationIdlePointers call PokeAnim_IsUnown jr z, .unown - ld c, BANK(PicAnimations) + ld c, BANK(AnimationPointers) ; aka BANK(AnimationIdlePointers) ld hl, AnimationPointers ld de, AnimationIdlePointers .unown diff --git a/gfx/pokemon/anims.asm b/gfx/pokemon/anims.asm index 761e7125c..e8f490cb2 100644 --- a/gfx/pokemon/anims.asm +++ b/gfx/pokemon/anims.asm @@ -1,5 +1,3 @@ -PicAnimations: ; used only for BANK(PicAnimations) - BulbasaurAnimation: INCLUDE "gfx/pokemon/bulbasaur/anim.asm" IvysaurAnimation: INCLUDE "gfx/pokemon/ivysaur/anim.asm" VenusaurAnimation: INCLUDE "gfx/pokemon/venusaur/anim.asm" diff --git a/gfx/pokemon/unown_anims.asm b/gfx/pokemon/unown_anims.asm index 6e8d251d5..6aa239e8e 100644 --- a/gfx/pokemon/unown_anims.asm +++ b/gfx/pokemon/unown_anims.asm @@ -1,5 +1,3 @@ -UnownAnimations: ; used only for BANK(UnownAnimations) - UnownAAnimation: INCLUDE "gfx/pokemon/unown_a/anim.asm" UnownBAnimation: INCLUDE "gfx/pokemon/unown_b/anim.asm" UnownCAnimation: INCLUDE "gfx/pokemon/unown_c/anim.asm" From a21507f22a0a93fe2b0b67073dd9f847864e49a9 Mon Sep 17 00:00:00 2001 From: mid-kid Date: Tue, 15 Jan 2019 13:08:40 +0100 Subject: [PATCH 2/4] Document wSuicuneFrame Also fixed inmediate in PlaceMapNameFrame.FillTopBottom to calculate the amount of loops required. (It fills two tiles in the first iteration, and four in the remaining, hence the `-2` and `+1` part). --- engine/events/map_name_sign.asm | 2 +- engine/movie/title.asm | 4 ++-- wram.asm | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/engine/events/map_name_sign.asm b/engine/events/map_name_sign.asm index 0b6b2b203..7bdbe8e8a 100644 --- a/engine/events/map_name_sign.asm +++ b/engine/events/map_name_sign.asm @@ -242,7 +242,7 @@ PlaceMapNameFrame: ret .FillTopBottom: - ld c, 5 + ld c, ((SCREEN_WIDTH - 2) - 2) / 4 + 1 jr .enterloop .continueloop diff --git a/engine/movie/title.asm b/engine/movie/title.asm index 26b30c3ee..a48b71e62 100644 --- a/engine/movie/title.asm +++ b/engine/movie/title.asm @@ -208,7 +208,7 @@ _TitleScreen: ldh [hBGMapMode], a xor a - ld [wd002], a + ld [wSuicuneFrame], a ; Play starting sound effect call SFXChannelsOff @@ -218,7 +218,7 @@ _TitleScreen: ret SuicuneFrameIterator: - ld hl, wd002 + ld hl, wSuicuneFrame ld a, [hl] ld c, a inc [hl] diff --git a/wram.asm b/wram.asm index 4631475c9..37c82c4cd 100644 --- a/wram.asm +++ b/wram.asm @@ -1710,6 +1710,7 @@ NEXTU ; d002 wTempDayOfWeek:: wApricorns:: wKeepSevenBiasChance:: ; used in the slots to handle the favoring of 7 symbol streaks +wSuicuneFrame:: db ds 2 wStartFlypoint:: db From 0390728d442db9b0eca21b56fe5ecff982195b67 Mon Sep 17 00:00:00 2001 From: mid-kid Date: Tue, 15 Jan 2019 13:37:22 +0100 Subject: [PATCH 3/4] Fix constants used with startbattle --- maps/LakeOfRage.asm | 2 +- maps/Route36.asm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/maps/LakeOfRage.asm b/maps/LakeOfRage.asm index a63fb147e..fbfaa93bb 100644 --- a/maps/LakeOfRage.asm +++ b/maps/LakeOfRage.asm @@ -87,7 +87,7 @@ RedGyarados: loadwildmon GYARADOS, 30 writecode VAR_BATTLETYPE, BATTLETYPE_SHINY startbattle - ifequal $1, .NotBeaten + ifequal LOSE, .NotBeaten disappear LAKEOFRAGE_GYARADOS .NotBeaten: reloadmapafterbattle diff --git a/maps/Route36.asm b/maps/Route36.asm index 67458e6f5..d9845bc30 100644 --- a/maps/Route36.asm +++ b/maps/Route36.asm @@ -77,7 +77,7 @@ WateredWeirdTreeScript:: ; export (for when you use Squirtbottle from pack) loadwildmon SUDOWOODO, 20 startbattle setevent EVENT_FOUGHT_SUDOWOODO - ifequal $2, DidntCatchSudowoodo + ifequal DRAW, DidntCatchSudowoodo disappear ROUTE36_WEIRD_TREE variablesprite SPRITE_WEIRD_TREE, SPRITE_TWIN reloadmapafterbattle From e288ef20d539a04042c5e91cc562db04bb33b707 Mon Sep 17 00:00:00 2001 From: mid-kid Date: Fri, 18 Jan 2019 16:17:50 +0100 Subject: [PATCH 4/4] Fix map name frame calculation --- engine/events/map_name_sign.asm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/events/map_name_sign.asm b/engine/events/map_name_sign.asm index 7bdbe8e8a..6162378a9 100644 --- a/engine/events/map_name_sign.asm +++ b/engine/events/map_name_sign.asm @@ -242,7 +242,7 @@ PlaceMapNameFrame: ret .FillTopBottom: - ld c, ((SCREEN_WIDTH - 2) - 2) / 4 + 1 + ld c, (SCREEN_WIDTH - 2) / 4 + 1 jr .enterloop .continueloop