Gotta go fast!
This commit is contained in:
parent
b4e85b87be
commit
332694aa10
4 changed files with 24 additions and 17 deletions
|
|
@ -29,7 +29,6 @@ include("${DEVKITPRO}/cmake/3DS.cmake")
|
|||
# LVGL
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
cmake_policy(SET CMP0077 NEW)
|
||||
#set(LV_CONF_INCLUDE_SIMPLE ON)
|
||||
#set(LV_BUILD_CONF_PATH ./include/lv_conf.h)
|
||||
set(CONFIG_LV_BUILD_EXAMPLES OFF)
|
||||
|
|
|
|||
|
|
@ -25,12 +25,25 @@ extern "C" {
|
|||
* DEFINES
|
||||
*********************/
|
||||
|
||||
// TODO: make it configurable for RGB888/RGB565
|
||||
// (currently hardcoded to ARGB888, otherwise I was getting only white screen)
|
||||
#define CTR_LV_COLOR_FORMAT LV_COLOR_FORMAT_ARGB8888
|
||||
#define CTR_TEX_COLOR_FORMAT GPU_RGBA8
|
||||
#define CTR_TR_IN_COLOR_FORMAT GX_TRANSFER_FMT_RGBA8
|
||||
#define CTR_TR_OUT_COLOR_FORMAT GX_TRANSFER_FMT_RGBA8
|
||||
#if LV_COLOR_DEPTH == 32
|
||||
// same as 24-bit - translation from ARGB8888 to RGBA8888 would require software translation
|
||||
#define CTR_LV_COLOR_FORMAT LV_COLOR_FORMAT_RGB888
|
||||
#define CTR_TEX_COLOR_FORMAT GPU_RGB8
|
||||
#define CTR_TR_IN_COLOR_FORMAT GX_TRANSFER_FMT_RGB8
|
||||
#define CTR_TR_OUT_COLOR_FORMAT GX_TRANSFER_FMT_RGB8
|
||||
#elif LV_COLOR_DEPTH == 24
|
||||
#define CTR_LV_COLOR_FORMAT LV_COLOR_FORMAT_RGB888
|
||||
#define CTR_TEX_COLOR_FORMAT GPU_RGB8
|
||||
#define CTR_TR_IN_COLOR_FORMAT GX_TRANSFER_FMT_RGB8
|
||||
#define CTR_TR_OUT_COLOR_FORMAT GX_TRANSFER_FMT_RGB8
|
||||
#elif LV_COLOR_DEPTH == 16
|
||||
#define CTR_LV_COLOR_FORMAT LV_COLOR_FORMAT_RGB565
|
||||
#define CTR_TEX_COLOR_FORMAT GPU_RGB565
|
||||
#define CTR_TR_IN_COLOR_FORMAT GX_TRANSFER_FMT_RGB565
|
||||
#define CTR_TR_OUT_COLOR_FORMAT GX_TRANSFER_FMT_RGB565
|
||||
#else
|
||||
#error "Not supported LV_COLOR_DEPTH"
|
||||
#endif
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
#ifndef LV_CONF_H
|
||||
#define LV_CONF_H
|
||||
|
||||
#define LV_COLOR_DEPTH 32
|
||||
#define LV_DEF_REFR_PERIOD 16
|
||||
#define LV_COLOR_DEPTH 16
|
||||
#define LV_USE_OS 0
|
||||
|
||||
#define LV_MEM_SIZE (256U * 1024U)
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ void lv_ctr_disp_init(void)
|
|||
/* Two buffers for double buffering. */
|
||||
buf_1 = linearAlloc(BOTTOM_DISP_BUF_SIZE);
|
||||
buf_2 = linearAlloc(BOTTOM_DISP_BUF_SIZE);
|
||||
lv_display_set_buffers_with_stride(bottom_disp, buf_1, buf_2, BOTTOM_DISP_BUF_SIZE, BOTTOM_DISP_STRIDE, LV_DISPLAY_RENDER_MODE_FULL);
|
||||
lv_display_set_buffers_with_stride(bottom_disp, buf_1, buf_2, BOTTOM_DISP_BUF_SIZE, BOTTOM_DISP_STRIDE, LV_DISPLAY_RENDER_MODE_DIRECT);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -143,18 +143,12 @@ static void disp_flush(lv_display_t * disp_drv, const lv_area_t * area, uint8_t
|
|||
GX_TRANSFER_SCALING(GX_TRANSFER_SCALE_NO))
|
||||
);
|
||||
|
||||
// start frame, clear targets
|
||||
C3D_FrameBegin(C3D_FRAME_SYNCDRAW);
|
||||
C2D_TargetClear(bottom_screen, C2D_Color32f(0, 0, 0, 1));
|
||||
C2D_ImageTint tint;
|
||||
C2D_PlainImageTint(&tint, C2D_Color32(255,255,255,255), 1.0f);
|
||||
|
||||
gspWaitForVBlank();
|
||||
C3D_FrameBegin(C3D_FRAME_NONBLOCK);
|
||||
|
||||
C2D_SceneBegin(bottom_screen);
|
||||
|
||||
C2D_Image img = { &tex, &subt3x };
|
||||
C2D_DrawImageAt(img, 0, 0, 0.6f, &tint, 1.f, 1.f);
|
||||
C2D_DrawImageAt(img, 0, 0, 0.6f, NULL, 1.f, 1.f);
|
||||
|
||||
C3D_FrameEnd(0);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue