diff --git a/src/Core.h b/src/Core.h index 439cb5e5e..f095007e8 100644 --- a/src/Core.h +++ b/src/Core.h @@ -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 diff --git a/src/Gui.c b/src/Gui.c index 4824c5039..07dcc1d53 100644 --- a/src/Gui.c +++ b/src/Gui.c @@ -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); diff --git a/src/Launcher.c b/src/Launcher.c index 335ccde6e..e93cc1e11 100644 --- a/src/Launcher.c +++ b/src/Launcher.c @@ -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 diff --git a/src/Platform_PSP.c b/src/Platform_PSP.c index 9df19eabf..9623cfb89 100644 --- a/src/Platform_PSP.c +++ b/src/Platform_PSP.c @@ -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 diff --git a/src/Window.h b/src/Window.h index f5c182a3c..5a9f2e32b 100644 --- a/src/Window.h +++ b/src/Window.h @@ -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 diff --git a/src/Window_3DS.c b/src/Window_3DS.c index 7c49c0855..f3d6707f5 100644 --- a/src/Window_3DS.c +++ b/src/Window_3DS.c @@ -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);