SDL2 scale up and scale down enhancement

About BasiliskII, a 68k Mac emulator for Windows, MacOSX, and Linux that can run System 7.x through MacOS 8.1.

Moderators: Cat_7, Ronald P. Regensburg

Post Reply
User avatar
rickyzhang
Mac Mechanic
Posts: 193
Joined: Mon Sep 15, 2014 7:59 pm

SDL2 scale up and scale down enhancement

Post by rickyzhang »

Thanks to SDL2 features from David.

I enhanced the scale up features in window mode. The user can change the scale factor at will by resizing the window.

When user restore the window from minimize or maximize, it restores the scale ratio to 1.

I can tell the SDL2 employs the hardware acceleration in both OpenGL in Linux and Metal in Mac OS X. My son's game is playing much more smoother than SDL1.

See my screen case here https://youtu.be/RzwpeUe787E
There is an App for that!
https://github.com/rickyzhang82
johnatcharpa
Space Cadet
Posts: 5
Joined: Mon Jul 27, 2020 5:44 am

Re: SDL2 scale up and scale down enhancement

Post by johnatcharpa »

Ricky,

Were you able to do a macOS build for your modified branch? I cloned current git and gave it a shot, but the macOS Xcode project file complains about missing source (quite a few files). I dug around for hints on building it but the file referenced regarding how to build it is gone too. Is there something I've totally overlooked for building this? I'd definitely like to try out all your changes to current.
User avatar
rickyzhang
Mac Mechanic
Posts: 193
Joined: Mon Sep 15, 2014 7:59 pm

Re: SDL2 scale up and scale down enhancement

Post by rickyzhang »

Sure. But please build with autoconf in Mac OS X. XCode changed too often. I don't have energy to patch it by clicking by mouse.

See https://github.com/cebix/macemu/wiki/Ba ... l-mac-os-x
or check the Travis CI YAML file for build instruction.
There is an App for that!
https://github.com/rickyzhang82
johnatcharpa
Space Cadet
Posts: 5
Joined: Mon Jul 27, 2020 5:44 am

Re: SDL2 scale up and scale down enhancement

Post by johnatcharpa »

Ricky,

Thanks for the pointer to the wiki page. I missed that completely. I probably should have just read the Unix/configure too. And yes, cli! I loathe using Xcode; with every release it gets harder to use. Just navigating it is incredibly frustrating. I force a standard Makefile for building Mini vMac too.

With enough messing around Basilisk 2 builds on Catalina. The window scaling works just fine and SDL reports metal rendering.

I saw some of your discussions about window scaling re: Mini vMac. Are you going to attempt to implement that kind of scaling for Basilisk? Bilinear filtering is my arch enemy..

As for a 64-bit JIT, could it be borrowed from FS-UAE?
johnatcharpa
Space Cadet
Posts: 5
Joined: Mon Jul 27, 2020 5:44 am

Re: SDL2 scale up and scale down enhancement

Post by johnatcharpa »

.. actually, I managed to sort out the filtering. I found:

Code: Select all

SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, PrefsFindBool("scale_nearest") ? "nearest" : "linear"
and

Code: Select all

SDL_RenderSetIntegerScale(sdl_renderer, PrefsFindBool("scale_integer") ? SDL_TRUE : SDL_FALSE);
but setting things like:

Code: Select all

scale_nearest true
or:

Code: Select all

scale_integer false
didn't seem to make a difference. I ended up just setting:

Code: Select all

SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, 0);
and that did what I wanted. The only other thing I tried was a black and white screen with MacII (Performa). It worked on the May build, but now the colours are inverted. It's white text on beige :|
User avatar
rickyzhang
Mac Mechanic
Posts: 193
Joined: Mon Sep 15, 2014 7:59 pm

Re: SDL2 scale up and scale down enhancement

Post by rickyzhang »

For 32 Bit ROM and System 7.x, an arbitrary guest OS resolution was possible long ago.

This month, I ported arbitrary guest OS resolution ROM patch form mini vMac for 24Bit Mac SE ROM under System 6.

See screen cast: https://www.youtube.com/watch?v=aXzM8t_ ... e=emb_logo

JIT is an overkill for modern hardware. It is a piece of cake for Ghz CPU in 2020 to emulate Mhz CPU in 1980.
There is an App for that!
https://github.com/rickyzhang82
uyjulian
Apple Corer
Posts: 241
Joined: Fri Aug 27, 2010 1:02 am

Re: SDL2 scale up and scale down enhancement

Post by uyjulian »

johnatcharpa wrote: As for a 64-bit JIT, could it be borrowed from FS-UAE?
I'm actually working on porting the JIT from ARAnyM. See my thread: https://www.emaculation.com/forum/viewt ... f=6&t=9674

I plan to submit changes to both ARAnyM and Basilisk II after I am finished with my changes and the issues are ironed out…
johnatcharpa
Space Cadet
Posts: 5
Joined: Mon Jul 27, 2020 5:44 am

Re: SDL2 scale up and scale down enhancement

Post by johnatcharpa »

I plan to submit changes to both ARAnyM and Basilisk II after I am finished with my changes and the issues are ironed out…
Great! I'll keep an eye on the thread.
johnatcharpa
Space Cadet
Posts: 5
Joined: Mon Jul 27, 2020 5:44 am

Re: SDL2 scale up and scale down enhancement

Post by johnatcharpa »

For 32 Bit ROM and System 7.x, an arbitrary guest OS resolution was possible long ago.
I guess I should have included a tiny bit more detail - my bad. So when I use the build/tree from kanjitalk755 (which doesn't have the screen resize changes), this indeed works. However if I use the cebix/macemu/ tree then it does not. If you set the screen to black and white it turns to white on beige (at least on macOS 10.15.6 with SDL2). Also the preferences setting 'scale_nearest' appears to be ignored.
This month, I ported arbitrary guest OS resolution ROM patch form mini vMac for 24Bit Mac SE ROM under System 6.
I saw that when going through the git diffs. I'm not terribly excited about using X11 though, so I'll wait until it works with a pure SDL2 build. I tried the standard build without X11 and it hangs at boot.

If I make any progress on any of this I'll submit anything of use I discover.
User avatar
rickyzhang
Mac Mechanic
Posts: 193
Joined: Mon Sep 15, 2014 7:59 pm

Re: SDL2 scale up and scale down enhancement

Post by rickyzhang »

Use cebix upstream, instead. I fixed the hang.
There is an App for that!
https://github.com/rickyzhang82
kanjitalk755
Mac Mechanic
Posts: 153
Joined: Thu Nov 09, 2017 12:06 pm

Re: SDL2 scale up and scale down enhancement

Post by kanjitalk755 »

@johnatcharpa
Try my fork with appending following line to ~/.basilisk_ii_prefs.

Code: Select all

mag_rate 2
scale_nearest true
jit true
Post Reply