SNEcog - The sound of "Sega Master System" (Game Gear, SC-3000H, Tandy, Coleco etc )

Ahle2Ahle2 Posts: 906
edited May 2011 in Propeller 1 Vote Up0Vote Down
SNEcog is an emulation of the SN76489 (and variants) running in a single cog.

It was used in:
Acorn BBC
IBM PCjr
Colecovision
Sord M5
Tandy home computer
TI-99/4A
Memotech MTX-500
VTech Creativision
Sega SG-1000
Sega SC-3000
Sega Master System
Sega Game Gear
Sega Genesis / Mega Drive (it used the SN76489 for SMS compability and some FX in games)


Here is the original first post
My new SN76489 emulator is finished and ready to be uploaded to the OBEX.
I'm having a problem to come up with a good name for it though; And I would like people on this forum to help me out.
For now, the name is "SNcog", but that just sounds wrong. :)

What should I call it?

Here is an example playback of a "dumped" tune from Sonic 1 on the Sega Master System.
SN76489_DumpPlayer - Archive [Date 2011.05.21 Time 10.42].zip

Copy the file named "Sonic1.vgm" to a sd card and run "SN76489_DumpPlayer.spin" on your Propeller!

Btw, If you want to try other ".vgm files", you will need to unpack them using winzip/7zip!!

/ Ahle2
SIDcog - The sound of the Commodore 64 in a single cog: Thread, OBEX, SIDcogMedlay.mp3
AYcog - An emulation of the AY3-8910 / YM2149F PSG: Thread, OBEX
SNEcog - An emulation of the SN76489 PSG(and variants): Thread, OBEX
Propeller chiptune player: Thread
«1

