Giter Club home page Giter Club logo

touchhle's Introduction

touchHLE: high-level emulator for iPhone OS apps

touchHLE is a high-level emulator for iPhone OS apps. It runs on modern desktop operating systems and Android, and is written in Rust.

touchHLE's high-level emulation (HLE) approach differs from low-level emulation (LLE) in that it does not directly simulate the iPhone/iPod touch hardware. Instead of running iPhone OS inside emulation, touchHLE itself takes the place of iPhone OS and provides its own implementations of the system frameworks (Foundation, UIKit, OpenGL ES, OpenAL, etc). The only code the emulated CPU executes is the app binary and a handful of libraries.

The goal of this project is to run games from the early days of iOS:

  • Currently: iPhone and iPod touch apps for iPhone OS 2.x and iPhone OS 3.0. (iPhone OS 3.0 support is a recent addition and is not in a release yet.)
  • Longer term: iPhone OS 3.1, iPad apps (iPhone OS 3.2), iOS 4.x, …
  • Never: 64-bit iOS.

Support for apps that aren't games isn't a priority: it's more complex and less fun.

The touchHLE app compatibility database tracks which apps work in touchHLE. It is a crowdsourced effort to which anyone can contribute.

If you're curious about the history and motivation behind the project, you might want to read the original announcement. For an introduction to some of the technical details, check out touchHLE in depth.

Important disclaimer

This project is not affiliated with or endorsed by Apple Inc in any way. iPhone, iOS, iPod, iPod touch and iPad are trademarks of Apple Inc in the United States and other countries.

Only use touchHLE to emulate software you have obtained legally.

Platform support

  • Officially supported: x64 Windows, x64 macOS and AArch64 Android.
    • These are the platforms with binary releases.
    • If you're an Apple Silicon Mac user, the x64 build reportedly works in Rosetta.
  • Probably works, but you must build it yourself: AArch64 macOS, x64 Linux, AArch64 Linux.
  • Never?: other architectures.

Input methods:

  • For simulated touch input, there are four options:
    • Mouse/trackpad input (tap/hold/drag by pressing the left mouse button)
    • Virtual cursor using a game controller (move the cursor with the right analog stick , and tap/hold/drag by pressing the stick or the right shoulder button)
    • Mapping of game controller buttons (see the description of --button-to-touch= in OPTIONS_HELP.txt)
    • Real touch input, if you're on a device that has a touch screen
  • For simulated accelerometer input, there are two options:
    • Tilt control simulation using the left analog stick of a game controller
    • Real accelerometer input, if you are using a phone, tablet or some other device with a built-in accelerometer (TODO: support game controllers with accelerometers)
      • This apparently doesn't work on certain Android devices, particularly Xiaomi/MIUI devices, but we don't know why

Development status

Real development started in December 2022. This is so far a single person's full-time passion project; please consider helping me to keep doing this by donating! There are also a number of volunteers contributing in their free time. There's only been a handful of releases so far and no promises can be made about the future. Please be patient.

In general, the supported functionality is defined by the supported apps: most contributors are interested in getting a particular game working, and contribute support for whichever missing features are needed for that game. Consequently, the completeness varies a lot between APIs, e.g. UIKit is easily the most hacky and incomplete of the large frameworks that have been implemented, because most games don't use very much of its functionality, whereas the OpenGL ES and OpenAL implementations are probably complete enough to cover a large number of early apps, because games make heavy use of these.

Usage

First obtain touchHLE, either a binary release or by building it yourself (see the next section).

You'll then need an app that you can run. The app compatibility database is a good guide for which versions of which apps are known to work, but bear in mind that it may contain outdated or inaccurate information. Note that the app binary must be decrypted to be usable.

There's a few ways you can run an app in touchHLE.

Special Android notes

Windows, Mac and Linux users can skip this section.

On Android, only the graphical user interface (app picker) is available. Therefore, you must put your “.ipa” files or “.app” bundles inside the “touchHLE_apps” directory. Note that you can only do that once you have run touchHLE at least once.

File management can be tricky on Android due to restrictions introduced by Google in newer Android versions. One of these methods may work:

  • If you tap the “Open file manager” button in touchHLE, this should open some sort of file manager. You might also be able to find touchHLE in your device's file manager app (often called “Files”, or sometimes “Downloads”), alongside cloud storage services. There are some limitations on what kinds of operations are possible. The files in this location are stored on your device. Warning: on some devices, the “Open file manager” button will open a file manager, but it will crash when actually doing file operations (this is probably a bug in Android, we have not been able to debug it). If this happens to you, clear that file manager from your recent apps list and try to navigate to your device's file manager app directly instead, rather than via the touchHLE UI.
  • If you have an older version of Android, you may be able to directly access touchHLE's files by browsing to /sdcard/Android/data/org.touchhle.android/files/touchHLE_apps. Note that the /sdcard directory is usually not on the SD card.
  • You may be able to use ADB. If you're unfamiliar with ADB, try using https://yume-chan.github.io/ya-webadb/ (in Google Chrome or another browser with WebUSB) with your device connected over USB. touchHLE's files can be found in “sdcard” > “Android” > “data” > “org.touchhle.android” > “files” > “touchHLE_apps”.

Graphical user interface

touchHLE has a built-in app picker. If you put your .ipa files and .app bundles in the touchHLE_apps directory, they will show up in the app picker when you run touchHLE.

To configure the options, you can edit the touchHLE_options.txt file. To get a list of options, look in the OPTIONS_HELP.txt file.

Command-line user interface

This section does not apply on Android.

You can see the command-line usage by passing the --help flag.

If you're a Windows user and unfamiliar with the command line, these instructions may help you get started:

  1. Move the .ipa file or .app bundle to the same folder as touchHLE.exe.
  2. Hold the Shift key and right-click on the empty space in the folder window.
  3. Click “Open with PowerShell”.
  4. Type .\touchHLE.exe "YourAppNameHere.ipa" (or .app as appropriate) and press Enter. If you want to specify options, add a space after the app name (outside the quotes) and then type the options, separated by spaces.

Other stuff

Any data saved by the app (e.g. saved games) are stored in the touchHLE_sandbox folder.

If the emulator crashes almost immediately while running a known-working version of a game, please check whether you have any overlays turned on like the Steam overlay, Discord overlay, RivaTuner Statistics Server, etc. Sadly, as useful as these tools are, they work by injecting themselves into other apps or games and don't always clean up after themselves, so they can break touchHLE… it's not our fault. 😢 Currently only RivaTuner Statistics Server is known to be a problem. If you find another overlay that doesn't work, please tell us about it.

Building and contributing

See the CONTRIBUTING.md file in the git repo if you want to contribute. If you just want build touchHLE, look at dev-docs/building.md.

License

touchHLE © 2023 hikari_no_yume and other contributors.

The source code of touchHLE itself (not its dependencies) is licensed under the Mozilla Public License, version 2.0.

Due to license compatibility concerns, binaries are under the GNU General Public License version 3 or later.

For a best effort listing of all licenses of dependencies, build touchHLE and pass the --copyright flag when running it, or click the “Copyright info” button in the app picker.

Please note that different licensing terms apply to the bundled dynamic libraries (in touchHLE_dylibs/) and fonts (in touchHLE_fonts/). Please consult the respective directories for more information.

Thanks

We stand on the shoulders of giants. Thank you to:

touchhle's People

Contributors

alborrajo avatar ciciplusplus avatar dcnick3 avatar dylanpdx avatar geffdev avatar hikari-no-yume avatar kiritodv avatar lennykappa avatar nighto avatar nitinseshadri avatar tylerjaacks avatar upintheairsheep avatar whatamisupposedtoputhere avatar xertes0 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

touchhle's Issues

Use anyhow or some other systematic error handling approach

Currently, some errors are handled as just Result<T, &'static str> or Result<T, String>. While this may be fine in some cases, I suggest using a more systematic approach, like, for example, anyhow provides.

Once of its nicer features is providing context to previous errors, giving nicer error messages overall.

For example:

fn work_with_files() -> anyhow::Result {
  std::fs::read("hello.txt").context("reading hello.txt")?;
  std::fs::write("bye.txt", "sayonara").context("writing bye.txt")?;
}

When printing the error not only the underlying IoError will be printed, but the context chain as well, like:

reading hello.txt
Caused by:
- Os { code: 9, kind: Uncategorized, message: "Bad file descriptor" }

Maybe you should also consider snafu: it gives similar features (context too), but allows you to type all your errors (still providing the Whatever escape hatch). This might be useful for exposing errors to the guest, as they are expected to be classified as some errno code, which is not easy for pure string errors...

Find a way to systematically implement OpenGL state accessor functions

There are a lot of things that could be improved about the GLES-1.1-on-GL-2.1 layer we have right now. This issue is about one of the areas that most badly needs attention.

