mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-12 00:56:40 -04:00
NDS: Launcher renders on bottom screen now
This commit is contained in:
parent
f4913b6415
commit
a74392dbb1
@ -1,8 +1,8 @@
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
#
|
||||
# SPDX-FileContributor: Antonio Niño Díaz, 2023
|
||||
export BLOCKSDS ?= /opt/blocksds/core
|
||||
export BLOCKSDSEXT ?= /opt/blocksds/external
|
||||
export BLOCKSDS ?= /opt/wonderful/thirdparty/blocksds/core
|
||||
export BLOCKSDSEXT ?= /opt/wonderful/thirdparty/blocksds/external
|
||||
|
||||
NAME := ClassiCube
|
||||
GAME_TITLE := ClassiCube
|
||||
|
@ -18,6 +18,9 @@
|
||||
#include <nds/system.h>
|
||||
#include <fat.h>
|
||||
|
||||
#define LAYER_CON 0
|
||||
#define LAYER_KB 1
|
||||
|
||||
|
||||
/*########################################################################################################################*
|
||||
*----------------------------------------------------Onscreen console-----------------------------------------------------*
|
||||
@ -117,9 +120,9 @@ static void consoleLoadFont(int bgId, u16* palette) {
|
||||
static void consoleInit(cc_bool onSub) {
|
||||
int bgId;
|
||||
if (onSub) {
|
||||
bgId = bgInitSub(0, BgType_Text4bpp, BgSize_T_256x256, 22, 2);
|
||||
bgId = bgInitSub(LAYER_CON, BgType_Text4bpp, BgSize_T_256x256, 22, 2);
|
||||
} else {
|
||||
bgId = bgInit( 0, BgType_Text4bpp, BgSize_T_256x256, 22, 2);
|
||||
bgId = bgInit( LAYER_CON, BgType_Text4bpp, BgSize_T_256x256, 22, 2);
|
||||
}
|
||||
|
||||
consoleLoadFont(bgId, onSub ? BG_PALETTE_SUB : BG_PALETTE);
|
||||
@ -141,10 +144,16 @@ static void SetupVideo(cc_bool mode) {
|
||||
if (launcherMode == mode) return;
|
||||
launcherMode = mode;
|
||||
|
||||
vramSetBankA(VRAM_A_LCD);
|
||||
vramSetBankB(VRAM_B_LCD);
|
||||
vramSetBankC(VRAM_C_LCD);
|
||||
vramSetBankD(VRAM_D_LCD);
|
||||
vramSetBankH(VRAM_H_LCD);
|
||||
vramSetBankI(VRAM_I_LCD);
|
||||
|
||||
if (launcherMode) {
|
||||
videoSetModeSub(MODE_0_2D);
|
||||
vramSetBankH(VRAM_H_SUB_BG);
|
||||
vramSetBankI(VRAM_I_SUB_BG_0x06208000);
|
||||
videoSetModeSub(MODE_5_2D);
|
||||
vramSetBankC(VRAM_C_SUB_BG);
|
||||
|
||||
videoSetMode(MODE_5_2D);
|
||||
vramSetBankA(VRAM_A_MAIN_BG);
|
||||
@ -156,7 +165,7 @@ static void SetupVideo(cc_bool mode) {
|
||||
videoSetMode(MODE_0_3D);
|
||||
}
|
||||
|
||||
consoleInit(true);
|
||||
consoleInit(!launcherMode);
|
||||
}
|
||||
|
||||
void Window_PreInit(void) {
|
||||
@ -186,7 +195,7 @@ void Window_Free(void) { }
|
||||
|
||||
void Window_Create2D(int width, int height) {
|
||||
SetupVideo(true);
|
||||
bg_id = bgInit(2, BgType_Bmp16, BgSize_B16_256x256, 2, 0);
|
||||
bg_id = bgInitSub(2, BgType_Bmp16, BgSize_B16_256x256, 2, 0);
|
||||
bg_ptr = bgGetGfxPtr(bg_id);
|
||||
}
|
||||
|
||||
@ -330,11 +339,12 @@ static void OnKeyPressed(int key) {
|
||||
|
||||
void OnscreenKeyboard_Open(struct OpenKeyboardArgs* args) {
|
||||
Keyboard* kbd = keyboardGetDefault();
|
||||
videoBgDisableSub(0); // hide console
|
||||
if (!launcherMode) videoBgDisableSub(LAYER_CON);
|
||||
|
||||
keyboardInit(kbd, 3, BgType_Text4bpp, BgSize_T_256x512,
|
||||
keyboardInit(kbd, LAYER_KB, BgType_Text4bpp, BgSize_T_256x512,
|
||||
14, 0, false, true);
|
||||
keyboardShow();
|
||||
bgSetPriority(4 + LAYER_KB, BG_PRIORITY_0);
|
||||
|
||||
kbd->OnKeyPressed = OnKeyPressed;
|
||||
String_InitArray(kbText, kbBuffer);
|
||||
@ -349,7 +359,7 @@ void OnscreenKeyboard_Close(void) {
|
||||
if (!DisplayInfo.ShowingSoftKeyboard) return;
|
||||
DisplayInfo.ShowingSoftKeyboard = false;
|
||||
|
||||
videoBgEnableSub(0); // show console
|
||||
if (!launcherMode) videoBgEnableSub(LAYER_CON);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user