From c7aef7cc824c9201b78af7aedad3debc21454ff0 Mon Sep 17 00:00:00 2001 From: anod <182859762@qq.com> Date: Wed, 19 Oct 2022 21:09:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=81=A2=E5=A4=8D=E6=9C=80=E5=88=9D=E7=9A=84?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/arm11/atp.c | 7 ++++--- source/arm11/open_agb_firm.c | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/source/arm11/atp.c b/source/arm11/atp.c index cafedad..951302d 100644 --- a/source/arm11/atp.c +++ b/source/arm11/atp.c @@ -2,6 +2,7 @@ #include "arm11/acf.h" #include "arm11/fmt.h" #include "arm11/drivers/hid.h" +#include "arm11/console.h" #include "drivers/gfx.h" #define TITLE_MAX 8 @@ -30,7 +31,7 @@ static void set_screen_color( acf_callerdata_t data, acf_position_t tx, acf_posi if( b == 0 ) return; int *draw_data = data; - u16 *frame = GFX_getFramebuffer(SCREEN_BOT); + u16 *frame = consoleGet()->frameBuffer; int x = tx + draw_data[0]; int y = ty + draw_data[1]; @@ -77,7 +78,7 @@ const char *acf_put_text(int x, int y, int width, int height, int maxwidth, u8 c static void screen_clean() { - memset(GFX_getFramebuffer(SCREEN_BOT), 0, WINDOW_WIDTH*WINDOW_HEIGHT*sizeof(uint16_t)); + memset(consoleGet()->frameBuffer, 0, WINDOW_WIDTH*WINDOW_HEIGHT*sizeof(uint16_t)); if( ta[0] ) acf_put_text( 5, 215, WINDOW_WIDTH, WINDOW_HEIGHT, WINDOW_WIDTH-10, ATP_COLOR_CYAN, ATP_PLACEMENT_LEFT, ta ); if( tb[0] ) acf_put_text( 5, 215, WINDOW_WIDTH, WINDOW_HEIGHT, WINDOW_WIDTH-10, ATP_COLOR_CYAN, ATP_PLACEMENT_RIGHT, tb ); } @@ -87,7 +88,7 @@ static void screen_clean_zone( int x, int y, int w, int h ) if( x < 0 || y < 0 || x+w >= WINDOW_WIDTH || y+h >=WINDOW_HEIGHT ) return; - int location= GFX_getFramebuffer(SCREEN_BOT); + int location= consoleGet()->frameBuffer; for( int i=0; i < w; i++ ) memset( location + WINDOW_HEIGHT*(i+x) + (WINDOW_HEIGHT-1-y-h), 0, h*sizeof(u16) ); } diff --git a/source/arm11/open_agb_firm.c b/source/arm11/open_agb_firm.c index 5f231a7..5db6a37 100644 --- a/source/arm11/open_agb_firm.c +++ b/source/arm11/open_agb_firm.c @@ -681,8 +681,8 @@ static void gbaGfxHandler(void *args) // 但是,gpu的transfer engine只支持16字节对齐的地址。现在需要 // 0x18180000 <----------> screen_top + 16*240*3 + 120 是正确对准,左边对16求余为0,右边为8 // 现在右边加上8,是2|2/3个像素 - GX_displayTransfer((u32*)(0x18180000 + 16*240*3 + 48), 368u<<16 | 240u, - GFX_getFramebuffer(SCREEN_TOP) + 16*240*3 + 160, 368u<<16 | 240u, 1u<<12 | 1u<<8); + GX_displayTransfer((u32*)(0x18180000 + 16*240*3), 368u<<16 | 240u, + GFX_getFramebuffer(SCREEN_TOP) + 16*240*3, 368u<<16 | 240u, 1u<<12 | 1u<<8); } else GX_displayTransfer((u32*)(0x18180000 + 16*240*3), 368u<<16 | 240u, GFX_getFramebuffer(SCREEN_TOP) + 16*240*3, 368u<<16 | 240u, 1u<<12 | 1u<<8);