Arbitrary resolutions, multiple monitors, Thousands of colors

About Qemu-system-m68k, a m68k Mac emulator for Windows, macOS and Linux that can run MacOS 7.1 to 8.1, AUX 3.x and NetBSD

Moderators: Cat_7, Ronald P. Regensburg

User avatar
Cat_7
Expert User
Posts: 6177
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Arbitrary resolutions, multiple monitors, Thousands of colors

Post by Cat_7 »

Got a trace from qemu built with debug and sanitizers on restart crash:

command line was:
gdb --args ./qemu-system-m68k-qfb-debug-sani -L pc-bios -m 136 -M q800,fb=none -device nubus-qfb,width=800,height=600,depth=16 -device nubus-qfb,width=800,height=600,depth=16 -drive file=pram-macos.img,format=raw,if=mtd -display gtk -serial stdio -bios Q800.ROM -device scsi-hd,scsi-id=0,drive=hd0 -drive file=system8.1.img,format=raw,media=disk,if=none,id=hd0

================================================================
==21405==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x7fff44364400 at pc 0x555555be7e31 bp 0x7fffffffd570 sp 0x7fffffffd568
WRITE of size 4 at 0x7fff44364400 thread T0
#0 0x555555be7e30 in qfb_draw_line1 ../hw/display/mac_qfb.c:84
#1 0x555555be8ec9 in qfb_draw_graphic ../hw/display/mac_qfb.c:275
#2 0x555555be975f in qfb_update_display ../hw/display/mac_qfb.c:360
#3 0x555555b27f97 in graphic_hw_update ../ui/console.c:230
#4 0x555555dd8ea1 in gd_refresh ../ui/gtk.c:438
#5 0x555555b34699 in dpy_refresh ../ui/console.c:1842
#6 0x555555b27813 in gui_update ../ui/console.c:165
#7 0x555556551653 in timerlist_run_timers ../util/qemu-timer.c:576
#8 0x555556551778 in qemu_clock_run_timers ../util/qemu-timer.c:590
#9 0x555556551c0b in qemu_clock_run_all_timers ../util/qemu-timer.c:672
#10 0x555556541d5a in main_loop_wait ../util/main-loop.c:607
#11 0x555555cc0885 in qemu_main_loop ../softmmu/runstate.c:734
#12 0x555555b11cc5 in qemu_main ../softmmu/main.c:38
#13 0x555555b11cf7 in main ../softmmu/main.c:47
#14 0x7ffff602954f in __libc_start_call_main (/lib64/libc.so.6+0x2954f)
#15 0x7ffff6029608 in __libc_start_main@@GLIBC_2.34 (/lib64/libc.so.6+0x29608)
#16 0x555555b11bd4 in _start (/home/hsp/qemu-m68k-mac/qemu-system-m68k-qfb-debug-sani+0x5bdbd4)

0x7fff44364400 is located 0 bytes to the right of 1920000-byte region [0x7fff4418f800,0x7fff44364400)
allocated by thread T0 here:
#0 0x7ffff78ba077 in calloc (/lib64/libasan.so.8+0xba077)
#1 0x7ffff7f114e9 in _pixman_bits_image_init (/lib64/libpixman-1.so.0+0x214e9)

SUMMARY: AddressSanitizer: heap-buffer-overflow ../hw/display/mac_qfb.c:84 in qfb_draw_line1
Shadow bytes around the buggy address:
0x100068864830: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x100068864840: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x100068864850: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x100068864860: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x100068864870: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x100068864880:[fa]fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x100068864890: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x1000688648a0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x1000688648b0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x1000688648c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x1000688648d0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Container overflow: fc
Array cookie: ac
Intra object redzone: bb
ASan internal: fe
Left alloca redzone: ca
Right alloca redzone: cb
==21405==ABORTING
User avatar
SolraBizna
Inquisitive Elf
Posts: 32
Joined: Mon Sep 27, 2021 1:39 am

Re: Arbitrary resolutions, multiple monitors, Thousands of colors

Post by SolraBizna »

It's quite possible I'm not handling the PRAM correctly. I hoped I could get away without touching it; Slot Manager PRAM stuff is spooky. I'm not able to reproduce any of this, though; my 8.1 machine handles the startup screen and the menu bar being flung around without any problems at all. >_<
Cat_7 wrote: Fri Sep 02, 2022 6:08 am ERROR: AddressSanitizer: heap-buffer-overflow on address 0x7fff44364400 at pc 0x555555be7e31 bp 0x7fffffffd570 sp 0x7fffffffd568
WRITE of size 4 at 0x7fff44364400 thread T0
#0 0x555555be7e30 in qfb_draw_line1 ../hw/display/mac_qfb.c:84
#1 0x555555be8ec9 in qfb_draw_graphic ../hw/display/mac_qfb.c:275
#2 0x555555be975f in qfb_update_display ../hw/display/mac_qfb.c:360
#3 0x555555b27f97 in graphic_hw_update ../ui/console.c:230
#4 0x555555dd8ea1 in gd_refresh ../ui/gtk.c:438
#5 0x555555b34699 in dpy_refresh ../ui/console.c:1842
#6 0x555555b27813 in gui_update ../ui/console.c:165
#7 0x555556551653 in timerlist_run_timers ../util/qemu-timer.c:576
#8 0x555556551778 in qemu_clock_run_timers ../util/qemu-timer.c:590
#9 0x555556551c0b in qemu_clock_run_all_timers ../util/qemu-timer.c:672
#10 0x555556541d5a in main_loop_wait ../util/main-loop.c:607
#11 0x555555cc0885 in qemu_main_loop ../softmmu/runstate.c:734
#12 0x555555b11cc5 in qemu_main ../softmmu/main.c:38
#13 0x555555b11cf7 in main ../softmmu/main.c:47
#14 0x7ffff602954f in __libc_start_call_main (/lib64/libc.so.6+0x2954f)
#15 0x7ffff6029608 in __libc_start_main@@GLIBC_2.34 (/lib64/libc.so.6+0x29608)
#16 0x555555b11bd4 in _start (/home/hsp/qemu-m68k-mac/qemu-system-m68k-qfb-debug-sani+0x5bdbd4)
Aha! Something actionable!

I looked at the code and... it looks okay, but it could do to be a bit more conservative. How does it fare with this patch?

Code: Select all

diff --git a/hw/display/mac_qfb.c b/hw/display/mac_qfb.c
index a88a9d6f8f..ef64778b22 100644
--- a/hw/display/mac_qfb.c
+++ b/hw/display/mac_qfb.c
@@ -356,8 +356,9 @@ static void qfb_update_display(void *opaque)
         qemu_console_resize(s->con, s->width, s->height);
         qfb_invalidate_display(s);
     }
-
-    qfb_draw_graphic(s);
+    else {
+        qfb_draw_graphic(s);
+    }
 }
 
 static void qfb_update_irq(QfbState *s)
diff --git a/hw/display/macfb.c b/hw/display/macfb.c
index 4427da917d..99a27ef470 100644
--- a/hw/display/macfb.c
+++ b/hw/display/macfb.c
@@ -477,9 +477,11 @@ static void macfb_update_display(void *opaque)
     if (s->width != surface_width(surface) ||
         s->height != surface_height(surface)) {
         qemu_console_resize(s->con, s->width, s->height);
+        macfb_invalidate_display(s);
+    }
+    else {
+        macfb_draw_graphic(s);
     }
-
-    macfb_draw_graphic(s);
 }
 
 static void macfb_update_irq(MacfbState *s)
User avatar
Cat_7
Expert User
Posts: 6177
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Arbitrary resolutions, multiple monitors, Thousands of colors

Post by Cat_7 »

It seems it takes longer, but I still crash with the patch applied:

control cscSetMode (2)
SET MODE: 128 @ 0
= 0
control cscSetEntries (3)
= 0
control cscSetMode (2)
SET MODE: 128 @ 0
= 0
control cscSetEntries (3)
= 0
control cscSetMode (2)
SET MODE: 128 @ 0
= 0
control cscSetEntries (3)
= 0
=================================================================
==35637==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x7fff3c753400 at pc 0x555555be7e3f bp 0x7fffffffd570 sp 0x7fffffffd568
WRITE of size 4 at 0x7fff3c753400 thread T0
#0 0x555555be7e3e in qfb_draw_line1 ../hw/display/mac_qfb.c:84
#1 0x555555be8ed7 in qfb_draw_graphic ../hw/display/mac_qfb.c:275
#2 0x555555be976f in qfb_update_display ../hw/display/mac_qfb.c:360
#3 0x555555b27f97 in graphic_hw_update ../ui/console.c:230
#4 0x555555dd8eb1 in gd_refresh ../ui/gtk.c:438
#5 0x555555b34699 in dpy_refresh ../ui/console.c:1842
#6 0x555555b27813 in gui_update ../ui/console.c:165
#7 0x555556551663 in timerlist_run_timers ../util/qemu-timer.c:576
#8 0x555556551788 in qemu_clock_run_timers ../util/qemu-timer.c:590
#9 0x555556551c1b in qemu_clock_run_all_timers ../util/qemu-timer.c:672
#10 0x555556541d6a in main_loop_wait ../util/main-loop.c:607
#11 0x555555cc0895 in qemu_main_loop ../softmmu/runstate.c:734
#12 0x555555b11cc5 in qemu_main ../softmmu/main.c:38
#13 0x555555b11cf7 in main ../softmmu/main.c:47
#14 0x7ffff602954f in __libc_start_call_main (/lib64/libc.so.6+0x2954f)
#15 0x7ffff6029608 in __libc_start_main@@GLIBC_2.34 (/lib64/libc.so.6+0x29608)
#16 0x555555b11bd4 in _start (/home/hsp/qemu-m68k-mac/qemu-system-m68k-qfb-debug-sani+0x5bdbd4)

0x7fff3c753400 is located 0 bytes to the right of 1920000-byte region [0x7fff3c57e800,0x7fff3c753400)
allocated by thread T0 here:
#0 0x7ffff78ba077 in calloc (/lib64/libasan.so.8+0xba077)
#1 0x7ffff7f114e9 in _pixman_bits_image_init (/lib64/libpixman-1.so.0+0x214e9)

SUMMARY: AddressSanitizer: heap-buffer-overflow ../hw/display/mac_qfb.c:84 in qfb_draw_line1
Shadow bytes around the buggy address:
0x1000678e2630: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x1000678e2640: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x1000678e2650: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x1000678e2660: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x1000678e2670: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x1000678e2680:[fa]fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x1000678e2690: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x1000678e26a0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x1000678e26b0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x1000678e26c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x1000678e26d0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Container overflow: fc
Array cookie: ac
Intra object redzone: bb
ASan internal: fe
Left alloca redzone: ca
Right alloca redzone: cb
==35637==ABORTING
[Thread 0x7fff61bff640 (LWP 35645) exited]
[Thread 0x7fff66dff640 (LWP 35643) exited]
[Thread 0x7ffff07fd640 (LWP 35641) exited]
[Thread 0x7ffff10ff640 (LWP 35640) exited]
[Thread 0x7ffff2b12d00 (LWP 35637) exited]
[Thread 0x7fffefffc640 (LWP 35642) exited]
[New process 35637]
[Inferior 1 (process 35637) exited with code 01]
User avatar
Cat_7
Expert User
Posts: 6177
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Arbitrary resolutions, multiple monitors, Thousands of colors

Post by Cat_7 »

Perhaps we could exchange pram files and command lines for Linux?

Best,
Cat_7
User avatar
SolraBizna
Inquisitive Elf
Posts: 32
Joined: Mon Sep 27, 2021 1:39 am

