Use CC_BUILD_DUALSCREEN define instead, and fix PSP build to work with latest master commit

This commit is contained in:
UnknownShadow200 2024-02-03 13:15:44 +11:00
parent 164958df36
commit d65fad3836
6 changed files with 13 additions and 18 deletions

View File

@ -287,6 +287,7 @@ typedef cc_uint8 cc_bool;
#define CC_BUILD_LOWMEM
#define CC_BUILD_CONSOLE
#define CC_BUILD_TOUCH
#define CC_BUILD_DUALSCREEN
#undef CC_BUILD_FREETYPE
#elif defined GEKKO
#define CC_BUILD_GCWII

View File

@ -21,7 +21,7 @@
struct _GuiData Gui;
struct Screen* Gui_Screens[GUI_MAX_SCREENS];
static cc_uint8 priorities[GUI_MAX_SCREENS];
#ifdef __3DS__
#ifdef CC_BUILD_DUALSCREEN
static struct Texture touchBgTex;
#endif
@ -34,12 +34,12 @@ static CC_NOINLINE int GetWindowScale(void) {
/* Use larger UI scaling on mobile */
/* TODO move this DPI scaling elsewhere.,. */
#ifndef __3DS__
#ifndef CC_BUILD_DUALSCREEN
if (!Input_TouchMode) {
#endif
widthScale /= DisplayInfo.ScaleX;
heightScale /= DisplayInfo.ScaleY;
#ifndef __3DS__
#ifndef CC_BUILD_DUALSCREEN
}
#endif
return 1 + (int)(min(widthScale, heightScale));
@ -303,7 +303,7 @@ void Gui_RenderGui(double delta) {
enum Screen3DS scr = Window_3DS_SetRenderScreen(BOTTOM_SCREEN);
#ifdef __3DS__
#ifdef CC_BUILD_DUALSCREEN
Texture_Render(&touchBgTex);
#endif
@ -641,7 +641,7 @@ static void OnInit(void) {
TextureEntry_Register(&icons_entry);
TextureEntry_Register(&touch_entry);
#ifdef __3DS__
#ifdef CC_BUILD_DUALSCREEN
struct Context2D ctx;
Context2D_Alloc(&ctx, 32, 32);
Gradient_Noise(&ctx, BitmapColor_RGB(0x40, 0x30, 0x20), 6, 0, 0, ctx.width, ctx.height);

View File

@ -537,7 +537,7 @@ void Launcher_DrawTitle(struct FontDesc* font, const char* text, struct Context2
/* Skip dragging logo when very small window to save space */
if (Window_Main.Height < 240) return;
#ifdef __3DS__
#ifdef CC_BUILD_DUALSCREEN
/* Put title on top screen */
enum Screen3DS scr = Window_3DS_SetRenderScreen(TOP_SCREEN);
struct Bitmap bmp;
@ -555,7 +555,7 @@ void Launcher_DrawTitle(struct FontDesc* font, const char* text, struct Context2
x = ctx->width / 2 - Drawer2D_TextWidth(&args) / 2;
y = 0;
#ifdef __3DS__
#ifdef CC_BUILD_DUALSCREEN
// vertically center the title
y = ctx->height / 2 - Drawer2D_TextHeight(&args) / 2;
#endif
@ -565,7 +565,7 @@ void Launcher_DrawTitle(struct FontDesc* font, const char* text, struct Context2
Drawer2D.Colors['f'] = BITMAPCOLOR_WHITE;
Context2D_DrawText(ctx, &args, x, y);
#ifdef __3DS__
#ifdef CC_BUILD_DUALSCREEN
Window_DrawFramebuffer((Rect2D){ 0, 0, bmp.width, bmp.height });
Window_3DS_SetRenderScreen(scr);
#endif

View File

@ -58,15 +58,15 @@ TimeMS DateTime_CurrentUTC_MS(void) {
}
void DateTime_CurrentLocal(struct DateTime* t) {
pspTime curTime;
ScePspDateTime curTime;
sceRtcGetCurrentClockLocalTime(&curTime);
t->year = curTime.year;
t->month = curTime.month;
t->day = curTime.day;
t->hour = curTime.hour;
t->minute = curTime.minutes;
t->second = curTime.seconds;
t->minute = curTime.minute;
t->second = curTime.second;
}
#define US_PER_SEC 1000000ULL

View File

@ -235,7 +235,7 @@ void GLContext_GetApiInfo(cc_string* info);
#endif
enum Screen3DS { TOP_SCREEN, BOTTOM_SCREEN };
#ifdef __3DS__
#ifdef CC_BUILD_DUALSCREEN
/* Selects which screen on the 3DS to render to. Returns the previous screen */
enum Screen3DS Window_3DS_SetRenderScreen(enum Screen3DS screen);
#else

View File

@ -26,14 +26,8 @@ struct _WindowData Window_Alt;
// * Width/height refer to the physical dimensions of the screen; that is, the top screen
// * is 240 pixels wide and 400 pixels tall; while the bottom screen is 240x320.
void Window_Init(void) {
//gfxInit(GSP_BGR8_OES,GSP_BGR8_OES,false);
//gfxInit(GSP_BGR8_OES,GSP_RGBA8_OES,false);
//gfxInit(GSP_RGBA8_OES, GSP_BGR8_OES, false);
gfxInit(GSP_BGR8_OES, GSP_BGR8_OES, false);
//gfxInit(GSP_RGBA8_OES,GSP_RGBA8_OES,false);
//consoleInit(GFX_BOTTOM, NULL);
u16 width, height;
gfxGetFramebuffer(GFX_TOP, GFX_LEFT, &width, &height);