diff --git a/abstract-machine/am/src/platform/nemu/ioe/gpu.c b/abstract-machine/am/src/platform/nemu/ioe/gpu.c index 7063e85..9cc28d6 100644 --- a/abstract-machine/am/src/platform/nemu/ioe/gpu.c +++ b/abstract-machine/am/src/platform/nemu/ioe/gpu.c @@ -31,10 +31,12 @@ void __am_gpu_config(AM_GPU_CONFIG_T *cfg) { void __am_gpu_fbdraw(AM_GPU_FBDRAW_T *ctl) { GET_W(w); - unsigned char* fb_addr = (unsigned char*)FB_ADDR; + uint32_t* fb_addr = (uint32_t*)FB_ADDR; for (int i = 0; i < ctl->h; i++) { for (int j = 0; j < ctl->w; j++) { - outl((uintptr_t)(fb_addr + 4 * ((ctl->y + i) * w + (ctl->x + j))), ((uint32_t*)ctl->pixels)[w * i + j]); + outl((uintptr_t)(fb_addr + + ((ctl->y + i) * w + (ctl->x + j))), + ((uint32_t*)ctl->pixels)[w * i + j]); } } if (ctl->sync) {