> compile NEMU

221220000 张三
Linux zzy 5.15.146.1-microsoft-standard-WSL2 #1 SMP Thu Jan 11 04:09:03 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
 13:09:54 up 7 days, 13:10,  1 user,  load average: 0.28, 0.25, 0.11
This commit is contained in:
tracer-ics2023
2024-09-25 13:09:54 +08:00
committed by zzy
parent 18726cdade
commit dfd0b3286d

View File

@ -48,7 +48,7 @@ static void _get_screen(int *w, int *h) {
}
*w = dev_w;
*h = dev_h;
printf("screen size: %d %d\n", dev_w, dev_h);
// printf("screen size: %d %d\n", dev_w, dev_h);
fclose(fp);
}
@ -86,10 +86,10 @@ void NDL_DrawRect(uint32_t *pixels, int x, int y, int w, int h) {
int dev_w, dev_h;
_get_screen(&dev_w, &dev_h);
x += (dev_w - x) / 2;
y += (dev_h - y) / 2;
// x += (dev_w - x) / 2;
// y += (dev_h - y) / 2;
for (int i = 0; i < h; i ++) {
fwrite(pixels + (screen_w * (y + i)) + x, sizeof(uint32_t), w, fp);
fwrite(pixels + (y + i) + x, sizeof(uint32_t), w, fp);
}
fclose(fp);
}