THOMSON MO6 SOUND CARD

Placez ici vos trucs et astuces, étalez sans retenue votre savoir-faire et votre science qui va nous permettre de redonner une apparence neuve et fonctionnelle à nos bouzes.

Modérateurs : Papy.G, fneck, Carl

Bentoc
Messages : 178
Inscription : 14 sept. 2019 13:35
Localisation : Var - France

Re: THOMSON MO6 SOUND CARD

Message par Bentoc »

yes, when your program reads the data, send each byte to the sound chip until you have :

- value $38 : no more data to send for this frame (1/50s), next frame : send the remaining data
- value $39 : no more data to send for this frame (1/50s), next frame : do nothing, next frame+1 : send the remaining data
- value $3A : no more data to send for this frame (1/50s), next frame and next frame+1 : do nothing, next frame+2 : send the remaining data
... this is valid up to $3f

if you have : $3f $3f $39
it means doing nothing during the next 15 frames
Avatar de l’utilisateur
6502man
Messages : 12286
Inscription : 12 avr. 2007 22:46
Localisation : VAR
Contact :

Re: THOMSON MO6 SOUND CARD

Message par 6502man »

Phil.

www.6502man.com

To bit or not to bit.
1 or 0.
dinoprodest
Messages : 312
Inscription : 01 févr. 2020 20:31
Localisation : Rome - Italy

Re: THOMSON MO6 SOUND CARD

Message par dinoprodest »

I think there sonething wrong in my assembly code..
The files sound in this way:
https://filebin.net/qz3wmud9gt20ps40
dinoprodest
Messages : 312
Inscription : 01 févr. 2020 20:31
Localisation : Rome - Italy

Re: THOMSON MO6 SOUND CARD

Message par dinoprodest »

Here is my code:

Code : Tout sélectionner

 ldy #$602a          ; start data address
 ldx base,pcr        ; 1/50 sec delay
loop                       
 lda ,y+                   ; read data
 beq exit                ; if 0 exit
 tfr a,b                    
 andb #$c0           ; check if control byte
 beq delay             ; jump to delay subrout
 sta $a7c4            ; write to sn76489
ret
 bra loop               ; main loop
exit       
 rts                         ; exit 
delay
 anda #$07           ; get n frames
 inca                       ; +1
loop2                     ; delay 1/50 sec loop
 leax -1,x
 bne loop2
 ldx base,pcr
 deca                      ; decrement n frames
 bne loop2
 bra ret
base fcw $0b29

__sam__
Messages : 7924
Inscription : 18 sept. 2010 12:08
Localisation : Brest et parfois les Flandres

Re: THOMSON MO6 SOUND CARD

Message par __sam__ »

You can optimize

Code : Tout sélectionner

  tfr a,b                    
  andb #$c0
  beq ...  
(8 cycles) with

Code : Tout sélectionner

  bita #$C0
  beq ...
(2 cycles)
Samuel.
A500 Vampire V2+ ^8^, A1200 (030@50mhz/fpu/64mb/cf 8go),
A500 GVP530(MMU/FPU) h.s., R-Pi, TO9, TO8D, TO8.Démos
Bentoc
Messages : 178
Inscription : 14 sept. 2019 13:35
Localisation : Var - France

Re: THOMSON MO6 SOUND CARD

Message par Bentoc »

Noise channel is recognizable.
The problem seems to be from the 3 square channels

Track is Arabian Nights
https://www.smspower.org/Music/Aladdin-SMS

Can you share the dcmoto state (.mrx file) ?

For the timing :
4+1 leax -1,x
3 bne loop2
gives 8 cycles x 2857 ($0b29) = 22856
it's a bit high you should have around 20000 for 1/50 with 6809
If you don't use VBL for sync, you can play at 60hz (original master system freq).
So use $0823 (16666/8) for base.
It will not solve the sound problem, but will play at the right speed.

First thing I would check :
look your data in the dcmoto debugger and see if bytes are of the same values as the .psg files.

On my side I will try to check the data on my file to see if there is a problem.
Dernière modification par Bentoc le 23 févr. 2021 07:43, modifié 1 fois.
dinoprodest
Messages : 312
Inscription : 01 févr. 2020 20:31
Localisation : Rome - Italy

