From e3e0bcd653f8d671f6fd1390fa922e3b644f4a34 Mon Sep 17 00:00:00 2001 From: mid-kid Date: Sun, 20 Oct 2019 22:24:17 +0000 Subject: #641 fixes and additions. (#646) Name a lot of text labels according to our conventions --- engine/overworld/decorations.asm | 80 +++++++++++++++++----------------------- engine/overworld/scripting.asm | 6 +-- engine/overworld/select_menu.asm | 8 ++-- engine/overworld/wildmons.asm | 5 +-- 4 files changed, 42 insertions(+), 57 deletions(-) (limited to 'engine/overworld') diff --git a/engine/overworld/decorations.asm b/engine/overworld/decorations.asm index 3b40641f3..67a07e5db 100644 --- a/engine/overworld/decorations.asm +++ b/engine/overworld/decorations.asm @@ -378,12 +378,11 @@ PopulateDecoCategoryMenu: ret .empty - ld hl, .Text_nothing_to_choose + ld hl, .NothingToChooseText call MenuTextboxBackup ret -.Text_nothing_to_choose: - ; There's nothing to choose. +.NothingToChooseText: text_far _NothingToChooseText text_end @@ -674,7 +673,7 @@ DecoAction_SetItUp: ld a, [wBuffer1] ld hl, wStringBuffer3 call GetDecorationName - ld hl, DecoText_PutAwayAndSetUp + ld hl, PutAwayAndSetUpText call MenuTextboxBackup xor a ret @@ -683,13 +682,13 @@ DecoAction_SetItUp: ld a, [wMenuSelection] ld hl, wStringBuffer3 call GetDecorationName - ld hl, DecoText_SetUpTheDeco + ld hl, SetUpTheDecoText call MenuTextboxBackup xor a ret .alreadythere - ld hl, DecoText_AlreadySetUp + ld hl, AlreadySetUpText call MenuTextboxBackup scf ret @@ -710,19 +709,19 @@ DecoAction_TryPutItAway: ld [wMenuSelection], a ld hl, wStringBuffer3 call GetDecorationName - ld hl, DecoText_PutAwayTheDeco + ld hl, PutAwayTheDecoText call MenuTextboxBackup xor a ret .nothingthere - ld hl, DecoText_NothingToPutAway + ld hl, NothingToPutAwayText call MenuTextboxBackup xor a ret DecoAction_setupornament: - ld hl, UnknownText_0x26e41 + ld hl, WhichSidePutOnText call DecoAction_AskWhichSide jr c, .cancel call DecoAction_SetItUp_Ornament @@ -736,7 +735,7 @@ DecoAction_setupornament: ret DecoAction_putawayornament: - ld hl, DecoText_WhichSide + ld hl, WhichSidePutAwayText call DecoAction_AskWhichSide jr nc, .incave xor a @@ -771,7 +770,7 @@ DecoAction_SetItUp_Ornament: ld a, [wMenuSelection] ld [wSelectedDecoration], a call .getwhichside - ld hl, DecoText_PutAwayAndSetUp + ld hl, PutAwayAndSetUpText call MenuTextboxBackup xor a ret @@ -783,13 +782,13 @@ DecoAction_SetItUp_Ornament: ld a, [wMenuSelection] ld hl, wStringBuffer3 call GetDecorationName - ld hl, DecoText_SetUpTheDeco + ld hl, SetUpTheDecoText call MenuTextboxBackup xor a ret .failed - ld hl, DecoText_AlreadySetUp + ld hl, AlreadySetUpText call MenuTextboxBackup scf ret @@ -804,8 +803,7 @@ DecoAction_SetItUp_Ornament: ld [wOtherDecoration], a ret -UnknownText_0x26e41: - ; Which side do you want to put it on? +WhichSidePutOnText: text_far _WhichSidePutOnText text_end @@ -819,19 +817,18 @@ DecoAction_PutItAway_Ornament: ld [wBuffer5], a xor a ld [wSelectedDecoration], a - ld hl, DecoText_PutAwayTheDeco + ld hl, PutAwayTheDecoText call MenuTextboxBackup xor a ret .nothingthere - ld hl, DecoText_NothingToPutAway + ld hl, NothingToPutAwayText call MenuTextboxBackup xor a ret -DecoText_WhichSide: - ; Which side do you want to put away? +WhichSidePutAwayText: text_far _WhichSidePutAwayText text_end @@ -883,28 +880,23 @@ MenuData_0x26eb3: db "LEFT SIDE@" db "CANCEL@" -DecoText_PutAwayTheDeco: - ; Put away the @ . +PutAwayTheDecoText: text_far _PutAwayTheDecoText text_end -DecoText_NothingToPutAway: - ; There's nothing to put away. +NothingToPutAwayText: text_far _NothingToPutAwayText text_end -DecoText_SetUpTheDeco: - ; Set up the @ . +SetUpTheDecoText: text_far _SetUpTheDecoText text_end -DecoText_PutAwayAndSetUp: - ; Put away the @ and set up the @ . +PutAwayAndSetUpText: text_far _PutAwayAndSetUpText text_end -DecoText_AlreadySetUp: - ; That's already set up. +AlreadySetUpText: text_far _AlreadySetUpText text_end @@ -1005,38 +997,34 @@ DecorationDesc_PosterPointers: DecorationDesc_TownMapPoster: opentext - writetext .TownMapText + writetext .LookTownMapText waitbutton special OverworldTownMap closetext end -.TownMapText: - ; It's the TOWN MAP. +.LookTownMapText: text_far _LookTownMapText text_end DecorationDesc_PikachuPoster: - jumptext .PikaPosterText + jumptext .LookPikachuPosterText -.PikaPosterText: - ; It's a poster of a cute PIKACHU. +.LookPikachuPosterText: text_far _LookPikachuPosterText text_end DecorationDesc_ClefairyPoster: - jumptext .ClefairyPosterText + jumptext .LookClefairyPosterText -.ClefairyPosterText: - ; It's a poster of a cute CLEFAIRY. +.LookClefairyPosterText: text_far _LookClefairyPosterText text_end DecorationDesc_JigglypuffPoster: - jumptext .JigglypuffPosterText + jumptext .LookJigglypuffPosterText -.JigglypuffPosterText: - ; It's a poster of a cute JIGGLYPUFF. +.LookJigglypuffPosterText: text_far _LookJigglypuffPosterText text_end @@ -1064,10 +1052,9 @@ DecorationDesc_OrnamentOrConsole: ret .OrnamentConsoleScript: - jumptext .OrnamentConsoleText + jumptext .LookAdorableDecoText -.OrnamentConsoleText: - ; It's an adorable @ . +.LookAdorableDecoText: text_far _LookAdorableDecoText text_end @@ -1077,10 +1064,9 @@ DecorationDesc_GiantOrnament: ret .BigDollScript: - jumptext .BigDollText + jumptext .LookGiantDecoText -.BigDollText: - ; A giant doll! It's fluffy and cuddly. +.LookGiantDecoText: text_far _LookGiantDecoText text_end diff --git a/engine/overworld/scripting.asm b/engine/overworld/scripting.asm index 7496b82bd..128439205 100644 --- a/engine/overworld/scripting.asm +++ b/engine/overworld/scripting.asm @@ -530,7 +530,7 @@ GiveItemScript: end ReceivedItemText: - text_far UnknownText_0x1c4719 + text_far _ReceivedItemText text_end Script_verbosegiveitemvar: @@ -622,11 +622,11 @@ CurItemName: ret PutItemInPocketText: - text_far UnknownText_0x1c472c + text_far _PutItemInPocketText text_end PocketIsFullText: - text_far UnknownText_0x1c474b + text_far _PocketIsFullText text_end Script_pokemart: diff --git a/engine/overworld/select_menu.asm b/engine/overworld/select_menu.asm index 9cc2ba149..18532edae 100644 --- a/engine/overworld/select_menu.asm +++ b/engine/overworld/select_menu.asm @@ -5,14 +5,14 @@ SelectMenu:: .NotRegistered: call OpenText - ld b, BANK(ItemMayBeRegisteredText) - ld hl, ItemMayBeRegisteredText + ld b, BANK(MayRegisterItemText) + ld hl, MayRegisterItemText call MapTextbox call WaitButton jp CloseText -ItemMayBeRegisteredText: - text_far UnknownText_0x1c1cf3 +MayRegisterItemText: + text_far _MayRegisterItemText text_end CheckRegisteredItem: diff --git a/engine/overworld/wildmons.asm b/engine/overworld/wildmons.asm index a384915b6..61ef89b18 100644 --- a/engine/overworld/wildmons.asm +++ b/engine/overworld/wildmons.asm @@ -821,7 +821,7 @@ RandomUnseenWildMon: ld a, c ld [wNamedObjectIndexBuffer], a call GetPokemonName - ld hl, .SawRareMonText + ld hl, .JustSawSomeRareMonText call PrintText xor a ld [wScriptVar], a @@ -832,8 +832,7 @@ RandomUnseenWildMon: ld [wScriptVar], a ret -.SawRareMonText: - ; I just saw some rare @ in @ . I'll call you if I see another rare #MON, OK? +.JustSawSomeRareMonText: text_far _JustSawSomeRareMonText text_end -- cgit v1.2.3 From 1f172badc42935bb510b03fa56e61707489e7c9b Mon Sep 17 00:00:00 2001 From: mid-kid Date: Wed, 21 Aug 2019 14:43:21 +0200 Subject: Misc fixes --- engine/overworld/map_objects.asm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engine/overworld') diff --git a/engine/overworld/map_objects.asm b/engine/overworld/map_objects.asm index cf532fea6..6a1c1a22b 100644 --- a/engine/overworld/map_objects.asm +++ b/engine/overworld/map_objects.asm @@ -430,7 +430,7 @@ RestoreDefaultMovement: ret .ok - ld a, SPRITEMOVEFN_STANDING + ld a, SPRITEMOVEDATA_STANDING_DOWN ret ClearObjectMovementByteIndex: @@ -2466,7 +2466,7 @@ RefreshPlayerSprite: jr ContinueSpawnFacing SpawnInFacingDown: - ld a, 0 + ld a, DOWN ContinueSpawnFacing: ld bc, wPlayerStruct call SetSpriteDirection -- cgit v1.2.3 From 7111ae8e582996f2b6ef36427cf54e0c168593ae Mon Sep 17 00:00:00 2001 From: mid-kid Date: Mon, 23 Sep 2019 15:09:49 +0200 Subject: Fix some mobile script and map sign things --- engine/overworld/warp_connection.asm | 1 - 1 file changed, 1 deletion(-) (limited to 'engine/overworld') diff --git a/engine/overworld/warp_connection.asm b/engine/overworld/warp_connection.asm index 2b36d1e42..bf28ab35e 100644 --- a/engine/overworld/warp_connection.asm +++ b/engine/overworld/warp_connection.asm @@ -1,4 +1,3 @@ - HandleNewMap: call ClearUnusedMapBuffer call ResetMapBufferEventFlags -- cgit v1.2.3 From 5134266b9a4570f69df5e9bc8a0d91a116da796c Mon Sep 17 00:00:00 2001 From: Rangi Date: Sun, 3 Nov 2019 12:25:59 -0500 Subject: Rename OBJECT_LENGTH to MAPOBJECT_LENGTH and OBJECT_STRUCT_LENGTH to OBJECT_LENGTH --- engine/overworld/events.asm | 2 +- engine/overworld/map_objects.asm | 22 +++++++++++----------- engine/overworld/map_objects_2.asm | 2 +- engine/overworld/npc_movement.asm | 4 ++-- engine/overworld/overworld.asm | 2 +- engine/overworld/player_object.asm | 16 ++++++++-------- 6 files changed, 24 insertions(+), 24 deletions(-) (limited to 'engine/overworld') diff --git a/engine/overworld/events.asm b/engine/overworld/events.asm index 178a889a3..76f14e506 100644 --- a/engine/overworld/events.asm +++ b/engine/overworld/events.asm @@ -1626,7 +1626,7 @@ CmdQueue_StoneTable: jr c, .fall_down_hole .next - ld hl, OBJECT_STRUCT_LENGTH + ld hl, OBJECT_LENGTH add hl, de ld d, h ld e, l diff --git a/engine/overworld/map_objects.asm b/engine/overworld/map_objects.asm index 6a1c1a22b..16562213b 100644 --- a/engine/overworld/map_objects.asm +++ b/engine/overworld/map_objects.asm @@ -10,7 +10,7 @@ DeleteMapObject:: push af ld h, b ld l, c - ld bc, OBJECT_STRUCT_LENGTH + ld bc, OBJECT_LENGTH xor a call ByteFill pop af @@ -2082,11 +2082,11 @@ DespawnEmote: jr z, .next push bc xor a - ld bc, OBJECT_STRUCT_LENGTH + ld bc, OBJECT_LENGTH call ByteFill pop bc .next - ld hl, OBJECT_STRUCT_LENGTH + ld hl, OBJECT_LENGTH add hl, de ld d, h ld e, l @@ -2149,7 +2149,7 @@ Function55e0:: jr z, .ok call Function565c .ok - ld hl, OBJECT_STRUCT_LENGTH + ld hl, OBJECT_LENGTH add hl, bc ld b, h ld c, l @@ -2205,7 +2205,7 @@ Function5645: .loop ldh [hMapObjectIndexBuffer], a call SetFacing_Standing - ld hl, OBJECT_STRUCT_LENGTH + ld hl, OBJECT_LENGTH add hl, bc ld b, h ld c, l @@ -2421,7 +2421,7 @@ HandleNPCStep:: jr z, .next call Function437b .next - ld hl, OBJECT_STRUCT_LENGTH + ld hl, OBJECT_LENGTH add hl, bc ld b, h ld c, l @@ -2582,7 +2582,7 @@ Function587a: add hl, bc set OBJ_FLAGS2_5, [hl] .next - ld hl, OBJECT_STRUCT_LENGTH + ld hl, OBJECT_LENGTH add hl, bc ld b, h ld c, l @@ -2625,7 +2625,7 @@ Function58b9:: add hl, bc res OBJ_FLAGS2_5, [hl] .next - ld hl, OBJECT_STRUCT_LENGTH + ld hl, OBJECT_LENGTH add hl, bc ld b, h ld c, l @@ -2750,7 +2750,7 @@ ApplyBGMapAnchorToObjects: add e ld [hl], a .skip - ld hl, OBJECT_STRUCT_LENGTH + ld hl, OBJECT_LENGTH add hl, bc ld b, h ld c, l @@ -2809,7 +2809,7 @@ InitSprites: jr .add .skip - ld hl, OBJECT_STRUCT_LENGTH + ld hl, OBJECT_LENGTH add hl, bc ld b, h ld c, l @@ -2817,7 +2817,7 @@ InitSprites: jr .next .add - ld hl, OBJECT_STRUCT_LENGTH + ld hl, OBJECT_LENGTH add hl, bc ld b, h ld c, l diff --git a/engine/overworld/map_objects_2.asm b/engine/overworld/map_objects_2.asm index f055e0fd9..d89d95fc0 100644 --- a/engine/overworld/map_objects_2.asm +++ b/engine/overworld/map_objects_2.asm @@ -19,7 +19,7 @@ LoadObjectMasks: ld [de], a inc de pop bc - ld hl, OBJECT_LENGTH + ld hl, MAPOBJECT_LENGTH add hl, bc ld b, h ld c, l diff --git a/engine/overworld/npc_movement.asm b/engine/overworld/npc_movement.asm index d249d2fd4..f4c730247 100644 --- a/engine/overworld/npc_movement.asm +++ b/engine/overworld/npc_movement.asm @@ -369,7 +369,7 @@ IsNPCAtCoord: jr nz, .setcarry .next - ld hl, OBJECT_STRUCT_LENGTH + ld hl, OBJECT_LENGTH add hl, bc ld b, h ld c, l @@ -523,7 +523,7 @@ Unreferenced_Function7113: jr .yes .next - ld hl, OBJECT_STRUCT_LENGTH + ld hl, OBJECT_LENGTH add hl, bc ld b, h ld c, l diff --git a/engine/overworld/overworld.asm b/engine/overworld/overworld.asm index e47645f2c..814f608f7 100644 --- a/engine/overworld/overworld.asm +++ b/engine/overworld/overworld.asm @@ -109,7 +109,7 @@ AddIndoorSprites: push af ld a, [hl] call AddSpriteGFX - ld de, OBJECT_LENGTH + ld de, MAPOBJECT_LENGTH add hl, de pop af inc a diff --git a/engine/overworld/player_object.asm b/engine/overworld/player_object.asm index 9f1b13dd9..478c8f6c6 100644 --- a/engine/overworld/player_object.asm +++ b/engine/overworld/player_object.asm @@ -132,9 +132,9 @@ CopyObjectStruct:: and a ret nz ; masked - ld hl, wObjectStructs + OBJECT_STRUCT_LENGTH * 1 + ld hl, wObjectStructs + OBJECT_LENGTH * 1 ld a, 1 - ld de, OBJECT_STRUCT_LENGTH + ld de, OBJECT_LENGTH .loop ldh [hObjectStructIndexBuffer], a ld a, [hl] @@ -224,7 +224,7 @@ CopyMapObjectToObjectStruct: ret InitializeVisibleSprites: - ld bc, wMapObjects + OBJECT_LENGTH + ld bc, wMapObjects + MAPOBJECT_LENGTH ld a, 1 .loop ldh [hMapObjectIndexBuffer], a @@ -271,7 +271,7 @@ InitializeVisibleSprites: jp c, .ret .next - ld hl, OBJECT_LENGTH + ld hl, MAPOBJECT_LENGTH add hl, bc ld b, h ld c, l @@ -311,7 +311,7 @@ CheckObjectEnteringVisibleRange:: ld d, a ld a, [wXCoord] ld e, a - ld bc, wMapObjects + OBJECT_LENGTH + ld bc, wMapObjects + MAPOBJECT_LENGTH ld a, 1 .loop_v ldh [hMapObjectIndexBuffer], a @@ -345,7 +345,7 @@ CheckObjectEnteringVisibleRange:: pop de .next_v - ld hl, OBJECT_LENGTH + ld hl, MAPOBJECT_LENGTH add hl, bc ld b, h ld c, l @@ -367,7 +367,7 @@ CheckObjectEnteringVisibleRange:: ld e, a ld a, [wYCoord] ld d, a - ld bc, wMapObjects + OBJECT_LENGTH + ld bc, wMapObjects + MAPOBJECT_LENGTH ld a, 1 .loop_h ldh [hMapObjectIndexBuffer], a @@ -401,7 +401,7 @@ CheckObjectEnteringVisibleRange:: pop de .next_h - ld hl, OBJECT_LENGTH + ld hl, MAPOBJECT_LENGTH add hl, bc ld b, h ld c, l -- cgit v1.2.3 From 4aeab6b87901a3571b105564576ac356ca527172 Mon Sep 17 00:00:00 2001 From: Rangi Date: Sun, 3 Nov 2019 12:48:54 -0500 Subject: Rename buttonsound to promptbutton --- engine/overworld/scripting.asm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'engine/overworld') diff --git a/engine/overworld/scripting.asm b/engine/overworld/scripting.asm index 128439205..7f82ea81d 100644 --- a/engine/overworld/scripting.asm +++ b/engine/overworld/scripting.asm @@ -148,7 +148,7 @@ ScriptCommandTable: dw Script_farjumptext ; 52 dw Script_jumptext ; 53 dw Script_waitbutton ; 54 - dw Script_buttonsound ; 55 + dw Script_promptbutton ; 55 dw Script_pokepic ; 56 dw Script_closepokepic ; 57 dw Script__2dmenu ; 58 @@ -398,7 +398,7 @@ Script_waitbutton: jp WaitButton -Script_buttonsound: +Script_promptbutton: ; script command 0x55 ldh a, [hOAMUpdate] @@ -406,7 +406,7 @@ Script_buttonsound: ld a, $1 ldh [hOAMUpdate], a call WaitBGMap - call ButtonSound + call PromptButton pop af ldh [hOAMUpdate], a ret @@ -525,7 +525,7 @@ GiveItemScript: end .Full: - buttonsound + promptbutton pocketisfull end -- cgit v1.2.3 From 717cf3f45873a759bce6530692950de84ea37a4d Mon Sep 17 00:00:00 2001 From: Rangi Date: Sun, 3 Nov 2019 14:30:33 -0500 Subject: Identify PLAYERMOVEMENT_* constants --- engine/overworld/events.asm | 43 ++++++++++++++++++------------------ engine/overworld/player_movement.asm | 16 +++++++------- 2 files changed, 30 insertions(+), 29 deletions(-) (limited to 'engine/overworld') diff --git a/engine/overworld/events.asm b/engine/overworld/events.asm index 76f14e506..d4c6ec0bf 100644 --- a/engine/overworld/events.asm +++ b/engine/overworld/events.asm @@ -759,40 +759,41 @@ PlayerMovement: ret .pointers - dw .zero - dw .one - dw .two - dw .three - dw .four - dw .five - dw .six - dw .seven - -.zero -.four +; entries correspond to PLAYERMOVEMENT_* constants + dw .normal + dw .warp + dw .turn + dw .force_turn + dw .finish + dw .continue + dw .exit_water + dw .jump + +.normal: +.finish: xor a ld c, a ret -.seven +.jump: call ret_968d7 ; mobile xor a ld c, a ret -.one - ld a, 5 +.warp: + ld a, PLAYEREVENT_WARP ld c, a scf ret -.two - ld a, 9 +.turn: + ld a, PLAYEREVENT_JOYCHANGEFACING ld c, a scf ret -.three +.force_turn: ; force the player to move in some direction ld a, BANK(Script_ForcedMovement) ld hl, Script_ForcedMovement @@ -802,8 +803,8 @@ PlayerMovement: scf ret -.five -.six +.continue: +.exit_water: ld a, -1 ld c, a and a @@ -923,13 +924,13 @@ CountStep: ret .hatch - ld a, 8 + ld a, PLAYEREVENT_HATCH scf ret ; unused .unreferenced - ld a, 7 + ld a, PLAYEREVENT_WHITEOUT scf ret diff --git a/engine/overworld/player_movement.asm b/engine/overworld/player_movement.asm index 09d6b47de..9f372640b 100644 --- a/engine/overworld/player_movement.asm +++ b/engine/overworld/player_movement.asm @@ -120,7 +120,7 @@ DoPlayerMovement:: ld c, a call CheckWhirlpoolTile jr c, .not_whirlpool - ld a, 3 + ld a, PLAYERMOVEMENT_FORCE_TURN scf ret @@ -222,7 +222,7 @@ DoPlayerMovement:: .continue_walk ld a, STEP_WALK call .DoStep - ld a, 5 + ld a, PLAYERMOVEMENT_CONTINUE scf ret @@ -247,7 +247,7 @@ DoPlayerMovement:: ld a, STEP_TURN call .DoStep - ld a, 2 + ld a, PLAYERMOVEMENT_TURN scf ret @@ -345,7 +345,7 @@ DoPlayerMovement:: call PlayMapMusic ld a, STEP_WALK call .DoStep - ld a, 6 + ld a, PLAYERMOVEMENT_EXIT_WATER scf ret @@ -374,7 +374,7 @@ DoPlayerMovement:: call PlaySFX ld a, STEP_LEDGE call .DoStep - ld a, 7 + ld a, PLAYERMOVEMENT_JUMP scf ret @@ -428,11 +428,11 @@ DoPlayerMovement:: call .StandInPlace scf - ld a, 1 + ld a, PLAYERMOVEMENT_WARP ret .not_warp - xor a + xor a ; PLAYERMOVEMENT_NORMAL ret .EdgeWarps: @@ -465,7 +465,7 @@ DoPlayerMovement:: ld a, [hl] ld [wPlayerTurningDirection], a - ld a, 4 + ld a, PLAYERMOVEMENT_FINISH ret .Steps: -- cgit v1.2.3 From 0c7b309f7f275f7cfee99bddea8b645c4c8f5f7f Mon Sep 17 00:00:00 2001 From: Rangi Date: Sun, 3 Nov 2019 20:07:25 -0500 Subject: Suggested formatting changes --- engine/overworld/scripting.asm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engine/overworld') diff --git a/engine/overworld/scripting.asm b/engine/overworld/scripting.asm index 7f82ea81d..415d29d6d 100644 --- a/engine/overworld/scripting.asm +++ b/engine/overworld/scripting.asm @@ -148,7 +148,7 @@ ScriptCommandTable: dw Script_farjumptext ; 52 dw Script_jumptext ; 53 dw Script_waitbutton ; 54 - dw Script_promptbutton ; 55 + dw Script_promptbutton ; 55 dw Script_pokepic ; 56 dw Script_closepokepic ; 57 dw Script__2dmenu ; 58 -- cgit v1.2.3 From 4d32035d4f68157e11c5eab2311ab760eb481339 Mon Sep 17 00:00:00 2001 From: Rangi Date: Sun, 3 Nov 2019 20:17:04 -0500 Subject: Bit 6 of PrintNum left-aligns numbers --- engine/overworld/scripting.asm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'engine/overworld') diff --git a/engine/overworld/scripting.asm b/engine/overworld/scripting.asm index 415d29d6d..245d8e763 100644 --- a/engine/overworld/scripting.asm +++ b/engine/overworld/scripting.asm @@ -1952,7 +1952,7 @@ Script_getmoney: call ResetStringBuffer1 call GetMoneyAccount ld hl, wStringBuffer1 - lb bc, PRINTNUM_RIGHTALIGN | 3, 6 + lb bc, PRINTNUM_LEFTALIGN | 3, 6 call PrintNum ld de, wStringBuffer1 jp GetStringBuffer @@ -1964,7 +1964,7 @@ Script_getcoins: call ResetStringBuffer1 ld hl, wStringBuffer1 ld de, wCoins - lb bc, PRINTNUM_RIGHTALIGN | 2, 6 + lb bc, PRINTNUM_LEFTALIGN | 2, 6 call PrintNum ld de, wStringBuffer1 jp GetStringBuffer @@ -1976,7 +1976,7 @@ Script_getnum: call ResetStringBuffer1 ld de, wScriptVar ld hl, wStringBuffer1 - lb bc, PRINTNUM_RIGHTALIGN | 1, 3 + lb bc, PRINTNUM_LEFTALIGN | 1, 3 call PrintNum ld de, wStringBuffer1 jp GetStringBuffer -- cgit v1.2.3 From 739a60b33c54021c975f22d627e4b5e40206fe37 Mon Sep 17 00:00:00 2001 From: mid-kid Date: Mon, 18 Nov 2019 18:16:50 +0100 Subject: Make the map setup commands match the actual function names better These functions used as map setup commands are used in other places, too, so I can't prefix them under the same. The names should match except I won't repeat "map" in a map setup command name. --- engine/overworld/map_setup.asm | 54 ++++++++++++++++++------------------ engine/overworld/spawn_points.asm | 2 +- engine/overworld/warp_connection.asm | 14 +++++----- 3 files changed, 35 insertions(+), 35 deletions(-) (limited to 'engine/overworld') diff --git a/engine/overworld/map_setup.asm b/engine/overworld/map_setup.asm index 5cf350a0a..a38736eb3 100644 --- a/engine/overworld/map_setup.asm +++ b/engine/overworld/map_setup.asm @@ -18,7 +18,7 @@ INCLUDE "data/maps/setup_scripts.asm" ReadMapSetupScript: .loop ld a, [hli] - cp -1 + cp map_end ret z push hl @@ -62,52 +62,52 @@ MapSetupCommands: ; entries correspond to command indexes in constants/map_setup_constants.asm dba EnableLCD ; 00 dba DisableLCD ; 01 - dba MapSetup_Sound_Off ; 02 + dba InitSound ; 02 dba PlayMapMusic ; 03 dba RestartMapMusic ; 04 dba FadeToMapMusic ; 05 - dba RotatePalettesRightMapAndMusic ; 06 - dba EnterMapMusic ; 07 + dba FadeMapMusicAndPalettes ; 06 + dba PlayMapMusicBike ; 07 dba ForceMapMusic ; 08 dba FadeInMusic ; 09 dba LoadBlockData ; 0a (callback 1) - dba LoadNeighboringBlockData ; 0b + dba LoadConnectionBlockData ; 0b dba SaveScreen ; 0c dba BufferScreen ; 0d - dba LoadGraphics ; 0e - dba LoadTileset ; 0f + dba LoadMapGraphics ; 0e + dba LoadMapTileset ; 0f dba LoadMapTimeOfDay ; 10 dba LoadMapPalettes ; 11 dba LoadWildMonData ; 12 dba RefreshMapSprites ; 13 dba HandleNewMap ; 14 - dba InitCommandQueue ; 15 - dba LoadObjectsRunCallback_02 ; 16 - dba LoadSpawnPoint ; 17 + dba HandleContinueMap ; 15 + dba LoadMapObjects ; 16 + dba EnterMapSpawnPoint ; 17 dba EnterMapConnection ; 18 - dba LoadWarpData ; 19 + dba EnterMapWarp ; 19 dba LoadMapAttributes ; 1a - dba LoadMapAttributes_SkipPeople ; 1b + dba LoadMapAttributes_SkipObjects ; 1b dba ClearBGPalettes ; 1c dba FadeOutPalettes ; 1d dba FadeInPalettes ; 1e - dba GetCoordOfUpperLeftCorner ; 1f - dba RestoreFacingAfterWarp ; 20 + dba GetMapScreenCoords ; 1f + dba GetWarpDestCoords ; 20 dba SpawnInFacingDown ; 21 dba SpawnPlayer ; 22 dba RefreshPlayerCoords ; 23 - dba DelayClearingOldSprites ; 24 - dba DelayLoadingNewSprites ; 25 + dba ResetPlayerObjectAction ; 24 + dba SkipUpdateMapSprites ; 25 dba UpdateRoamMons ; 26 dba JumpRoamMons ; 27 - dba FadeOldMapMusic ; 28 + dba FadeOutMapMusic ; 28 dba ActivateMapAnims ; 29 dba SuspendMapAnims ; 2a - dba RetainOldPalettes ; 2b - dba DontScrollText ; 2c - dba ReturnFromMapSetupScript ; 2d + dba ApplyMapPalettes ; 2b + dba EnableTextAcceleration ; 2c + dba InitMapNameSign ; 2d -DontScrollText: +EnableTextAcceleration: xor a ld [wDisableTextAcceleration], a ret @@ -122,7 +122,7 @@ SuspendMapAnims: ldh [hMapAnims], a ret -LoadObjectsRunCallback_02: +LoadMapObjects: ld a, MAPCALLBACK_OBJECTS call RunMapCallback farcall LoadObjectMasks @@ -132,12 +132,12 @@ LoadObjectsRunCallback_02: ; unused ret -DelayClearingOldSprites: +ResetPlayerObjectAction: ld hl, wPlayerSpriteSetupFlags set PLAYERSPRITESETUP_RESET_ACTION_F, [hl] ret -DelayLoadingNewSprites: +SkipUpdateMapSprites: ld hl, wPlayerSpriteSetupFlags set PLAYERSPRITESETUP_SKIP_RELOAD_GFX_F, [hl] ret @@ -215,16 +215,16 @@ CheckReplaceKrisSprite: and a ret -FadeOldMapMusic: +FadeOutMapMusic: ld a, 6 call SkipMusic ret -RetainOldPalettes: +ApplyMapPalettes: farcall _UpdateTimePals ret -RotatePalettesRightMapAndMusic: +FadeMapMusicAndPalettes: ld e, 0 ld a, [wMusicFadeID] ld d, 0 diff --git a/engine/overworld/spawn_points.asm b/engine/overworld/spawn_points.asm index 6b4476f2b..33e4c96b3 100644 --- a/engine/overworld/spawn_points.asm +++ b/engine/overworld/spawn_points.asm @@ -1,6 +1,6 @@ INCLUDE "data/maps/spawn_points.asm" -LoadSpawnPoint: +EnterMapSpawnPoint: ; loads the spawn point in wDefaultSpawnpoint push hl push de diff --git a/engine/overworld/warp_connection.asm b/engine/overworld/warp_connection.asm index bf28ab35e..ed3b26ef5 100644 --- a/engine/overworld/warp_connection.asm +++ b/engine/overworld/warp_connection.asm @@ -6,7 +6,7 @@ HandleNewMap: call ResetBikeFlags ld a, MAPCALLBACK_NEWMAP call RunMapCallback -InitCommandQueue: +HandleContinueMap: farcall ClearCmdQueue ld a, MAPCALLBACK_CMDQUEUE call RunMapCallback @@ -149,7 +149,7 @@ EnterMapConnection: scf ret -LoadWarpData: +EnterMapWarp: call .SaveDigWarp call .SetSpawn ld a, [wNextWarp] @@ -295,8 +295,8 @@ LoadMapTimeOfDay: ldh [rVBK], a ret -LoadGraphics: - call LoadTileset +LoadMapGraphics: + call LoadMapTileset call LoadTilesetGFX xor a ldh [hMapAnims], a @@ -313,7 +313,7 @@ LoadMapPalettes: RefreshMapSprites: call ClearSprites - farcall ReturnFromMapSetupScript + farcall InitMapNameSign call GetMovementPermissions farcall RefreshPlayerSprite farcall CheckReplaceKrisSprite @@ -325,7 +325,7 @@ RefreshMapSprites: call SafeUpdateSprites .skip ld a, [wPlayerSpriteSetupFlags] - and %00011100 + and (1 << PLAYERSPRITESETUP_FEMALE_TO_MALE_F) | (1 << 3) | (1 << 4) ld [wPlayerSpriteSetupFlags], a ret @@ -386,7 +386,7 @@ CheckMovingOffEdgeOfMap:: scf ret -GetCoordOfUpperLeftCorner:: +GetMapScreenCoords:: ld hl, wOverworldMapBlocks ld a, [wXCoord] bit 0, a -- cgit v1.2.3 From fa7261a8eea2676746c130a517479e2a82a7d352 Mon Sep 17 00:00:00 2001 From: Rangi Date: Tue, 3 Dec 2019 09:17:21 -0500 Subject: Update some labels --- engine/overworld/map_setup.asm | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'engine/overworld') diff --git a/engine/overworld/map_setup.asm b/engine/overworld/map_setup.asm index 5cf350a0a..45f9c7076 100644 --- a/engine/overworld/map_setup.asm +++ b/engine/overworld/map_setup.asm @@ -178,13 +178,13 @@ CheckReplaceKrisSprite: jr z, .surfing call GetMapEnvironment cp INDOOR - jr z, .checkbiking + jr z, .no_biking cp ENVIRONMENT_5 - jr z, .checkbiking + jr z, .no_biking cp DUNGEON - jr z, .checkbiking + jr z, .no_biking jr .nope -.checkbiking +.no_biking ld a, [wPlayerState] cp PLAYER_BIKE jr nz, .nope @@ -200,18 +200,19 @@ CheckReplaceKrisSprite: .CheckSurfing: call CheckOnWater - jr nz, .ret_nc + jr nz, .nope2 ld a, [wPlayerState] cp PLAYER_SURF - jr z, ._surfing + jr z, .is_surfing cp PLAYER_SURF_PIKA - jr z, ._surfing + jr z, .is_surfing ld a, PLAYER_SURF ld [wPlayerState], a -._surfing +.is_surfing scf ret -.ret_nc + +.nope2 and a ret -- cgit v1.2.3