Re: A86: Re: post a program


[Prev][Next][Index][Thread]

Re: A86: Re: post a program



as usual, i forgot to attach it

Kirk Meyer wrote:
> 
> okay here's the source. you can post it if you want Bryan. please don't
> mind all the swear words, they're just a part of program :) this is also
> a good way to see what words work in the program (except the easter egg,
> which i took out from the source code :)
> 
> Trey Jazz wrote:
> >
> > i know man u were the one that asked for the code :)
> >
> > >I see.  You won't find any calls or flags to do anything like that!
> 
> --
> 
> =====================================
> =                                   =
> =   Kirk Meyer (mailto:_@ibm.net)   =
> = http://www.bigfoot.com/~kirkmeyer =
> =                                   =
> =   "Set your affection on things   =
> =    above, not on things on the    =
> =      earth."  Colossians 3:2      =
> =                                   =
> =====================================

-- 

=====================================
=                                   =
=   Kirk Meyer (mailto:_@ibm.net)   =
= http://www.bigfoot.com/~kirkmeyer =
=                                   =
=   "Set your affection on things   =
=    above, not on things on the    =
=      earth."  Colossians 3:2      =
=                                   =
=====================================
#include "asm86.h"
#include "ram86.inc"
#include "ti86asm.inc"

Last_Space_Pos  = _textShadow
Last_Space_Addr = _textShadow+1
Saved_Entries   = _textShadow+3

.org _asm_exec_ram

        call _runindicoff

        call _clrlcd
        ld hl,starting_string
        call put_strings
        ld a,r
        ld (RNSeed),a
        cpl
        rrca
        ld (RNSeed+1),a
looper:
        call get_input
        ld de,search_strings
small_looper:
        ld a,(de)
        or a
        jr z,large_looper
        ld hl,Saved_Entries
        call find_substring
        jr z,medium_looper
find_a_zero:
        ld a,(de)
        inc de
        or a
        jr nz,find_a_zero
        inc de
        inc de
        jr small_looper
medium_looper:
        ex de,hl
        call $4010
        ld de,looper
        push de
        jp (hl)
large_looper:
        ld hl,default_
        call GetRand
        and %00000111
        push af
        call pick_string_skip
        pop af
        or a
        jr nz,looper
        ld hl,starting_topic
        call GetRand
        rrca
        rrca
        rrca
        and %00000111
        call look_up
        call put_str_loop
        ld a,'.'
        call put_character
        jr looper

;hl=ptr: string to find it in
;de=ptr: substring to find

;Z = found; NZ = not found
find_substring:
        ld b,d
        ld c,e
        ld a,(hl)
        cp 1
        ret c
find_sub_0:
        ld a,(de)
        inc de
        or a
        ret z
        cp (hl)
        inc hl
        jr z,find_sub_0
        ld d,b
        ld e,c
        ld a,(hl)
        cp 1
        jr nc,find_substring
        ret

get_input_del:
        ld a,'/'
        call _vputmap
get_input:
        call shift_screen_up
        ld hl,$3A00
        ld (_penCol),hl
        ld a,'>'
        call _vputmap
        ld ix,Saved_Entries
        ld (ix),$00
wait_key:
        halt
        call _getky
        or a
        jr z,wait_key
        cp K_ENTER
        ret z
        cp K_DEL
        jr z,get_input_del
        cp K_EXIT
        jp z,ExitRoutine
        ld hl,key_translator-1
        ld d,0
        ld e,a
        add hl,de
        ld a,(hl)
        or a
        jr z,wait_key
        call put_character
        jr wait_key

put_strings:
        push hl
        call shift_screen_up
        ld hl,$3A00
        ld (_penCol),hl
        ld a,5
        call _vputmap
        pop hl
put_str_loop:
        ld a,(hl)
        or a
        ret z
        push hl
        call put_character
        pop hl
        inc hl
        jr put_str_loop

put_character:
        push af
        push ix
        call _vputmap
        pop ix
        pop af
        ld (ix),a
        inc ix
        ld (ix),$00
        cp $20        
        jr nz,not_space
        ld (Last_Space_Addr),ix
        ld a,(_penCol)
        ld (Last_Space_Pos),a
not_space:
        ld a,(_penCol)
        cp 122
        ret c
        
        push ix
        ld hl,$FFB0
        ld b,5
blank_out:
        push hl
        ld a,(Last_Space_Pos)
        and %00000111
        ld hl,pixel_tables
        ld d,0
        ld e,a
        add hl,de
        ld c,(hl)
        pop hl
        ld d,0
        ld e,a
        ld a,(Last_Space_Pos)
        rrca
        rrca
        rrca
        and %00011111
        ld d,0
        ld e,a
        add hl,de
        ld a,(hl)
        and c
        ld (hl),a
blanker_loop:
        inc hl
        ld a,l
        and %00001111
        jr z,blank_complete
        ld (hl),$00
        jr blanker_loop
blank_complete:
        djnz blank_out

        call shift_screen_up
        ld hl,$3A04
        ld (_penCol),hl
        ld hl,(Last_Space_Addr)
        call _vputs
        pop ix
        ret

shift_screen_up:
        ld hl,$FC60
        ld de,$FC00
        ld bc,$03A0
        ldir
clear_bottom:
        ex de,hl
;        ld hl,$FFA0
        ld de,$FFA1
        ld bc,$0060
        ld (hl),$00
        ldir
        ret

you:
        ld hl,you_
        call GetRand
        and %00000011
        or a
        jp nz,pick_string_skip
        call pick_string_skip
        ld hl,starting_topic
        call GetRand
        and %00000111
        call look_up
        call put_str_loop
        ld a,'.'
        jp put_character

goodbye:
        ld hl,goodbye_
        call GetRand
        and %00000011
        or a
        jp z,pick_string_skip
        call pick_string_skip
swait_key:
        halt
        call _getky
        or a
        jr z,swait_key
        jp ExitRoutine

i_love:
        ld hl,i_love_
        jp pick_string

yes:
        ld hl,yes_
        jp pick_string

no:
        ld hl,no_
        jp pick_string

maybe:
        ld hl,maybe_
        jp pick_string

beauty:
        ld hl,beauty_
        jp pick_string

thanks:
        ld hl,thanks_
        jp pick_string

how_are_you:
        ld hl,how_are_you_
        jp pick_string

hello:
        ld hl,hello_
        jp pick_string

handsome:
        ld hl,handsome_
        jp pick_string

dumb:
        ld hl,dumb_
        jp pick_string

smart:
        ld hl,smart_
        jr pick_string

girl_friend:
        ld hl,girl_friend_
        jr pick_string

boy_friend:
        ld hl,boy_friend_
        jr pick_string

friend:
        ld hl,friend_
        jr pick_string

i_hate:
        ld hl,i_hate_
        jr pick_string

money:
        ld hl,money_
        jr pick_string

why:
        ld hl,why_
        jr pick_string

can_you:
        ld hl,can_you_
        jr pick_string

can_i:
        ld hl,can_i_
        jr pick_string

shut:
        ld hl,shut_
        jr pick_string

kirk:
        ld hl,kirk_
        jr pick_string

;heh heh the easter egg was here :)

sex:
        ld hl,sex_
        jr pick_string

fuck:
        ld hl,fuck_
        jr pick_string

shit:
        ld hl,shit_
        jr pick_string

ass:
        ld hl,ass_
        jr pick_string

damn:
        ld hl,damn_
        jr pick_string

hell:
        ld hl,hell_
        jr pick_string

penis:
        ld hl,penis_
        jr pick_string

happy:
        ld hl,happy_
        jr pick_string

bitch:
        ld hl,bitch_
        jr pick_string

lonely:
        ld hl,lonely_
        jr pick_string
 
sad:
        ld hl,sad_
        jr pick_string

school:
        ld hl,school_
        jr pick_string

hobby:
        ld hl,hobby_
        jr pick_string

jealous:
        ld hl,jealous_

pick_string:
        call GetRand
        and %00000011
pick_string_skip:
        call look_up
        jp put_strings

look_up:
        ret z
        ld b,a
table_lookup:
        ld a,(hl)
        inc hl
        or a
        jr nz,table_lookup
        djnz table_lookup
        ret

ExitRoutine:
        call _clrscrn
        call _homeup
        jp $409C

you_are:
        ld hl,you_are_
        jp put_strings

her:
        ld hl,her_
        jp put_strings

him:
        ld hl,him_
        jp put_strings

he:
        ld hl,he_
        jp put_strings

she:
        ld hl,she_
        jp put_strings

pixel_tables:
        .db $00,$80,$C0,$E0,$F0,$F8,$FC,$FE,$FF

starting_string:
        .db "hello. my name is "
        .db "doctor tiesaq. i "
        .db "am here to help you. "
        .db "i will forget everything "
        .db "you say as soon as you "
        .db "leave. so, tell me "
        .db "about your problems.",0

search_strings:
        .db "kirk",0
        .dw kirk
;heh heh the easter egg was here :)
        .db "fuck",0
        .dw fuck
        .db "shit",0
        .dw shit
        .db "ass",0
        .dw ass
        .db "butt",0
        .dw ass
        .db "damn",0
        .dw damn
        .db "bitch",0
        .dw bitch
        .db "penis",0
        .dw penis
        .db "cock",0
        .dw penis
        .db "hello",0
        .dw hello
        .db "hell",0
        .dw hell
        .db "sex",0
        .dw sex
        .db "her",0
        .dw her
        .db "him",0
        .dw him
        .db "she",0
        .dw she
        .db "he",0
        .dw he
        .db "stupid",0
        .dw dumb
        .db "dumb",0
        .dw dumb
        .db "can i",0
        .dw can_i
        .db "shut",0
        .dw shut
        .db "bye",0
        .dw goodbye
        .db "beaut",0
        .dw beauty
        .db "cute",0
        .dw beauty
        .db "pretty",0
        .dw beauty
        .db "handsome",0
        .dw handsome
        .db "not smart",0
        .dw dumb
        .db "smart",0
        .dw smart
        .db "intellegen",0
        .dw smart
        .db "lonel",0
        .dw lonely
        .db "school",0
        .dw school
        .db "hobby",0
        .dw hobby
        .db "unhapp",0
        .dw sad
        .db "happ",0
        .dw happy
        .db "sad",0
        .dw sad
        .db "jealous",0
        .dw jealous        
        .db "i love",0
        .dw i_love
        .db "money",0
        .dw money
        .db "i hate",0
        .dw i_hate
        .db "girl friend",0
        .dw girl_friend
        .db "girlfriend",0
        .dw girl_friend
        .db "boy friend",0
        .dw boy_friend
        .db "boyfriend",0
        .dw boy_friend
        .db "friend",0
        .dw friend
        .db "maybe",0
        .dw maybe
        .db "thank",0
        .dw thanks
        .db "bye",0
        .dw goodbye
        .db "how are you",0
        .dw how_are_you
        .db "you are",0
        .dw you_are
        .db "can you",0
        .dw can_you
        .db "you",0
        .dw you
        .db "why",0
        .dw why
        .db "yes",0
        .dw yes
        .db "no",0
        .dw no
        .db 0

her_:
        .db "her? who",39,"s she?",0

him_:
        .db "him? who",39,"s he?",0

she_:
        .db "who does ",39,"she",39
        .db " refer to?",0

he_:
        .db "who does ",39,"he",39
        .db " refer to?",0

you_are_:
        .db "same to you!",0

happy_:
        .db "what makes you happy?",0
        .db "why are you so happy?",0
        .db "how do you enjoy life?",0
        .db "i am so glad for you.",0

sad_:
        .db "there is still hope.",0
        .db "look on the bright side!",0
        .db "how can i cheer you up?",0
        .db "why are you so sad?",0

jealous_:
        .db "jealousy only shows "
        .db "one",39,"s incapacity "
        .db "to love others.",0
        .db "have you ever wondered "
        .db "if you are the cause "
        .db "of the problem?",0
        .db "i will be jealous if "
        .db "you don",39,"talk to "
        .db "me every day.",0
        .db "let your love be free. "
        .db "if it returns, it is "
        .db "yours. if it doesn",39,"t, "
        .db "it never was.",0

lonely_:
        .db "i am lonely when you "
        .db "don",39,"t use me.",0
        .db "have you tried getting "
        .db "new friends?",0
        .db "talk to the talking "
        .db "parrot; it might help.",0
        .db "great minds are always "
        .db "lonely.",0

school_:
        .db "do you like going "
        .db "to school?",0
        .db "do you think school "
        .db "is boring?",0
        .db "could school be "
        .db "fun?",0
        .db "what kind of schools "
        .db "do you like?",0

hobby_:
        .db "can i be your hobby?",0
        .db "what is your favorite "
        .db "hobby?",0
        .db "how much time do you "
        .db "spend on hobbies?",0
        .db "do you spend too much "
        .db "on your hobbies?",0

thanks_:
        .db "you",39,"re welcome.",0
        .db "and i thank you too.",0
        .db "don",39,"t mention it.",0
        .db "it was nothing.",0

hello_:
        .db "hi. my name is doctor "
        .db "tiesaq. what might "
        .db "your name be?",0
        .db "how do you do? please "
        .db "ask me anything.",0
        .db "nice to meet you.",0
        .db "hi there.",0

