iOS / iPhone / iPad

NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
Forum rules
NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
Lanica
Site Admin
Posts: 140
Joined: Thu May 14, 2020 1:34 pm

iOS / iPhone / iPad

Post by Lanica »

I'm thinking of working on the iOS port of Exult a bit this weekend. I think it might be SotA (Shroud of the Avatar) or possible the release of Ultima Forever (which I particularly found that I do not like due to free to play) causing me to me inspired. There's a lot of implementation questions that I had before when I started working on this. So this is a starting point. Follow-up questions to....follow.

-Lanica
Lanica
Site Admin
Posts: 140
Joined: Thu May 14, 2020 1:34 pm

Re: iOS / iPhone / iPad

Post by Lanica »

* Now will compile for iOS again
* Quick instructions: Install XCode (with iOS support), Install command line tools from XCode (Preferences->Downloads), Install libsdl-devel using macports (sudo port install libsdl-devel), and use iphone-simulator-libs or iphone-hardware-libs as provided by me
* Versions
* Mac OS X: Mountain Lion (10.8.3)
* XCode: 4.5.1
* iOS: 6.0
* SDL: 1.3 (my library, not macport)
* Vorbis: ???
* Configure line that I use (simulator, not actual hardware): ./configure --with-iphone-sdk=iPhoneSimulator6.0 --with-sdl-prefix="${HOME}/iphone-simulator-libs/SDL" OGG_LIBS="-L${HOME}/iphone-simulator-libs/vorbis/lib -lvorbis -lm -lvorbisfile -logg" OGG_CFLAGS="-I${HOME}/iphone-simulator-libs/vorbis/include" CPPFLAGS="-I${HOME}/iphone-simulator-libs/vorbis/include"

I'll get the iphone libs up somewhere and add more instructions. Once this is nailed down better I'll probably add a README.iOS or README.iPhone.
Lanica
Site Admin
Posts: 140
Joined: Thu May 14, 2020 1:34 pm

Re: iOS / iPhone / iPad

Post by Lanica »

So now for the big questions:
1. What time of user interface enhancements will actually make an iPhone version useful?
2. What time of user interface enhancements (beyond those above) will actually make an iPad version useful?
3. If the goal is to get this into the app store, then we have to allow the users to load in the content... There's a few different ways to go about this, none of which I like.
3.a. User uploads it somewhere and points the app to a link or something
3.b. User e-mails theirself and we get it from there somehow
3.c. Exult app could set up some kind of Samba (Windows file share), or basic FTP server to receive files. User would have to be connected to wi-fi to get it in
4. Related to #3. Do we think it would be possible to make the content an in-app purpose, by working with EA / goggames.com? I think this would be the best option, which is still a headache, but it does give us "more of a blessing" to do this as well.

Until we get #3 and #4 resolved, that means Exult iOS will be for those that have jailbroken devices or are developers.
Malignant Manor
Site Admin
Posts: 985
Joined: Thu May 14, 2020 1:34 pm

Re: iOS / iPhone / iPad

Post by Malignant Manor »

SDL 2.0 had an official release earlier this month. I'm not sure how SDL 2.0 will affect performance of Windows and OSX or whether not having SDL 1.2 compatibility will cause Kirben issues when building. Maintaining compatibility with SDL 1.2 using defines may be a lot of extra code though.
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: iOS / iPhone / iPad

Post by Dominus »

3. /4.: it cannot ever get into the app store unless we change our license to something the app store license is compatible with ;(
We could also make the app accept files through itunes, probably better than all other options.

SDL: shortly after your initial port to SDL 1.3, the guys from SDL nixxed 1.3, made it 2.0 and also did away with the compatibilty layer ;(
So the port right now only works up to a specific mercurial commit (also really shortly after your port SDL 1.3 required named threads (I think) which clashed in our midi stuff somewhere).
So porting just got more annoying ;)

(And I'd also wish we could circumvent the cross compile problems with the tools)
--
Read the documentation and the FAQ! There is no excuse for not reading them! RTFM
Read the Rules!
We do not support Piracy/Abandonware/Warez!
Lanica
Site Admin
Posts: 140
Joined: Thu May 14, 2020 1:34 pm

Re: iOS / iPhone / iPad

Post by Lanica »

What's wrong with the license? I figured Exult itself would be free, but the content would have to be paid for.

Good thing for you guys I still have the SDL I compiled back when I was messing around. Like I said above. I'll post it in a bit.

I think I have it done where you can get it working at least in the simulator. Though I tried to walk around and apparently that hasn't been fixed yet.

Testing the process from freshly checked out code then I'll post the steps and the pre-req libs.
Lanica
Site Admin
Posts: 140
Joined: Thu May 14, 2020 1:34 pm

Re: iOS / iPhone / iPad

Post by Lanica »

Oh...and another thing... Save game transfer. Need to be able to bring savegames in and also send them out.
Lanica
Site Admin
Posts: 140
Joined: Thu May 14, 2020 1:34 pm

Re: iOS / iPhone / iPad

Post by Lanica »

Here are the steps to get it going on in the simulator...

Make sure you have done these things first: Install XCode (with iOS support), Install command line tools from XCode (Preferences->Downloads), and Install libsdl-devel using macports ( sudo port install libsdl-devel )

# Get latest code
svn co https://svn.code.sf.net/p/exult/code/exult/trunk exult-test
cd exult-test

# Get libs required for simulator and extract
# URL for libs: https://www.box.com/shared/86qspv7c3bout465oyly
tar -xzvf iphone-simulator-libs.tar.gz -C ~

# Configure
./autogen.sh
./configure --with-iphone-sdk=iPhoneSimulator6.0 --with-sdl-prefix="${HOME}/iphone-simulator-libs/SDL" OGG_LIBS="-L${HOME}/iphone-simulator-libs/vorbis/lib -lvorbis -lm -lvorbisfile -logg" OGG_CFLAGS="-I${HOME}/iphone-simulator-libs/vorbis/include" CPPFLAGS="-I${HOME}/iphone-simulator-libs/vorbis/include"
make
make iosbundle

# Get the Exult ios config and put it in place
# URL for exult-ios.cfg: https://www.box.com/shared/9l7vdzqeacpe8bco8gty
cp -a exult-ios.cfg Exult.app/exult.cfg

# Put game data in place
mkdir Exult.app/game
# NOTE: ~/.exult/blackgate/ should be a place where you have the BlackGate original content files
rsync -auv ~/.exult/blackgate/ Exult.app/game/forgeofvirtue/
# NOTE: ~/.exult/serpentisle/ should be a place where you have the Serpent Isle original content files
rsync -auv ~/.exult/serpentisle/ Exult.app/game/silverseed/

# Put the complete game bundle into the simulator
TMPUUID=$(uuidgen)
mkdir ~/Library/Application\ Support/iPhone\ Simulator/6.0/Applications/${TMPUUID}
mkdir ~/Library/Application\ Support/iPhone\ Simulator/6.0/Applications/${TMPUUID}/Documents
mkdir ~/Library/Application\ Support/iPhone\ Simulator/6.0/Applications/${TMPUUID}/Library
mkdir ~/Library/Application\ Support/iPhone\ Simulator/6.0/Applications/${TMPUUID}/tmp
rsync -auv Exult.app/ ~/Library/Application\ Support/iPhone\ Simulator/6.0/Applications/${TMPUUID}/Exult.app/

# Launch it!
Go to XCode...go to the menu XCode->Open Developer Tool->iOS Simulator
Launch Exult
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: iOS / iPhone / iPad

Post by Dominus »

Great write up, now I only need to set up my office tomorrow to test it out. Everything was under construction while we were on holidays ;)

Apple's App Store license is not compatible with GPL. AFAIR in a nutshell, GPL does not permit a license on top of itself. Big fallout one or two years ago between VLC and whoever made a VLC app. No idea how they resolved this with the current VLC app.
While developing this we could offer the app via testflight. Testflight allows distributing apps for testing. Whoever offers it via testflight needs an ios developer account, though, to register the ios devices of the testers with apple as tester devices. I just renewed my account so that could be done and one developer of XU4 already uses testflight so, I could ask him for help setting it up when we are at sucha stage. The number of testing devices are limited but recently Apple allowed more than the hundred it limited to before.

Savegames: this really needs to be done via itunes file transfer OR via dropbox sign in and pointing at a dropbox folder (already have all my saves synced to dropbox ;))
--
Read the documentation and the FAQ! There is no excuse for not reading them! RTFM
Read the Rules!
We do not support Piracy/Abandonware/Warez!
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: iOS / iPhone / iPad

Post by Dominus »

If you search "apple app store gpl" you get a couple of explanations, for example pidgins :
https://developer.pidgin.im/wiki/WhyNoiOSVersion

And testflight can be found at testflightapp.com
--
Read the documentation and the FAQ! There is no excuse for not reading them! RTFM
Read the Rules!
We do not support Piracy/Abandonware/Warez!
Lanica
Site Admin
Posts: 140
Joined: Thu May 14, 2020 1:34 pm

Re: iOS / iPhone / iPad

Post by Lanica »

The GPL is preventing the spread of free software? That's...amazing. I'm trying to find which terms of the Apple agreement are the offending ones... The fact is, its a mechanism to deliver application binaries. It had nothing to do with source. Anyone can still do whatever they want with the source of the application. There are plenty of other ways in which GPL binaries are delivered...I'm sure if Apple violates them with their terms than many others have as well. Pretty interesting topic.
Lanica
Site Admin
Posts: 140
Joined: Thu May 14, 2020 1:34 pm

Re: iOS / iPhone / iPad

Post by Lanica »

I think the license may have changed some....

The below is from the Apple Developer Agreement, dated 2013/06/10. Looks like to me they intend for you to use GPL...or not. Hard to read between the lines here.

“FOSS” (Free and Open Source Software) means any software that is subject to terms that, as a condition of use, copying, modification or redistribution, require such software and/or derivative works thereof to be disclosed or distributed in source code form, to be licensed for the purpose of making derivative works, or to be redistributed free of charge, including without limitation software distributed under the GNU General Public License or GNU Lesser/Library GPL.

Check this out:
3.3.22
If Your Application includes any FOSS, You agree to comply with all applicable FOSS licensing terms. You also agree not to use any FOSS in the development of Your Application in such a way that would cause the non-FOSS portions of the Apple Software to be subject to any FOSS licensing terms or obligations.
Colourless
Site Admin
Posts: 731
Joined: Thu May 14, 2020 1:34 pm

Re: iOS / iPhone / iPad

Post by Colourless »

There is a couple of issues. Mostly comes down to the restrictions that the App Store places on Apps sort of violates GPL (v2) Term 3.

Term 3 states "You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form". The intent is that the GPL allows you to distribute the executable version of the program you have received. The way the App Store works is makes this sort of impossible to actually comply with. If I put my App on the App Store, you can't actually redistribute it.

I do wonder if there may be ways around this by releasing precompiled versions of the executable independently of the App Store. I don't know the specifics of App Store development to know what the process is, and if you can do that.

The VLC problem was solved by contacting all authors and relicensing the entire program.
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: iOS / iPhone / iPad

Post by Dominus »

Yay, too bad we can't split topics ;)
I can't imagine it being possible for Exult to change license, too much coming from elsewhere and much of that also GPLed...
--
Read the documentation and the FAQ! There is no excuse for not reading them! RTFM
Read the Rules!
We do not support Piracy/Abandonware/Warez!
Lanica
Site Admin
Posts: 140
Joined: Thu May 14, 2020 1:34 pm

Re: iOS / iPhone / iPad

Post by Lanica »

Here's the process for TRYING to get it compiled for the hardware. It dies on some midi stuff due to an internal compiler error. From what I've read its not the code's fault, but you might be able to find a workaround. I've tried disabling some of the midi stuff via configure but it never seems to compile less things... same goes for the tools...it never seems to not compile some of the tools if I use --disable-tools.

# Get latest code
svn co https://svn.code.sf.net/p/exult/code/exult/trunk exult-test
cd exult-test

# Get libs required for hardware (SDL + vorbis) and extract
# URL for libs: https://www.box.com/shared/tnzfscos85qspgiv3soy
tar -xzvf iphone-hardware-libs.tar.gz -C ~

# Run autogen
./autogen.sh

# Build tools required for building (expack, usecode stuff, etc)
./configure
cd files ; make ; cd ..
cd conf ; make ; cd ..
cd gamemgr ; make ; cd ..
cd usecode ; make ; cd ..
cd tools ; make ; cd ..

# Clean-up pre-reqs from building tools
cd files ; make clean ; cd ..
cd conf ; make clean ; cd ..
cd gamemgr ; make clean ; cd ..

# Configure for build
./configure --with-iphone-sdk=iPhoneOS6.0 --with-sdl-prefix="${HOME}/iphone-hardware-libs/SDL" OGG_LIBS="-L${HOME}/iphone-hardware-libs/vorbis/lib -lvorbis -lm -lvorbisfile -logg" OGG_CFLAGS="-I${HOME}/iphone-hardware-libs/vorbis/include" CPPFLAGS="-I${HOME}/iphone-hardware-libs/vorbis/include" --host=arm-apple-darwin11

