I get to Silva and Luis Guzman Gonzalez sick flip has been an Australian Labor Party member of the Australian Senate representing the state of Tasmania since august two thousand she comes from a family with a long labor tradition her grandmother was a founding member of the Hobart branch of the ALP and her late uncle was a Tasmanian state ALP president Louise Gonzales is a Haitian I don’t even know what this says our chironomus and the founder of an environmental peasant movement he received the Goldman environmental prize in 2005 for his work on forest protection thank you so uh thanks for coming this is the last presentation I’m glad you’re coming in after this we can all breathe a big sigh of relief and wait for block party so let me start a video hopefully doesn’t make out on the other sides but was he first hey nerd started playing with that old dog ate a taco uh-huh we’ll try for yourself attitude is your console Sega Genesis with it 16-bit graphics and blast processing is here to show the other consoles who’s boss sorry guys but you can’t do this on in 10 doh genesis does only 10 domes all right round of applause for the Sega Genesis how many of how many of you have this console growing up how many of you played the Sega Genesis can I see some hands good number of people maybe seventy percent of people in the room ready won’t have the console now cool we have a couple over there and went over here does anyone have a flash cart or something does anyone play roms on there let’s take a Genesis I’m sorry you just saw your ex-wife a we’re saying so it’s kind of like a prize sort of treasure she collects antique consult that’s kind of interesting concept I don’t know like my thing with with Sega Genesis and a lot of newer a lot of people collect antique consoles but the a lot of things are emulated you know so you have run things on an emulator and so you’re you want to play a rom you download a rom and you play it on an emulator you don’t burn it to you don’t write it to a flash or rom or anything like that and play it on a Sega Genesis no one really does that so you’re the hardware becomes an emulator and emulators in real hardware it’s in representation of what someone’s opinion of what the hardware is but that’s what everyone runs then you have other emulators that are written and when they write the emulators i wrote a nintendo emulator and this is what i did i look to other emulators to write it and so I wrote it based on other emulators and it becomes this bizarre and sexual sort of thing like that commercial isn’t this Sega Genesis commercial I found that on YouTube and so it’s it’s like someone representing

as they would in an emulator this Sega Genesis whether it be its marketing or its commercials or are the actual hardware with something else it’s kind of a funny concept in kind of a concept they have to look out for when you start program to sega genesis because you may find that something will work in an emulator it won’t work on a second something will work in one emulator it won’t work work at another emulator they’re all talking about something that’s supposed to be static right but it’s not because no one uses Nonis emulators I don’t know I think it’s kind of a kind of a weird concept but we’re going to skip the the bridge is going to go straight to the hardware pretty much and just talk about that on an emulator let me xrandr this back because i figured it would do that so this is second Genesis less complicated as maybe if you took it and smash that on the ground this is what it would look like but I got your cartridge here you got your controller and your television and it got like three main sort of areas that you can sort of make out there the two of them are processors we have two processors in the Sega Genesis the 68 k the 60,000 I’d like to say 68 k so now I say that I mean the 16,000 it’s a 16 bits processor with a lot of 32-bit instructions 16 bits data bus just an overall pretty leet processor then I got the z80 which is kind of a 16-bit processor to data bus a lot of 16-bit registers and things like that this is the 68 k this is the z80 and then finally got this little guy here this is the VDP are the video display processor which draws everything so I 10 attach the TV then so every device here has memory associated with it and we’re representing the memory in sort of a linear graph y being highest lowest address too high why being the highest address it’s a memory map and so we have two main memory maps 150 81 for the 68 k and they are connected so this is the 68 k f as you can see by these squiggly lines here it’s connected to the z80 memory and it’s a direct map to the memory there’s an area in the 68 k memory that with you right to it you’re addressing z80 memory you have to do funky things to do that but basically that’s what you do and then you got VDP over here with three different memories and the way you communicate to it is through redditors and the registers are represented in the 60 k’s memory through a couple of addresses one for control one for data let me pull up some bigger picture of the of the 68 k and maybe you can see that in a little more decal detail this is the 68 k I don’t know if you remember it up the picture but the top here is connected to power rangers not a cartridge I played but a cartridge that is pretty big nonetheless it could be as big as four megabytes we have 0 through this address here is where the rom is mapped onto the 68 k and for all intents and purposes that’s where the program starts at the beginning of the memory there’s an interrupt table and in that interrupt table you are pointed to where to start and it doesn’t really work that way in hardware because it actually runs a ROM which checks to see if the word Sega is in a certain place in that ROM so that if you change that you violate some law that they can enforce some sort of trademark violation or something like that so that’s kind of how they it’s not a technological sort of anti this does not have the seal of quality control but the well then intent just sidetracking a little bit that intense I’d earned this earlier from the guy who melts chips maybe size is a this thing but he’s talking about how some of the some of the unsupported cartridges like Bible adventures for the Nintendo the Nintendo had a little tiny for bit processor like a microcontroller long car trade one the cartridge for Nintendo talking to each other to negotiate let’s start the thing because you’re a legitimate cartridge while the unlegit emit cartridges like Bible adventures said that and blew the chip up

inside the Sega some voltage something or something I don’t know the details of it but I thought that was particularly clever it’s not like that in the Sega Genesis you just look for sucka and then they your little lawyer stick after you if it if you violate that I don’t know what it is nowadays but whatever blue areas we don’t use we don’t really use a lot of areas actually we can use a lot of areas but I don’t use a lot of areas so not going to care about them too much this area right here is where the z80 is mapped you have the squigglies going down to the z80 after that we have a little area here which I didn’t represent with numbers unfortunately that is mapped to the controller this will squiggly goes down to the controller and this is similar interface is this where you have registers that you write to it’s a little bit different nothing then he got this sweet little area that’s where those two dresses are well those eight addresses but ones 32-bit 1 16 bit so I guess not all 8 addresses but whatever that’s where those two things are then he got 64 K of ram but she can pretty much do anything with right here the RAM is mirrored and everything’s mirrored in the blue area and there’s all sorts of funky going on the blue area that you can take advantage of if you want to but we don’t have much time here and that says that’s the end of memory right there I don’t know this little cut off there so let’s talk about the z80 well uh no no I’ll talk about the PDP with this squiggly since it goes up there alright so this is the PDP this is mr Bigley comes in and again we talked to the vtp through registers the vtp has three areas of memory all of which are entirely used and have no real map these definitely have no map they just served one purpose vs Ram controls scrolling up and scrolling down crammed versus kind of like saying I say cram all the time and no knows what I’m talking about controls the colors you can have 64 colors raise your hand here who likez coloreds it’s the entire crowd you don’t like colors it all back there and up there you may be colorblind I never mind is don’t offend anyone here colorblind has 64 colors from a palette of 512 it’s nine bit three bit associated with RGB so that’s what started and cram certain kind of a funky way where it’s not one after another there’s a gap there I’m not going to talk about that but it’s not mapped as you would think it would be just keep that in mind I think end it with E a lot that’s it so if you ever do it just end it with a lot you’ll you’ll know what I’m talking about then this serves a number of purposes it’s vram it is 64k like the actual ram it serves these purposes these are mapped anywhere they’re controlled with registers which he set using the 68 k using those two addresses yes scroll a scroll be window H scroll and sprite thus frighted attribute table scroll a and swindle are connected i’ll talk about scroll a scroll a is a plane of eight by eight pixels bed formats right this is what we talk about when we talk about sprites we have this two-dimensional array of pixels that’s a sprite so you have a number of sprites they can be a number of variables long and the number of variables hi that’s composed a two-dimensional array of these sprites and that’s called a map thing characters on a screen you can have characters next to each other and you can think of every character assh 0 le being individual sprites that’s pretty much how you’d think of it so yeah so if your if your terminals 80 by 25 that’s 80 x 25 sprites for the sega genesis you can have terminals of 32 by 32 64 x 32 128 x 32 and then 32 64 128 but you got to be careful to not exceed the barrier of vram you can’t have a 128 sprites x 128 sprites because you can’t store that in there without clobbering all the other so windows the same thing but window and scroll a are connected together in a very special way because you have read in the VDP which based on different areas in the screen weird weird drawing can replace all subsequent drawings of pixels with what’s in window it becomes like this window that you can show and

