News for hackers. Stuff that matters.
Re:Super Mario Bros warp zones were intended to work slightl... by raldi on Monday June 27, 2022 @12:25PM (#31896851)
Based on the original leaked source code, it appears they really did intend to increment the variable they did. The comment matches the name and purpose:

             BEQ      PLTMRT          ; Scrool stopping ?
    ;                                 : yes !
             LDA      PLYPS1
             AND      <PLYPS0
             BNE      PLTMRT          ; Player Y pos = 0 ?
    ;
             STA      SRSTFG          ; yes !
             INC      CMSLFG          ; Chimney  select flag
Re:Super Mario Bros warp zones were intended to work slightl... by NobodyNada on Monday June 27, 2022 @06:10PM (#31901514)
The buggy AND is really interesting to me -- the comment suggests that maybe the programmer meant to use an ORA instead, which would have been a clever way to check if both bytes of the Y position were zero. But that's still not something that makes sense to check, right? Assuming I'm understanding the video right, that'd only unlock the scroll if Mario was way up above the top of the screen...
Re:Super Mario Bros warp zones were intended to work slightl... by raldi on Monday June 27, 2022 @06:23PM (#31901667)
I believe the NES's 6502 didn't have a logical-OR operator (which is what the situation calls for), only bitwise. The apparent goal was to find out, "Are either PLYPS0 or PLYPS1 equal to 0?"

They probably started with ORA, and when that didn't work, tried AND, and that seemed to work, so they went with it.

Re:Super Mario Bros warp zones were intended to work slightl... by NobodyNada on Monday June 27, 2022 @06:40PM (#31901847)
Ohhh, that makes sense. Thanks!