DOSBox iPhone Port - Work in Progress!

Developer's Forum, for discussion of bugs, code, and other developmental aspects of DOSBox.

DOSBox iPhone Port - Work in Progress!

Postby lopar » 2009-11-26 @ 19:10

Hey all,

For an Operating Systems class project, I'm working with a classmate on an iPhone port for DOSBox (hence the topic :P)

Anyway, after several dirty hacks on SDL and the main DOSBox codebase, as well as disabling a *lot* of features, I've managed to get it to boot. Next step is to get the keyboard mapping correct, as it seems that the keycodes are vastly different on the iphone.

I'd like to get this working to the point where I could release it to the community. However, the code is really dirty at the moment, as we're rushing to get it functional in time for the project to get turned in, but hopefully I can fix it up after the class is over.

Here's proof:

First successful build: http://dl.dropbox.com/u/932447/dosbox_early.png
Screen scaling: http://dl.dropbox.com/u/932447/dosbox_2.png

So far it's (as expected) really zippy on the simulator, quite slow on the device. Lots of optimization ahead.. let me know what you think!

Happy thanksgiving everyone.
- Jason Neufeld (Phil. 3:12)
http://www.jasonneufelddesign.com/
User avatar
lopar
Newbie
 
Posts: 2
Joined: 2009-11-26 @ 18:57

Re: DOSBox iPhone Port - Work in Progress!

Postby Dominus » 2009-11-26 @ 22:17

Hmm, I'd make it a sideways app, sorry, right now I'm lacking the proper words, but to me it seems that having it sideways would look much more DOSish :)
But looks good, whenever you need an additional tester, let me know, I have a jailbroken iPhone 3G and know my way around DOSBox :)

(for this the built-in GUI for configuration would be nice to have :))
User avatar
Dominus
DOSBox Moderator
 
Posts: 7689
Joined: 2002-10-03 @ 09:54
Location: Ludwigsburg

Re: DOSBox iPhone Port - Work in Progress!

Postby Pickle » 2009-11-30 @ 20:28

lopar the best thing you can do to get more performance is to use the the ARM dynamic core.
Pickle
Newbie
 
Posts: 95
Joined: 2008-4-14 @ 13:15

Re: DOSBox iPhone Port - Work in Progress!

Postby lopar » 2009-11-30 @ 21:21

Hey that's a good idea... I noticed there was an X86 dynamic core.. is the ARM one accessible in the current source revision?

Right now I have it booting and I've created a virtual keyboard and am able to use the shell fairly well, but it wont fork new applications. Gives me a GRP5: Illegal Call 7 error, which I'm assuming from what I can find on that error has something to do with the memory system. Any ideas on how to resolve that? Thanks so much!
- Jason Neufeld (Phil. 3:12)
http://www.jasonneufelddesign.com/
User avatar
lopar
Newbie
 
Posts: 2
Joined: 2009-11-26 @ 18:57

Re: DOSBox iPhone Port - Work in Progress!

Postby Pickle » 2009-11-30 @ 21:56

sure the ARM dynamic core was in the last release, although I think there were some minor changes/fixes applied after 0.73.
To enable it I usually change config.h manually.
define C_DYNREC
define C_TARGETCPU ARMV4LE

also take note about having the correct ABI, undefine for OABI or define for EABI (see risc_armv4le-common.h):
__ARM_EABI__

A person with iphone experience tip me on this to flush the icache:
extern void sys_icache_invalidate(const void* Addr, size_t len);

replace:
108 __asm __volatile ("swi 0x9f0002 @ sys_cacheflush"
109 : // no outputs
110 : "r" (_beg), "r" (_end), "r" (_flg)
111 );
Pickle
Newbie
 
Posts: 95
Joined: 2008-4-14 @ 13:15

Re: DOSBox iPhone Port - Work in Progress!

Postby one541 » 2009-12-12 @ 04:38

I enabled the dynamic recompiling core and set the __ARM_EABI__ and modified cache_block_closing to use sys_icache_invalidate instead... But it gives me an EXC_BAD_ACCESS in some odd place -- thinking the stack is corrupted, not exactly sure where to start to debug this, can anyone give me a pointer?
one541
Newbie
 
Posts: 1
Joined: 2009-12-11 @ 19:27

