Shop OBEX P1 Docs P2 Docs Learn Events
SNEcog - The sound of "Sega Master System" (Game Gear, SC-3000H, Tandy, Coleco etc ) — Parallax Forums

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

Ahle2Ahle2 Posts: 1,178
edited 2011-05-23 13:55 in Propeller 1
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
«1

Comments

  • potatoheadpotatohead Posts: 10,253
    edited 2011-05-21 01:55
    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.
  • Ahle2Ahle2 Posts: 1,178
    edited 2011-05-21 02:02
    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
  • potatoheadpotatohead Posts: 10,253
    edited 2011-05-21 02:27
    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.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2011-05-21 03:03
    SN76489. That brings back memories. First chip I ever bought. Saved up a month's pocket money. Ah, those lovely retro sound effects...
  • Ahle2Ahle2 Posts: 1,178
    edited 2011-05-21 03:03
    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
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2011-05-21 03:08
    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*.
  • Ahle2Ahle2 Posts: 1,178
    edited 2011-05-21 03:21
    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
  • Ahle2Ahle2 Posts: 1,178
    edited 2011-05-21 04:43
    Any name suggestion other than DCSGcog?
  • LeonLeon Posts: 7,620
    edited 2011-05-21 05:00
    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.
  • Ahle2Ahle2 Posts: 1,178
    edited 2011-05-21 05:09
    @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.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2011-05-21 05:57
    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.
  • BaggersBaggers Posts: 3,019
    edited 2011-05-21 06:05
    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: 1,178
    edited 2011-05-21 06:31
    @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
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2011-05-21 07:54
    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
  • BaggersBaggers Posts: 3,019
    edited 2011-05-21 08:48
    Ahle2, I wrote it for the game I did for the Master System and Game Gear, Ultimate Soccer.
  • Ahle2Ahle2 Posts: 1,178
    edited 2011-05-21 08:51
    @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.
  • BaggersBaggers Posts: 3,019
    edited 2011-05-21 08:51
  • potatoheadpotatohead Posts: 10,253
    edited 2011-05-21 08:54
    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.
  • potatoheadpotatohead Posts: 10,253
    edited 2011-05-21 08:59
    Smile... 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.
  • BaggersBaggers Posts: 3,019
    edited 2011-05-21 09:08
    YASCOAC :) Yet Another Sound Chip On A Cog.
  • potatoheadpotatohead Posts: 10,253
    edited 2011-05-21 09:09
    +1 on that one! Like it.
  • BaggersBaggers Posts: 3,019
    edited 2011-05-21 09:18
    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: 10,253
    edited 2011-05-21 09:27
    Seriously. That story will run a long time, I suspect.
  • Ahle2Ahle2 Posts: 1,178
    edited 2011-05-21 09:33
    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)
  • BaggersBaggers Posts: 3,019
    edited 2011-05-21 09:38
    haha excellent cheers ;)
  • Ahle2Ahle2 Posts: 1,178
    edited 2011-05-21 09:51
    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. :):(
  • kwinnkwinn Posts: 8,697
    edited 2011-05-21 13:40
    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.
  • Ahle2Ahle2 Posts: 1,178
    edited 2011-05-21 14:12
    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.
  • Cluso99Cluso99 Posts: 18,066
    edited 2011-05-21 18:19
    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. :)
  • potatoheadpotatohead Posts: 10,253
    edited 2011-05-21 18:37
    I would love to see AHLEcog.
Sign In or Register to comment.