Advertisement
Atdiy

Propopet V3.0

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