DIY Games Console

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

Also, the project is well documented here https://mitxela.com/projects/console

👍︎︎ 140 👤︎︎ u/nopainXX 📅︎︎ Nov 07 2019 🗫︎ replies

Some people are just damn fucking intelligent.

👍︎︎ 209 👤︎︎ u/lionrom098 📅︎︎ Nov 07 2019 🗫︎ replies

I honestly didn’t expect his Pac-Man game to look this good.... damn

👍︎︎ 47 👤︎︎ u/Rudy69 📅︎︎ Nov 07 2019 🗫︎ replies

Analogue snake?!?! What a time to be alive! :-D

👍︎︎ 25 👤︎︎ u/unwind-protect 📅︎︎ Nov 07 2019 🗫︎ replies

This is how the first video games were made, for those not aware.

👍︎︎ 41 👤︎︎ u/tiftik 📅︎︎ Nov 07 2019 🗫︎ replies

To build a game console that outputs on an oscilloscope from scratch, you first must invent the universe.

👍︎︎ 75 👤︎︎ u/aradil 📅︎︎ Nov 07 2019 🗫︎ replies

The glitchy music and graphics at the end of the mario level is creepy as heck.

What do you see before you die... you start to load every data of your life, everything gets confusing, tiles mixes up. and when the glitchy soundtrack ends, you close your eyes, take a last breath, and when the last note plays, you go, peaceful.

👍︎︎ 12 👤︎︎ u/holyfab 📅︎︎ Nov 07 2019 🗫︎ replies

The part where he inserts the first card....takes it out after a few seconds....and then blew into the cartridge to get it to work?

This guy Nintendo'd.

👍︎︎ 24 👤︎︎ u/GandalfsNephew 📅︎︎ Nov 07 2019 🗫︎ replies

Fun fact: The very first video game ever was made to display on an oscilloscope.

https://www.aps.org/publications/apsnews/200810/physicshistory.cfm

