Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CON
- _clkmode = xtal1 + pll16x
- _xinfreq = 5_000_000
- OBJ
- text : "vga_text"
- VAR
- long Hunger
- long Poo
- long Sleep
- long Eat
- long Exp
- long Function
- long Button [32]
- long Blurb
- long Funct
- PUB Premain
- text.start(8)
- text.out(00)
- cognew(ButtonPub, @Button)
- Hunger := 0 '0 is not hungry 100 is hungry
- Poo := 0 '0 is no need to poo 100 is needs to
- Sleep := 0 '0 is not sleepy 100 is sleepy
- Exp := 0
- Main
- Pub Main
- text.out(1)
- text.dec(Hunger)
- text.out(13)
- text.dec(Poo)
- text.out(13)
- text.dec(Sleep)
- text.out(13)
- text.dec(Exp)
- text.out(13)
- Repeat 1
- Hunger += 2
- Poo += 3
- Sleep += 1
- Repeat 1
- If Hunger =< 75
- StandbyPub
- If Hunger > 75
- HungerPub
- Pub MainSecond
- text.out(1)
- text.dec(Hunger)
- text.out(13)
- text.dec(Poo)
- text.out(13)
- text.dec(Sleep)
- text.out(13)
- text.dec(Exp)
- text.out(13)
- Repeat 1
- If Poo =< 50
- MainThird
- If Poo > 50
- PooPub
- Pub MainThird
- text.out(1)
- text.dec(Hunger)
- text.out(13)
- text.dec(Poo)
- text.out(13)
- text.dec(Sleep)
- text.out(13)
- text.dec(Exp)
- text.out(13)
- Repeat 1
- If Sleep =< 100
- Main
- If Sleep > 100
- SleepPub
- Pub StandbyPub
- text.out(1)
- text.dec(Hunger)
- text.out(13)
- text.dec(Poo)
- text.out(13)
- text.dec(Sleep)
- text.out(13)
- text.dec(Exp)
- text.out(13)
- Repeat 1
- If Exp =< 30
- Function := @VY
- If Exp > 30 and Exp =< 100
- Function := @Y
- If Exp > 100
- Function := @A
- Repeat 2
- text.str(string($A,12,$B,7))
- text.str(Function)
- waitcnt(clkfreq + cnt)
- 'text.out(00)
- text.str(string($A,12,$B,7))
- text.str(Function + 9)
- waitcnt(clkfreq + cnt)
- 'text.out(00)
- MainSecond
- Pub HungerPub
- Repeat 1
- If Exp =< 30
- Function := @VYHungry
- If Exp > 30 and Exp =< 100
- Function := @YHungry
- If Exp > 100
- Function := @AHungry
- repeat 2
- text.str(string($A,12,$B,7))
- text.str(Function)
- waitcnt(clkfreq + cnt)
- 'text.out(00)
- text.str(string($A,12,$B,7))
- text.str(Function + 9)
- waitcnt(clkfreq + cnt)
- 'text.out(00)
- MainSecond
- Pub PooPub
- Repeat 1
- If Exp =< 30
- Function := @VYPooing
- If Exp > 30 and Exp =< 100
- Function := @YPooing
- If Exp > 100
- Function := @APooing
- repeat 2
- text.str(string($A,12,$B,7))
- text.str(Function)
- waitcnt(clkfreq + cnt)
- 'text.out(00)
- text.str(string($A,12,$B,7))
- text.str(Function + 9)
- waitcnt(clkfreq + cnt)
- 'text.out(00)
- MainThird
- Pub SleepPub
- Repeat 1
- If Exp =< 30
- Function := @VYSleeping
- If Exp > 30 and Exp =< 100
- Function := @YSleeping
- If Exp > 100
- Function := @ASleeping
- repeat 2
- text.str(string($A,12,$B,7))
- text.str(Function)
- waitcnt(clkfreq + cnt)
- 'text.out(00)
- text.str(string($A,12,$B,7))
- text.str(Function + 9)
- waitcnt(clkfreq + cnt)
- 'text.out(00)
- Main
- Pub ButtonPub | ButtonPush
- dira[0..4]~
- repeat
- ButtonPush := ina[0..4]
- case ButtonPush
- %11110:
- Funct := @Zero 'hunger
- text.str(string($A,12,$B,9))
- text.str(Funct)
- WaitPub
- ZeroPub
- %11101:
- Funct := @One 'poo
- text.str(string($A,12,$B,9))
- text.str(Funct)
- WaitPub
- OnePub
- %11011:
- Funct := @Two
- text.str(string($A,12,$B,9))
- text.str(Funct)
- WaitPub
- TwoPub
- %10111:
- Funct := @Three
- text.str(string($A,12,$B,9))
- text.str(Funct)
- WaitPub
- ThreePub
- %01111:
- Funct := @Four
- text.str(string($A,12,$B,9))
- text.str(Funct)
- WaitPub
- FourPub
- Pub WaitPub
- repeat
- until ina[2] == 0
- text.str(Funct + 21)
- return
- Pub ZeroPub 'hunger
- If Exp =< 30
- Blurb := @VYEating
- If Exp > 30 and Exp =< 100
- Blurb := @YEating
- If Exp > 100
- Blurb := @AEating
- Hunger := 0
- Exp += 5
- repeat 2
- text.str(string($A,12,$B,9))
- text.str(Blurb)
- waitcnt(clkfreq + cnt)
- text.str(string($A,12,$B,9))
- text.str(Blurb + 9)
- waitcnt(clkfreq + cnt)
- text.str(string($A,12,$B,9))
- text.str(Blurb + 18)
- waitcnt(clkfreq + cnt)
- text.str(string($A,12,$B,9))
- text.str(Blurb + 27)
- waitcnt(clkfreq + cnt)
- text.out(00)
- Pub OnePub 'poo
- If Exp =< 30
- Blurb := @VYPooing
- If Exp > 30 and Exp =< 100
- Blurb := @YPooing
- If Exp > 100
- Blurb := @APooing
- Poo := 0
- Exp += 5
- repeat 2
- text.str(string($A,12,$B,9))
- text.str(Blurb)
- waitcnt(clkfreq + cnt)
- text.str(string($A,12,$B,9))
- text.str(Blurb + 9)
- waitcnt(clkfreq + cnt)
- text.out(00)
- Pub TwoPub 'never mind
- repeat 2
- text.str(string($A,12,$B,9))
- text.str(string("Never Mind!"))
- waitcnt(clkfreq + cnt)
- text.out(00)
- Pub ThreePub 'sleep
- If Exp =< 30
- Blurb := @VYSleeping
- If Exp > 30 and Exp =< 100
- Blurb := @YSleeping
- If Exp > 100
- Blurb := @ASleeping
- Sleep := 0
- Exp += 5
- repeat 2
- text.str(string($A,12,$B,9))
- text.str(Blurb)
- waitcnt(clkfreq + cnt)
- text.str(string($A,12,$B,9))
- text.str(Blurb + 9)
- waitcnt(clkfreq + cnt)
- text.out(00)
- Pub FourPub 'never mind
- repeat 2
- text.str(string($A,12,$B,9))
- text.str(string("Never Mind!"))
- waitcnt(clkfreq + cnt)
- text.out(00)
- DAT
- VY byte ".ô ", 0
- VYStandby2 byte " Ô. ", 0
- VYHungry byte ".ö ", 0
- VYHungry2 byte " Ö. ", 0
- VYPooing byte "..õ ", 0
- VYPooing2 byte "õ.. ", 0
- VYSleeping byte "ó zz ", 0
- VYSleeping2 byte " ò zZ ", 0
- VYEating byte "ö... ", 0
- VYEating2 byte " ö.. ", 0
- VYEating3 byte " ö. ", 0
- VYEating4 byte " ö ", 0
- Y byte " ^.^ ", 0
- YStandby2 byte "^.^ ", 0
- YHungry byte " 'o' ", 0
- YHungry2 byte "'.' ", 0
- YPooing byte " >.< ", 0
- YPooing2 byte "-.< ", 0
- YSleeping byte " ~o~ zz ", 0
- YSleeping2 byte "~.~ zzZ ", 0
- YEating byte "^o^ ooo ", 0
- YEating2 byte " ^~^ oo ", 0
- YEating3 byte " ^o^ oo ", 0
- YEating4 byte " ^~^ o ", 0
- A byte " >(^.^)>", 0
- AStandby2 byte "<(^.^)< ", 0
- AHungry byte " ('o') ", 0
- AHungry2 byte "('.') ", 0
- APooing byte " (>.<) ", 0
- APooing2 byte "(-.<) ", 0
- ASleeping byte " (~o~)zz", 0
- ASleeping2 byte "(~.~)zzZ", 0
- AEating byte "(^o^)nom", 0
- AEating2 byte "(^~^)NOM", 0
- AEating3 byte "(^o^)nom", 0
- AEating4 byte "(^~^)NOM", 0
- Zero byte "Feed Me? ", 0 'down
- Zero2 byte "I have been fed! ", 0
- One byte "Clean Me? ", 0 'left
- One2 byte "I have been cleaned!", 0
- Two byte "Never mind! ", 0 'center
- Two2 byte "Never mind! ", 0
- Three byte "Should I sleep? ", 0 'right
- Three2 byte "I have slept! ", 0
- Four byte "Never mind! ", 0 'up
- Four2 byte "Never mind! ", 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement