Advertisement
Guest User

Untitled

a guest
Jul 24th, 2016
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.05 KB | None | 0 0
  1. !Coinsneeded = $05 ; Number of coins necessary to collect.
  2. !Count = $191F ; RAM address for tracking how many you've collected.
  3. !AllGot = $1F2F ; 12-byte table for tracking levels you've collected all coins in.
  4.  
  5. print "A coin that gives Mario a power-up or 1-up when he collects ", dec(!Coinsneeded), "."
  6.  
  7. db $42
  8.  
  9. JMP Mario : JMP Mario : JMP Mario : JMP Return : JMP Return : JMP Return : JMP Return
  10. JMP Mario : JMP Mario : JMP Mario
  11.  
  12. Mario:
  13. JSR SetItemMemory
  14. LDY #$00 ;act like tile 2C (So mario collects it like a coin)
  15. LDA #$2C
  16. STA $1693
  17. INC !Count
  18. LDA !Count
  19. CMP #!Coinsneeded
  20. BEQ AllCollected
  21. Return:
  22. RTL
  23.  
  24.  
  25. AllCollected:
  26. PHY
  27. LDA.w $13BF ;\
  28. LSR ;|
  29. LSR ;|
  30. LSR ;|
  31. TAY ;|
  32. LDA.w $13BF ;| Set all collected bit
  33. AND.b #$07 ;|
  34. TAX ;|
  35. LDA.l $05B35B,X ;|
  36. TYX ;|
  37. ORA !AllGot,X ;|
  38. STA !AllGot,X ;/
  39. PLY
  40.  
  41. STZ !Count
  42. LDA $19
  43. CMP #$00
  44. BEQ Smallmario
  45. CMP #$01
  46. BEQ SuperMario
  47. PHY
  48. JSL $00F388 ; give 1up
  49. PLY
  50. RTL
  51.  
  52. Smallmario: ; make big
  53. LDA #$3E
  54. STA $1DFC
  55. LDA #$02
  56. STA $71
  57. LDA #$2F
  58. STA $1496
  59. STA $9D
  60. LDA #$0A
  61. STA $1DF9
  62. RTL
  63.  
  64. SuperMario: ; make fire
  65. LDA #$3E
  66. STA $1DFC
  67. LDA #$20
  68. STA $149B
  69. STA $9D
  70. LDA #$04
  71. STA $71
  72. LDA #$03
  73. STA $19
  74. LDA #$0A
  75. STA $1DF9
  76. RTL
  77.  
  78.  
  79.  
  80. SetItemMemory:
  81. REP #$30
  82. LDA $9A
  83. AND.w #$FF00
  84. LSR
  85. LSR
  86. LSR
  87. LSR
  88. LSR
  89. LSR
  90. STA $04
  91. LDA $9A
  92. AND.w #$0080
  93. LSR
  94. LSR
  95. LSR
  96. LSR
  97. LSR
  98. LSR
  99. LSR
  100. ORA $04
  101. STA $04
  102. LDA $98
  103. AND.w #$0100
  104. BEQ CODE_00C03A
  105. LDA $04
  106. ORA.w #$0002
  107. STA $04
  108. CODE_00C03A:
  109. LDA.w $13BE
  110. AND.w #$000F
  111. ASL
  112. TAX
  113. LDA.l $00BFFF,X
  114. CLC
  115. ADC $04
  116. STA $04
  117. TAY
  118. LDA $9A
  119. AND.w #$0070
  120. LSR
  121. LSR
  122. LSR
  123. LSR
  124. TAX
  125. SEP #$20
  126. LDA.w $19F8,Y
  127. ORA.l $00C005,X
  128. STA.w $19F8,Y
  129. SEP #$10
  130. RTS
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement