cebix / macemu

Basilisk II and SheepShaver Macintosh emulators
1.38k stars 288 forks source link

linux/x11: Window scaling possible? #199

Closed buserror closed 4 years ago

buserror commented 4 years ago

I've got a HiDPi 4K screen, and Baslisk in like 800x600 looks like a thumnail requiring a loupe! Would it be easily possible to implement scaling to like x2 ?

I had a look at video_x.cpp, and it seems it's using some sort of 16x16 matrix to detect 'dirty' rectangles, and do copies, unless you are in shm/'shared memory' mode where it doesn't do anything.

I thought I'd just plot an issue here, perhaps someome already solved that problem, somewhere!

macmeister1967 commented 4 years ago

I must agree, I had to set screen resolution manually just to make out what was happening... 4K here.

buserror commented 4 years ago

I've started to do a bit of work on that, problem is, it's unlikely to ever be 'generic' as the video rendering is all over the place, theres loads of cases; so I only took "my" case to implement a pixel doubler. Still need the scale the mouse tho. perhaps I'll push a fork of that when it's working!

macmeister1967 commented 4 years ago

That sounds just perfect, 2x the size would be just great. Thanks for the info.

On Sun, 21 Jun 2020 at 01:57, Michel Pollet notifications@github.com wrote:

I've started to do a bit of work on that, problem is, it's unlikely to ever be 'generic' as the video rendering is all over the place, theres loads of cases; so I only took "my" case to implement a pixel doubler. Still need the scale the mouse tho. perhaps I'll push a fork of that when it's working!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/cebix/macemu/issues/199#issuecomment-647013106, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGLSXIO5ZJLLDKLRXKRHTCTRXTL6PANCNFSM4NMOUJDQ .

phrxmd commented 4 years ago

Much appreciated, @buserror !

buserror commented 4 years ago

If you guys want to check it out... I only changed the "best" rendering path (vosf) at the minute, but it should work also for the others with little modifications.

Done very little testing, but now a 1024x768 Basilisk window is nice a readable on my 32" 4K screen!

macmeister1967 commented 4 years ago

many thanks

buserror commented 4 years ago

Well I pulled the pull request, it was getting into long winded blah blah discussion about fractional and how to configure it etc etc and I have no time for this really. I'll keep my fork on my account, and will rebase when I feel like it.

rickyzhang82 commented 4 years ago

@macmeister1967

I merged a SDL2 PR in upstream. Please pull the upstream master branch and follow the configure and the settings. You will get scale up for free in a hi-res monitor (or even non hi-res monitor)

make clean
NO_CONFIGURE=1 ./autogen.sh
./configure CFLAGS="-O3 -march=native" CXXFLAGS="-O3 -march=native" --enable-sdl-video --enable-sdl-audio --disable-vosf --disable-jit-compiler --with-x --with-gtk --with-mon --with-sdl2
make -j 32

The scale up is accelerated by SDL2 through your hardware. The visual effect is pretty awesome and fast compared to SDL1.


displaycolordepth 0
disk /home/Ricky/repo/68k.Mac/BasilikII/DiskImage/MacImage.dsk
disk /home/Ricky/repo/68k.Mac/BasilikII/DiskImage/Development.dsk
disk /home/Ricky/Downloads/OS755/OS_755_2GB.dsk
extfs /home/Ricky/repo/68k.Mac/Apps
screen dga/640/480
seriala /dev/ttyS0
serialb /dev/ttyS1
ether wlo1
udptunnel false
udpport 6066
rom /home/Ricky/repo/68k.Mac/BasilikII/ROM/Mac.ROM
bootdrive 0
bootdriver 0
ramsize 1073741824
frameskip 1
modelid 5
cpu 4
fpu true
nocdrom false
nosound false
noclipconversion false
nogui false
jit false
jitfpu true
jitdebug false
jitcachesize 8192
jitlazyflush true
jitinline true
keyboardtype 5
keycodes true
keycodefile /home/Ricky/repo/68k.Mac/BasilikII/keycodes
mousewheelmode 1
mousewheellines 3
dsp /dev/dsp
mixer /dev/mixer
ignoresegv false
idlewait true

I'm working on another PR which allows scale up/down the host OS window by resizing BII windows. This new feature will make scale up/down way much more easier.

buserror commented 4 years ago

"screen dga/640/480 specifies the guest OS virtual resolution 640x480. It is fixed. The dga makes the window full screen in your physical hi-res monitor"

ROFL Ok I have TWO 4K 32" screens side by side, so your patch will magically fuck up ALL my (other) window positions, on all virtual workspaces because I accidentally launched your program.

Color me impressed.

I do bow to you as the superior being.

ROFL more

rickyzhang82 commented 4 years ago

Go check out my new improvement that I made for SDL2:

Screen Cast

rickyzhang82 commented 4 years ago

The guest OS virtual resolution has to be fixed. You can't change the guest OS virtual resolution on the fly at least the current BII can't do it.

My new improvement can make scale up and scale down even in window mode. I will send a PR soon.

I don't mean to fight for anything. But chill out, man.

macmeister1967 commented 4 years ago

Could you possibly send me a link to that build of yours (on macOS).

I am terrible at building from source on macOS :-(

thanks.

On Fri, 3 Jul 2020 at 08:17, Ricky Zhang notifications@github.com wrote:

Go check out my new improvement that I made for SDL2:

Screen Cast https://youtu.be/RzwpeUe787E

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/cebix/macemu/issues/199#issuecomment-653242076, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGLSXII3HZG6ML3QEOJOI4LRZUBPBANCNFSM4NMOUJDQ .

rickyzhang82 commented 4 years ago

It is highly unlikely the binary will work on your machine. Because it relies on so many dynamic libraries:

Ricky@imac:~/repo/github/macemu/BasiliskII/src/Unix$ otool -L BasiliskII
BasiliskII:
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.100.1)
    /opt/local/lib/libreadline.8.dylib (compatibility version 8.0.0, current version 8.0.0)
    /opt/local/lib/libncurses.6.dylib (compatibility version 6.0.0, current version 6.0.0)
    /opt/local/lib/libSDL2-2.0.0.dylib (compatibility version 13.0.0, current version 13.0.0)
    /opt/local/lib/libiconv.2.dylib (compatibility version 9.0.0, current version 9.1.0)
    /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio (compatibility version 1.0.0, current version 1.0.0)
    /System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox (compatibility version 1.0.0, current version 1000.0.0)
    /System/Library/Frameworks/ForceFeedback.framework/Versions/A/ForceFeedback (compatibility version 1.0.0, current version 1.0.2)
    /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
    /System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo (compatibility version 1.2.0, current version 1.5.0)
    /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 23.0.0)
    /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 162.0.0)
    /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
    /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore (compatibility version 1.2.0, current version 1.11.0)
    /System/Library/Frameworks/Metal.framework/Versions/A/Metal (compatibility version 1.0.0, current version 212.5.15)
    /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 902.1.0)
    /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 1894.40.150)
    /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1675.129.0)
    /opt/local/lib/libgtk-x11-2.0.0.dylib (compatibility version 2401.0.0, current version 2401.32.0)
    /opt/local/lib/libgdk-x11-2.0.0.dylib (compatibility version 2401.0.0, current version 2401.32.0)
    /opt/local/lib/libpangocairo-1.0.0.dylib (compatibility version 4201.0.0, current version 4201.4.0)
    /opt/local/lib/libgio-2.0.0.dylib (compatibility version 5801.0.0, current version 5801.3.0)
    /opt/local/lib/libXrender.1.dylib (compatibility version 5.0.0, current version 5.0.0)
    /opt/local/lib/libXinerama.1.dylib (compatibility version 2.0.0, current version 2.0.0)
    /opt/local/lib/libXi.6.dylib (compatibility version 8.0.0, current version 8.0.0)
    /opt/local/lib/libXrandr.2.dylib (compatibility version 5.0.0, current version 5.0.0)
    /opt/local/lib/libXcursor.1.dylib (compatibility version 2.0.0, current version 2.2.0)
    /opt/local/lib/libXcomposite.1.dylib (compatibility version 2.0.0, current version 2.0.0)
    /opt/local/lib/libXdamage.1.dylib (compatibility version 3.0.0, current version 3.0.0)
    /opt/local/lib/libXfixes.3.dylib (compatibility version 5.0.0, current version 5.0.0)
    /opt/local/lib/libX11.6.dylib (compatibility version 10.0.0, current version 10.0.0)
    /opt/local/lib/libXext.6.dylib (compatibility version 11.0.0, current version 11.0.0)
    /opt/local/lib/libatk-1.0.0.dylib (compatibility version 23610.0.0, current version 23610.1.0)
    /opt/local/lib/libcairo.2.dylib (compatibility version 11603.0.0, current version 11603.0.0)
    /opt/local/lib/libgdk_pixbuf-2.0.0.dylib (compatibility version 4001.0.0, current version 4001.0.0)
    /opt/local/lib/libpangoft2-1.0.0.dylib (compatibility version 4201.0.0, current version 4201.4.0)
    /opt/local/lib/libpango-1.0.0.dylib (compatibility version 4201.0.0, current version 4201.4.0)
    /opt/local/lib/libgobject-2.0.0.dylib (compatibility version 5801.0.0, current version 5801.3.0)
    /opt/local/lib/libglib-2.0.0.dylib (compatibility version 5801.0.0, current version 5801.3.0)
    /opt/local/lib/libintl.8.dylib (compatibility version 10.0.0, current version 10.5.0)
    /opt/local/lib/libfontconfig.1.dylib (compatibility version 14.0.0, current version 14.0.0)
    /opt/local/lib/libfreetype.6.dylib (compatibility version 24.0.0, current version 24.2.0)
    /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 1069.22.0)
    /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 1675.129.0)

If you use macports, you can get X11, gtk2 and SDL2 easily. That's dependencies you need.

