Skip to content

Commit

Permalink
Switch Palette Sets to use a pointer table too
Browse files Browse the repository at this point in the history
  • Loading branch information
JustRegularLuna committed Feb 1, 2024
1 parent a62b5e7 commit a5d389b
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 179 deletions.
221 changes: 50 additions & 171 deletions color/data/map_palette_sets.asm
Original file line number Diff line number Diff line change
@@ -1,8 +1,34 @@
; 8 bytes per tileset for 8 palettes, which are taken from MapPalettes.
MapPaletteSets:
table_width 8, MapPaletteSets
table_width 2, MapPaletteSets
dw OverworldPalSet ; OVERWORLD
dw RedsHouse1PalSet ; REDS_HOUSE_1
dw MartPalSet ; MART
dw ForestPalSet ; FOREST
dw RedsHouse2PalSet ; REDS_HOUSE_2
dw DojoPalSet ; DOJO
dw PokecenterPalSet ; POKECENTER
dw GymPalSet ; GYM
dw HousePalSet ; HOUSE
dw ForestGatePalSet ; FOREST_GATE
dw MuseumPalSet ; MUSEUM
dw UndergroundPalSet ; UNDERGROUND
dw GatePalSet ; GATE
dw ShipPalSet ; SHIP
dw ShipPortPalSet ; SHIP_PORT
dw CemeteryPalSet ; CEMETERY
dw InteriorPalSet ; INTERIOR
dw CavernPalSet ; CAVERN
dw LobbyPalSet ; LOBBY
dw MansionPalSet ; MANSION
dw LabPalSet ; LAB
dw ClubPalSet ; CLUB
dw FacilityPalSet ; FACILITY
dw PlateauPalSet ; PLATEAU
assert_table_length NUM_TILESETS

; OVERWORLD
OverworldPalSet:
PlateauPalSet:
db OUTDOOR_GRAY
db OUTDOOR_RED
db OUTDOOR_GREEN
Expand All @@ -12,7 +38,17 @@ MapPaletteSets:
db OUTDOOR_ROOF
db CRYS_TEXTBOX

; REDS_HOUSE_1
RedsHouse1PalSet:
RedsHouse2PalSet:
DojoPalSet:
GymPalSet:
HousePalSet:
ForestGatePalSet:
UndergroundPalSet:
ShipPalSet:
ShipPortPalSet:
ClubPalSet:
FacilityPalSet:
db INDOOR_GRAY
db INDOOR_RED
db INDOOR_GREEN
Expand All @@ -22,7 +58,11 @@ MapPaletteSets:
db INDOOR_LIGHT_BLUE
db CRYS_TEXTBOX

; MART
MartPalSet:
InteriorPalSet:
LobbyPalSet:
MansionPalSet:
LabPalSet:
db INDOOR_GRAY
db INDOOR_RED
db INDOOR_GREEN
Expand All @@ -32,7 +72,7 @@ MapPaletteSets:
db INDOOR_LIGHT_BLUE
db PC_POKEBALL_PAL

; FOREST
ForestPalSet:
db OUTDOOR_GRAY
db FOREST_ROCKS
db OUTDOOR_GREEN
Expand All @@ -42,27 +82,7 @@ MapPaletteSets:
db FOREST_TREES
db CRYS_TEXTBOX

; REDS_HOUSE_2
db INDOOR_GRAY
db INDOOR_RED
db INDOOR_GREEN
db INDOOR_BLUE
db INDOOR_YELLOW
db INDOOR_BROWN
db INDOOR_LIGHT_BLUE
db CRYS_TEXTBOX

; DOJO
db INDOOR_GRAY
db INDOOR_RED
db INDOOR_GREEN
db INDOOR_BLUE
db INDOOR_YELLOW
db INDOOR_BROWN
db INDOOR_LIGHT_BLUE
db CRYS_TEXTBOX

; POKECENTER
PokecenterPalSet:
db INDOOR_GRAY
db INDOOR_RED
db INDOOR_GREEN
Expand All @@ -72,37 +92,8 @@ MapPaletteSets:
db INDOOR_LIGHT_BLUE
db PC_POKEBALL_PAL

; GYM
db INDOOR_GRAY
db INDOOR_RED
db INDOOR_GREEN
db INDOOR_BLUE
db INDOOR_YELLOW
db INDOOR_BROWN
db INDOOR_LIGHT_BLUE
db CRYS_TEXTBOX

; HOUSE
db INDOOR_GRAY
db INDOOR_RED
db INDOOR_GREEN
db INDOOR_BLUE
db INDOOR_YELLOW
db INDOOR_BROWN
db INDOOR_LIGHT_BLUE
db CRYS_TEXTBOX

; FOREST_GATE
db INDOOR_GRAY
db INDOOR_RED
db INDOOR_GREEN
db INDOOR_BLUE
db INDOOR_YELLOW
db INDOOR_BROWN
db INDOOR_LIGHT_BLUE
db CRYS_TEXTBOX

