If you appreciate the work done within the wiki, please consider supporting The Cutting Room Floor on Patreon. Thanks for all your support!

バグ:Super Mario Bros.

From The Cutting Room Floor
Jump to navigation Jump to search
This page is a translated version of the page Bugs:Super Mario Bros. and the translation is 80% complete.
Other languages:
Deutsch • ‎English • ‎español • ‎français • ‎italiano • ‎polski • ‎português do Brasil • ‎日本語 • ‎한국어

This page details bugs of Super Mario Bros..

Spiny Egg Bug

Here's how the Spiny egg's speed is calculated and stored.

DifLoop:  lda PRDiffAdjustData,y     ;3 つの値を取得して保存します
          sta $01,x                  ;to $01-$03
          iny
          iny                        ;値ごとに Y を 4 バイト増加します
          iny
          iny
          dex                        ;1つごとにXをデクリメントします
          bpl DifLoop                ;3 つすべてが書き込まれるまでループします
          ldx ObjectOffset           ;get enemy object buffer offset
          jsr PlayerLakituDiff       ;move enemy, change direction, get value - difference
          ldy Player_X_Speed         ;check player's horizontal speed
          cpy #$08
          bcs SetSpSpd               ;if moving faster than a certain amount, branch elsewhere
          tay                        ;otherwise save value in A to Y for now
          lda PseudoRandomBitReg+1,x
          and #%00000011             ;get one of the LSFR parts and save the 2 LSB
          beq UsePosv                ;branch if neither bits are set
          tya
          eor #%11111111             ;otherwise get two's compliment of Y
          tay
          iny
UsePosv:  tya                        ;put value from A in Y back to A     A=SpeedVar
SetSpSpd: jsr SmallBBox              ;set bounding box control, etc.      A=SpeedVar
          ...

これまでのところうまくいっている。 A レジスタには、適切な速度値が格納されます。

SmallBBox: lda #$09               ;set specific bounding box size control A=09
           bne SetBBox            ;unconditional branch                   A=09

おっと、境界ボックスへのジャンプ サブルーチンが A を上書きしてしまいました。これらはすべて無駄に機能します。

SetBBox:  sta Enemy_BoundBoxCtrl,x    ;set bounding box control here      A=09
          lda #$02                    ;set moving direction for left      A=02
          sta Enemy_MovingDir,x                                           A=02
InitVStf: lda #$00                    ;initialize vertical speed          A=00
          sta Enemy_Y_Speed,x         ;and movement force                 A=00
          sta Enemy_Y_MoveForce,x                                         A=00
          rts                                                             A=00

ここで、A は 00 になります。ゲームは SetSpSpd サブルーチンに戻ります...

          ...
          ldy #$02                   ;Set Y to 02 (Leftwards)             A=00
          sta Enemy_X_Speed,x        ;Set Spiny egg speed to A (00)       A=00
          cmp #$00                   ;Now check if speed is negative...   A=00
          bmi SpinyRte               ;...but A is always 00. No branch.   A=00
          dey                        ;Set Y to 01 (Rightwards)
SpinyRte: sty Enemy_MovingDir,x      ;Set moving direction.

...速度は0に設定されています。移動方向は右方向に設定されていますが、卵には水平方向の移動がなく、トゲトゲの敵がスポーンすると方向がリセットされるため、これはあまり意味がありません。

このバグを修正するには、「jsr SmallBBox」を dey'' オペコードの後に​​移動するだけです。これがこのパッチの動作です:

Download.png Download Spiny Egg Speed Patch
File: SMBSpinyEggPatch.ips (25 B) (info)


(Source: doppelganger's SMBDis)