This commit is a good example of the problem: 8e9eb0c. (Warning: glTexEnv's documentation (both for GLES 1.1 and for GL 2.1) is a nightmare to try to comprehend if you need to know the names and types for the parameters it can set. Thankfully, there is a more helpful listing in the State Tables section of the GLES 1.1 specification.)

OpenGL has a lot of function families following a pattern like:

glFooBari(GLenum target, GLenum pname, GLint value);
glFooBarf(GLenum target, GLenum pname, GLfloat value);
glFooBarx(GLenum target, GLenum pname, GLfixed value);
glFooBariv(GLenum target, GLenum pname, const GLint *values);
glFooBarfv(GLenum target, GLenum pname, const GLfloat *values);
glFooBarxv(GLenum target, GLenum pname, const GLfixed *values);

These are all interchangeable! This makes it difficult to systematically handle every possibility. Among other things, our layer must:

  • Validate that the parameter name (enum value) is one we support.
  • Find out how many values should be associated with that parameter.
  • Support using mismatched integer/float types and letting the runtime convert (integer -> float, float -> integer).
  • Support using fixed-point types and doing the conversion ourselves (float -> fixed-point).
  • Support using mismatched fixed-point types and not doing any conversion ourselves (fixed-point reinterpreted as integer). Yes, that's what the standard requires…
  • Do all of the above both for single-value and multiple-value cases.

I think glTexEnv is the only function family that actually does all of these right now, and it's very verbose. It wasn't much fun to write and it's difficult to read it and be sure it's correct.

At the very least we probably need some helper macros, but I wonder if we could somehow generate the code programmatically. I'm guessing the state tables aren't available in a machine-readable format, though. 😢

The website is broken on Android in Chrome-based browsers

Not sure if issues with the website belong in this repo, but it feels like a good place to put a notice about this as a reminder to myself, and so that fewer people ask me about it.

The site is made with Dashcode, which is software even more ancient than iPhone OS, so I'm not sure how easy this is to fix.

By the way: if you have an Android phone and know how to use the Chrome developer tools with it, I'd really appreciate getting a copy of the debug log. Even better, if you happen to be skilled with JS/DOM debugging and can tell me what the underlying issue is, that'd be great!

Not all Info.plist files have a CFBundleName (thread 'main' panicked at 'IndexMap: key not found', src\bundle.rs:50:27)

PS D:\다운로드\touchHLE_v0.1.0_Windows_x86_64> .\touchHLE.exe "OvenBreak.app"
touchHLE v0.1.0 — https://touchhle.org/

thread 'main' panicked at 'IndexMap: key not found', src\bundle.rs:50:27
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

This happen when I try to run Ovenbreak (paid version) 1.09 ~ 1.12 ipa.

PS D:\다운로드\touchHLE_v0.1.0_Windows_x86_64> .\touchHLE.exe "OvenBreak.app"
touchHLE v0.1.0 — https://touchhle.org/

Error: "Could not parse icon image"

As an aside, this error happen when I try to run Ovenbreak (paid version) 1.0 ~ 1.08 ipa, but seems like it already commented on other thread.

Map taps of any coordinate to inputs

For instance, you could pause a game or use an item in Crash Bandicoot Nitro Kart 3D, all from the comfort of your own controller. There was an old app for jailbroken devices called Blutrol that could do this.

A pretty launcher for your app collection

Perhaps something that resembles Springboard (the iOS home screen).

I think it would be cute if we could implement this using touchHLE's implementation of UIKit. That would require the UIKit implementation to be significantly improved of course. ;)

To be clear: we won't and can't use iOS's actual launcher, and we should probably steer clear of imitating it too closely in look and feel, due to the legal hazard.

Meta-issue for hot loop performance stuff

We're lucky that Super Monkey Ball runs so well, there's been almost no performance optimisation effort put into this emulator so far. But that's no reason not to strive to improve! There's many potentially slow things we do that could be improved:

  • No fastmem, dynarmic has to do all memory accesses through callbacks. Easy to fix though a risk for memory leaks and less-debuggable crashes considering that all pages are readable and writeable right now.
  • Tons of HashMap lookups happen when dispatching an Objective-C message send
  • Host-to-host message sends are especially inefficient right now, they look up the selector and sometimes class each time
  • The way guest-to-host calls work might not be optimally efficient?
  • There is no proper event loop, we just do polling every now and then sleep for five milliseconds inside ns_run_loop. Obviously not ideal, it was an expedient hack to bring down the CPU and energy use before the first release.

But this is all just speculation, what's really needed is to do some performance profiling on the hot code.

Android port?

Hello i have been using your emulator and its pretty good, can you pleeease make an andriod port uwu

sysctl customization "iPhone1,1", etc

Please make a flag in the future to change the device string spoofed by sysctl. This is useful for bypassing incompatibility messages in the future, or getting different screen sizes as well.

Cannot run on macOS

So I tried running Monkey Ball on touchHLE with an M1 MacBook and this is what it always says:
The application cannot be opened for an unexpected reason, error=Error Domain=NSOSStatusErrorDomain Code=-10661 "(null)" UserInfo={_LSLine=4101, _LSFunction=_LSOpenStuffCallLocal}
This doesn't appear on my Windows PC trying to run the exact same app.

Windows build question - small BUILDING.md improvement proposal

Hi there, so I am using Windows 11 and following instructions to build touchHLE on my end.

I have downloaded boost from their website, and extracted it to vendor/boost directory. So the file structure is: vendor/boost/boost_1_81_0.

That might be wrong because the build is failing with the following log:

PS D:\Users\APereira\src\touchHLE> cargo run
   Compiling sdl2 v0.35.1
   Compiling touchHLE_dynarmic_wrapper v0.1.0 (D:\Users\APereira\src\touchHLE\src\cpu\dynarmic_wrapper)
   Compiling sdl2-sys v0.35.1
   Compiling touchHLE_openal_soft_wrapper v0.1.0 (D:\Users\APereira\src\touchHLE\src\audio\openal_soft_wrapper)
   Compiling touchHLE v0.1.0 (D:\Users\APereira\src\touchHLE)
error: failed to run custom build command for `touchHLE_dynarmic_wrapper v0.1.0 (D:\Users\APereira\src\touchHLE\src\cpu\dynarmic_wrapper)`

Caused by:
  process didn't exit successfully: `D:\Users\APereira\src\touchHLE\target\debug\build\touchHLE_dynarmic_wrapper-6fd497a82964d59d\build-script-build` (exit code: 101)
  --- stdout
  CMAKE_TOOLCHAIN_FILE_x86_64-pc-windows-msvc = None
  CMAKE_TOOLCHAIN_FILE_x86_64_pc_windows_msvc = None
  HOST_CMAKE_TOOLCHAIN_FILE = None
  CMAKE_TOOLCHAIN_FILE = None
  CMAKE_GENERATOR_x86_64-pc-windows-msvc = None
  CMAKE_GENERATOR_x86_64_pc_windows_msvc = None
  HOST_CMAKE_GENERATOR = None
  CMAKE_GENERATOR = None
  CMAKE_PREFIX_PATH_x86_64-pc-windows-msvc = None
  CMAKE_PREFIX_PATH_x86_64_pc_windows_msvc = None
  HOST_CMAKE_PREFIX_PATH = None
  CMAKE_PREFIX_PATH = None
  CMAKE_x86_64-pc-windows-msvc = None
  CMAKE_x86_64_pc_windows_msvc = None
  HOST_CMAKE = None
  CMAKE = None
  running: "cmake" "D:\\Users\\APereira\\src\\touchHLE\\src\\cpu\\dynarmic_wrapper\\../../..\\vendor/dynarmic" "-G" "Visual Studio 17 2022" "-Thost=x64" "-Ax64" "-DDYNARMIC_WARNINGS_AS_ERRORS=OFF" "-DDYNARMIC_TESTS=OFF" "-DBoost_INCLUDE_DIR=D:\\Users\\APereira\\src\\touchHLE\\src\\cpu\\dynarmic_wrapper\\../../..\\vendor/boost" "-DCMAKE_INSTALL_PREFIX=D:\\Users\\APereira\\src\\touchHLE\\target\\debug\\build\\touchHLE_dynarmic_wrapper-4f0f57d37945b485\\out" "-DCMAKE_C_FLAGS= -nologo -MD -Brepro" "-DCMAKE_C_FLAGS_DEBUG= -nologo -MD -Brepro" "-DCMAKE_CXX_FLAGS= -nologo -MD -Brepro" "-DCMAKE_CXX_FLAGS_DEBUG= -nologo -MD -Brepro" "-DCMAKE_ASM_FLAGS= -nologo -MD -Brepro" "-DCMAKE_ASM_FLAGS_DEBUG= -nologo -MD -Brepro" "-DCMAKE_BUILD_TYPE=Debug"
  -- Target architecture: x86_64
  -- Configuring incomplete, errors occurred!
  See also "D:/Users/APereira/src/touchHLE/target/debug/build/touchHLE_dynarmic_wrapper-4f0f57d37945b485/out/build/CMakeFiles/CMakeOutput.log".
  See also "D:/Users/APereira/src/touchHLE/target/debug/build/touchHLE_dynarmic_wrapper-4f0f57d37945b485/out/build/CMakeFiles/CMakeError.log".

  --- stderr
  CMake Error at C:/Program Files/CMake/share/cmake-3.25/Modules/FindBoost.cmake:1826 (file):
    file STRINGS file
    "D:\Users\APereira\src\touchHLE\src\cpu\dynarmic_wrapper\../../..\vendor/boost/boost/version.hpp"
    cannot be read.
  Call Stack (most recent call first):
    CMakeLists.txt:127 (find_package)


  CMake Error at C:/Program Files/CMake/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:225 (set):
    Syntax error in cmake code at

      C:/Program Files/CMake/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:225

    when parsing string

      Could NOT find Boost: Found unsuitable version "0.0.0", but required is at least "1.57" (found D:\Users\APereira\src\touchHLE\src\cpu\dynarmic_wrapper\../../..\vendor/boost, )

    Invalid character escape '\U'.
  Call Stack (most recent call first):
    C:/Program Files/CMake/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:598 (_FPHSA_FAILURE_MESSAGE)
    C:/Program Files/CMake/share/cmake-3.25/Modules/FindBoost.cmake:2377 (find_package_handle_standard_args)
    CMakeLists.txt:127 (find_package)


  thread 'main' panicked at '
  command did not execute successfully, got: exit code: 1

  build script failed, must exit now', D:\Users\APereira\.cargo\registry\src\github.com-1ecc6299db9ec823\cmake-0.1.49\src\lib.rs:1104:5
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

I see that it tries to read vendor/boost/boost and the boost_1_81_0 has a boost directory inside, so maybe the instructions could be updated to "From the boost zip package, extract the contents of boost_n_nn_n directory to vendor/boost directory" to make it clearer. Can I propose a small PR to update it? :)