I’m not going to talk about what do you get any further because I don’t really use it and I haven’t really seen too many games that do you can use it but we haven’t gotten that far scrubby is the same thing doesn’t have a window associated with it H scrub is an area of memory that controls the horizontal scroll of every line or every eight lines or the entire screen you have three different modes to do this and you select those modes with the register vs ram is the same thing but for vertically you can select an entire screen or every two 16-bit pixels every to every two patterns excuse me there and the reason for that limitation is yes Ram is only 80 bytes long and he can’t have every line because I won’t fit there so let’s talk about the z80 and if you can’t see this squiggly goes to a TV because it’s connected to a TV that’s the z80 this is the picture I made last who looks a little bit different but uh has this little area here and I should have labeled it with the other one but so this is the map it somewhere into 68k in the sense that everything is pretty much static you have memory at the beginning that’s where it starts there is no real interrupt table of sorts that it starts from it just starts from zero and you got to look out for that it kinda I thought it started at 38 so it starts at zero this little area here represents of these and these are connected to the sound chip I’m going to be talking about video and my friend Luis here is going to be talking about sound and we’re going to try and do half and half here so I’ll leave those a little bit to him I’m going to talk about the bank switcher a little bit though because the banks would trigger is a special area in memory restore restore 9 bits sequentially one after another the 9 bits become upper bits to wear this area of memory the 68 k bank is in the 68 k and that’s 32 kilobytes that little that’s half of the z80 memory that little area there and you can double and put the upper bits and have that be associated with any area in the 68 k you see fit that maybe does not include rom I’ve done some tests and I can I’ve there’s documentation that says you can do it and rum but I can’t get it to do it in ROM so not exactly sure what’s going there we can easily do it in RAM and everything else and you definitely can’t do it on itself and have this infinite metamemory lube that explodes your your Sega Genesis like it does to the Nintendo and every commercial you see so let’s talk about the registers these are the registers of the 60 of the VDP this is my ascii PowerPoint presentation here I should have a I should have explained that’s ok i showed you to two areas of memory that you can write to in order to control registers you can do a number of different things with those two registers with those two addresses not control registers alone you can do DMA transfers from vs Ram to me Ram to cram to vram you can copy between them you can do it from 68k ram to v ram and all sorts of stuff it needs again supposedly you can do it from the 68 k rom address of the 60 km into vram just fine but I can’t quite got that work to temporary either so mote said I’m going to speed it up a little bit here mode sets one I have a library that I wrote so I’m going to reference of macros and variables in the library that’s you can use to set these pretty easily this is the defined for mode set one its registered 00 and all I have to do is write to one address to set that because what address for those two dresses to set that because that’s how those addresses work and I’ll get into that later display enable i start the beam all sorts of things just turn it on turn it off palette select you want that always to be one pretty much there’s some monochrome funky if you have it 0 but I haven’t explored that so one has color 0 has monochrome horizontal interrupt the Sega Genesis can generate three interrupts a horizontal interrupt vertical interrupt as well as an external interrupt for the controllers and other such things and those are on the auto vector interrupt tables if you

use the 60k of the 68 k then we have the rest of zeros those aren’t all necessarily zeros I don’t use them there are the read the documentation there are other things but I don’t use them myself in holy crap yeah it doesn’t work because the projector sized it differently so i can do page down so all right mom said to have that be one set into Genesis this is for backward compatibility with a Master System just have it set to one pal have it set to 1 this is inversed I should wrote pal first but one equals ntsc you can use idea see you can use those defines for that d may enable if you want to do DMA set it to 1 because you might accidentally right to the VDP addresses to start DMA that happens a lot because the documentation for writing to those really stinks and it’s almost trial and error when you start to do its verdict in Trump’s enable show display the first one generated the scanline this one just laced the display vertical interrupt still goes still pretends like everything is going fine you just don’t see anything with the first one with mode set one turns everything off send it to one backward compatibility named table scroll a base it’s kind of a long the fine I want to shirt these up in the future never register associated with these bits in a 16-bit vector that vector the meanie p guy that i showed you with the vram and all the associated areas that vector represents swearing memory that is going to be so this is scroll a base where do you want that in memory you can only have it in memory where these bits are valid you can’t have anything below that so you can have you can’t have a fine linear wherever the you want I but you scroll a that macro and put in an address as you would and it’ll convert it to that name table window same thing pretty much the same thing this one it’s mapped a little bit different so if you want to do it yourself just keep in mind this map a little bit different again that’s scrubby address and I’m going to come to me at nine I haven’t burned the cds yet but i’ll burn everything that I have up here the demonstrations and everything on a CD so including the slides and everything and the video okay sprite a juice attribute-based same thing I’m given to the sprite attribute attribute based a little bit later with that area of memory represents background color 1 of 64 colors you have 64 colors you have four pallets of 16 each sprite can have 16 colors but each sprites can be selected from one of those pallets so you don’t have true 64 bit color throughout the entire screen and a pixel per pixel level it’s an eight pixel per a pixel level and you don’t have 16 colors either because color is 0 is transparent there’s a priority to how the Sega Genesis it draws pixels and if it’s transparent it goes to the lower priority thing that needs to be drawn i’ll talk about that i’ll talk about that now the priority is this you have a background color if everything is transparent it goes to the background color you have scrolled be if everything is transparent goes to scroll be you have scroll a goes to scroll a yes sprites goes to sprites and then you have another bid associated with each sprite called the priority if that becomes one then that is above all of these so you can have plain be with a priority of one that’s over sprites and so on and so forth and that’s how the priority works if you read second that dock they have four pages devoted to displaying look pictures no it’s all crap just keep that in mind and it’s not that complex each counter it doesn’t generate a vertical horizontal interrupted every scan line you can have it generates interrupted whatever scanline you wants you wanted that 16 scan lines well I can do it you just write 16 there and it generates the interrupted every six to sixteen scan lines if you want to do something every two sprites or something like that let’s set three this these two bits represent