Re: Arbitrary resolutions, multiple monitors, Thousands of colors

Post by SolraBizna »

Not much to my command line. I use the same one on macOS and Linux:

Code: Select all

exec $QEMU \
-L ../qfb_driver/bin \
-m 128 \
-M q800,fb=none \
-serial stdio \
-bios Quadra800.rom \
-device nubus-qfb,width=960,height=600,depth=8 \
-net nic,model=dp83932 -net user \
-drive file=pram.dd,format=raw,if=mtd \
-device scsi-hd,scsi-id=0,drive=hd0,vendor="SEAGATE",product="ST225N",ver="1.0" \
-device scsi-cd,scsi-id=3,drive=cd1,vendor="MATSHITA",product="CD-ROM CR-8005",ver="1.0k" \
-drive file=oryx.dd,media=disk,format=raw,if=none,id=hd0
Only between that command line (MacOS 8.1) and the one I use for A/UX is that the A/UX one has two disks instead of one. And I don't share the PRAM file between them. I created an empty 256 byte file for both of them on initial install, and haven't touched or thought about it since. When I test multiple monitors, I set fb=mac or fb=dual or fb=qemu and add or remove more "-device nubus-qfb" lines. All combinations tested have worked on my end.

I have a plan for a more conservative patch that should knock that draw_line crash away, but it'll be some hours before I can sit down and work on it.
User avatar
SolraBizna
Inquisitive Elf
Posts: 32
Joined: Mon Sep 27, 2021 1:39 am

Re: Arbitrary resolutions, multiple monitors, Thousands of colors

Post by SolraBizna »

Very long wait for a very short patch, sorry.

Does this patch alleviate the crashes?

Code: Select all

diff --git a/hw/display/mac_qfb.c b/hw/display/mac_qfb.c
index a88a9d6f8f..8341d95bc7 100644
--- a/hw/display/mac_qfb.c
+++ b/hw/display/mac_qfb.c
@@ -233,6 +233,8 @@ static void qfb_draw_graphic(QfbState *s)
     DirtyBitmapSnapshot *snap = NULL;
     ram_addr_t page;
     uint32_t v = 0;
+    int height = min(s->height, qemu_surface_height(s));
+    int width = min(s->width, qemu_surface_width(s));
     int y, ymin;
     int qfb_stride = s->stride;
     qfb_draw_line_func *qfb_draw_line;
@@ -267,26 +269,26 @@ static void qfb_draw_graphic(QfbState *s)
 
     ymin = -1;
     page = s->regs[QFB_MODE_PAGE >> 2] * s->stride * s->height;
-    for (y = 0; y < s->height; y++, page += qfb_stride) {
+    for (y = 0; y < height; y++, page += qfb_stride) {
         if (qfb_check_dirty(s, snap, page, qfb_stride)) {
             uint8_t *data_display;
 
             data_display = surface_data(surface) + y * surface_stride(surface);
-            qfb_draw_line(s, data_display, page, s->width);
+            qfb_draw_line(s, data_display, page, width);
 
             if (ymin < 0) {
                 ymin = y;
             }
         } else {
             if (ymin >= 0) {
-                dpy_gfx_update(s->con, 0, ymin, s->width, y - ymin);
+                dpy_gfx_update(s->con, 0, ymin, width, y - ymin);
                 ymin = -1;
             }
         }
     }
 
     if (ymin >= 0) {
-        dpy_gfx_update(s->con, 0, ymin, s->width, y - ymin);
+        dpy_gfx_update(s->con, 0, ymin, width, y - ymin);
     }
 
     g_free(snap);
User avatar
Cat_7
Expert User
Posts: 6177
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Arbitrary resolutions, multiple monitors, Thousands of colors

Post by Cat_7 »

Hi,

No reason to be sorry. We seem to have lives to live too ;-)

The latest patch doesn´t make:

