How Bad Apple was played inside Super Mario Bros.

82,898
0
Published 2024-05-15
In this video, I break down the steps I took to create a TAS of Super Mario Bros. wherein I play the Bad Apple music video on screen.

Here's the TASVideos submission for more information: tasvideos.org/8991S

My game Fantastic Fist can be found here: store.steampowered.com/app/2119470/Fantastic_Fist/

If you want to follow my TAS tomfoolery, join my discord: discord.gg/SbhTn6nX35

All the background music used in this video (If it isn't coming out of the NES) is from my game's soundtrack.

This video makes some assumptions on your 6502 Assembly programming knowledge. Many of the concepts used in this video would require an entire course on 6502 ASM, and I'd probably lose 90% of the audience halfway through explaining all that. Instead of explaining all that, I'll just assume my target audience is people who already have a decent idea of what's going on, and are willing to pause the video to read the comments on my ASM code if needed. (The ASM code can also be found in the TASVideos link)

On top of explaining how the recent Bad Apple TAS was put together, I also show some ways to improve this TAS, such as playing colored videos.

I don't usually make videos with commentary, so if you want to provide feedback in the comments, all is welcome! If the subtle music in the background is distracting, if I sound too monotonous, or if I completely forgot to explain something, I'll keep that in mind for future videos.

Timestamps / chapters:

0:00 Introduction
0:16 Step 0 - Glossary: TAS
1:10 Step 0 - Glossary: ACE
2:03 Step 0 - ACE in Super Mario Bros.
6:14 Step 0 - Writing our own custom code
9:09 Step 1 - The Graphics: Convert the video into "Mario tiles"
11:47 Step 1 - The Graphics: How to draw to the NES background
14:29 Step 1 - The Graphics: Compress the data into "packets"
15:39 Step 1 - The Graphics: The limitations of VBlank
16:56 Step 1 - The Graphics: Create packets and convert into inputs
18:11 Step 2 - The Audio: How to play PCM audio on the NES
21:03 Step 2 - The Audio: Generate the inputs, and give it a listen
23:02 Step 2 - The Audio: Fixing the audio
24:27 Step 3 - Return to Stable Gameplay
25:34 Step 4 - Bonus Audio: Multiple interlace functions
26:06 Step 4 - Bonus Audio: 26.6Khz audio loop
26:38 Step 4 - Bonus Graphics: Larger resolution
27:07 Step 4 - Bonus Graphics: 60 Frames per second
27:21 Step 4 - Bonus Graphics: Color video: Intro
28:10 Step 4 - Bonus Graphics: Color video: Determine color palettes
29:12 Step 4 - DOOM
30:10 Conclusion

All Comments (21)
  • @HBMmaster
    using this method it might one day be possible to play super mario bros (1993) inside of super mario bros
  • @Altilt
    Oh so we're just casually skimming over coding an emulator?
  • @appleando752
    Any and all video players will play Bad Apple, and anything that isn't a video player will be forced into one so it can play Bad Apple. For being the video equivalent of "Can it run Doom" It is criminal that almost none of these Bad Apple videos and barely any of the comments mention Touhou.
  • @Alberos
    Step 0: Get a Bad Apple video Step 1: Write a NES emulator in C# Step 2: ??? (Hand waving intensely) Step N-2: Profit
  • @IrisGalaxis
    I watched until you casually said "so I'll just write a nes emulator". I had to pause there. I just had to. Lmao! So awesome.
  • @ct3000
    "Nes ROMs don't have enough storage for full length PCM music" Should've just made the player spam buttons for the music to play
  • @Pixelcraftian
    2:11 Hey, look, there I am! :D Incredible stuff!! Can't wait to see what you get up to next :]
  • @OhhCrapGuy
    Honestly, asking "why" of any arbitrary code execution attack is probably another way of saying "this video wasn't made for me"
  • @twingemios5139
    After taking an assembly class in college these videos actually make sense to me now.
  • @guzik1252
    16:00 well guess what? I want math. I want to see dirty and naughty math and nasty assembly code, that's my entertainment
  • @Snidbert
    guys will watch this and think "hell yeah"
  • @smob0
    Instead of using a 1x1 kernel when searching for mario tiles, I wonder if a different shape could be better. Maybe a 3x3 gausian spread could help make some of the edges less jagged. I also like how the piano roll analogy became a reality. Its a sequence of button presses to make music. It's just the the first part of the piano roll builds the piano itself.
  • @blara2401
    The constant back and forth between entry level explanations and "I wrote an NES emulator" level madness is beyond hilarious. Great job !
  • @xXBlueSheepXx
    The audio playing the NES part is what amazed me the most. Honestly, I was expecting Bad Apple added as SMB custom music
  • @hexagon_
    I guessed a lot of how this was done, but going into the details was so fun! I figured you used a black-and-white video because of the color palette limitations, but it's insane how it still just about works with color video. Also, I can't believe you wrote your own cycle-accurate NES emulator as a side-project for this. Insane
  • @emilycurtis766
    I had a ton of fun watching this. Incredibly impressed you pulled this off, and even more that you explained it in a way that made sense to me. Normally technical glitch explanation videos fly a bit over my head but I was able to get this one with a minimum of pausing and rewinding.
  • @HappyLeeHL
    Great video. You're absolutely fantastic at what you do. :D