Sharing some logs you may find helpful

Thanks for creating this project first of all. I tested touchHLE with a collection of around 1,000 outdated/abandonware apps from the iPhone OS 2.x era and redirected the logs to text files for your convenience.

As to be expected, nearly every app either refuses to load outright or crashes the emulator shortly after startup. The only exceptions are Super Monkey Ball (obviously) and Dungeon and Hero, which freezes at the Chillingo logo and only crashes once the game window is clicked.

I'll probably update this issue with new logs whenever there's an update. Looking forward to the future of the project.

Logs.zip

Poor quality text rendering: overlapping letters (particularly W and A) cut eachother off

You can notice this especially in some of the tutorial and instruction screens in Super Monkey Ball.

This happens because of how cg_bitmap_context.rs, ui_font.rs and font.rs interact. In short: there's no blending done, so transparent pixels (strictly speaking, texels) in one character's rectangle can obscure opaque pixels from an overlapping one.

A quick fix would be to add blending in cg_bitmap_context.rs, and that definitely should be done eventually, but I bet that falls down if you want to do stuff like rendering text with semi-transparency. Although to be fair, I've no idea if iPhone OS itself can do that correctly.

Don't try to write in the installation directory

While a point could be made for touchHLE_fonts and touchHLE_dylibs (it's not what you expect on Linux, but, it's not a center of the universe ig), I think writing to directories near the executable (like touchHLE_sandbox) is not something expected of desktop app nowadays.

If you install the app into a system-wide directory (like C:\Program Files or /usr/share), you can't really write there.

I recommend using data_dir function in dirs-next to locate a directory for your application data. This (usually, the os-specific logic is kinda complicated) corresponds to the following locations in different OSes:

  • C:\Users\Alice\AppData\Roaming on Windows
  • /home/alice/.local/share on Linux
  • /Users/Alice/Library/Application Support on macOS

More prominently warn the user if there's no controller connected

I think it's easy to miss the current warning that's logged in the terminal. We could display it in a more obvious, GUI way. Not completely sure about this since it could be quite annoying though.

sdl2::messagebox would be an easy way to do it, but I think people who don't have their controller connected all the time might get frustrated at having to dismiss the prompt.

Maybe ImGui would be good for this?

Assertion Failed error when launching Monkey Ball

I tried running Monkey Ball (all versions) on Windows following the instructions as exactly stated, but when I launch the game, it opens and shows a splash screen for a split-second, then immediately closes. I compared it with another user's error log and I seem to be getting an assertion failure error of some sort, could anyone look into this?
message.txt

SDL Wayland failure on final linking

Steam OS on Steam Deck

Finally got all the dependencies going but it failed on final linking

(deck@steamdeck touchHLE)$ cargo run --release
   Compiling sdl2-sys v0.35.1
   Compiling touchHLE_dynarmic_wrapper v0.1.0 (/home/deck/build/touchHLE/src/cpu/dynarmic_wrapper)
   Compiling sdl2 v0.35.1
   Compiling touchHLE v0.1.0 (/home/deck/build/touchHLE)
