Advertisement
Guest User

Propopet V2.0

a guest
Dec 11th, 2012
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.70 KB | None | 0 0
  1. CON
  2.  
  3. _clkmode = xtal1 + pll16x
  4. _xinfreq = 5_000_000
  5.  
  6.  
  7. OBJ
  8.  
  9. text : "vga_text"
  10.  
  11. VAR
  12.  
  13. long Hunger
  14. long Poo
  15. long Sleep
  16. long Eat
  17. long Exp
  18. long Function
  19. long Button [32]
  20. long Funct
  21.  
  22. Pub Main
  23.  
  24. Initialize
  25.  
  26. Repeat
  27.  
  28. If Exp =< 10
  29. Function := @VY
  30. If Exp > 10 and Exp =< 20
  31. Function := @Y
  32. If Exp > 30
  33. Function := @A
  34.  
  35. Display
  36.  
  37. Hunger += 2
  38. Poo += 3
  39. Sleep += 1
  40.  
  41. If Hunger =< 15
  42. StandbyPub
  43. If Hunger > 15
  44. HungerPub
  45.  
  46. If Poo =< 10
  47. StandbyPub
  48. If Poo > 10
  49. PooPub
  50.  
  51. If Sleep =< 20
  52. StandbyPub
  53. If Sleep > 20
  54. SleepPub
  55.  
  56. PUB Initialize
  57.  
  58. text.start(8)
  59. text.out(00)
  60. cognew(ButtonPub, @Button)
  61.  
  62. Hunger := 0 '0 is not hungry 100 is hungry
  63. Poo := 0 '0 is no need to poo 100 is needs to
  64. Sleep := 0 '0 is not sleepy 100 is sleepy
  65. Exp := 0
  66.  
  67. Pub StandbyPub
  68.  
  69. Repeat 2
  70. text.str(string($A,12,$B,7))
  71. text.str(Function)
  72. waitcnt(clkfreq + cnt)
  73. text.str(string($A,12,$B,7))
  74. text.str(Function + 9)
  75. waitcnt(clkfreq + cnt)
  76. Return
  77.  
  78. Pub HungerPub
  79.  
  80. Repeat 2
  81. text.str(string($A,12,$B,7))
  82. text.str(Function + 18)
  83. waitcnt(clkfreq + cnt)
  84. text.str(string($A,12,$B,7))
  85. text.str(Function + 27)
  86. waitcnt(clkfreq + cnt)
  87. Return
  88.  
  89. Pub PooPub
  90.  
  91. Repeat 2
  92. text.str(string($A,12,$B,7))
  93. text.str(Function + 36)
  94. waitcnt(clkfreq + cnt)
  95. text.str(string($A,12,$B,7))
  96. text.str(Function + 45)
  97. waitcnt(clkfreq + cnt)
  98. Return
  99.  
  100. Pub SleepPub
  101.  
  102. Repeat 2
  103. text.str(string($A,12,$B,7))
  104. text.str(Function + 54)
  105. waitcnt(clkfreq + cnt)
  106. text.str(string($A,12,$B,7))
  107. text.str(Function + 63)
  108. waitcnt(clkfreq + cnt)
  109. Return
  110.  
  111. Pub Display
  112.  
  113. text.out(1)
  114. text.dec(Hunger)
  115. text.out(13)
  116. text.dec(Poo)
  117. text.out(13)
  118. text.dec(Sleep)
  119. text.out(13)
  120. text.dec(Exp)
  121. text.out(13)
  122. Return
  123.  
  124. Pub ButtonPub | ButtonPush
  125.  
  126. dira[0..4]~
  127.  
  128. repeat
  129. ButtonPush := ina[0..4]
  130. case ButtonPush
  131. %11110:
  132. Funct := @Zero 'hunger
  133. text.str(string($A,12,$B,9))
  134. text.str(Funct)
  135. WaitPub
  136. HungerResponsePub
  137. Hunger := 0
  138. Exp += 5
  139. %11101:
  140. Funct := @One 'poo
  141. text.str(string($A,12,$B,9))
  142. text.str(Funct)
  143. WaitPub
  144. PooResponsePub
  145. Poo := 0
  146. Exp += 5
  147. %11011:
  148. Funct := @Two
  149. text.str(string($A,12,$B,9))
  150. text.str(Funct)
  151. WaitPub
  152. NonPub
  153. %10111:
  154. Funct := @Three
  155. text.str(string($A,12,$B,9))
  156. text.str(Funct)
  157. WaitPub
  158. SleepResponsePub
  159. Sleep := 0
  160. Exp += 5
  161. %01111:
  162. Funct := @Four
  163. text.str(string($A,12,$B,9))
  164. text.str(Funct)
  165. WaitPub
  166. NonPub
  167.  
  168. Pub WaitPub
  169.  
  170. repeat
  171. until ina[2] == 0
  172. text.str(Funct + 21)
  173. return
  174.  
  175. Pub HungerResponsePub
  176.  
  177. repeat 2
  178. text.str(string($A,12,$B,9))
  179. text.str(Function + 72)
  180. waitcnt(clkfreq + cnt)
  181. text.str(string($A,12,$B,9))
  182. text.str(Function + 81)
  183. waitcnt(clkfreq + cnt)
  184. text.out(00)
  185.  
  186. Pub PooResponsePub
  187.  
  188. repeat 2
  189. text.str(string($A,12,$B,9))
  190. text.str(Function + 36)
  191. waitcnt(clkfreq + cnt)
  192. text.str(string($A,12,$B,9))
  193. text.str(Function + 45)
  194. waitcnt(clkfreq + cnt)
  195. text.out(00)
  196.  
  197. Pub SleepResponsePub
  198.  
  199. repeat 2
  200. text.str(string($A,12,$B,9))
  201. text.str(Function + 54)
  202. waitcnt(clkfreq + cnt)
  203. text.str(string($A,12,$B,9))
  204. text.str(Function + 63)
  205. waitcnt(clkfreq + cnt)
  206. text.out(00)
  207.  
  208. Pub NonPub 'never mind
  209.  
  210. repeat 2
  211. text.str(string($A,12,$B,9))
  212. text.str(string("Never Mind!"))
  213. waitcnt(clkfreq + cnt)
  214. text.out(00)
  215.  
  216. DAT
  217.  
  218. VY byte ".ô ", 0
  219. VYStandby2 byte " Ô. ", 0
  220. VYHungry byte ".ö ", 0
  221. VYHungry2 byte " Ö. ", 0
  222. VYPooing byte "..õ ", 0
  223. VYPooing2 byte "õ.. ", 0
  224. VYSleeping byte "ó zz ", 0
  225. VYSleeping2 byte " ò zZ ", 0
  226. VYEating1 byte " ö. ", 0
  227. VYEating2 byte " ö ", 0
  228.  
  229. Y byte " ^.^ ", 0
  230. YStandby2 byte "^.^ ", 0
  231. YHungry byte " 'o' ", 0
  232. YHungry2 byte "'.' ", 0
  233. YPooing byte " >.< ", 0
  234. YPooing2 byte "-.< ", 0
  235. YSleeping byte " ~o~ zz ", 0
  236. YSleeping2 byte "~.~ zzZ ", 0
  237. YEating1 byte " ^o^ o ", 0
  238. YEating2 byte " ^~^ ", 0
  239.  
  240. A byte " >(^.^)>", 0
  241. AStandby2 byte "<(^.^)< ", 0
  242. AHungry byte " ('o') ", 0
  243. AHungry2 byte "('.') ", 0
  244. APooing byte " (>.<) ", 0
  245. APooing2 byte "(-.<) ", 0
  246. ASleeping byte " (~o~)zz", 0
  247. ASleeping2 byte "(~.~)zzZ", 0
  248. AEating1 byte "(^o^)nom", 0
  249. AEating2 byte "(^~^)NOM", 0
  250.  
  251. Zero byte "Feed Me? ", 0 'down
  252. Zero2 byte "I have been fed! ", 0
  253. One byte "Clean Me? ", 0 'left
  254. One2 byte "I have been cleaned!", 0
  255. Two byte "Never mind! ", 0 'center
  256. Two2 byte "Never mind! ", 0
  257. Three byte "Should I sleep? ", 0 'right
  258. Three2 byte "I have slept! ", 0
  259. Four byte "Never mind! ", 0 'up
  260. Four2 byte "Never mind! ", 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement