From 55a38ff2de666c9f39ef54c431ab61911247e3dc Mon Sep 17 00:00:00 2001 From: xCrystal Date: Fri, 4 Aug 2023 18:45:50 +0200 Subject: [PATCH] Make map environments more granular and make all map palettes except darkness depend on map environment (#7) --- constants/map_data_constants.asm | 16 +-- data/maps/environment_colors.asm | 84 +++++++++----- data/maps/maps.asm | 4 +- engine/battle/battle_transition.asm | 8 +- engine/events/field_moves.asm | 1 - engine/events/magnet_train.asm | 2 +- engine/events/overworld.asm | 13 +-- engine/events/sweet_scent.asm | 2 +- engine/gfx/color.asm | 36 +++++- engine/gfx/crystal_layouts.asm | 13 --- engine/overworld/events.asm | 10 +- engine/overworld/init_map.asm | 1 - engine/overworld/map_setup.asm | 6 +- engine/overworld/wildmons.asm | 2 + engine/phone/phone.asm | 6 +- engine/tilesets/tileset_palettes.asm | 160 --------------------------- gfx/font/bg_text.pal | 4 - gfx/tilesets/battle_tower_inside.pal | 40 ------- gfx/tilesets/bg_tiles.pal | 39 +++++-- gfx/tilesets/bg_tiles_darkness.pal | 2 +- gfx/tilesets/house.pal | 40 ------- gfx/tilesets/ice_path.pal | 40 ------- gfx/tilesets/mansion_1.pal | 44 -------- gfx/tilesets/mansion_2.pal | 4 - gfx/tilesets/pokecom_center.pal | 40 ------- gfx/tilesets/radio_tower.pal | 39 ------- home/flag.asm | 6 +- home/map.asm | 26 ++--- 28 files changed, 157 insertions(+), 531 deletions(-) delete mode 100644 engine/tilesets/tileset_palettes.asm delete mode 100644 gfx/font/bg_text.pal delete mode 100644 gfx/tilesets/battle_tower_inside.pal delete mode 100644 gfx/tilesets/house.pal delete mode 100644 gfx/tilesets/ice_path.pal delete mode 100644 gfx/tilesets/mansion_1.pal delete mode 100644 gfx/tilesets/mansion_2.pal delete mode 100644 gfx/tilesets/pokecom_center.pal delete mode 100644 gfx/tilesets/radio_tower.pal diff --git a/constants/map_data_constants.asm b/constants/map_data_constants.asm index 5faa12864..8cf84325d 100644 --- a/constants/map_data_constants.asm +++ b/constants/map_data_constants.asm @@ -20,13 +20,15 @@ DEF MAP_LENGTH EQU _RS ; map environments (wEnvironment) ; EnvironmentColorsPointers indexes (see data/maps/environment_colors.asm) const_def 1 - const TOWN - const ROUTE - const INDOOR - const CAVE - const ENVIRONMENT_5 - const GATE - const DUNGEON + const OUTDOOR_GRASSY + const OUTDOOR_MOUNTAIN + const OUTDOOR_COAST + const OUTDOOR_SEA +DEF INDOOR_ENVIRONMENT EQU const_value + const INDOOR_FOREST + const INDOOR_CAVE + const INDOOR_ICE_CAVE + const INDOOR_BUILDING DEF NUM_ENVIRONMENTS EQU const_value - 1 ; map palettes (wEnvironment) diff --git a/data/maps/environment_colors.asm b/data/maps/environment_colors.asm index e11f3bd8c..9003d9c44 100644 --- a/data/maps/environment_colors.asm +++ b/data/maps/environment_colors.asm @@ -1,37 +1,63 @@ EnvironmentColorsPointers: ; entries correspond to environment constants (see constants/map_data_constants.asm) table_width 2, EnvironmentColorsPointers - dw .OutdoorColors ; unused - dw .OutdoorColors ; TOWN - dw .OutdoorColors ; ROUTE - dw .IndoorColors ; INDOOR - dw .DungeonColors ; CAVE - dw .Env5Colors ; ENVIRONMENT_5 - dw .IndoorColors ; GATE - dw .DungeonColors ; DUNGEON + dw .GrassyColors ; unused + dw .GrassyColors ; OUTDOOR_GRASSY + dw .MountainColors ; OUTDOOR_MOUNTAIN + dw .CoastColors ; OUTDOOR_COAST + dw .SeaColors ; OUTDOOR_SEA + dw .ForestColors ; INDOOR_FOREST + dw .CaveColors ; INDOOR_CAVE + dw .IceCaveColors ; INDOOR_ICE_CAVE + dw .BuildingColors ; INDOOR_BUILDING assert_table_length NUM_ENVIRONMENTS + 1 -; Valid indices: $00 - $2b (see gfx/tilesets/bg_tiles.pal) -.OutdoorColors: - db $00, $01, $02, $28, $04, $05, $06, $07 ; morn - db $08, $09, $0a, $29, $0c, $0d, $0e, $0f ; day - db $10, $11, $12, $2a, $14, $15, $16, $17 ; nite - db $18, $19, $1a, $2b, $1c, $1d, $1e, $1f ; eve +; Valid indices: $00 - $35 (see gfx/tilesets/bg_tiles.pal) +; assumes that maps with an environment of INDOOR_CAVE and INDOOR_ICE_CAVE always have PALETTE_NITE +.GrassyColors: + db $00, $01, $02, $28, $04, $05, $06, $2e ; morn + db $08, $09, $0a, $29, $0c, $0d, $0e, $2e ; day + db $10, $11, $12, $2a, $14, $15, $16, $2e ; nite + db $18, $19, $1a, $2b, $1c, $1d, $1e, $2e ; eve -.IndoorColors: - db $20, $21, $22, $23, $24, $25, $26, $07 ; morn - db $20, $21, $22, $23, $24, $25, $26, $07 ; day - db $10, $11, $12, $13, $14, $15, $16, $07 ; nite - db $18, $19, $1a, $1b, $1c, $1d, $1e, $07 ; eve +.MountainColors: + db $00, $01, $02, $28, $04, $05, $06, $2f ; morn + db $08, $09, $0a, $29, $0c, $0d, $0e, $2f ; day + db $10, $11, $12, $2a, $14, $15, $16, $2f ; nite + db $18, $19, $1a, $2b, $1c, $1d, $1e, $2f ; eve -.DungeonColors: - db $00, $01, $02, $03, $04, $05, $06, $07 ; morn - db $08, $09, $0a, $0b, $0c, $0d, $0e, $0f ; day - db $10, $11, $12, $13, $14, $15, $16, $17 ; nite - db $18, $19, $1a, $1b, $1c, $1d, $1e, $1f ; eve +.CoastColors: + db $00, $01, $02, $28, $04, $05, $06, $30 ; morn + db $08, $09, $0a, $29, $0c, $0d, $0e, $30 ; day + db $10, $11, $12, $2a, $14, $15, $16, $30 ; nite + db $18, $19, $1a, $2b, $1c, $1d, $1e, $30 ; eve -.Env5Colors: - db $00, $01, $02, $03, $04, $05, $06, $07 ; morn - db $08, $09, $0a, $0b, $0c, $0d, $0e, $0f ; day - db $10, $11, $12, $13, $14, $15, $16, $17 ; nite - db $18, $19, $1a, $1b, $1c, $1d, $1e, $1f ; eve +.SeaColors: + db $00, $01, $02, $28, $04, $05, $06, $31 ; morn + db $08, $09, $0a, $29, $0c, $0d, $0e, $31 ; day + db $10, $11, $12, $2a, $14, $15, $16, $31 ; nite + db $18, $19, $1a, $2b, $1c, $1d, $1e, $31 ; eve + +.ForestColors: + db $00, $01, $02, $03, $04, $05, $06, $32 ; morn + db $08, $09, $0a, $0b, $0c, $0d, $0e, $32 ; day + db $10, $11, $12, $13, $14, $15, $16, $32 ; nite + db $18, $19, $1a, $1b, $1c, $1d, $1e, $32 ; eve + +.CaveColors: + db $10, $11, $12, $13, $14, $15, $16, $33 ; morn + db $10, $11, $12, $13, $14, $15, $16, $33 ; day + db $10, $11, $12, $13, $14, $15, $16, $33 ; nite + db $10, $11, $12, $13, $14, $15, $16, $33 ; eve + +.IceCaveColors: + db $10, $11, $2c, $13, $14, $15, $2d, $34 ; morn + db $10, $11, $2c, $13, $14, $15, $2d, $34 ; day + db $10, $11, $2c, $13, $14, $15, $2d, $34 ; nite + db $10, $11, $2c, $13, $14, $15, $2d, $34 ; eve + +.BuildingColors: + db $20, $21, $22, $23, $24, $25, $26, $35 ; morn + db $20, $21, $22, $23, $24, $25, $26, $35 ; day + db $10, $11, $12, $13, $14, $15, $16, $35 ; nite + db $18, $19, $1a, $1b, $1c, $1d, $1e, $35 ; eve diff --git a/data/maps/maps.asm b/data/maps/maps.asm index b05e1e6dc..f15e93e5a 100644 --- a/data/maps/maps.asm +++ b/data/maps/maps.asm @@ -23,8 +23,8 @@ MapGroupPointers:: MapGroup_Level1: table_width MAP_LENGTH, MapGroup_Level1 - map Level1_Map1, TILESET_PLAYERS_ROOM, INDOOR, LANDMARK_LEVEL_1, MUSIC_NEW_BARK_TOWN, FALSE, PALETTE_DAY, FISHGROUP_SHORE -; map Level1_Map2, TILESET_CHAMPIONS_ROOM, INDOOR, LANDMARK_LEVEL_2, MUSIC_GYM, TRUE, PALETTE_DAY, FISHGROUP_SHORE + map Level1_Map1, TILESET_PLAYERS_ROOM, INDOOR_BUILDING, LANDMARK_LEVEL_1, MUSIC_NEW_BARK_TOWN, FALSE, PALETTE_DAY, FISHGROUP_SHORE +; map Level1_Map2, TILESET_CHAMPIONS_ROOM, INDOOR_CAVE, LANDMARK_LEVEL_2, MUSIC_GYM, TRUE, PALETTE_NITE | IN_DARKNESS, FISHGROUP_SHORE assert_table_length NUM_LEVEL_1_MAPS ; MapGroup_Level2: diff --git a/engine/battle/battle_transition.asm b/engine/battle/battle_transition.asm index 7d145796b..703a4dacc 100644 --- a/engine/battle/battle_transition.asm +++ b/engine/battle/battle_transition.asm @@ -215,12 +215,8 @@ StartTrainerBattle_DetermineWhichAnimation: set TRANS_STRONGER_F, e .not_stronger ld a, [wEnvironment] - cp CAVE - jr z, .cave - cp ENVIRONMENT_5 - jr z, .cave - cp DUNGEON - jr z, .cave + cp INDOOR_ENVIRONMENT + jr nc, .cave set TRANS_NO_CAVE_F, e .cave ld hl, .StartingPoints diff --git a/engine/events/field_moves.asm b/engine/events/field_moves.asm index 79d496d9d..1e4f0a777 100644 --- a/engine/events/field_moves.asm +++ b/engine/events/field_moves.asm @@ -17,7 +17,6 @@ BlindingFlash: farcall UpdateTimeOfDayPal ld b, CGB_MAPPALS call GetCGBLayout - farcall LoadOW_BGPal7 farcall FadeInPalettes ret diff --git a/engine/events/magnet_train.asm b/engine/events/magnet_train.asm index 305eba584..0245d943f 100644 --- a/engine/events/magnet_train.asm +++ b/engine/events/magnet_train.asm @@ -404,7 +404,7 @@ MagnetTrain_Jumptable_FirstRunThrough: ld a, [wTimeOfDay] maskbits NUM_DAYTIMES ld [wTimeOfDayPal], a - ld a, TOWN + ld a, OUTDOOR_GRASSY ld [wEnvironment], a ld b, CGB_MAPPALS call GetCGBLayout diff --git a/engine/events/overworld.asm b/engine/events/overworld.asm index d8bee91d0..c44da9f8b 100644 --- a/engine/events/overworld.asm +++ b/engine/events/overworld.asm @@ -762,9 +762,9 @@ EscapeRopeOrDig: .CheckCanDig: call GetMapEnvironment - cp CAVE + cp INDOOR_CAVE jr z, .incave - cp DUNGEON + cp INDOOR_ICE_CAVE jr z, .incave .fail ld a, $2 @@ -1677,13 +1677,8 @@ BikeFunction: .CheckEnvironment: call GetMapEnvironment - call CheckOutdoorMap - jr z, .ok - cp CAVE - jr z, .ok - cp GATE - jr z, .ok - jr .nope + cp INDOOR_BUILDING + jr z, .nope .ok call GetPlayerTile diff --git a/engine/events/sweet_scent.asm b/engine/events/sweet_scent.asm index ceda90b11..05a6afc3e 100644 --- a/engine/events/sweet_scent.asm +++ b/engine/events/sweet_scent.asm @@ -30,7 +30,7 @@ SweetScentNothing: end SweetScentEncounter: - farcall CanUseSweetScent + farcall CanEncounterWildMonInThisTile jr nc, .no_battle ld hl, wStatusFlags2 bit STATUSFLAGS2_BUG_CONTEST_TIMER_F, [hl] diff --git a/engine/gfx/color.asm b/engine/gfx/color.asm index 9e9ba3738..d8d2ccc1b 100644 --- a/engine/gfx/color.asm +++ b/engine/gfx/color.asm @@ -628,12 +628,12 @@ INCLUDE "data/pokemon/palettes.asm" INCLUDE "data/trainers/palettes.asm" LoadMapPals: - farcall LoadSpecialMapPalette ; also handles darkness palettes + call LoadDarknessPaletteIfDark ; also handles darkness palettes jr c, .got_pals ; Which palette group is based on whether we're outside or inside ld a, [wEnvironment] - and 7 + maskbits NUM_ENVIRONMENTS + 1 ld e, a ld d, 0 ld hl, EnvironmentColorsPointers @@ -713,9 +713,8 @@ LoadMapPals: call FarCopyWRAM ld a, [wEnvironment] - cp TOWN - jr z, .outside - cp ROUTE + cp INDOOR_ENVIRONMENT + jr c, .outside ret nz .outside ld a, [wMapGroup] @@ -740,6 +739,30 @@ endr call FarCopyWRAM ret +LoadDarknessPaletteIfDark: + call GetMapTimeOfDay + bit IN_DARKNESS_F, a + jr z, .do_nothing + ld a, [wStatusFlags] + bit STATUSFLAGS_FLASH_F, a + jr nz, .do_nothing + +.darkness + call LoadDarknessPalette + scf + ret + +.do_nothing + and a + ret + +LoadDarknessPalette: + ld a, BANK(wBGPals1) + ld de, wBGPals1 + ld hl, DarknessPalette + ld bc, 8 palettes + jp FarCopyWRAM + INCLUDE "data/maps/environment_colors.asm" PartyMenuBGMobilePalette: @@ -748,6 +771,9 @@ INCLUDE "gfx/stats/party_menu_bg_mobile.pal" PartyMenuBGPalette: INCLUDE "gfx/stats/party_menu_bg.pal" +DarknessPalette: +INCLUDE "gfx/tilesets/bg_tiles_darkness.pal" + TilesetBGPalette: INCLUDE "gfx/tilesets/bg_tiles.pal" diff --git a/engine/gfx/crystal_layouts.asm b/engine/gfx/crystal_layouts.asm index 834e49c98..a4c2aca63 100644 --- a/engine/gfx/crystal_layouts.asm +++ b/engine/gfx/crystal_layouts.asm @@ -1,16 +1,3 @@ -LoadOW_BGPal7:: - ld hl, Palette_TextBG7 - ld de, wBGPals1 palette PAL_BG_TEXT - ld bc, 1 palettes - ld a, BANK(wBGPals1) - call FarCopyWRAM - ret - -Palette_TextBG7: -INCLUDE "gfx/font/bg_text.pal" - -INCLUDE "engine/tilesets/tileset_palettes.asm" - _InitMG_Mobile_LinkTradePalMap: hlcoord 0, 0, wAttrmap lb bc, 16, 2 diff --git a/engine/overworld/events.asm b/engine/overworld/events.asm index 9190011ac..9fa83ff66 100644 --- a/engine/overworld/events.asm +++ b/engine/overworld/events.asm @@ -1109,7 +1109,7 @@ RandomEncounter:: call CheckWildEncounterCooldown jr c, .nope - call CanUseSweetScent + call CanEncounterWildMonInThisTile jr nc, .nope ld hl, wStatusFlags2 bit STATUSFLAGS2_BUG_CONTEST_TIMER_F, [hl] @@ -1149,15 +1149,13 @@ WildBattleScript: reloadmapafterbattle end -CanUseSweetScent:: +CanEncounterWildMonInThisTile:: ld hl, wStatusFlags bit STATUSFLAGS_NO_WILD_ENCOUNTERS_F, [hl] jr nz, .no ld a, [wEnvironment] - cp CAVE - jr z, .ice_check - cp DUNGEON - jr z, .ice_check + cp INDOOR_ENVIRONMENT + jr nc, .ice_check farcall CheckGrassCollision jr nc, .no diff --git a/engine/overworld/init_map.asm b/engine/overworld/init_map.asm index c98f36c1f..87102a2bf 100644 --- a/engine/overworld/init_map.asm +++ b/engine/overworld/init_map.asm @@ -31,7 +31,6 @@ ReanchorBGMap_NoOAMUpdate:: ld a, HIGH(vBGMap1) call .LoadBGMapAddrIntoHRAM call _OpenAndCloseMenu_HDMATransferTilemapAndAttrmap - farcall LoadOW_BGPal7 farcall ApplyPals ld a, TRUE ldh [hCGBPalUpdate], a diff --git a/engine/overworld/map_setup.asm b/engine/overworld/map_setup.asm index e70f9ab7b..6859cec5a 100644 --- a/engine/overworld/map_setup.asm +++ b/engine/overworld/map_setup.asm @@ -130,11 +130,7 @@ CheckUpdatePlayerSprite: cp PLAYER_SURF_PIKA jr z, .surfing call GetMapEnvironment - cp INDOOR - jr z, .no_biking - cp ENVIRONMENT_5 - jr z, .no_biking - cp DUNGEON + cp INDOOR_BUILDING jr z, .no_biking jr .nope .no_biking diff --git a/engine/overworld/wildmons.asm b/engine/overworld/wildmons.asm index 0e7b9c957..a08557cb3 100644 --- a/engine/overworld/wildmons.asm +++ b/engine/overworld/wildmons.asm @@ -236,6 +236,8 @@ ApplyCleanseTagEffectOnEncounterRate:: ld hl, wPartyMon1Item ld de, PARTYMON_STRUCT_LENGTH ld a, [wPartyCount] + and a + ret z ld c, a .loop ld a, [hl] diff --git a/engine/phone/phone.asm b/engine/phone/phone.asm index 15e4e4a4c..1b0521fc2 100644 --- a/engine/phone/phone.asm +++ b/engine/phone/phone.asm @@ -285,10 +285,8 @@ CheckSpecialPhoneCall:: SpecialCallOnlyWhenOutside: ld a, [wEnvironment] - cp TOWN - jr z, .outside - cp ROUTE - jr z, .outside + cp INDOOR_ENVIRONMENT + jr c, .outside xor a ret diff --git a/engine/tilesets/tileset_palettes.asm b/engine/tilesets/tileset_palettes.asm deleted file mode 100644 index 061a57b2d..000000000 --- a/engine/tilesets/tileset_palettes.asm +++ /dev/null @@ -1,160 +0,0 @@ -LoadSpecialMapPalette: - call GetMapTimeOfDay - bit IN_DARKNESS_F, a - jr z, .not_dark - ld a, [wStatusFlags] - bit STATUSFLAGS_FLASH_F, a - jr z, .darkness - -.not_dark - ld a, [wMapTileset] - cp TILESET_POKECOM_CENTER - jr z, .pokecom_2f - cp TILESET_BATTLE_TOWER_INSIDE - jr z, .battle_tower_inside - cp TILESET_ICE_PATH - jr z, .ice_path - cp TILESET_HOUSE - jr z, .house - cp TILESET_RADIO_TOWER - jr z, .radio_tower - cp TILESET_MANSION - jr z, .mansion_mobile - jr .do_nothing - -.darkness - call LoadDarknessPalette - scf - ret - -.pokecom_2f - call LoadPokeComPalette - scf - ret - -.battle_tower_inside - call LoadBattleTowerInsidePalette - scf - ret - -.ice_path - ld a, [wEnvironment] - and $7 - cp INDOOR ; Hall of Fame - jr z, .do_nothing - call LoadIcePathPalette - scf - ret - -.house - call LoadHousePalette - scf - ret - -.radio_tower - call LoadRadioTowerPalette - scf - ret - -.mansion_mobile - call LoadMansionPalette - scf - ret - -.do_nothing - and a - ret - -LoadDarknessPalette: - ld a, BANK(wBGPals1) - ld de, wBGPals1 - ld hl, DarknessPalette - ld bc, 8 palettes - jp FarCopyWRAM - -DarknessPalette: -INCLUDE "gfx/tilesets/bg_tiles_darkness.pal" - -LoadPokeComPalette: - ld a, BANK(wBGPals1) - ld de, wBGPals1 - ld hl, PokeComPalette - ld bc, 8 palettes - call FarCopyWRAM - ret - -PokeComPalette: -INCLUDE "gfx/tilesets/pokecom_center.pal" - -LoadBattleTowerInsidePalette: - ld a, BANK(wBGPals1) - ld de, wBGPals1 - ld hl, BattleTowerInsidePalette - ld bc, 8 palettes - call FarCopyWRAM - ret - -BattleTowerInsidePalette: -INCLUDE "gfx/tilesets/battle_tower_inside.pal" - -LoadIcePathPalette: - ld a, BANK(wBGPals1) - ld de, wBGPals1 - ld hl, IcePathPalette - ld bc, 8 palettes - call FarCopyWRAM - ret - -IcePathPalette: -INCLUDE "gfx/tilesets/ice_path.pal" - -LoadHousePalette: - ld a, BANK(wBGPals1) - ld de, wBGPals1 - ld hl, HousePalette - ld bc, 8 palettes - call FarCopyWRAM - ret - -HousePalette: -INCLUDE "gfx/tilesets/house.pal" - -LoadRadioTowerPalette: - ld a, BANK(wBGPals1) - ld de, wBGPals1 - ld hl, RadioTowerPalette - ld bc, 8 palettes - call FarCopyWRAM - ret - -RadioTowerPalette: -INCLUDE "gfx/tilesets/radio_tower.pal" - -MansionPalette1: -INCLUDE "gfx/tilesets/mansion_1.pal" - -LoadMansionPalette: - ld a, BANK(wBGPals1) - ld de, wBGPals1 - ld hl, MansionPalette1 - ld bc, 8 palettes - call FarCopyWRAM - ld a, BANK(wBGPals1) - ld de, wBGPals1 palette PAL_BG_YELLOW - ld hl, MansionPalette2 - ld bc, 1 palettes - call FarCopyWRAM - ld a, BANK(wBGPals1) - ld de, wBGPals1 palette PAL_BG_WATER - ld hl, MansionPalette1 palette 6 - ld bc, 1 palettes - call FarCopyWRAM - ld a, BANK(wBGPals1) - ld de, wBGPals1 palette PAL_BG_ROOF - ld hl, MansionPalette1 palette 8 - ld bc, 1 palettes - call FarCopyWRAM - ret - -MansionPalette2: -INCLUDE "gfx/tilesets/mansion_2.pal" diff --git a/gfx/font/bg_text.pal b/gfx/font/bg_text.pal deleted file mode 100644 index 39a4a194c..000000000 --- a/gfx/font/bg_text.pal +++ /dev/null @@ -1,4 +0,0 @@ - RGB 31, 31, 31 - RGB 08, 19, 28 - RGB 05, 05, 16 - RGB 00, 00, 00 diff --git a/gfx/tilesets/battle_tower_inside.pal b/gfx/tilesets/battle_tower_inside.pal deleted file mode 100644 index 4e71a5575..000000000 --- a/gfx/tilesets/battle_tower_inside.pal +++ /dev/null @@ -1,40 +0,0 @@ -; gray - RGB 30, 28, 26 - RGB 19, 19, 19 - RGB 13, 13, 13 - RGB 07, 07, 07 -; red - RGB 30, 28, 26 - RGB 31, 19, 24 - RGB 30, 10, 06 - RGB 07, 07, 07 -; green - RGB 18, 24, 09 - RGB 15, 20, 01 - RGB 09, 13, 00 - RGB 07, 07, 07 -; water (blue) - RGB 30, 28, 26 - RGB 15, 16, 31 - RGB 09, 09, 31 - RGB 07, 07, 07 -; yellow - RGB 30, 28, 26 - RGB 31, 31, 07 - RGB 31, 16, 01 - RGB 07, 07, 07 -; brown - RGB 26, 24, 17 - RGB 21, 17, 07 - RGB 16, 13, 03 - RGB 07, 07, 07 -; roof - RGB 05, 05, 16 - RGB 08, 19, 28 - RGB 00, 00, 00 - RGB 31, 31, 31 -; text - RGB 31, 31, 16 - RGB 31, 31, 16 - RGB 14, 09, 00 - RGB 00, 00, 00 diff --git a/gfx/tilesets/bg_tiles.pal b/gfx/tilesets/bg_tiles.pal index 85e8b0dd4..6039146a0 100644 --- a/gfx/tilesets/bg_tiles.pal +++ b/gfx/tilesets/bg_tiles.pal @@ -5,8 +5,8 @@ RGB 31,31,31, 08,12,31, 01,04,31, 07,07,07 ; water RGB 28,31,16, 31,31,07, 31,16,01, 07,07,07 ; yellow RGB 28,31,16, 24,18,07, 20,15,03, 07,07,07 ; brown - RGB 28,31,16, 15,31,31, 05,17,31, 07,07,07 ; roof - RGB 31,31,16, 31,31,16, 14,09,00, 00,00,00 ; text + RGB 28,31,16, 15,31,31, 05,17,31, 07,07,07 ; roof (overwritten if outdoor env) + RGB 31,31,31, 31,31,16, 14,09,00, 00,00,00 ; text (always overwritten) ; day RGB 27,31,27, 21,21,21, 13,13,13, 07,07,07 ; gray @@ -15,8 +15,8 @@ RGB 31,31,31, 08,12,31, 01,04,31, 07,07,07 ; water RGB 27,31,27, 31,31,07, 31,16,01, 07,07,07 ; yellow RGB 27,31,27, 24,18,07, 20,15,03, 07,07,07 ; brown - RGB 27,31,27, 15,31,31, 05,17,31, 07,07,07 ; roof - RGB 31,31,16, 31,31,16, 14,09,00, 00,00,00 ; text + RGB 27,31,27, 15,31,31, 05,17,31, 07,07,07 ; roof (overwritten if outdoor env) + RGB 31,31,31, 31,31,16, 14,09,00, 00,00,00 ; text (always overwritten) ; nite RGB 15,14,24, 11,11,19, 07,07,12, 00,00,00 ; gray @@ -25,8 +25,8 @@ RGB 15,14,24, 05,05,17, 03,03,10, 00,00,00 ; water RGB 30,30,11, 16,14,18, 16,14,10, 00,00,00 ; yellow RGB 15,14,24, 12,09,15, 08,04,05, 00,00,00 ; brown - RGB 15,14,24, 13,12,23, 11,09,20, 00,00,00 ; roof - RGB 31,31,16, 31,31,16, 14,09,00, 00,00,00 ; text + RGB 15,14,24, 13,12,23, 11,09,20, 00,00,00 ; roof (overwritten if outdoor env) + RGB 31,31,31, 31,31,16, 14,09,00, 00,00,00 ; text (always overwritten) ; eve RGB 31,21,14, 18,16,16, 11,10,10, 06,05,05 ; gray @@ -35,21 +35,38 @@ RGB 31,21,14, 07,09,23, 01,03,23, 06,05,05 ; water RGB 31,31,07, 27,21,10, 25,12,01, 06,05,05 ; yellow RGB 31,21,14, 21,13,05, 16,09,01, 06,05,05 ; brown - RGB 31,21,14, 13,23,23, 04,13,23, 06,05,05 ; roof - RGB 31,31,16, 31,31,16, 14,09,00, 00,00,00 ; text + RGB 31,21,14, 13,23,23, 04,13,23, 06,05,05 ; roof (overwritten if outdoor env) + RGB 31,31,31, 31,31,16, 14,09,00, 00,00,00 ; text (always overwritten) -; indoor (morn/day) +; building (morn/day) RGB 30,28,26, 19,19,19, 13,13,13, 07,07,07 ; gray RGB 30,28,26, 31,19,24, 30,10,06, 07,07,07 ; red RGB 18,24,09, 15,20,01, 09,13,00, 07,07,07 ; green RGB 30,28,26, 15,16,31, 09,09,31, 07,07,07 ; water RGB 30,28,26, 31,31,07, 31,16,01, 07,07,07 ; yellow RGB 26,24,17, 21,17,07, 16,13,03, 07,07,07 ; brown - RGB 30,28,26, 17,19,31, 14,16,31, 07,07,07 ; roof - RGB 31,31,16, 31,31,16, 14,09,00, 00,00,00 ; text + RGB 30,28,26, 17,19,31, 14,16,31, 07,07,07 ; roof (overwritten if outdoor env) + RGB 31,31,31, 31,31,16, 14,09,00, 00,00,00 ; text (always overwritten) ; overworld water (outdoor) RGB 23,23,31, 18,19,31, 13,12,31, 07,07,07 ; morn RGB 23,23,31, 18,19,31, 13,12,31, 07,07,07 ; day RGB 15,13,27, 10,09,20, 04,03,18, 00,00,00 ; nite RGB 31,21,14, 16,14,23, 11,09,23, 06,05,05 ; eve + +; ice + RGB 22,29,31, 10,27,31, 31,31,31, 05,00,09 ; green (ice) + RGB 25,31,31, 09,28,31, 16,11,31, 05,00,09 ; roof (snow) + +; text + RGB 31,31,31, 31,31,16, 14,09,00, 00,00,00 ; OUTDOOR_GRASSY + RGB 31,31,31, 31,31,16, 14,09,00, 00,00,00 ; OUTDOOR_MOUNTAIN + RGB 31,31,31, 31,31,16, 14,09,00, 00,00,00 ; OUTDOOR_COAST + RGB 31,31,31, 31,31,16, 14,09,00, 00,00,00 ; OUTDOOR_SEA + RGB 31,31,31, 31,31,16, 14,09,00, 00,00,00 ; INDOOR_FOREST + RGB 31,31,31, 31,31,16, 14,09,00, 00,00,00 ; INDOOR_CAVE + RGB 31,31,31, 31,31,16, 14,09,00, 00,00,00 ; INDOOR_ICE_CAVE + RGB 31,31,31, 31,31,16, 14,09,00, 00,00,00 ; INDOOR_BUILDING + +; house building +; RGB 30,28,26, 31,19,24, 16,13,03, 07,07,07 ; roof (glass) diff --git a/gfx/tilesets/bg_tiles_darkness.pal b/gfx/tilesets/bg_tiles_darkness.pal index 0db5d2309..2582d3c2c 100755 --- a/gfx/tilesets/bg_tiles_darkness.pal +++ b/gfx/tilesets/bg_tiles_darkness.pal @@ -6,4 +6,4 @@ RGB 30,30,11, 00,00,00, 00,00,00, 00,00,00 ; yellow RGB 01,01,02, 00,00,00, 00,00,00, 00,00,00 ; brown RGB 01,01,02, 00,00,00, 00,00,00, 00,00,00 ; roof - RGB 31,31,16, 31,31,16, 14,09,00, 00,00,00 ; text + RGB 31,31,31, 31,31,16, 14,09,00, 00,00,00 ; text diff --git a/gfx/tilesets/house.pal b/gfx/tilesets/house.pal deleted file mode 100644 index a9f8b74b6..000000000 --- a/gfx/tilesets/house.pal +++ /dev/null @@ -1,40 +0,0 @@ -; gray - RGB 30, 28, 26 - RGB 19, 19, 19 - RGB 13, 13, 13 - RGB 07, 07, 07 -; red - RGB 30, 28, 26 - RGB 31, 19, 24 - RGB 30, 10, 06 - RGB 07, 07, 07 -; green - RGB 30, 28, 26 - RGB 15, 20, 01 - RGB 09, 13, 00 - RGB 07, 07, 07 -; water (blue) - RGB 30, 28, 26 - RGB 15, 16, 31 - RGB 09, 09, 31 - RGB 07, 07, 07 -; yellow - RGB 30, 28, 26 - RGB 31, 31, 07 - RGB 31, 16, 01 - RGB 07, 07, 07 -; brown - RGB 26, 24, 17 - RGB 21, 17, 07 - RGB 16, 13, 03 - RGB 07, 07, 07 -; roof (glass) - RGB 30, 28, 26 - RGB 31, 19, 24 - RGB 16, 13, 03 - RGB 07, 07, 07 -; text - RGB 31, 31, 16 - RGB 31, 31, 16 - RGB 14, 09, 00 - RGB 00, 00, 00 diff --git a/gfx/tilesets/ice_path.pal b/gfx/tilesets/ice_path.pal deleted file mode 100644 index cb7659f50..000000000 --- a/gfx/tilesets/ice_path.pal +++ /dev/null @@ -1,40 +0,0 @@ -; gray - RGB 15, 14, 24 - RGB 11, 11, 19 - RGB 07, 07, 12 - RGB 00, 00, 00 -; red - RGB 15, 14, 24 - RGB 14, 07, 17 - RGB 13, 00, 08 - RGB 00, 00, 00 -; green (ice) - RGB 22, 29, 31 - RGB 10, 27, 31 - RGB 31, 31, 31 - RGB 05, 00, 09 -; water - RGB 15, 14, 24 - RGB 05, 05, 17 - RGB 03, 03, 10 - RGB 00, 00, 00 -; yellow - RGB 30, 30, 11 - RGB 16, 14, 18 - RGB 16, 14, 10 - RGB 00, 00, 00 -; brown - RGB 15, 14, 24 - RGB 12, 09, 15 - RGB 08, 04, 05 - RGB 00, 00, 00 -; roof (snow) - RGB 25, 31, 31 - RGB 09, 28, 31 - RGB 16, 11, 31 - RGB 05, 00, 09 -; text - RGB 31, 31, 16 - RGB 31, 31, 16 - RGB 14, 09, 00 - RGB 00, 00, 00 diff --git a/gfx/tilesets/mansion_1.pal b/gfx/tilesets/mansion_1.pal deleted file mode 100644 index 1ed1de75f..000000000 --- a/gfx/tilesets/mansion_1.pal +++ /dev/null @@ -1,44 +0,0 @@ - RGB 30, 28, 26 - RGB 19, 19, 19 - RGB 13, 13, 13 - RGB 07, 07, 07 - - RGB 30, 28, 26 - RGB 31, 19, 24 - RGB 30, 10, 06 - RGB 07, 07, 07 - - RGB 18, 24, 09 - RGB 15, 20, 01 - RGB 09, 13, 00 - RGB 07, 07, 07 - - RGB 30, 28, 26 - RGB 15, 16, 31 - RGB 09, 09, 31 - RGB 07, 07, 07 - - RGB 30, 28, 26 - RGB 31, 31, 07 - RGB 31, 16, 01 - RGB 07, 07, 07 - - RGB 26, 24, 17 - RGB 21, 17, 07 - RGB 16, 13, 03 - RGB 07, 07, 07 - - RGB 30, 28, 26 - RGB 17, 19, 31 - RGB 14, 16, 31 - RGB 07, 07, 07 - - RGB 31, 31, 16 - RGB 31, 31, 16 - RGB 14, 09, 00 - RGB 00, 00, 00 - - RGB 05, 05, 16 - RGB 08, 19, 28 - RGB 00, 00, 00 - RGB 31, 31, 31 diff --git a/gfx/tilesets/mansion_2.pal b/gfx/tilesets/mansion_2.pal deleted file mode 100644 index ad5c5e4db..000000000 --- a/gfx/tilesets/mansion_2.pal +++ /dev/null @@ -1,4 +0,0 @@ - RGB 25, 24, 23 - RGB 20, 19, 19 - RGB 14, 16, 31 - RGB 07, 07, 07 diff --git a/gfx/tilesets/pokecom_center.pal b/gfx/tilesets/pokecom_center.pal deleted file mode 100644 index 9fe7b765a..000000000 --- a/gfx/tilesets/pokecom_center.pal +++ /dev/null @@ -1,40 +0,0 @@ -; gray - RGB 30, 28, 26 - RGB 19, 19, 19 - RGB 13, 13, 13 - RGB 07, 07, 07 -; red - RGB 30, 28, 26 - RGB 31, 19, 24 - RGB 30, 10, 06 - RGB 07, 07, 07 -; green - RGB 18, 24, 09 - RGB 15, 20, 01 - RGB 09, 13, 00 - RGB 07, 07, 07 -; water (blue) - RGB 30, 28, 26 - RGB 17, 19, 31 - RGB 14, 16, 31 - RGB 07, 07, 07 -; yellow - RGB 31, 26, 21 - RGB 31, 20, 01 - RGB 14, 16, 31 - RGB 07, 07, 07 -; brown - RGB 21, 17, 07 - RGB 17, 19, 31 - RGB 16, 13, 03 - RGB 07, 07, 07 -; roof - RGB 05, 05, 16 - RGB 08, 19, 28 - RGB 00, 00, 00 - RGB 31, 31, 31 -; text - RGB 31, 31, 16 - RGB 31, 31, 16 - RGB 14, 09, 00 - RGB 00, 00, 00 diff --git a/gfx/tilesets/radio_tower.pal b/gfx/tilesets/radio_tower.pal deleted file mode 100644 index 5799b6f77..000000000 --- a/gfx/tilesets/radio_tower.pal +++ /dev/null @@ -1,39 +0,0 @@ - RGB 27, 31, 27 - RGB 21, 21, 21 - RGB 13, 13, 13 - RGB 07, 07, 07 - - RGB 27, 31, 27 - RGB 31, 19, 24 - RGB 30, 10, 06 - RGB 07, 07, 07 - - RGB 08, 12, 31 - RGB 12, 25, 01 - RGB 05, 14, 00 - RGB 07, 07, 07 - - RGB 31, 31, 31 - RGB 08, 12, 31 - RGB 01, 04, 31 - RGB 07, 07, 07 - - RGB 27, 31, 27 - RGB 12, 25, 01 - RGB 05, 14, 00 - RGB 07, 07, 07 - - RGB 27, 31, 27 - RGB 24, 18, 07 - RGB 20, 15, 03 - RGB 07, 07, 07 - - RGB 27, 31, 27 - RGB 15, 31, 31 - RGB 05, 17, 31 - RGB 07, 07, 07 - - RGB 31, 31, 16 - RGB 31, 31, 16 - RGB 14, 09, 00 - RGB 00, 00, 00 diff --git a/home/flag.asm b/home/flag.asm index 97e15ea3b..d48f0d093 100644 --- a/home/flag.asm +++ b/home/flag.asm @@ -12,10 +12,8 @@ ResetBikeFlags:: ResetFlashIfOutOfCave:: ld a, [wEnvironment] - cp ROUTE - jr z, .outdoors - cp TOWN - jr z, .outdoors + cp INDOOR_ENVIRONMENT + jr c, .outdoors ret .outdoors diff --git a/home/map.asm b/home/map.asm index a5e9ea806..4933d4777 100644 --- a/home/map.asm +++ b/home/map.asm @@ -351,20 +351,20 @@ CopyWarpData:: ret CheckOutdoorMap:: - cp ROUTE - ret z - cp TOWN - ret + cp INDOOR_ENVIRONMENT + jr c, .outdoor + ret ; nz +.outdoor + xor a + ret ; z CheckIndoorMap:: - cp INDOOR - ret z - cp CAVE - ret z - cp DUNGEON - ret z - cp GATE - ret + cp INDOOR_ENVIRONMENT + jr nc, .indoor + ret ; nz +.indoor + xor a + ret ; z LoadMapAttributes:: call CopyMapPartialAndAttributes @@ -1912,7 +1912,6 @@ ExitAllMenus:: FinishExitMenu:: ld b, CGB_MAPPALS call GetCGBLayout - farcall LoadOW_BGPal7 call WaitBGMap2 farcall FadeInPalettes call EnableSpriteUpdates @@ -1934,7 +1933,6 @@ ReturnToMapWithSpeechTextbox:: call WaitBGMap2 ld b, CGB_MAPPALS call GetCGBLayout - farcall LoadOW_BGPal7 call UpdateTimePals call DelayFrame ld a, $1