Skip to content

Commit

Permalink
Merge pull request #1586 from GriffinRichards/clean-areascreen
Browse files Browse the repository at this point in the history
Clean up pokedex_area_screen
  • Loading branch information
GriffinRichards authored Jan 7, 2022
2 parents 71e0b48 + 713cd66 commit 577e6cc
Show file tree
Hide file tree
Showing 15 changed files with 612 additions and 337 deletions.
1 change: 1 addition & 0 deletions data/mystery_gift.s
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "constants/songs.h"
#include "constants/species.h"
#include "constants/vars.h"
#include "constants/wild_encounter.h"
.include "asm/macros.inc"
.include "asm/macros/event.inc"
.include "constants/constants.inc"
Expand Down
2 changes: 1 addition & 1 deletion data/scripts/gift_altering_cave.inc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
MysteryGiftScript_AlteringCave::
setvaddress MysteryGiftScript_AlteringCave
addvar VAR_ALTERING_CAVE_WILD_SET, 1
vgoto_if_ne VAR_ALTERING_CAVE_WILD_SET, 10, MysteryGiftScript_AlteringCave_
vgoto_if_ne VAR_ALTERING_CAVE_WILD_SET, (NUM_ALTERING_CAVE_TABLES + 1), MysteryGiftScript_AlteringCave_
setvar VAR_ALTERING_CAVE_WILD_SET, 0
MysteryGiftScript_AlteringCave_:
lock
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
5 changes: 3 additions & 2 deletions graphics_file_rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ WALLPAPERGFXDIR := graphics/pokemon_storage/wallpapers
OBJEVENTGFXDIR := graphics/object_events
MISCGFXDIR := graphics/misc
JPCONTESTGFXDIR := graphics/contest/japanese
POKEDEXGFXDIR := graphics/pokedex

types := normal fight flying poison ground rock bug ghost steel mystery fire water grass electric psychic ice dragon dark
contest_types := cool beauty cute smart tough
Expand Down Expand Up @@ -700,10 +701,10 @@ $(PKNAVGFXDIR)/device_outline.4bpp: %.4bpp: %.png
$(PKNAVGFXDIR)/match_call/ui.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 13

$(INTERFACEGFXDIR)/region_map.8bpp: %.8bpp: %.png
$(POKEDEXGFXDIR)/region_map.8bpp: %.8bpp: %.png
$(GFX) $< $@ -num_tiles 232

$(INTERFACEGFXDIR)/region_map_affine.8bpp: %.8bpp: %.png
$(POKEDEXGFXDIR)/region_map_affine.8bpp: %.8bpp: %.png
$(GFX) $< $@ -num_tiles 233

$(MISCGFXDIR)/birch_help.4bpp: $(MISCGFXDIR)/birch_bag.4bpp $(MISCGFXDIR)/birch_grass.4bpp
Expand Down
6 changes: 0 additions & 6 deletions include/constants/maps.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@
#define MAP_GROUP(map) (MAP_##map >> 8)
#define MAP_NUM(map) (MAP_##map & 0xFF)

// These groups are used by pokedex_area_screen.c to find wild
// pokemon locations.
#define MAP_GROUP_OVERWORLD_MONS MAP_GROUP(PETALBURG_CITY)
#define MAP_GROUP_SPECIAL_MONS_1 MAP_GROUP(METEOR_FALLS_1F_1R)
#define MAP_GROUP_SPECIAL_MONS_2 MAP_GROUP(SAFARI_ZONE_NORTHWEST)

// IDs for dynamic warps. Both are used in the dest_warp_id field for warp events, but they
// are never read in practice. A dest_map of MAP_NONE is used to indicate that a
// dynamic warp should be used, at which point the warp id is ignored. It can be passed to
Expand Down
11 changes: 11 additions & 0 deletions include/constants/wild_encounter.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#ifndef GUARD_CONSTANTS_WILD_ENCOUNTER_H
#define GUARD_CONSTANTS_WILD_ENCOUNTER_H

#define LAND_WILD_COUNT 12
#define WATER_WILD_COUNT 5
#define ROCK_WILD_COUNT 5
#define FISH_WILD_COUNT 10

#define NUM_ALTERING_CAVE_TABLES 9

#endif // GUARD_CONSTANTS_WILD_ENCOUNTER_H
5 changes: 1 addition & 4 deletions include/wild_encounter.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
#ifndef GUARD_WILD_ENCOUNTER_H
#define GUARD_WILD_ENCOUNTER_H

#define LAND_WILD_COUNT 12
#define WATER_WILD_COUNT 5
#define ROCK_WILD_COUNT 5
#define FISH_WILD_COUNT 10
#include "constants/wild_encounter.h"

struct WildPokemon
{
Expand Down
315 changes: 315 additions & 0 deletions src/data/pokedex_area_glow.h

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions src/pokedex_area_region_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@

static EWRAM_DATA u8 *sPokedexAreaMapBgNum = NULL;

static const u16 sPokedexAreaMap_Pal[] = INCBIN_U16("graphics/interface/region_map.gbapal");
static const u32 sPokedexAreaMap_Gfx[] = INCBIN_U32("graphics/interface/region_map.8bpp.lz");
static const u32 sPokedexAreaMap_Tilemap[] = INCBIN_U32("graphics/interface/region_map.bin.lz");
static const u32 sPokedexAreaMapAffine_Gfx[] = INCBIN_U32("graphics/interface/region_map_affine.8bpp.lz");
static const u32 sPokedexAreaMapAffine_Tilemap[] = INCBIN_U32("graphics/interface/region_map_affine.bin.lz");
static const u16 sPokedexAreaMap_Pal[] = INCBIN_U16("graphics/pokedex/region_map.gbapal");
static const u32 sPokedexAreaMap_Gfx[] = INCBIN_U32("graphics/pokedex/region_map.8bpp.lz");
static const u32 sPokedexAreaMap_Tilemap[] = INCBIN_U32("graphics/pokedex/region_map.bin.lz");
static const u32 sPokedexAreaMapAffine_Gfx[] = INCBIN_U32("graphics/pokedex/region_map_affine.8bpp.lz");
static const u32 sPokedexAreaMapAffine_Tilemap[] = INCBIN_U32("graphics/pokedex/region_map_affine.bin.lz");

void LoadPokedexAreaMapGfx(const struct PokedexAreaMapTemplate *template)
{
Expand Down Expand Up @@ -41,7 +41,7 @@ void LoadPokedexAreaMapGfx(const struct PokedexAreaMapTemplate *template)
ChangeBgX(template->bg, 0, BG_COORD_SET);
ChangeBgY(template->bg, 0, BG_COORD_SET);
SetBgAttribute(template->bg, BG_ATTR_PALETTEMODE, 1);
CpuCopy32(sPokedexAreaMap_Pal, &gPlttBufferUnfaded[0x70], 0x60);
CpuCopy32(sPokedexAreaMap_Pal, &gPlttBufferUnfaded[0x70], sizeof(sPokedexAreaMap_Pal));
*sPokedexAreaMapBgNum = template->bg;
}

Expand Down
Loading

0 comments on commit 577e6cc

Please sign in to comment.