A user-friendly launcher for Project Epoch on Apple Silicon Macs, with one-click patching of winerosetta, rosettax87 and d9vk.

## Prerequisites

Before you begin, ensure you have the following:

* A working version of **CrossOver** installed (the trial version is sufficient and can still be used after expiration).
  - You must use CrossOver v25.0.1 or later. Older versions will cause issues.
* A 3.3.5a World of Warcraft client. You can easily get the client from [Project Epoch's download page](https://project-epoch.com/play)
* Place the client in an folder you have rights to. Your user directory (example: `/Users/username/Epoch`) is a good default choice. Avoid spaces in your path!

## Credits

All credit for the core translation layer `winerosetta` and `rosettax87` goes to [**@Lifeisawful**](https://github.com/Lifeisawful). This application is merely a Fyne-based GUI wrapper to simplify the patching and launching process. 

[https://github.com/Lifeisawful/winerosetta](https://github.com/Lifeisawful/winerosetta) 

[https://github.com/Lifeisawful/rosettax87](https://github.com/Lifeisawful/rosettax87)

EpochSilicon is a fork of [https://turtlesilicon.github.io/](TurtleSilicon), credit for the base of the application goes to tairasu.

## Features

*   **Apple Silicon Compatibility:** Runs 32-bit DirectX9 World of Warcraft (v3.3.5a) on M1/M2/M3/M4 Macs without "illegal instruction" errors.
*   **Performance Optimization:** 
    *   Integrates `rosettax87` for accelerated x87 FPU instructions
    *   Uses `d9vk` for efficient DirectX9 via Vulkan/Metal translation
    *   Achieves significant FPS improvements
*   **Automated Setup:** One-click patching for both CrossOver and Epoch installations.
*   **Simple Interface:** Easy to use GUI with status indicators and configuration options.

## Usage

### Installation



### Method 1: Using the Pre-built Application

1.  Launch `EpochSilicon.app`.
2.  **Set CrossOver Path**:
    *   If CrossOver is installed in the default location (`/Applications/CrossOver.app`), this path will be pre-filled.
    *   Otherwise, click "Set/Change" and navigate to your `CrossOver.app` bundle.
3.  **Set Warcraft Directory Path**:
    *   Click "Set/Change" and select the folder where you have your WoW 3.3.5a client files.
4.  **Apply Patches**:
    *   Click "Patch Epoch".
    *   Click "Patch CrossOver".
    *   Status indicators will turn green once patching is successful for each.
6.  **Start RosettaX87 Service**:
    *   Click "Start RosettaX87 Service" and enter your sudo password when prompted.
    *   This will run the RosettaX87 service in the background and is required for launching the game.
    *   The service will automatically stop when you close the launcher.
7.  **Configure Options (Optional)**:
    *   **Enable Metal Hud**: Shows FPS counter in-game.
    *   **Show Terminal**: Displays terminal output during game launch for debugging.
8.  **Launch Game**:
    *   Once both paths are set, both components are patched, and the RosettaX87 service is running, the "Launch Game" button will become active. Click it.
9.  **Enjoy**: Experience a VM free, smoother Project Epoch on your Apple Silicon Mac!

### Method 2: Running from Source Code

If you prefer to run the application directly from source code:

1.  **Clone the repository**:
    ```sh
    git clone https://git.burkey.co/eburk/EpochSilicon
    ```

2.  **Navigate to the directory**:
    ```sh
    cd EpochSilicon
    ```

3.  **Run the application**:
    ```sh
    go run main.go
    ```
    
    Note: This method requires Go to be installed on your system. See the Build Instructions section for details on installing Go and Fyne.

4.  **Use the application** as described in Method 1 (steps 2-6).

## Recommended settings

TBD

## Build Instructions

To build this application yourself, you will need:

1.  **Go**: Make sure you have Go installed on your system. You can download it from [golang.org](https://golang.org/).
2.  **Fyne**: Install the Fyne toolkit and its dependencies by following the instructions on the [Fyne website](https://developer.fyne.io/started/).

Once Go and Fyne are set up, navigate to the project directory in your terminal and run the following command to build the application for Apple Silicon (ARM64) macOS:

### Option 1: Using the Makefile (Recommended)

The included Makefile automates the build process and handles copying the required resource files:

```sh
make
```

This will:
1. Build the application for Apple Silicon macOS
2. Automatically copy the rosettax87 and winerosetta directories to the app bundle

### Option 2: Manual Build

If you prefer to build manually:

```sh
GOOS=darwin GOARCH=arm64 fyne package
# Then manually copy the resource directories
cp -R rosettax87 winerosetta EpochSilicon.app/Contents/Resources/
```

In either case, this will create a `EpochSilicon.app` file in the project directory, which you can then run.

Make sure you have an `Icon.png` file in the root of the project directory before building.

## Bundled Binaries

The `rosettax87` and `winerosetta` components included in this application are precompiled for convenience. If you prefer, you can compile them yourself by following the instructions provided by Lifeisawful on the official repositories: 
[https://github.com/Lifeisawful/winerosetta](https://github.com/Lifeisawful/winerosetta)
[https://github.com/Lifeisawful/rosettax87](https://github.com/Lifeisawful/rosettax87)

## License

This project is licensed under the MIT License.
