diff options
author | Daniel Harding <33dannye@gmail.com> | 2021-11-15 13:31:15 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-15 13:31:15 -0600 |
commit | f516a91f5fa02a741631c77b9097598f466d1328 (patch) | |
tree | bac2ee5e3fad02983b061580f5c085baecb5439a /src/engine/menus/init_menu.asm | |
parent | 15e986d374fdd11ed0f412fbdc9b858d4c4b9f50 (diff) | |
parent | 1fd16cd27fcd4f432bfc09fc5b7a262798b72430 (diff) |
Some more bank splitting
Diffstat (limited to 'src/engine/menus/init_menu.asm')
-rw-r--r-- | src/engine/menus/init_menu.asm | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/engine/menus/init_menu.asm b/src/engine/menus/init_menu.asm new file mode 100644 index 0000000..3757050 --- /dev/null +++ b/src/engine/menus/init_menu.asm @@ -0,0 +1,46 @@ +; empties screen in preparation to draw some menu +InitMenuScreen: + ld a, $0 + ld [wTileMapFill], a + call EmptyScreen + call LoadSymbolsFont + lb de, $30, $7f + call SetupText + call Set_OBJ_8x8 + xor a + ldh [hSCX], a + ldh [hSCY], a + ld a, [wLCDC] + bit LCDC_ENABLE_F, a + jr nz, .skip_clear_scroll + xor a + ldh [rSCX], a + ldh [rSCY], a +.skip_clear_scroll + call SetDefaultPalettes + call ZeroObjectPositions + ld a, $1 + ld [wVBlankOAMCopyToggle], a + ret + +; saves all pals to SRAM, then fills them with white. +; after flushing, it loads back the saved pals from SRAM. +FlashWhiteScreen: + ldh a, [hBankSRAM] + + push af + ld a, BANK("SRAM1") + call BankswitchSRAM + call CopyPalsToSRAMBuffer + call DisableSRAM + call SetWhitePalettes + call FlushAllPalettes + call EnableLCD + call DoFrameIfLCDEnabled + call LoadPalsFromSRAMBuffer + call FlushAllPalettes + pop af + + call BankswitchSRAM + call DisableSRAM + ret |