> 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
 00:44:16 up 7 days,  9:41,  1 user,  load average: 0.47, 0.49, 0.72
This commit is contained in:
tracer-ics2023
2024-09-25 00:44:16 +08:00
committed by zzy
parent 5f77bcf034
commit 3358dc6006

View File

@ -27,23 +27,23 @@ int NDL_PollEvent(char *buf, int len) {
}
void NDL_OpenCanvas(int *w, int *h) {
if (getenv("NWM_APP")) {
int fbctl = 4;
fbdev = 5;
screen_w = *w; screen_h = *h;
char buf[64];
int len = sprintf(buf, "%d %d", screen_w, screen_h);
// let NWM resize the window and create the frame buffer
write(fbctl, buf, len);
while (1) {
// 3 = evtdev
int nread = read(3, buf, sizeof(buf) - 1);
if (nread <= 0) continue;
buf[nread] = '\0';
if (strcmp(buf, "mmap ok") == 0) break;
}
close(fbctl);
}
// if (getenv("NWM_APP")) {
// int fbctl = 4;
// fbdev = 5;
// screen_w = *w; screen_h = *h;
// char buf[64];
// int len = sprintf(buf, "%d %d", screen_w, screen_h);
// // let NWM resize the window and create the frame buffer
// write(fbctl, buf, len);
// while (1) {
// // 3 = evtdev
// int nread = read(3, buf, sizeof(buf) - 1);
// if (nread <= 0) continue;
// buf[nread] = '\0';
// if (strcmp(buf, "mmap ok") == 0) break;
// }
// close(fbctl);
// }
FILE* fp = fopen("/proc/dispinfo", "w");
if (fp == NULL) {