diff --git a/Makefile b/Makefile index 6384a59..f89b849 100644 --- a/Makefile +++ b/Makefile @@ -91,7 +91,7 @@ ifeq ($(DEBUG),1) RGBASMFLAGS += -E endif -$(pokecrystal_obj): RGBASMFLAGS += +$(pokecrystal_obj): RGBASMFLAGS += -D _DEBUG $(pokecrystal_vc_obj): RGBASMFLAGS += -D _CRYSTAL_VC %.patch: vc/%.constants.sym %_vc.gbc %.gbc vc/%.patch.template diff --git a/constants/engine_flags.asm b/constants/engine_flags.asm index 862fd0d..002be2f 100644 --- a/constants/engine_flags.asm +++ b/constants/engine_flags.asm @@ -89,6 +89,7 @@ const ENGINE_FLYPOINT_LAKE_OF_RAGE const ENGINE_FLYPOINT_BLACKTHORN const ENGINE_FLYPOINT_SILVER_CAVE + const ENGINE_FLYPOINT_SILENT_HILLS const ENGINE_FLYPOINT_UNUSED ; wLuckyNumberShowFlag const ENGINE_LUCKY_NUMBER_SHOW diff --git a/constants/item_constants.asm b/constants/item_constants.asm index fd8407d..7839f0d 100644 --- a/constants/item_constants.asm +++ b/constants/item_constants.asm @@ -30,7 +30,7 @@ const FIRE_STONE ; 16 const THUNDERSTONE ; 17 const WATER_STONE ; 18 - const ITEM_19 ; 19 + const FAIRY_FEATHER; 19 const HP_UP ; 1a const PROTEIN ; 1b const IRON ; 1c diff --git a/constants/item_data_constants.asm b/constants/item_data_constants.asm index faf201d..302bab1 100644 --- a/constants/item_data_constants.asm +++ b/constants/item_data_constants.asm @@ -130,6 +130,7 @@ DEF MAIL_STRUCT_LENGTH_JP EQU $2a ; mailmsg_jp struct const HELD_DRAGON_BOOST const HELD_DARK_BOOST const HELD_STEEL_BOOST + const HELD_FAIRY_BOOST const_next 70 const HELD_CATCH_CHANCE diff --git a/constants/landmark_constants.asm b/constants/landmark_constants.asm index 058b70c..85f0213 100644 --- a/constants/landmark_constants.asm +++ b/constants/landmark_constants.asm @@ -98,6 +98,8 @@ DEF KANTO_LANDMARK EQU const_value const LANDMARK_TOHJO_FALLS ; 5d const LANDMARK_ROUTE_28 ; 5e const LANDMARK_FAST_SHIP ; 5f +DEF NIHON_LANDMARK EQU const_value + const LANDMARK_SILENT_HILLS DEF NUM_LANDMARKS EQU const_value ; used in CaughtData @@ -109,4 +111,5 @@ DEF NUM_LANDMARKS EQU const_value const_def const JOHTO_REGION ; 0 const KANTO_REGION ; 1 + const NIHON_REGION ; 2 DEF NUM_REGIONS EQU const_value diff --git a/constants/map_constants.asm b/constants/map_constants.asm index e24d04c..6e2114b 100644 --- a/constants/map_constants.asm +++ b/constants/map_constants.asm @@ -500,5 +500,9 @@ ENDM map_const MR_POKEMONS_HOUSE, 4, 4 ; 10 map_const ROUTE_31_VIOLET_GATE, 5, 4 ; 11 endgroup - -DEF NUM_MAP_GROUPS EQU const_value ; 26 + + newgroup SILENT_HILLS ; 27 + map_const SILENT_HILLS, 10, 10 ; 1 + endgroup + +DEF NUM_MAP_GROUPS EQU const_value ; 27 diff --git a/constants/map_data_constants.asm b/constants/map_data_constants.asm index 5d18ce3..5c8fd88 100644 --- a/constants/map_data_constants.asm +++ b/constants/map_data_constants.asm @@ -102,6 +102,8 @@ DEF NUM_FISHGROUPS EQU const_value - 1 const SPAWN_BLACKTHORN const SPAWN_MT_SILVER const SPAWN_FAST_SHIP +; nihon + const SPAWN_SILENT_HILLS DEF NUM_SPAWNS EQU const_value DEF SPAWN_N_A EQU -1 @@ -136,6 +138,8 @@ DEF KANTO_FLYPOINT EQU const_value const FLY_FUCHSIA const FLY_CINNABAR const FLY_INDIGO +DEF NIHON_FLYPOINT EQU const_value + const FLY_SILENT_HILLS DEF NUM_FLYPOINTS EQU const_value DEF MAX_OUTDOOR_SPRITES EQU 23 ; see engine/overworld/overworld.asm diff --git a/constants/scgb_constants.asm b/constants/scgb_constants.asm index 449be75..dde5f41 100644 --- a/constants/scgb_constants.asm +++ b/constants/scgb_constants.asm @@ -71,6 +71,7 @@ DEF SCGB_DEFAULT EQU $ff const PREDEFPAL_LAKE_OF_RAGE const PREDEFPAL_SILVER_CAVE const PREDEFPAL_DUNGEONS + const PREDEFPAL_SILENT_HILLS const PREDEFPAL_NITE const PREDEFPAL_BLACKOUT const PREDEFPAL_DIPLOMA ; RB_MEWMON diff --git a/constants/type_constants.asm b/constants/type_constants.asm index 49fa661..262997e 100644 --- a/constants/type_constants.asm +++ b/constants/type_constants.asm @@ -32,6 +32,7 @@ DEF SPECIAL EQU const_value const ICE const DRAGON const DARK + const FAIRY DEF TYPES_END EQU const_value DEF NUM_TYPES EQU TYPES_END + UNUSED_TYPES - UNUSED_TYPES_END - 1 ; discount BIRD diff --git a/data/events/engine_flags.asm b/data/events/engine_flags.asm index 851f1b0..c9fc0a6 100644 --- a/data/events/engine_flags.asm +++ b/data/events/engine_flags.asm @@ -99,6 +99,7 @@ EngineFlags: engine_flag wVisitedSpawns, SPAWN_LAKE_OF_RAGE engine_flag wVisitedSpawns, SPAWN_BLACKTHORN engine_flag wVisitedSpawns, SPAWN_MT_SILVER + engine_flag wVisitedSpawns, SPAWN_SILENT_HILLS engine_flag wVisitedSpawns, NUM_SPAWNS ; unused engine_flag wLuckyNumberShowFlag, LUCKYNUMBERSHOW_GAME_OVER_F diff --git a/data/items/attributes.asm b/data/items/attributes.asm index 08a5e9f..bbf7a2c 100644 --- a/data/items/attributes.asm +++ b/data/items/attributes.asm @@ -56,8 +56,8 @@ ItemAttributes: item_attribute 2100, HELD_NONE, 0, CANT_SELECT, ITEM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; WATER_STONE item_attribute 2100, HELD_NONE, 0, CANT_SELECT, ITEM, ITEMMENU_PARTY, ITEMMENU_NOUSE -; ITEM_19 - item_attribute $9999, HELD_NONE, 0, NO_LIMITS, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE +; FAIRY_FEATHER + item_attribute 1450, HELD_FAIRY_BOOST, 10, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ; HP_UP item_attribute 9800, HELD_NONE, 0, CANT_SELECT, ITEM, ITEMMENU_PARTY, ITEMMENU_NOUSE ; PROTEIN diff --git a/data/items/catch_rate_items.asm b/data/items/catch_rate_items.asm index 9c39afa..bdeeaf6 100644 --- a/data/items/catch_rate_items.asm +++ b/data/items/catch_rate_items.asm @@ -3,7 +3,7 @@ ; item associated with the table entry is used instead. TimeCapsule_CatchRateItems: - db ITEM_19, LEFTOVERS + db FAIRY_FEATHER, LEFTOVERS db ITEM_2D, BITTER_BERRY db ITEM_32, GOLD_BERRY db ITEM_5A, BERRY diff --git a/data/items/descriptions.asm b/data/items/descriptions.asm index 550d3b8..68a1898 100644 --- a/data/items/descriptions.asm +++ b/data/items/descriptions.asm @@ -25,7 +25,7 @@ ItemDescriptions: dw FireStoneDesc dw ThunderStoneDesc dw WaterStoneDesc - dw QuestionMarkDesc + dw FairyFeatherDesc dw HPUpDesc dw ProteinDesc dw IronDesc @@ -915,3 +915,7 @@ MusicMailDesc: MirageMailDesc: db "MEW-print MAIL." next "(HOLD)@" + +FairyFeatherDesc: + db "Powers up fairy-" + next "type moves. (HOLD)@" diff --git a/data/items/names.asm b/data/items/names.asm index b820b77..cf97390 100644 --- a/data/items/names.asm +++ b/data/items/names.asm @@ -24,7 +24,7 @@ ItemNames:: li "FIRE STONE" li "THUNDERSTONE" li "WATER STONE" - li "TERU-SAMA" + li "FAIRYFEATHER" li "HP UP" li "PROTEIN" li "IRON" diff --git a/data/maps/attributes.asm b/data/maps/attributes.asm index 07f4a7f..8877808 100644 --- a/data/maps/attributes.asm +++ b/data/maps/attributes.asm @@ -695,3 +695,4 @@ ENDM map_attributes Route30BerryHouse, ROUTE_30_BERRY_HOUSE, $00, 0 map_attributes MrPokemonsHouse, MR_POKEMONS_HOUSE, $00, 0 map_attributes Route31VioletGate, ROUTE_31_VIOLET_GATE, $00, 0 + map_attributes SilentHills, SILENT_HILLS, $00, 0 ; this is on its own for now. add connections to mt. silver later. diff --git a/data/maps/blocks.asm b/data/maps/blocks.asm index 7cdf608..64a5d9c 100644 --- a/data/maps/blocks.asm +++ b/data/maps/blocks.asm @@ -1045,3 +1045,6 @@ BetaBlank_Blocks: ; unreferenced GoldenrodDeptStoreRoof_Blocks: INCBIN "maps/GoldenrodDeptStoreRoof.ablk" + +SilentHills_Blocks: + INCBIN "maps/SilentHills.ablk" diff --git a/data/maps/flypoints.asm b/data/maps/flypoints.asm index faf3a4d..28ff60a 100644 --- a/data/maps/flypoints.asm +++ b/data/maps/flypoints.asm @@ -27,4 +27,6 @@ Flypoints: db LANDMARK_FUCHSIA_CITY, SPAWN_FUCHSIA db LANDMARK_CINNABAR_ISLAND, SPAWN_CINNABAR db LANDMARK_INDIGO_PLATEAU, SPAWN_INDIGO +; Nihon + db LANDMARK_SILENT_HILLS, SPAWN_SILENT_HILLS db -1 ; end diff --git a/data/maps/landmarks.asm b/data/maps/landmarks.asm index 173d11b..4d5a4f1 100644 --- a/data/maps/landmarks.asm +++ b/data/maps/landmarks.asm @@ -104,6 +104,8 @@ Landmarks: landmark 12, 100, TohjoFallsName landmark 20, 68, Route28Name landmark 140, 116, FastShipName + assert_table_length NIHON_LANDMARK + landmark 100, 116, SilentHillsName assert_table_length NUM_LANDMARKS NewBarkTownName: db "NEW BARK¯TOWN@" @@ -208,3 +210,4 @@ TohjoFallsName: db "TOHJO FALLS@" UndergroundName: db "UNDERGROUND@" BattleTowerName: db "BATTLE¯TOWER@" SpecialMapName: db "SPECIAL@" +SilentHillsName: db "SILENT¯HILLS@" diff --git a/data/maps/maps.asm b/data/maps/maps.asm index 5282212..c0268f1 100644 --- a/data/maps/maps.asm +++ b/data/maps/maps.asm @@ -43,6 +43,7 @@ MapGroupPointers:: dw MapGroup_NewBark ; 24 dw MapGroup_Saffron ; 25 dw MapGroup_Cherrygrove ; 26 + dw MapGroup_SilentHills ; 27 assert_table_length NUM_MAP_GROUPS MapGroup_Olivine: @@ -536,3 +537,8 @@ MapGroup_Cherrygrove: map MrPokemonsHouse, TILESET_FACILITY, INDOOR, LANDMARK_ROUTE_30, MUSIC_CHERRYGROVE_CITY, FALSE, PALETTE_DAY, FISHGROUP_SHORE map Route31VioletGate, TILESET_GATE, GATE, LANDMARK_ROUTE_31, MUSIC_ROUTE_30, FALSE, PALETTE_DAY, FISHGROUP_SHORE assert_table_length NUM_CHERRYGROVE_MAPS + +MapGroup_SilentHills: + table_width MAP_LENGTH, MapGroup_SilentHills + map SilentHills, TILESET_JOHTO, TOWN, LANDMARK_SILENT_HILLS, MUSIC_NEW_BARK_TOWN, TRUE, PALETTE_AUTO, FISHGROUP_SHORE + assert_table_length NUM_SILENT_HILLS_MAPS diff --git a/data/maps/outdoor_sprites.asm b/data/maps/outdoor_sprites.asm index 9f4860d..feab3ce 100644 --- a/data/maps/outdoor_sprites.asm +++ b/data/maps/outdoor_sprites.asm @@ -30,6 +30,7 @@ OutdoorSprites: dw NewBarkGroupSprites dw SaffronGroupSprites dw CherrygroveGroupSprites + dw SilentHillsGroupSprites assert_table_length NUM_MAP_GROUPS PalletGroupSprites: @@ -307,6 +308,7 @@ IndigoGroupSprites: db SPRITE_POKE_BALL db SPRITE_BOULDER +SilentHillsGroupSprites: ; Will have its own thing eventually NewBarkGroupSprites: db SPRITE_SUICUNE db SPRITE_SILVER_TROPHY diff --git a/data/maps/roofs.asm b/data/maps/roofs.asm index bcc49f1..1e2b09d 100644 --- a/data/maps/roofs.asm +++ b/data/maps/roofs.asm @@ -38,6 +38,7 @@ MapGroupRoofs: db ROOF_NEW_BARK ; 24 (New Bark) db -1 ; 25 db ROOF_NEW_BARK ; 26 (Cherrygrove) + db ROOF_NEW_BARK ; 27 (Silent Hills) assert_table_length NUM_MAP_GROUPS + 1 Roofs: diff --git a/data/maps/scripts.asm b/data/maps/scripts.asm index 19b06a1..1f0670e 100644 --- a/data/maps/scripts.asm +++ b/data/maps/scripts.asm @@ -484,3 +484,4 @@ SECTION "Map Scripts 25", ROMX INCLUDE "maps/SilverCaveOutside.asm" INCLUDE "maps/Route10North.asm" +INCLUDE "maps/SilentHills.asm" diff --git a/data/maps/sgb_roof_pal_inds.asm b/data/maps/sgb_roof_pal_inds.asm index 617b004..788abfe 100644 --- a/data/maps/sgb_roof_pal_inds.asm +++ b/data/maps/sgb_roof_pal_inds.asm @@ -30,4 +30,5 @@ MapGroupRoofSGBPalInds: db PREDEFPAL_NEW_BARK db PREDEFPAL_SAFFRON db PREDEFPAL_CHERRYGROVE + db PREDEFPAL_SILENT_HILLS assert_table_length NUM_MAP_GROUPS + 1 diff --git a/data/maps/spawn_points.asm b/data/maps/spawn_points.asm index 61938cd..c5a142c 100644 --- a/data/maps/spawn_points.asm +++ b/data/maps/spawn_points.asm @@ -38,7 +38,9 @@ SpawnPoints: spawn BLACKTHORN_CITY, 21, 30 spawn SILVER_CAVE_OUTSIDE, 23, 20 spawn FAST_SHIP_CABINS_SW_SSW_NW, 6, 2 - + + spawn SILENT_HILLS, 10, 10 + spawn N_A, -1, -1 assert_table_length NUM_SPAWNS + 1 diff --git a/data/types/names.asm b/data/types/names.asm index 94fe67e..b7f0e90 100644 --- a/data/types/names.asm +++ b/data/types/names.asm @@ -31,6 +31,7 @@ TypeNames: dw Ice dw Dragon dw Dark + dw Fairy assert_table_length TYPES_END Normal: db "NORMAL@" @@ -52,3 +53,4 @@ Ghost: db "GHOST@" Steel: db "STEEL@" Dragon: db "DRAGON@" Dark: db "DARK@" +Fairy: db "FAIRY@" diff --git a/data/types/search_strings.asm b/data/types/search_strings.asm index 1345c27..39e021b 100644 --- a/data/types/search_strings.asm +++ b/data/types/search_strings.asm @@ -19,4 +19,5 @@ PokedexTypeSearchStrings: db " DRAGON @" db " DARK @" db " STEEL @" + db " FAIRY @" assert_table_length NUM_TYPES + 1 diff --git a/data/types/search_types.asm b/data/types/search_types.asm index dd9ea56..6f0a454 100644 --- a/data/types/search_types.asm +++ b/data/types/search_types.asm @@ -18,4 +18,5 @@ PokedexTypeSearchConversionTable: db DRAGON db DARK db STEEL + db FAIRY assert_table_length NUM_TYPES diff --git a/data/types/type_boost_items.asm b/data/types/type_boost_items.asm index 85a58db..507b184 100644 --- a/data/types/type_boost_items.asm +++ b/data/types/type_boost_items.asm @@ -16,4 +16,5 @@ TypeBoostItems: db HELD_DRAGON_BOOST, DRAGON ; DRAGON_SCALE db HELD_DARK_BOOST, DARK ; BLACKGLASSES db HELD_STEEL_BOOST, STEEL ; METAL_COAT + db HELD_FAIRY_BOOST, FAIRY ; FAIRY_FEATHER db -1 diff --git a/data/types/type_matchups.asm b/data/types/type_matchups.asm index 81906b0..afc280a 100644 --- a/data/types/type_matchups.asm +++ b/data/types/type_matchups.asm @@ -49,12 +49,14 @@ TypeMatchups: db FIGHTING, ROCK, SUPER_EFFECTIVE db FIGHTING, DARK, SUPER_EFFECTIVE db FIGHTING, STEEL, SUPER_EFFECTIVE + db FIGHTING, FAIRY, NOT_VERY_EFFECTIVE db POISON, GRASS, SUPER_EFFECTIVE db POISON, POISON, NOT_VERY_EFFECTIVE db POISON, GROUND, NOT_VERY_EFFECTIVE db POISON, ROCK, NOT_VERY_EFFECTIVE db POISON, GHOST, NOT_VERY_EFFECTIVE db POISON, STEEL, NO_EFFECT + db POISON, FAIRY, SUPER_EFFECTIVE db GROUND, FIRE, SUPER_EFFECTIVE db GROUND, ELECTRIC, SUPER_EFFECTIVE db GROUND, GRASS, NOT_VERY_EFFECTIVE @@ -83,6 +85,7 @@ TypeMatchups: db BUG, GHOST, NOT_VERY_EFFECTIVE db BUG, DARK, SUPER_EFFECTIVE db BUG, STEEL, NOT_VERY_EFFECTIVE + db BUG, FAIRY, NOT_VERY_EFFECTIVE db ROCK, FIRE, SUPER_EFFECTIVE db ROCK, ICE, SUPER_EFFECTIVE db ROCK, FIGHTING, NOT_VERY_EFFECTIVE @@ -97,17 +100,26 @@ TypeMatchups: db GHOST, GHOST, SUPER_EFFECTIVE db DRAGON, DRAGON, SUPER_EFFECTIVE db DRAGON, STEEL, NOT_VERY_EFFECTIVE + db DRAGON, FAIRY, NO_EFFECT db DARK, FIGHTING, NOT_VERY_EFFECTIVE db DARK, PSYCHIC_TYPE, SUPER_EFFECTIVE db DARK, GHOST, SUPER_EFFECTIVE db DARK, DARK, NOT_VERY_EFFECTIVE db DARK, STEEL, NOT_VERY_EFFECTIVE + db DARK, FAIRY, NOT_VERY_EFFECTIVE db STEEL, FIRE, NOT_VERY_EFFECTIVE db STEEL, WATER, NOT_VERY_EFFECTIVE db STEEL, ELECTRIC, NOT_VERY_EFFECTIVE db STEEL, ICE, SUPER_EFFECTIVE db STEEL, ROCK, SUPER_EFFECTIVE db STEEL, STEEL, NOT_VERY_EFFECTIVE + db STEEL, FAIRY, SUPER_EFFECTIVE + db FAIRY, FIRE, NOT_VERY_EFFECTIVE + db FAIRY, FIGHTING, SUPER_EFFECTIVE + db FAIRY, POISON, NOT_VERY_EFFECTIVE + db FAIRY, DRAGON, SUPER_EFFECTIVE + db FAIRY, DARK, SUPER_EFFECTIVE + db FAIRY, STEEL, NOT_VERY_EFFECTIVE db -2 ; end (with Foresight) diff --git a/engine/debug/debug_room.asm b/engine/debug/debug_room.asm index 245f31d..9ce8c61 100644 --- a/engine/debug/debug_room.asm +++ b/engine/debug/debug_room.asm @@ -30,10 +30,11 @@ DEF DEBUGROOMMENU_NUM_PAGES EQU const_value const DEBUGROOMMENUITEM_BT_BUG_POKE ; 14 _DebugRoom: - ldh a, [hJoyDown] - and SELECT | START - cp SELECT | START - ret nz + ; This makes it less fussy to access - PvK + ;ldh a, [hJoyDown] + ;and SELECT | START + ;cp SELECT | START + ;ret nz ldh a, [hDebugRoomMenuPage] push af xor a diff --git a/engine/items/item_effects.asm b/engine/items/item_effects.asm index 3d4be93..8c0f0a4 100644 --- a/engine/items/item_effects.asm +++ b/engine/items/item_effects.asm @@ -38,7 +38,7 @@ ItemEffects: dw EvoStoneEffect ; FIRE_STONE dw EvoStoneEffect ; THUNDERSTONE dw EvoStoneEffect ; WATER_STONE - dw NoEffect ; ITEM_19 + dw NoEffect ; FAIRY_FEATHER dw VitaminEffect ; HP_UP dw VitaminEffect ; PROTEIN dw VitaminEffect ; IRON @@ -193,22 +193,27 @@ ItemEffects: dw PokeBallEffect ; PARK_BALL dw NoEffect ; RAINBOW_WING dw NoEffect ; ITEM_B3 - assert_table_length ITEM_B3 + dw NoEffect ; BRICK_PIECE + dw NoEffect ; SURF_MAIL + dw NoEffect ; LITEBLUEMAIL + dw NoEffect ; PORTRAITMAIL + dw NoEffect ; LOVELY_MAIL + dw NoEffect ; EON_MAIL + dw NoEffect ; MORPH_MAIL + dw NoEffect ; BLUESKY_MAIL + dw NoEffect ; MUSIC_MAIL + dw NoEffect ; MIRAGE_MAIL + dw NoEffect ; ITEM_BE + dw NoEffect ; ITEM_DC + dw NoEffect ; ITEM_C3 + dw NoEffect ; ITEM_FA + assert_table_length NUM_ITEMS ; The items past ITEM_B3 do not have effect entries: -; BRICK_PIECE -; SURF_MAIL -; LITEBLUEMAIL -; PORTRAITMAIL -; LOVELY_MAIL -; EON_MAIL -; MORPH_MAIL -; BLUESKY_MAIL -; MUSIC_MAIL -; MIRAGE_MAIL -; ITEM_BE ; They all have the ITEMMENU_NOUSE attribute so they can't be used anyway. ; NoEffect would be appropriate, with the table then being NUM_ITEMS long. +; This has been amended for architectural purposes, and because we have a shitload of SW97 items to add. + PokeBallEffect: ; BUG: The Dude's catching tutorial may crash if his Poké Ball can't be used (see docs/bugs_and_glitches.md) ld a, [wBattleMode] diff --git a/engine/overworld/landmarks.asm b/engine/overworld/landmarks.asm index bee64c7..1b9ccfd 100644 --- a/engine/overworld/landmarks.asm +++ b/engine/overworld/landmarks.asm @@ -67,6 +67,8 @@ RegionCheck: call GetWorldMapLocation .checkagain + cp NIHON_LANDMARK + jr z, .nihon cp KANTO_LANDMARK jr c, .johto @@ -80,3 +82,6 @@ RegionCheck: .kanto ld e, KANTO_REGION ret +.nihon + ld e, NIHON_REGION + ret \ No newline at end of file diff --git a/engine/pokegear/pokegear.asm b/engine/pokegear/pokegear.asm index eaf93a4..22dec4b 100644 --- a/engine/pokegear/pokegear.asm +++ b/engine/pokegear/pokegear.asm @@ -17,6 +17,8 @@ DEF PHONE_DISPLAY_HEIGHT EQU 4 const POKEGEARSTATE_JOHTOMAPJOYPAD ; 4 const POKEGEARSTATE_KANTOMAPINIT ; 5 const POKEGEARSTATE_KANTOMAPJOYPAD ; 6 + const POKEGEARSTATE_NIHONMAPINIT ; 5 + const POKEGEARSTATE_NIHONMAPJOYPAD ; 6 const POKEGEARSTATE_PHONEINIT ; 7 const POKEGEARSTATE_PHONEJOYPAD ; 8 const POKEGEARSTATE_MAKEPHONECALL ; 9 @@ -324,6 +326,8 @@ InitPokegearTilemap: .Map: ld a, [wPokegearMapPlayerIconLandmark] + cp NIHON_LANDMARK + jr z, .nihon cp LANDMARK_FAST_SHIP jr z, .johto cp KANTO_LANDMARK @@ -334,6 +338,10 @@ InitPokegearTilemap: .kanto ld e, 1 + jr .ok + +.nihon + ld e, 2 .ok farcall PokegearMap ld a, $07 @@ -443,6 +451,8 @@ PokegearJumptable: dw PokegearMap_JohtoMap dw PokegearMap_Init dw PokegearMap_KantoMap + dw PokegearMap_Init + dw PokegearMap_NihonMap dw PokegearPhone_Init dw PokegearPhone_Joypad dw PokegearPhone_MakePhoneCall @@ -534,6 +544,8 @@ PokegearMap_CheckRegion: jr z, .johto cp KANTO_LANDMARK jr nc, .kanto + cp NIHON_LANDMARK + jr c, .nihon .johto ld a, POKEGEARSTATE_JOHTOMAPINIT jr .done @@ -541,6 +553,11 @@ PokegearMap_CheckRegion: .kanto ld a, POKEGEARSTATE_KANTOMAPINIT + jr .done + ret + +.nihon + ld a, POKEGEARSTATE_NIHONMAPINIT .done ld [wJumptableIndex], a call ExitPokegearRadio_HandleMusic @@ -564,6 +581,10 @@ PokegearMap_KantoMap: call TownMap_GetKantoLandmarkLimits jr PokegearMap_ContinueMap +PokegearMap_NihonMap: + call TownMap_GetNihonLandmarkLimits + jr PokegearMap_ContinueMap + PokegearMap_JohtoMap: ld d, LANDMARK_SILVER_CAVE ld e, LANDMARK_NEW_BARK_TOWN @@ -740,6 +761,12 @@ TownMap_GetKantoLandmarkLimits: ld e, LANDMARK_VICTORY_ROAD ret +TownMap_GetNihonLandmarkLimits: + ld a, [wStatusFlags] + ld d, LANDMARK_SILENT_HILLS + ld e, LANDMARK_SILENT_HILLS ; Gonna need another map. + ret + PokegearRadio_Init: call InitPokegearTilemap depixel 4, 10, 4, 4 @@ -1547,7 +1574,7 @@ RadioChannels: jr z, .johto cp KANTO_LANDMARK jr c, .johto -; kanto +; kanto or nihon and a ret @@ -1809,6 +1836,8 @@ _TownMap: .dmg ld a, [wTownMapPlayerIconLandmark] + cp NIHON_LANDMARK + jr nc, .nihon cp KANTO_LANDMARK jr nc, .kanto ld d, KANTO_LANDMARK - 1 @@ -1820,6 +1849,10 @@ _TownMap: call TownMap_GetKantoLandmarkLimits call .loop +.nihon + call TownMap_GetNihonLandmarkLimits + call .loop + .resume pop af ld [wVramState], a @@ -1892,6 +1925,8 @@ _TownMap: .InitTilemap: ld a, [wTownMapPlayerIconLandmark] + cp NIHON_LANDMARK + jr nc, .nihon2 cp KANTO_LANDMARK jr nc, .kanto2 ld e, JOHTO_REGION @@ -1899,6 +1934,9 @@ _TownMap: .kanto2 ld e, KANTO_REGION + jr .okay_tilemap +.nihon2 + ld e, NIHON_REGION .okay_tilemap farcall PokegearMap ld a, $07 @@ -2021,10 +2059,17 @@ PokegearMap: ret .kanto + cp NIHON_LANDMARK + jr c, .nihon call LoadTownMapGFX call FillKantoMap ret +.nihon + call LoadTownMapGFX + call FillNihonMap + ret + _FlyMap: call ClearBGPalettes call ClearTilemap @@ -2267,6 +2312,8 @@ FlyMap: call GetWorldMapLocation .CheckRegion: ; The first 46 locations are part of Johto. The rest are in Kanto. + cp NIHON_LANDMARK + jr nc, .NihonFlyMap cp KANTO_LANDMARK jr nc, .KantoFlyMap ; Johto fly map @@ -2301,7 +2348,7 @@ FlyMap: ; Kanto's map is only loaded if we've visited Indigo Plateau ld a, KANTO_FLYPOINT ; first Kanto flypoint ld [wStartFlypoint], a - ld a, NUM_FLYPOINTS - 1 ; last Kanto flypoint + ld a, NIHON_FLYPOINT - 1 ; last Kanto flypoint ld [wEndFlypoint], a ld [wTownMapPlayerIconLandmark], a ; last one is default (Indigo Plateau) ; Fill out the map @@ -2311,6 +2358,33 @@ FlyMap: call TownMapPlayerIcon ret +.NihonFlyMap: +; The event that there are no flypoints enabled in a map is not +; accounted for. As a result, if you attempt to select a flypoint +; when there are none enabled, the game will crash. Additionally, +; the flypoint selection has a default starting point that +; can be flown to even if none are enabled. +; To prevent both of these things from happening when the player +; enters Kanto, fly access is restricted until Indigo Plateau is +; visited and its flypoint enabled. + push af + ld c, SPAWN_SILENT_HILLS + call HasVisitedSpawn + and a + jr z, .NoKanto +; Kanto's map is only loaded if we've visited Indigo Plateau + ld a, NIHON_FLYPOINT ; first Nihon flypoint + ld [wStartFlypoint], a + ld a, NUM_FLYPOINTS - 1 ; last Nihon flypoint + ld [wEndFlypoint], a + ld [wTownMapPlayerIconLandmark], a ; last one is default (Indigo Plateau) +; Fill out the map + call FillNihonMap + call .MapHud + pop af + call TownMapPlayerIcon + ret + .NoKanto: ; If Indigo Plateau hasn't been visited, we use Johto's map instead ld a, JOHTO_FLYPOINT ; first Johto flypoint @@ -2644,6 +2718,10 @@ FillJohtoMap: FillKantoMap: ld de, KantoMap + jr FillTownMap + +FillNihonMap: + ld de, NihonMap FillTownMap: hlcoord 0, 0 .loop @@ -2794,6 +2872,9 @@ INCBIN "gfx/pokegear/johto.bin" KantoMap: INCBIN "gfx/pokegear/kanto.bin" +NihonMap: +INCBIN "gfx/pokegear/nihon.bin" + PokedexNestIconGFX: INCBIN "gfx/pokegear/dexmap_nest_icon.2bpp" FlyMapLabelBorderGFX: @@ -2911,11 +2992,19 @@ EntireFlyMap: ; unreferenced ld a, [wTownMapPlayerIconLandmark] cp KANTO_FLYPOINT jr c, .InJohto + cp NIHON_FLYPOINT + jr nc, .InNihon call FillKantoMap xor a ld b, HIGH(vBGMap1) jr .Finally +.InNihon: + call FillNihonMap + ld a, SCREEN_HEIGHT_PX + ld b, HIGH(vBGMap0) + jr .Finally + .InJohto: call FillJohtoMap ld a, SCREEN_HEIGHT_PX diff --git a/gfx/pokegear/nihon.bin b/gfx/pokegear/nihon.bin new file mode 100644 index 0000000..65954ed Binary files /dev/null and b/gfx/pokegear/nihon.bin differ diff --git a/gfx/sgb/predef.pal b/gfx/sgb/predef.pal index 745767d..9299476 100644 --- a/gfx/sgb/predef.pal +++ b/gfx/sgb/predef.pal @@ -23,6 +23,7 @@ RGB 31,31,31, 31,20,20, 15,20,31, 00,00,00 ; PREDEFPAL_LAKE_OF_RAGE RGB 31,31,31, 26,26,26, 15,20,31, 00,00,00 ; PREDEFPAL_SILVER_CAVE RGB 31,31,31, 21,14,09, 15,20,20, 00,00,00 ; PREDEFPAL_DUNGEONS + RGB 31,31,31, 12,28,22, 15,20,20, 00,00,00 ; PREDEFPAL_SILENT_HILLS RGB 31,31,31, 12,28,22, 15,20,20, 00,00,00 ; PREDEFPAL_NITE RGB 31,31,31, 07,07,07, 02,03,03, 00,00,00 ; PREDEFPAL_BLACKOUT RGB 31,31,31, 30,22,17, 16,14,19, 00,00,00 ; PREDEFPAL_DIPLOMA diff --git a/gfx/tilesets/roofs.pal b/gfx/tilesets/roofs.pal index 652b152..fd000bc 100644 --- a/gfx/tilesets/roofs.pal +++ b/gfx/tilesets/roofs.pal @@ -105,3 +105,7 @@ ; group 26 (Cherrygrove) RGB 31,14,28, 31,05,21 ; morn/day RGB 14,07,17, 13,00,08 ; nite + +; group 27 (Silent Hills) + RGB 20,31,14, 11,23,05 ; morn/day + RGB 09,13,08, 06,09,04 ; nite diff --git a/home/region.asm b/home/region.asm index 7e0fc5f..b855bed 100644 --- a/home/region.asm +++ b/home/region.asm @@ -20,6 +20,8 @@ IsInJohto:: call GetWorldMapLocation .CheckRegion: + cp NIHON_LANDMARK + jr z, .Nihon cp KANTO_LANDMARK jr nc, .Kanto @@ -30,3 +32,7 @@ IsInJohto:: .Kanto: ld a, KANTO_REGION ret + +.Nihon: + ld a, NIHON_REGION + ret diff --git a/maps/SilentHills.ablk b/maps/SilentHills.ablk new file mode 100644 index 0000000..3a57236 --- /dev/null +++ b/maps/SilentHills.ablk @@ -0,0 +1,2 @@ +IJHFABFIJaJE +xxIIIIIJTvvvvU \ No newline at end of file diff --git a/maps/SilentHills.asm b/maps/SilentHills.asm new file mode 100644 index 0000000..c7b8778 --- /dev/null +++ b/maps/SilentHills.asm @@ -0,0 +1,25 @@ + object_const_def + ;const GLOBALTERMINALOUTSIDE_ROCKET + +SilentHills_MapScripts: + def_scene_scripts + + def_callbacks + callback MAPCALLBACK_NEWMAP, SilentHillsFlypointCallback + +SilentHillsFlypointCallback: + setflag ENGINE_FLYPOINT_SILENT_HILLS + endcallback + +SilentHills_MapEvents: + db 0, 0 ; filler + + def_warp_events + warp_event 11, 5, PLAYERS_HOUSE_1F, 1 + + def_coord_events + + def_bg_events + + def_object_events + ;object_event 24, 16, SPRITE_ROCKET, SPRITEMOVEDATA_STANDING_UP, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, GoldenrodCityRocketScoutScript, EVENT_GOLDENROD_CITY_ROCKET_SCOUT