System 7 coexisting with macOS X

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

User avatar
mabam
Master Emulator
Posts: 497
Joined: Wed Apr 10, 2013 9:32 am

Re: System 7 coexisting with macOS X

Post by mabam »

emendelson wrote:That doesn't help on this MacBook Air 2015, non-retina (of course) running Mojave:

https://imgur.com/a/2pgwUDA
Not that I want to promote DragAnyWindow, but its “Exclude” settings suggest there are differences in how certain appliciations’ redrawing behaves to dragging a window. And it lets you exclude the incompatible ones from the dragging features.

According to what you observe, that seems to apply to WordPerfect.

Image
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

Re: System 7 coexisting with macOS X

Post by emendelson »

I wish DragAnyWindow could do the job for WordPerfect, but any combination of enabling/disabling, etc., with PowerWindows installed or with PowerWindows not installed, produces no better results. It works for everything else; just not for WordPerfect. But I'm glad to have it anyway!
kanjitalk755
Apple Corer
Posts: 239
Joined: Thu Nov 09, 2017 12:06 pm

Re: System 7 coexisting with macOS X

Post by kanjitalk755 »

zydeco wrote:
emendelson wrote:Probably this is impossible, but is there any way for rootless Basilisk to refresh its windows? The apps that I've been trying (like WordPerfect for the Mac) tend to create blank windows, or windows that only show in part until you move the mouse pointer over them. I'm not at all sure that this is (1) possible and (2) practical because of the CPU power it would take, but I hope it's worth asking about.
This happens sometimes, I think it's some desync between when BasiliskII finds changes in the emulated screen, and when the transparency mask is applied. Unfortunately I haven't been able to reproduce it consistently enough to debug. If it's consistent for you, what's your setup?
I have implemented to redraw the whole screen when number of the masks increased.
Not the best, but it seems to solve the problem.

https://github.com/kanjitalk755/macemu/ ... o_rootless
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

Re: System 7 coexisting with macOS X

Post by emendelson »

That works beautifully, kanjitalk755! Thank you!!
User avatar
mabam
Master Emulator
Posts: 497
Joined: Wed Apr 10, 2013 9:32 am

Re: System 7 coexisting with macOS X

Post by mabam »

I just compiled the new code and it is also working fine here!

In my opinion, at the present state rootless mode works great and I would love to see this option merged into the master branch/standard build of Basilisk II.

What do others here think about that?
User avatar
adespoton
Forum All-Star
Posts: 4227
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: System 7 coexisting with macOS X

Post by adespoton »

I think it would be great to have as a standard option -- but it would only support macOS, which could fragment things a bit. Thoughts?
zydeco
Space Cadet
Posts: 7
Joined: Tue May 24, 2016 9:11 pm
Location: Stockholm, Sweden

Re: System 7 coexisting with macOS X

Post by zydeco »

mabam wrote:I just compiled the new code and it is also working fine here!

In my opinion, at the present state rootless mode works great and I would love to see this option merged into the master branch/standard build of Basilisk II.

What do others here think about that?
It’s still a bit flaky: some apps create windows in non-standard ways and they aren’t detected by the hooks.
And sometimes it just crashes at launch, which I haven’t been able to debug.
User avatar
mabam
Master Emulator
Posts: 497
Joined: Wed Apr 10, 2013 9:32 am

Re: System 7 coexisting with macOS X

Post by mabam »

I’ve merged zydeco’s rootless code into present kanjitalk755 code: https://github.com/mabam/macemu/tree/rootless_updated.

There’s also a binary: https://c.web.de/@337526389169198226/Yi ... XaxP0sxWmw.
(Also see this thread: viewtopic.php?p=72763#p72763.)

Only it seems the hight of macOS’s menu bar has increased a little since, as it’s not fully masked anymore. But I don’t know what exactly to amend in the code to fix it (it should be in this file though: https://github.com/mabam/macemu/blob/ro ... otless.cpp).
User avatar
adespoton
Forum All-Star
Posts: 4227
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: System 7 coexisting with macOS X

Post by adespoton »

Now it's time for some screenshots :)

As for the menu bar height, I just flipped through my screenshot collection, and it appears the menu bar is the traditional height for 10.7 through 11, but 12 has "default" set to the same as "large" in Accessibility to clear the notch on the new MBPs -- that is, Monterey essentially removed the default menu height option, at least on devices with a notch.

Not sure when that feature for two heights got introduced; it's not present in 10.7.
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

Re: System 7 coexisting with macOS X

Post by emendelson »

In Monterey, exactly as in earlier versions, the height of the menu bar remains the same with the "default" and "large" options in Accessibility->Display. The font size changes within the menu bar, not the height of the menu bar itself. The effect is very subtle.

The menu bar height is different on new MBP models, apparently. It's 36 pixels on the new machines, 22 on old ones, I believe. But the menu on the new MPB machines is (apparently) positioned higher on the screen than in older Macs.

I'm reporting what I've read. I haven't had a chance to use one of the new machines except in an Apple Store.
User avatar
mabam
Master Emulator
Posts: 497
Joined: Wed Apr 10, 2013 9:32 am

Re: System 7 coexisting with macOS X

Post by mabam »

I was mistaken regarding the menu bar height, see here: https://github.com/zydeco/macemu/commit ... t-61463795.

My intention was to use rootless Basilisk II as print server (though my banana pi based A2SERVER is still running fine). AppleTalk works but I can't reach it from the host yet (see viewtopic.php?p=72776#p72776).

But there’s nothing like an emulator running Apple Printer Utility. It’s the only software that lets you control all the settings of a LaserWriter.
I remember Linotype had a tool that had at least some of Printer Utility’s features. And I think Linotype also had a Windows version of it. But I can’t remember it’s name. I remember using the Mac version for a Linotronic imagesetter.

Image

For rootless Basilisk II, I recommend installing “DragAnyWindow” and “OtherMenu”. And I like “Appearance” just for the menus staying open without holding the mouse button in System 7.
Last edited by mabam on Tue Dec 07, 2021 1:52 am, edited 1 time in total.
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

Re: System 7 coexisting with macOS X

Post by emendelson »

This is very impressive, mabam. Thank you!
User avatar
gingerbeardman
Tinkerer
Posts: 88
Joined: Mon Aug 06, 2018 2:58 pm
Location: UK
Contact:

Re: System 7 coexisting with macOS X

Post by gingerbeardman »

@mabam could you please provide a build?

I can't build it even following the readme. (SDL2 error for SheepShaver)
• BasiliskII on iPad Pro 12.9": Macintosh IIci 32MB + System 7.5.5 + Deneba artWORKS & UltraPaint
User avatar
mabam
Master Emulator
Posts: 497
Joined: Wed Apr 10, 2013 9:32 am

Re: System 7 coexisting with macOS X

Post by mabam »

mabam wrote: Mon Dec 06, 2021 4:38 pm […]
There’s also a binary: https://c.web.de/@337526389169198226/Yi ... XaxP0sxWmw.
[…]
Only it‘s not notarised.

gingerbeardman wrote: Tue Dec 21, 2021 3:45 pm I can't build it even following the readme. (SDL2 error for SheepShaver)
zydeco’s rootless code only works for Basilisk II, though.

To be more specific:
kanjitalk755 wrote: Wed Jan 01, 2020 10:38 am
mabam wrote:And a question to kanjitalk755: Do you think the code for rootless mode could be added to SheepShaver as well?
Zydeco patched ToolBox with 68k code to achieve rootless behavior.
If the same is possible with PowerPC, I think that SheepShaver will be rootless.
I don't know if it can actually be coded.
User avatar
gingerbeardman
Tinkerer
Posts: 88
Joined: Mon Aug 06, 2018 2:58 pm
Location: UK
Contact:

Re: System 7 coexisting with macOS X

Post by gingerbeardman »

Excellent, I'll check it out. I missed the link in the earlier post.

Basilisk II and System 7 is my thing.
• BasiliskII on iPad Pro 12.9": Macintosh IIci 32MB + System 7.5.5 + Deneba artWORKS & UltraPaint
User avatar
mabam
Master Emulator
Posts: 497
Joined: Wed Apr 10, 2013 9:32 am

Re: System 7 coexisting with macOS X

Post by mabam »

You will need “DragAnyWindow” or “Power Windows”. See the discussion on how to configure them earlier in this thread.
User avatar
gingerbeardman
Tinkerer
Posts: 88
Joined: Mon Aug 06, 2018 2:58 pm
Location: UK
Contact:

Re: System 7 coexisting with macOS X

Post by gingerbeardman »

Thanks, I have DragAnyWindow installed already.

BasiliskII-rootless works a treat!
• BasiliskII on iPad Pro 12.9": Macintosh IIci 32MB + System 7.5.5 + Deneba artWORKS & UltraPaint
User avatar
gingerbeardman
Tinkerer
Posts: 88
Joined: Mon Aug 06, 2018 2:58 pm
Location: UK
Contact:

Re: System 7 coexisting with macOS X

Post by gingerbeardman »

Is this still working for people?

Just tried my old build on Monterey and it's just a regular Basilisk window?

edit: maybe I had forgotten to set screen to rootless, but i'm now using emendelson build that keeps its own prefs.
• BasiliskII on iPad Pro 12.9": Macintosh IIci 32MB + System 7.5.5 + Deneba artWORKS & UltraPaint
User avatar
mabam
Master Emulator
Posts: 497
Joined: Wed Apr 10, 2013 9:32 am

Re: System 7 coexisting with macOS X

Post by mabam »

I haven’t used it for longer. Not sure when I get to sync my repo with kanjitalk755’s up-to-date Basilisk II code. But I hope some time soon.
User avatar
gingerbeardman
Tinkerer
Posts: 88
Joined: Mon Aug 06, 2018 2:58 pm
Location: UK
Contact:

Re: System 7 coexisting with macOS X

Post by gingerbeardman »

Thanks.

It seems your build has better screen redrawing.

But I prefer the ability to keep a separate set of prefs like emendelson's build.
emendelson wrote: Sat Dec 28, 2019 12:55 pm And if anyone wants to experiment with this, here's a copy built under Mojave and notarized:
@emendelson any chance of a newer build of your rootless?
• BasiliskII on iPad Pro 12.9": Macintosh IIci 32MB + System 7.5.5 + Deneba artWORKS & UltraPaint
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

Re: System 7 coexisting with macOS X

Post by emendelson »

gingerbeardman wrote: Mon Oct 16, 2023 11:08 am
emendelson wrote: Sat Dec 28, 2019 12:55 pm And if anyone wants to experiment with this, here's a copy built under Mojave and notarized:
@emendelson any chance of a newer build of your rootless?
I'm able to build this, but I'm still trying to figure out how to specify that the prefs file should be in the same folder with the application. Replacing "HOME" with "PWD" in prefs_sdl.cpp doesn't work at all. If anyone knows the solution to this, I'll be grateful.

Meanwhile, I might make an AppleScript app that would use your Library/Application Support folder to store the prefs, disk image, etc. I did this a few years ago for my WordPerfect app, but it wasn't stable enough to go public with it.
User avatar
adespoton
Forum All-Star
Posts: 4227
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: System 7 coexisting with macOS X

Post by adespoton »

emendelson wrote: Mon Oct 16, 2023 4:30 pm
gingerbeardman wrote: Mon Oct 16, 2023 11:08 am
emendelson wrote: Sat Dec 28, 2019 12:55 pm And if anyone wants to experiment with this, here's a copy built under Mojave and notarized:
@emendelson any chance of a newer build of your rootless?
I'm able to build this, but I'm still trying to figure out how to specify that the prefs file should be in the same folder with the application. Replacing "HOME" with "PWD" in prefs_sdl.cpp doesn't work at all. If anyone knows the solution to this, I'll be grateful.

Meanwhile, I might make an AppleScript app that would use your Library/Application Support folder to store the prefs, disk image, etc. I did this a few years ago for my WordPerfect app, but it wasn't stable enough to go public with it.
The way I deal with the prefs file is I stick the BasiliskII.app inside a simple wrapper:

Code: Select all

Basilisk II.app/Contents/Info.plist
Basilisk II.app/Contents/MacOS/boot.dsk
Basilisk II.app/Contents/MacOS/BasiliskII.app
Basilisk II.app/Contents/MacOS/Config
Basilisk II.app/Contents/MacOS/launchb2.sh
Basilisk II.app/Contents/MacOS/ROM.Q650
Basilisk II.app/Contents/Resources/BasiliskII.icns
boot.dsk is the boot disk, Basiliskii.app is downloaded via here.
launchb2.sh is:

Code: Select all

#!/bin/sh
mypath=`dirname "$0"`
cd "$mypath"
./"BasiliskII.app/Contents/MacOS/BasiliskII" --config Config
Config is my standard prefs file; the rest should be self-explanatory.

What this setup DOESN'T fix is the PRAM file which still gets dropped to ~/.basilisk_ii_xpram -- which is a bit annoying as I have 14 different Basilisk II apps with embedded configs and disks, and they all stomp on each other's xpram, even though they're running everything from System 7.0 through Mac OS 7.5.1 and some of them use different ROMs.
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

Re: System 7 coexisting with macOS X

Post by emendelson »

That's exactly what I did with my WordPerfect app, but I'd like to make it easier to manage for other users. Someone who knows how to write code could probably see how to replace the "HOME" location in the source, but I can't.
User avatar
gingerbeardman
Tinkerer
Posts: 88
Joined: Mon Aug 06, 2018 2:58 pm
Location: UK
Contact:

Re: System 7 coexisting with macOS X

Post by gingerbeardman »

emendelson wrote: Mon Oct 16, 2023 4:30 pm I'm able to build this, but I'm still trying to figure out how to specify that the prefs file should be in the same folder with the application. Replacing "HOME" with "PWD" in prefs_sdl.cpp doesn't work at all. If anyone knows the solution to this, I'll be grateful.
I'll try my best!

You can probably comment out that HOME section, as below it it uses the current directory if it fails to get a value for HOME.

https://github.com/emaculation/macemu/b ... pp#L53-L58

I can try building if somebody can please let me know which code to build (that includes the latest changes for rootless and the changes in basilisk since this thread started)
• BasiliskII on iPad Pro 12.9": Macintosh IIci 32MB + System 7.5.5 + Deneba artWORKS & UltraPaint
User avatar
adespoton
Forum All-Star
Posts: 4227
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: System 7 coexisting with macOS X

Post by adespoton »

Hmm... how is it getting the value for HOME? I may want to leverage that to enable setting HOME in the config/prefs file.

If I get some time I'll try creating a patch for kanjitalk755 fork; but if someone else has time to add that in the next few weeks, I wouldn't object :)

[edit] Hmm; I don't think that's the only place HOME is checked/set, but it appears to be calling it via SDL. But... it's checking to see if vmdir is set.

Which means, it should be possible to set vmdir somewhere else.

[edit2]
https://github.com/emaculation/macemu/b ... dl.cpp#L32

Code: Select all

void SaveXPRAM(void)
{
	// Build a full-path to the file
	char full_path[4096];
	const char *dir = SDL_getenv("HOME");
	if (!dir) {
		dir = "./";
	}
	SDL_snprintf(full_path, sizeof(full_path), "%s/%s", dir, XPRAM_FILE_NAME);

	// Save the XPRAM file
	FILE *f = fopen(XPRAM_FILE_NAME, "wb");
	if (f != NULL) {
		fwrite(XPRAM, 256, 1, f);
		fclose(f);
	}
}
Yeah; instead of setting a single value somewhere in code and referencing that variable/constant in a sane way, the BII/SS code does SDL_getenv("HOME"); all over the place. And unlike for the config file, for the XPRAM file, there's no check for vmdir -- only a check for if the dir exists after attempting to set it via SDL_getenv. This means that bugs abound, as you could save the XPRAM and have it work everything out, but then have something change in the environment while the emulator is running and suddenly the file can't be saved/deleted/loaded anymore, but is written to wherever ./ happens to be, even though it's still there at ~/.basilisk_ii_xpram.

[edit3] Hah! Based on that code, I tried something, and it worked!
I added the following line to my config file:

Code: Select all

vmdir ./
And now with that, after the initial config (which is passed from the command line, all prefs and xpram values read/write to ./, which is the folder in which BasiliskII.app is run!

[edit4] ...or not. Looking at timestamps, it's still trying to write to the one in ~/ -- I KNOW I've fixed this before (which is where the local copy of the xpram came from)....
Post Reply