Comments

  • 34 Comments sorted by Date Added Votes
  • potatoheadpotatohead Posts: 9,015
    edited May 2011 Vote Up0Vote Down
    Excellent!!

    Was this chip in the Tandy PC computers?

    Well, TI did brand it "DCSG", maybe DCSGcog?

    I was just listening to some SEGA chip tunes today. This chip has a distinctive sound.
    Do not taunt Happy Fun Ball! @opengeekorg ---> Be Excellent To One Another SKYPE = acuity_doug
    Parallax colors simplified: http://forums.parallax.com/showthread.php?123709-Commented-Graphics_Demo.spin<br>
  • Ahle2Ahle2 Posts: 906
    edited May 2011 Vote Up0Vote Down
    Yes, it was used in the tandy computer; The only difference is that the noise generator uses different bits for the "xor feedback".
    There are three different variations for the "xor feedback" and my emulator handles all variations with constants at the top.

    I don't know if you could call a simple square wave chip distinctive. It basically sounds as most chips from that era did; with two BIG exceptions, NES and C64.

    /Ahle2
    SIDcog - The sound of the Commodore 64 in a single cog: Thread, OBEX, SIDcogMedlay.mp3
    AYcog - An emulation of the AY3-8910 / YM2149F PSG: Thread, OBEX
    SNEcog - An emulation of the SN76489 PSG(and variants): Thread, OBEX
    Propeller chiptune player: Thread
  • potatoheadpotatohead Posts: 9,015
    edited May 2011 Vote Up0Vote Down
    Perhaps that's just me. I am most familiar with the SID, POKEY, TIA, the NES, and to a lesser degree AY, and can tell them apart. Maybe it's just the productions I've heard on this chip that I find distinctive. Either way, thanks for a great addition to Propeller sound.
    Do not taunt Happy Fun Ball! @opengeekorg ---> Be Excellent To One Another SKYPE = acuity_doug
    Parallax colors simplified: http://forums.parallax.com/showthread.php?123709-Commented-Graphics_Demo.spin<br>
  • Dr_AculaDr_Acula Posts: 5,482
    edited May 2011 Vote Up0Vote Down
    SN76489. That brings back memories. First chip I ever bought. Saved up a month's pocket money. Ah, those lovely retro sound effects...
    Answers: 1) A quadcopter. 2) Very high. 3) The internet. 4) A lot. 5) No.
  • Ahle2Ahle2 Posts: 906
    edited May 2011 Vote Up0Vote Down
    To not be able to tell A SID apart from any of those mentioned above is kind of like saying you can't see the difference between a "T-Ford" and a "Toyota Camry".

    The SID is FAR more advanced than the other chips.
    An indication of this is the fact that I had to optimize SIDcog for weeks before I could get it to run at a decent sample rate. (31kHz)
    The SN76489 emulator was made in a day and runs at 175kHz

    Compare this (Sega Master System) with this(C64). :)
    (Compare 0:30 onwards on the SMS with 0:20 onwards on the C64)

    I could forgive you for not be able to tell the sound from the NES apart from other chips though. :)
    It was not far ahead of the SN or the AY.

    /Ahle2
    SIDcog - The sound of the Commodore 64 in a single cog: Thread, OBEX, SIDcogMedlay.mp3
    AYcog - An emulation of the AY3-8910 / YM2149F PSG: Thread, OBEX
    SNEcog - An emulation of the SN76489 PSG(and variants): Thread, OBEX
    Propeller chiptune player: Thread
  • Dr_AculaDr_Acula Posts: 5,482
    edited May 2011 Vote Up0Vote Down
    One of the cool things the SN76489 could do was a falling bomb sound effect and then an explosion. You 'programmed' it with a few capacitors and resistors. It was pretty cool that you could get this working from a 40 pin chip. Those were the days, when you would get excited about all the cool things a 40 pin chip could do. Can't imagine getting excited about a 40 pin chip these days... *grin*.
    Answers: 1) A quadcopter. 2) Very high. 3) The internet. 4) A lot. 5) No.
  • Ahle2Ahle2 Posts: 906
    edited May 2011 Vote Up0Vote Down
    You are definitely thinking about another chip (maybe SN76477)!!
    The SN76489 has got 16 pins and is programmed using a single memory-mapped port and an internal latch!

    @potatohead
    Maybe you are thinking about the wrong chip as well?

    /Ahle2
    SIDcog - The sound of the Commodore 64 in a single cog: Thread, OBEX, SIDcogMedlay.mp3
    AYcog - An emulation of the AY3-8910 / YM2149F PSG: Thread, OBEX
    SNEcog - An emulation of the SN76489 PSG(and variants): Thread, OBEX
    Propeller chiptune player: Thread
  • Ahle2Ahle2 Posts: 906
    edited May 2011 Vote Up0Vote Down
    Any name suggestion other than DCSGcog?
    SIDcog - The sound of the Commodore 64 in a single cog: Thread, OBEX, SIDcogMedlay.mp3
    AYcog - An emulation of the AY3-8910 / YM2149F PSG: Thread, OBEX
    SNEcog - An emulation of the SN76489 PSG(and variants): Thread, OBEX
    Propeller chiptune player: Thread
  • LeonLeon Posts: 7,619
    edited May 2011 Vote Up0Vote Down
    The doc is probably thinking of the GI AY-3-8910, that had 40 pins. I interfaced one to my TRS80 Model 1, and annoyed a friend of mine by playing the explosion effect to a friend of mine over the phone, when he got back late from a hard day spent lecturing to his students.
    Leon Heller
    G1HSM
  • Ahle2Ahle2 Posts: 906
    edited May 2011 Vote Up0Vote Down
    @Leon
    I think you mean AY3-8910 and not AY3890.
    I've already done an emulation of that chip for the prop (AYcog); And I'm certain that he didn't think about that one, because it is NOT programmed with resistors and capacitators and is similar to the SN764890 sound wise.
    SIDcog - The sound of the Commodore 64 in a single cog: Thread, OBEX, SIDcogMedlay.mp3
    AYcog - An emulation of the AY3-8910 / YM2149F PSG: Thread, OBEX
    SNEcog - An emulation of the SN76489 PSG(and variants): Thread, OBEX
    Propeller chiptune player: Thread
  • Dr_AculaDr_Acula Posts: 5,482
    edited May 2011 Vote Up0Vote Down
    Ah yes, I was thinking of a different chip. But similar sounds.

    DCSGcog sounds good.

    I wonder if this could be turned into a 'cogject' so it can be loaded and reloaded, and also so it could be used by C and other languages?

    Technical question
      resetRegisters
      writeRegister_p := @shadowRegisters
      'writeRegister_p := @SNregisters
      
      arg1 := $18000000 | left
      arg2 := $18000000 | right
      res1 := ((1<<right) | (1<<left))&!1
      sampleRate := clkfreq/SAMPLE_RATE
      cog := cognew(@SNEMU, @SNregisters) + 1
    

    Cogjects can only pass one variable to the cog, and all variables like "samplerate" need to be in an array rather than declared in the spin part. It looks possible to do as it looks like only four variables there - arg1, arg2, res1 and samplerate.
    Answers: 1) A quadcopter. 2) Very high. 3) The internet. 4) A lot. 5) No.
  • BaggersBaggers Posts: 2,965
    edited May 2011 Vote Up0Vote Down
    SNSCOG or COGSN or COGSND

    Great little chip :)
    I wrote a music&SFX driver for it years back for the Master System and Game Gear :D

    I may still have the source lying around somewhere! :D
  • Ahle2Ahle2 Posts: 906
    edited May 2011 Vote Up0Vote Down
    @Baggers
    Very interesting, what games used your driver?

    @Dr_Acula
    I havn't played around with cogject's, so I'm not sure how to modify it into one.

    What about SNEEZEcog, SNORTcog or ANEMULATIONOFTHESOUNDCHIPUSEDINTHESEGAMSTERSYSTEMAMONGMANYOTHERcog ?
    :) :P
    SIDcog - The sound of the Commodore 64 in a single cog: Thread, OBEX, SIDcogMedlay.mp3
    AYcog - An emulation of the AY3-8910 / YM2149F PSG: Thread, OBEX
    SNEcog - An emulation of the SN76489 PSG(and variants): Thread, OBEX
    Propeller chiptune player: Thread
  • Dr_AculaDr_Acula Posts: 5,482
    edited May 2011 Vote Up0Vote Down
    Cogjects are just cog code that is compiled separately from the spin code. So to convert to a cogject, first remove all the spin code and see if it will compile. Then go through the code looking for variables that are shared spin and cog variables. These need to be removed and passed in one single array at the beginning of the code.

    Some of the early obex code was written this way, eg the keyboard and mouse drivers.

    The code is very close
    SNEMU         mov      SN_Address, par                      ' Init
                  mov      dira, res1
                  mov      ctra, arg1
                  mov      ctrb, arg2
    

    is passing a number of parameters via a list at 'par' Just need to change it so it passes all the parameters.

    It might only be just 'samplerate'. Maybe 'writeregister_p' as well
    Answers: 1) A quadcopter. 2) Very high. 3) The internet. 4) A lot. 5) No.
  • BaggersBaggers Posts: 2,965
    edited May 2011 Vote Up0Vote Down
    Ahle2, I wrote it for the game I did for the Master System and Game Gear, Ultimate Soccer.
  • Ahle2Ahle2 Posts: 906
    edited May 2011 Vote Up0Vote Down
    @Dr_Acula
    I will have a look at making my objects into cogjects.

    @potatohead
    I thought you said that you couldn't tell the chips apart, but after rereading your reply I saw that you actually said the opposite.

    To tell the AY 3-8910 and the SN76489 apart isn't easy for an untrained ear though. The difference in noise generation is the easiest way to distinguish which is which.
    In some rare cases when the AY 3-8910 uses the envelope generator as a "wave shaper" or in some "ultra rare" cases when the SN76489 uses periodic noise (which actually is a square wave with a duty of 1/16) it's easy to tell them apart though.
    But most tunes on both chips uses pure square waves and "white" noise and they tend to sound the same.
    SIDcog - The sound of the Commodore 64 in a single cog: Thread, OBEX, SIDcogMedlay.mp3
    AYcog - An emulation of the AY3-8910 / YM2149F PSG: Thread, OBEX
    SNEcog - An emulation of the SN76489 PSG(and variants): Thread, OBEX
    Propeller chiptune player: Thread
  • BaggersBaggers Posts: 2,965
    edited May 2011 Vote Up0Vote Down
  • potatoheadpotatohead Posts: 9,015
    edited May 2011 Vote Up0Vote Down
    Alhe2: I think you misread my post. I can tell them apart. You had remarked the chip was not distinctive, and I then commented that maybe it was me, hearing something that wasn't really there, or that I was biased by the productions I've heard. You've obviously got experience way beyond mine.

    SMSANDFRIENDSCOG?

    Real pickle on the name. Then again, "SNCOG" isn't so bad, after thinking about it. Could have been SNOG! (and I like that one actually) Good luck with that.
    Do not taunt Happy Fun Ball! @opengeekorg ---> Be Excellent To One Another SKYPE = acuity_doug
    Parallax colors simplified: http://forums.parallax.com/showthread.php?123709-Commented-Graphics_Demo.spin<br>
  • potatoheadpotatohead Posts: 9,015
    edited May 2011 Vote Up0Vote Down
    Crap... Yes! We are on the same page now. The noise generator, and the distribution of pitches are the primary things I hear on this chip. Some of the "ringing" from concurrent notes stands out too. I have heard this chip the least, of all the ones mentioned. The little things are what make music and SFX from that era a lot of fun for me. Mere artifacts of the tech, often turned out to be game changing, where today, they would be undesirable artifacts. Fun stuff, and video systems of the time, often were exactly the same way.

    When some artifact of the design can impact a industry, often providing some differentiators, or basis for a new production, there is some element of discovery there, continuing to this day, as people hack on the old chips, looking for "extra stuff", :"in the can". I've followed the retro scene for years because of that. Seems the story almost never ends, with somebody somewhere, convincing old hardware to do new things even today.
    Do not taunt Happy Fun Ball! @opengeekorg ---> Be Excellent To One Another SKYPE = acuity_doug
    Parallax colors simplified: http://forums.parallax.com/showthread.php?123709-Commented-Graphics_Demo.spin<br>
  • BaggersBaggers Posts: 2,965
    edited May 2011 Vote Up0Vote Down
    YASCOAC :) Yet Another Sound Chip On A Cog.
  • potatoheadpotatohead Posts: 9,015
    edited May 2011 Vote Up0Vote Down
    +1 on that one! Like it.
    Do not taunt Happy Fun Ball! @opengeekorg ---> Be Excellent To One Another SKYPE = acuity_doug
    Parallax colors simplified: http://forums.parallax.com/showthread.php?123709-Commented-Graphics_Demo.spin<br>
  • BaggersBaggers Posts: 2,965
    edited May 2011 Vote Up0Vote Down
    potatohead wrote: »
    somebody somewhere, convincing old hardware to do new things even today.

    That's what I love about the Prop, it's got all the joy of the old hardware, but the added bonus it's new fast, and 32bit, and easy to program, yet we're always finding new ways that this little gem amazes us all.
  • potatoheadpotatohead Posts: 9,015
    edited May 2011 Vote Up0Vote Down
    Seriously. That story will run a long time, I suspect.
    Do not taunt Happy Fun Ball! @opengeekorg ---> Be Excellent To One Another SKYPE = acuity_doug
    Parallax colors simplified: http://forums.parallax.com/showthread.php?123709-Commented-Graphics_Demo.spin<br>
  • Ahle2Ahle2 Posts: 906
    edited May 2011 Vote Up0Vote Down
    Just for you Baggers!! :)
    Try this on the dump player!!

    For some odd reason it plays to slow on my dump player.
    Change the hardcoded "80_000_000" values to "70_000_000" and it plays at the same rate as in your clip.

    (I dumped it just now when playing your game on the MEKA SMS emulator)
    SIDcog - The sound of the Commodore 64 in a single cog: Thread, OBEX, SIDcogMedlay.mp3
    AYcog - An emulation of the AY3-8910 / YM2149F PSG: Thread, OBEX
    SNEcog - An emulation of the SN76489 PSG(and variants): Thread, OBEX
    Propeller chiptune player: Thread
  • BaggersBaggers Posts: 2,965
    edited May 2011 Vote Up0Vote Down
    haha excellent cheers ;)
  • Ahle2Ahle2 Posts: 906
    edited May 2011 Vote Up0Vote Down
    I really like "YASCOAC", but it doesn't say anything about the chip it emulates. I may go with "SNemu", but I would like to keep cog in there somehow, soo maybe not. :) :(
    SIDcog - The sound of the Commodore 64 in a single cog: Thread, OBEX, SIDcogMedlay.mp3
    AYcog - An emulation of the AY3-8910 / YM2149F PSG: Thread, OBEX
    SNEcog - An emulation of the SN76489 PSG(and variants): Thread, OBEX
    Propeller chiptune player: Thread
  • kwinnkwinn Posts: 7,712
    edited May 2011 Vote Up0Vote Down
    How about YASCOG-SN76489 or only part of the chip number. That way you can use the same naming convention for other sound chip emulators. It would certainly make searching easier.
    In science there is no authority. There is only experiment.
    Life is unpredictable. Eat dessert first.
  • Ahle2Ahle2 Posts: 906
    edited May 2011 Vote Up0Vote Down
    How about SNEcog for SN-Emulator-cog ?
    I will not do emulations of the other SN PSGs, so I don't need the 76489 in the name anyway.
    Actually three of them are almost identical and are emulated in SNEcog(yes I said it) and the last "SN76477" is mostly analog and hard to emulate; It was only used in a few arcade games like "space invader" anyway.
    SIDcog - The sound of the Commodore 64 in a single cog: Thread, OBEX, SIDcogMedlay.mp3
    AYcog - An emulation of the AY3-8910 / YM2149F PSG: Thread, OBEX
    SNEcog - An emulation of the SN76489 PSG(and variants): Thread, OBEX
    Propeller chiptune player: Thread
  • Cluso99Cluso99 Posts: 13,192
    edited May 2011 Vote Up0Vote Down
    Nice work Ahle2. You are a master with the sound generators!

    Next, You need to write your own sound generator to combine all the good bits from all the generators. :)
    My Prop boards: P8XBlade2, RamBlade, CpuBlade, TriBlade
    Prop OS (also see Sphinx, PropDos, PropCmd, Spinix)
    Website: www.clusos.com
    Prop Tools (Index) , Emulators (Index) , ZiCog (Z80)
  • potatoheadpotatohead Posts: 9,015
    edited May 2011 Vote Up0Vote Down
    I would love to see AHLEcog.
    Do not taunt Happy Fun Ball! @opengeekorg ---> Be Excellent To One Another SKYPE = acuity_doug
    Parallax colors simplified: http://forums.parallax.com/showthread.php?123709-Commented-Graphics_Demo.spin<br>
Sign In or Register to comment.