../hw/display/mac_qfb.c: In function ‘qfb_draw_graphic’:
../hw/display/mac_qfb.c:236:18: error: implicit declaration of function ‘min’ [-Werror=implicit-function-declaration]
236 | int height = min(s->height, qemu_surface_height(s));
| ^~~
../hw/display/mac_qfb.c:236:18: error: nested extern declaration of ‘min’ [-Werror=nested-externs]
../hw/display/mac_qfb.c:236:33: error: implicit declaration of function ‘qemu_surface_height’; did you mean ‘surface_height’? [-Werror=implicit-function-declaration]
236 | int height = min(s->height, qemu_surface_height(s));
| ^~~~~~~~~~~~~~~~~~~
| surface_height
../hw/display/mac_qfb.c:236:33: error: nested extern declaration of ‘qemu_surface_height’ [-Werror=nested-externs]
../hw/display/mac_qfb.c:237:31: error: implicit declaration of function ‘qemu_surface_width’; did you mean ‘surface_width’? [-Werror=implicit-function-declaration]
237 | int width = min(s->width, qemu_surface_width(s));
| ^~~~~~~~~~~~~~~~~~
| surface_width
../hw/display/mac_qfb.c:237:31: error: nested extern declaration of ‘qemu_surface_width’ [-Werror=nested-externs]

Best,
Cat_7
User avatar
SolraBizna
Inquisitive Elf
Posts: 32
Joined: Mon Sep 27, 2021 1:39 am

Re: Arbitrary resolutions, multiple monitors, Thousands of colors

Post by SolraBizna »

Heck. It doesn't build at my end, either. I must've built the wrong thing earlier.

Revert that one and apply this one:

Code: Select all

diff --git a/hw/display/mac_qfb.c b/hw/display/mac_qfb.c
index a88a9d6f8f..aa62df8b9e 100644
--- a/hw/display/mac_qfb.c
+++ b/hw/display/mac_qfb.c
@@ -233,6 +233,10 @@ static void qfb_draw_graphic(QfbState *s)
     DirtyBitmapSnapshot *snap = NULL;
     ram_addr_t page;
     uint32_t v = 0;
+    int height = s->height < surface_height(surface)
+        ? s->height : surface_height(surface);
+    int width = s->width < surface_width(surface)
+        ? s->width : surface_width(surface);
     int y, ymin;
     int qfb_stride = s->stride;
     qfb_draw_line_func *qfb_draw_line;
@@ -267,26 +271,26 @@ static void qfb_draw_graphic(QfbState *s)
 
     ymin = -1;
     page = s->regs[QFB_MODE_PAGE >> 2] * s->stride * s->height;
-    for (y = 0; y < s->height; y++, page += qfb_stride) {
+    for (y = 0; y < height; y++, page += qfb_stride) {
         if (qfb_check_dirty(s, snap, page, qfb_stride)) {
             uint8_t *data_display;
 
             data_display = surface_data(surface) + y * surface_stride(surface);
-            qfb_draw_line(s, data_display, page, s->width);
+            qfb_draw_line(s, data_display, page, width);
 
             if (ymin < 0) {
                 ymin = y;
             }
         } else {
             if (ymin >= 0) {
-                dpy_gfx_update(s->con, 0, ymin, s->width, y - ymin);
+                dpy_gfx_update(s->con, 0, ymin, width, y - ymin);
                 ymin = -1;
             }
         }
     }
 
     if (ymin >= 0) {
-        dpy_gfx_update(s->con, 0, ymin, s->width, y - ymin);
+        dpy_gfx_update(s->con, 0, ymin, width, y - ymin);
     }
 
     g_free(snap);
User avatar
Cat_7
Expert User
Posts: 6177
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Arbitrary resolutions, multiple monitors, Thousands of colors

Post by Cat_7 »

Patch applied!

Still crashes A/UX System with unimplemented trap, but it attempts to restart when Restart is clicked in the error box.
./qemu-system-m68k-qfb-debug-sani \
-L pc-bios \
-m 128 \
-M q800,fb=mac \
-device nubus-qfb,width=800,height=600,depth=8 \
-display sdl -serial stdio \
-bios Quadra800.rom \
-net nic,model=dp83932 -net user \
-drive file=pram-aux.img,format=raw,if=mtd \
-device scsi-hd,scsi-id=1,drive=hd0 \
-drive file=AUX2GB.img,media=disk,format=raw,if=none,id=hd0 \

Restart works with Mac OS 8.1:
./qemu-system-m68k-qfb-debug-sani \
-L pc-bios \
-m 128 \
-M q800,fb=mac \
-device nubus-qfb,width=800,height=600,depth=8 \
-drive file=pram-macos.img,format=raw,if=mtd \
-device scsi-hd,scsi-id=0,drive=hd0 \
-drive file=system8.1-new.img,format=raw,media=disk,if=none,id=hd0 \

Restart does not work with:
./qemu-system-m68k-qfb-debug-sani \
-L pc-bios \
-m 128 \
-M q800,fb=none \
-device nubus-qfb,width=800,height=600,depth=8 \
-device nubus-qfb,width=800,height=600,depth=8 \
-drive file=pram-macos.img,format=raw,if=mtd \
-display sdl -serial stdio \
-bios Quadra800.rom \
-device scsi-hd,scsi-id=0,drive=hd0 \
-drive file=system8.1-new.img,format=raw,media=disk,if=none,id=hd0 \

Does the code keep track of the last known good in the nubus bus pram?

Best,
Cat_7
User avatar
SolraBizna
Inquisitive Elf
Posts: 32
Joined: Mon Sep 27, 2021 1:39 am

Re: Arbitrary resolutions, multiple monitors, Thousands of colors

Post by SolraBizna »

My code currently ignores the PRAM entirely. The only use it should be seeing is from the Slot Manager using it to keep track of whether the same card is still present in the slot. Normally, one would use the PRAM to store the last set default mode, but "modern" QuickDraw just uses "scrn" resources for that instead, and doesn't make the driver do it... and, regardless, my driver uses the mode information given on the QEMU command line instead of PRAM.
User avatar
Cat_7
Expert User
Posts: 6177
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Arbitrary resolutions, multiple monitors, Thousands of colors

Post by Cat_7 »

Hi Solra,

I took the liberty to write to one of the qemu cocoa devs about multiple windows with the cocoa gui. This is what he had to say:

It is possible to implement multiple windows, but there are some hurdles
you need to overcome:

1. Current ui/cocoa has lots of states embedded in the view class. Each
window will have a view so you need to decouple common states from the
view class and share them among windows. This is a significant
refactoring and requires careful design. Once that refactoring is done,
you can have multiple window classes.

2. ui/cocoa has only one DisplayChangeListener, which means you can only
see a display at a time. It needs to be changed to have a
DisplayChangeListener per display.

3. Pointing devices that operate in absolute coordinates will require
extra attention. A pointing device should be attached to a display or be
independent (so-called "pen-tablet" device).

ui/gtk actually allows to "detach a tab" from a window and can have
multiple windows so you may refer to the implementation. But I don't say
it is perfect. Unfortunately QEMU's UI/display-related code is so buggy
and relies on wrong assumptions although it works fine in common situations.

If you managed to write patches, please share them on qemu-devel list
(as RFC if appropriate), I'd appreciate if you CC me for them.


Best,
Cat_7
User avatar
SolraBizna
Inquisitive Elf
Posts: 32
Joined: Mon Sep 27, 2021 1:39 am

Re: Arbitrary resolutions, multiple monitors, Thousands of colors

Post by SolraBizna »

3 at least wouldn't matter for a Quadra 800 target. But, if I were to work on this feature, it would definitely be to implement it for every guest.

I probably won't work much more on this particular problem, though. A big obstacle is that none of my Macs have multiple actual monitors. (My current Mac menagerie consists of an M1 MacBook Air and a frankensteined Macintosh LC III+... quite a time gap at play there.) If I'm being honest, though, the biggest problem is just one of time. I had a lot of time to work on the QFB thing because it happened to come up at the perfect time, right when my physical health took a very sudden and very dramatic turn for the better. But now my workload has caught up... :(

I already hadn't planned on pursuing mainlining the QFB changes, but I definitely won't be able to do even that now.
User avatar
Cat_7
Expert User
Posts: 6177
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Arbitrary resolutions, multiple monitors, Thousands of colors

Post by Cat_7 »

Good to read about your improved health! We are happy with the lovely work you already did.
The Q800 stuff itself is not even in main line Qemu, so perhaps you or someone will take your work up in the future.

Best (of health),
Cat_7
peanutbutter71
Student Driver
Posts: 10
Joined: Sun Sep 05, 2021 3:44 am

Re: Arbitrary resolutions, multiple monitors, Thousands of colors

Post by peanutbutter71 »

I got the dual monitors to work with that arbitrary-resolutions build. Couldn't get it to work very well with 7.5 very but it worked ok with 8.0 until it froze.

Image
peanutbutter71
Student Driver
Posts: 10
Joined: Sun Sep 05, 2021 3:44 am

Re: Arbitrary resolutions, multiple monitors, Thousands of colors

Post by peanutbutter71 »

I spoke too soon, I guess it didn't work with 7.5.1 but the multi monitor support did work with 7.5.5. Too cool! :cool: :!:

Image
User avatar
Cat_7
Expert User
Posts: 6177
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Arbitrary resolutions, multiple monitors, Thousands of colors

Post by Cat_7 »

I don't know what host system you are running, but you might want to use one of our newer experimental builds here:

viewtopic.php?t=11727
or here:
viewtopic.php?t=11728

These are based on the most recent source code.

Best,
Cat_7
peanutbutter71
Student Driver
Posts: 10
Joined: Sun Sep 05, 2021 3:44 am

Re: Arbitrary resolutions, multiple monitors, Thousands of colors

Post by peanutbutter71 »

Cat_7 wrote: Fri Oct 07, 2022 4:01 am Hi,

qemu-system-m68k was compiled from the q800.upstream2-vm branch at https://github.com/mcayland/qemu
qemu-system-m68k with arbitrary resolutions and multi display option was compiled from the arbitrary-resolutions branch at https://github.com/SolraBizna/qemu

Best,
Cat_7
I cloned those builds and compiled them on Ubuntu 22.04.
User avatar
Becatto
Inquisitive Elf
Posts: 25
Joined: Tue Oct 11, 2022 7:48 am

Re: Arbitrary resolutions, multiple monitors, Thousands of colors

Post by Becatto »

not trying to bother you, but are you the same SolraBizna as seen on the OpenComputers forum? if so, good luck on all of your coding projects!
-------------------------------------------------------------------------------------------------------------------------
Is it just me or every time I comment on a post, it dies :???:
User avatar
adespoton
Forum All-Star
Posts: 4286
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Arbitrary resolutions, multiple monitors, Thousands of colors

Post by adespoton »

I take it the qfb code hasn't been rolled into the latest build yet? I get "Property 'q800-machine.fb'' not found" on the latest build, even with mac_qfb.rom in the folder.
User avatar
Cat_7
Expert User
Posts: 6177
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Arbitrary resolutions, multiple monitors, Thousands of colors

Post by Cat_7 »

Correct, they are not merged.
However, for now the qfb code is on top of the also still experimental q800 code that boots Mac OS ;-)
So we do provide two builds.

Best,
Cat_7
User avatar
SolraBizna
Inquisitive Elf
Posts: 32
Joined: Mon Sep 27, 2021 1:39 am

Re: Arbitrary resolutions, multiple monitors, Thousands of colors

Post by SolraBizna »

Becatto wrote: Thu Oct 13, 2022 3:24 pm not trying to bother you, but are you the same SolraBizna as seen on the OpenComputers forum? if so, good luck on all of your coding projects!
I am indeed. I'm surprised anyone remembers my brief presence there. Thanks. :)
Post Reply