-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
移植AT32F435运行速度较低 #3
Comments
Title: The transplanted AT32F435 runs slower |
你这是每个像素发?这效率很慢呀,你整屏buff发呢? |
Are you posting every pixel? This efficiency is very slow. How do you apply the buff to the entire screen? |
我现在是每个像素点都发,但是这样的话能够设定好LCD的范围之后,一直发就行了,LCD内部地址会自动递增,而且这样的帧率也是比较稳定的,所需时间和按点来发送的所需时间差距并不是很大。还是说我理解有误,请求大佬给我一点建议 |
I am currently sending every pixel, but in this case, after setting the range of the LCD, I can just send it all the time. The internal address of the LCD will automatically increase, and the frame rate is relatively stable. The time required and the number of clicks are The difference in time required to send is not very big. Or maybe I misunderstood, please give me some advice. |
Tested using previous projects, AT32F435 288M main frequency 72Mspi+dma faster optimization level, 240*240 full screen refresh FPS is 70+ (normal spi driver), |
整块内存发送和你一个像素一个像素发完全不一样,和自增没关系,自增是lcd的驱动形式,按点发送时间相差极大,建议使用整屏+dma驱动 |
Sending the entire memory is completely different from sending it pixel by pixel. It has nothing to do with auto-increment. Auto-increment is the driving mode of LCD. The time of sending by point is very different. It is recommended to use the whole screen + dma driver. |
#define NES_ENABLE_SOUND (0) /* enable sound /
#define NES_USE_SRAM (0) / use SRAM */
#define NES_FRAME_SKIP (0) /* skip frames /
#define NES_COLOR_DEPTH (16) / color depth /
#define NES_COLOR_SWAP (0) / swap color channels /
#define NES_RAM_LACK (0) / lack of RAM */
#define NES_USE_FS (0) /* use file system /
这是目前的配置。
int nes_draw(int x1, int y1, int x2, int y2, nes_color_t color_data){
static unsigned int last_tick = 0;
LCD_Address_Set(50+0,50+0,306-1-0,290-1-0);
LCD_CS_Clr();
LCD_WR_Bus(0x32);
LCD_WR_Bus(0x00);
LCD_WR_Bus(0x3c);
LCD_WR_Bus(0x00);
for (int j = 0; j < 240; j++)
{
for (int i = 0; i < 256; i++)
{
Write_QSPI_Parameter(((((color_data[(j256+i)] << 1) & 0xffe0 )| (color_data[(j256+i)] & 0x001F))>>8)&0xFF);
Write_QSPI_Parameter((((color_data[(j256+i)] << 1) & 0xffe0 )| (color_data[(j256+i)] & 0x001F))&0xFF);
}
}
LCD_CS_Set();
FPS = 1000/(sys_tick-last_tick);
last_tick = sys_tick;
return 0;
}
这是LCD刷新函数和计算FPS函数,没有进行任何的nes_wait。运行后得到FPS只有9
The text was updated successfully, but these errors were encountered: