Advertisement
Guest User

6-digit Coin Counter incompatible con AMK.

a guest
Nov 28th, 2014
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.42 KB | None | 0 0
  1. header
  2. lorom
  3.  
  4. ;===============================================;
  5. ;POINT THIS TO FREE SPACE!!!!!!!!!!!!! - Applied;
  6. ;===============================================;
  7.  
  8. !RAM_DecCoins = $7F969E ;
  9. !ShowZeroes = $00 ; 00 - don't show leading zeroes, anything else - show them
  10.  
  11. org $10EBF5 ; <--- POINT TO FREESPACE!! REPLACE XXXXXX WITH SNES ADDRESS.
  12.  
  13. !RatsTag = RoutineEnd-RoutineStart ; RATS TAG.
  14.  
  15. db "STAR" ; DON'T REMOVE
  16. dw !RatsTag-$01 ; THIS IF YOU WANT
  17. dw !RatsTag-$01^$FFFF ; TO PROTECT THIS DATA.
  18.  
  19. RoutineStart: ; Don't remove label
  20.  
  21. LDA !RAM_DecCoins
  22. BEQ EndDec
  23. LDA $0F34
  24. ORA $0F35
  25. ORA $0F36
  26. BEQ EndDec
  27. REP #$20
  28. LDA !RAM_DecCoins
  29. DEC
  30. STA !RAM_DecCoins
  31. SEP #$20
  32. LDA #$FF
  33. DEC $0F34
  34. CMP $0F34
  35. BNE EndDec
  36. DEC $0F35
  37. CMP $0F35
  38. BNE EndDec
  39. DEC $0F36
  40.  
  41. EndDec:
  42. LDA $13CC
  43. BEQ NoInc
  44.  
  45. IncCoins:
  46. DEC $13CC
  47. LDA #$FF
  48. CMP $0F34
  49. BNE NotMaxedOut
  50. CMP $0F35
  51. BNE NotMaxedOut
  52. CMP $0F36
  53. BNE NotMaxedOut
  54. STZ $13CC
  55. BRA EndInc
  56.  
  57. NotMaxedOut:
  58. INC $0F34 ; $0F34 = Lowest 256 values.
  59. BNE EndInc
  60. INC $0F35 ; $0F35 = Lowest 65536 values.
  61. BNE EndInc
  62. INC $0F36 ; $0F36 = All 1000000 values
  63. EndInc:
  64. LDA $00
  65. JML $008F32
  66.  
  67. NoInc:
  68. JML $008F3B
  69.  
  70. ZeroDec:
  71. STA $7F8000
  72. LDA #$0000
  73. STA !RAM_DecCoins
  74. RTL
  75.  
  76. SaveSRAMRoutine:
  77. JSR GetSaveFile
  78.  
  79. LoadScoreData:
  80.  
  81. LDA $0F34,y ; Transfer coin counter data over...
  82. STA $70079F,x ; to SRAM data. ($7007FD - $7007FF)
  83. INX
  84. INY
  85. CPY #32
  86. BCC LoadScoreData
  87. LDX $010A
  88. LDA $009CCB,x
  89. RTL
  90.  
  91. LoadSRAMRoutine:
  92.  
  93. PHX
  94. PHY
  95. SEP #$10
  96. JSR GetSaveFile
  97.  
  98. LoadSRAMData:
  99.  
  100. LDA $70079F,x ; Transfer SRAM data...
  101. STA $0F34,y ; over to coin counter data.
  102. INX
  103. INY
  104. CPY #32
  105. BCC LoadSRAMData
  106. REP #$10
  107. PLY
  108. PLX
  109. LDA $700000,x
  110. RTL
  111.  
  112. GetSaveFile:
  113. LDA $010A
  114. ASL
  115. ASL
  116. ASL
  117. ASL
  118. ASL
  119. TAX
  120. LDY #0
  121. RTS
  122.  
  123. ZeroCoins:
  124.  
  125. LDA #!ShowZeroes
  126. BNE PutZero
  127.  
  128. LDA #$FC ; hijacked routine
  129. STA $0F29,x
  130.  
  131. LDA $0F34
  132. ORA $0F35
  133. ORA $0F36 ; if you have 0 coins...
  134. BNE DontStoreZero ; put "0" on the status bar
  135. STZ $0F2E ; 0 for the first digit
  136. DontStoreZero:
  137. RTL
  138.  
  139. PutZero:
  140. STZ $0F29,x
  141. RTL
  142.  
  143. RoutineEnd: ; Don't remove label
  144.  
  145. ;=====================================;
  146. ; Values that edit status bar & score.;
  147. ;=====================================;
  148.  
  149. org $008CB2
  150.  
  151. db $3C ; \
  152. db $FC ; |
  153. db $38 ; |
  154. db $FC ; |
  155. db $38 ; |
  156. db $FC ; |
  157. db $20 ; | Tilemap in status bar.
  158. db $FC ; |
  159. db $20 ; |
  160. db $FC ; |
  161. db $38 ; |
  162. db $FC ; |
  163. db $38 ; |
  164. db $FC ; |
  165. db $20 ; /
  166.  
  167. org $008CE7
  168.  
  169. db $2E ; \ Change $FC to $2E if you want the coin sign in front.
  170. db $3C ; |
  171. db $00 ; |
  172. db $38 ; |
  173. db $00 ; |
  174. db $38 ; | More tilemap data.
  175. db $00 ; |
  176. db $38 ; |
  177. db $00 ; |
  178. db $38 ; |
  179. db $00 ; |
  180. db $38 ; |
  181. db $00 ; |
  182. db $38 ; |
  183. db $FC ; |
  184. db $3C ; /
  185.  
  186. org $008EE5
  187.  
  188. JSL ZeroCoins
  189. NOP
  190.  
  191. org $00802A
  192. JSL ZeroDec
  193.  
  194. ;STZ $0F29,x ; <--
  195.  
  196. org $008F1D
  197.  
  198. JML RoutineStart
  199. LDA $00
  200. BRA CycleSkip ;\ Skip for reducing cycles
  201. NOP ; |
  202. NOP ; | Useless
  203. NOP ; |
  204. NOP ;/
  205.  
  206. CycleSkip:
  207.  
  208. org $008F7E
  209.  
  210. BRA Skip ; \ Skip to save cycles.
  211. NOP ; |
  212. NOP ; |
  213. NOP ; |
  214. NOP ; / There isn't written to coin total.
  215. Skip:
  216.  
  217. org $009BCC
  218.  
  219. JSL SaveSRAMRoutine ; Save data to SRAM!
  220. NOP
  221. NOP
  222.  
  223. org $009D14
  224.  
  225. JSL LoadSRAMRoutine ; Load data from SRAM!
  226.  
  227. org $009E4E
  228.  
  229. NOP ; Remove the first ; if you...
  230. NOP ; want to disable the score being...
  231. NOP ; deleted when getting to the Game Over screen.
  232.  
  233. org $009E56
  234.  
  235. NOP ; Remove the first ; if you...
  236. NOP ; want to disable the score being...
  237. NOP ; deleted when getting to the Game Over screen.
  238.  
  239. org $028766
  240.  
  241. NOP ; \
  242. NOP ; | Disable score
  243. NOP ; /
  244.  
  245. org $028770
  246.  
  247. NOP ; \
  248. NOP ; | Disable score
  249. NOP ; /
  250.  
  251. org $02AE21
  252.  
  253. BRA SkipUseless ; \ Skip to save cycles.
  254. NOP ; |
  255. NOP ; |
  256. NOP ; |
  257. NOP ; | Disable score
  258. NOP ; |
  259. NOP ; |
  260. NOP ; |
  261. NOP ; |
  262. NOP ; |
  263. NOP ; /
  264. NOP
  265. NOP
  266. NOP
  267. NOP ; \ Yeah more semi-colons and comments...
  268. NOP ; / Etc.
  269. NOP
  270. NOP
  271. NOP
  272. SkipUseless:
  273.  
  274. org $05CEF9
  275.  
  276. NOP ; \
  277. NOP ; |
  278. NOP ; |
  279. NOP ; |
  280. NOP ; |
  281. NOP ; |
  282. NOP ; | Disable score being added at level end.
  283. NOP ; |
  284. NOP ; |
  285. NOP ; |
  286. NOP ; |
  287. NOP ; /
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement