Hello again,
I was studying the NOISE generator features of MSX (YM2149) and Master System (SN76489).
On Master System, you can:
1) Set NOISE volume, using %1 11 1 xxxx (where xxxx is the volume)
2) Set NOISE mode (Periodic or White) using %1 11 0 z x yy (where x is the mode and z is unused)
3) Set NOISE freq using %1 11 0 z xyy (where y is the data)
And, on MSX, you can associate NOISE generator on any of the 3 available channels. Let's say that channel B is on noise (register 7 is 10 010 000).
1) Using register 9 you can set the volume with zzz n xxxx (n = mode, and xxxx = volume)
2) Using register 6 you can set Noise Frequency with zzz xxxxx (z = unused and xxxxx = frequency)
So, HOW! can I convert a noise generated in Master System to MSX?
Like this? (A CONTAINS WHAT SMS IS SENDING TO IT'S (ONLY) SOUND PORT) *PS* RUIDO = NOISE IN PORTUGUESE
SMS_SOUND_ROUTINE:
PUSH AF
PUSH BC
LD B,A
AND %01100000 ; CHANNEL 11 IS SMS NOISE CHANNEL
CP %01100000 ;
JR Z,SOM_RUIDO ;
JR TOCA_SOM_FIM ; ONLY INTERESTED IN NOISE RIGHT NOW
SOM_RUIDO:
LD A,B ;
AND %00010000 ; ON THAT BIT, 1 = VOLUME AND 0 = FREQUENCY
JR Z,SOM_RUIDO_FREQ
SOM_RUIDO_VOLUME:
LD A,B
AND %00001111 ;
LD C,A ;
LD A,9
OUT ($A0),A ;
LD A,C ;
OUT ($A1),A ; WELL, VOLUME IS SET AT REGISTER 9 (MSX), BUT WHAT ABOUT MODE? LET'S LEAVE IT "1"
JR TOCA_SOM_FIM
SOM_RUIDO_FREQ:
LD A,B
AND $00000011
RLCA
RLCA
RLCA ; I JUST IGNORED THE WHITE OR PERIODIC NOISE FROM SMS. NOW TO TRANSFORM 2 BITS IN 5...
DEC A ; 00 STILL THE SAME , 01 TURNS 111, 10 TURNS 1111 E 11 TURNS 11111, IS THAT CORRECT?
LD C,A
LD A,6 ; REGISTRADOR 6 = NOISE
OUT ($A0),A ;
LD A,C
OUT ($A1),A ;
TOCA_SOM_FIM:
POP BC
POP AF
RET
BTW, IS NOT WORKINGS. Anyone can help me with that?
|
I didn't check the source in to much detail, but I think there is at least one problem; the volume on the SN76489 is inverted compared to the YM2149. Maximum volume on the YM2149 means writing %1111 to it, while maximum volume on the SN76489 means writing %0000 to it.
The noise channel of that SN76489 got quite an interesting mode (11), which is probably hard to reproduce on the MSX. Do you have any ideas how to approach that, or do you want to ignore that mode?
|
Well, I tried that with no success too...
I was looking at the SN76489 datasheet and they use the expression attenuation:
a0 a1 a2 a3
0 0 0 1 2db
0 0 1 0 4db
0 1 0 0 8db
1 0 0 0 16db
1 1 1 1 OFF
it's somehow confusing to me. Attenuate the sound by 16db or output is at 16db?
about the mode, that's probably the "Noise Feedback Control", which is only 1 bit, at position 2: 0 = Periodic and 1 = White Noise.
If I at least knew some "sound expressions", like "Periodic Sound" translates literally (sound that's playing continuously, but what sound? The White Noise? And if is that, how long the other mode (white noise) keeps playing?
About my ideas, first I still have to learn more about the chips real behavior. I'll probably send the datasheets to garbage and I'll try to check some of the MSX and SMS emulators source code... That will help (after long study) to find out the chip's desired behavior.
Maybe I'll can try to use the envelope generators on the MSX to reproduce whatever that "periodic" behavior is???
|