# Block the building of tools ( --disable-tools doesn't seem to work )
echo "all:" > usecode/ucxt/Makefile
echo "all:" > tools/Makefile

# Build
make

# Build dies at:
# /bin/sh ../../libtool --tag=CXX --mode=compile /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/g++ -DHAVE_CONFIG_H -I. -I../.. -I./../../headers -I./../../conf -I./../.. -I./.. -I./../../files -I./../../imagewin -I../../conf -I../../files -I../../objs -I./../../shapes -I/Users/phillipgeorge/iphone-hardware-libs/SDL/include/SDL -D_GNU_SOURCE=1 -D_THREAD_SAFE -DMACOSX -O2 -Wno-long-long -DSDL_VER_1_3 -D__IPHONEOS__ -DSDL_VER_1_3 -D__IPHONEOS__ -arch armv7 -pipe -Os -gdwarf-2 -no-cpp-precomp -mthumb -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk -MT XMidiFile.lo -MD -MP -MF .deps/XMidiFile.Tpo -c -o XMidiFile.lo XMidiFile.cpp
# XMidiFile.cpp:2072: internal compiler error: Segmentation fault: 11
# Please submit a full bug report,
# with preprocessed source if appropriate.
# See for instructions.
# make[2]: *** [XMidiFile.lo] Error 1
# make[1]: *** [all-recursive] Error 1
# make: *** [all-recursive] Error 1
Lanica
Site Admin
Posts: 140
Joined: Thu May 14, 2020 1:34 pm

GPL vs. Apple

Post by Lanica »

Apple doesn't restrict the copying of the free programs as far as I can tell. Anyone want a copy of the Apple developer agreement to look it over?

Does anyone here actually believe it would be a violation of the GPL? I guess reading the agreement would be the way to go...

If so, then we would need to try to change the license. Or if we get it up there and ANYONE complains AND Apple agrees, it will get pulled down. Then we would be back to changing the license.
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: iOS / iPhone / iPad

Post by Dominus »

I ran into this problem ages before and back then I compiled manually the xmidi with clang and everything else with gcc (due to some other forgotten problem with clang back then).
Now that with upcoming Xcode, there is only clang and that might just work for everything (since it got many fixes since back then).

As for the tools, on a quick glance there is no condition for the data files to require the tools but they do, so it should work when you --disable-data as well. (at least that works for my cross compile for PPC).
--
Read the documentation and the FAQ! There is no excuse for not reading them! RTFM
Read the Rules!
We do not support Piracy/Abandonware/Warez!
Lanica
Site Admin
Posts: 140
Joined: Thu May 14, 2020 1:34 pm

GPL vs. Apple

Post by Lanica »

Here's the developer agreement: https://developer.apple.com/programs/te ... 130610.pdf

Note that you can distribute outside of the app store, if its free. If its a paid app, you are agreeing to only allow it thru Apple. There some kind of default EULA attached to the app, which I'll have to review -- that could be more of the issue than anything. The EULA might just be more about running of the software which the GPL does not cover....not sure. It might also apply to paid apps more than free apps.

Either way I look at them as a point of distribution and the software and source code can still be delivered outside of the app store. The problem is, unless you jailbreak your phone, you can't do much with it. However, that's a platform restriction, not restriction on our software.
Lanica
Site Admin
Posts: 140
Joined: Thu May 14, 2020 1:34 pm

Re: iOS / iPhone / iPad

Post by Lanica »

Dominus:
disable-data and disable-tools together works for that part of the code it seems.

Also, it looks like what its dying on, is an XMidi driver...which I'm assuming is X-Windows, which cannot be used. I cut it out of the Makefile and was able to get it to compile. Now I need to make some kind of conditional so it doesn't get compiled if there is a definition of __IPHONEOS__ defined....

-Lanica
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: iOS / iPhone / iPad

Post by Dominus »

or maybe only if x is x-windows is defined. doesn't make much sense in lock stock mac, too, I guess.
--
Read the documentation and the FAQ! There is no excuse for not reading them! RTFM
Read the Rules!
We do not support Piracy/Abandonware/Warez!
Lanica
Site Admin
Posts: 140
Joined: Thu May 14, 2020 1:34 pm

Re: iOS / iPhone / iPad

Post by Lanica »

correction...I was able to get the audio part to compile, but then got other errors later on...which had references to XMidi stuff.
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: iOS / iPhone / iPad

Post by Dominus »

