Jump to content
IGNORED

which i/o ports are used for sound?


Recommended Posts

On msx, i use a code like this for having some sound:

out $a0,7  ';- register 7: channel switch (OpenMSX warning: bit 6 should be 0)
out $a1,%10111110  ';- value
out $a0,0  ';- register 0: channel a frequency (16 bit, unsure if it is more or less significant byte)
out $a1,93 ';- value
out $a0,1  ';- register 1: channel a frequency (16 bit, unsure if it is more or less significant byte)
out $a1,4  ';- value
out $a0,8  ';- register 8: volume - channel a
out $a1,7  ';- value

There, the port $A0 is used for the psg register choosing, and $A1 for setting values.

 

The confusion is when i try to find which ports are used on Colecovision, which http://www.colecoboxart.com/faq/FAQ05.htm says it is from $C0 to $DF, and http://adamcon.org/pipermail/coladam/2012q3/002088.html from $E0 to $FF - which one is correct, and which are for setting register, and which are for outputting values?

Edited by nitrofurano
Link to comment
Share on other sites

I just use FF.

 

But the MSX chip is not compatible with the Colecovision one. So you cant just change the port number you need to do som conversion.

 

thanks

 

btw, the documentation at http://www.smspower.org/Development/SN76489 looks quite confusing - how simple is to convert code that use ay-3-8910 to sn76489 and back? and where from can we find documentation comparing these both side by side?

Edited by nitrofurano
Link to comment
Share on other sites

i'm trying this now ( copied from http://www.smspower.org/Development/SN76489 ) :

 

 

  ld a,%10001110
  out ($FF),a
  ld a,%00001111
  out ($FF),a
 
  ld a,%11011111
  out ($FF),a
 
  ld a,%11011111
  out ($FF),a
  ld a,%00000000
  out ($FF),a
 
  ld a,%11100101
  out ($FF),a
 
  ld a,%11100101
  out ($FF),a
  ld a,%00000100
  out ($FF),a

 

and getting no sound at all... :S - where from should we try examples that works?

Link to comment
Share on other sites

another thing i'm seeing is that you can play on ay-3-8910 2 octaves lower than sn76489 lower frequency limit? (A0 on ay-3-8910, and A2 at sn76489 - due on 12 bits for ay-3-8910 and 10 bits for sn76489, for 111861/hz value ) - from http://www.seventhstring.com/resources/notefrequencies.html i'm seeing that we can’t play most of the bass/cello notes scale... :o

Edited by nitrofurano
Link to comment
Share on other sites

i'm trying this now ( copied from http://www.smspower.org/Development/SN76489 ) :

 

and getting no sound at all... :S - where from should we try examples that works?

This code will work. Read more carefully the documentation ;)

 

ld a,$8a    ; Select channel 0, update lower 4 bits (contained in bits 3-0)
out ($ff),a
ld a,$0a    ; Continue updating channel 0, update higher 6 bits (contained in bits 5-0)
out ($ff),a
ld a,$9f    ; Select volume 0 (bit 7= 1=select), lower 4 bits are volume
out ($ff),a
  • Like 1
Link to comment
Share on other sites

This code will work. Read more carefully the documentation ;)

 

ld a,$8a    ; Select channel 0, update lower 4 bits (contained in bits 3-0)
out ($ff),a
ld a,$0a    ; Continue updating channel 0, update higher 6 bits (contained in bits 5-0)
out ($ff),a
ld a,$9f    ; Select volume 0 (bit 7= 1=select), lower 4 bits are volume
out ($ff),a

 

thanks! recently my doubt was that i didn’t know if %1xxxxxxx and %0xxxxxxx values should have some special sequence

Link to comment
Share on other sites

 

thanks! recently my doubt was that i didnt know if %1xxxxxxx and %0xxxxxxx values should have some special sequence

Yep, technically a %00xxxxxx just after a %1rr0xxxx for register selection. (0/1/2)

 

Only for frequency registers.

 

And there are the four volume registers %1rr1xxxx and the control register %1110xxxx for noise channel.

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...