Re: DOSBox iPhone Port - Work in Progress!

Postby Pickle » 2009-12-12 @ 14:19

This needs to run on the translation cache to make it executable on the stack. BASE_ADDR is the address to this translation area and TARGET_SIZE_2 is the size.

out=(u_char *)BASE_ADDR;

if (mmap (out, 1<<TARGET_SIZE_2,

PROT_READ | PROT_WRITE | PROT_EXEC,

MAP_FIXED | MAP_PRIVATE | MAP_ANON,

-1, 0) != out) {fprintf(stderr, "mmap() failed\n");}
Pickle
Newbie
 
Posts: 95
Joined: 2008-4-14 @ 13:15

Re: DOSBox iPhone Port - Work in Progress!

Postby xris99 » 2009-12-23 @ 12:23

Hey Lopar,

i was going to port dosbox myself. So if you need help hacking, just pm me and send me your code. I help you fix the bugs.
User avatar
xris99
Newbie
 
Posts: 1
Joined: 2009-12-23 @ 12:16

Re: DOSBox iPhone Port - Work in Progress!

Postby kolijoco » 2010-1-27 @ 09:57

hi lopar,

i'm the one who ported dosbox to s60 (smart nokias): nice and working and released. :-)

i've done pretty much all the things you're still lacking: touchscreen keyboard overlays for virtual keyboards (mappings loadable form the dos shell :-), arm dynamic core, (relatively fast) rendering to fixed (small) resolution and all.

my code's pretty nice and clean, off of dosbox 0.73 at the moment...

check your PM!
User avatar
kolijoco
Newbie
 
Posts: 72
Joined: 2006-6-16 @ 07:38

Re: DOSBox iPhone Port - Work in Progress!

Postby kolijoco » 2010-1-27 @ 15:25

a quick question to all,
where can i get hold of sdl and sdl sources for the iphone? all the links i googled up seem to be dead...
i really don't feel like (re-?)doing the sdl port as well...
User avatar
kolijoco
Newbie
 
Posts: 72
Joined: 2006-6-16 @ 07:38

Re: DOSBox iPhone Port - Work in Progress!

Postby Pickle » 2010-1-28 @ 14:19

do you know who zodttd is? He has some SDL sources that i believe are very optimized for the iphone.
Pickle
Newbie
 
Posts: 95
Joined: 2008-4-14 @ 13:15

Re: DOSBox iPhone Port - Work in Progress!

Postby kolijoco » 2010-1-28 @ 16:57

haven't "met" him yet. how can i contact him?
User avatar
kolijoco
Newbie
 
Posts: 72
Joined: 2006-6-16 @ 07:38

Re: DOSBox iPhone Port - Work in Progress!

Postby Pickle » 2010-1-28 @ 17:00

www.zodttd.com

Try the forums. I also have direct contact, so ill inform him you will be lookinf for SDL source.
Pickle
Newbie
 
Posts: 95
Joined: 2008-4-14 @ 13:15

Re: DOSBox iPhone Port - Work in Progress!

Postby bendac » 2010-2-16 @ 22:26

About SDL Source
Question asked from Zodttd to ambethia found on Twitter : http://twitter.com/zodttd/status/8907427462
=> " Can you link me to where you found SDL needing a commercial license for iPhone? Eep!? 8:14 AM Feb 10th depuis web en réponse à "
Answer from ambethia : http://twitter.com/ambethia/status/8914930136
=> "@zodttd http://bit.ly/a88S40 It's LGPL, and Apple says you can't do dylibs. It seems making the object code available might be a workaround"

Link : http://www.galaxygameworks.com/

Would it be a problem ?

You should contact Zodttd on Twitter.

Thank you to spend of time to port dosbox on ipod :)
bendac
Newbie
 
Posts: 2
Joined: 2010-2-16 @ 22:13

Re: DOSBox iPhone Port - Work in Progress!

Postby bendac » 2010-2-16 @ 22:29

Otherwise may be you should have a look here : http://stackoverflow.com/questions/5974 ... for-iphone
bendac
Newbie
 
Posts: 2
Joined: 2010-2-16 @ 22:13


Return to DOSBox Development

Who is online

Users browsing this forum: No registered users and 1 guest