From dd04feb32a16916545007942fc1c504c61abdbcf Mon Sep 17 00:00:00 2001 From: xCrystal Date: Mon, 31 Jul 2023 19:30:40 +0200 Subject: [PATCH] Remove map name sign feature (#1) --- data/maps/setup_script_pointers.asm | 1 - data/maps/setup_scripts.asm | 1 - engine/events/map_name_sign.asm | 233 --------------------- engine/overworld/events.asm | 11 - engine/overworld/warp_connection.asm | 3 +- gfx/font.asm | 9 - gfx/font/unused_up_arrow.png | Bin 86 -> 0 bytes gfx/font/unused_weekday_kanji.png | Bin 142 -> 0 bytes gfx/frames/{map_entry_sign.png => ow1.png} | Bin home/window.asm | 3 +- main.asm | 1 - ram/wram.asm | 1 - 12 files changed, 4 insertions(+), 259 deletions(-) delete mode 100644 engine/events/map_name_sign.asm delete mode 100644 gfx/font/unused_up_arrow.png delete mode 100644 gfx/font/unused_weekday_kanji.png rename gfx/frames/{map_entry_sign.png => ow1.png} (100%) diff --git a/data/maps/setup_script_pointers.asm b/data/maps/setup_script_pointers.asm index b32be8d8f..2d7e49abc 100644 --- a/data/maps/setup_script_pointers.asm +++ b/data/maps/setup_script_pointers.asm @@ -49,4 +49,3 @@ MapSetupCommands: add_mapsetup SuspendMapAnims ; 2a add_mapsetup ApplyMapPalettes ; 2b add_mapsetup EnableTextAcceleration ; 2c - add_mapsetup InitMapNameSign ; 2d diff --git a/data/maps/setup_scripts.asm b/data/maps/setup_scripts.asm index 5ad24be6e..bcb1057d1 100644 --- a/data/maps/setup_scripts.asm +++ b/data/maps/setup_scripts.asm @@ -86,7 +86,6 @@ MapSetupScript_Connection: mapsetup LoadMapObjects mapsetup FadeToMapMusic mapsetup LoadMapPalettes - mapsetup InitMapNameSign mapsetup ApplyMapPalettes mapsetup LoadWildMonData mapsetup UpdateRoamMons diff --git a/engine/events/map_name_sign.asm b/engine/events/map_name_sign.asm deleted file mode 100644 index 163eeab8e..000000000 --- a/engine/events/map_name_sign.asm +++ /dev/null @@ -1,233 +0,0 @@ -DEF MAP_NAME_SIGN_START EQU $60 - -InitMapNameSign:: - xor a - ldh [hBGMapMode], a - farcall .inefficient_farcall ; this is a waste of 6 ROM bytes and 6 stack bytes - ret - -; should have just been a fallthrough -.inefficient_farcall - ld a, [wMapGroup] - ld b, a - ld a, [wMapNumber] - ld c, a - call GetWorldMapLocation - ld [wCurLandmark], a - - call GetMapEnvironment - cp GATE - jr nz, .not_gate - -.gate - ld a, -1 - ld [wCurLandmark], a - -.not_gate - ld hl, wEnteredMapFromContinue - bit 1, [hl] - res 1, [hl] - jr nz, .dont_do_map_sign - - call .CheckMovingWithinLandmark - jr z, .dont_do_map_sign - ld a, [wCurLandmark] - ld [wPrevLandmark], a - - call .CheckSpecialMap - jr z, .dont_do_map_sign - -; Display for 60 frames - ld a, 60 - ld [wLandmarkSignTimer], a - call LoadMapNameSignGFX - call InitMapNameFrame - farcall HDMATransfer_OnlyTopFourRows - ret - -.dont_do_map_sign - ld a, [wCurLandmark] - ld [wPrevLandmark], a - ld a, $90 - ldh [rWY], a - ldh [hWY], a - xor a - ldh [hLCDCPointer], a - ret - -.CheckMovingWithinLandmark: - ld a, [wCurLandmark] - ld c, a - ld a, [wPrevLandmark] - cp c - ret - -.CheckSpecialMap: -; These landmarks do not get pop-up signs. - cp -1 - ret z - ld a, 1 - and a - ret - -PlaceMapNameSign:: - ld hl, wLandmarkSignTimer - ld a, [hl] - and a - jr z, .disappear - dec [hl] - cp 60 - ret z - cp 59 - jr nz, .already_initialized - call InitMapNameFrame - call PlaceMapNameCenterAlign - farcall HDMATransfer_OnlyTopFourRows -.already_initialized - ld a, $80 - ld a, $70 - ldh [rWY], a - ldh [hWY], a - ret - -.disappear - ld a, $90 - ldh [rWY], a - ldh [hWY], a - xor a - ldh [hLCDCPointer], a - ret - -LoadMapNameSignGFX: - ld de, MapEntryFrameGFX - ld hl, vTiles2 tile MAP_NAME_SIGN_START - lb bc, BANK(MapEntryFrameGFX), 14 - call Get2bpp - ret - -InitMapNameFrame: - hlcoord 0, 0 - ld b, 2 - ld c, 18 - call InitMapSignAttrmap - call PlaceMapNameFrame - ret - -PlaceMapNameCenterAlign: - ld a, [wCurLandmark] - ld e, a - farcall GetLandmarkName - call .GetNameLength - ld a, SCREEN_WIDTH - sub c - srl a - ld b, 0 - ld c, a - hlcoord 0, 2 - add hl, bc - ld de, wStringBuffer1 - call PlaceString - ret - -.GetNameLength: - ld c, 0 - push hl - ld hl, wStringBuffer1 -.loop - ld a, [hli] - cp "@" - jr z, .stop - cp "%" - jr z, .loop - inc c - jr .loop -.stop - pop hl - ret - -InitMapSignAttrmap: - ld de, wAttrmap - wTilemap - add hl, de - inc b - inc b - inc c - inc c - ld a, PAL_BG_TEXT | PRIORITY -.loop - push bc - push hl -.inner_loop - ld [hli], a - dec c - jr nz, .inner_loop - pop hl - ld de, SCREEN_WIDTH - add hl, de - pop bc - dec b - jr nz, .loop - ret - -PlaceMapNameFrame: - hlcoord 0, 0 - ; top left - ld a, MAP_NAME_SIGN_START + 1 - ld [hli], a - ; top row - ld a, MAP_NAME_SIGN_START + 2 - call .FillTopBottom - ; top right - ld a, MAP_NAME_SIGN_START + 4 - ld [hli], a - ; left, first line - ld a, MAP_NAME_SIGN_START + 5 - ld [hli], a - ; first line - call .FillMiddle - ; right, first line - ld a, MAP_NAME_SIGN_START + 11 - ld [hli], a - ; left, second line - ld a, MAP_NAME_SIGN_START + 6 - ld [hli], a - ; second line - call .FillMiddle - ; right, second line - ld a, MAP_NAME_SIGN_START + 12 - ld [hli], a - ; bottom left - ld a, MAP_NAME_SIGN_START + 7 - ld [hli], a - ; bottom - ld a, MAP_NAME_SIGN_START + 8 - call .FillTopBottom - ; bottom right - ld a, MAP_NAME_SIGN_START + 10 - ld [hl], a - ret - -.FillMiddle: - ld c, SCREEN_WIDTH - 2 - ld a, MAP_NAME_SIGN_START + 13 -.loop - ld [hli], a - dec c - jr nz, .loop - ret - -.FillTopBottom: - ld c, (SCREEN_WIDTH - 2) / 4 + 1 - jr .enterloop - -.continueloop - ld [hli], a - ld [hli], a - -.enterloop - inc a - ld [hli], a - ld [hli], a - dec a - dec c - jr nz, .continueloop - ret diff --git a/engine/overworld/events.asm b/engine/overworld/events.asm index 9e6369c60..9190011ac 100644 --- a/engine/overworld/events.asm +++ b/engine/overworld/events.asm @@ -208,7 +208,6 @@ HandleMapObjects: HandleMapBackground: farcall _UpdateSprites farcall ScrollScreen - farcall PlaceMapNameSign ret CheckPlayerState: @@ -272,16 +271,6 @@ PlayerEvents: ld [wScriptRunning], a call DoPlayerEvent - ld a, [wScriptRunning] - cp PLAYEREVENT_CONNECTION - jr z, .ok2 - cp PLAYEREVENT_JOYCHANGEFACING - jr z, .ok2 - - xor a - ld [wLandmarkSignTimer], a - -.ok2 scf ret diff --git a/engine/overworld/warp_connection.asm b/engine/overworld/warp_connection.asm index 492e84b49..1c8972548 100644 --- a/engine/overworld/warp_connection.asm +++ b/engine/overworld/warp_connection.asm @@ -297,7 +297,8 @@ LoadMapPalettes: RefreshMapSprites: call ClearSprites - farcall InitMapNameSign + xor a + ldh [hBGMapMode], a call GetMovementPermissions farcall RefreshPlayerSprite farcall CheckUpdatePlayerSprite diff --git a/gfx/font.asm b/gfx/font.asm index 54c876481..6af1f91e5 100644 --- a/gfx/font.asm +++ b/gfx/font.asm @@ -35,9 +35,6 @@ INCBIN "gfx/battle/expbar.2bpp" TownMapGFX: INCBIN "gfx/pokegear/town_map.2bpp.lz" -UnusedWeekdayKanjiGFX: ; unreferenced -INCBIN "gfx/font/unused_weekday_kanji.2bpp" - PokegearPhoneIconGFX: INCBIN "gfx/font/phone_icon.2bpp" @@ -51,12 +48,6 @@ INCBIN "gfx/font/space.2bpp" FontsExtra_SolidBlackGFX: INCBIN "gfx/font/black.1bpp" -UnusedUpArrowGFX: ; unreferenced -INCBIN "gfx/font/unused_up_arrow.1bpp" - -MapEntryFrameGFX: -INCBIN "gfx/frames/map_entry_sign.2bpp" - FontsExtra2_UpArrowGFX: INCBIN "gfx/font/up_arrow.2bpp" diff --git a/gfx/font/unused_up_arrow.png b/gfx/font/unused_up_arrow.png deleted file mode 100644 index cb62087aafe86b03de3152b57295b2c0e7d51b8d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 86 zcmeAS@N?(olHy`uVBq!ia0vp^5Z3 z^Gn0NdCV<)luAU`cuiMp&hTma#mLY*&9ujwyG2T`OD$Elc)`w1S3fU`OcDuSvru=V q{NwL));J=d#Wzp$P!Vkuiz@ diff --git a/gfx/frames/map_entry_sign.png b/gfx/frames/ow1.png similarity index 100% rename from gfx/frames/map_entry_sign.png rename to gfx/frames/ow1.png diff --git a/home/window.asm b/home/window.asm index 0a1a448f7..11a09b7ff 100644 --- a/home/window.asm +++ b/home/window.asm @@ -39,7 +39,8 @@ CloseText:: ld a, $90 ldh [hWY], a call UpdatePlayerSprite - farcall InitMapNameSign + xor a + ldh [hBGMapMode], a farcall LoadOverworldFont ret diff --git a/main.asm b/main.asm index 606855c41..145209fd7 100644 --- a/main.asm +++ b/main.asm @@ -287,7 +287,6 @@ INCLUDE "engine/events/trainer_scripts.asm" SECTION "bank2E", ROMX -INCLUDE "engine/events/map_name_sign.asm" INCLUDE "engine/events/checkforhiddenitems.asm" INCLUDE "engine/events/treemons.asm" INCLUDE "engine/events/fishing_gfx.asm" diff --git a/ram/wram.asm b/ram/wram.asm index e847d2123..f987c3038 100644 --- a/ram/wram.asm +++ b/ram/wram.asm @@ -135,7 +135,6 @@ wPrevDexEntry:: db wDisableTextAcceleration:: db wPrevLandmark:: db wCurLandmark:: db -wLandmarkSignTimer:: dw wLinkMode:: ; a LINK_* value for the link type