Forums

Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew

View topic - Noise generator of the SN76489

Reply to topic
Author Message
  • Joined: 10 Feb 2020
  • Posts: 3
Reply with quote
Noise generator of the SN76489
Post Posted: Tue May 05, 2020 3:28 pm
Hello,

I'm writing a sms emulator for "personnal education" purpose. The VDP is about 60-70% done (with scanline interrupt) and I am trying to produce sound.
I first did the 3 square voices. With 44100Hz sampling, the square are not perfect squares but it sound correctly. While going from high level to low level of the output an intermediary value is calculated corresponding to an average value.

When I read docs about the noise generator (especially in Development/SN76489), it does not seem clear for me.

When you choose the frequency divider (2bits : 0x10/0x20/0x40/Tone2) you produce a square signal that is only the shift trigger of the shift register isn't it ? This value is not "injected" in the register ? How is it possible to initialise the internal value of the register that may be stuck to 0 ?

I think I've got the main idea of the external "LFSR" that brings xor from 2 tapped bits to the input of the shift register while shifting. However, it is mentionned a "internal" xor network in the shift register. In the SN76489, excepted what it is mentionned just above, the bits are not simply shifted in the register ?

Thanks !
  View user's profile Send private message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 13231
  • Location: London
Reply with quote
Post Posted: Tue May 05, 2020 6:43 pm
Writes to the noise control register reset the LFSR to 0..001. The frequency controls drive the shift rate, each square wave in triggers one bit shift.
  View user's profile Send private message Visit poster's website
  • Joined: 10 Feb 2020
  • Posts: 3
Reply with quote
Post Posted: Thu May 07, 2020 10:43 am
Thank you for this reply.

The initialisation at 0x01 makes it much more clear to me.

Concerning an additional "internal xor network" could you confirm that it exists only one xor operation between the two tapped bits ? (0 and 3 to the sms)
  View user's profile Send private message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 13231
  • Location: London
Reply with quote
Post Posted: Thu May 07, 2020 12:48 pm
Any LFSR can be implemented as an internal or external XOR, which means either XORing bits from the register to produce the new bit to go in (external), or putting XORs between some of the bits instead of just shifting (internal). The former is usually easier to do in code as you have the bits in one place, but the latter is probably simpler in hardware.
  View user's profile Send private message Visit poster's website
Reply to topic



Back to the top of this page

Back to SMS Power!