Author Topic: Developing for Gemei A330 on Mac OS X  (Read 12839 times)

Jonesie (OP)

  • Posts: 32
Re: Developing for Gemei A330 on Mac OS X
« Reply #20 on: November 04, 2013, 10:12:13 am »
Jonesie: I really like your enthusiasm.....the A330 is a really good piece of hardware and never got the love it deserves. Hopefully you'll figure it all out.....thanks for your efforts.

Hi,

thank you for your message. I'm this enthusiastic mostly because the console is 100% new to me, but I think it's more than worth mentioning that Harteex remains equally enthusiastic after all the time he has spent with it. I wouldn't have made any progress without his skills and support.

By the way, already moved to our new house. Lots of space, including a room for developing stuff. Now I need internet access :-)
« Last Edit: November 04, 2013, 10:14:21 am by Jonesie »

fosamax

  • Posts: 316
Re: Developing for Gemei A330 on Mac OS X
« Reply #21 on: November 04, 2013, 12:12:50 pm »
I hope that you could find a way to avoid audio latency that is probably the most worrying trouble with the gemei.

The lack of proper documentation is also problematic.

if you can, take a look at http://drlionrsm.blogspot.fr/2013/07/dingoo-emulation-pack-v20.html#more since it's something that may worth being ported to the gemei.

Thanks to Jonesie and Harteex !

Jonesie (OP)

  • Posts: 32
Re: Developing for Gemei A330 on Mac OS X
« Reply #22 on: November 05, 2013, 05:13:03 pm »
I hope that you could find a way to avoid audio latency that is probably the most worrying trouble with the gemei.

That is one of the most intriguing points. I've noticed that there are emulators with and without lag. I'll try to figure it out, of course.

if you can, take a look at http://drlionrsm.blogspot.fr/2013/07/dingoo-emulation-pack-v20.html#more since it's something that may worth being ported to the gemei.

I've peeked at that page and it looks interesting. I'm more than anything interested in porting my games to the Gemei, but won't say no to this kind of things.

Harteex

  • * Administrator
  • Posts: 713
    • Harteex Productions
Re: Developing for Gemei A330 on Mac OS X
« Reply #23 on: November 05, 2013, 08:49:42 pm »
I hope that you could find a way to avoid audio latency that is probably the most worrying trouble with the gemei.

I wonder if there is some way of configuring the hardware for this, for example through some gpio...

if you can, take a look at http://drlionrsm.blogspot.fr/2013/07/dingoo-emulation-pack-v20.html#more since it's something that may worth being ported to the gemei.

I don't know how to create a SIM file atm unfortunally. If that would be solved, porting over those emulators would probably be very easy.
(Although unrelated to lion's emulators) I have hugo (PCE) running on the gemei, but as said, didn't figure out how to make it work as an emulator, so I didn't really do much more with it.


As for the device itself, it's form factor and controls beats any other device imo.

Jonesie (OP)

  • Posts: 32
Re: Developing for Gemei A330 on Mac OS X
« Reply #24 on: November 06, 2013, 02:48:54 pm »
I don't know how to create a SIM file atm unfortunally. If that would be solved, porting over those emulators would probably be very easy.
(Although unrelated to lion's emulators) I have hugo (PCE) running on the gemei, but as said, didn't figure out how to make it work as an emulator, so I didn't really do much more with it.

We can look into that too :)

As for the device itself, it's form factor and controls beats any other device imo.

Mine makes wonkie noises when pressing right on the D-pad, but other than that I'm 100% satisfied with it. Maybe I should open the case and polish it a little bit in order to get this straight. That noise can be irritating sometimes :D

Harteex

  • * Administrator
  • Posts: 713
    • Harteex Productions
Re: Developing for Gemei A330 on Mac OS X
« Reply #25 on: November 08, 2013, 02:29:58 am »
I noticed the origin memory address was different between my working binaries and my non-working ones compiled on OSX. So I then tried to manually change this with a hex editor, and it seemed to work.

Grab the following code and compile it for your OS. Then after compiling any gemei application such as SDLPong, run my code on the .cc file, and hopefully the cc file should run on your gemei:
http://pastebin.com/ZZ4krdtX

But it would still be nice to get flatmush elf2app tool work with the gemei to not depend on the dlmake exe file..
« Last Edit: November 08, 2013, 02:33:05 am by Harteex »

Jonesie (OP)

  • Posts: 32
Re: Developing for Gemei A330 on Mac OS X
« Reply #26 on: November 08, 2013, 04:16:06 pm »
I noticed the origin memory address was different between my working binaries and my non-working ones compiled on OSX. So I then tried to manually change this with a hex editor, and it seemed to work.

Grab the following code and compile it for your OS. Then after compiling any gemei application such as SDLPong, run my code on the .cc file, and hopefully the cc file should run on your gemei:
http://pastebin.com/ZZ4krdtX

But it would still be nice to get flatmush elf2app tool work with the gemei to not depend on the dlmake exe file..

That's great. I'll try it ASAP.

If the only thing that's actually making a difference is the entry point address, we could supply the -e0x138008b8 swich to ld as see what happens. I guess we could even specify it in the link script :)

Jonesie (OP)

  • Posts: 32
Re: Developing for Gemei A330 on Mac OS X
« Reply #27 on: November 09, 2013, 07:08:36 pm »
Excellent! It worked like a charm.

However, I've failed to reproduce the result neither using ld input (the -e parameter) nor as a link script statement. I'm misunderstanding something, that's for sure.

I've triple-checked that the entry address for the ELF binary is indeed 0x138008b8, which was the entry point on the ELF file you sent me and that I dlmake'd into a working CC file under wine.

I have to go on the hunt for new furniture, but I'll keep trying later on :)

Harteex

  • * Administrator
  • Posts: 713
    • Harteex Productions
Re: Developing for Gemei A330 on Mac OS X
« Reply #28 on: November 10, 2013, 12:48:28 am »
Excellent! It worked like a charm.

However, I've failed to reproduce the result neither using ld input (the -e parameter) nor as a link script statement. I'm misunderstanding something, that's for sure.

I've triple-checked that the entry address for the ELF binary is indeed 0x138008b8, which was the entry point on the ELF file you sent me and that I dlmake'd into a working CC file under wine.

I have to go on the hunt for new furniture, but I'll keep trying later on :)

Great that it worked!

The origin is the address where the code will be loaded into on the gemei, not the address of the entry function.

Good luck with the furniture! :)

Jonesie (OP)

  • Posts: 32
Re: Developing for Gemei A330 on Mac OS X
« Reply #29 on: November 10, 2013, 07:22:47 am »
The origin is the address where the code will be loaded into on the gemei, not the address of the entry function.

That's right, but I've noticed that the origin address can also be specified in link.xn:

Code: [Select]
MEMORY
{
        ram (wx) : ORIGIN = 0x13800000, LENGTH = 16M
}

Is that the value you're patching? I can see that you're writing 0x80 and 0x13 in your code, but I don't know if it is just a matter of coincidence or if you're enforcing this value because the linker failed to set it.

Thanks for all your help, and sorry to keep bugging you with so many questions.   

Good luck with the furniture! :)

Thanks! We've managed to spot all three needed pieces of furniture in a community-managed second-hand furniture store for ?65, delivery included. This was a triumph!

Harteex

  • * Administrator
  • Posts: 713
    • Harteex Productions
Re: Developing for Gemei A330 on Mac OS X
« Reply #30 on: November 11, 2013, 10:18:18 pm »
The origin is the address where the code will be loaded into on the gemei, not the address of the entry function.

That's right, but I've noticed that the origin address can also be specified in link.xn:

Code: [Select]
MEMORY
{
        ram (wx) : ORIGIN = 0x13800000, LENGTH = 16M
}

Is that the value you're patching? I can see that you're writing 0x80 and 0x13 in your code, but I don't know if it is just a matter of coincidence or if you're enforcing this value because the linker failed to set it.

Yea that's the value, it's in the other order in my program since I'm writing bytes and it's little endian... and I'm also not checking / writing the other zeroes, so it can be improved :P

