恢复最初的功能

This commit is contained in:
anod 2022-10-19 21:09:09 +08:00
parent e8daf9aede
commit c7aef7cc82
2 changed files with 6 additions and 5 deletions

View File

@ -2,6 +2,7 @@
#include "arm11/acf.h" #include "arm11/acf.h"
#include "arm11/fmt.h" #include "arm11/fmt.h"
#include "arm11/drivers/hid.h" #include "arm11/drivers/hid.h"
#include "arm11/console.h"
#include "drivers/gfx.h" #include "drivers/gfx.h"
#define TITLE_MAX 8 #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; if( b == 0 ) return;
int *draw_data = data; int *draw_data = data;
u16 *frame = GFX_getFramebuffer(SCREEN_BOT); u16 *frame = consoleGet()->frameBuffer;
int x = tx + draw_data[0]; int x = tx + draw_data[0];
int y = ty + draw_data[1]; 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() 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( 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 ); 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 ) if( x < 0 || y < 0 || x+w >= WINDOW_WIDTH || y+h >=WINDOW_HEIGHT )
return; 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) ); for( int i=0; i < w; i++ ) memset( location + WINDOW_HEIGHT*(i+x) + (WINDOW_HEIGHT-1-y-h), 0, h*sizeof(u16) );
} }

View File

@ -681,8 +681,8 @@ static void gbaGfxHandler(void *args)
// 但是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
// 现在右边加上8是2|2/3个像素 // 现在右边加上8是2|2/3个像素
GX_displayTransfer((u32*)(0x18180000 + 16*240*3 + 48), 368u<<16 | 240u, GX_displayTransfer((u32*)(0x18180000 + 16*240*3), 368u<<16 | 240u,
GFX_getFramebuffer(SCREEN_TOP) + 16*240*3 + 160, 368u<<16 | 240u, 1u<<12 | 1u<<8); 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, 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); GFX_getFramebuffer(SCREEN_TOP) + 16*240*3, 368u<<16 | 240u, 1u<<12 | 1u<<8);