well, after al the advices and help from you guys i made a simple thing to hear sounds. I think its a good starting point.
i check when the channel timer register is written, and take the 11 bit wavelenght and convert it to herz with the following formula:
hz = 1789772.5 / DIVIDER / WaveLenght
Where DIVIDER is 16 for square and 32 for Triangle (i guess), then thanks to Charles Petzold "FillBuffer" function expample form his "Programming Windows" Book, i convert "hz" to PCM format.
The result? sound.. but very poor. I know disch told me about a way of taking all the outputs to sample correctly: as APU does.
But i didnt understand you well disch, if you could explain it to me very "step-by-step" i will preciate it.
i check when the channel timer register is written, and take the 11 bit wavelenght and convert it to herz with the following formula:
hz = 1789772.5 / DIVIDER / WaveLenght
Where DIVIDER is 16 for square and 32 for Triangle (i guess), then thanks to Charles Petzold "FillBuffer" function expample form his "Programming Windows" Book, i convert "hz" to PCM format.
The result? sound.. but very poor. I know disch told me about a way of taking all the outputs to sample correctly: as APU does.
But i didnt understand you well disch, if you could explain it to me very "step-by-step" i will preciate it.