Simple 4-channel sample player

For anything related to sound (YM2612, PSG, Z80, PCM...)

Moderator: BigEvilCorporation

Shiru
Very interested
Posts: 786
Joined: Sat Apr 07, 2007 3:11 am
Location: Russia, Moscow
Contact:

Post by Shiru » Wed May 02, 2007 8:08 am

Ok, here is first test (RS, MF), to be sure what M68K not hangs by some reasons (for example, in waiting loop). Now when you press keys, some messages displays, usually just 'wait after new sample' for short time. Try to stress program, and see what it will display. Also, when you get silence, check, if mentioned message still displays by keys pressing.

TmEE co.(TM)
Very interested
Posts: 2440
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Wed May 02, 2007 8:33 am

I'll check later this day, when I get home
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

zinger
Very interested
Posts: 60
Joined: Thu Apr 19, 2007 12:39 am
Location: sweden
Contact:

Post by zinger » Wed May 02, 2007 10:59 am

WTF? How does this work? Impressive! :)

TmEE co.(TM)
Very interested
Posts: 2440
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Wed May 02, 2007 11:28 am

zinger wrote:WTF? How does this work? Impressive! :)
Look at the source :wink:
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

zinger
Very interested
Posts: 60
Joined: Thu Apr 19, 2007 12:39 am
Location: sweden
Contact:

Post by zinger » Wed May 02, 2007 1:14 pm

TmEE co.(TM) wrote:
zinger wrote:WTF? How does this work? Impressive! :)
Look at the source :wink:
Sorry, I don't know a thing about coding. Where do those extra soundchannels come from? :) How is the YM2612 limited when playing all 4 channels (do all FM channels still work??)? And had this trick been discovered when games were still made for MD?

TmEE co.(TM)
Very interested
Posts: 2440
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Wed May 02, 2007 2:28 pm

It does everything in software with one PCM channel YM2612 has.

Anyway I tested your new code, when it halts, it says "Wait for Z80", maybe some acknowledge gets missed or something ?
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Wed May 02, 2007 7:59 pm

I confirm what tmEE affirmed... sound mute if you stress the player. I'm not able to give when exactly it happen since it looks very hasardous.
I tested both on MD1 ans MD2 on PAL or NTSC setting.
There is a strange bug on the MD1 which isn't on MD2 by the way :
when you do a cold start on MD1, all you have is a white screen, the button action does work however. If you do reset, you have the explanation partially displayed (bottom on screen almost time). I guess this is related to VDP initialisation. On my MD2 i've the minimal genesis bios which does basic VDP initialisation before giving hand to the rom code... which i haven't on the MD1.

evildragon
Very interested
Posts: 326
Joined: Mon Mar 12, 2007 1:53 am
Contact:

Post by evildragon » Wed May 02, 2007 8:05 pm

Stef wrote:I confirm what tmEE affirmed... sound mute if you stress the player. I'm not able to give when exactly it happen since it looks very hasardous.
I tested both on MD1 ans MD2 on PAL or NTSC setting.
There is a strange bug on the MD1 which isn't on MD2 by the way :
when you do a cold start on MD1, all you have is a white screen, the button action does work however. If you do reset, you have the explanation partially displayed (bottom on screen almost time). I guess this is related to VDP initialisation. On my MD2 i've the minimal genesis bios which does basic VDP initialisation before giving hand to the rom code... which i haven't on the MD1.
Which MD1? There's atleast 3 models of the MD1 as far as I know...

1st Gen Model 1: Rubber Feet (and says HD Graphics, and has EXT port on back). Also lacks TMSS, boots right into game.

1 and a half Gen (as I call it): Says HD Graphics, but has plastic feet. Has TMSS (i believe--i've never had this model)

2nd Gen Model 1: Plastic Feet (and does NOT say HD Graphics, lacks EXT port on back, but appears to have a space for one). Has TMSS..

3rd Gen Model 1: Looks the same as 2nd Gen, but does NOT have that space on the back for an EXT port... Has TMSS.. (This model is also closely related to the Model 2 Genesis, in the fact that it has the smaller 68K CPU, and has black piano contacts for the CD attachment.. Also has a completely re-designed motherboard)

(all of the above models have different motherboards, and combinations of 68K CPUs/Clones

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Wed May 02, 2007 9:47 pm

evildragon wrote:
Stef wrote:I confirm what tmEE affirmed... sound mute if you stress the player. I'm not able to give when exactly it happen since it looks very hasardous.
I tested both on MD1 ans MD2 on PAL or NTSC setting.
There is a strange bug on the MD1 which isn't on MD2 by the way :
when you do a cold start on MD1, all you have is a white screen, the button action does work however. If you do reset, you have the explanation partially displayed (bottom on screen almost time). I guess this is related to VDP initialisation. On my MD2 i've the minimal genesis bios which does basic VDP initialisation before giving hand to the rom code... which i haven't on the MD1.
Which MD1? There's atleast 3 models of the MD1 as far as I know...

1st Gen Model 1: Rubber Feet (and says HD Graphics, and has EXT port on back). Also lacks TMSS, boots right into game.

1 and a half Gen (as I call it): Says HD Graphics, but has plastic feet. Has TMSS (i believe--i've never had this model)

2nd Gen Model 1: Plastic Feet (and does NOT say HD Graphics, lacks EXT port on back, but appears to have a space for one). Has TMSS..

3rd Gen Model 1: Looks the same as 2nd Gen, but does NOT have that space on the back for an EXT port... Has TMSS.. (This model is also closely related to the Model 2 Genesis, in the fact that it has the smaller 68K CPU, and has black piano contacts for the CD attachment.. Also has a completely re-designed motherboard)

(all of the above models have different motherboards, and combinations of 68K CPUs/Clones
As i mentionned mine hasn't TMSS (which i called the minimal genesis bios) so it's the first version (european by the way). It does a the 3rd RS232 port also ;)

evildragon
Very interested
Posts: 326
Joined: Mon Mar 12, 2007 1:53 am
Contact:

Post by evildragon » Wed May 02, 2007 10:10 pm

RS232? I call it a DB-9 connector, cause i thought it communicates just the same way as a controller port...

ok.. that's the same one i personally use.. i wonder how the 1.5, 2, and 3rd versions would handle the code.. i think the 3rd version will be fine..

Shiru
Very interested
Posts: 786
Joined: Sat Apr 07, 2007 3:11 am
Location: Russia, Moscow
Contact:

Post by Shiru » Thu May 03, 2007 2:22 am

TmEE co.(TM) wrote:Anyway I tested your new code, when it halts, it says "Wait for Z80", maybe some acknowledge gets missed or something ?
Not figured yet. It also can halt with message 'wait for z80' because Z80 hangs by some reasons (possibly bug in player or maybe some hardware misunderstanding in part of busreq), and can't acknowledge new sound. I don't think that bug in acknowledge part, because it very simple code (M68K send parameters then set flag; Z80 check flag, grab parameters and reset flag if set). Worst thing is that problem not present in emulators.
Stef wrote:There is a strange bug on the MD1 which isn't on MD2 by the way
...
I took base M68K code (init VDP and draw message) from ASCII Text Demo from sega-devega.net, so it's not a my bug. I'll fix it in next test, when I get some idea about reason of problem with player.

TmEE co.(TM)
Very interested
Posts: 2440
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Thu May 03, 2007 5:31 am

That really sucks when you can't test your stuff on real hardware :(

I discovered that when Z80 is in action, it will affect the performance of 68K. I put my old z80 driver play sound, and then I let my performance counter run, and to my surprise, speed index was 200 points less. So I guess, z80 has un-wait-stated access to bank. It seems reasonable, since SMS probably doesn't have wait-states when it accesses cart. SMS in MD is almost identical in operation, except some VDP issues with certain games that try to utilize some video modes...
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

Shiru
Very interested
Posts: 786
Joined: Sat Apr 07, 2007 3:11 am
Location: Russia, Moscow
Contact:

Post by Shiru » Fri May 04, 2007 9:39 am

TmEE co.(TM) wrote:That really sucks when you can't test your stuff on real hardware :(
Yeah, it's kinda like doctor who made diagnosis by photo.
TmEE co.(TM) wrote:So I guess, z80 has un-wait-stated access to bank. It seems reasonable, since SMS probably doesn't have wait-states when it accesses cart.
In case with active M68K on bus, Z80 can't get access to bus immediately, even with high priority, because M68K can be on half of machine cycle at this time. For SMS mode, I assume that M68K is disabled by bus manager, so Z80 works without wait-states.



Here is second test (RS, MF). Now Z80 places some debug value in memory at misc parts of code, M68K take this value and shows at screen (one symbol above messages in bottom part of screen). So we can see if Z80 hangs by some reasons, and where it happens. Note that this versions may sounds with distortions, because busreq happens frequently. I also tried to make more complete VDP init, don't know if it will work on MD1.

If Z80 hangs, please make test 2-3 times to ensure that it hangs in same place.

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Fri May 04, 2007 5:19 pm

Shiru wrote:
TmEE co.(TM) wrote:That really sucks when you can't test your stuff on real hardware :(
Yeah, it's kinda like doctor who made diagnosis by photo.
TmEE co.(TM) wrote:So I guess, z80 has un-wait-stated access to bank. It seems reasonable, since SMS probably doesn't have wait-states when it accesses cart.
In case with active M68K on bus, Z80 can't get access to bus immediately, even with high priority, because M68K can be on half of machine cycle at this time. For SMS mode, I assume that M68K is disabled by bus manager, so Z80 works without wait-states.



Here is second test (RS, MF). Now Z80 places some debug value in memory at misc parts of code, M68K take this value and shows at screen (one symbol above messages in bottom part of screen). So we can see if Z80 hangs by some reasons, and where it happens. Note that this versions may sounds with distortions, because busreq happens frequently. I also tried to make more complete VDP init, don't know if it will work on MD1.

If Z80 hangs, please make test 2-3 times to ensure that it hangs in same place.
afaik the VDP init bug wasn't important ! i reported it because it was fun to see a difference between MD1 and MD2 ;)

TmEE co.(TM)
Very interested
Posts: 2440
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Sat May 05, 2007 2:05 pm

I tested the code, and as much as I tried, it wouldn't mute. Strange thing is, that there wasn't any changing character on screen, I looked at the code, and there wasn't anything wrong...
anyway, now it works as intended, and the sound wasn't crappier at all :wink:
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

Post Reply