Re: THOMSON MO6 SOUND CARD

Message par dinoprodest »

Thanks at all.
This evening i will share the mrx and i want to try to code in basic, checking sound byte by byte.
Bentoc
Messages : 178
Inscription : 14 sept. 2019 13:35
Localisation : Var - France

Re: THOMSON MO6 SOUND CARD

Message par Bentoc »

I checked the first frame data of the file, it gives :

Code : Tout sélectionner

$86 : 10000110 : latch - Ch 0 - Tone - 0110
$4d : 01001101 : data - 001101 - PLAY 522,63 hz (C5) (3579000 / 32 * 214)
$9c : 10011100 : latch - Ch 0 - Vol - 1100 (12/15)
$aa : 10101010 : latch - Ch 1 - Tone - 1010
$63 : 01100011 : data - 100011 - PLAY 196,22 hz (G3) (3579000 / 32 * 570)
$bb : 10111011 : latch - Ch 1 - Vol - 1011 (11/15)
$cd : 11001101 : latch - Ch 2 - Tone - 1101
$57 : 01010111 : data - 010111 - PLAY 293,55 hz (D4) (3579000 / 32 * 381)
$db : 11011011 : latch - Ch 2 - Vol - 1011 (11/15)
$e6 : 11100110 : latch - noise - Tone - 0110
$ff : 11111111 : latch - noise - Vol - 1111 (15/15)
$38 : end of frame
dinoprodest
Messages : 312
Inscription : 01 févr. 2020 20:31
Localisation : Rome - Italy

Re: THOMSON MO6 SOUND CARD

Message par dinoprodest »

Good news. :roll:
Now it playng well.
I had a bug on the sn76489 emulator so when the data bit was set the frequency was turned low.
Now i have fixed but i have to test to real machine.
I think the result will be better.

https://filebin.net/pr8p1jc6io45hcjj
dinoprodest
Messages : 312
Inscription : 01 févr. 2020 20:31
Localisation : Rome - Italy

Re: THOMSON MO6 SOUND CARD

Message par dinoprodest »

Bentoc, do you have another sounds to suggest me?
Bentoc
Messages : 178
Inscription : 14 sept. 2019 13:35
Localisation : Var - France

Re: THOMSON MO6 SOUND CARD

Message par Bentoc »

I so happy it works !

Very nice job :D

You can download the VGM for Sonic Green Hill Zone
https://www.smspower.org/Music/SonicTheHedgehog-SMS

You have to convert the file to PSG with vgm2psg.exe :
https://github.com/sverx/PSGlib/tree/master/tools

This is just what I did with Aladdin music intro.

You will have to implement the loop and maybe the (small) compression algorithm that is described in the file format I send yesterday.

I really need to build this card for my TO8, but I don't know which address to use, if someone can help me ... Sam ? Daniel ? Another nice guy ? ... ;-)
I plan to use the card in conjunction with SDDRIVE.

Thanks dinoprodest for your work !
dinoprodest
Messages : 312
Inscription : 01 févr. 2020 20:31
Localisation : Rome - Italy

Re: THOMSON MO6 SOUND CARD

Message par dinoprodest »

Thanks you very much Bentoc, without your help i was in stall. For your board i will very happy to help you.
Consider that the test is emulated. As soon as possible i will test on real machine.
dinoprodest
Messages : 312
Inscription : 01 févr. 2020 20:31
Localisation : Rome - Italy

Re: THOMSON MO6 SOUND CARD

Message par dinoprodest »

Wonderful.
I can't bellieve.

https://filebin.net/h8v3735xlm729j9b
dinoprodest
Messages : 312
Inscription : 01 févr. 2020 20:31
Localisation : Rome - Italy

Re: THOMSON MO6 SOUND CARD

Message par dinoprodest »

Hello, at link below, my test on real machine, playng psg file.


https://www.facebook.com/groups/thomson ... 3/?app=fbl
Bentoc
Messages : 178
Inscription : 14 sept. 2019 13:35
Localisation : Var - France

Re: THOMSON MO6 SOUND CARD

Message par Bentoc »

Wonderboy ! nice choice :D
Répondre