Author Topic: Running FF7 on Mac OSX with WineSkin  (Read 9176 times)

Betamax

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
    • View Profile
Running FF7 on Mac OSX with WineSkin
« on: 2013-02-28 14:16:50 »
Having discovered recently that ff7 was playable under wine, I thought I'd make an attempt to get this game to run on OSX mountain lion on my retina macbook.  However, whilst I was able to piece together a solution from various snippets of information on different forums I couldn't find any step-by-step guides.  So I thought I'd write one.  It's not perfect and admittedly rather convoluted, but hopefully this info will prove useful to someone.

The main issue that I came across was installing the various game mods.  Some of the installers didn't work properly (usually due to differences command line switches between the wine and dos commands), others wouldn't run at all. So instead of installing everything directly on OSX, IMHO it is easier to setup a fully modded install under windows first, and then copy it into an OSX wineskin wrapper.  Whilst there's an existing wrapper already available at http://portingteam.com/files/file/7159-final-fantasy-vii/ , that one is only compatible with snow leopard. So if you are using lion or later, you'll need to roll your own.

Finally, I haven't tried this with the 2012 version as I don't own that.

Phase 1: Under Windows, create a working installation.

  • Install the game.  Make sure you use c:\Program Files\Square Soft, Inc\Final Fantasy VII\ as the path.  Please note that if you are using a 64-bit version of windows, this isn't the default.
  • Follow one of the various tutorials/use bootleg to mod the game.
  • Test that everything works as advertised.  It's hard enough debugging the quirks on OSX without having any extra ones introduced at this point ;).

Phase 2: Prepare the installation for transfer to OSX.

  • Copy the c:\Program Files\Square Soft, Inc\ folder to somewhere you can access under OSX. (If this folder is already accessible under OSX, you can ignore this step.)
  • You now need to grab your config settings out of the registry.  Run regedit.
  • Export the following registry branches into files located somewhere that can be accessed in OSX.  Make sure that you export the files in REGEDIT4 format:

    (for 32 bit windows)
    [HKEY_CURRENT_USER\Software\Team Avalanche]
    [HKEY_LOCAL_MACHINE\SOFTWARE\FF7Music]
    [HKEY_LOCAL_MACHINE\SOFTWARE\Square Soft, Inc.]

    (for 64 bit windows)
    [HKEY_CURRENT_USER\Software\Team Avalanche]
    [HKEY_LOCAL_MACHINE\Wow6432Node\SOFTWARE\FF7Music]
    [HKEY_LOCAL_MACHINE\Wow6432Node\SOFTWARE\Square Soft, Inc.]

  • Open the newly created reg files in a text editor. Check the following lines and edit if necessary:

    • "DataDrive"="D:\\"
    • "MIDI_data"="GENERAL_MIDI"
    • "MIDI_DeviceID"=dword:00000000
    • "Sound_GUID"=hex:35,f8,dd,a5,d1,78,d6,48,8d,28,89,df,20,93,e3,e3 (Use this for wine 1.5.1 or earlier)
    • "Sound_GUID"=hex:65,8e,d9,fb,6a,06,b3,4a,99,38,eb,70,6d,1d,58,f3 (Use this for wine 1.5.2 or later)

  • (64bit users only) Change any references of [HKEY_LOCAL_MACHINE\Wow6432Node\] to [HKEY_LOCAL_MACHINE\].