👍︎︎ 11 👤︎︎ u/Hypersapien 📅︎︎ Nov 07 2019 🗫︎ replies
Captions
fair warning this video is just going to be me showing off no that's that didn't in my previous videos but in this case I assure you there is no educational content in 2014 I built a games console I designed and built the hardware I wrote the BIOS and I wrote all of the games for it and obviously it was all programmed in assembly instead of a composite video output it has a vector display so yes it's the old trick of drawing pictures on an oscilloscope in XY mode although I used reasonable quality Dax for the output there are only eight bit and the op amps are meant for audio so that slew rate is really bad and kind of defeats the point of having a vector output at all I wanted it to use existing control pans but when I was building this I only had one nest pad and one snez pad so the two-player games are a little bit lopsided also I couldn't easily get hold of the vector the socket for this type of connector but what I could get were extension cables so all I had to do is chop those up to be able to connect to it but enough talking let's turn this thing on Oh hold on [Music] what a great game to start off with anaconda it's like zinc but you know involves trigonometry the bright dot in the top right corner is the beam idle spot the console has no intensity alpha so the only way to modulate brightness is by changing the dwell time and between frames it rests the beam at the zero zero position gives a pretty good idea of the load on the display routine if that point starts to get dim it means there are too many spots on the screen [Music] the sound Hardware is a very loose approximation of what you might find on a game board it's got three square waves and a noise channel the noise channel really is just that it's gating the output of the reverse bias transistor I'm sure no one will be surprised to learn that I wrote a JavaScript utility to convert MIDI files into the correct binary format from cartridges [Music] since the cartridges are a EEPROM electrically erasable non-volatile memory the high score table is stored on to the country at the routine that does this is part of the BIOS it's used by several different games but in this case we didn't score highly enough to earn a place on the scoreboard now if you recognize what that first game was wrong then you can probably guess what the next game is going to be yep retro racer [Music] it's a two-player game and since I couldn't find the soundtrack in MIDI format I used another popular MIDI file instead here we encounter one of the big problems of the system since there's no color answer it's normally quite hard to keep track of who's who in this case the oh I'm as you can see demonstrating this by myself I'll pick up the other controller [Music] one of the striking things about retro racer is that the motion is supposed to be very fluid the walls of the be slippery and I only partly managed to implement that because the processor is just a bit the collisions are single precision and the tiles are about as pixelated as they look speaking of which the system can load any map that we desire but true to the original it only has one map available [Music] if you thought the calculations there were tricky it gets even harder for the next game in the series so hard in fact that I didn't finish it Astro Lander has gravity and momentum land collisions and the whole screen zooms in and out as you play which I almost managed but I'd given myself a hard deadline of only one week per game and I missed the deadline on this one besides the next game is going to be a lot more exciting but before we load this up and let's talk about what's actually happening when we load a game the processor is 8 bit it's an atmega chip and the AVR architecture is interesting it's what we call a harvard architecture the program data that's the flash memory on board the chip has a separate address space to everything else so that Ram the working memory and the peripherals all exist in a separate place to the program and similarly the program on this cart has its own address space no matter what we do we cannot get that chip to run code directly from this cartridge so what's going on what we do have the ability to do is write to our own program memory so when the game card is plugged in the first thing the BIOS does is copy the entire cartridge onto the flash memory and then jump to there in order to run it if you think that doing it this way is stupid you'd be right anyway to maintain the illusion of running from the cartridge as a pin change interrupt that fires when the Kart is pulled out that kills it and goes back to the insert cart screen [Music] I have a weird compulsion to get these games as accurate as possible and if you're not familiar with it you might not realize that the motion of the pac-man ghosts is far from random each of the ghosts has its own behavior routine and in my recreation I've stayed as true as possible to the original blinky the red ghost is the simplest who always runs straight towards Batman at least during the attack phase pinky runs ahead aiming for a few squares ahead of where pac-man is facing inky does something similar but this time mixing things up a bit taking the difference between blinky and pac-man's positions to try and perform a pincer attack with the other ghosts and Clyde the orange ghost well he just does his own thing all of this is slightly wasted though since there's no color information and all of the ghosts look the same but now you know that although they look the same they all have their own personalities writing this game was an excellent exercise in using the memory displacement instructions these aren't unique to add mega chips lots of processes have something like this it's basically about setting a pointer to memory and then asking to read and write data to a fixed offset away from that pointer and the reason you'd want this is so that you can implement tabular data in the case of the ghosts they've all got different properties things like their X&Y positions their sprite and the direction they're heading even though there are differences in their behavior the bulk of the ghost handgun code is the same by having a table in memory of all these properties we can set a pointer to the first row of the table and the code can use the displacement instructions to work on the properties of the first ghost then we move the pointer ahead to the next row and run exactly the same code again to do the processing for the second ghost these techniques are a bit different to how you'd implement something like this at sea but once you get used to it you can make the code really efficient almost unnecessarily efficient before we load up the next game I have to explain that throughout this project every day that went by my ambitions would grow you know I started off knowing almost nothing about electronics and almost nothing about programming in assembly and nothing about how computers work I mean how they really work so halfway through I was thinking you know look how far we've come what could take this to the next level and the answer is obviously 3d I didn't even have a gaming mind but I chucked together a couple of matrix transform routines we've already got the trig tables from earlier and BAM wireframe 3d models on an 8-bit processor drawn on an oscilloscope well by the end of the project I'd kind of forgotten to make use of these 3d routines so not to let them go to waste the only thing I could think of was putting them on the Tetris title screen [Music] [Applause] Waal kicks and delayed auto-ship these two things are what make or break a Tetris implementation the wall kicks are what happened when you try and rotate a piece when it's in contact with a wall and an in-place rotation wouldn't work the delayed auto shift is about what happens when you hold a button down the first press shifts by one grid space then after a fixed amount of time it will start to auto shift and the delays between Auto shafts are different again lucky for me every last detail of the different versions of Tetris has been extensively documented so all it takes to implement these things is attention to detail [Applause] [Music] the scoring the rotation origins the bag from which the next tetromino is chosen all of these things are implemented as true to the original as possible because well if you're going to do something do it right [Applause] [Music] there are a couple of games I made right at the very beginning nothing special there's paint which was most just to help me while I was developed on the graphics hardware and yes this is a brain interpreter which again this is after I'd written it text drawing routines I needed something to test it there's one of the game one game I wanted to have a go at you know something really ambitious might not sound all that complicated it's just a 30 year old platforming game but the physics of Mario the behavior of our little jumping plumber recreating that is an entire project in itself getting Tetris to feel right was one thing but Mario and I say this as someone who used to be quite active in the Nintendo fan game community Mario everyone gets it wrong or very few people get it right the mechanics are so counterintuitive from when you press the jump button to when you first release the jump button at that period of time gravity is reduced there are distances which can only be jumped when you're running at full speed there are distances which can literally jump there are Heights which can only jump tuned if you have a certain horizontal speed all of these things are an effect of the exact physics behavior and the exact constants which govern the behavior get any one of them wrong and the levels are unplowed as you can see I've managed to implement Mario's behavior and the level is loaded but there are no bad guys and lots of things are missing since I didn't implement death falling into a pit means you fall into the y-coordinate ramps and you fall out of the sky and there's no end game either so at the end of the level the routine starts to load the music data into memory as if it were level data and perhaps this is a metaphor for life when we overcome the hurdles and we finally reach our goals all that lies behind is a collection of broken tiles or maybe it's a lesson about obsessive behavior if you take things too far the world will fall [Music] you might be wondering how I was able to produce all of this on such a short time scale for Mario I think I only spent three days Island and these aren't full Bay's mind you despite everything I did have certain responsibilities which meant that I couldn't channel every waking hour into the project much as I might have wanted to honestly I've never told anyone about this but I suppose it's time that I come clean before writing these games in assembly I prototype them in JavaScript for Mario and pac-man and bits of the others anywhere the logic was going to be difficult I made a quick demo in a language where I was more comfortable and then once the behavior was nailed down I could focus on translating that by hand into assembly there was still a lot of difficult assembly programming to do but by separating the difficulty of it being assembly and the difficulty of it being a complicated behavior the whole thing was well I wouldn't say easy but easier did I need to make the pac-man prototype as polished as this no people frequently underestimate it takes to document projects I'd say writing him a project page and filming a video about it often takes more effort than the actual project itself but it's so valuable though being able to go back and see what you did and what you thought at the time in this case this thing has sat on my shelf for about four and a half years and I feel it may have been better to just do a half-assed project page about it at the time rather than waiting until I'd forgotten all of the details still I'll put what I can on MIT's allcom including some of the JavaScript stuff and I guess the assembly source code although it might be horrifying I've not looked at it yet conclusion if you're thinking of learning electronics building your own games console with a one-of-a-kind architecture and programming all of the games for it yourself in assembly it's already been done but don't let that stop you it's really fun and educational I'll cheer you on believe in yourself believe
Info
Channel: mitxela
Views: 643,359
Rating: undefined out of 5
Keywords: avr, assembly, programming, microcontrollers, oscilloscope, games console
Id: dTGOEe8f8ls
Channel Id: undefined
Length: 16min 3sec (963 seconds)
Published: Sun Dec 23 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.