Nihon Map fixes

This fixes the Town Map for Nihon. Fly map and other bits and pieces may still require some tinkering. Needs further testing.
This commit is contained in:
Llinos Evans 2023-10-20 18:30:54 +01:00
parent 55f4427fc1
commit 82e264f425
4 changed files with 24 additions and 9 deletions

View file

@ -210,4 +210,4 @@ TohjoFallsName: db "TOHJO FALLS@"
UndergroundName: db "UNDERGROUND@" UndergroundName: db "UNDERGROUND@"
BattleTowerName: db "BATTLE¯TOWER@" BattleTowerName: db "BATTLE¯TOWER@"
SpecialMapName: db "SPECIAL@" SpecialMapName: db "SPECIAL@"
SilentHillsName: db "SILENT HILLS@" SilentHillsName: db "SILENT¯HILLS@"

View file

@ -540,12 +540,12 @@ Pokegear_UpdateClock:
PokegearMap_CheckRegion: PokegearMap_CheckRegion:
ld a, [wPokegearMapPlayerIconLandmark] ld a, [wPokegearMapPlayerIconLandmark]
cp NIHON_LANDMARK
jr z, .nihon
cp LANDMARK_FAST_SHIP cp LANDMARK_FAST_SHIP
jr z, .johto jr z, .johto
cp KANTO_LANDMARK cp KANTO_LANDMARK
jr nc, .kanto jr nc, .kanto
cp NIHON_LANDMARK
jr c, .nihon
.johto .johto
ld a, POKEGEARSTATE_JOHTOMAPINIT ld a, POKEGEARSTATE_JOHTOMAPINIT
jr .done jr .done
@ -2059,10 +2059,17 @@ PokegearMap:
ret ret
.kanto .kanto
cp NIHON_LANDMARK
jr c, .nihon
call LoadTownMapGFX call LoadTownMapGFX
call FillKantoMap call FillKantoMap
ret ret
.nihon
call LoadTownMapGFX
call FillNihonMap
ret
_FlyMap: _FlyMap:
call ClearBGPalettes call ClearBGPalettes
call ClearTilemap call ClearTilemap
@ -2305,10 +2312,10 @@ FlyMap:
call GetWorldMapLocation call GetWorldMapLocation
.CheckRegion: .CheckRegion:
; The first 46 locations are part of Johto. The rest are in Kanto. ; The first 46 locations are part of Johto. The rest are in Kanto.
cp KANTO_LANDMARK
jr nc, .KantoFlyMap
cp NIHON_LANDMARK cp NIHON_LANDMARK
jr nc, .NihonFlyMap jr nc, .NihonFlyMap
cp KANTO_LANDMARK
jr nc, .KantoFlyMap
; Johto fly map ; Johto fly map
; Note that .NoKanto should be modified in tandem with this branch ; Note that .NoKanto should be modified in tandem with this branch
push af push af
@ -2341,7 +2348,7 @@ FlyMap:
; Kanto's map is only loaded if we've visited Indigo Plateau ; Kanto's map is only loaded if we've visited Indigo Plateau
ld a, KANTO_FLYPOINT ; first Kanto flypoint ld a, KANTO_FLYPOINT ; first Kanto flypoint
ld [wStartFlypoint], a ld [wStartFlypoint], a
ld a, NUM_FLYPOINTS - 1 ; last Kanto flypoint ld a, NIHON_FLYPOINT - 1 ; last Kanto flypoint
ld [wEndFlypoint], a ld [wEndFlypoint], a
ld [wTownMapPlayerIconLandmark], a ; last one is default (Indigo Plateau) ld [wTownMapPlayerIconLandmark], a ; last one is default (Indigo Plateau)
; Fill out the map ; Fill out the map
@ -2366,9 +2373,9 @@ FlyMap:
and a and a
jr z, .NoKanto jr z, .NoKanto
; Kanto's map is only loaded if we've visited Indigo Plateau ; Kanto's map is only loaded if we've visited Indigo Plateau
ld a, NIHON_FLYPOINT ; first Kanto flypoint ld a, NIHON_FLYPOINT ; first Nihon flypoint
ld [wStartFlypoint], a ld [wStartFlypoint], a
ld a, NUM_FLYPOINTS - 1 ; last Kanto flypoint ld a, NUM_FLYPOINTS - 1 ; last Nihon flypoint
ld [wEndFlypoint], a ld [wEndFlypoint], a
ld [wTownMapPlayerIconLandmark], a ; last one is default (Indigo Plateau) ld [wTownMapPlayerIconLandmark], a ; last one is default (Indigo Plateau)
; Fill out the map ; Fill out the map
@ -2985,11 +2992,19 @@ EntireFlyMap: ; unreferenced
ld a, [wTownMapPlayerIconLandmark] ld a, [wTownMapPlayerIconLandmark]
cp KANTO_FLYPOINT cp KANTO_FLYPOINT
jr c, .InJohto jr c, .InJohto
cp NIHON_FLYPOINT
jr nc, .InNihon
call FillKantoMap call FillKantoMap
xor a xor a
ld b, HIGH(vBGMap1) ld b, HIGH(vBGMap1)
jr .Finally jr .Finally
.InNihon:
call FillNihonMap
ld a, SCREEN_HEIGHT_PX
ld b, HIGH(vBGMap0)
jr .Finally
.InJohto: .InJohto:
call FillJohtoMap call FillJohtoMap
ld a, SCREEN_HEIGHT_PX ld a, SCREEN_HEIGHT_PX

Binary file not shown.

View file

@ -15,7 +15,7 @@ SilentHills_MapEvents:
db 0, 0 ; filler db 0, 0 ; filler
def_warp_events def_warp_events
;warp_event 8, 13, GLOBAL_TERMINAL_1F, 1 warp_event 11, 5, PLAYERS_HOUSE_1F, 1
def_coord_events def_coord_events