diff --git a/abstract-machine/am/src/platform/nemu/ioe/gpu.c b/abstract-machine/am/src/platform/nemu/ioe/gpu.c index 35092d2..49a7f24 100644 --- a/abstract-machine/am/src/platform/nemu/ioe/gpu.c +++ b/abstract-machine/am/src/platform/nemu/ioe/gpu.c @@ -19,9 +19,9 @@ void __am_gpu_init() { void __am_gpu_config(AM_GPU_CONFIG_T *cfg) { // uint32_t vgactl = inl(VGACTL_ADDR); GET_W(w); - PNT_BITS(w, 16, 'W'); + // PNT_BITS(w, 16, 'W'); GET_H(h); - PNT_BITS(h, 16, 'H'); + // PNT_BITS(h, 16, 'H'); *cfg = (AM_GPU_CONFIG_T) { .present = true, .has_accel = false, .width = w, .height = h, @@ -33,7 +33,7 @@ void __am_gpu_fbdraw(AM_GPU_FBDRAW_T *ctl) { GET_W(w); for (int i = 0; i < ctl->h; i++) { for (int j = 0; j < ctl->w; j++) { - outl(FB_ADDR + w * j + i, (uint32_t)ctl->pixels + w * j + i); + outl(FB_ADDR + (ctl->y + j) * w + (ctl->x + i), (uint32_t)ctl->pixels + w * j + i); } } if (ctl->sync && inl(SYNC_ADDR) == 0) {