Reverse Engineering Game Code from the Neutral Zone

แชร์
ฝัง
  • เผยแพร่เมื่อ 22 พ.ย. 2024

ความคิดเห็น • 699

  • @HowardScottWarshaw
    @HowardScottWarshaw 11 หลายเดือนก่อน +5517

    I'm impressed. This is a very thoughtful and intricate analysis. I also love the irony that the code responsible for displaying the neutral zone is also the graphics for the neutral zone. I must say, though I always thought I had made it extremely tough to ascertain the code from the display, I'm both glad and relieved to see it passed a very stringent test here. Thank you so much for this!
    Yars truly, :)
    HSW

    • @RGMechEx
      @RGMechEx  11 หลายเดือนก่อน +1255

      I'm slightly disappointed that I couldn't crack it any further, but it was still fun to analyze and see how far I could possibly take it. Thanks for the comment, and for the game I could make a video about!

    • @shona-sof
      @shona-sof 11 หลายเดือนก่อน +288

      Halfway through this video I thought that someone needed to make sure Howard saw it. Glad to see this comment!

    • @urdnal
      @urdnal 11 หลายเดือนก่อน +167

      Off topic but playing Yars' Revenge in the dark with it lighting up the whole room, the neutral zone mesmerizing me, is a very distinct and loved early gaming memory for me. Want you to know I appreciate it.
      (Also, ET wasn't that bad and it blew my mind to see a Yar in a well the couple of times it happened.)

    • @ToyKeeper
      @ToyKeeper 11 หลายเดือนก่อน +75

      That's amazing.❤ I used the same trick in my torch firmware "Anduril", reading from ROM to get values for a pseudo-random number generator. So when the torch is in candle mode or lightning mode, it's technically blinking out the program's machine code. But I continuously added the least-signficant bits of its voltage and temperature ADC readings too, to make it more of a true random.

    • @JustWasted3HoursHere
      @JustWasted3HoursHere 11 หลายเดือนก่อน +62

      @@shona-sofI thought the same thing, which is why I sent Howard an email to let him know about it! There's a video on TH-cam somewhere where Howard talks about the whole process of developing Yars Revenge* but I'll be darned if I can find it now. I should have bookmarked it!
      - Russell Jones
      * Especially the revelation he had on how to control the main ship: He was originally thinking of an Asteroid-esque control scheme where right and left rotate the ship, up is thrust and down was a warp or something similar. He finally realized that up/down/left/right are the perfect controls by themselves, with the fire button launching the shot.

  • @CrisperPoet
    @CrisperPoet 11 หลายเดือนก่อน +575

    25:45 "It's about to get pretty technical, and if you don't have a good grasp on how assembly and machine code works, it might be a little difficult to follow."
    Man, you lost me like three years ago, at this point I'm just here for the flashing lights while my brain tickles my ear as it drips on the floor.

    • @christophercampbell6884
      @christophercampbell6884 7 หลายเดือนก่อน +38

      Well said. I just come to this channel to feel smart and nod my head to the information given while having no clue what the hell is going on.

    • @WhoLover
      @WhoLover 6 หลายเดือนก่อน +11

      i read this as he said it. this happens a lot to me

  • @AlyxForest
    @AlyxForest 11 หลายเดือนก่อน +3340

    Ironically for Atari, just dumping the rom would be easier than reverse-engineering the code using an image.

    • @gordontaylor2815
      @gordontaylor2815 11 หลายเดือนก่อน +602

      Yeah, but the Atari legal team wouldn't have known that back in the day. They got paranoid as soon as they heard the phrase "game code being drawn to the TV screen"...

    • @SECONDQUEST
      @SECONDQUEST 11 หลายเดือนก่อน +98

      ​@@gordontaylor2815that's specialized hardware, and I highly doubt they were actually worried, just wanted to protect their IP.

    • @CptJistuce
      @CptJistuce 11 หลายเดือนก่อน +267

      ​​@@SECONDQUESTAn EPROM programmer was not at all specialized hardware for a programmer of the day.
      Ironically, displaying the code onscreen would have afforded it more copyright protection than not in the early days of 1982.

    • @09jjohns
      @09jjohns 11 หลายเดือนก่อน +119

      The dev stated that if someone did reverse engineer the code from the Neutral Zone, they deserved it, which could be argued in court as permission to reverse engineer it from the image, AND as a license to copy and use that code. Dumping the rom would be clear theft.

    • @CptJistuce
      @CptJistuce 11 หลายเดือนก่อน +79

      @@09jjohns It was Time-Warner's code, not his.
      However, depending on when in 1982 the game came out, there's a few months where it WOULDN'T be clear theft. 1982 was a big year for copyright protection of computer programs distributed in ROMs, with multiple cases establishing that yes, data in ROM ICs was covered. Before that time, the argument was that only human-readable works were copyrightable, and hence a listing of your code was copyrightable but not the contents of a ROM, disk, or magnetic tape.
      So while the writing was on the wall there was still a brief window of time you could, legally, copy that floppy.

  • @LendriMujina
    @LendriMujina 11 หลายเดือนก่อน +1260

    If you squint, the Neutral Zone being the game's entire world blown open for all to see lines up with the in-universe lore of it being the remains of one of the Yars' home planets. In a meta sort of way.

    • @CarbonRollerCaco
      @CarbonRollerCaco 11 หลายเดือนก่อน +86

      And it fits the game being a metaphor of Ray Kassar, head of Atari in those days, getting revenge on Activision (the OG one, not the one that Bobby Kotick used to ru(i)n) for "breaking" his empire with unlicensed games that cut into recurring profit for Atari.

  • @PearangeProductions
    @PearangeProductions 11 หลายเดือนก่อน +864

    I love how all the text in this video looks like it was actually drawn on the Atari 2600.
    Love little details like that.

    • @mattiviljanen8109
      @mattiviljanen8109 11 หลายเดือนก่อน +39

      2160p60 bandwidth well spent :) (Okay, the intro and outro graphics benefit from it)

    • @AutodidacticPhd
      @AutodidacticPhd 11 หลายเดือนก่อน +33

      Yeah, I still get a kick out of this one little detail in the pacman kill screen ep, when he's explaining what happens when you add 1 to 255, and the carry bit on the end just falls off the equation and bounces on the rest of it on the way down.

    • @andre_601
      @andre_601 11 หลายเดือนก่อน +8

      Does that also include possible colours the Atari 2600 would be able to draw? That would be peek design detail for me.

    • @CptJistuce
      @CptJistuce 11 หลายเดือนก่อน +14

      ​@@andre_601It looks right to me. The VCS actually has a fairly large color palette to choose from, so it isn't hard. 8 luminance values, 16 chroma values. That results in 128 color options(8 of which are just black and white shades).

    • @Arcsin27
      @Arcsin27 10 หลายเดือนก่อน +8

      Oh yeah this dudes channel has such intricate and awesome graphical details!!

  • @jaywolfenstien
    @jaywolfenstien 11 หลายเดือนก่อน +155

    Ever since I learned the neutral zone is the game's code, I've always wanted to see a programmer take a crack at deciphering it. Dream come true. Now if only we can get HSW to react to this, my life would be complete.

    • @spunkyre3917
      @spunkyre3917 11 หลายเดือนก่อน +38

      They did, see pinned comment!

    • @JeraWolfe
      @JeraWolfe 6 หลายเดือนก่อน +9

      Your life is complete.

  • @Damien.D
    @Damien.D 11 หลายเดือนก่อน +642

    I've happily spent 40 minutes of my life appreciating every explanations that a very talented person makes by trying to decipher what is, in the end, nothing more than a very fun and elegant way to make a random number generator.
    Fun fact, the "last level" of Pacman is also made of the game code, albeit not voluntarily :P

    • @forgiveman
      @forgiveman 11 หลายเดือนก่อน +65

      And there is a video on this same channel explaining the how/why this happens.

    • @CallousCoder
      @CallousCoder 11 หลายเดือนก่อน +24

      I did a video where I hacked the Pacman game to get to the kill screen and indeed it's about 512 bytes (probably less but half a screen) of the code.
      I have never ever gotten to that screen myself hence I had to hack it :D

    • @noway2831
      @noway2831 10 หลายเดือนก่อน +2

      BRO THAT WAS 40 MINUTES???

  • @mrmimeisfunny
    @mrmimeisfunny 11 หลายเดือนก่อน +547

    A good way to get the clean data from the neutral zone using late 70s early 80s tech would be to flip the BW switch on the Atari and feed the video output into an oscilloscope. From there you know the neutral zone will be rendered every line in the same place.
    Edit: Turns out the BW switch doesn't work in Yar's Revenge. Still considering each pixel is made of two dots it would still create a meaningful signal even with color.

    • @_MasterLink_
      @_MasterLink_ 11 หลายเดือนก่อน +42

      Wait, on my 2600 flipping that switch does nothing on this game and it remains in color. I know the switch works as the Telegames cartridge does go black and white, but this one does not. I know the switch is software, but perhaps it works differently on some systems? Mines a 4-switcher.

    • @sugar_700
      @sugar_700 11 หลายเดือนก่อน +25

      This is because Yar's Revenge doesn't support BW switch.

    • @tylisirn
      @tylisirn 11 หลายเดือนก่อน +23

      You do realize that it would be an analogue oscilloscope, not a storage oscilloscope (those were expensive as heck). It would be practically impossible to read. If you had access to a storage oscilloscope, you almost certainly had access to a PROM reader and could trivially just dump the cartridge. (In fact, dumping the cartridge wasn't hard at all for any electronics hobbyist. If anyone really wanted the source, that's what they'd do.)

    • @nsf001-3
      @nsf001-3 11 หลายเดือนก่อน +3

      Just plug it into a BW television. Bam

    • @_MasterLink_
      @_MasterLink_ 11 หลายเดือนก่อน +17

      @@nsf001-3 And yet that wouldn't work anyway, as mentioned in the video. Even with a perfect capture, just too much is missing to properly reconstruct.

  • @timmowarner
    @timmowarner 11 หลายเดือนก่อน +247

    I always thought the odd look of the canon when the Neutral Zone wasn't in the level was a stylistic choice. Amazing to discover it was the only way to display it!

    • @idontwantahandlethough
      @idontwantahandlethough 11 หลายเดือนก่อน +13

      right?! Love finding out stuff like that :)

    • @youtubeforcinghandlessucks
      @youtubeforcinghandlessucks 7 หลายเดือนก่อน

      not the only way, the laziest to program way is probably more like it. in the end still a stylistic choice, but based not just on the style of the visuals, but combined also with the style of the code and the effort required for it.

  • @Craig1967
    @Craig1967 10 หลายเดือนก่อน +18

    Up until now, I thought that I was King of "Going Down The Rabbit Hole." I now humbly transfer that crown to you. This project you undertook required patience of unimagable amount. This is something that reminds me of my High School days when I had Atari 400 and 800 computers. I figured out how to copy cartridges to disk as binary files. Some games would not run, and I had to reverse engineer the code to figure out why. Usually there was some code that would write back to ROM memory space that would not do any harm if it was a legit cartridge installed. However if the game was running in RAM, it would kill it by overwriting itself. I was able to replace all that "anti-piracy" code with NOP instructions. Wow, good memories come back thanks to your video.

  • @narayanbandodker5482
    @narayanbandodker5482 11 หลายเดือนก่อน +1625

    The "neutral zone" is sometimes not visible in 30fps on TH-cam because of the flicker

    • @Phroggster
      @Phroggster 11 หลายเดือนก่อน +312

      I kept thinking "what's this dude even talking about" at the beginning before I remembered that my phone defaults to data saver resolutions. 1440p/60 cleared my initial confusion right up.

    • @K-Anator
      @K-Anator 11 หลายเดือนก่อน +86

      Thankfully that should only be an issue for people watching in 480p and under, unless TH-cam has started giving different devices different framerate options that aren't available on desktop.

    • @Haganeren
      @Haganeren 11 หลายเดือนก่อน +21

      I was JUST seeing that and wanted to make a comment about it !

    • @GeneralBolas
      @GeneralBolas 11 หลายเดือนก่อน +79

      Oh *that's* why I couldn't see it.
      As an old Atari player from back in the day, I knew it was supposed to be there, but it wasn't visible.

    • @potato9832
      @potato9832 11 หลายเดือนก่อน +12

      Unfortunately, this is a common issue for many Atari 2600 games that use flicker (i.e. sprite/playfield multiplexing and scanline flickering) to exceed the native graphics capabilities of the 2600. Some people might be surprised to discover the Atari 2600's native frame rate was 60 Hz (for NTSC, 50 Hz for PAL), which can be unexpected given it's a console from the 1970s. The 60 Hz frame rate is also why Atari sprite movement can look very fluid when movement uses 2 byte fixed-point arithmetic without flicker. We've come to expect fluid movement on more modern powerful consoles. (See Atari 2600 demoscene and modern homebrews.)

  • @Dark.Shingo
    @Dark.Shingo 11 หลายเดือนก่อน +160

    My biggest takeaway from this video is that Howard Scott Warshaw was a damn genius. Which I already knew but it's always nice to see another display of his prowess. Also, making this video takes another genius, always a pleasure to watch.

  • @Manabender
    @Manabender 11 หลายเดือนก่อน +98

    33:27 There is a flaw in this logic; the just-greyed box could be a JMP instruction, in which case what comes next need not be a valid instruction. Any bytes immediately after an unconditional jump could be data from some data table, so anything is potentially valid.

    • @randomcatdude
      @randomcatdude 11 หลายเดือนก่อน +21

      was just thinking that too
      this is all assuming an uninterrupted branchless instruction flow

    • @RGMechEx
      @RGMechEx  11 หลายเดือนก่อน +84

      This is true. I decided to leave it out of the video since it just made things more complicated. But in practice this would be a valid concern.

  • @HokoraYinphine
    @HokoraYinphine 11 หลายเดือนก่อน +79

    i was watching on data at 30 fps and the entire neutral zone at around 2:01 is completely invisible!
    I didnt even notice you were talking about that til you mentioned some of it was offscreen while zooming into seemingly nothing!
    the beginning of the video requires 60 fps to see the whole thing haha

  • @Roverd26
    @Roverd26 11 หลายเดือนก่อน +168

    I love the idea of checking which interpretation of the binary code results in the most valid/common opcodes! Reminds me of reading gene sequences, where a sequence can be interpreted 3 ways depending on where you start reading it. (DNA is made of codons, which are kind of like opcodes made out of 3 base pairs. Starting on a different base pair results in wildly different codons, and you can check which interpretation is the most likely to be valid by checking how long it takes you to run into a STOP codon.)

    • @angeldude101
      @angeldude101 11 หลายเดือนก่อน +42

      Instead of disassembling 8 digit binary groups, you get to disassemble 3 digit quaternary groups (which are effective 6-bit).
      I find it kind of funny that nature managed to come up with what's basically a "terminator byte." Whether you'd interpret it like a string's null terminator or a subroutine's return instruction, it's still pretty cool how much there is in common.

    • @tafazzi-on-discord
      @tafazzi-on-discord 11 หลายเดือนก่อน +20

      ​@@angeldude101it's more similar to a null terminator because STOP codon in prokaryotes can be followed by new start codons, so that the two proteins are always produced in equal proportions

    • @peterfireflylund
      @peterfireflylund 11 หลายเดือนก่อน +14

      I remember being taught that in high school biology. Then we asked the teacher how the cell read the right sequence: how did it choose the correct strand and how did it get the reading direction right? Turns out she didn’t understand the question. We spent a long time, maybe 15 minutes, trying to explain it to her. Then we collectively decided she was stupid :)
      (Denmark, late 80’s, no Google, no Wikipedia, no internet.)

    • @SECONDQUEST
      @SECONDQUEST 11 หลายเดือนก่อน +12

      ​@@peterfireflylund I highly doubt she didn't understand the question. She didn't have an answer because that's more the realm of physics and chemistry anyway.

    • @Sypaka
      @Sypaka 11 หลายเดือนก่อน +10

      So i am not the only one to compare DNA to computer code, where the compiler is our own body. DNA could also be a large TAR archive and the "human compiler" just scans through it until it finds the block - like a LOAD XXXX instruction.
      I even dare to say, certain blocks are AND/OR/XOR'd to form a new variance. Because if you see the Y-Chromosome, it has stuff missing in it and can't exist on it's own. THis is called Y0 and any baby with this is unable to form and dies early. I'd like to call the Y-Chromosome "a patch". It integrates, overwrites some portions and then keeps "compiling" normally as an X would. Recessive Genes could be a result of an AND/OR/XOR, thats why brown eyes for example are more dominant then blue, if you think of them as 0/1 , but they aren't. Hell, maybe call blue eyes an "else default" case, so you are left with "is_brown" or "is_green" IF checks.
      Anyway, I think it really safe to assume human DNA to be code and the base RNA found in all woman to be a key/checksum like "if remote.DNAinit not equal self.DNAinit; exit"

  • @SuperSmashDolls
    @SuperSmashDolls 11 หลายเดือนก่อน +96

    Absolutely excellent.
    I'm still wondering why Atari management was worried about game code being copied this way, though. Just dumping the ROM on the cartridge would be way easier, and people did that.

    • @thewhitefalcon8539
      @thewhitefalcon8539 11 หลายเดือนก่อน +19

      Lawyers, man...

    • @CptJistuce
      @CptJistuce 11 หลายเดือนก่อน +43

      At this time, Atari management was Time-Warner.
      Ironically, displaying the code onscreen at the beginning of 1982 would have actually afforded them STRONGER copyright protection, since the case law establishing that code on a ROM is afforded protection would only happen later that year.

    • @Jerhevon
      @Jerhevon 11 หลายเดือนก่อน +25

      @@CptJistuce Also, this was Atari that absolutely would not put game dev names in any publicly accessible credits lest their programmers get poached.

  • @stevenolson3977
    @stevenolson3977 11 หลายเดือนก่อน +29

    Oh man....that bit at the end about the code that draws the neutral zone...this is a fantastic example of a "strange loop" as defined by Tom7

    • @nsf001-3
      @nsf001-3 11 หลายเดือนก่อน +1

      Eatin' boots since 1982

  • @jamesburnett3585
    @jamesburnett3585 10 หลายเดือนก่อน +11

    Holy shit. My phone auto set it to 480p 30fps and I couldn't see the neutral zone at all lmao. It took till you explained how it worked that I went back and switched it to 60 fps.

  • @DiThi
    @DiThi 11 หลายเดือนก่อน +81

    I heavily suspect that the fact that only half of the rows were drawn was pure coincidence, and the guy didn't realize his reversal method mapped it to the same bytes.

  • @AB-Prince
    @AB-Prince 11 หลายเดือนก่อน +120

    I would say that although it's more or less impossible to unscramble the code from the color blocks, the fact that you can more or less reverse engineer the code that displays the neutral field from looking at the graphics, I would say, technically counts as extracting code from the neutral field graphics, albeit not the code that is hidden in the field. considering that also just by chance, the code to draw the field ends up becoming field is rather fitting to the goal of unscrambling the code.

    • @Nikola_M
      @Nikola_M 11 หลายเดือนก่อน +14

      I'd say that "fitting" would be a better word than "ironic" in the last sentence

    • @AB-Prince
      @AB-Prince 11 หลายเดือนก่อน +11

      @@Nikola_M thanks, english is my first language but I suck at properly conveying information. fixed it.

  • @ExpoM3rker
    @ExpoM3rker 6 หลายเดือนก่อน +6

    Whoever did these captions need a raise, using colors is something I don’t see a lot do. They even move it too!

  • @dirkkrohn1907
    @dirkkrohn1907 11 หลายเดือนก่อน +55

    This was one of the 2600 games that I had back in the day. Thanks for the memories, and happy holidays to you and your family.

  • @dogg-paws
    @dogg-paws 11 หลายเดือนก่อน +27

    It's amazing with what developers can do with such a limited piece of hardware. Thanks for the video!

  • @bitblit
    @bitblit 11 หลายเดือนก่อน +48

    A small change in the ROM should allow for the neutral zone to be rendered every frame whilst the quotile shield is never rendered, giving us access to all of the data in the ROM minus the least significant bit. If the Atari had the equivalent of a game genie the branch instruction could be changed to always draw the neutral zone.
    Building off of this if you run this in an emulator and change address $FAF3 from 0x9003 (bcc $FAF8) to 0x3A3A (NOP x2) then the game will draw the neutral zone every frame and every piece of code can be seen.

  • @jogloran
    @jogloran 11 หลายเดือนก่อน +92

    These skills are going to be real useful for hardware archaeology, when we recover damaged firmware developed centuries in the past and need to get them working again.

    • @CptJistuce
      @CptJistuce 11 หลายเดือนก่อน +30

      Eh, just splice frog DNA in over the missing parts. What could go wrong?

    • @PopeGoliath
      @PopeGoliath 11 หลายเดือนก่อน +20

      Instructions unclear. Lilypad stuck in ceiling fan.

    • @lavacat720
      @lavacat720 11 หลายเดือนก่อน +19

      ​@@CptJistuceinstructions unclear: my router is going ribbet ribbet and catching flies

    • @CovenantAgentLazarus
      @CovenantAgentLazarus 7 หลายเดือนก่อน

      Instructions Unclear: my di%# is in my throat

    • @sjfs231
      @sjfs231 3 หลายเดือนก่อน

      with modern data keeping tech this is unlikely to happen without some sort of societal collapse, and at that point I don't think youtube would still be around.

  • @CmdRolled
    @CmdRolled 5 หลายเดือนก่อน +2

    I was working on an NES emulator and you having motivation to explain all the assembly instructions refilled my motivation to emulate running assembly

  • @aner_bda
    @aner_bda 11 หลายเดือนก่อน +6

    I remember playing this game as a young kid, maybe about 6 or 7. I had no clue what I was doing, or how to play it. But I still do have distinct memories of it.

    • @stevethepocket
      @stevethepocket 11 หลายเดือนก่อน +2

      This was definitely one of those games you didn't want to throw out the manual for. One great thing about the switch to discs is that people finally started holding on to the packaging for their games, since storing discs without their cases is much more of a pain. I was lucky enough to end up with not just the manual for this one, but the little comic book that explains the backstory in more detail. I still don't know if that came with the game or was something you had to buy separately or order from the back of a cereal box or whatever.

  • @stevethepocket
    @stevethepocket 11 หลายเดือนก่อน +35

    It took me forever to remember what other game you already covered that grabbed a chunk of its own code as a substitute for pseudorandom data. It was _Pac-Man_ using it to determine random directions to move at intersections. I wonder how many other games over the years have used that trick in one way or another.

    • @williamdrum9899
      @williamdrum9899 11 หลายเดือนก่อน +10

      I imagine anything that had a TV static effect was doing it. Nowadays you get a segfault if you tried this

    • @nikkiofthevalley
      @nikkiofthevalley 8 หลายเดือนก่อน +3

      ​​@@williamdrum9899Yep, because modern CPUs don't let you read random memory for security reasons. It'll let you read your own memory, of course, but you're pretty likely to end up reading invalid memory if you're trying to do something like this.

  • @Lin_The_Cat_
    @Lin_The_Cat_ 10 หลายเดือนก่อน +5

    Omg that transition from the analogue TV static-y shot of the win screen to the crisp digital emulated shot of the win screen at 1:36 was brilliant.

  • @ozziegerff
    @ozziegerff 11 หลายเดือนก่อน +247

    "Challenge Accepted"

    • @brinleyhamer729
      @brinleyhamer729 11 หลายเดือนก่อน +4

      You first

    • @TheRedCap
      @TheRedCap 11 หลายเดือนก่อน +5

      "Challenge Accepted"
      >40 minutes in the video
      hell yeah

    • @Monkeymario.
      @Monkeymario. 4 หลายเดือนก่อน

      e

  • @mozzapple
    @mozzapple 8 หลายเดือนก่อน +5

    At first I was extremely confused because I couldn't see the neutral zone at all, but when the section about the flickering started, I realized I just needed to up the quality to 60fps

    • @IAmOneAnt
      @IAmOneAnt 8 หลายเดือนก่อน

      Woah! Rad.

  • @AutodidacticPhd
    @AutodidacticPhd 11 หลายเดือนก่อน +19

    With regard to your closing comment, I suspect we could further surmise that anyone who did have the time and experience needed to deduce the code from the neutral zone could probably write their own (UX identical) version of the game from scratch in less time than it would take to untangle that mess and fill in the blanks accurately.

  • @TheWarmotor
    @TheWarmotor 11 หลายเดือนก่อน +18

    Never thought about using the second bit as a mask in XOR instructions. I typically use XOR instructions to zero out large blocks of registers in one instruction by making my bit matrix both of the input fields as well as the output field. The instruction set allows 125 registers at a time, allowing me to zero out (up to) all 125 in one very fast instruction. This is for low level code on dedicated microcontrollers for industrial automation, where every byte and clock cycle count. Next time I'm working on a large bit matrix, I'll probably look at it a little differently :)

    • @canebro1
      @canebro1 11 หลายเดือนก่อน

      That is funny. My last job I remember seeing a macro for an efficient memset to 0, but never looked at the assembly behind it. Now I wonder if it used XOR or not.

    • @nikolthomas2544
      @nikolthomas2544 11 หลายเดือนก่อน +6

      @@canebro1
      Probably. Most CPUs have one or more versions of' a "XOR 'thing' with itself" instruction which is generally the most efficient way to set 'thing' to zero.

  • @micheleporcu2287
    @micheleporcu2287 22 วันที่ผ่านมา

    Somebody PLEASE give a price to this guy. The channel is AWESOME, the in depth analysis are always thorough and spot on. 10/10.

  • @SteveNeubauer
    @SteveNeubauer 11 หลายเดือนก่อน +6

    I love the premise of this video!
    I used to play Yars' Revenge like crazy in the Atari days, and I think I was vaguely aware of the trivia of the neutral zone sometime recently, AND I am fascinated by your videos. This video is for *me* so thank you for it!

  • @Chrisuan
    @Chrisuan 11 หลายเดือนก่อน +15

    Absolutely beautiful video, please never stop making them

  • @maxinealexander9709
    @maxinealexander9709 11 หลายเดือนก่อน +2

    I really appreciate that the subtitles were actually good, and adjusted position when needed based on screen contents. Thank you!

  • @craftersshaft
    @craftersshaft 11 หลายเดือนก่อน +17

    i think the neutral zone would be a great teacher, they never dwell on the least significant bits

    • @nsf001-3
      @nsf001-3 11 หลายเดือนก่อน +3

      I *C* what you did there
      (It's assembly but bear with me)

    • @wolfetteplays8894
      @wolfetteplays8894 11 หลายเดือนก่อน

      Nice pfp

    • @nameless......................
      @nameless...................... 10 หลายเดือนก่อน +1

      @@nsf001-3 on the topic of characters being used, i □ unicode

  • @KeviRun
    @KeviRun 11 หลายเดือนก่อน +10

    This is definitely high on the list of the best videos that you have made! Technically detailed but also easy enough to follow along with.
    There may be an opportunity for me to meet HSW at a future event and if I do, I will be sure to ask if he has seen this video/ recommend it to him, and ask his opinion of your methodology to dissect the game; and I will be sure to pass along what he says in DM if it happens.
    Thanks for all of the great content!

  • @jchadwick4918
    @jchadwick4918 11 หลายเดือนก่อน +2

    The fact that you managed to unpack that much of the code using only understanding of assembly op codes, operation lengths and bit masking is… awesome. Same vibes as archaeologists trying to decrypt worn away texts from millennia past.
    You never cease to amaze.

  • @codingidiot6754
    @codingidiot6754 7 หลายเดือนก่อน +2

    absolutely incredible video, couldnt stop watching. I dont even know anything about machine code or assembly at all but this had me hooked. Sad that it seems impossible to fully decode, but getting that far in the first place is arguably cool enough. And dont even get me started on the editing. Definitely one of the highest quality channels about cool niche coding stuff out there, dont stop doing what you're doing.

  • @sa3270
    @sa3270 11 หลายเดือนก่อน +6

    Atari put out a magazine called Atari Age back in the 80s, and sometimes they would include some high-level technical explanations related to their hardware and games, and I could swear that they mentioned once that the Neutral Zone in Yar's Revenge was based on the game's code.

  • @larswadefalk6423
    @larswadefalk6423 10 หลายเดือนก่อน +4

    Worst mindf*ck I've seen in a long time. Oh man, the patience and tolerance to just move forward is just amazing. Total awe. Thanks.

  • @ElliLavender
    @ElliLavender 10 หลายเดือนก่อน +1

    I only understood like half of this, but you explained it so well, that I still feel like I've got a grasp on everything solid enough to leave the video satisfyied. Thank you, that was really interesting!

  • @aceae4210
    @aceae4210 11 หลายเดือนก่อน +4

    the subtitles for this video are very well done, thanks for having them

  • @metalpachuramon
    @metalpachuramon 10 หลายเดือนก่อน +1

    Well, what else can I say that everyone else hasn't said but kudos! This is the kind of rabbit hole that I like diving into, it's so refreshing seeing some true software and hardware engineering in action!

  • @Longuncattr
    @Longuncattr 11 หลายเดือนก่อน +4

    34:18 It's not true that $9Exx is a "garbage" location, it would just be a mirror of something (in this case, a ROM address), since the 6507 variant of the 6502 has only 13 address lines but still computes 16-bit addresses internally. Now of course Yars' Revenge is a plain old 4K cartridge with no extra RAM, so storing to an address with A12 set truly is nonsense for this game, but it's worth mentioning. Plus, some particularly advanced bankswitch schemes do interesting things in exploiting the various sorts of incomplete address decoding that the VCS has.
    Very cool video!

  • @nickwallette6201
    @nickwallette6201 11 หลายเดือนก่อน +7

    This all sounds like EXACTLY the argument that inspires things like HDCP. If that were a possibility in the 80s, Atari may have demanded the game use an encrypted channel to the TV. Pirates would then simply dump the ROM, grabbing every byte, in order, with no obfuscation or masked bits. But, gamers would have to upgrade their TVs, VCRs, and switch boxes to avoid scrambled video.
    Or maybe I'm just bitter that I can't get my Mac Mini desktop to show up through an HDMI KVM, HDMI Matrix, and HDMI to DisplayPort adapter without disconnecting the cable two or three times every morning. Because god forbid I vid-cap my Outlook window and share it on the Internet...

    • @canaconn2388
      @canaconn2388 3 หลายเดือนก่อน +1

      mac user, point and laugh

  • @ZeroHourProductions407
    @ZeroHourProductions407 11 หลายเดือนก่อน +13

    Imagine making your source code the template for game mechanics. This game was before my time, but that is a madness i can admire!

    • @gordontaylor2815
      @gordontaylor2815 11 หลายเดือนก่อน +3

      If you've watched the "racing the beam" episode, you'll understand that the devs back in the day had to be a little bit mad to be doing this kind of thing. This is why you'll often see them affectionately called terms like "wizard" and "magician" on fan forums; it's a tongue-in-cheek way of describing what they are. :)

    • @canebro1
      @canebro1 11 หลายเดือนก่อน

      They essentially need to create random numbers, so what better way than just randomly grabbing from your source code? You know it will be sequence of non-zero numbers, and as long as you do a little fiddling it is essentially unreadable. Plus, as he said at the end, anyone willing to actually decode it probably deserves it, and should probably be hired.

    • @CptJistuce
      @CptJistuce 11 หลายเดือนก่อน +3

      There's a lot of crazy going on in VCS coding. When you have 4Kbytes of ROM, 128 bytes of RAM, and a CPU that almost has to draw the image on the TV in real-time... you get creative in terrifying ways.

  • @roastinNAVY
    @roastinNAVY 8 หลายเดือนก่อน

    Currently going to school for electrical engineering technology and covering microprocessors right now, so this is pretty cool. As an avid player of this in my '90s childhood, because I got it as a hand-me-down from my Aunt/Uncle, that's also a huge plus.

  • @c00lcar5
    @c00lcar5 3 หลายเดือนก่อน

    10:19 what you did with the captions here was so genius I almost didn't even notice that they were in a different spot. My eyes moved to the graph and so did the captions. Incredible

  • @mattrodriguez1712
    @mattrodriguez1712 11 หลายเดือนก่อน +5

    Amazing video. I hadn’t thought about Yar’s Revenge since I was a kid. I loved that game and this is incredibly interesting.

  • @obscurity3027
    @obscurity3027 9 หลายเดือนก่อน +1

    Yars Revenge was the game that got me hooked on video games when I was 6 years old. I’ve never looked back.

  • @NinF37
    @NinF37 11 หลายเดือนก่อน +1

    Absolutely fantastic video as usual! As someone who doesn’t touch code, and doesn’t know assembly, this was still super easy to follow. Extra kudos for the captions, which move out of the way when it would normally block something! ❤

  • @theantipope4354
    @theantipope4354 10 หลายเดือนก่อน +1

    Truly a lovely piece of reverse-engineering analysis, & it brought back a lot of memories! I never worked on Atari 2600 code, but I did work on lots of code for other 6502 based machines of that era. Thanks for the excellent work.

  • @matthewmangan6251
    @matthewmangan6251 11 หลายเดือนก่อน +1

    4:00 to 6:00 is some of the most awesome analysis I’ve ever seen

  • @gtabro1337
    @gtabro1337 11 หลายเดือนก่อน +58

    Bro really put the inner workings of the game on literal display

    • @Tuxfanturnip
      @Tuxfanturnip 11 หลายเดือนก่อน +16

      why write code to generate a random-looking bit pattern when you already have one on the ROM?

    • @CptJistuce
      @CptJistuce 11 หลายเดือนก่อน +8

      ​@@TuxfanturnipFlashbacks to the Pac-Man RNG.

  • @agvulpine
    @agvulpine 11 หลายเดือนก่อน +1

    This is the type of data forensics that wins million dollar jury verdicts. You should spend all of your energies on becoming a highly sought after (and well paid) expert witness in your field. This presentation alone has the court convinced beyond a reasonable doubt.

  • @ElTaitronAnim
    @ElTaitronAnim 10 หลายเดือนก่อน

    Amazing work! And the ingenuity of old-school programmers like this is really impressive too.

  • @whamer100
    @whamer100 11 หลายเดือนก่อน +1

    this is by far one of the coolest videos ive seen in a long time

  • @avhoward537
    @avhoward537 8 หลายเดือนก่อน +1

    they did a similar effect in Metroid Prime! there is a a static effect that happens around a certain enemy, but they didn’t want to use a big static texture because of the limited RAM space. instead of making a high resolution animated texture, they displayed the game’s code instead!

  • @ZTenski
    @ZTenski 10 หลายเดือนก่อน +1

    Lol, I was watching this at 480p60 and had 0 clue what you were on about until you slowed it down and showed the switching frames.

  • @Richie086
    @Richie086 10 หลายเดือนก่อน

    Wow you are one smart dude! Glad people like you exist and are willing to explain how this works to the rest of us.

  • @lorensims4846
    @lorensims4846 9 หลายเดือนก่อน +1

    Wheee! This was fun!
    Yeah, I can see how some kid playing Yar's Revenge could get excited upon learning that the source for the game was being used to draw the Neutral Zone. But I agree. In the early '80s there really wouldn't be a practical way to decipher that code even to the extent you were able to.
    This all takes me back to when I learned everything I ever needed to know about computer science on my Atari 800.
    I really appreciate that text you used for your displays. It looks like a real small font from back in the day. It looks great!
    Atari 8K BASIC was so slow that we were practically forced to use 6502 Assembly Language pretty quickly.
    I never had an Atari VCS (2600), I saw computer games as graphics demos for me to figure out how they were done. That "Neutral Zone" looks like the kind of noise I often saw to represent energy fields in the better games. It's not at all surprising that the most convenient source of "noise" would be the machine code.

  • @knightsofthebedrock
    @knightsofthebedrock 11 หลายเดือนก่อน

    I never have any clue what you’re talking about but I watch every video you make. Thanks for the great content!

  • @StormyBuckets
    @StormyBuckets 11 หลายเดือนก่อน

    the content of your videos tends to go straight over my head, but it's still so fun to listen to!

  • @unnamed82979
    @unnamed82979 11 หลายเดือนก่อน +1

    This is video is amazing. Love the amount of effort you put into it. Great visuals, great explanations, great everything. 10/10
    I don't know how I missed out on this TH-cam channel. But I pulled out my phone on which I am signed in and dropped a like and sub.

  • @SkyanUltra
    @SkyanUltra 11 หลายเดือนก่อน +1

    this is really cool! honestly i would love a whole video on the process of reverse engineering the code from games. i always wondered how people managed to crack the code for Super Mario 64, OoT, and Paper Mario 64

  • @NicolasGasnier
    @NicolasGasnier 10 หลายเดือนก่อน

    Impressed by the patience and deductions you put in all your videos. Well as for decoding the code that way, I can only agree with you that no one back in the days would have tried. If someone had the electronic & programming skills to understand the inner working of the console, it would have been much much easier to do a ROM dump.

  • @pseudolimao
    @pseudolimao 6 หลายเดือนก่อน

    This is fantastic. I loved my uni class on assembly code and havent really used much of the knoweldge gained, but i can confidently say it made me able to follow this video, and able to understand the monumental effort you put into it. Good job!

  • @b4ttlemast0r
    @b4ttlemast0r 3 หลายเดือนก่อน

    Yet another way to conceptualise the XOR operator is that it's the "does not equal" operator; it returns 1 (true) if the two inputs aren't the same. A logic gate that is the opposite of this, returning true if the inputs are the same, is called various names such as NXOR, XNOR, XAND, but does not usually exist as a fundamental operation in assembly code afaik.

  • @BrunoValads
    @BrunoValads 11 หลายเดือนก่อน

    What an amazing research, I'm really impressed of how far you could get thru this visual reverse engineering

  • @Clancydaenlightened
    @Clancydaenlightened 11 หลายเดือนก่อน +2

    6:01 the tia chip is mostly implemented using latched polynomial counter and some shift register style logic

  • @memesalldayjack3267
    @memesalldayjack3267 10 หลายเดือนก่อน

    this was super interesting, well paced and very well animated, very good job

  • @lis6502
    @lis6502 7 หลายเดือนก่อน

    oh how i love such deep dives into obscure techniques. Especially on 6502 which thanks to von Neumann's memory architecture doesn't distinct between "program" and "data" segments. Therefore we can experience wonders such as self modifying code to save some memory or even executing some graphics data which happen to be valid machine code if read correctly.
    Leaving all that aside i am astonished by sheer amount of work put in here. Until you showed exact code drawing neutral zone i though that color might be at least missing byte's nibble. Also representation of data-code as blocks and guessing how PC would look like after it was very clever. Amazing video.

  • @phantom-chan2940
    @phantom-chan2940 11 หลายเดือนก่อน

    oh god that viewers like you thank you thing sent me back years

  • @noahwinslow3252
    @noahwinslow3252 10 หลายเดือนก่อน

    Really beautiful and well done presentation. Thank you for all the time and effort it must have taken to make this!

  • @ric8248
    @ric8248 11 หลายเดือนก่อน +11

    I believe the explosion when you kill the boss also uses the code.
    I once coded a ATARI 2600 emulator and I was baffled that whenever I took a screenshot of Yar's Revenge I could only see either the safe zone or the enemy's shield.

    • @SECONDQUEST
      @SECONDQUEST 11 หลายเดือนก่อน +2

      You coded a whole emulator and didn't know about flicker?
      Dude what.

    • @ric8248
      @ric8248 11 หลายเดือนก่อน +4

      @@SECONDQUEST Mate I can't know what techniques every game uses. In fact when you code an emulator you just create the engine. I did know though that the Pacman ghosts were render each 4th frame, because that is more notorious, but for Yar's Revenge it was once every other frame, so until you see it in action you just don't know.

  • @StephenBryant
    @StephenBryant 11 หลายเดือนก่อน

    It's amazing to see the switching in real time of the graphics while pausing the video and using , and . to go back and forth. (You go into this right after I added the comment LOL )

  • @vlasiy5550
    @vlasiy5550 11 หลายเดือนก่อน

    Thank you for that video. This is incredible how much we can say about game code, using one visual effect.
    Sorry for my English

    • @ohnoitschris
      @ohnoitschris 11 หลายเดือนก่อน

      Your English in your comment was perfect.

  • @claudiusraphael9423
    @claudiusraphael9423 11 หลายเดือนก่อน

    "Elementary, Watson." ... Nice voyage into deduction. Thx for sharing!

  • @Dedicatedtolivinginthepast
    @Dedicatedtolivinginthepast 11 หลายเดือนก่อน +1

    Well, I'm a collector of early to mid 80s video equipment so I might try recording this to VHS with a period correct VCR to see just how hard it would be to get the correct pattern written down!

    • @wolfetteplays8894
      @wolfetteplays8894 11 หลายเดือนก่อน +1

      Hello fellow analogue lover!

  • @jajoothecoolman
    @jajoothecoolman 10 หลายเดือนก่อน

    THE CAPTIONS ARE WELL MADE
    THANK YOU

  • @sesemuller4086
    @sesemuller4086 11 หลายเดือนก่อน +6

    That topic came out of nowhere! Good video though!

  • @mattshu
    @mattshu 11 หลายเดือนก่อน

    First video I’ve seen from this channel. What an amazing style you use! Unique!❤

  • @srb2er
    @srb2er 11 หลายเดือนก่อน

    NEW RGME DROPPED!! LET'S GOO!!!
    Interesting design choice of them using the code as a actual game design choice

  • @ladydelorean
    @ladydelorean 11 หลายเดือนก่อน +2

    That is a gorgeous work of art, thank you. 💞

  • @HmmmmmLemmeThinkNo
    @HmmmmmLemmeThinkNo 10 หลายเดือนก่อน +1

    "It's about to get pretty technical, and if you don't have a good grasp on assembly and machine code works, it might be a little difficult to follow." Buddy, I don't know a hardly anything about code and have been struggling to understand from the start. Don't worry about me :"D
    (The funny part is, I'm mostly following despite not knowing wtf you're saying. I think it's a result of reading extensive scientific journals despite not knowing the jargon -- I can get a feel for the discussion without knowing anything technical)

  • @zhet
    @zhet 7 หลายเดือนก่อน +1

    Fun fact, if you're watching this video in quality with fps less than 60 you will not see the neutral zone during the showcase of the gameplay.
    I didn't get what is neutral zone is first before i switched the quality

  • @dholmlund
    @dholmlund 8 หลายเดือนก่อน

    At 3:47 - I like how your frame counter numbers are coloured with player 1 and player 2 yars colors!! :D It's cool how each Yars is a different color! :)

  • @SpringySpring04
    @SpringySpring04 11 หลายเดือนก่อน +1

    So interesting to see your videos, its always a blast

  • @megamanguy
    @megamanguy 10 หลายเดือนก่อน +1

    With 2020s technology thats trivial, but in the 1980s it would be near impossible. You'd need expensive recording and video processing equipment and slow it down so the computers of the time could decode it.

  • @mr.kleen1479
    @mr.kleen1479 2 หลายเดือนก่อน

    if you watch this video in less than 720p because it'll be 30 frames instead of 60, you can't see the flashing between the neutral zone and the shield when the gameplay is at normal speed. you can only see the shield.
    at least I couldn't see the neutral zone at 30 frames. I also don't know if he mentioned that or not, but I thought it was really neat

  • @nsf001-3
    @nsf001-3 11 หลายเดือนก่อน +2

    Some dude in 1982 already figure out the answer using a piece of paper and a calculator while referencing an ASM book, and the notes have been sitting in an attic somwhere for over 40 years. It's gotta happen. Like there's probably some natty benching 1000lbs raw right now but we'll never know because they don't know Powerlifting exists. The universe is pretty weird like that

  • @Striker9
    @Striker9 10 หลายเดือนก่อน +1

    Man. It took so much longer then i care to admit to just figure out how to play yars revenge as a teenager playing my uncles old atari xD. I was an intellivision kid until i got my Genesis lol.

  • @potaxpotax
    @potaxpotax 11 หลายเดือนก่อน

    This is a work of art. And I mean both the game AND your video. Thanks.

  • @ShadyHero
    @ShadyHero 11 หลายเดือนก่อน

    1:15 this brought me back to when I was little, thank you

  • @ozzie_goat
    @ozzie_goat 11 หลายเดือนก่อน

    No idea who did your captions, but they are on point my guy

  • @AFourEyedGeek
    @AFourEyedGeek 9 หลายเดือนก่อน

    What ever this is, I want more of it, its fantastic. Great work.

  • @klaudialustig3259
    @klaudialustig3259 11 หลายเดือนก่อน

    This video was a great Christmas present!