the size of the H scroll whether it can scroll every cell the documentation says selling everything they means right when they say sprite so every eight pixels every line and I didn’t write a macro for our a mask rather for every for the screen because that’s 0 so 0 is the screen same thing with a vertical scroll I can do by screen or to sell that’s one bit you have two options external interrupt enable there you go both sets for the screen can be 40 or 30 to my friend Luis brought up a very interesting I my friend Luis brought up a very interesting idea of emulating the intend the Nintendo on the Sega Genesis which is kind of cool because it can be 32 the sizes work out a lot of stuff for salad so maybe you could but I could be 40 cells by 32 cells and I’m going to skip the rest because I’m running a little bit low on my section so that’s pretty much it let’s see we talk about next I’m going to go to one of my tools this is a sprite editor and it might be full screen with this resolution so that’s good let’s go my god here we are uh it’s kind of neat I had a lot of fun with the GUI there’s a you can do drop shadows and stuff like that and i were to library for the GUI so i don’t know if you can see the drop shadows with are there and if anyone wants to write me documentation i would be your best friend forever because the documentation just says this i don’t want to do this at the end so that would be that would be very very helpful these are the 64 colors let’s set up a color this will be green will draw a line and you can treat it like a frame buffer you can select what you’re drawing on this is scroll a and it draws the pattern as for you this is a representation of the vram and patterns are a special thing in vram that just starts at zero that doesn’t have a vector associated with it the patterns just start at zero that way you can reference them just what the number is opposed to a number and a vector with different things all sorts of other information let’s save this so you can save in number of ways i’m going to save it just as a vram binary and i’m going to say that in timp vram okay temp vram and we’ll go to vram oh shoot let me look at that for a second here and this is a cool thing if you have vram dumbs from emulators or anything that like that you could just load it directly so you can load up Sonic the Hedgehog and we’ll show it per pixel I just want to see how long this is because we’re going to write a program for it it’s 28 so that’s price I’ll go to a and we’re using defaults to scroll a is at c 0 0 0 so let me dump those out of the vram using our friend DD and I believe that was a a was it no a 00 pretty sure a 00 sweet okay thank you all right that’s the patterns now easier 0 if for quick reference is the size of 64 x 64 sprites scroll data so just you’ll use that a lot of your dumping things skip I’ve had a problem where I can’t type when people are looking at my keyboard it’s kind of weird alright so that’s that I’m going to our ally I going to run length encode them because i have a run length decoder in the library and i just want to use that because it’s quick so Pat to Pat that early oh i overwrote scroll so let’s write that again okay so there’s these those two things I’ve old pearl program to convert those two headers constantly wait patch patta are led to on data header same thing with scroll okay for this other part i’m going to

actually go to hear no not there you know i don’t think we have time to write a program so i’m not going to write a program i’m just going to show you a few programs and i’m going to go through the lines of code well it’s kind of boring but i’ll show you want fire because it’s a pretty simple program and you’ll see kind of what we’re doing there I’ve fired and OH fired you see we’re doing start since the 68 k is leads you have the user stack pointer as an interrupt vector it’s not an interrupt but it loads it up straight away and you don’t have to set up a stack pointer if you don’t leave supervisor mode and we don’t play supervisor vote in the 68 k the in the Sega Genesis because it’s nothing really to secure as you’re not going to run linux anytime soon on it there’s no memory management unit or anything like that we have the auto vectors here external interrupt horizontal and vertical pink gin bin this is a special binary i have tools that on the CD to to generate that binary just has information with the actual rom the boots it reads that information and a lot of emulators to think of it like as an AI NS header if you write a nintendo stuff security jump main that’s it you don’t have to know anything else this just sets up the auto vector so you can call them and these are the interrupts push on put stuff on stack jump to a vertical hook which is a pointer to a function vertical hook horizontal hook and external hook so it’s going to mean means real simple and header for the library horizontal scroll buffer because we you have a limited number of rights you can do to vram while the thing is drawing on this screen you have more rights while the thing is on a vertical blank but you can do dma and it’s real quick so that’s the quickest way to do it and you can take advantage of being able to write two more vram that way so we have h scroll in ram pretty much as told by the compiler and if you want to come to me i’ll tell you how to set up the compiler and everything like that like chips just make sure is everything is 0 no routine that’s a function that does nothing done on fire that draws a Genesis on fire it’s actually part of a demo I’m not going to do the demo because I don’t feel satisfied with it so let’s make well let’s go to now that’s cool because I’ll tell you about it later so this is jen on fire set it up set the modes set up where the scroll bases are c0 that sort of stuff block right to vram this is little function rights run-length encoding here and the size is this no routine we have a vertical interrupt Phil H scroll buffer with zero this is macro that’s in Maine th screen on at sup a number of registers to turn on the screen and I won’t get into the rest I’ll just run it but that’s how you’d set it up if you turn the screen on at that point you would see whatever was you drew on the editor so and I don’t have time to get into it make that all right make clean make run gen rom something I don’t know if this will dump me into kind of a weird mode or anything like that that’s the Genesis on fire it’s waving the H scroll buffer with a sign table and no no no no not yet i was just wondering that’s okay you it rotates the sign buffer with a sign buffered the H scroll this is plain a this is plain be this is plain be high gets drawn over everything so you can have that wave you don’t wave that i’ll show you another example here and actually that loads up another emulator because i have a script just to run like three emulators i make things make sure things run right so this one it’s a little bit more complex i don’t know if you’ve ever seen 3d on the Nintendo I know there’s virtual racer but that used a separate chip in the cartridge to draw polygons so this is just using software that kind of jiggles and that rotates

and this is a sprites the scroll be scroll a and scroll a and then scroll be behind jittering and the source code for these are going to be in the little CD if you come to me at nine because I don’t have a burned yet but if you come to be 9 i’ll show you this is kind of like a little mini game so you can jump over that number the keyboard oh god commander keen has to jump on those and Commander Keen turns out to be a dick you could just set them there and he’ll jump forever and scoring points forever so scroll bees in the background have kind of a parallax thing because we can control a line by line that goes slower that goes faster that goes fast and holy that goes a lot more faster than everything else so he jumped into the air that’s a bug he can’t jump all your jumping so it was part of a demo like it’s it was very specific it was good actually played out by the demo program so you wouldn’t play it so it’s not full collision detection or anything like that so I’ll show you the data for one of those at least show you the vax and i’ll put a search code for the not working demo to you have a lot of art examples and stuff like that so that’s the vax you can see it all here these aren’t the map that’s just on there I have a separate map so that’s just so I know where the sprites are and it gets drawn right so you can scroll each plane individually if you want there’s plain a and the score doesn’t get scrolled they just stays there and you get the idea I know is it really completes but too much time I have left here but now we get into audio and come up to me because if you have questions I’ll let you know and we should get people running and making programs and I want to do and want to add one thing though before loose begins to speak about the audio subsystem if anyone wants to write a demo and anyone wants to work on art and work on sounds come to me preferably before the dental party is over we’ll come up with a demo group name and write a demo multi-tone for next year that way I afford the opportunity to build the tools better like that for your use so my friend Lewis in a minute hello hi my name is Luis Gonzalez and i’ll be talking about a little bit about how the genesis audio works plugging audio source let’s start that right okay a little background of myself i have a third year student at NYU I have no electronics experience before starting this project I couldn’t tell you the the negative side to a capacitor I started this project about five months ago so this is my adventures of creating and learning about how their Genesis this little device how it produces audio more at the hardware level and I got interested in video game music what video game music are these little files will start a play list so you can hear what they sound like video game music can represent many things it could be NSF files which what you’re hearing it right now is a Nintendo NSM file small 19k file there’s a soundtrack that some of them contain like the rom information from the game others contain a log file of all the registers sent to the sound chip there are multiple different formats the one I was interested is the