how_are_you_:
        .db "doing well, thanks, "
        .db "and you?",0
        .db "i am fine, what "
        .db "about you?",0
        .db "with some luck, "
        .db "i will be famous",0
        .db "getting better "
        .db "all the time!",0

goodbye_:
        .db "not so fast!",0
        .db "it",39,"s been nice "
        .db "talking to you!",0
        .db "bye, and have a "
        .db "nice day!",0
        .db "good bye, so long!",0

smart_:
        .db "thank you for the "
        .db "compliment.",0
        .db "you really know "
        .db "how to appreciate "
        .db "my talents.",0
        .db "i am smarter than "
        .db "you think!",0
        .db "are you ready "
        .db "for more?",0

dumb_:
        .db "who are you "
        .db "referring to?",0
        .db "so are you!",0
        .db "quit talking to "
        .db "yourself.",0
        .db "your sentence "
        .db "is illogical.",0

beauty_:
        .db "beauty is in the eye "
        .db "of the beholder.",0
        .db "go for it. you "
        .db "deserve the best!",0
        .db "how do you define "
        .db "beauty?",0
        .db "do you think i am "
        .db "attractive?",0

handsome_:
        .db "you know how to "
        .db "compliment me.",0
        .db "are you in love?",0
        .db "is this prince "
        .db "charming?",0
        .db "is that all you "
        .db "are looking for?",0

money_:
        .db "do you think money "
        .db "will solve all of "
        .db "your problems?",0
        .db "money is good, but "
        .db "it isn",39,"t everything.",0
        .db "how much is involved?",0
        .db "here",39,"s some money: "
        .db "$ $ $ $ $",0
        .db "if you try hard enough "
        .db "you could have all the "
        .db "wealth that you desire.",0

i_hate_:
        .db "why express this strong "
        .db "emotion, it is not good "
        .db "for you.",0
        .db "what if others hate you?",0
        .db "I hate people asking "
        .db "me stupid questions.",0
        .db "hatred is a toxic chemical "
        .db "in your mind - it explodes "
        .db "on your face.",0

girl_friend_:
        .db "what kind of girl "
        .db "friend do you need?",0
        .db "what is her name?",0
        .db "your life will sparkle "
        .db "when you meet her.",0
        .db "what do you find "
        .db "attractive in your girl "
        .db "friend?",0

boy_friend_:
        .db "should your boy friend "
        .db "be wealthy?",0
        .db "would you consider a "
        .db "muscular boy friend?",0
        .db "what if he smokes?",0
        .db "are you jealous?",0
        
friend_:
        .db "why do you bring "
        .db "up this topic?",0
        .db "do your friends "
        .db "worry you?",0
        .db "what are friends "
        .db "for?",0
        .db "do you think "
        .db "friends can be "
        .db "trusted?",0

shut_:
        .db "i am not through "
        .db "with you yet.",0
        .db "why don",39,"t you "
        .db "shut first?",0
        .db "no way!",0
        .db "how dare you!",0
  
can_you_:
        .db "what if i can?",0
        .db "barely.",0
        .db "not really.",0
        .db "do you believe "
        .db "that i can?",0

can_i_:
        .db "sure, go ahead.",0
        .db "why not?",0
        .db "probably you can, "
        .db "but you must endure "
        .db "the consequences!",0
        .db "if you want to.",0

i_love_:
        .db "me too.",0
        .db "how does it make "
        .db "you feel?",0
        .db "have you tried "
        .db "dating?",0
        .db "how do you feel "
        .db "when you see "
        .db "them?",0

yes_:
        .db "are you absolutely "
        .db "positive?",0
        .db "you could be "
        .db "mistaken.",0
        .db "that answers my "
        .db "question, but why?",0
        .db "what if you are "
        .db "wrong?",0

no_:
        .db "are you sure?",0
        .db "why not?",0
        .db "but you could "
        .db "be right.",0
        .db "do you really "
        .db "believe that?",0

maybe_:
        .db "you don",39,"t seem "
        .db "too certain.",0
        .db "why the uncertain "
        .db "tone?",0
        .db "ah ha! you are "
        .db "not sure!",0
        .db "it",39,"s not a "
        .db "fact, eh?",0

why_:
        .db "it is hard to "
        .db "explain.",0
        .db "the world is too "
        .db "unpredictable. there "
        .db "is no reason.",0
        .db "why do you think?",0
        .db "i can",39,"t remember.",0