warning: /home/deck/build/touchHLE/src/cpu/dynarmic_wrapper/lib.cpp: In member function ‘int32_t touchHLE::cpu::DynarmicWrapper::run(touchHLE::cpu::touchHLE_Mem*, uint64_t*)’:
warning: /home/deck/build/touchHLE/src/cpu/dynarmic_wrapper/lib.cpp:173:38: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 2 has type ‘Dynarmic::HaltReason’ [-Wformat=]
warning:   173 |       printf("unhandled halt reason %u\n", hr);
warning:       |                                     ~^     ~~
warning:       |                                      |     |
warning:       |                                      |     Dynarmic::HaltReason
warning:       |                                      unsigned int
error: linking with `cc` failed: exit status: 1
  |
  = note: "cc" "-m64" "/tmp/rustcRv2rU7/symbols.o" "/home/deck/build/touchHLE/target/release/deps/touchHLE-a6338ae14b589d18.touchHLE.dd5f5e18-cgu.0.rcgu.o" "/home/deck/build/touchHLE/target/release/deps/touchHLE-a6338ae14b589d18.touchHLE.dd5f5e18-cgu.1.rcgu.o" "/home/deck/build/touchHLE/target/release/deps/touchHLE-a6338ae14b589d18.touchHLE.dd5f5e18-cgu.10.rcgu.o" "/home/deck/build/touchHLE/target/release/deps/touchHLE-a6338ae14b589d18.touchHLE.dd5f5e18-cgu.11.rcgu.o" "/home/deck/build/touchHLE/target/release/deps/touchHLE-a6338ae14b589d18.touchHLE.dd5f5e18-cgu.12.rcgu.o" "/home/deck/build/touchHLE/target/release/deps/touchHLE-a6338ae14b589d18.touchHLE.dd5f5e18-cgu.13.rcgu.o" "/home/deck/build/touchHLE/target/release/deps/touchHLE-a6338ae14b589d18.touchHLE.dd5f5e18-cgu.14.rcgu.o" "/home/deck/build/touchHLE/target/release/deps/touchHLE-a6338ae14b589d18.touchHLE.dd5f5e18-cgu.15.rcgu.o" "/home/deck/build/touchHLE/target/release/deps/touchHLE-a6338ae14b589d18.touchHLE.dd5f5e18-cgu.2.rcgu.o" "/home/deck/build/touchHLE/target/release/deps/touchHLE-a6338ae14b589d18.touchHLE.dd5f5e18-cgu.3.rcgu.o" "/home/deck/build/touchHLE/target/release/deps/touchHLE-a6338ae14b589d18.touchHLE.dd5f5e18-cgu.4.rcgu.o" "/home/deck/build/touchHLE/target/release/deps/touchHLE-a6338ae14b589d18.touchHLE.dd5f5e18-cgu.5.rcgu.o" "/home/deck/build/touchHLE/target/release/deps/touchHLE-a6338ae14b589d18.touchHLE.dd5f5e18-cgu.6.rcgu.o" "/home/deck/build/touchHLE/target/release/deps/touchHLE-a6338ae14b589d18.touchHLE.dd5f5e18-cgu.7.rcgu.o" "/home/deck/build/touchHLE/target/release/deps/touchHLE-a6338ae14b589d18.touchHLE.dd5f5e18-cgu.8.rcgu.o" "/home/deck/build/touchHLE/target/release/deps/touchHLE-a6338ae14b589d18.touchHLE.dd5f5e18-cgu.9.rcgu.o" "/home/deck/build/touchHLE/target/release/deps/touchHLE-a6338ae14b589d18.1symld0vefltubw7.rcgu.o" "-Wl,--as-needed" "-L" "/home/deck/build/touchHLE/target/release/deps" "-L" "/home/deck/build/touchHLE/target/release/build/sdl2-sys-9ff28d10e285166e/out/lib" "-L" "/home/deck/build/touchHLE/target/release/build/touchHLE_dynarmic_wrapper-6c8028f864a1246b/out/lib" "-L" "/home/deck/build/touchHLE/target/release/build/touchHLE_dynarmic_wrapper-6c8028f864a1246b/out/lib64" "-L" "/home/deck/build/touchHLE/target/release/build/touchHLE_dynarmic_wrapper-6c8028f864a1246b/out/build/externals/fmt/" "-L" "/home/deck/build/touchHLE/target/release/build/touchHLE_dynarmic_wrapper-6c8028f864a1246b/out/build/externals/mcl/src/" "-L" "/home/deck/build/touchHLE/target/release/build/touchHLE_dynarmic_wrapper-6c8028f864a1246b/out/build/externals/zydis/" "-L" "/home/deck/build/touchHLE/target/release/build/touchHLE_dynarmic_wrapper-6c8028f864a1246b/out" "-L" "/home/deck/build/touchHLE/target/release/build/touchHLE_openal_soft_wrapper-b96ac8e3604ee592/out/lib" "-L" "/home/deck/build/touchHLE/target/release/build/touchHLE_openal_soft_wrapper-b96ac8e3604ee592/out/lib64" "-L" "/home/deck/build/touchHLE/target/release/build/touchHLE_stb_image_wrapper-196cf62604b32558/out" "-L" "/home/deck/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/home/deck/build/touchHLE/target/release/deps/libcaf-70e444a5766d1ed7.rlib" "/home/deck/build/touchHLE/target/release/deps/libhound-fe46169102ceffc2.rlib" "/home/deck/build/touchHLE/target/release/deps/libtouchHLE_gl_bindings-87125c3eb3d39abc.rlib" "/home/deck/build/touchHLE/target/release/deps/libsdl2-26c82b8009c3f4b6.rlib" "/home/deck/build/touchHLE/target/release/deps/libsdl2_sys-28baec4d6fde2b80.rlib" "/home/deck/build/touchHLE/target/release/deps/libmach_object-942bdb1548f0df07.rlib" "/home/deck/build/touchHLE/target/release/deps/liblibc-4c131b5db9bfdab1.rlib" "/home/deck/build/touchHLE/target/release/deps/libthiserror-f7109fc6aa4e0b24.rlib" "/home/deck/build/touchHLE/target/release/deps/libuuid-7fea2c62de4293a8.rlib" "/home/deck/build/touchHLE/target/release/deps/libbyteorder-4e5cdfb579a00f9b.rlib" "/home/deck/build/touchHLE/target/release/deps/liblog-ce0285bbb16e858e.rlib" "/home/deck/build/touchHLE/target/release/deps/libcfg_if-5b8144915620281b.rlib" "/home/deck/build/touchHLE/target/release/deps/liblazy_static-e4c33e1ba5d50820.rlib" "/home/deck/build/touchHLE/target/release/deps/libbitflags-e9d78eb3a2a37b57.rlib" "/home/deck/build/touchHLE/target/release/deps/libtouchHLE_stb_image_wrapper-6192de0cb2cd9940.rlib" "/home/deck/build/touchHLE/target/release/deps/librusttype-f8c29c52e8fb1cc8.rlib" "/home/deck/build/touchHLE/target/release/deps/libab_glyph_rasterizer-20077331218a1250.rlib" "/home/deck/build/touchHLE/target/release/deps/libowned_ttf_parser-1788f6424a0550aa.rlib" "/home/deck/build/touchHLE/target/release/deps/libttf_parser-eb6c76f8aabfe0e4.rlib" "/home/deck/build/touchHLE/target/release/deps/libtouchHLE_dynarmic_wrapper-4e4e4d0008e7d133.rlib" "/home/deck/build/touchHLE/target/release/deps/libplist-24187fefef836bb1.rlib" "/home/deck/build/touchHLE/target/release/deps/libtime-6f6bad996f951a1a.rlib" "/home/deck/build/touchHLE/target/release/deps/libitoa-4e588e78b0f4ee18.rlib" "/home/deck/build/touchHLE/target/release/deps/libtime_core-a554233c7157c2cc.rlib" "/home/deck/build/touchHLE/target/release/deps/libline_wrap-c83eec083dd35b29.rlib" "/home/deck/build/touchHLE/target/release/deps/libsafemem-98bcf8ae094d1041.rlib" "/home/deck/build/touchHLE/target/release/deps/libxml-ec5ee1edbe63f573.rlib" "/home/deck/build/touchHLE/target/release/deps/libbase64-9f0fbc8cff4644fd.rlib" "/home/deck/build/touchHLE/target/release/deps/libindexmap-7e7e8e0c7492852f.rlib" "/home/deck/build/touchHLE/target/release/deps/libhashbrown-5fc33d79308a8e59.rlib" "/home/deck/build/touchHLE/target/release/deps/libserde-2cfd11a31b8321ee.rlib" "/home/deck/build/touchHLE/target/release/deps/libtouchHLE_openal_soft_wrapper-d422ce6a16594dd9.rlib" "/home/deck/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-2a15b3cd0948397b.rlib" "/home/deck/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-8f251cec381c549e.rlib" "/home/deck/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libobject-e8062a7445a64946.rlib" "/home/deck/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libmemchr-431dd9a65eafb1c5.rlib" "/home/deck/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-5d5a85338b125cfb.rlib" "/home/deck/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-3cf84ad460df483a.rlib" "/home/deck/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-5a049915d61fbb5d.rlib" "/home/deck/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-aabc21fad3549c98.rlib" "/home/deck/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-dac6992ac677a0cb.rlib" "/home/deck/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-3cd49acf880d0306.rlib" "/home/deck/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libadler-6c93f515800d4657.rlib" "/home/deck/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-8a30445cf40d74de.rlib" "/home/deck/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-47cbfc4f5b0f6f87.rlib" "/home/deck/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-0b6ce813aa5d1704.rlib" "/home/deck/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-f0ffbd64420a69ad.rlib" "/home/deck/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-60668236929c1cf5.rlib" "/home/deck/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-2fb2d4481260f706.rlib" "/home/deck/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-c888e061ea504c93.rlib" "/home/deck/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-93189d615c3f2d6a.rlib" "-Wl,-Bdynamic" "-lstdc++" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-znoexecstack" "-L" "/home/deck/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/home/deck/build/touchHLE/target/release/deps/touchHLE-a6338ae14b589d18" "-Wl,--gc-sections" "-pie" "-Wl,-zrelro,-znow" "-Wl,-O1" "-nodefaultlibs"
  = note: /usr/bin/ld: /home/deck/build/touchHLE/target/release/deps/libsdl2_sys-28baec4d6fde2b80.rlib(SDL_waylandvideo.c.o): in function `handle_ping_xdg_wm_base':
          SDL_waylandvideo.c:(.text.handle_ping_xdg_wm_base+0x32): undefined reference to `wl_proxy_marshal_flags'
          /usr/bin/ld: /home/deck/build/touchHLE/target/release/deps/libsdl2_sys-28baec4d6fde2b80.rlib(SDL_waylandvideo.c.o): in function `Wayland_VideoInit':
          SDL_waylandvideo.c:(.text.Wayland_VideoInit+0x55): undefined reference to `wl_proxy_marshal_flags'
          /usr/bin/ld: /home/deck/build/touchHLE/target/release/deps/libsdl2_sys-28baec4d6fde2b80.rlib(SDL_waylandvideo.c.o): in function `display_handle_global':
          SDL_waylandvideo.c:(.text.display_handle_global+0x58): undefined reference to `wl_proxy_marshal_flags'
          /usr/bin/ld: SDL_waylandvideo.c:(.text.display_handle_global+0xaf): undefined reference to `wl_proxy_marshal_flags'
          /usr/bin/ld: SDL_waylandvideo.c:(.text.display_handle_global+0x181): undefined reference to `wl_proxy_marshal_flags'
          /usr/bin/ld: /home/deck/build/touchHLE/target/release/deps/libsdl2_sys-28baec4d6fde2b80.rlib(SDL_waylandvideo.c.o):SDL_waylandvideo.c:(.text.display_handle_global+0x237): more undefined references to `wl_proxy_marshal_flags' follow
          collect2: error: ld returned 1 exit status
          
  = note: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
  = note: use the `-l` flag to specify native libraries to link
  = note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorustc-link-libkindname)

error: could not compile `touchHLE` due to previous error

Suggestion: state on the readme (or a separate file) the supported games / versions with MD5 hash

Something that I see that emulation community doing, specially folks gathering around RetroAchievements, is to even though (obviously) not linking to pirated content etc., they provided hashes of the supported games (in this case, the games with Achievements) so you are positive that the version you have is actually supported. This is how they do it.

So in a nutshell creating a file like supported-games.md:

SUPPORTED GAMES

The only currently supported games and versions are those listed down below, do not open bug reports for other games than those listed:

Super Monkey Ball 1.0 abcd1234
Super Monkey Ball 1.2 bcde2345
Super Monkey Ball 1.3 cdef3456

If you like the idea, I can create a pull request with such file.

Fat binary (ARMv6 + ARMv7) support

Hello, after seeing your comment i am here to confirm i actually want the emulator to support iPhone OS/iOS apps that are fat binaries. I could've done that sooner but i really wasn't able to do so. ig here you go lol

Linux build problems

Building in debug mode on arch linux produces an error:

error: could not find native static library `fmtd`, perhaps an -L flag is missing?

Looking at the code, in case the debug assertions are enabled the linking happens to a debug version of fmt, however it does not seem to exist.

Building in release mode doesn't work too, because touchHLE links to it statically and static version of fmt is not included on linux too.

I love c++ dependency management I love c++ dependency management I love c++ dependency management

Type aliases for C types

Currently we have Rust types or type aliases for pointers (Ptr, …), sizes (GuestUSize, GuestISize), key Objective-C types (id, SEL, …), Foundation types (NSInteger, …), and more, but the core C integer and float types don't have aliases. Instead, a specific Rust type is usually written. The current practice is:

  • char variants used for character data are usually mapped to u8, regardless of their actual sign (TODO: check what sign normal char has on iPhone OS), because Rust uses u8 for byte strings
  • Other uses of char are u8 or i8 as appropriate.
  • Not sure if short ever gets used, but that would be i16.
  • int, long => i32
  • unsigned, unsigned long => u32
  • long long => i64
  • unsigned long long => u64
  • float => f32
  • double => f64

Ignoring char, these types are perfectly correct for 32-bit ARM iPhone OS/iOS apps, but they might prevent us from supporting other architectures in the future: 64-bit ARM, 32-bit or 64-bit x86 (Simulator ABI), etc. Of course it's unlikely any of these will ever be supported. The main thing that bothers me is it's a loss of information in type signatures. It also requires contributors to correctly remember what particular types map to in the ABI, which I'm sure will go wrong at some point.

The only problem is: how would we name the aliases, and where would we put them? I don't want to use names like c_int because that clashes with Rust's own type aliases. I also think GuestInt might be a bit verbose, though that is consistent. Maybe gc_int? Though that maybe sounds too much like “garbage collection”.

📱🕹️ The quest to relive iPhone OS games with touchHLE 🕹️📱

🚨"Uh, excuse me but where did my iPhone go?"🚨

So, I was just minding my own business, scrolling through my phone and then poof it disappeared into thin air! 🤔 But wait, it seems like I stumbled upon touchHLE and now I can run my fave iPhone apps on my desktop! 💻🎮

However, I have a serious question here. Why does touchHLE only support iPhone OS 2.x and not the newer versions? 🤔 Can't my iPhone 6s run on touchHLE too? 😢 And what about the iPad? Will it ever be supported? 💻🖥️

If anyone can shed some light on this situation, it would be greatly appreciated! 🙏 Until then, I'll be here waiting for a solution to my iPhone-less life. 📱👀

Constant CFString flags != 0x7C8 (Bike or Die 2 inter alia)

Info.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>CFBundleVersion</key>
        <string>2.1.1</string>
        <key>UIInterfaceOrientation</key>
        <string>UIInterfaceOrientationLandscapeRight</string>
        <key>CFBundleIdentifier</key>
        <string>com.chillingo.bikeordie</string>
        <key>NSMainNibFile</key>
        <string>MainWindow</string>
        <key>CFBundleIconFile</key>
        <string>Icon.png</string>
        <key>CFBundleExecutable</key>
        <string>BikeOrDie</string>
        <key>CFBundleURLTypes</key>
        <array>
                <dict>
                        <key>CFBundleURLName</key>
                        <string>com.toyspring.bikeordie</string>
                        <key>CFBundleURLSchemes</key>
                        <array>
                                <string>bikeordie</string>
                        </array>
                </dict>
        </array>
        <key>DTSDKName</key>
        <string>(SDK_NAME)</string>
        <key>UIStatusBarHidden</key>
        <true/>
        <key>CFBundleDevelopmentRegion</key>
        <string>en</string>
        <key>DTPlatformName</key>
        <string>iphoneos</string>
        <key>CFBundleInfoDictionaryVersion</key>
        <string>6.0</string>
        <key>CFBundleResourceSpecification</key>
        <string>ResourceRules.plist</string>
        <key>CFBundleDisplayName</key>
        <string>Bike or Die!</string>
        <key>CFBundleSignature</key>
        <string>????</string>
        <key>CFBundlePackageType</key>
        <string>APPL</string>
        <key>LSRequiresIPhoneOS</key>
        <true/>
        <key>CFBundleName</key>
        <string>BikeOrDie</string>
</dict>
</plist>

touchHLE release backtrace (Unable to build debug currently on Linux). Tested the Windows release in Wine with the same behavior. Window opens for a split second with graphics and crashes.

(deck@steamdeck release)$ RUST_BACKTRACE=full ./touchHLE BikeOrDie.app
touchHLE v0.1.0-3-g8f6998e (git) — https://touchhle.org/

Address of start function: GuestFunction(0x2000)
thread 'main' panicked at 'assertion failed: flags == 0x7C8', src/frameworks/foundation/ns_string.rs:586:5
stack backtrace:
   0:     0x5607acb7a16a - std::backtrace_rs::backtrace::libunwind::trace::h34aec3ef6cd8ad7e
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x5607acb7a16a - std::backtrace_rs::backtrace::trace_unsynchronized::h8035d38698d0f7a8
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x5607acb7a16a - std::sys_common::backtrace::_print_fmt::hff968f6695a1ba22
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x5607acb7a16a - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h7eea0efe77acf1ec
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x5607acb9b91e - core::fmt::write::hc553f17407eb0b48
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/core/src/fmt/mod.rs:1208:17
   5:     0x5607acb77aa5 - std::io::Write::write_fmt::h62e5f01a089f48c0
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/io/mod.rs:1682:15
   6:     0x5607acb79f35 - std::sys_common::backtrace::_print::h52d116aff3db4cd1
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x5607acb79f35 - std::sys_common::backtrace::print::h9e7d2f98fb7af075
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x5607acb7b5bf - std::panicking::default_hook::{{closure}}::hf74999dab2d0a95c
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:267:22
   9:     0x5607acb7b2fb - std::panicking::default_hook::hc11ca7d10c44c42f
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:286:9
  10:     0x5607acb7bccc - std::panicking::rust_panic_with_hook::hdb4da1ae79c845a5
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:688:13
  11:     0x5607acb7ba22 - std::panicking::begin_panic_handler::{{closure}}::h02b5b35b126d5cf2
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:577:13
  12:     0x5607acb7a61c - std::sys_common::backtrace::__rust_end_short_backtrace::h6c6853376cf416d1
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/sys_common/backtrace.rs:137:18
  13:     0x5607acb7b772 - rust_begin_unwind
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:575:5
  14:     0x5607ac7333f3 - core::panicking::panic_fmt::hfd9e949092070b66
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/core/src/panicking.rs:64:14
  15:     0x5607ac7334cd - core::panicking::panic::h341545107301821d
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/core/src/panicking.rs:111:5
  16:     0x5607ac7b09fc - touchHLE::frameworks::foundation::ns_string::handle_constant_string::hb8f6014aa7cafb46
  17:     0x5607ac77d7a2 - touchHLE::dyld::Dyld::do_initial_linking::h2d1cb3632a77367b
  18:     0x5607ac7742df - touchHLE::main::h78da24b14fc90263
  19:     0x5607ac7c2cf6 - std::sys_common::backtrace::__rust_begin_short_backtrace::hb06dc5f8a2da40da
  20:     0x5607ac7c9ad2 - std::rt::lang_start::{{closure}}::hacf0aa1800f126f8
  21:     0x5607acb7382c - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h9ab31282e87f134a
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/core/src/ops/function.rs:606:13
  22:     0x5607acb7382c - std::panicking::try::do_call::h42ddf5b01d0b4bc7
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:483:40
  23:     0x5607acb7382c - std::panicking::try::hfb70320d7386c61a
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:447:19
  24:     0x5607acb7382c - std::panic::catch_unwind::h978c9edbad2bb4d4
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panic.rs:137:14
  25:     0x5607acb7382c - std::rt::lang_start_internal::{{closure}}::h04ede5bd2f26b553
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/rt.rs:148:48
  26:     0x5607acb7382c - std::panicking::try::do_call::ha6b9da35a0885c93
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:483:40
  27:     0x5607acb7382c - std::panicking::try::h3325520cab3a642e
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:447:19
  28:     0x5607acb7382c - std::panic::catch_unwind::h160beec6f047175b
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panic.rs:137:14
  29:     0x5607acb7382c - std::rt::lang_start_internal::h79190e3a877a769d
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/rt.rs:148:20
  30:     0x5607ac776975 - main
  31:     0x7f81f6dfd290 - <unknown>
  32:     0x7f81f6dfd34a - __libc_start_main
  33:     0x5607ac748b35 - _start
                               at /build/glibc/src/glibc/csu/../sysdeps/x86_64/start.S:115
  34:                0x0 - <unknown>

Need to be located in touchHLE directory or cannot start

So, it looks like you need to cd into the touchHLE directory or, you just get an error message and nothing will launch. Here's what I was getting when trying to run this command:

"/Users/eisnerguy1/Desktop/touchHLE_v0.1.0_macOS_x86_64/touchHLE /Users/eisnerguy1/Desktop/touchHLE_v0.1.0_macOS_x86_64/Versions/Super\ Monkey\ Ball\ (v1.0.0)/Monkey\ Ball.app --scale-hack=2 --y-tilt-offset=24"

"touchHLE v0.1.0 — https://touchhle.org/

thread 'main' panicked at 'Unexpected I/O failure when trying to access real path "touchHLE_dylibs/libstdc++.6.0.4.dylib": No such file or directory (os error 2). This might indicate that files needed by touchHLE are missing, or were moved while it was running.', src/fs.rs:275:19
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace"

If you cd into the "touchHLE_v0.1.0_macOS_x86_64" directory and run the command again, Super Monkey Ball launches. I'm running macOS 12.6.2.

Per-app settings, including defaults

Let's say we have two files, touchHLE_default_settings.txt and touchHLE_settings.txt. The former would be bundled with the emulator and contain default settings for particular apps, something like:

# These are default per-app settings provided by touchHLE.
# We recommend editing the touchHLE_settings.txt file instead of this one.
com.ooi.supermonkeyball: --y-tilt-offset=24
com.vgmobile.cnk2: --landscape-left

Then you could create a touchHLE_settings.txt file (maybe touchHLE could create it for you when you first run it) to contain per-app overrides and global settings:

# These are your personal per-app settings for touchHLE.
# Each line begins with the bundle identifier for that app, followed by a colon, then a list of command-line arguments.
# If you specify settings for an app in this file, the settings in touchHLE_default_settings.txt will not be used.
# For settings that should apply to all apps, put those on a line with an asterisk (*) instead of a bundle identifier.
# You can use a hash sign (#) to add comments: the part of a line following a hash sign is ignored.
*: --scale-hack=3
com.ooi.supermonkeyball: --y-tilt-offset=22

Support accelerometers in game controllers

This should be simple to do using SDL2's accelerometer support, it's just a bit fiddly to test.

One problem I anticipate is that for game controllers with accelerometers (Wiimotes, Switch Joycons, newer DualShock controllers, etc) you might need to rotate the controller in an awkward way unless touchHLE can rotate your inputs for you. That should be a new command-line option. Maybe phones and other mobile devices (Steam Deck?) that have accelerometers will also need this depending on their screen orientations?

Add unit tests

Currently the only testing done is, well, manually running Super Monkey Ball and trying to play it. This is a very effective integration test, but it's not going to scale. It would be really good to have some automated testing to complement it. For the moment, I'm only interested in unit testing (fsvo unit…).

There's no particularly good reason that I didn't write unit tests so far, except that this is a hobby project. :)

The easiest targets are leaf functions with no dependencies on Environment or other heavy things (Mem, ObjC…). For example, the path resolving algorithm inside fs.rs and the ADPCM decoder in ima4.rs would be easy to add tests for.

With a bit more work, we can test things that do have a dependency on Environment, but don't need a binary to be loaded or a window to be set up. We can add a special constructor to Environment for testing that skips these things, and possibly allocates less memory than normal. Then we would be able to write simple tests of the C string functions, NSString, etc.

I think I'm okay with not trying to have unit tests for anything related to binaries, windowing, audio output, OpenGL, and actual file I/O.

Compatibility list

It would be good to track how compatibility with games evolves over time and what issues currently happen when trying to emulate them.

I've already tested a bunch and as I expected, only the original Super Monkey Ball worked. I have also been running touchHLE with Proton on my Steam Deck so results may be different, but so far the issues I've been getting seem to be specifically from functions not being reimplemented and stuff missing, or the IPA being encrypted or the files being borked.

(also forgive me for the earlier deleted post, I didn't realize that those links could still be considered piracy)

No mouse/trackpad option for tilt controls

So, I've got a 2015 MacBook Pro running 12.6.2. I'm trying to use my trackpad mouse and Super Monkey Ball isn't recognizing it as a mouse. Does the game only work with a physical mouse? Either way, thank you for helping to preserve old iOS games! 😄 👍🏻

Official Springboard support

Just an idea. As we can run the games with .app folder it would be cool if we would be able to run springboard like this.

Will not run on macOS Big Sur (11.7.1)

Running "./touchHLE app.app" returns
"dyld: Symbol not found: __ZTTNSt3__114basic_ifstreamIcNS_11char_traitsIcEEEE
Referenced from: /Users/shark/Desktop/touchHLE_v0.1.0_macOS_x86_64/./touchHLE (which was built for Mac OS X 12.0)
Expected in: /usr/lib/libc++.1.dylib
in /Users/shark/Desktop/touchHLE_v0.1.0_macOS_x86_64/./touchHLE
zsh: abort ./touchHLE app.app"

Add emulator shortcut functionality

Please make a command to create a shortcut in the programs or applications folder in the OS that points to the app of your choice along with its icon, which requires the “install” or “point” command in the binary to be passed first.

unimplemented function _wctob'

thread 'main' panicked at 'Call to unimplemented function _wctob', src\dyld.rs:474:9

This function uses by very many software and games and i think:
This function hard to implement like the stub for example.. or more "real"?

P.S. Sorry for my bad english 😄

Suggestion for the future: RetroAchievements support

I'd like to give a suggestion for the future. There is a very nice project called RetroAchievements, it's a community that adds achievements to emulated games - similar to what you'd have on PlayStation 3+ or Xbox. Basically create achievements to Super Monkey Ball when, say, you finish the tutorial, finish a certain number of levels, finish the levels without dying, finish the game etc etc.

Of course there are a loooot of things to work on the near future but I personally would love to see it on the radar. =)

RetroAchievements Developers documentation: https://docs.retroachievements.org/Developer-docs/

Language/locale detection doesn't work on Windows or Android (falls back to English)

Super Monkey Ball requests the language via NSLocale and I wrote a simple implementation that checks your LANG environment variable and reports the language part (en, ja, etc). That works on macOS and (based on a video I've seen) presumably Linux. Windows doesn't set that variable though, so we just report en instead, which isn't very accessible.

I'm not sure what the best way to check the user's language preference is on Windows. I know there's a registry key for it, but I don't know if that's the correct approach, and we'd need a table to convert Microsoft language codes into the ISO 639-1 code.

It would be especially nice if we could actually get a list of all languages the user wants, since NSLocale supports that. The LANG variable doesn't have that info, so currently we don't support that on any platform.

Bleeding edge or nightly builds

May I suggest bleeding edge or nightly builds, e.g. on AppVeyor? Many good emulators have them, and it would be nice not to have to wait for improvements in new stable versions, like IPA support. It would also ensure any issues filed aren't fixed in the latest or close to latest source code.

Update dynarmic

As seen in #17, the current dynarmic version fails to build for some people. I'm told 76aa4dd665085fb6ac10d4cd58e25466366d0799 might be a good new version. Just need to remember to test it.

Need help, app won't run.

I'm trying to open an app called Rhythm Thief & the Paris Caper; it boots up for a second, closes, and gives me this message in PowerShell:

touchHLE::mach_o: Warning! DyldInfo is not handled.
touchHLE: Warning: app binary depends on unexpected dylib "/usr/lib/libiconv.2.dylib"
Error: "Mach-O file has no 'start' symbol, perhaps it is not an executable?"

I really don't know what this means, but if anyone does, I would appreciate some help!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.