Advertisement
Tyler_Elric

snesscript .1

Sep 1st, 2012
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. #org 0x8168CAE
  2. '-----------------------------------
  3. msgbox 0x818D4E7 ' \v\h01 played with t...
  4. callstd MSG_SIGN ' Signpost-style message
  5. end
  6.  
  7.  
  8. #org 0x818D4E7
  9. = \v\h01 played with the NES.\p[.]Okay!\nIt's time to go!
  10.  
  11. #eorg 0x8168CAE
  12. #eorg 0x818D4E7 'Erase the old scripts.
  13.  
  14. #define HIGHSCORE 0x4000
  15. #define FLAG_ID 0x201
  16. #define CURRENTLEVEL 0x8001
  17. #define LEVELSCORE 0x8002
  18. #define TOTALSCORE 0x8003
  19. #define NUMLEVELS 10
  20.  
  21. #dyn 0x740000
  22. #org @main
  23. lock
  24. setvar CURRENTLEVEL 1
  25. checkflag FLAG_ID
  26. :loop-top
  27. call @play_level
  28. compare CURRENTLEVEL NUMLEVELS
  29. if == jump :end
  30. jump :loop-top
  31. :end
  32. random 0xFFFF
  33. storevar 0 LASTRESULT
  34. call @show_hiscore
  35. msgbox @finished
  36. callstd MSG_NORMAL
  37. release
  38. end
  39.  
  40. #org @play_level
  41. random 0xFFFA
  42. storevar 0 CURRENTLEVEL
  43. addvar TOTALSCORE LASTRESULT
  44. storevar 1 LEVELSCORE
  45. msgbox @playing_level
  46. callstd MSG_NORMAL
  47. call @show_hiscore
  48. addvar CURRENTLEVEL 1
  49. return
  50.  
  51. #org @show_hiscore
  52. comparevars TOTALSCORE HIGHSCORE
  53. if <= jump :hs-end
  54. storevar 0 TOTALSCORE
  55. copyvar HIGHSCORE TOTALSCORE
  56. msgbox @hiscoretext
  57. callstd MSG_NORMAL
  58. return
  59.  
  60. #org @playing_level
  61. = I'm playing level \v\h02!
  62.  
  63. #org @finished
  64. = Awesome, my final score was \v\h02!
  65.  
  66. #org @hiscoretext
  67. = My new high-score is \v\h02!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement