tomoha

SMW In the 6 ACE Multitap Route Technical Explanation

Dec 27th, 2021
661
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.96 KB | None | 0 0
  1. SMW In the 6 ACE Technical Explanation
  2. by tomoha
  3.  
  4. This is a technical explanation of how the arbitrary code execution works in the multitap In the 6 route.
  5.  
  6. First, I’ll explain what is our goal in In the 6 ACE.
  7.  
  8. All levels are managed by hex numbers like 01.
  9. After now, we’ll call it ‘level number’.
  10.  
  11. So, contained a level number in specific RAM address decides where to exit when we enter the pipes.
  12. $19B8 in the length of 32 bytes are ‘exit table’.
  13.  
  14. According to SMWCentral,
  15.  
  16. This connects doors and exit-enabled pipes to their correct entrances. The index for this exit table is the position of the exit (relative to layer 1) divided by 256. If layer 1 is vertical, then use the Y position of the exit, else use the X position. This is also known as the current screen number.
  17.  
  18. The exit of blue pipe in YI2 is managed by $19C7.
  19. And the level number of our destination, Bowser’s castle’s second floor, is $D0.
  20. Therefore, our goal is to contain $D0 in $19C7.
  21.  
  22. The route with one additional controller plugged into port2 invented by 333Rich333 and MostlySMW firstly goes to YI1 and drop a power up mushroom twice to store $C7 in $EE and $19 in $EF because the number of red koopas at the beginning of YI2 is not enough to write codes to load $D0 in a resister, store it in $19C7 and avoid returning to openbus.
  23. The following are instructions executed in the one additional controller route.
  24.  
  25. ORA ($01,X)
  26. ORA [$17],Y
  27. JSR ($19FC,X)
  28. BRA $F0
  29. JMP ($1820,X)
  30. JMP $421A
  31. JSR $00E5
  32. LDA #$D0
  33. STA ($EE)
  34. JMP $EF87
  35.  
  36. Instructions from LDA #$D0 to JMP $EF87 are written in shell-code (A9 D0; 92 EE; 4C 87 EF).
  37. However, writing LDY instruction on the controller plugged into port2 slot1 enables us to omit YI1 as we do not have to write LDA #$D0 in shell-code.
  38.  
  39. Next, I’ll talk about the new route and its technical explanation.
  40. However, everything is the same as RLX shell code credits warp invented by SethBling until we reach $421A, multitap resisters.
  41. So, I’ll omit the explanations about instructions before $421A and ask you to read his explanation in a reference list at bottom.
  42.  
  43. $421A and $421B are port 2 slot 1, which is pressing A, L, B, Y and Start.
  44. Then, $421A is $A0 and $421B is $D0, which means LDY #$D0 (A0 D0).
  45.  
  46. $421C and $421D are port 1 slot 2, which is pressing L, Select, Y, B, Down and Right.
  47. Then, $421C is $20 and $421D is $E5.
  48. Since we do not plug anything into port 2 slot 2, $421E and $421F are both $00.
  49. So, these code means JMP $0000E5 (20 E5 00 00).
  50.  
  51. Now we are at $E5 which is the sprite x-coordinate low byte table at slot #1.
  52. We spit out shell for slots #1-5:
  53. $8C, $C7, $19, $4C, $87 and $EF, which mean STY $19C7; JMP $EF87.
  54. As we stored $D0 in Y resister by controller inputs, LDY $19C7 stores $D0 into $19C7 which contains a level number of the blue pipe’s exit.
  55. Then we jump to $EF87 in order not to return to open bus, but this is explained well on SethBling’s explanation I mentioned earlier, so read it for the explanation.
  56. After all, $19C7 contains $D0, so the blue pipe now takes us to Bowser’s Castle’s second floor.
  57.  
  58. Instractions:
  59.  
  60. ORA ($01,X)
  61. ORA [$17],Y
  62. JSR ($19FC,X)
  63. BRA $F0
  64. JMP ($1820,X)
  65. JMP $421A
  66. BVS
  67. LDY #$D0
  68. JMP $0000E5
  69. STY $19C7
  70. JMP $EF87
  71.  
  72.  
  73. References
  74.  
  75. Drummerrific. (2018, April 16). Hexadecimal List of Super Mario World Levels by Drummerrific. SMW Central.
  76. https://www.smwcentral.net/?p=viewthread&t=94452&page=1&pid=1474840#p1474840
  77.  
  78. In the 6. (2018, August 26). In Super Mario World Wiki.
  79. https://smwspeedruns.com/index.php?title=In_the_6&oldid=2853
  80.  
  81. MostlySMW. (2017, December 22). In the 6 ACE route. PASTEBIN.
  82. https://pastebin.com/yQnfdUhy
  83.  
  84. SethBling. (2016, April 9). RLX Credits Warp Technical Explanation. PASTEBIN.
  85. https://pastebin.com/t17QxjvX
  86.  
  87. SMW Central. (n.d.). SMW Memory Map. SMW Central.
  88. https://www.smwcentral.net/?p=memorymap&game=smw&region=ram
  89.  
  90. 改造ドンキーの館. (n.d.). 65C816命令表.
  91. https://donkeyhacks.zouri.jp/databank/65C816/65c816.html
Add Comment
Please, Sign In to add comment