试试使用下屏作为显示

This commit is contained in:
anod 2022-10-19 18:09:05 +08:00
parent fe386988ff
commit 019b1501c9

View File

@ -675,17 +675,19 @@ static void gbaGfxHandler(void *args)
// 地址0x18180000保存的是360x240大小的贴图数据rgb888(序列:↑↘↑) // 地址0x18180000保存的是360x240大小的贴图数据rgb888(序列:↑↘↑)
// 地址0x18200000保存的是512x512大小的GBA的240x160贴图数据(序列:→↙→) // 地址0x18200000保存的是512x512大小的GBA的240x160贴图数据(序列:→↙→)
// 所以GPU做的事情就是将18200000的数据逆时针旋转90° // 所以GPU做的事情就是将18200000的数据逆时针旋转90°
int src_offset = 16*240*3; int src = 16*240*3;
int dst_offset = src_offset; int dst_offset = src_offset;
if( g_oafConfig.scaler == 0 ) if( g_oafConfig.scaler == 0 )
{ {
int base_offset = 120; // 3ds高240, gba高160居中需要平移40个像素rgb888每个像素3字节共120字节 int base_offset = 120; // 3ds高240, gba高160居中需要平移40个像素rgb888每个像素3字节共120字节
// 但是gpu的transfer engine只支持16字节对齐的地址。现在需要 // 但是gpu的transfer engine只支持16字节对齐的地址。现在需要
// 0x18180000 <----------> screen_top + 16*240*3 + 120 是正确对准左边对16求余为0右边为8 // 0x18180000 <----------> screen_top + 16*240*3 + 120 是正确对准左边对16求余为0右边为8
dst_offset += 144; // 现在右边加上8是2|2/3个像素
GX_displayTransfer((u32*)(0x18180000 + 24*240*3), 300u<<16 | 240u,
GFX_getFramebuffer(SCREEN_BOT) + 40*3, 300u<<16 | 240u, 2u<<12 | 1u<<8);
} }
GX_displayTransfer((u32*)(0x18180000 + src_offset), 368u<<16 | 240u, else GX_displayTransfer((u32*)(0x18180000 + 16*240*3), 368u<<16 | 240u,
GFX_getFramebuffer(SCREEN_TOP) + dst_offset, 368u<<16 | 240u, 1u<<12 | 1u<<8); GFX_getFramebuffer(SCREEN_TOP) + 16*240*3, 368u<<16 | 240u, 1u<<12 | 1u<<8);
GFX_waitForPPF(); GFX_waitForPPF();
GFX_swapFramebufs(); GFX_swapFramebufs();