Fix for Laggy X-Wing and TIE Fighter

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
NucAr
Tinkerer
Posts: 69
Joined: Mon Aug 13, 2012 1:42 am

Fix for Laggy X-Wing and TIE Fighter

Post by NucAr »

According to this compatibility sheet, the game Star Wars: X-Wing runs slowly in SheepShaver and Basilisk II. I have experienced this with X-Wing and TIE Fighter in SheepShaver, but I have discovered the following, which makes it run at full speed.

I was experimenting with SheepShaver in a Parallels Desktop 8 virtual machine (VM) running Mac OS X 10.7.5 (Lion). The computer is a mid-2012 15-inch MacBook Pro (non-Retina display) with a Core i7 running 10.8.2 (Mountain Lion). Running SheepShaver in that VM, both X-Wing and TIE Fighter run at full speed! My hunch is that there's something about the virtual CPU, not the graphics, that is somehow crunching the numbers differently, something to do with the JIT compiling. The host and the VM's respective SheepShavers are using the exact same settings (both using JIT compiler, but not the "experimental" 68k one).

So the lag is not due to SheepShaver inherently. It would be nice if we could figure out what's really going on, as other programs could also experience this sort of lag.
herecomethej2000
Student Driver
Posts: 22
Joined: Fri Jun 20, 2008 3:40 pm
Contact:

Re: Fix for Laggy X-Wing and TIE Fighter

Post by herecomethej2000 »

yes other games such as Chuck Yeager's Air Combat and Shockwave Assault also suffer this lag. I always assumed it had to do with rendering quickdraw stuff.
x-wing
Space Cadet
Posts: 3
Joined: Sun Feb 09, 2014 4:02 pm

Re: Fix for Laggy X-Wing and TIE Fighter

Post by x-wing »

I was really interested in getting X-Wing to work on a modern PC, and of course quite disillusioned when I saw that there doesn't seem to be any way to do that. I am really interested in the possibility mentioned in the OP, but I'm still working on getting a VM set up for that purpose.

X-Wing for the Mac is the definitive version of X-Wing which ran in 640x480. Lucasarts never made the DOS version look so good, which ran in 320x200 and is only for the DOS nostalgic. The DOS version of TIE Fighter is more or less identical to X-Wing on the Mac, and the later re-releases for Windows 95 were without the iMuse sound system and lost so much of the feel of these gems.

So, I was very motivated to get it to work. I have a decent enough machine to emulate on and SheepShaver runs very fast except of course when running X-Wing.

I'm using a 4.2GHz AMD 8350, 16GB RAM and Windows 8.1

I assume Sheepshaver is a single core program, so it is only utilizing one core of eight, but it seems to be using that core 90% to 95% when running X-Wing. The music plays on normal speed, the game is responsive outside gameplay. For example cutscenes (which I remember were really hard on my 040 Performa back in the day) play smooth as butter. The mouse in game is a bit sluggish, but all animations and sounds work 100%. If one presses escape to enter the menu, that's always super responsive. No lag like it is on a slow computer.

The base emulation is damn fast. It suffers from something else. So, I thought that I'd try Basilisk II, after all this game works fine on the 68k.

After installing Basilisk II and installing the game, I start and what I found really curious, is that it plays and feels *exactly* like in SheepShaver. It is neither faster nor slower. It's like its the same emulator - of course it isn't - but it feels like it.

The indications are exactly the same. It plays slow in exactly the same way.

I was using the latest build of SheepShaver and the latest build of Basilisk II (as of today) and Mac OS 8.6 and System 7.5.3 respectively.

Now all that remains is to attempt to run an OS X VM and Sheepshaver on top of that and see what happens. I just get the feeling that SheepShaver/Basilisk II are so close from emulating this perfectly. After all, the emulation is perfect, it's just the in game speed that is off.
NucAr
Tinkerer
Posts: 69
Joined: Mon Aug 13, 2012 1:42 am

Re: Fix for Laggy X-Wing and TIE Fighter

Post by NucAr »

First off, you're right about the Mac versions being the best. But in case anyone's interested in the Windows 95 remakes, the way to run them in modern 64-bit Windows is to follow the instructions for making a modified installation disc (image) at http://www.markusegger.at. The instructions discuss burning a physical disc, but you can simply make and use a disc image using a program such as ImgBurn, which is free.

