• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

[Guide] Run StarCraft in x86 Android tablet

Alan11Ma

Lurker
Jan 4, 2015
1
0
By installing "Debian noroot" and "WINE" you can run StarCraft natively in x86 Android device. No cpu emulation is needed.

This guide is for x86 (Intel) based tablet only. This should not require a rooted device. You will need enough free space in the internal storage to hold Debian noroot+wine+StarCraft CD. I am guessing about 1.5GB. It will be much easier to set up if you use a Bluetooth keyboard as some typing is needed in the Debian terminal

1. Install "Debian noroot" [by Pelya] from Google Play
https://play.google.com/store/apps/details?id=com.****ubuntu&hl=en
- recoommand also install the hacker's keryboard
https://play.google.com/store/apps/details?id=org.pocketworkstation.pckeyboard


2. In app list find "Debian" app and run it, it will download 600MB of Debian image. Once it is done you will see a Xfce desktop Environment.
3. double tap on "Enable Audio" icon to install pulseaudio package, this will download another 100MB
4. double tap on "Root Terminal" icon to launch privilige user terminal. the device back button show/hide the soft keyboard.
type "apt-get install wine"
type "apt-get install libgl1-mesa-swx11-i686" (software-based OpenGL)


5. Connect android device to Windows host. Have your Starcraft CD in CD drive. I assume CD drive is at D:
6. Android Debian have no HW openGL support, we need to tell WINE not to use opengl. Create a text file in Windows host named it something like no_opengl.reg, put following lines in it:

REGEDIT4

[HKEY_CURRENT_USER\Software\Wine\Direct3D]
"DirectDrawRenderer"="gdi"
"OffscreenRenderingMode"="backbuffer"
"RenderTargetLockMode"="disabled"

7. Download Starcarft 1.16.1 (SC-1161.exe) patch from Battle.Net support. open a windows cmd prompt, type:
adb shell mkdir /sdcard/SCCD
-this will copy all StarCraft CD files to /sdcard/SCCD/
adb push D:\* /sdcard/SCCD/
adb push SC-1161.exe /sdcard/SCCD/
-copy reg file too
adb push no_opengl.reg /sdcard/SCCD/

8. Back to device Android Debian, double tap on the terminal icon (not root terminal) to open a terminal
- to disable opengl for wine type this
regedit /sdcard/SCCD/no_opengl.reg
- now install StarCraft from SCCD
wine /sdcard/SCCD/setup.exe
- the StarCraft setup will run , install game as usual, I put game under c:\StarCraft\ for easy access
wine /sdcard/SCCD/SC-1161.exe // patch SC to latest version
- StarCraft.exe will not look for CD if you copy install.exe and put it in C:\StarCraft\StarCraft.mpq
cd .wine/drive_c/StarCraft
ln -s /sdcard/SCCD/install.exe StarCraft.mpq // symblic link works, no need to copy

9. Now shutdown Android Debian, (tap on the red arrow under "Menu" side bar)
10. Start "Debian" again , select device configuration
under video Settings -> enable 4:3 aspect ratio
- if you want mouse pointer track your touch point
under Mouse Emulation -> advance features-> disable Relative Mouse Movement
tap ok to continue
tap the screen again when you see resolution change message
tap the word "custom" and give 640 width and 480 height.
select your prefer font scale, continue to desktop

11. double tap on terminal, type "wine C:/StarCraft/StarCraft,exe" to launch StarCraft
12. If all goes well you will see the main menu and touch should works. Try start a new game. You will hear choppy or no audio. That is an known issue of Debian noroot. I have no fix for the audio at this time.
13. You can create a Xfce desktop launch icon to run game later.

P.S this process should works for other 2D Windows games that don't require CD to play.

Update: 2/4/2015: Found a way to improve choppy audio. This requires installing a modified wine-alsa driver and a pcm server inside Debian for Android. Modified wine-alsa driver send pcm samples directly to audio server which invoke Android OpenSL API to playback audio. This fixes choppy and laggy audio for Starcraft.
Disclamer: This has been tested with x86 device emulator and a x86 tablet and seems to work fine. Software are provded "as-is" with no warranty. Use at your own risk.
Download: <http://www.mediafire.com/download/z7ax5l7ttmjr6px/wine-audio-android.zip>
zip file contains 3 files:
winealsa.drv.so
wine-audio
wine-audio.reg

INSTALLATION : for Audio server and winealsa driver
1. Make sure both pulseaudio and WINE are already installed inside Debian for Android.
2. Connect Android tablet to host. From host machine transfer all 3 files to SDCARD

adb push winealsa.drv.so /sdcard/
adb push wine-audio /sdcard/
adb push wine-audio.reg /sdcard/

3. In tablet, lauch Debian for Android and open a terminal windows in desktop. use following commands to copy files from SDCARD

cd /
cp /sdcard/wine-audio .
chmod 777 wine-audio
cd /usr/lib/i386-linux-gnu/wine
mv winealsa.drv.so winealsa.drv.so-orig --- backup original winealsa.drv
cp /sdcard/winealsa.drv.so .
chmod 644 winealsa.drv.so

4. Set WINE DirectSound registry entry
regedit /sdcard/wine-audio.reg

----wine-audio.reg contains these entries
REGEDIT4

[HKEY_CURRENT_USER\Software\Wine\DirectSound]
"HalBuflen"="16384"
"SndQueueMax"="4"
-----

5. Add a command to lauch wine-audio in /proot.sh (It may be difficult to edit file on tablet. You can transfer proot.sh to host , edit it with unix text file friendly editor and transfer it back)
6. Add "./wine-audio &" to /proot.sh right after these lines:
...
done
echo "STORAGE $STORAGE"
./wine-audio & <--- new command
...
Wine-audio server will now start whenever you launch Debian chroot in Android

7. Quit Debian and launch it again to kickstart wine-audio server. Run Starcraft with WINE to check the audio.
8. If you still hear choppy audio, try edit wine-audio.reg and double the value of "HalBuflen" and "SndQueueMax"
Run "regedit wine-audio.reg" to update registry and check the audio again.

Uninstall:
Edit /proot.sh and remove the line cointains "./wine-audio &".
Open a terminal window in Debian xfce desktop and type :
cd /usr/lib/i386-linux-gnu/wine
rm winealsa.drv.so
mv winealsa.drv.so-orig winealsa.drv.so --- restore original winealsa.drv

If you want to compile wine-audio server and winealsa.drv yourself, check out the source tree at:
https://github.com/alan11ma/wine-audio-android
 
Last edited:

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones