Windows version: update host PC icon?

About SheepShaver, a PPC Mac emulator for Windows, MacOS X, and Linux that can run System 7.5.3 to MacOS 9.0.4.

Moderators: Cat_7, Ronald P. Regensburg, ClockWise

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

Windows version: update host PC icon?

Post by emendelson »

Both BII and SheepShaver for Windows use an ugly and outdated bitmap image for the host computer, and the code for that bitmap is in the file posix_emu.cpp.

I've been trying to replace that code with C code for the Windows 11 "This PC" icon, found in various sizes in this Apple .icns file which I created here (and have been using to experiment with different sizes of the icon)

https://www.dropbox.com/s/nkz9y9p65gndd ... .icns?dl=0

I know that the GIMP app is supposed to be able to produce the appropriate C code, but I haven't been able to do this. Can anyone suggest a method that works?
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

Re: Windows version: update host PC icon?

Post by emendelson »

Well, I thought I found the answer, which was to export the new icon from GraphicConverter11 in C-code format, and I did that, and replaced the bitmap code and rebuilt. But BII still displays the old Windows-computer icon, so I seem to have modified the wrong code. Can anyone suggest a way to modify that old Windows-computer icon?
Last edited by emendelson on Fri Jan 21, 2022 1:38 am, edited 1 time in total.
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

Re: Windows version: update host PC icon?

Post by emendelson »

I'm always grateful for suggestions, but I'm talking about the WINDOWS version of BasiliskII, which does not have icons in its resource fork, because it doesn't have a resource fork. Windows programs don't have resource forks. And the icon I'm talking about is not a resource in the Windows executable; it isn't accessible from the third-party Resource Hacker program (which seems to be what you mean by Res Hacker). If Resource Hacker could find the icon, this would be effortless.

I'm talking specifically about the icon that appears on the desktop of the Windows version that represents your Windows host machine. It's the lower of the two icons shown here:

Image

I thought that icon was created from the hex code in posix_emu.cpp but probably I'm wrong. Does anyone know exactly where that icon is in the source code?
User avatar
Cat_7
Expert User
Posts: 6145
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Windows version: update host PC icon?

Post by Cat_7 »

The Windows icon is in src\Windows\posix_emu.cpp

const uint8 my_comp_icon[2670] = {

Best,
Cat_7
User avatar
adespoton
Forum All-Star
Posts: 4227
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Windows version: update host PC icon?

Post by adespoton »

OK; I've come full circle.
const uint8 my_comp_icon[2670] = {
from line 133 of BasiliskII/src/Windows/posix_emu.cpp is what's being written to the custom icon field. Instead of being the basic 256+2 field, it's a 2670 field of hex values.

I just ran those values through CyberChef, and you can make out the icon. So this is definitely a color bitmap of the Windows icon.
User avatar
adespoton
Forum All-Star
Posts: 4227
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Windows version: update host PC icon?

Post by adespoton »

And after trying to decode by hand and CyberChef, I think the easiest way to replace the icon is outlined in the comment:

// Set up an icon looking like "My Computer"
// Can be overwritten just like any other folder custom icon.

-- easiest way to replace it seems to be to set a custom icon. It must be using the standard icon format though, so someone who's looked inside Inside Macintosh recently could probably figure out the exact format. I just realized I was assuming the wrong endianness, for example xP
User avatar
adespoton
Forum All-Star
Posts: 4227
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Windows version: update host PC icon?

Post by adespoton »

I think I've found the data format in https://developer.apple.com/library/arc ... oolbox.pdf in 5-17. Time for me to stop.
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

Re: Windows version: update host PC icon?

Post by emendelson »

Again, many thanks for the detailed answer.

I already use the custom-icon method in at least one of the systems that I distribute. What I'm trying to do is replace the code that sets up the icon so that a new user, creating a new system, will not have to see that clumsy default icon. What's baffling to me is that I've replaced the byte array below the lines that you quote, but the clumsy default icon still appears. So I seem to have modified the wrong code. EDIT: though it's also possible that I need to use a different byte array, and your reply may actually point to the solution. Will experiment and report further.
Post Reply