Phase 3: Under OSX, create a wineskin wrapper.

  • Download wineskin winery and install/run it ( http://wineskin.urgesoftware.com/tiki-index.php )
  • Install the latest WinSkin Engine (At time of writing WS9Wine1.5.23), and the latest wrapper (at the time of writing 2.5.8 )
  • Create a new wrapper.  When prompted call it "Final Fantasy VII"

Phase 4: Copy the game into the wrapper.

  • Right click on the newly created wrapper and choose to show contents
  • Run the winskin app contained within the wrapper, then goto advanced->tools->registry editor
  • Import the registry files that you created in Phase2.
  • Copy the Squaresoft, Inc folder from windows into the wrapper's /drive_c/Program Files Folder.

Phase 5: Passing the cd check.

  • Insert Disk 1 into your mac and use disk utility to create an image file.  Make sure you choose "DVD/CD master" as the image format. The filename should be FF7DISC1.cdr
  • Create a new folder called img located in the wrapper's /drive_c/ folder, then move the FF7DISC1.cdr file into that location.
  • We need to edit the wrappers startup/shutdown scripts so that it mounts/unmounts the image file on launch.

    • Add the following line to the end of the wrapper's Contents/Resources/WineskinStartupScript script:

                      hdiutil attach "$CONTENTSFOLD/Resources/drive_c/img/FF7DISC1.cdr"

    • Add the following line to the end of the wrapper's Contents/Resources/WineskinShutdownScript script:

                      hdiutil detach "$CONTENTSFOLD/Resources/drive_c/img/FF7DISC1.cdr"

  • Grab kranmer's anycd from this forum and copy it into the wrapper's /drive_c/Program Files/Square Soft, Inc/Final Fantasy VII/ folder.

Phase 6: Tweaking your settings and tidying up.

  • Edit your ff7_opengl.cfg file:

    • We need to use the wine version of the ff7music plugin, otherwise no music:

                        music_plugin = plugins/ff7music_wine.fgp

    • Set the windows_size variables to a resolution supported under OSX.  In my case I've used 1280x800:

                        window_size_x = 1280
                        window_size_y = 800

    • Switching on compress_textures makes the game more stable:

                        compress_textures = yes

  • Create an OSX.bat file in the wrappers /drive_c/Program Files/Square Soft, Inc/Final Fantasy VII/ folder with the following contents:

                    @ECHO OFF
                    pushd ff7music
                    start ff7music.exe
                    popd
                    FF7anyCD.exe
                    EXIT


  • Run the winskin app contained within the wrapper. Goto advanced, then set the windows exe to "/Program Files/Square Soft, Inc/Final Fantasy VII/OSX.bat". Make sure the "use start" checkbox is enabled.
  • (optional) set the version number and/or icon file (I used the icon from the porting teams original wrapper for mine).

Phase 7: Run the game.

  • Close any open copies of winskin and/or winery, then move the "Final Fantasy VII.app" bundle into /Applications
  • Double click to (hopefully) run the game.

Optional: Setup a dualshock 3 (usb only)
  • Plug in a dualshock 3 controller via usb.  OSX has drivers for it built in.
  • Download usboverdrive ( http://www.usboverdrive.com/ ), install it then configure it to map the dualshock's buttons onto the correct keyboard button. If you don't get a response from the dualshock, hold down the ps button for 3 seconds to reset it.

Optional: Playing via an Apple TV
An Apple TV?!? Ok, sure. Why not :P. It will introduce some latency though.

  • Run the winskin app contained within the wrapper. Goto advanced->tools->regedit.
  • Goto [HKEY_LOCAL_MACHINE\Software\Square Soft, Inc.\Final Fantasy VII\1.00\Sound]
  • Locate Sound_GUID. Change the value to hex:f4,0c,71,fa,de,ef,6f,4f,80,14,ba,86,36,89,21,af
  • Save and exit.
  • Switch on airplay mirroring on your mac, then run the game.

Known Issue's:

  • After about an hour or so of runtime or sooner for more graphically intensive sections, the game will load a scene with a corrupted background and will crash soon thereafter. This is due to the game running out of memory (GL_OUT_OF_MEMORY errors aplenty in app.dat). I'm still trying to figure out why, but at a guess I either need to tweak ff7_opengl.cfg/use a different/custom wine engine. Any advice would be appreciated.
  • If you have time machine enabled, everytime a backup cycle starts the game will prompt you to reinsert the cd. Hence you need to turn time machine off before playing the game.  Alternatively, you can put the following code at the end of your wrappers startup/shutdown scripts to disable/renable time machine on launch.  Please note however that enabling/disabling time machine will require you to enter your admin password.

    WineskinStartupScript:

    # check if TimeMachine is enabled and prompt the user's password to disable it
    if [[ `defaults read /Library/Preferences/com.apple.TimeMachine AutoBackup` == 1 ]]; then
       # Disable TM, then create a lock file for the shutdown script to detect
       osascript -e "do shell script \"defaults write /Library/Preferences/com.apple.TimeMachine AutoBackup -bool false\" with administrator privileges"
       touch .ff7_tc
    fi


    WineskinShutdownScript:

    # check for the TimeMachine Lock file from the startup script
    if [[ -f .ff7_tc ]]; then
       # Re-enable TM, then remove the lock file
       osascript -e "do shell script \"defaults write /Library/Preferences/com.apple.TimeMachine AutoBackup -bool true\" with administrator privileges" &
       rm .ff7_tc
    fi

  • Using the quit command from the menu will cause the game to crash.  You can use the standard cmd+Q keyboard shortcut to exit the game without it crashing.
  • FF7Config is very buggy under wine.  It'll crash if you click on the graphics tab, or try to test any sound/midi settings.  Avoid using it were possible

Revision History:
  • 1.00: Initial release
  • 1.01: Added info regarding dualshock 3
  • 1.02:
    • Updated instructions for wine > 1.5.
    • Added instructions on howto reset a non responsive dualshock
    • Added workaround for crash on exit
    • Updated info on graphic corruption.
    • Added Apple tv section.
    • Added issue regarding FF7Config
    • Created revision history :p
« Last Edit: 2013-03-02 21:56:28 by Betamax »

Klaw117

  • Fast newbie
  • *
  • Posts: 49
  • Karma: 0
    • View Profile
Re: Running FF7 on Mac OSX with WineSkin
« Reply #1 on: 2013-03-02 05:04:45 »
Regarding your first known issue, I believe that Aali's driver has memory leak issues, which causes the incomplete backgrounds. The driver keeps using up memory until you run out, forcing you to quit the game and wait for memory usage to go back down (I usually just restart when this happens).

Take note that no one has actually confirmed this, but it is my suspicion. Another member here ran into the same issue a while back.

Betamax

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
    • View Profile
Re: Running FF7 on Mac OSX with WineSkin
« Reply #2 on: 2013-03-02 10:35:29 »
I'm rapidly coming to the same conclusion here.  When running the game in wine's debug mode, I can see a bunch of wine(91058,0x41ae6c00) malloc: *** mmap(size=4194304) failed (error code=12) occurring alongside the GL_OUT_OF_MEMORY messages in app.log.  That looks roughly the size of the background textures it's trying to load at that point.   Also if I disable auto detect gpu settings and force wine's emulated vram to a stupidly high number (eg//4GB) I'm seeing a longer time before this error occurs.  So nothing concrete, but my gut is telling me there's a leak somewhere.  Of course, I can't rule out that the leak isn't in wine itself.

On the flip side, at least I figured out why WS9 based engines were crashing now. They changed the name of the sound device :roll:. I'll update above once I have some free time to do so.


ajthedj747

  • Insane poster
  • *
  • Posts: 312
  • Karma: 1
  • Looking Forward to 2017
    • View Profile
Re: Running FF7 on Mac OSX with WineSkin
« Reply #3 on: 2013-03-02 12:42:43 »
Thank you for making this tutorial.

Betamax

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
    • View Profile
Re: Running FF7 on Mac OSX with WineSkin
« Reply #4 on: 2013-03-02 20:05:46 »
You're welcome :)

BTW I've been testing a few more settings, and I've noticed the reliability improves significantly if you enable compress_tectures.  I've added that info to above.