|
发表于 2004-8-14 17:11:09
|
显示全部楼层
0)引:
今天看了skyeye0.8有关lcd实现的部分代码和文档.
感觉,还是0.8有点问题.
就象文档说的定时刷新,就会消耗时间.
其实在某些非动画场合下,是不需要这些无用操作的.
而文档中介绍的两种方法其实可以结合起来,取长补短.
1)思路:
实际上引入显存的概念,就可以了.
即内存写时,如果是显存的bank,
就设置全局变量lcd_changed = 1;
而在定时刷新redraw()中,
检查lcd_changed,0则不刷.
2)操作:
今天在0.8上我简单作了些改动,采用如下方法:
a)引入mem_bank: map=V, type=RW, addr=0xc0000000, size=0x09600
在skyeye.conf中.
do_mem_bank_option()中加入
}else if (!strcmp("V", value)) {
mb[num].read_byte = vid_read_byte; mb[num].write_byte = vid_write_byte;
mb[num].read_halfword = vid_read_halfword;
mb[num].read_halfword = vid_read_halfword;
mb[num].write_halfword = vid_write_halfword;
mb[num].read_word = vid_read_word; mb[num].write_word = vid_write_word;
mb[num].type=MEMTYPE_VID; }
b)在armmem.c中加入
void vid_write_byte(ARMul_State *state, ARMword addr, ARMword data)
{
lcd_changed = 1;
real_write_byte(state, addr, data);
}
void vid_write_halfword(ARMul_State *state, ARMword addr, ARMword data)
{
lcd_changed = 1;
real_write_halfword(state, addr, data);
}
void vid_write_word(ARMul_State *state, ARMword addr, ARMword data)
{
lcd_changed = 1;
real_write_word(state, addr, data);
}
c)skyeye_lcd.c |
|