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

Harteex

  • * Administrator
  • Posts: 709
    • 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: 709
    • 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: 709
    • 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: 709
    • 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: 156
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