Level selection menu: placeholder grahpics and cgb layout (#12)

This commit is contained in:
xCrystal 2023-08-18 20:19:34 +02:00
parent d7ce3b27ab
commit fe4b54cece
17 changed files with 377 additions and 11 deletions

View File

@ -181,7 +181,7 @@ pushc
charmap "\r", $0d
popc
; Special tiles
; Significant tile equivalences
DEF OVERWORLD_FRAME_FIRST_TILE EQU "┌"
DEF BOARD_MENU_BG_FIRST_TILE EQU "A"
DEF BOARD_MENU_OAM_FIRST_TILE EQU BOARD_MENU_BG_FIRST_TILE + 18 * 3

View File

@ -13,7 +13,7 @@
const CGB_PARTY_MENU
const CGB_EVOLUTION
const CGB_GS_TITLE_SCREEN
const CGB_0D
const CGB_LEVEL_SELECTION_MENU
const CGB_MOVE_LIST
const CGB_BETA_PIKACHU_MINIGAME
const CGB_POKEDEX_SEARCH_OPTION

View File

@ -38,7 +38,7 @@ CGBLayoutJumptable:
dw _CGB_PartyMenu
dw _CGB_Evolution
dw _CGB_GSTitleScreen
dw _CGB_Unused0D
dw _CGB_LevelSelectionMenu
dw _CGB_MoveList
dw _CGB_BetaPikachuMinigame
dw _CGB_PokedexSearchOption
@ -570,11 +570,61 @@ _CGB_GSTitleScreen:
ldh [hCGBPalUpdate], a
ret
_CGB_Unused0D:
ld hl, FourPals_Diploma
call CopyFourPalettes
call WipeAttrmap
_CGB_LevelSelectionMenu:
; load daytime-based player sprite pals (male and female)
ld a, [wTimeOfDay]
maskbits NUM_DAYTIMES
ld bc, 8 palettes
ld hl, MapObjectPals
call AddNTimes
ld de, wOBPals1
ld bc, 2 palettes
ld a, BANK(wOBPals1)
call FarCopyWRAM
; load daytime and gender-based background pals
ld a, [wPlayerGender]
bit PLAYERGENDER_FEMALE_F, a
jr z, .male
ld hl, LevelSelectionMenuFemalePals
jr .got_pals
.male
ld hl, LevelSelectionMenuMalePals
.got_pals
ld a, [wTimeOfDay]
maskbits NUM_DAYTIMES
ld bc, 6 palettes
call AddNTimes
ld de, wBGPals1
ld bc, 6 palettes
ld a, BANK(wBGPals1)
call FarCopyWRAM
; assign attrs based on tile ids according to LevelSelectionMenuAttrmap
hlcoord 0, 0
decoord 0, 0, wAttrmap
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
.loop
push hl
ld a, [hl] ; tile id
ld hl, LevelSelectionMenuAttrmap
add l
ld l, a
ld a, h
adc 0
ld h, a
ld a, [hl] ; attr value
ld [de], a
pop hl
inc hl
inc de
dec bc
ld a, b
or c
jr nz, .loop
; apply pals and attrmap
call ApplyAttrmap
call ApplyPals
ld a, TRUE
ldh [hCGBPalUpdate], a
ret
_CGB_UnownPuzzle:

View File

@ -811,3 +811,16 @@ INCLUDE "gfx/beta_poker/beta_poker.pal"
SlotMachinePals:
INCLUDE "gfx/slots/slots.pal"
LevelSelectionMenuMalePals:
table_width PAL_COLOR_SIZE * 4 * 6, LevelSelectionMenuMalePals
INCLUDE "gfx/level_selection_menu/background_male.pal"
assert_table_length NUM_DAYTIMES
LevelSelectionMenuFemalePals:
table_width PAL_COLOR_SIZE * 4 * 6, LevelSelectionMenuFemalePals
INCLUDE "gfx/level_selection_menu/background_female.pal"
assert_table_length NUM_DAYTIMES
LevelSelectionMenuAttrmap:
INCLUDE "gfx/level_selection_menu/attrmap.asm"

View File

@ -376,8 +376,6 @@ FinishContinueFunction:
ld hl, wGameTimerPaused
set GAME_TIMER_PAUSED_F, [hl]
res GAME_TIMER_MOBILE_F, [hl]
ld hl, wEnteredMapFromContinue
set 1, [hl]
farcall OverworldLoop
ld a, [wSpawnAfterChampion]
cp SPAWN_LEVEL_1

View File

@ -0,0 +1,14 @@
LevelSelectionMenuGFX:
INCBIN "gfx/level_selection_menu/background.2bpp.lz"
LevelSelectionMenuPage1Tilemap:
INCBIN "gfx/level_selection_menu/page_1.tilemap"
LevelSelectionMenuPage2Tilemap:
INCBIN "gfx/level_selection_menu/page_2.tilemap"
LevelSelectionMenuPage3Tilemap:
INCBIN "gfx/level_selection_menu/page_3.tilemap"
LevelSelectionMenuPage4Tilemap:
INCBIN "gfx/level_selection_menu/page_4.tilemap"

View File

@ -0,0 +1,22 @@
DEF PAL_LEVELSELECTIONMENU_BORDER EQU 0 | 1 << OAM_PRIORITY
const_def 1
const PAL_LEVELSELECTIONMENU_EARTH ; 1
const PAL_LEVELSELECTIONMENU_MOUNTAIN ; 2
const PAL_LEVELSELECTIONMENU_CITY ; 3
const PAL_LEVELSELECTIONMENU_POI ; 4
const PAL_LEVELSELECTIONMENU_POI_MTN ; 5
MACRO levelselectionmenupals
rept _NARG
db PAL_LEVELSELECTIONMENU_\1
shift
endr
ENDM
; gfx/level_selection_menu/background.png
levelselectionmenupals EARTH, EARTH, EARTH, MOUNTAIN, MOUNTAIN, MOUNTAIN, BORDER, BORDER
levelselectionmenupals EARTH, EARTH, CITY, EARTH, POI, POI_MTN, POI, POI_MTN
levelselectionmenupals EARTH, EARTH, EARTH, MOUNTAIN, MOUNTAIN, MOUNTAIN, BORDER, BORDER
levelselectionmenupals EARTH, EARTH, EARTH, EARTH, EARTH, BORDER, BORDER, BORDER
levelselectionmenupals EARTH, EARTH, EARTH, MOUNTAIN, MOUNTAIN, MOUNTAIN, BORDER, BORDER
levelselectionmenupals BORDER, BORDER, BORDER, BORDER, BORDER, BORDER, BORDER, BORDER

Binary file not shown.

After

Width:  |  Height:  |  Size: 885 B

View File

@ -0,0 +1,131 @@
; morn
; border
RGB 28, 31, 20
RGB 21, 21, 21
RGB 13, 13, 13
RGB 00, 00, 00
; earth
RGB 28, 31, 20
RGB 00, 31, 00
RGB 00, 00, 31
RGB 00, 00, 00
; mountain
RGB 28, 31, 20
RGB 00, 31, 00
RGB 15, 07, 00
RGB 00, 00, 00
; city (girl)
RGB 28, 31, 20
RGB 10, 18, 31
RGB 13, 06, 31
RGB 00, 00, 00
; point of interest
RGB 28, 31, 20
RGB 00, 31, 00
RGB 00, 00, 31
RGB 31, 00, 00
; mountain point of interest
RGB 28, 31, 20
RGB 00, 31, 00
RGB 15, 07, 00
RGB 31, 00, 00
; day (original)
; border
RGB 28, 31, 20
RGB 21, 21, 21
RGB 13, 13, 13
RGB 00, 00, 00
; earth
RGB 28, 31, 20
RGB 00, 31, 00
RGB 00, 00, 31
RGB 00, 00, 00
; mountain
RGB 28, 31, 20
RGB 00, 31, 00
RGB 15, 07, 00
RGB 00, 00, 00
; city (girl)
RGB 28, 31, 20
RGB 10, 18, 31
RGB 13, 06, 31
RGB 00, 00, 00
; point of interest
RGB 28, 31, 20
RGB 00, 31, 00
RGB 00, 00, 31
RGB 31, 00, 00
; mountain point of interest
RGB 28, 31, 20
RGB 00, 31, 00
RGB 15, 07, 00
RGB 31, 00, 00
; nite
; border
RGB 28, 31, 20
RGB 21, 21, 21
RGB 13, 13, 13
RGB 00, 00, 00
; earth
RGB 28, 31, 20
RGB 00, 31, 00
RGB 00, 00, 31
RGB 00, 00, 00
; mountain
RGB 28, 31, 20
RGB 00, 31, 00
RGB 15, 07, 00
RGB 00, 00, 00
; city (girl)
RGB 28, 31, 20
RGB 10, 18, 31
RGB 13, 06, 31
RGB 00, 00, 00
; point of interest
RGB 28, 31, 20
RGB 00, 31, 00
RGB 00, 00, 31
RGB 31, 00, 00
; mountain point of interest
RGB 28, 31, 20
RGB 00, 31, 00
RGB 15, 07, 00
RGB 31, 00, 00
; eve
; border
RGB 28, 31, 20
RGB 21, 21, 21
RGB 13, 13, 13
RGB 00, 00, 00
; earth
RGB 28, 31, 20
RGB 00, 31, 00
RGB 00, 00, 31
RGB 00, 00, 00
; mountain
RGB 28, 31, 20
RGB 00, 31, 00
RGB 15, 07, 00
RGB 00, 00, 00
; city (girl)
RGB 28, 31, 20
RGB 10, 18, 31
RGB 13, 06, 31
RGB 00, 00, 00
; point of interest
RGB 28, 31, 20
RGB 00, 31, 00
RGB 00, 00, 31
RGB 31, 00, 00
; mountain point of interest
RGB 28, 31, 20
RGB 00, 31, 00
RGB 15, 07, 00
RGB 31, 00, 00

View File

@ -0,0 +1,131 @@
; morn
; border
RGB 28, 31, 20
RGB 21, 21, 21
RGB 13, 13, 13
RGB 00, 00, 00
; earth
RGB 28, 31, 20
RGB 00, 31, 00
RGB 00, 00, 31
RGB 00, 00, 00
; mountain
RGB 28, 31, 20
RGB 00, 31, 00
RGB 15, 07, 00
RGB 00, 00, 00
; city (boy)
RGB 28, 31, 20
RGB 31, 15, 00
RGB 15, 07, 00
RGB 00, 00, 00
; point of interest
RGB 28, 31, 20
RGB 00, 31, 00
RGB 00, 00, 31
RGB 31, 00, 00
; mountain point of interest
RGB 28, 31, 20
RGB 00, 31, 00
RGB 15, 07, 00
RGB 31, 00, 00
; day (original)
; border
RGB 28, 31, 20
RGB 21, 21, 21
RGB 13, 13, 13
RGB 00, 00, 00
; earth
RGB 28, 31, 20
RGB 00, 31, 00
RGB 00, 00, 31
RGB 00, 00, 00
; mountain
RGB 28, 31, 20
RGB 00, 31, 00
RGB 15, 07, 00
RGB 00, 00, 00
; city (boy)
RGB 28, 31, 20
RGB 31, 15, 00
RGB 15, 07, 00
RGB 00, 00, 00
; point of interest
RGB 28, 31, 20
RGB 00, 31, 00
RGB 00, 00, 31
RGB 31, 00, 00
; mountain point of interest
RGB 28, 31, 20
RGB 00, 31, 00
RGB 15, 07, 00
RGB 31, 00, 00
; nite
; border
RGB 28, 31, 20
RGB 21, 21, 21
RGB 13, 13, 13
RGB 00, 00, 00
; earth
RGB 28, 31, 20
RGB 00, 31, 00
RGB 00, 00, 31
RGB 00, 00, 00
; mountain
RGB 28, 31, 20
RGB 00, 31, 00
RGB 15, 07, 00
RGB 00, 00, 00
; city (boy)
RGB 28, 31, 20
RGB 31, 15, 00
RGB 15, 07, 00
RGB 00, 00, 00
; point of interest
RGB 28, 31, 20
RGB 00, 31, 00
RGB 00, 00, 31
RGB 31, 00, 00
; mountain point of interest
RGB 28, 31, 20
RGB 00, 31, 00
RGB 15, 07, 00
RGB 31, 00, 00
; eve
; border
RGB 28, 31, 20
RGB 21, 21, 21
RGB 13, 13, 13
RGB 00, 00, 00
; earth
RGB 28, 31, 20
RGB 00, 31, 00
RGB 00, 00, 31
RGB 00, 00, 00
; mountain
RGB 28, 31, 20
RGB 00, 31, 00
RGB 15, 07, 00
RGB 00, 00, 00
; city (boy)
RGB 28, 31, 20
RGB 31, 15, 00
RGB 15, 07, 00
RGB 00, 00, 00
; point of interest
RGB 28, 31, 20
RGB 00, 31, 00
RGB 00, 00, 31
RGB 31, 00, 00
; mountain point of interest
RGB 28, 31, 20
RGB 00, 31, 00
RGB 15, 07, 00
RGB 31, 00, 00

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -79,6 +79,8 @@ ROMX $14
"Unused Egg Pic"
ROMX $15
"Map Scripts 1"
ROMX $1d
"Level Selection Menu"
ROMX $1e
"Board 1"
ROMX $20

View File

@ -232,6 +232,12 @@ INCLUDE "data/pokemon/base_stats.asm"
INCLUDE "data/pokemon/names.asm"
INCLUDE "data/pokemon/unused_pic_banks.asm"
SECTION "Level Selection Menu", ROMX
INCLUDE "engine/menus/level_selection_menu.asm"
SECTION "Board 1", ROMX
INCLUDE "engine/board/menu.asm"

View File

@ -2243,6 +2243,7 @@ wPlayerGender::
db
wSavedAtLeastOnce:: db
wSaveFileInOverworld:: db
wSpawnAfterChampion:: db
; init time set at newgame
@ -2286,8 +2287,6 @@ wObjectMasks:: ds NUM_OBJECTS
wVariableSprites:: ds $100 - SPRITE_VARS
wEnteredMapFromContinue:: db
wTimeOfDayPal:: db
wTimeOfDayPalFlags:: db
wTimeOfDayPalset:: db