[文]SkyEye中LCD和TouchScreen的仿真实现
有关SkyEye中LCD和TouchScreen的仿真实现,以及MiniGUI在SkyEye上的移植介绍。可到如下处下载
http://download.gro.clinux.org/skyeye/SkyEyelcdtouchscreen4gro.pdf
有关SkyEye的内部实现文档
http://download.gro.clinux.org/skyeye/skyeyeinternal-0.6.8.pdf 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.read_byte = vid_read_byte; mb.write_byte = vid_write_byte;
mb.read_halfword = vid_read_halfword;
mb.read_halfword = vid_read_halfword;
mb.write_halfword = vid_write_halfword;
mb.read_word = vid_read_word; mb.write_word = vid_write_word;
mb.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 如上的改动,
设置的显示内存是静态配置的,并不理想..
晚上又看了一下代码,其实不用如此麻烦,上面的a)b)没有用处.
如下0.8代码:
real_write_XXX()
if((!skyeye_config.no_lcd) && *(state->mach_io.lcd_is_enable) && addr >= *(state->mach_io.lcd_addr_begin) && addr <= *(state->mach_io.lcd_addr_end)){
//fprintf(stderr, "SKYEYE,lcd enabledwrite byte lcd memory addr %x, data %x\n",addr,*temp);
//skyeye_config.mach->mach_lcd_write(state,addr,*temp);
lcd_changed = 1;
}
就可以了 有道理,谢谢!
页:
[1]