Advertisement
Telinc1

Scrambled patch for SMW

Nov 30th, 2011
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. header
  2. lorom
  3.  
  4. !RATS = End-Start  ;Define the RATS tag
  5.  
  6. org $258000  ;Point this to some freespace, if you don't want the Blank Screen of Death™.
  7.  
  8. Start:  ;Start of the RATS tag
  9.  
  10. DEC $0DBE  ;Prevent Mario from getting a 1-UP after 100 coins are collected.
  11. JMP CoinChecker
  12.  
  13. CoinChecker:
  14. LDA $DBF  ;Load Mario's coins in the Accumulator.
  15. CMP #$64  ;Check if the value in A is 100
  16. BEQ GivePowerup  ;If so, then jump to GivePowerup
  17.  
  18. GivePowerup:
  19. LDA $19  ;Load Mario's powerup in A.
  20. CMP #$00  ;If Mario has nothing, then...
  21. BEQ Mushroom  ;Jump to Mushroom
  22. CMP #$01  ;If Mario has a Mushroom, then...
  23. BEQ Flower  ;Jump to Flower
  24. CMP #$03  ;If Mario has a Flower, then...
  25. BEQ Cape  ;Jump to Cape
  26. CMP #$02  ;If Mario has a cape, then...
  27. BEQ Star  ;Jump to Star
  28. JMP CoinChecker
  29.  
  30. Mushroom:
  31. LDA #$01  ;Load 01 into A
  32. STA $19  ;Load 01 into RAM Address 19
  33. LDA $0DBF  ;|
  34. SEC        ; \  Decrease Mario's coins by 100
  35. SBC #$64   ; /  Taken from all.log
  36. STA $0DBF  ;|
  37. JMP CoinChecker
  38.  
  39. Flower:
  40. LDA #$03  ;Load 03 into A
  41. STA $19  ;Load 03 into RAM Address 19
  42. LDA $0DBF  ;|
  43. SEC        ; \  Decrease Mario's coins by 100
  44. SBC #$64   ; /  Taken from all.log
  45. STA $0DBF  ;|
  46. JMP CoinChecker
  47.  
  48. Cape:
  49. LDA #$02  ;Load 02 into A
  50. STA $19  ;Load 02 into RAM Address 19
  51. LDA $0DBF  ;|
  52. SEC        ; \  Decrease Mario's coins by 100
  53. SBC #$64   ; /  Taken from all.log
  54. STA $0DBF  ;|
  55. JMP CoinChecker
  56.  
  57. Star:
  58. LDA #$F  ;Load 15 into A
  59. STA $1490  ;Load 15 into RAM Address 1490
  60. LDA $0DBF  ;|
  61. SEC        ; \  Decrease Mario's coins by 100
  62. SBC #$64   ; /  Taken from all.log
  63. STA $0DBF  ;|
  64. JMP CoinChecker
  65.  
  66. End:  ;End of RATS tag
  67.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement