Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to compile under macOS ? #79

Closed
wyatt-wong opened this issue Mar 25, 2023 · 23 comments
Closed

How to compile under macOS ? #79

wyatt-wong opened this issue Mar 25, 2023 · 23 comments

Comments

@wyatt-wong
Copy link
Contributor

How to compile under macOS ?

@samkusin
Copy link
Owner

I'll clarify this in the README when version 0.6 is released. But if you want to build from main, you'll need CMake and macOS Catalina or later.

After you've cloned the repo, in the source repo's root directory run:

# For debug builds , use --config=Debug
cmake -B build -DBUILD_TESTING=OFF
cmake --build build --config=Release. 

# Then run
open build/host/Clemens\ IIGS.app

Some of the README steps are out of date for running the emulator. The current version should be complete enough to use as is. There's a bug with the SmartPort hard drive emulation which I'm working on. A release with a fix should be coming out within a week.

@wyatt-wong
Copy link
Contributor Author

I'll clarify this in the README when version 0.6 is released. But if you want to build from main, you'll need CMake and macOS Catalina or later.

After you've cloned the repo, in the source repo's root directory run:

# For debug builds , use --config=Debug
cmake -B build -DBUILD_TESTING=OFF
cmake --build build --config=Release. 

# Then run
open build/host/Clemens\ IIGS.app

Some of the README steps are out of date for running the emulator. The current version should be complete enough to use as is. There's a bug with the SmartPort hard drive emulation which I'm working on. A release with a fix should be coming out within a week.

OK. I have successfully build the app and I moved it to /Applications. But I checked the README mentioned the gs_rom_3.rom should be located in the same directory as the executable, doses that mean I need to put gs_rom_3.rom in the /Applications directory as well ? That looks awkward to me since the usual practice is to put all XXXX.app under /Applications folder

@samkusin
Copy link
Owner

samkusin commented Mar 27, 2023

As you've noticed, the README isn't very clear on this. The current state of main basically renders a lot of those instructions obsolete. I'll update it - but to move you forward, you shouldn't need to perform any manual steps yourself.

When you start the application, you'll be prompted to locate a ROM file. The application will take care of copying the ROM file to your ~/Library/Application Support/cinekine/Clemens folder. That folder will then contain the ROM file, BRAM (control panel settings), configuration and imported disks. You shouldn't need to manually copy anything with the current application.

@samkusin
Copy link
Owner

0.6 will be released early next week with an updated README and perhaps a couple small UI improvements. SmartPort fixes should already be in main as of a couple hours ago.

Let me know if you have any further questions and thanks for trying this out.

@wyatt-wong
Copy link
Contributor Author

As you've noticed, the README isn't very clear on this. The current state of main basically renders a lot of those instructions obsolete. I'll update it - but to move you forward, you shouldn't need to perform any manual steps yourself.

When you start the application, you'll be prompted to locate a ROM file. The application will take care of copying the ROM file to your ~/Library/Application Support/cinekine/Clemens folder. That folder will then contain the ROM file, BRAM (control panel settings), configuration and imported disks. You shouldn't need to manually copy anything with the current application.

Actually when I open the /Applications/Clemens\ IIGS.app, I got a prompt mentioned a directory will be created under my current directory and ask me to click OK or Choose Directory. I clicked OK and I got something wrong and the application was trash. The application did NOT prompt me to locate a GS ROM file at all.

Anyway, you may have to try to build it and run under macOS (I am using Catalina) and see what happens and update the README with the proper instructions to build "Clemens IIGS.app" and run it under macOS

@samkusin
Copy link
Owner

Ok. I think I see the problem on my end. I've been testing by placing the app in a non system wide folder (I.e. running the app from the build folder.)

I'll run throw the flow you described and work on getting that to work. It's the most common flow for end users as well.

@wyatt-wong
Copy link
Contributor Author

wyatt-wong commented Apr 1, 2023

cmake -B build -DBUILD_TESTING=OFF

I downloaded the latest source and build it. Here is what I got after I copied it to /Applications folder and run it:

Screenshot 2023-04-01 at 10 47 44 AM

Screenshot 2023-04-01 at 10 50 55 AM

Screenshot 2023-04-01 at 10 51 03 AM

@samkusin
Copy link
Owner

samkusin commented Apr 1, 2023

Thanks for these screenshots - they are helpful. I'm not sure where that directory name -psn_0_893156 is coming from (I assume you didn't select 'Change Directory' to get that.)

I'll add some additional logging around the area where the directory name is generated and selected during startup. In the meantime, can you try running in the Terminal:

open '/Applications/Apple IIGS/Clemens IIGS.app'

Do you see the same behavior as above? Also what happens if you do select 'Change Directory' and change it to a location in your home directory (i.e. /Users/<your username>/Documents or even a USB volume if you don't want to alter your local SSD.)

@wyatt-wong
Copy link
Contributor Author

open '/Applications/Apple IIGS/Clemens IIGS.app'

Here is what I got:

Screenshot 2023-04-01 at 3 43 46 PM

Screenshot 2023-04-01 at 3 43 56 PM

Screenshot 2023-04-01 at 3 44 04 PM

Screenshot 2023-04-01 at 3 44 13 PM

When I choose either a GS ROM 3 or do NOT choose GS ROM 3, the Clemens IIGS.app then quit immediately.

@wyatt-wong
Copy link
Contributor Author

And even if I did not choose anything, why would the application display the directory name -psn_0_893156 for me ?

@samkusin
Copy link
Owner

samkusin commented Apr 1, 2023

And even if I did not choose anything, why would the application display the directory name -psn_0_893156 for me ?

It looks like that -psn_0_893156 value is being interpreted by the startup code as an application / command-line argument argument. The code interpreting this is here: https://github.com/samkusin/clemens_iigs/blob/main/host/clem_host_app.cpp#L35

It's a rather sloppy method of allowing users to specify their own data directory if they didn't want to use the GUI and for debugging. Now I don't know why this is happening as launching the app from Applications like that shouldn't inject command line arguments. Since this feature has been superseded by other methods, I can take this out.

What's more concerning is the ROM issue. If you browse /Users/wyattwong/Documents/ do you see a folder called cinekine? If so, can you check if there's anything in /Users/wyattwong/Documents/cinekine/Clemens. You should see a config.ini file and also a ROM file there.

Can you send me the config.ini file if you have it? Also if you launch the app from the Terminal, could you take a snapshot of any text output after running the app from there?

Thanks again for digging into this. Though I haven't seen this behavior before, if it's happening to you. it'll likely happen to a sizeable enough slice of users.

@samkusin
Copy link
Owner

samkusin commented Apr 2, 2023

Clemens IIGS.zip

I've built and verified the app in the attached archive runs on a fresh install of Catalina (10.15.7) with nothing other than Chrome installed. The app was built on my M2 under Monterey (Xcode 14 - but targeting Catalina) with the following cmake configuration and build commands (it builds a universal binary):

cd clemens_iigs
cmake -B build -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DCMAKE_BUILD_TYPE=Release
cmake --build build --config=Release --target=clemens_iigs

If you're open to trying out this binary (I understand if not due to potential security concerns), can you verify this works on your device? Note, there will be a config.ini file located in your /Users/wyattwong/Library/Application Support/cinekine/Clemens folder. If you remove it, you should be greeted with the same introductory GUI as you described above. I've also in this build taken out the code I mentioned above that may be the source of that odd directory.

@wyatt-wong
Copy link
Contributor Author

wyatt-wong commented Apr 2, 2023

Clemens IIGS.zip

I've built and verified the app in the attached archive runs on a fresh install of Catalina (10.15.7). The app was built on my M2 under Monterey (Xcode 14 - but targeting Catalina) with the following cmake configuration and build commands:


cd clemens_iigs

cmake -B build -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DCMAKE_BUILD_TYPE=Release

cmake --build build --config=Release --target=clemens_iigs

If you're open to trying out this binary (I understand if not due to potential security concerns), can you verify this works on your device? Note, there will be a config.ini file located in your /Users/wyattwong/Library/Application Support/cinekine/Clemens folder. If you remove it, you should be greeted with the same introductory GUI as you described above. I've also in this build taken out the code I mentioned above that may be the source of that odd directory.

I will rebuild it from source and test it later today. I am using the first generation of Retina MacBook Pro in Jun-2012 so I can't run your binaries.

PS: After checking your compilation switches, the binary was built for Intel so it should run in my environment fine. But still I like to build it from the source to make sure it works.

@samkusin
Copy link
Owner

samkusin commented Apr 2, 2023

Ok. I've pushed some changes in PR #85 just now to main (the specific host directory change is a one of the commits there.)

If you do build and test the latest main today if you could run the build from your command line, can you send me any terminal output from the application?

I unfortunately don't have any Mac hardware older than the Retina MB Pro 2013 model. But if you're on Catalina, then I think the GL libraries should support the 3.3 profile that supports render targets which this version requires. Since you did see some GUI, I think you're OK on that side.

@wyatt-wong
Copy link
Contributor Author

wyatt-wong commented Apr 2, 2023

/Users/wyattwong/Library/Application Support/cinekine/Clemens

I build it from the source and here is what I got when I run the application:

Screenshot 2023-04-03 at 12 10 52 AM

Screenshot 2023-04-03 at 12 08 51 AM

I would say it is perfect for the time being except a small issue that I found Command+Q couldn't exit the application. The Command+Q should be a standard key combination across all macOS applications, I suppose.

Now I need explore how to startup the IIGS.

@samkusin
Copy link
Owner

samkusin commented Apr 2, 2023

Good to hear! I'll close the issue as fixed for now. I'll also look into adding that shortcut for quitting the app. One concern I have is that the emulated machine may also need to handle that combination depending on the app.

@wyatt-wong
Copy link
Contributor Author

wyatt-wong commented Apr 2, 2023

Good to hear! I'll close the issue as fixed for now. I'll also look into adding that shortcut for quitting the app. One concern I have is that the emulated machine may also need to handle that combination depending on the app.

I can't figure out how to start either ProDOS 2.4.2 or GS/OS, but that's another issue.

And you still need to revise the README file or else I will raise a pull request

@samkusin
Copy link
Owner

samkusin commented Apr 3, 2023

If you've been able to attain disk images you can import them into the emulator by selecting one of the disk trays in the upper left part of the UI. I think the help menu icon (question mark) has a summary of what's involved.

As for the Readme, it's going through a small rewrite which will be in the 0.6 release when done

@samkusin
Copy link
Owner

samkusin commented Apr 3, 2023

If you have suggestions on UI improvements please feel free to submit issues for them. They may make it into the 0.7 release if they aren't major changes.

@samkusin samkusin closed this as completed Apr 3, 2023
@samkusin
Copy link
Owner

samkusin commented Apr 3, 2023

Again thank you for your patience. It's always good to get user feedback as I'm currently the only one using this on almost a daily basis.

@wyatt-wong
Copy link
Contributor Author

If you've been able to attain disk images you can import them into the emulator by selecting one of the disk trays in the upper left part of the UI. I think the help menu icon (question mark) has a summary of what's involved.

As for the Readme, it's going through a small rewrite which will be in the 0.6 release when done

I tried and it doesn't work.

First do I choose Disk 6 Slot 1, Disk 5 Slot 1 or the Smartport ?

I found the System 6.0.4 have a Live Install.po file so I assume I need to load it in Slot 5 Disk 1, but when I choose either Import Master Disk or Import Blank Disk option, the emulator will end up ask me to choose a destination and I found there is NONE in the dialog box for selection and I clicked Create Directory but got no response.

And the Smartport is pre-selected a .2mg file and I clicked on it and it doesn't allow me to load another .2mg file.

Maybe you should test it by yourself first. I felt I am like a beta tester rather than a normal user.

@samkusin
Copy link
Owner

samkusin commented Apr 3, 2023

I'm sorry that it's been this difficult to load your first disk. Since I've been around this interface for months, what seems straightforward to me may not be to others as you've stated above.

As mentioned earlier in the readme, this is basically alpha-level software and I'm a solo developer working on this as a hobby - which is about the story for most GitHub projects!

I think this is the roadblock you're seeing as the Live Install for System 6.0.4 is a 32MB hard disk image. I assume you're seeing the same thing I am below what I try that.

Screen Shot 2023-04-02 at 7 06 48 PM

Yes, the Smartport disk cannot be selected at this time. It's a matter of adding the interface to switch out the disk and I'll add that to the list. Probably having a separate "import disk" entry per disk slot is overly confusing.

Anyway, for now you can only use 3.5" and 5.25" disk images in Slots 5 and 6 respectively. For example, you should see this when you use the System.Disk.po GSOS 800K image from I believe the same set of images that you have:

Screen Shot 2023-04-02 at 7 08 38 PM

Then you select a location to place the imported disk image. Basically the disk image is brought into your data directory's library folder under one of the subfolders you see in that list. If there are no subfolders there, you would create a directory for it:

Screen Shot 2023-04-02 at 7 09 00 PM

Finally after clicking 'Create Directory' (or select an existing directory and press 'OK') you'll import the 800K 3.5" disk image:

Screen Shot 2023-04-02 at 7 09 05 PM

Now you would select Slot 5, Drive and you should see the newly imported image:

Screen Shot 2023-04-02 at 7 45 36 PM

And then reboot the machine (the cycle icon - yes this could be placed in a better location.)

Screen Shot 2023-04-02 at 7 46 12 PM

@wyatt-wong
Copy link
Contributor Author

wyatt-wong commented Apr 3, 2023

I'm sorry that it's been this difficult to load your first disk. Since I've been around this interface for months, what seems straightforward to me may not be to others as you've stated above.

As mentioned earlier in the readme, this is basically alpha-level software and I'm a solo developer working on this as a hobby - which is about the story for most GitHub projects!

I think this is the roadblock you're seeing as the Live Install for System 6.0.4 is a 32MB hard disk image. I assume you're seeing the same thing I am below what I try that.

Screen Shot 2023-04-02 at 7 06 48 PM

Yes, the Smartport disk cannot be selected at this time. It's a matter of adding the interface to switch out the disk and I'll add that to the list. Probably having a separate "import disk" entry per disk slot is overly confusing.

Anyway, for now you can only use 3.5" and 5.25" disk images in Slots 5 and 6 respectively. For example, you should see this when you use the System.Disk.po GSOS 800K image from I believe the same set of images that you have:

Screen Shot 2023-04-02 at 7 08 38 PM

Then you select a location to place the imported disk image. Basically the disk image is brought into your data directory's library folder under one of the subfolders you see in that list. If there are no subfolders there, you would create a directory for it:

Screen Shot 2023-04-02 at 7 09 00 PM

Finally after clicking 'Create Directory' (or select an existing directory and press 'OK') you'll import the 800K 3.5" disk image:

Screen Shot 2023-04-02 at 7 09 05 PM

Now you would select Slot 5, Drive and you should see the newly imported image:

Screen Shot 2023-04-02 at 7 45 36 PM

And then reboot the machine (the cycle icon - yes this could be placed in a better location.)

Screen Shot 2023-04-02 at 7 46 12 PM

Perhaps you missed reading my previous post. I said I clicked on the "Create Directory" and it doesn't react at all. Here is what I got:

  1. I clicked on S6, D1 and choose <import master>

Screenshot 2023-04-04 at 12 21 35 AM

  1. I choose the folder where System 6.0.4 was located:

Screenshot 2023-04-04 at 12 21 59 AM

  1. I clicked the OK button

Screenshot 2023-04-04 at 12 22 08 AM

  1. I got the dialog box of "Select Destination". When I clicked on "Create Directory", there is no response. If I click Cancel, the import master operation will fail

Screenshot 2023-04-04 at 12 22 18 AM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants