Page 2 of 2

Posted: Sun Jan 03, 2010 8:53 pm
by Gigasoft
I use VINT as a timer, and I decrement each channel's timer according to an overflow value made by adding the song's speed to a global timer. That works out well. The YM2612 also has two programmable timers that you can poll. You don't need to share addresses between the two programs. You can just include the file with your music at an aligned, known address.

Posted: Sun Jan 03, 2010 9:42 pm
by Stef
eteream wrote: The only thing that is mising is a C compiler for Z80... and well, a method to share real address between the two compilations (for music mapping from Z80 to ROM).

I'm tring the SDCC compiler for C for Z80, but it generates some king of hexadecimal code, i'm working on it...

EDIT:

Now I see that since there is no kind of timers on the z80, the timing of cicles of instructions are used to do the 'timing'. Well, you can use VINT as a timers, if you find music at 60hz... So doing it with C sounds crazy... well, unless you modify the compiler...
As far you're going on Z80, i think you should stay with asm. You have limited memory space and limited cpu time (if you want to deal with DAC stuff). Also that permit you to calculate all your loop cycle to assure good timing without pooling YM2612 timers.

And yeah, basically i'm the creator of Gens, i'm an inconditionnal sega genesis fan :p

Posted: Tue Jan 05, 2010 3:58 am
by eteream
Gigasoft wrote:I use VINT as a timer, and I decrement each channel's timer according to an overflow value made by adding the song's speed to a global timer. That works out well. The YM2612 also has two programmable timers that you can poll.
That timers sounds interesting...
Stef wrote: As far you're going on Z80, i think you should stay with asm. You have limited memory space and limited cpu time (if you want to deal with DAC stuff).
I'm lost at this point. Why is DAC difficult? As far as I know PCM seems to be the hardest part, the most consuming resources thing.
By limited cpu time, do you mean response time? or not so much instructions per second?
Stef wrote:And yeah, basically i'm the creator of Gens, i'm an inconditionnal sega genesis fan :p
you are awesome man! wow!

Posted: Tue Jan 05, 2010 4:03 am
by TmEE co.(TM)
Doing PCM is very simple, its that if you use C you will maybe reach 8KHz sample rate and have no time for doing other things without major negative consequences on PCM playback quality..... Z80 is not exactly fast, and C is not really meant for slow stuff.... so slow + slow = very slow.

Here is small example of what my MD Z80 sound engine can do :
http://8bitcollective.com/music/TmEE/Wi ... tter+(MD)/
...all 100% ASM, 100% real HW recording... :)

Posted: Tue Jan 05, 2010 5:45 am
by tomaitheous
eteream wrote: I'm lost at this point. Why is DAC difficult? As far as I know PCM seems to be the hardest part, the most consuming resources thing.
By limited cpu time, do you mean response time? or not so much instructions per second?
No interrupts to feed the DAC. And the DAC isn't self feeding. Those two things make it a pain in the ass. If it weren't for the Z80 (being a separate processor to dedicate to pure timing via instructions), samples would pretty much null on the system.

Posted: Tue Jan 05, 2010 1:04 pm
by eteream
Ok, I got it. When you speak about DAC you include PCM sound in it. Z80 is more slow than it seems. All it sounds very hard.

¿Do you know if old comercial games uses PCM+FM to do sound effects+music?

Posted: Tue Jan 05, 2010 1:47 pm
by Flygon
Commercial games did indeed do PCM and FM at the same time (Such as Shining Force or Sonic the Hedgehog), in fact, I'm sure most of the games released for the console did.

Unless I've missed the point of the question completely, in which case, ignore this post.

Posted: Tue Jan 05, 2010 5:14 pm
by eteream
This is it. Thanks!