Page 7 of 25

Posted: Tue Oct 08, 2013 7:04 pm
by Stef
Yeah, i can confirm the audio is still bad in the later version.

Posted: Tue Oct 08, 2013 7:42 pm
by TmEE co.(TM)
I tried both and I am quite sure the problem is writing things too quick to the YM. Every reset results in different tones, and on tune loops things change too.
Also FM freq register write order is not optional, it has to be done the right way.

EDIT: I let the ROM sit for a while, I think one problem is the Key On/Off register, I hear stuck notes every once in a while. Bad sounds can happen when not all the operator bits get set the right way.

Posted: Tue Oct 08, 2013 8:04 pm
by Stef
What is weird is that it does work perfectly on my MD1, it seems to affects only systems with YM3438.. i remember there is something different about the timers with YM3438, but it may be related to the status register itself.

Posted: Tue Oct 08, 2013 8:28 pm
by gasega68k
Yeah, i can confirm the audio is still bad in the later version.
Thanks, good to know, now I can try it in both genesis that I have (when I finish building the test cartridge). I will post some pictures of the test cartridge when it is finished. :wink:

When I finished programming the game I will release the source code, also the tools I use to make textures and sprites, so anyone could use it to make your own version of the game or maybe do a completely different game with this. :D

Posted: Tue Oct 08, 2013 8:30 pm
by Mask of Destiny
It wouldn't be that surprising if the minimum wait time between register writes was different between the YM2612 and YM3438. I've been meaning to test that actually.

Posted: Tue Oct 08, 2013 8:39 pm
by TmEE co.(TM)
The wait times are different, but I did not measure how much different.
Also vanilla YM3438 differs from one in MD2. Hellfire has 2x slower music on MD2 and no music at all with 3438.

The ROMs are not working on my MD1 though.

Posted: Tue Oct 08, 2013 8:40 pm
by Stef
It wouldn't be that surprising if the minimum wait time between register writes was different between the YM2612 and YM3438. I've been meaning to test that actually.
Probably but from his code he is actually testing for the busy bit before each write so that should not cause any troubles.
When I finished programming the game I will release the source code, also the tools I use to make textures and sprites, so anyone could use it to make your own version of the game or maybe do a completely different game with this.
Awesome ! i would be love to look into the sources :D

Posted: Tue Oct 08, 2013 8:44 pm
by Stef
TmEE co.(TM) wrote:The wait times are different, but I did not measure how much different.
Also vanilla YM3438 differs from one in MD2. Hellfire has 2x slower music on MD2 and no music at all with 3438.

The ROMs are not working on my MD1 though.
You mean the wolf3D game does not sound correctly on your MD1 ?
which version you actually own ? I should test on my other MD1 as well.

Posted: Tue Oct 08, 2013 10:15 pm
by gasega68k
If the problem is to write quick to Ym regs, instead of reading to $4000 for wait status and then write, I could do just counting cycles and then write to the Ym regs. What do you think?

Posted: Tue Oct 08, 2013 10:35 pm
by TmEE co.(TM)
I my MD sound engine I do strategically placed NOPs and arrange code so that there's some action happen between writes so I waste least time possible.

My MD1 is a VA6. I have not tested on VA1/2/3/4.

Posted: Mon Oct 14, 2013 6:33 pm
by Mixail
gasega68k, how's it going?

Posted: Mon Oct 14, 2013 9:16 pm
by gasega68k
I'm still building the test cartridge (I think it will be finished tomorrow) to try both versions of sega sega genesis that I have, because I want to find out why the music does not play well in some models, but in the meantime I made a version, which had not really thought of uploading yet, because I wanted to test it first. This version I changed the way to write to the YM regs in a similar way as they do in sonic1, although admittedly I have not much hope that now works well but ...
Here is the link to download it:
http://www.mediafire.com/download/3t6dh ... _b2_sn.rar

Posted: Mon Oct 14, 2013 9:40 pm
by Sdw
I think you are onto something - this version played correctly as far as I could tell!

Posted: Mon Oct 14, 2013 9:45 pm
by Stef
Curious to know about the difference in register writes :)

Posted: Tue Oct 15, 2013 2:16 am
by gasega68k
Sdw wrote:I think you are onto something - this version played correctly as far as I could tell!
Wow! :o Can others confirm this?
Stef wrote:Curious to know about the difference in register writes :)
I changed several things, now the Z80 is disabled during the loop of tfc replayer (in previous versions the Z80 was disabled before writing to the YM regs and then enabled again after writing), but I think this is not the cause the problem because before had already made ​​a version with the Z80 disabled but that did not work. Also now after writing to $4000($4002) and before the wait status, I add 3 NOPs, and also the wait status was changed, instead of reading through the reg "a0" ("tst.b (a0)") as it was before, I do: "tst.b ($ a04000)". This is the code to write to the YM regs:

Code: Select all

;..............................................
         ;d0 = reg,  d1 = val,  d2 = bank
ym2612wr:
   ;lea  $a04000,a0
wait1:
   tst.b  ($a04000)        ;waitstatus
   bmi.s wait1
   move.b d0,0(a0,d2)
   nop
   nop
   nop
wait2:
   tst.b  ($a04000)        ;waitstatus
   bmi.s wait2
   move.b d1,1(a0,d2)
   rts
If finally confirmed that this version works well, I think the cause could be the 3 NOPs I added.