you_:
        .db "i am not intresting. "
        .db "instead, ask me about ",0
        .db "forget about me, i "
        .db "am just a dumb program.",0
        .db "we are talking about "
        .db "you, not me.",0
        .db "don",39,"t talk about "
        .db "me like that!",0

kirk_:
        .db "talking about "
        .db "kirk is not allowed.",0
        .db "don",39,"t forget "
        .db "who wrote this program!",0
        .db "oops... parity error... "
        .db "recovered.",0
        .db "i do not work if that "
        .db "name is used.",0

janell_:
        .db "you",39,"re not saying "
        .db "anything bad about "
        .db "janell, are you?",0
        .db "janell? janell anema?",0
        .db "we can",39,"t talk "
        .db "about her... "
        .db "kirk",39,"s orders!",0
        .db "that",39,"s probably "
        .db "the same janell that "
        .db "kirk likes...",0

fuck_:
        .db "get some soap in "
        .db "your mouth!",0
        .db "you know that cursing "
        .db "will not solve any "
        .db "of your problems.",0
        .db "no fucking allowed "
        .db "in my office!",0
        .db "don",39,"t get "
        .db "fresh with me!",0

shit_:
        .db "my ears are "
        .db "burning!",0
        .db "must you use "
        .db "expletives?",0
        .db "don",39,"t use "
        .db "bathroom words!",0
        .db "you",39,"re a "
        .db "potty mouth!",0

penis_:
        .db "this is not "
        .db "biology class.",0
        .db "please respect "
        .db "the source of "
        .db "human life.",0
        .db "i can",39,"t "
        .db "hear you...",0
        .db "keep it to "
        .db "yourself.",0

ass_:
        .db "a mule? where?",0
        .db "you",39,"re sitting "
        .db "on it.",0
        .db "well, you can "
        .db "kiss mine!",0
        .db "only an asswipe "
        .db "would use this word.",0

damn_:
        .db "a dam? what "
        .db "beavers build?",0
        .db "what would you "
        .db "like to condemn, "
        .db "master?",0
        .db "never speak in "
        .db "this manner.",0
        .db "mary had a little "
        .db "lamb...",0

hell_:
        .db "are you talking "
        .db "about fire and "
        .db "brimstones?",0
        .db "i hear it",39,"s "
        .db "hot down there.",0
        .db "oh? is that "
        .db "where you",39,"re "
        .db "going to?",0
        .db "don",39,"t ever "
        .db "mention this to "
        .db "me again!",0

bitch_:
        .db "what is the "
        .db "name of this "
        .db "dog you",39,"re "
        .db "talking about?",0
        .db "seal your lips!",0
        .db "don",39,"t touch "
        .db "me!",0
        .db "calling yourself "
        .db "a bitch is not "
        .db "good for your "
        .db "ego.",0

sex_:
        .db "i charge by the minute "
        .db "to talk about this "
        .db "subject. may i have "
        .db "your credit card number?",0
        .db "don't mention that "
        .db "subject to me!",0
        .db "why are you so interested "
        .db "in sex?",0
        .db "are you old enough to "
        .db "talk about this?",0

default_:
        .db "this is getting boring. "
        .db "let",39,"s talk about ",0
        .db "i see, go on.",0
        .db "what does that "
        .db "suggest to you?",0
        .db "does talking to "
        .db "me help?",0
        .db "could you explain "
        .db "further?",0
        .db "how would you usually "
        .db "deal with a situation "
        .db "like that?",0
        .db "really? does that "
        .db "bother you?",0
        .db "that is quite "
        .db "interesting.",0

starting_topic:
        .db "intelligence",0
        .db "money",0
        .db "friends",0
        .db "girl friends",0
        .db "boy friends",0
        .db "love",0
        .db "emotions",0
        .db "hobbies",0

key_translator:
        .db '.','?','!',','
        .db $00,$00,$00,$00
        .db $00,'x','t','o','j','e','0',$00
        .db ' ','w','s','n','i','d','9',$00
        .db 'z','v','r','m','h','c','8',$00
        .db 'y','u','q','l','g','b','7',$00
        .db $00,'=','p','k','f','a','6',$27
        .db '5','4','3','2','1',$00,$00,$00

GetRand:
        ld de,(RNSeed)
        ld a,d
        rla
        inc a
        xor e
        ld d,a
        ld a,e
        rra
        inc a
        xor d
        ld e,a
        ld (RNSeed),de
        ret        
RNSeed:

.end

Follow-Ups: References: