Skip to content

Commit

Permalink
nuzlocke: add MapToLocationIndex (no use yet)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanqui committed Nov 24, 2017
1 parent 87ccf81 commit 4be9a22
Show file tree
Hide file tree
Showing 5 changed files with 137 additions and 1 deletion.
1 change: 1 addition & 0 deletions constants.asm
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ INCLUDE "constants/credits_constants.asm"
INCLUDE "constants/music_constants.asm"
INCLUDE "constants/tilesets.asm"
INCLUDE "constants/starter_mons.asm"
INCLUDE "constants/map_location_constants.asm"
55 changes: 55 additions & 0 deletions constants/map_location_constants.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
PalletTown_LOCATION EQU $00
ViridianCity_LOCATION EQU $01
PewterCity_LOCATION EQU $02
CeruleanCity_LOCATION EQU $03
LavenderTown_LOCATION EQU $04
VermilionCity_LOCATION EQU $05
CeladonCity_LOCATION EQU $06
FuchsiaCity_LOCATION EQU $07
CinnabarIsland_LOCATION EQU $08
IndigoPlateau_LOCATION EQU $09
SaffronCity_LOCATION EQU $0a
Route1_LOCATION EQU $0b
Route2_LOCATION EQU $0c
Route3_LOCATION EQU $0d
Route4_LOCATION EQU $0e
Route5_LOCATION EQU $0f
Route6_LOCATION EQU $10
Route7_LOCATION EQU $11
Route8_LOCATION EQU $12
Route9_LOCATION EQU $13
Route10_LOCATION EQU $14
Route11_LOCATION EQU $15
Route12_LOCATION EQU $16
Route13_LOCATION EQU $17
Route14_LOCATION EQU $18
Route15_LOCATION EQU $19
Route16_LOCATION EQU $1a
Route17_LOCATION EQU $1b
Route18_LOCATION EQU $1c
Route19_LOCATION EQU $1d
Route20_LOCATION EQU $1e
Route21_LOCATION EQU $1f
Route22_LOCATION EQU $20
Route23_LOCATION EQU $21
Route24_LOCATION EQU $22
Route25_LOCATION EQU $23
ViridianForest_LOCATION EQU $24
MountMoon_LOCATION EQU $25
RockTunnel_LOCATION EQU $26
SeaCottage_LOCATION EQU $27
SSAnne_LOCATION EQU $28
PokemonLeague_LOCATION EQU $29
UndergroundPath_LOCATION EQU $2a
PokemonTower_LOCATION EQU $2b
SeafoamIslands_LOCATION EQU $2c
VictoryRoad_LOCATION EQU $2d
DiglettsCave_LOCATION EQU $2e
RocketHQ_LOCATION EQU $2f
SilphCo_LOCATION EQU $30
PokemonMansion_LOCATION EQU $31
SafariZone_LOCATION EQU $32
CeruleanCave_LOCATION EQU $33
PowerPlant_LOCATION EQU $34

NUM_LOCATIONS EQU $35
63 changes: 63 additions & 0 deletions data/town_map_entries.asm
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,66 @@ InternalMapEntries: ; 71382 (1c:5382)
IMAP $ED,$A,$5,SilphCoName
IMAP $F8,$0,$2,PokemonLeagueName
db $FF

MapToLocationIndexTable:
db $29,PalletTown_LOCATION
db $2E,ViridianCity_LOCATION
db $33,Route2_LOCATION
db $34,ViridianForest_LOCATION
db $3B,PewterCity_LOCATION
db $3E,MountMoon_LOCATION
db $44,CeruleanCity_LOCATION
db $45,Route4_LOCATION
db $46,CeruleanCity_LOCATION
db $49,Route5_LOCATION
db $4C,Route6_LOCATION
db $4F,Route7_LOCATION
db $51,Route8_LOCATION
db $53,RockTunnel_LOCATION
db $54,PowerPlant_LOCATION
db $57,Route11_LOCATION
db $58,Route12_LOCATION
db $59,SeaCottage_LOCATION
db $5F,VermilionCity_LOCATION
db $69,SSAnne_LOCATION
db $6D,VictoryRoad_LOCATION
db $77,PokemonLeague_LOCATION
db $78,UndergroundPath_LOCATION
db $79,PokemonLeague_LOCATION
db $7A,UndergroundPath_LOCATION
db $8D,CeladonCity_LOCATION
db $8E,LavenderTown_LOCATION
db $95,PokemonTower_LOCATION
db $98,LavenderTown_LOCATION
db $9C,FuchsiaCity_LOCATION
db $9D,SafariZone_LOCATION
db $9F,FuchsiaCity_LOCATION
db $A3,SeafoamIslands_LOCATION
db $A4,VermilionCity_LOCATION
db $A5,FuchsiaCity_LOCATION
db $A6,PokemonMansion_LOCATION
db $AE,CinnabarIsland_LOCATION
db $AF,IndigoPlateau_LOCATION
db $B8,SaffronCity_LOCATION
db $BA,Route15_LOCATION
db $BD,Route16_LOCATION
db $BE,Route12_LOCATION
db $C0,Route18_LOCATION
db $C1,SeafoamIslands_LOCATION
db $C2,Route22_LOCATION
db $C3,VictoryRoad_LOCATION
db $C4,Route12_LOCATION
db $C5,VermilionCity_LOCATION
db $C6,DiglettsCave_LOCATION
db $C7,VictoryRoad_LOCATION
db $CF,RocketHQ_LOCATION
db $D6,SilphCo_LOCATION
db $D9,PokemonMansion_LOCATION
db $E2,SafariZone_LOCATION
db $E5,CeruleanCave_LOCATION
db $E6,LavenderTown_LOCATION
db $E7,CeruleanCity_LOCATION
db $E9,RockTunnel_LOCATION
db $ED,SilphCo_LOCATION
db $F8,PokemonLeague_LOCATION
db $FF
15 changes: 15 additions & 0 deletions engine/town_map.asm
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,21 @@ Func_712f1: ; 712f1 (1c:52f1)
ld l, a
ret

MapToLocationIndex:
cp REDS_HOUSE_1F
ret c
ld hl, MapToLocationIndexTable
.loop
cp [hl]
jr c, .found
inc hl
inc hl
jr .loop
.found
inc hl
ld a, [hl]
ret

INCLUDE "data/town_map_entries.asm"

INCLUDE "text/map_names.asm"
Expand Down
4 changes: 3 additions & 1 deletion wram.asm
Original file line number Diff line number Diff line change
Expand Up @@ -1286,7 +1286,6 @@ wPokedexSeen:: ; d30a
flag_array NUM_POKEMON
wPokedexSeenEnd::


wNumBagItems:: ; d31d
ds 1
wBagItems:: ; d31e
Expand Down Expand Up @@ -2115,6 +2114,9 @@ SECTION "Empty", WRAMX, BANK[1]

wPokemonlessBlackout:: ds 1

wHadEncounterInLocation::
flag_array NUM_LOCATIONS

SECTION "Stack", WRAMX[$dfff], BANK[1]
wStack:: ; dfff
ds -$100
Expand Down

0 comments on commit 4be9a22

Please sign in to comment.