Code Walk! CPU Cycles and Performance of Mega Man 2 (Bonus: MM3) - Talkin' Code Ep. 4

31,929
0
Publicado 2022-04-20
Code walk of a Mega Man 2 subroutine with cycle counting, execution time as a frame percentage, and improving Mega Man 3.

If you would like to support this channel, here is a link to the Displaced Gamers Patreon page - www.patreon.com/displacedgamers

Twitter: twitter.com/DisplacedGamers
Facebook: www.facebook.com/DisplacedGamers/
Instagram: www.instagram.com/displacedgamers/

0:00 Intro
0:41 Code Walk
14:13 The Math (Percentage of Frame)
17:54 Marked Breakpoints
24:26 Mega Man 3 Performance
27:19 Outro

#NES #MegaMan #Programming

Todos los comentarios (21)
  • @nickwallette6201
    Exposition on MegaMan's X-Position. I'm here for it. * taco crunch *
  • @TheWizardOfJim
    The disappearing/reappearing blocks are the bane of my existence. I hear the "vzzzzshwp vzzzzshwp" noise in my sleep. Learning more about them has not helped.
  • @trzy
    Debugging tools like this would have been amazing back in the day.
  • @seanvinsick5271
    Grab a taco, your favorite beverage, were gonna do a code walk is my new favorite line. I plan to use it at my next code demo.
  • I don't code, I never learned any programming language, but with just a cursory understanding of the very basics, your explanations make things perfectly clear. These videos are so fascinating and entertaining to watch! I love peeking under the hood of these games, seeing what makes them "tick". It's the same sort of fascination I'd have when someone breaks down a car's engine and explains what each little tidbit does and how it affects the whole. Thank you so much for making these! Can't wait to see what you do next!
  • @warmCabin
    $F9 sort of acts as an underflow/overflow for Y coordinate math. I've seen it used like: 0E:8C29: AD A0 04 LDA y_pixels[0] 0E:8C2C: 69 0C ADC #$0C 0E:8C2E: 85 0A STA $0A 0E:8C30: A5 F9 LDA offscreen_underflow 0E:8C32: 69 00 ADC #$00 0E:8C34: 85 0B STA $0B Theoretically it can be positive, but Mega Man always dies when that would happen.
  • @BrianBates128
    This video is fantastic. Mega Man is my favorite game, as a developer I love NES development, and the ability to have it all told to me as a story is great. Please keep doing videos like this and Behind the Code.
  • @kri249
    I never recognised the shine graphic on those blocks before. It goes so fast but I can pick out at least 3 frames. So imagine the blocks skip through three tiles before disappearing. If this game was a rush job you gotta appreciate the small details the developers invested in it with what little time they had.
  • @ryans5615
    I'm totally digging this series! I really appreciate all the code walkthroughs. As I delve in code myself, I don't ever do this low level of programming though, and I truly find it super interesting and entertaining. I also realize you don't want to take 2 hours to go over every single detail in the code that's there. Thanks! And keep up the great work!
  • @tonysanchez314
    I really appreciate the level of detail and depth in your videos. You've revealed many of the secrets that I've wondered about since I was a kid and a fledgling programmer. Many thanks.
  • @sanderbos4243
    The marked breakpoint visualization is an awesome feature, wow! And the graphics you made and showed to the side of the code walk really helped!
  • @craigluft7453
    I remember from your mapper video explaining how the MM3 in Mario 3 allowed the slot machine video game with interrupts. when I saw the alternating directions of scrolling in the level select at 24:30, I thought that must be a different mapper, which you soon confirmed I am retaining information from these videos.
  • @arciks11
    I heard Mega Man 3 development was insanely stressful with many staff walking away during or after finishing it. you can kinda notice it in level design. Starting with Wily stages you really start feeling like they are first drafts and not iterated on at all. In some ways Mega Man 4 feels like first Mega Man game they actually finished.
  • Megaman 3 was absolutely rushed out the door too, sad to say. It`s actually amazing that it managed to be done as well as it was, all things considered.
  • @HanCurunyr
    I always enjoy code dives like that in old games, really shows how things have evolved, and how much knowledge we gained throught the years, for the very same subject
  • @spartonberry
    Inefficient code? Have you heard of the infamous kusoge Maka-maka for the Super Famicom? One of the features of the SFC was DMA. The programmer on that saw that and got the exact WRONG idea of how to use it. It is an RPG, and whenever transitioning to or from battles, the game has some incredibly long load time, especially for a cartridge game. I don't know if I've even seen worse from CD-based games. I remember finding the load times in the PS1 port of Chrono Trigger excruciating, and yet they're still not as long. During the graphics decompression routine, the program uses DMA to registers to write a single byte to RAM, while it uses looped code to individually clear out 64KB (half of WRAM), and it does that many times during one graphics loading sequence. I have patched that game's graphics decompression code. And while not dealing the excessive wiping of WRAM, just patching it to make sensible use of DMA was something like a 40% speedup, if I remember the timing comparison right.
  • @adamdrew7522
    I just started developing NES games, so this is the best channel I could have found right now. Amazing work, man. Amazing.
  • @warmCabin
    I've looked at that bubbles and splashes subroutine. It's about what you'd expect--most interesting part is that there's a couple of little tables that store different gravity values for air vs water.
  • @sandmyth
    I would love to see you look at the bank switching on Zelda 2 to see what could have been improved, or what caused the slowdown in the maze potion of the overworld VS the NDS version. I know i saw you mention it in a previous video. As always, great content!