Page 1 of 1

SDL2 scale up and scale down enhancement

Posted: Thu Jul 02, 2020 10:41 pm
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

Re: SDL2 scale up and scale down enhancement

Posted: Mon Jul 27, 2020 5:54 am
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.

Re: SDL2 scale up and scale down enhancement

Posted: Mon Jul 27, 2020 6:22 pm
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.

Re: SDL2 scale up and scale down enhancement

Posted: Tue Jul 28, 2020 12:25 am
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?

Re: SDL2 scale up and scale down enhancement

Posted: Tue Jul 28, 2020 11:59 am
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 :|

Re: SDL2 scale up and scale down enhancement

Posted: Tue Jul 28, 2020 2:01 pm
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.

Re: SDL2 scale up and scale down enhancement

Posted: Tue Jul 28, 2020 4:53 pm
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…

Re: SDL2 scale up and scale down enhancement

Posted: Wed Jul 29, 2020 2:55 am
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.

Re: SDL2 scale up and scale down enhancement

Posted: Wed Jul 29, 2020 3:06 am
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.

Re: SDL2 scale up and scale down enhancement

Posted: Wed Jul 29, 2020 6:35 pm
by rickyzhang
Use cebix upstream, instead. I fixed the hang.

Re: SDL2 scale up and scale down enhancement

Posted: Tue Sep 01, 2020 4:57 pm
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