IOS Build?

Linux geeks and Mac OS hipsters unite! A board for discussion of Supermodel on non-Windows platforms.
Forum rules
Keep it classy!

  • No ROM requests or links.
  • Do not ask to be a play tester.
  • Do not ask about release dates.
  • No drama!

IOS Build?

Postby sergio_prado » Tue Dec 29, 2020 9:10 am

Is technically possible to build it to run on IOS?

I was able to build it and run o Nintendo Switch using L4T Ubuntu, but the performance was not so great, and i was thinking that an Ipad would be much more capable to run the games at full speed.

Can someone point me to any guide on how to build it on a mac, because i was only able to found build instructions for Windows and Linux. Thanks.
sergio_prado
 
Posts: 4
Joined: Thu Nov 12, 2020 6:30 pm

Re: IOS Build?

Postby Bart » Tue Dec 29, 2020 12:36 pm

Given that Supermodel has been demonstrated to work on ARM by you and others, it is certainly possible to port it to iOS. But it would not be as simple as compiling it for the platform (unless Linux exists for jailbroken devices). iOS would require a custom UX and main loop (basically, all the stuff in Src/OSD/SDL would need an iOS equivalent from the ground up, e.g., Src/OSD/iOS). iOS used to (and still does?) support OpenGL ES but I don't know whether Ian's rendering engine is ES-compatible. It will likely require some modifications.

It would be a big project. However, Supermodel is open source and if you want to try it, I encourage you to do so. I think the logical starting point would be to first write a basic iOS OpenGL ES app that renders a spinning cube and lets you control it with a d-pad on the touch screen. If you can figure out how to make that, and feel comfortable with C++, you could probably use that as a framework to begin porting Supermodel.
User avatar
Bart
Site Admin
 
Posts: 3086
Joined: Thu Sep 01, 2011 2:13 pm
Location: Reno, Nevada

Re: IOS Build?

Postby sergio_prado » Tue Dec 29, 2020 1:37 pm

@Bart Thank you for your insight :) . I love this emulador, and definitely would like to work on such project on the future, but i still have some things to learn until be up to that task.
sergio_prado
 
Posts: 4
Joined: Thu Nov 12, 2020 6:30 pm

Re: IOS Build?

Postby Ian » Tue Dec 29, 2020 3:36 pm

Opengl es is basically regular opengl but with a bunch of stuff removed. As long as they haven't removed any core stuff we rely on it shouldn't be too hard to port in theory anyway.
Ian
 
Posts: 2044
Joined: Tue Feb 23, 2016 9:23 am

Re: IOS Build?

Postby TheOldDragon » Tue Dec 29, 2020 4:39 pm

Ian wrote:Opengl es is basically regular opengl but with a bunch of stuff removed. As long as they haven't removed any core stuff we rely on it shouldn't be too hard to port in theory anyway.


SDL is available for iOS, and I actually had a quick go at this a few weeks ago when my ARM [M1] Mac mini arrived [and showed that an iPhone/iPad would be more than up to the task], but it looks like there's stuff missing from iOS's OpenGL implementation that prevents this being a simple exercise...

- I hacked together an Xcode project so I could build Supermodel [for macOS] inside of Xcode, including building SDL2 as a static library, and eventually got this to work on macOS...
- I then switched the target to an iOS device, but it immediately failed as Apple's OpenGL ES for iOS doesn't seem support the necessary OpenGL functionality...

Sorry for the vagueness; I don't' have access to the computer I was using at the time, but I can try and recreate the exercise...and list what the errors were.

OpenGL has been deprecated on Apple platforms [in favor of Metal] for years, and I think that longer term Apple will totally kill off the OpenGL support on macOS and iOS.
I there any thought to re-writing Supermodel for the Vulkan APIs, as this will probably help with long term support on Linux too, and MoltenVK https://moltengl.com/moltenvk/ would likely make the macOS/iOS support easier?..
Last edited by TheOldDragon on Tue Dec 29, 2020 7:01 pm, edited 2 times in total.
TheOldDragon
 
Posts: 62
Joined: Sat May 30, 2020 5:39 am

Re: IOS Build?

Postby TheOldDragon » Tue Dec 29, 2020 5:19 pm

sergio_prado wrote:Is technically possible to build it to run on IOS?

I was able to build it and run o Nintendo Switch using L4T Ubuntu, but the performance was not so great, and i was thinking that an Ipad would be much more capable to run the games at full speed.

Can someone point me to any guide on how to build it on a mac, because i was only able to found build instructions for Windows and Linux. Thanks.


Building on macOS is kind-of-similar similar to linux but not really... Here are the steps...

Install the free Apple Developer tools:
If you don't have Xcode installed [you don't need it unless you want net code on an ARM Mac] then just open a Terminal and type:
Code: Select all
cc

This will prompt you to download Apple's command line developer tools, which are all you need (see *note below)...