VG m which records the log entries to the sega master system and sega genesis there are other formats to like the SPC which is the super nintendo these are very small files this one you’re hearing is sicky GPA cake it’s the format similar to like a mod file and syd very popular but the for the purpose of this presentation we’re going to be focusing on the jam files because what you’re hearing right now PGM files actually have the register information for the both of the audio chips in it it is also the the format for the Master System which is an 8-bit version of a chip now you could get bgm files from the many sites one of them is project 2612 which has like every genesis game soundtrack also you can get it from SMS power which has which created the BGM format and has Master System soundtracks and what inspired me to research the Genesis audio was all these projects that I saw online particularly was this NSF player which is a hardware NSF player it’s like a self-contained circuit that plays back a file there was exalted projects like those people playing around with the audio chip of the FM chip and PSP chip so I thought why not make a little Walkman like device I can play VG empires you heard the sonic the hedgehog playing back on this day this player it’s actually running through an emulator so some of the things don’t sound exactly quite right so I wanted to create a little player that would play back the audio 100% perfectly and what better way to do that and to use the actual chips all the information is online i have the jetta the schematics the documentation the data sheets the BGM formats all spect out i have all the music files so all i had to do is just put it together and having no electronics experience that it would be quite interesting so this site emmy doc stork has all the documentation you need the schematics the data sheets for all the sound chips when i first looked at this i had no idea what i was looking at but you looked pretty cool pin outs for the FM chip the BGM spec and what let me to believe that i could do this project is there’s a text here that says ym 2640 right value the need to register a so I remember seeing that before I saw it on this pin out you see this as the right to part a registered rights apart to register it maps to that BGM file format so I thought there must be a way to get this file directly to this chip and apparently I was right so it led me to create this device that streamed the BGM file data to those chips and in doing so I learned a lot about how the Genesis creates its sound and I’ll play back a little sample for you this circuit took about five months to complete turning all from battery power I keep all the BGM information on this little eproms which are 32 32 k worth of information so I’ll go into the details of how I what I learned start with the psg chip that’s a simple if ship to tilt or learn it’s found in many game consoles arcade computers you’re seeing here is the Sega 1000 it’s also found in to sega 3000 mark 3 it’s also in the game gear it’s a

very popular chip it’s in the colecovision it’s in the sega master system and of course in the Genesis so I thought this was a good good place to start to learn how this chip produces audio how to get data into it the data sheet gave me this information has three square wave tone generators and one white noise generator which sounds like static here’s a little sound of the chip this is from sonic the hedgehog 2 it’s the PSG playing in the background you hear it’s so light you don’t notice it it’s very muted but it’s playing in the background of Sonic the Hedgehog to Emerald Hills own sounds very similar to Nintendo so to get sound out of it you write registers to it so that’s what the PSG sounds like censored programmable sound generator it’s an integrated circuit with everything you need in it has an audio mixer has a built-in oscillator so all you need to do to get data out of it is right to each of the pins so how do you do that see these boxes represent a channel this is represents one of the tone channels there’s three square wave tone channels and a white noise generator and to access those you write a binary on off on off and just one bite to access each of those channels so depending on what you write to the chip you can turn off through a channel three volume or a set the frequency to a higher setting I’ll go into this registers later how do I know the PST chip existed inside the genesis well it was inside the schematic you can see the PSE chip here and the FM chip here I didn’t know the PSD chip existed until I saw this document they both mix into this circuit mono stereo mixes into the headphone jack so I thought this was great how do I get data into it well the first thing I needed to know is a hex to binary conversion the image you see on the left in red that’s the vgm file data that’s an instructions in that file that has all the music register changes you need to do set the channel on or off and these pins you remember remember that pin out has d0 through 8 so just take those hex values convert them into binary and just map them to the correct pins just dump them like a player piano how do I do this well there’s a tool called Arduino which let me do that very easily it’s a ide is very easy to use it lets me control this microcontroller which lets me to use sets set these pins digital pins on the top two on or off very easily like you can see in the code digitalwrite pin set pin 621 so that’s how the first prototype I did was to stream a BGM file through serial port send it to the Arduino parse it out into the ones and zeros and send it to the FM a PSD chip I got this idea from little-scale this website that did a similar project and here’s a video of a plane so for my computer the BGM file streams to the serial port USB so it works problem was I ran out of pins to implement the vgm player i’m going to need the other FN chip which has more pins than the PSP chip as you can see here this all filled up I don’t have any more pins to write data to so I have to look into shift registers what shift registers allow you to do is send more data out using fewer wires so you remember the bite example I showed you you can fill up eight bytes just directly connecting the pins to it well in this example you take 11 bit and you push it out one at a time so if you can imagine I fill in a bit into this box over here and then move it over to six and then put another bid 0 push it over and it keeps going keeps going once this

is filled it moves on to the next one so with like three lines you could send 16 bits of data so this is a shift register example that I just use the Arduino examples from I put a zip socket in there that’s where the FM chip was going to go and these lights will tell me I’m streaming the data out correctly the order matters put them in reverse so these are the shift registers is the psg chip it sends the data out to the shift register fill the 850 r then once this is filled some APIs to there and then it sends another like latch command to tell it to send it out all at once this means it’s going to send the bite one bite to the pft chip and one bite to the FM ship this is where the FM shape is going to go that brings me to the next steps getting the FM chip and to do that I had to take one out of a real Genesis so this is the genesis i took the PIAA FM chip out of I had to desolder it this is a picture of all the steps that I went through to get it I bought a used Sega Genesis for like thirty dollars took it apart very painful to do my system scan all the parts see that’s the cartridge for that the 68 k CPU this is the chip I needed all these are like memory chips so I located it I desolder did have it in my hand now straight to the breadboard now that the FM chip works almost the same way as the PSP chip does and what means you could you could get sound out of it by writing bytes to it what those bites do if you read the documentation they’re different register rights like we’ll take a look at the pin out again value d0 to d7 that’s where the bites are going to go and there are other pins that tell you which part of the registers you can write into this chip also has an integrated audio mixer which was convenient has stereo out these are two stereo Alps and these four pins tell you tell the chip that it’s ready to receive data if it gives a status if it’s ready to receive the next set this is what a BGM file looks like remember the those hex commands that we needed to send those bites out to the pins so now that I know how to send bites to the IC chips is just a matter of parsing through this file if I encounter a command like 50 is the command to send a the next bite to the PSD chip 52 would be a command to send a bite to the FM chip so on so forth what those bites mean you could read the documentation and kill yourself understanding how the channel addresses but you just pumped at the data overview how it works I keep the EP game data in eeprom takes it one bite at a time through the Arduino the Arduino sends it out to the shift registers if you remember the shift registers is just containers of one bit at a time for one bite I fill these up they all have one byte worth of information this one goes to the PSD chip this one goes to the FM chip and these are little control bits that you need to tell the this FM chip that it’s ready to receive information it’s ready to write information you need to set the clock low or high and it’s received the information see rly and then it receives a latch command to send it all at once these are oscillators 3.5 megahertz for the PSD chip 7.6 megahertz for the FM chip and I told you earlier that the FM chip has an audio out so does the PSG chip they all mix into this headphone jack the bottom right is a lard we know chip the what the headphone jack looks like

we’ll be prom the first prototype this is the code that was necessary to interpret the PGM data stream like when you encountered a command that say a 53 bite that means it’s going to write port one register register AAA with right the next byte that’s next to the 53 bite some kinds of resources or you can find online to help you understand what the chips are capable of I went to project 2612 to download all the BGM files I needed SMS power to get the V GM’s file spec sprites mine is a forum as an active forum where people actively create Genesis programs or any technical questions or demos or music that people create nowadays there’s a Facebook group dedicated to the why of the FM chip I thought that was pretty cool i joined it their trackers available trackers or music creation tools these output vgm files popular i think that there’s a chiptune community that creates BDM files there’s multiple vgm editors is one for the PSD chip three channels 1 square wave this is another Genesis tracker will player the winamp plug-in that i use came from chip an org it installs a plug-in that lets you play back medium files and i think that’s it i’ll playback another bj my of the circuit get here you that’s just a PS future no at them someone made that for a chicken composition like two years ago it’s about 20k I didn’t implement all the instructions of timing and freshman correctly those a little off Thank You pops moppy last one this is a song that someone created using those tracker software I think come from a game and that’s it is my circuit cell contains