VOGONS


DOSBox iPhone Port - Work in Progress!

Topic actions

  • This topic is locked. You cannot reply or edit posts.

First post, by lopar

User metadata
Rank Newbie
Rank
Newbie

Hey all,

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

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/

Reply 1 of 14, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

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 😀)

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 3 of 14, by lopar

User metadata
Rank Newbie
Rank
Newbie

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/

Reply 4 of 14, by Pickle

User metadata
Rank Member
Rank
Member

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 );

Reply 5 of 14, by one541

User metadata
Rank Newbie
Rank
Newbie

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?

Reply 6 of 14, by Pickle

User metadata
Rank Member
Rank
Member

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");}

Reply 8 of 14, by kolijoco

User metadata
Rank Newbie
Rank
Newbie

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!

Reply 13 of 14, by bendac

User metadata
Rank Newbie
Rank
Newbie

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 😀