So this could be an issue with dlmake and a new linker format, but also an issue where the linker does not pick up this value..

Jonesie (OP)

  • Posts: 32
Re: Developing for Gemei A330 on Mac OS X
« Reply #31 on: November 25, 2013, 10:25:14 am »
I'm spending the little time I've got these days to study how things have been done in the SDL port. I find it quite strange how an OS task is being created every time you want to play some audio samples  ::)

Is that the proper way of doing it, or is it just a fix because of documentation being scarce?

Harteex

  • * Administrator
  • Posts: 713
    • Harteex Productions
Re: Developing for Gemei A330 on Mac OS X
« Reply #32 on: November 25, 2013, 06:54:31 pm »
I'm spending the little time I've got these days to study how things have been done in the SDL port. I find it quite strange how an OS task is being created every time you want to play some audio samples  ::)

Is that the proper way of doing it, or is it just a fix because of documentation being scarce?

The thread is created when you init audio, not every time you play a sample. You need to do the mixing in its own thread, otherwise you might not be able to feed it with audio data fast enough.
For example, if the drawing takes more time than it takes to play what's in the buffer, you would hear cracks in the music.

There are actually two threads, on that is mixing, and one that is writing it to wave out. The reason is because waveout_write is blocking, at least on the dingoo, so if you would use just one thread, there would be silence during the mixing.
« Last Edit: November 25, 2013, 06:57:51 pm by Harteex »

Jonesie (OP)

  • Posts: 32
Re: Developing for Gemei A330 on Mac OS X
« Reply #33 on: November 27, 2013, 10:08:26 am »
Excellent explanation, thank you very much! This thing gets more and more interesting every day.

I've been trying to understand how things were done in other HAL's running on different architectures. Precisely, on GP2X (minimal lib) and GP32 (SDL). I would like to study how GPIO works. I've never worked at very low level, except for some work I did on microchip and intel microcontrollers in the late 90's.

I do have a question: doesn't the operating system prevent software to use these kind of low level resources? I mean, as far as I can remember, I was told quite a while ago that modern operating systems enforce the use of system calls, effectively preventing loadable programs from programming the hardware directly. Here's hoping that this is not the case, though ;D

Harteex

  • * Administrator
  • Posts: 713
    • Harteex Productions
Re: Developing for Gemei A330 on Mac OS X
« Reply #34 on: November 29, 2013, 12:51:54 am »
I do have a question: doesn't the operating system prevent software to use these kind of low level resources? I mean, as far as I can remember, I was told quite a while ago that modern operating systems enforce the use of system calls, effectively preventing loadable programs from programming the hardware directly. Here's hoping that this is not the case, though ;D

Well, MicroC/OS-II is a very small OS for embedded devices. Everything runs in kernel mode, so you can do what you want.

Jonesie (OP)

  • Posts: 32
Re: Developing for Gemei A330 on Mac OS X
« Reply #35 on: November 29, 2013, 10:18:40 am »
Ok, that's the difference then. Thanks!

I'll keep studying existing code  ;D

Jonesie (OP)

  • Posts: 32
Re: Developing for Gemei A330 on Mac OS X
« Reply #36 on: January 08, 2014, 10:27:34 am »
Just a quick message to state that I haven't ran away, just don't feel like posting until I have something to share :D

flexus

  • Posts: 4
Re: Developing for Gemei A330 on Mac OS X
« Reply #37 on: January 09, 2014, 05:44:00 pm »
Nice to hear this from you. I belive in success!

Harteex

  • * Administrator
  • Posts: 713
    • Harteex Productions
Re: Developing for Gemei A330 on Mac OS X
« Reply #38 on: January 09, 2014, 09:19:30 pm »
Just a quick message to state that I haven't ran away, just don't feel like posting until I have something to share :D

Looking forward to see what you're up to :)
I haven't had any time to do anything for the Gemei myself unfortunally.

chevette

  • Posts: 238
Re: Developing for Gemei A330 on Mac OS X
« Reply #39 on: January 09, 2014, 10:13:53 pm »
Glad you're still on the scene!!!

 

Post a new topic
Post a new topic