diff --git a/abstract-machine/am/src/platform/nemu/ioe/gpu.c b/abstract-machine/am/src/platform/nemu/ioe/gpu.c index 9cc28d6..eed7a88 100644 --- a/abstract-machine/am/src/platform/nemu/ioe/gpu.c +++ b/abstract-machine/am/src/platform/nemu/ioe/gpu.c @@ -35,8 +35,8 @@ void __am_gpu_fbdraw(AM_GPU_FBDRAW_T *ctl) { for (int i = 0; i < ctl->h; i++) { for (int j = 0; j < ctl->w; j++) { outl((uintptr_t)(fb_addr + - ((ctl->y + i) * w + (ctl->x + j))), - ((uint32_t*)ctl->pixels)[w * i + j]); + (w * (ctl->y + i) + ctl->x + j)), + ((uint32_t*)ctl->pixels)[ctl->w * i + j]); } } if (ctl->sync) {