; MUSEUM
MuseumPalSet:
GatePalSet:
db INDOOR_GRAY
db INDOOR_RED
db INDOOR_GREEN
Expand All @@ -112,47 +103,7 @@ MapPaletteSets:
db INDOOR_LIGHT_BLUE
db ALT_TEXTBOX_PAL ; Uses variant of textbox palette for skeleton pokemon

; UNDERGROUND
db INDOOR_GRAY
db INDOOR_RED
db INDOOR_GREEN
db INDOOR_BLUE
db INDOOR_YELLOW
db INDOOR_BROWN
db INDOOR_LIGHT_BLUE
db CRYS_TEXTBOX

; GATE
db INDOOR_GRAY
db INDOOR_RED
db INDOOR_GREEN
db INDOOR_BLUE
db INDOOR_YELLOW
db INDOOR_BROWN
db INDOOR_LIGHT_BLUE
db ALT_TEXTBOX_PAL ; Uses variant of textbox palette for Articuno binoculars

; SHIP
db INDOOR_GRAY
db INDOOR_RED
db INDOOR_GREEN
db INDOOR_BLUE
db INDOOR_YELLOW
db INDOOR_BROWN
db INDOOR_LIGHT_BLUE
db CRYS_TEXTBOX

; SHIP_PORT
db INDOOR_GRAY
db INDOOR_RED
db INDOOR_GREEN
db INDOOR_BLUE
db INDOOR_YELLOW
db INDOOR_BROWN
db INDOOR_LIGHT_BLUE
db CRYS_TEXTBOX

; CEMETERY
CemeteryPalSet:
db INDOOR_GRAY
db INDOOR_RED
db INDOOR_GREEN
Expand All @@ -162,17 +113,7 @@ MapPaletteSets:
db INDOOR_PURPLE
db CRYS_TEXTBOX

; INTERIOR
db INDOOR_GRAY
db INDOOR_RED
db INDOOR_GREEN
db INDOOR_BLUE
db INDOOR_YELLOW
db INDOOR_BROWN
db INDOOR_LIGHT_BLUE
db PC_POKEBALL_PAL

; CAVERN
CavernPalSet:
db CAVE_GRAY
db CAVE_RED
db CAVE_GREEN
Expand All @@ -181,65 +122,3 @@ MapPaletteSets:
db CAVE_BROWN
db CAVE_LIGHT_BLUE
db CRYS_TEXTBOX

; LOBBY
db INDOOR_GRAY
db INDOOR_RED
db INDOOR_GREEN
db INDOOR_BLUE
db INDOOR_YELLOW
db INDOOR_BROWN
db INDOOR_LIGHT_BLUE
db PC_POKEBALL_PAL

; MANSION
db INDOOR_GRAY
db INDOOR_RED
db INDOOR_GREEN
db INDOOR_BLUE
db INDOOR_YELLOW
db INDOOR_BROWN
db INDOOR_LIGHT_BLUE
db PC_POKEBALL_PAL

; LAB
db INDOOR_GRAY
db INDOOR_RED
db INDOOR_GREEN
db INDOOR_BLUE
db INDOOR_YELLOW
db INDOOR_BROWN
db INDOOR_LIGHT_BLUE
db PC_POKEBALL_PAL

; CLUB
db INDOOR_GRAY
db INDOOR_RED
db INDOOR_GREEN
db INDOOR_BLUE
db INDOOR_YELLOW
db INDOOR_BROWN
db INDOOR_LIGHT_BLUE
db CRYS_TEXTBOX

; FACILITY
db INDOOR_GRAY
db INDOOR_RED
db INDOOR_GREEN
db INDOOR_BLUE
db INDOOR_YELLOW
db INDOOR_BROWN
db INDOOR_LIGHT_BLUE
db CRYS_TEXTBOX

; PLATEAU
db OUTDOOR_GRAY
db OUTDOOR_RED
db OUTDOOR_GREEN
db OUTDOOR_BLUE
db OUTDOOR_YELLOW
db OUTDOOR_BROWN
db OUTDOOR_ROOF
db CRYS_TEXTBOX

assert_table_length NUM_TILESETS
16 changes: 8 additions & 8 deletions color/loadpalettes.asm
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ LoadTilesetPalette:

ld a, b ; Get wCurMapTileset
push af
ld d, 0
ld e, a
sla e
sla e
sla e
ld hl, MapPaletteSets
add hl, de
ld d, h
ld e, l
ld b, 0
ld c, a
add hl, bc
add hl, bc
ld a, [hli]
ld e, a
ld a, [hl]
ld d, a
ld hl, W2_BgPaletteData ; palette data to be copied to wram at hl
ld b, $08
.nextPalette
Expand Down

0 comments on commit a5d389b

Please sign in to comment.