If you don't need a GTK GUI, you can also get the dependencies from homebrew. Please check out the CI .travis.yml file in upstream repo. I have written the build process which also specifies its build dependencies.

macmeister1967 commented 4 years ago

Eek, that seems like a lot of work. I think I'll be patient and see if this ever gets a mainstream release... I use Brew and try not to use MacPorts as well.

I use Basilisk/SheepShaver so rarely, I can wait a while (I failed building both on Linux recently, and I am nowhere near as good building from source on macOS). Thanks for all the advice.

On Fri, 3 Jul 2020 at 12:42, Ricky Zhang notifications@github.com wrote:

It is highly unlikely the binary will work on your machine. Because it relies on so many dynamic libraries:

Ricky@imac:~/repo/github/macemu/BasiliskII/src/Unix$ otool -L BasiliskII BasiliskII: /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.100.1) /opt/local/lib/libreadline.8.dylib (compatibility version 8.0.0, current version 8.0.0) /opt/local/lib/libncurses.6.dylib (compatibility version 6.0.0, current version 6.0.0) /opt/local/lib/libSDL2-2.0.0.dylib (compatibility version 13.0.0, current version 13.0.0) /opt/local/lib/libiconv.2.dylib (compatibility version 9.0.0, current version 9.1.0) /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio (compatibility version 1.0.0, current version 1.0.0) /System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox (compatibility version 1.0.0, current version 1000.0.0) /System/Library/Frameworks/ForceFeedback.framework/Versions/A/ForceFeedback (compatibility version 1.0.0, current version 1.0.2) /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0) /System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo (compatibility version 1.2.0, current version 1.5.0) /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 23.0.0) /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 162.0.0) /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0) /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore (compatibility version 1.2.0, current version 1.11.0) /System/Library/Frameworks/Metal.framework/Versions/A/Metal (compatibility version 1.0.0, current version 212.5.15) /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 902.1.0) /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 1894.40.150) /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1675.129.0) /opt/local/lib/libgtk-x11-2.0.0.dylib (compatibility version 2401.0.0, current version 2401.32.0) /opt/local/lib/libgdk-x11-2.0.0.dylib (compatibility version 2401.0.0, current version 2401.32.0) /opt/local/lib/libpangocairo-1.0.0.dylib (compatibility version 4201.0.0, current version 4201.4.0) /opt/local/lib/libgio-2.0.0.dylib (compatibility version 5801.0.0, current version 5801.3.0) /opt/local/lib/libXrender.1.dylib (compatibility version 5.0.0, current version 5.0.0) /opt/local/lib/libXinerama.1.dylib (compatibility version 2.0.0, current version 2.0.0) /opt/local/lib/libXi.6.dylib (compatibility version 8.0.0, current version 8.0.0) /opt/local/lib/libXrandr.2.dylib (compatibility version 5.0.0, current version 5.0.0) /opt/local/lib/libXcursor.1.dylib (compatibility version 2.0.0, current version 2.2.0) /opt/local/lib/libXcomposite.1.dylib (compatibility version 2.0.0, current version 2.0.0) /opt/local/lib/libXdamage.1.dylib (compatibility version 3.0.0, current version 3.0.0) /opt/local/lib/libXfixes.3.dylib (compatibility version 5.0.0, current version 5.0.0) /opt/local/lib/libX11.6.dylib (compatibility version 10.0.0, current version 10.0.0) /opt/local/lib/libXext.6.dylib (compatibility version 11.0.0, current version 11.0.0) /opt/local/lib/libatk-1.0.0.dylib (compatibility version 23610.0.0, current version 23610.1.0) /opt/local/lib/libcairo.2.dylib (compatibility version 11603.0.0, current version 11603.0.0) /opt/local/lib/libgdk_pixbuf-2.0.0.dylib (compatibility version 4001.0.0, current version 4001.0.0) /opt/local/lib/libpangoft2-1.0.0.dylib (compatibility version 4201.0.0, current version 4201.4.0) /opt/local/lib/libpango-1.0.0.dylib (compatibility version 4201.0.0, current version 4201.4.0) /opt/local/lib/libgobject-2.0.0.dylib (compatibility version 5801.0.0, current version 5801.3.0) /opt/local/lib/libglib-2.0.0.dylib (compatibility version 5801.0.0, current version 5801.3.0) /opt/local/lib/libintl.8.dylib (compatibility version 10.0.0, current version 10.5.0) /opt/local/lib/libfontconfig.1.dylib (compatibility version 14.0.0, current version 14.0.0) /opt/local/lib/libfreetype.6.dylib (compatibility version 24.0.0, current version 24.2.0) /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 1069.22.0) /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 1675.129.0)

If you use macports, you can get X11, gtk2 and SDL2 easily. That's dependencies you need.

If you don't need a GTK GUI, you can also get the dependencies from homebrew. Please check out the CI .travis.yml file in upstream repo. I have written the build process which also specifies its build dependencies.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/cebix/macemu/issues/199#issuecomment-653306681, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGLSXIKZTWVN6333KP5Q44DRZVATFANCNFSM4NMOUJDQ .