I think herecomethej2000 is right about the slow emulation being a QuickDraw problem. When running SheepShaver in native OS X (meaning not in a VM), after completing a mission in X-Wing, the game would freeze SheepShaver. Upon unchecking "Enable QuickDraw Acceleration" in SheepShaver's preferences, this would no longer occur, but the in-flight lag would persist.

Parallels Desktop for Mac, now version 9, has very simplistic graphics drivers for OS X guests. There is no graphics acceleration such as OpenGL support. But my guess is that this simplicity actually helps the QuickDraw programs, at least in the emulators, and that the modern graphics drivers running natively on a modern computer don't really care much about such an old API. Therefore, the cause of the lag you're experiencing in the Windows versions of SheepShaver and Basilisk II is probably identical to that in native OS X and cannot be dealt with any time soon.

So go ahead and set up your OS X VM. I'd go with Parallels over VMware since we know it works. And I doubt the experience with VirtualBox would be pleasant. Make sure you use a .dmg for SheepShaver's "hard drive" (you can simply add that extension to the volume created by SheepShaver's preferences if you want). Do NOT use a .sparsebundle, as I've found that Parallels doesn't support them very well. Then, you can reach files in the host for use in the VM's SheepShaver (including a .sheepvm file if using one) via Parallels' Shared Folders, so the host's SheepShaver and VM's SheepShaver can use the same instance of Mac OS 8/9. Just try not to run both SheepShavers at the same time.

Finally, I recommend using the Mac OS 8 or 9 control strip or control panel to set the resolution to 640x480, not any larger, before playing these games. It may be my imagination, but it seems like the games freeze in-game much less often this way. Your desktop icons will look messed up, but they will be back to normal after you turn the resolution back up again.
x-wing
Space Cadet
Posts: 3
Joined: Sun Feb 09, 2014 4:02 pm

Re: Fix for Laggy X-Wing and TIE Fighter

Post by x-wing »

Thanks for the pointers, the thing about Parallels is that it isn't available for Windows, so I'll try something else. The "best" solution would probably be to fix the X-Wing Collectors' Series so the games work for modern Windows, but as I understand it they do not support mouse input, just joystick. While joystick is optimal and certainly the best way to play these games, I don't have one.

If this fails completely, I'll fix X-Wing 95 and play it with a joystick emulator for the mouse, but I'm really curious to see how far I can get in getting this amazing Mac port to work.

In direct emulation, neither SheepShaver or Basilisk II manage to emulate the game sufficiently fast at the moment, but seeing how far these emulators have come in the last 5 years I think it is something that might be achieved one day. Emulation is the only way we have to ensure that the past does not disappear into oblivion. SheepShaver and Basilisk II are pretty amazing projects.

I hope they can achieve for the Macintosh what DOSBox achieved for DOS on x86.
NucAr
Tinkerer
Posts: 69
Joined: Mon Aug 13, 2012 1:42 am

Re: Fix for Laggy X-Wing and TIE Fighter

Post by NucAr »

For the Windows X-Wing series games, use PPJoy to emulate a joystick using a mouse. The latest version can be found, for example, here (ppjoysetup-0-8-4-6.exe). In 64-bit Windows, the machine will have to be restarted to be put into "Test Mode" in order to install and run PPJoy. To get out of test mode, a cmd.exe command, which you can google, must be entered.

Edit: Another idea that just came to mind is trying the Linux version of SheepShaver in a VM, e.g. in VirtualBox. I've never used the Linux version before, though.
x-wing
Space Cadet
Posts: 3
Joined: Sun Feb 09, 2014 4:02 pm

Re: Fix for Laggy X-Wing and TIE Fighter

Post by x-wing »

That's a good idea! I have not been successful in getting OS X to work in a VM yet, so I might just have to try it. I don't have much experience with Linux but I think I can set it up. :)
NucAr
Tinkerer
Posts: 69
Joined: Mon Aug 13, 2012 1:42 am

Re: Fix for Laggy X-Wing and TIE Fighter

Post by NucAr »

Apple does not allow OS X to be run, virtualized or not, on non-Apple hardware. For this reason, no virtualization software for Windows PCs officially supports OS X guests. So setting up an OS X VM on a Windows PC, with sound and file sharing and all, would involve some skillful hacking, which is probably not the solution you're interested in.
Post Reply