File tree Expand file tree Collapse file tree 4 files changed +7
-12
lines changed
abstract-machine/am/src/platform/sim/ioe Expand file tree Collapse file tree 4 files changed +7
-12
lines changed Original file line number Diff line number Diff line change @@ -33,9 +33,7 @@ void __am_gpu_fbdraw(AM_GPU_FBDRAW_T *ctl) {
3333 volatile uint32_t * dst = fb + screen_w * y + x ; // dst 指向显存
3434 uint32_t * src = pixels ;
3535 for (size_t i = 0 ; i < h ; i ++ ) { // 逐行复制
36- for (size_t j = 0 ; j < w ; j ++ ) {
37- dst [j ] = src [j ];
38- }
36+ for (size_t j = 0 ; j < w ; j ++ ) { dst [j ] = src [j ]; }
3937 dst += screen_w ;
4038 src += w ;
4139 }
Original file line number Diff line number Diff line change @@ -53,8 +53,10 @@ void __am_audio_init();
5353#endif
5454
5555bool ioe_init () {
56- for (int i = 0 ; i < LENGTH (lut ); i ++ )
57- if (!lut [i ]) lut [i ] = fail ;
56+ for (int i = 0 ; i < LENGTH (lut ); i ++ ) { // init
57+ if (!lut [i ]) { lut [i ] = fail ; }
58+ }
59+
5860 __am_timer_init ();
5961#ifdef PLATFORM_NEMU
6062 __am_gpu_init ();
Original file line number Diff line number Diff line change @@ -152,8 +152,7 @@ static void execute(uint64_t n) {
152152
153153 g_nr_guest_inst ++ ;
154154 trace_and_difftest (& s , cpu .pc );
155- if (nemu_state .state != NEMU_RUNNING )
156- break ;
155+ if (nemu_state .state != NEMU_RUNNING ) { break ; }
157156 IFDEF (CONFIG_DEVICE , device_update ());
158157 }
159158}
Original file line number Diff line number Diff line change @@ -36,13 +36,9 @@ void vga_update_screen();
3636void device_update () {
3737 static uint64_t last = 0 ;
3838 uint64_t now = get_time ();
39- if ( likely ( now - last < 1000000 / TIMER_HZ ) ) {
40- return ;
41- }
39+ if ( likely ( now - last < 1000000 / TIMER_HZ ) ) { return ; }
4240 last = now ;
43-
4441 IFDEF (CONFIG_HAS_VGA , vga_update_screen ());
45-
4642#ifndef CONFIG_TARGET_AM
4743 SDL_Event event ;
4844 while (SDL_PollEvent (& event )) {
You can’t perform that action at this time.
0 commit comments