Install the SDL2 and SDL_net frameworks:
Download them from https://www.libsdl.org and https://www.libsdl.org/projects/SDL_net/, and install them in /Library/Frameworks/
[*Note: if your using an x86 Mac the above is fine, but you'll have to compile your own SDL_net framework for an M1 based Mac (using Xcode), as the distributed binaries are x86 only. The SDL2 framework is already updated and released as a universal binary ].

Download the Supermodel code archive from sourceforge.net, unzip it, and then cd to the directory in a Terminal.
Then compile/link:
Code: Select all
ln -s /Makefiles/Makefile.OSX ./Makefile
make -j<num threads> NET_BOARD=1

[The -j<num threads> is optional.... either replace <num threads> with the number of CPU threads you want the compiler to use, or delete it entirely for a slow compile time...
THE NET_BOARD=1 is also optional... I wouldn't bother for now...]

However, you'll likely get errors from the clang compiler... per this thread http://supermodel3.com/Forum/viewtopic.php?f=5&t=1911 I had to explicitly declare the "m68ki_int_ack()" function in "m68kcpu.h". I added it to lines 440 and 1900... [which is different to what I wrote in that thread, but how I just got r840 to build.. :-( ]
[I need to find the command line option [for clang] to turn the error back into a warning, but haven't found it yet...]

Then, after all that, you should end top with a binary in the ./bin/ directory...

Just follow the normal instructions for running it from the cli, and remember to add the "-legacy3d" argument [otherwise it will have missing graphics and crash..]
TheOldDragon
 
Posts: 62
Joined: Sat May 30, 2020 5:39 am

Re: IOS Build?

Postby tfmf » Sun Jan 03, 2021 7:32 am

here are the steps I used to run it in mac os big sur on a macbook 16' using only brew

install sdl2 and svn using brew
Code: Select all
brews install sdl2 sdl2_gfx sdl2_image sdl2_mixer sdl2_net sdl2_ttf svn


create the necessary header links
Code: Select all
cd /usr/local/include/SDL2
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL.h SDL.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_assert.h SDL_assert.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_atomic.h SDL_atomic.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_audio.h SDL_audio.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_bits.h SDL_bits.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_blendmode.h SDL_blendmode.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_clipboard.h SDL_clipboard.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_config.h SDL_config.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_cpuinfo.h SDL_cpuinfo.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_egl.h SDL_egl.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_endian.h SDL_endian.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_error.h SDL_error.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_events.h SDL_events.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_filesystem.h SDL_filesystem.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_gamecontroller.h SDL_gamecontroller.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_gesture.h SDL_gesture.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_haptic.h SDL_haptic.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_hints.h SDL_hints.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_joystick.h SDL_joystick.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_keyboard.h SDL_keyboard.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_keycode.h SDL_keycode.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_loadso.h SDL_loadso.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_locale.h SDL_locale.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_log.h SDL_log.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_main.h SDL_main.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_messagebox.h SDL_messagebox.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_metal.h SDL_metal.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_misc.h SDL_misc.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_mouse.h SDL_mouse.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_mutex.h SDL_mutex.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_name.h SDL_name.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_opengl.h SDL_opengl.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_opengl_glext.h SDL_opengl_glext.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_opengles.h SDL_opengles.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_opengles2.h SDL_opengles2.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_opengles2_gl2.h SDL_opengles2_gl2.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_opengles2_gl2ext.h SDL_opengles2_gl2ext.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_opengles2_gl2platform.h SDL_opengles2_gl2platform.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_opengles2_khrplatform.h SDL_opengles2_khrplatform.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_pixels.h SDL_pixels.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_platform.h SDL_platform.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_power.h SDL_power.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_quit.h SDL_quit.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_rect.h SDL_rect.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_render.h SDL_render.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_revision.h SDL_revision.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_rwops.h SDL_rwops.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_scancode.h SDL_scancode.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_sensor.h SDL_sensor.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_shape.h SDL_shape.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_stdinc.h SDL_stdinc.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_surface.h SDL_surface.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_system.h SDL_system.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_syswm.h SDL_syswm.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_test.h SDL_test.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_test_assert.h SDL_test_assert.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_test_common.h SDL_test_common.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_test_compare.h SDL_test_compare.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_test_crc32.h SDL_test_crc32.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_test_font.h SDL_test_font.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_test_fuzzer.h SDL_test_fuzzer.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_test_harness.h SDL_test_harness.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_test_images.h SDL_test_images.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_test_log.h SDL_test_log.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_test_md5.h SDL_test_md5.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_test_memory.h SDL_test_memory.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_test_random.h SDL_test_random.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_thread.h SDL_thread.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_timer.h SDL_timer.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_touch.h SDL_touch.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_types.h SDL_types.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_version.h SDL_version.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_video.h SDL_video.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/SDL_vulkan.h SDL_vulkan.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/begin_code.h begin_code.h
ln -s  ../../Cellar/sdl2/2.0.14_1/include/SDL2/close_code.h close_code.h



Checkout the the code
Code: Select all
svn checkout https://svn.code.sf.net/p/model3emu/code/trunk model3emu-code


Go into the directory:
Code: Select all
cd model3emu-code


Link the Make file in the root directory
Code: Select all
ln -s Makefiles/Makefile.OSX Makefile


Edit the Makefile and replace the following line
Code: Select all
...
SDL_LIBS = -I/Library/Frameworks/SDL2.framework/Headers -F/Library/Frameworks -framework SDL2 -framework AGL -framework OpenGL -framework GLUT -framework Cocoa
...


with
Code: Select all
SDL_LIBS = -I/usr/local/include/SDL2 -D_THREAD_SAFE -L/usr/local/Cellar/sdl2/2.0.14_1/lib/ -lSDL2 -framework AGL -framework OpenGL -framework GLUT -framework Cocoa


Update the file `Src/CPU/68K/Musashi/mk68kcpu.h`, and add this line before the method `void m68ki_exception_interrupt(uint int_level)`:
Code: Select all
uint m68ki_int_ack(uint level);


Everything should be ready now, run:
Code: Select all
make


If everything goes ok you can now use bin/supermodel, here's an example of the optimal setting in my mac:
Code: Select all
./bin/supermodel Roms/srally2.zip  -legacy3d -show-fps -ppc-frequency=100 -res=1600,1080
tfmf
 
Posts: 1
Joined: Sat Jan 02, 2021 4:54 pm


Return to Alternative Fashion

Who is online

Users browsing this forum: No registered users and 0 guests

cron