A "rootless" app running a no-desktop BasiliskII

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
emendelson
Forum All-Star
Posts: 1677
Joined: Tue Oct 14, 2008 12:12 am

A "rootless" app running a no-desktop BasiliskII

Post by emendelson »

First: Everything in this post is based on the work of the programmers who call themselves kanjitalk755, zydeco, and mabam. All I did was string it together. For details of where this is coming from, see this thread:

viewtopic.php?p=77159#p77159

Next: here is an AppleScript app that runs a customized version of the "rootless" BasiliskII originally made by zydeco, then updated by mabam in this forum, and finally merged with kanjitalk755's current code by me. I couldn't even have begun doing this without mabam's earlier modifications.

READ THIS BEFORE DOWNLOADING!!

This app is notarized, and (I think) writes all its changes to your ~/Library/Application Support folder, so it should be usable from the Applications folder of a multi-user system. As I've supplied it, it runs SimpleText in a window on the macOS desktop and then shuts itself down when you quit SimpleText. Because this is based on my System761 app, you should be able to print from SimpleText to your default macOS printer, or create a PDF on the macOS desktop, or select a printer in macOS. (In BasiliskII, there is a separate printer for each of these options.)

If you want to run a different application instead of SimpleText (as you probably will), hold down the Option key when starting the app. It will open to a normal BasiliskII desktop running System 7.6.1. If the app you want to use is not already in the 7.6.1 system, put it (or its installer) into your host macOS Documents folder, then drag it from the Unix window in BasiliskII to the File Transfer folder on the BasiliskII desktop so gets copied to the virtual hard disk. Then install the app and make sure it runs.

Now you should edit the RunAppAndExit AppleScript that is in the Startup Items in the System folder in BasiliskII. You can edit it most easily by clicking on the icons at the far right of the BasiliskII menu bar, choosing RunAppAndExit, and then Edit from the file manu.

In the editing screen replace the name "SimpleText" (it appears twice) with the name of the app that you want to run. Check the syntax. Save the script and run it. You may be prompted to find the application whose name you wrote it. Close down BasiliskII. When you start it again (without holding down the Option key), the app should open in a separate window.

If it doesn't work, please read these instructions again before posting a message here.

The forum forbids direct links to downloads that include Mac system software, so please go to this page and search for the string "rootless":

http://www.columbia.edu/~em36/macos9osx.html
emendelson
Forum All-Star
Posts: 1677
Joined: Tue Oct 14, 2008 12:12 am

Re: A "rootless" app running a no-desktop BasiliskII

Post by emendelson »

And have now posted a version that won't produce the error message produced by the version I posted earlier. Apologies for wasting your time if you already downloaded.
kanjitalk755
Apple Corer
Posts: 239
Joined: Thu Nov 09, 2017 12:06 pm

Re: A "rootless" app running a no-desktop BasiliskII

Post by kanjitalk755 »

I tried your pull request, but it didn't work properly, including the window appearing as a black rectangle.
However, the above build worked fine.
Is there any difference in the code?
emendelson
Forum All-Star
Posts: 1677
Joined: Tue Oct 14, 2008 12:12 am

Re: A "rootless" app running a no-desktop BasiliskII

Post by emendelson »

I can't figure out what's wrong. The only differences in the code are that the above build adds default settings for "disk" and "rom" and change the location of the prefs file. I can upload that code if it might be useful.

I downloaded my merged code in a zip file from this page:

https://github.com/emendelson/macemu-ro ... 7afd58847a

(I clicked Code, then Download ZIP) and built it in Xcode (M2 Mac, Ventura) and it worked perfectly.

I don't want to waste your time. If you can tell me what to do next, I will gladly do it.

EDIT: "merged" not "forced"
Last edited by emendelson on Mon Oct 23, 2023 12:36 pm, edited 1 time in total.
kanjitalk755
Apple Corer
Posts: 239
Joined: Thu Nov 09, 2017 12:06 pm

Re: A "rootless" app running a no-desktop BasiliskII

Post by kanjitalk755 »

It turned out that it works with SDL2 2.0.22 embedded in your app, but not with the latest 2.28.4.
User avatar
mabam
Master Emulator
Posts: 491
Joined: Wed Apr 10, 2013 9:32 am

Re: A "rootless" app running a no-desktop BasiliskII

Post by mabam »

emendelson wrote: Fri Oct 20, 2023 6:43 pm First: Everything in this post is based on the work of the programmers who call themselves kanjitalk755, zydeco, and mabam. All I did was string it together. For details of where this is coming from, see this thread:

viewtopic.php?p=77159#p77159

zydeco’s original post and kanjitalk755’s fixes can be found at viewtopic.php?t=10472 .
I haven’t actually contributed anything to the code, I only merged https://github.com/kanjitalk755/macemu/ ... o_rootless (almost four years old) with the master branch about two years ago.

If it helps, I should have time to merge https://github.com/mabam/macemu with present code in the end of next week.
emendelson
Forum All-Star
Posts: 1677
Joined: Tue Oct 14, 2008 12:12 am

Re: A "rootless" app running a no-desktop BasiliskII

Post by emendelson »

kanjitalk755 wrote: Mon Oct 23, 2023 3:16 am It turned out that it works with SDL2 2.0.22 embedded in your app, but not with the latest 2.28.4.
Thank you for sorting this out. I remembered also that I fixed a similar problem by deleting the xpram file, but that may not be relevant.

Is it possible to edit the code so that it works with the latest SDL2? This may not be worth the effort, I understand...
kanjitalk755
Apple Corer
Posts: 239
Joined: Thu Nov 09, 2017 12:06 pm

Re: A "rootless" app running a no-desktop BasiliskII

Post by kanjitalk755 »

mabam wrote: Mon Oct 23, 2023 6:40 am If it helps, I should have time to merge https://github.com/mabam/macemu with present code in the end of next week.
I think the result will be the same as emendelson's pull request.
emendelson wrote: Mon Oct 23, 2023 12:37 pm Is it possible to edit the code so that it works with the latest SDL2? This may not be worth the effort, I understand...
I don't think it's impossible, but there is currently no plan to fix it.
emendelson
Forum All-Star
Posts: 1677
Joined: Tue Oct 14, 2008 12:12 am

Re: A "rootless" app running a no-desktop BasiliskII

Post by emendelson »

What I will probably do is experiment to find out which is the most recent SDL version that works with zydeco's code, and add that framework to my fork, so that anyone can build a working system even if they have a later version installed in the ~/Library/Frameworks folder in their build environment. Thank you for figuring out what is wrong.
User avatar
adespoton
Forum All-Star
Posts: 4076
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: A "rootless" app running a no-desktop BasiliskII

Post by adespoton »

emendelson wrote: Tue Oct 24, 2023 9:28 pm What I will probably do is experiment to find out which is the most recent SDL version that works with zydeco's code, and add that framework to my fork, so that anyone can build a working system even if they have a later version installed in the ~/Library/Frameworks folder in their build environment. Thank you for figuring out what is wrong.
If in doing those experiments you happen to figure out exactly what broke between versions, please let us know :)
emendelson
Forum All-Star
Posts: 1677
Joined: Tue Oct 14, 2008 12:12 am

Re: A "rootless" app running a no-desktop BasiliskII

Post by emendelson »

adespoton wrote: Tue Oct 24, 2023 9:34 pm
emendelson wrote: Tue Oct 24, 2023 9:28 pm What I will probably do is experiment to find out which is the most recent SDL version that works with zydeco's code, and add that framework to my fork, so that anyone can build a working system even if they have a later version installed in the ~/Library/Frameworks folder in their build environment. Thank you for figuring out what is wrong.
If in doing those experiments you happen to figure out exactly what broke between versions, please let us know :)
The chance that I'll be able to figure out what part of the code broke is probably zero. If you have a moment, could you look at the code that's inside the "ifdef video_rootless" blocks and see if anything jumps out at you? It's clearly something in those bits of code, but I wouldn't have any idea of how to fix it.
User avatar
adespoton
Forum All-Star
Posts: 4076
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: A "rootless" app running a no-desktop BasiliskII

Post by adespoton »

emendelson wrote: Tue Oct 24, 2023 9:37 pm
adespoton wrote: Tue Oct 24, 2023 9:34 pm
emendelson wrote: Tue Oct 24, 2023 9:28 pm What I will probably do is experiment to find out which is the most recent SDL version that works with zydeco's code, and add that framework to my fork, so that anyone can build a working system even if they have a later version installed in the ~/Library/Frameworks folder in their build environment. Thank you for figuring out what is wrong.
If in doing those experiments you happen to figure out exactly what broke between versions, please let us know :)
The chance that I'll be able to figure out what part of the code broke is probably zero. If you have a moment, could you look at the code that's inside the "ifdef video_rootless" blocks and see if anything jumps out at you? It's clearly something in those bits of code, but I wouldn't have any idea of how to fix it.
Nothing jumps out; I'd probably have to attempt to build the project and see where it breaks, then see what changed in SDL2 related to that point.
emendelson
Forum All-Star
Posts: 1677
Joined: Tue Oct 14, 2008 12:12 am

Re: A "rootless" app running a no-desktop BasiliskII

Post by emendelson »

adespoton wrote: Tue Oct 24, 2023 9:54 pm
emendelson wrote: Tue Oct 24, 2023 9:37 pm
adespoton wrote: Tue Oct 24, 2023 9:34 pm

If in doing those experiments you happen to figure out exactly what broke between versions, please let us know :)
The chance that I'll be able to figure out what part of the code broke is probably zero. If you have a moment, could you look at the code that's inside the "ifdef video_rootless" blocks and see if anything jumps out at you? It's clearly something in those bits of code, but I wouldn't have any idea of how to fix it.
Nothing jumps out; I'd probably have to attempt to build the project and see where it breaks, then see what changed in SDL2 related to that point.
According to kanjitalk755, it builds, but displays a black window. That makes things difficult...
emendelson
Forum All-Star
Posts: 1677
Joined: Tue Oct 14, 2008 12:12 am

Re: A "rootless" app running a no-desktop BasiliskII

Post by emendelson »

SDL2 2.24.2 works correctly.

2.26.0 and later versions produce a black window.

If someone can figure out what relevant detail changed in 2.26.0, then maybe this can be fixed, but I certainly can't figure it out.
User avatar
adespoton
Forum All-Star
Posts: 4076
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: A "rootless" app running a no-desktop BasiliskII

Post by adespoton »

I'll start looking through https://discourse.libsdl.org/t/sdl-upda ... ease/40325

Potential items so far:
* Updated OpenGL headers to the latest API from The Khronos Group Inc.
* Added SDL_GetWindowSizeInPixels() to get the window size in pixels, which may differ from the window coordinate size for windows with high-DPI support
* Added simulated vsync synchronization for the software renderer
* Implemented vsync synchronization on macOS 12
emendelson
Forum All-Star
Posts: 1677
Joined: Tue Oct 14, 2008 12:12 am

Re: A "rootless" app running a no-desktop BasiliskII

Post by emendelson »

And I've now updated my fork to include SDL2 2.24.2 so that it can produce usable code even if a later version is installed in the /Library/Frameworks folder when you build:

https://github.com/emendelson/macemu-rootless
Post Reply