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

@@ -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"