too bad, now crashes current clang preview 4 as well :(

Getting newest Xcode preview and will report back and also report this to Apple (even though last time I wasn't exactly lucky with that).

But even if I manage to compile I'll not be able to put it on my ipad since it isn't jailbroken atm (and runs iOS 7 beta). We'd really need an xcode file for that...

Edit: hmm, did you hardcode iphone gcc somewhere?
--
Read the documentation and the FAQ! There is no excuse for not reading them! RTFM
Read the Rules!
We do not support Piracy/Abandonware/Warez!
Lanica
Site Admin
Posts: 140
Joined: Thu May 14, 2020 1:34 pm

Re: iOS / iPhone / iPad

Post by Lanica »

You can still deliver binaries to your iOS devices that were not built with your XCode. You can also sign binaries outside of XCode.


FYI, I isolated the compile error to something in this function:
void XMidiFile::AdjustTimings(uint32 ppqn)
(in /audio/midi_drivers/XMidiFile.cpp)

About 58 lines of code to go thru.

Configure does select the iphone SDK compilers, or it attempts to.
Lanica
Site Admin
Posts: 140
Joined: Thu May 14, 2020 1:34 pm

Re: iOS / iPhone / iPad

Post by Lanica »

Ok...found the line: aim *= tempo;

Which is right below: uint64 aim = event->time - time_prev;

I can get it to compile by doing: aim = aim * (uint64)tempo;

tempo is a uint32....

Strangely enough, if I try to ifdef it out, it still gets the error:
#ifndef __IPHONEOS__
aim *= tempo;
#else
aim = aim * (uint64)tempo;
#endif


.... suggestions? I'm not confident based upon the uint64 definitions that it will work the same, but if someone knows better, tell me :)
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: iOS / iPhone / iPad

Post by Dominus »

it compiles correctly with clang (needed to edit configure.ac to get rid of your hardcoded cc/c++ paths - these will no longer be valid for upcoming Xcode 5, btw).

Only linking fails since we are now building for Arm7 but the libs you provided are built for Arm6.

Since it builds with clang but fails with older llvm-gcc fileing a bug report is not gonna be successful with Apple as only clang is supported now.
--
Read the documentation and the FAQ! There is no excuse for not reading them! RTFM
Read the Rules!
We do not support Piracy/Abandonware/Warez!
Lanica
Site Admin
Posts: 140
Joined: Thu May 14, 2020 1:34 pm

Re: iOS / iPhone / iPad

Post by Lanica »

Did you get around hardcoding -- I couldn't seem to find a way to get it to detect a compiler automatically? I changed it to llvm-g++ and lvm-gcc and then I don't have the problem in the audio directory.
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: iOS / iPhone / iPad

Post by Dominus »

I just commented your hard codings in configure and passed clang/++ instead in terminal.
Did you make arm7 binaries of the libs yet? Or do you still remeber waht mercurial revision of sdl 1.3 you used?
--
Read the documentation and the FAQ! There is no excuse for not reading them! RTFM
Read the Rules!
We do not support Piracy/Abandonware/Warez!
Lanica
Site Admin
Posts: 140
Joined: Thu May 14, 2020 1:34 pm

Re: iOS / iPhone / iPad

Post by Lanica »

It now compiles ALL of the way. Here are the instructions so far. Also...I updated the hardware libs...I also updated the link in the post above just in case...though those steps are little off on the configure line.

# Instructions below are for getting to run on the physical hardware!

# Get latest code
svn co https://svn.code.sf.net/p/exult/code/exult/trunk exult-test
cd exult-test

# Get libs required for hardware (SDL + vorbis) and extract
# URL for libs: https://www.box.com/shared/tnzfscos85qspgiv3soy
tar -xzvf iphone-hardware-libs.tar.gz -C ~

# Run autogen
./autogen.sh

# Build tools required for building (expack, usecode stuff, etc)
./configure
cd files ; make ; cd ..
cd conf ; make ; cd ..
cd tools ; make ; cd ..
cd data ; make ; cd ..
cd gamemgr ; make ; cd ..
cd usecode ; make ; cd ..

# Clean-up pre-reqs from building tools
cd files ; make clean ; cd ..
cd conf ; make clean ; cd ..
cd gamemgr ; make clean ; cd ..

# Configure for build
./configure --with-iphone-sdk=iPhoneOS6.0 --with-sdl-prefix="${HOME}/iphone-hardware-libs/SDL" OGG_LIBS="-L${HOME}/iphone-hardware-libs/vorbis/lib -lvorbis -lm -logg" OGG_CFLAGS="-I${HOME}/iphone-hardware-libs/vorbis/include" CPPFLAGS="-I${HOME}/iphone-hardware-libs/vorbis/include" --host=arm-apple-darwin11 --disable-tools --disable-data

# Build
make
make iosbundle

# Fix-up the Info.plist file in the bundle (refers to Simulator instead of OS ... also needs to be based upon options the user provides on the configure line)
# NOTE: your.cert.exult below to match whatever is valid for your provisioning profile
cat Info-ios.plist | sed "s/Simulator/OS/g;s/simulator/os/g" > Exult.app/Info.plist | sed "s/net.sf.exult/com.ayeapp.exult/g" > Exult.app/Info.plist

# Get the Exult ios config and put it in place
# URL for exult-ios.cfg: https://www.box.com/shared/9l7vdzqeacpe8bco8gty
cp -a exult-ios.cfg Exult.app/exult.cfg

# Put game data in place
mkdir Exult.app/game
# NOTE: ~/.exult/blackgate/ should be a place where you have the BlackGate original content files
rsync -auv ~/.exult/blackgate/ Exult.app/game/forgeofvirtue/
# NOTE: ~/.exult/serpentisle/ should be a place where you have the Serpent Isle original content files
rsync -auv ~/.exult/serpentisle/ Exult.app/game/silverseed/

# Sign the app -- replace "Your Name" below with whatever you have for your cert
codesign -f -s "iPhone Developer: Your Name" Exult.app

# Put it on the device
Connect your device to your mac
Open Xcode
Open Organizer (via menu Window->Organizer)
Drag the Exult.app file from finder to your device in the Organizer
Status seems to show up only if you have a project in the background. If you receive no error, you should be good...go launch it on your device.

# Launch it!
Just touch it!
Lanica
Site Admin
Posts: 140
Joined: Thu May 14, 2020 1:34 pm

Re: iOS / iPhone / iPad

Post by Lanica »

Ok, so audio does not work...what I did get to work was static.
Also, the dimensions do not match the iPhone 5....uses the previous device screen dimensions.

Exciting nonetheless!
Malignant Manor
Site Admin
Posts: 985
Joined: Thu May 14, 2020 1:34 pm

Re: iOS / iPhone / iPad

Post by Malignant Manor »

There seems to be some missing code for SDL_VER_1_3.

gamemgr\sigame.cc, line 1304 has an unused bool, isTextInput. gamemgr\bggame.cc has the same variable and it is used in the default case statement. This is what the code should probably be.

Code: Select all

Index: gamemgr/sigame.cc
===================================================================
--- gamemgr/sigame.cc	(revision 7403)
+++ gamemgr/sigame.cc	(working copy)
@@ -1365,7 +1365,11 @@
 						npc_name[strlen(npc_name) - 1] = 0;
 					break;
 				default: {
+#ifdef SDL_VER_1_3
+					if ((isTextInput && selected == 0) || (!isTextInput && event.key.keysym.unicode > (int)'~' && selected == 0))
+#else
 					if (selected == 0) { // on the text input field?
+#endif
 						int len = strlen(npc_name);
 						char chr = 0;
 

Lanica
Site Admin
Posts: 140
Joined: Thu May 14, 2020 1:34 pm

Re: iOS / iPhone / iPad

Post by Lanica »

Yes Malignment....that is correct. I am just now only remembering what I did and didn't do back in 2011 ;)

-Lanica
Lanica
Site Admin
Posts: 140
Joined: Thu May 14, 2020 1:34 pm

Re: iOS / iPhone / iPad

Post by Lanica »

Ok...now music works. However it seems like it hangs whenever it gets to the end...just repeats one tone and doesn't loop.
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: iOS / iPhone / iPad

Post by Dominus »

Great, I'll give it a try tonight. As for music, are all music drivers (digital, midi, fmopl) affected?
--
Read the documentation and the FAQ! There is no excuse for not reading them! RTFM
Read the Rules!
We do not support Piracy/Abandonware/Warez!
Lanica
Site Admin
Posts: 140
Joined: Thu May 14, 2020 1:34 pm

Re: iOS / iPhone / iPad

Post by Lanica »

Tweaking the audio options did the trick. Sorry didn't have much time to mess with it last night. Should also try the OGGs for fun. Looks like you're around 9 hours head of me, so I expect your evening is coming up.

FYI you walk around by moving your device....When its level it shouldn't move at all. You can also tilt it when you have any gumps up and it won't move. To manipulate an object you can click near it and it will give you a menu of nearby options. Touch that menu option then it gives you a few more options.
Lanica
Site Admin
Posts: 140
Joined: Thu May 14, 2020 1:34 pm

Re: iOS / iPhone / iPad

Post by Lanica »

To make it work for the iphone5 resolution you can do:
touch Exult.app/Default-568h@2x.png

But then exult.cfg needs to be modified so it fills up the rest of the screen and also so the touch/mouse cursor properly lines up.
Malignant Manor
Site Admin
Posts: 985
Joined: Thu May 14, 2020 1:34 pm

Re: iOS / iPhone / iPad

Post by Malignant Manor »

Dominus asked, "do you still remeber waht mercurial revision of sdl 1.3 you used?"

I'd like to know too because my old compiled version of SDL 1.3 on Windows crashes on start up of Exult. Current Mercurial version is 7701. I think my current versions are from the 4900's. It would be nice if you could try to update to SDL 2.0 now that you have your 1.3 version working.



Should keys.cc line 297 be
k.scancode = SDL_SCANCODE_UNKNOWN;
instead of
k.scancode = static_cast(0);
?

It doesn't compile for me with the current code in Windows. (again old SDL 1.3 I had)
Lanica
Site Admin
Posts: 140
Joined: Thu May 14, 2020 1:34 pm

Re: iOS / iPhone / iPad

Post by Lanica »

I provided the SDL and vorbis libs in posts above. Note the libs are different whether you're using the simulator (x86) or hardware (arm).


# Get libs required for simulator and extract
# URL for libs: https://www.box.com/shared/86qspv7c3bout465oyly

# Get libs required for hardware (SDL + vorbis) and extract
# URL for libs: https://www.box.com/shared/tnzfscos85qspgiv3soy


I had to update the hardware libs at one point because it was using armv6 instead of armv7.

Looks like it was revision 5557, downloaded July 31, 2011.



I didn't ever try it on Windows. Also note that your previous question about SDL_VER_1_3 .... that block of code really should be __IPHONEOS__ as there's nothing related to SDL in there.


What compile errors are you getting?



And yes...SDL 2.0 should be something done soon. I'm wondering if we should do that as a whole rather than ifdef'ing the crap out of everything...
Lanica
Site Admin
Posts: 140
Joined: Thu May 14, 2020 1:34 pm

SDL 1.2 to 2.0

Post by Lanica »

Started the SDL conversation at:
http://exult.info/forum/viewtopic.php?p=516617#p516617

Looks like there's lots to do....

Migration guide (also in the post above): http://wiki.libsdl.org/MigrationGuide
Malignant Manor
Site Admin
Posts: 985
Joined: Thu May 14, 2020 1:34 pm

Re: iOS / iPhone / iPad

Post by Malignant Manor »

And yes...SDL 2.0 should be something done soon. I'm wondering if we should do that as a whole rather than ifdef'ing the crap out of everything...
I don't know if SDL 1.3+ dropped any system support. If there isn't any significant performance issue or bugs, I wouldn't mind if we dropped SDL 1.2. I'm not sure how the other developers feel.

It seems weird using SDL_VER_1_3 when the SDL_VERSION_ATLEAST macro exists.

What compile errors are you getting?

Code: Select all

keys.cc: In member function 'void KeyBinder::AddKeyBinding(SDLKey, int, const Action*, int, int*)':
keys.cc:380:27: error: expected type-specifier before 'SDL_Scancode'
keys.cc:380:27: error: expected '>' before 'SDL_Scancode'
keys.cc:380:27: error: expected '(' before 'SDL_Scancode'
keys.cc:380:27: error: 'SDL_Scancode' was not declared in this scope
keys.cc:380:43: error: expected ')' before ';' token

P.S. I don't know when I'll have the time to build the SDL version you are using and compile Exult.
Lanica
Site Admin
Posts: 140
Joined: Thu May 14, 2020 1:34 pm

Re: iOS / iPhone / iPad

Post by Lanica »

Yeah probably should have used that macro. Right now SDL_VER_1_3 is only defined if you are using --with-iphone-sdk ... so you probably need to define that.. It should be fixed...guess I was in a hurry back in 2011 and didn't do that the right way. At that point though, the iOS devices were the only thing that was planned to use SDL 1.3.
Malignant Manor
Site Admin
Posts: 985
Joined: Thu May 14, 2020 1:34 pm

Re: iOS / iPhone / iPad

Post by Malignant Manor »

I did define SDL_VER_1_3. SDL_SCANCODE_UNKNOWN is defined is 0 in the SDL_scancode enum. static_cast(0) gives the error.

relevant lines

Code: Select all

#ifdef SDL_VER_1_3
	k.scancode = static_cast(0);
#else
	k.scancode = 0;
#endif

edit: SDL_Scancode has the wrong case. It used to be SDL_scancode but got changed. I still don't see the need for the cast.
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: iOS / iPhone / iPad

Post by Dominus »

*compiled* now I need to see about those further instructions to get it on my phone (4) and my ipad...
--
Read the documentation and the FAQ! There is no excuse for not reading them! RTFM
Read the Rules!
We do not support Piracy/Abandonware/Warez!
Lanica
Site Admin
Posts: 140
Joined: Thu May 14, 2020 1:34 pm

Re: iOS / iPhone / iPad

Post by Lanica »

MM:

I receive this is I gut the ifdef block (make it just k.scancode = 0):
keys.cc: In member function 'void KeyBinder::AddKeyBinding(SDL_Keycode, int, const Action*, int, int*)':
keys.cc:379: error: invalid conversion from 'int' to 'SDL_Scancode'
make[2]: *** [keys.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2


However, SDL_scancode works just as well as SDL_Scancode.

-Lanica
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: iOS / iPhone / iPad

Post by Dominus »

hmm, can you attach the ios.flx file? This is not being generated by your rules :(

I think this problem we are facing with expack and the other tools is solved in other projects by some override file that points to the correct tools for the machine the cross compile is being done on. Can't remember which projects and where...
--
Read the documentation and the FAQ! There is no excuse for not reading them! RTFM
Read the Rules!
We do not support Piracy/Abandonware/Warez!
Lanica
Site Admin
Posts: 140
Joined: Thu May 14, 2020 1:34 pm

Re: iOS / iPhone / iPad

Post by Lanica »

Dominus:

The instructions for compiling for hardware should have made sure they were generated first.

However, I know you're just trying to get to success, so here is exult_iphone.flx :
https://www.box.com/shared/otmg5wwhckbqewct6s2b

;)

Once you get done, try to checkout to a new directory and follow the compiling for hardware instructions from the start to make sure they don't just work for me! :)

-Lanica
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: iOS / iPhone / iPad

Post by Dominus »

never mind, solved
--
Read the documentation and the FAQ! There is no excuse for not reading them! RTFM
Read the Rules!
We do not support Piracy/Abandonware/Warez!
Malignant Manor
Site Admin
Posts: 985
Joined: Thu May 14, 2020 1:34 pm

Re: iOS / iPhone / iPad

Post by Malignant Manor »

SDL_scancode works because of SDL_compat.h
#define SDL_scancode SDL_Scancode

It was my problem from having an older version. I prefer SDL_SCANCODE_UNKNOWN instead of the cast, but the current code is fine.
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: iOS / iPhone / iPad

Post by Dominus »

result built against ios 7.0:
Aug 26 21:31:01 DomiFon com.apple.launchd[1] (UIKitApplication:net.sf.exult[0xd77e][864]) : (UIKitApplication:net.sf.exult[0xd77e]) Exited with code: 2
Aug 26 21:31:01 DomiFon backboardd[28] : Application 'UIKitApplication:net.sf.exult[0xd77e]' exited abnormally with exit status 2

I'll try to find my ios 6.1 sdk now :)
--
Read the documentation and the FAQ! There is no excuse for not reading them! RTFM
Read the Rules!
We do not support Piracy/Abandonware/Warez!
Lanica
Site Admin
Posts: 140
Joined: Thu May 14, 2020 1:34 pm

Re: iOS / iPhone / iPad

Post by Lanica »

Its possible you need to edit something in the Info.plist file....the error is not specific at all. Did you sign? Was this simulator or hardware? I have seen that happen before with the simulator...but with the hardware it typically makes sure all is good before it goes forward.

Could also be as simple as a missing .cfg file...but I think you got that covered?
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: iOS / iPhone / iPad

Post by Dominus »

with ios 6.1 sdk, same crash on startup :(
Edited the plist to be ios 6.1 instead but still crashed. everything else is there as you wrote (copy/pasted the whole thing and made my changes).
--
Read the documentation and the FAQ! There is no excuse for not reading them! RTFM
Read the Rules!
We do not support Piracy/Abandonware/Warez!
Locked