home *** CD-ROM | disk | FTP | other *** search
- include "tios.h" ;The include file for the TI-OS in the calculator.
- include "util.h" ;Utilities include file
- xdef _main ;Label to jump to when the program starts
- xdef _comment ;Pointer to the comment that appears in Doors OS/Plusshell
- xdef _ti89 ;This program is designed for the TI89
-
- WriteStr macro ;A macro. This does not save bytes. Every time this macro is called, it is included in the program again.
- move.w \3,-(a7) ;Set the font to display the words in. Can be white on black, black on white, "xor" (inversed), and some other stuff.
- pea \4(pc) ;Point to the string to display
- move.w \2,-(a7) ;Where to start the string vertically
- move.w \1,-(a7) ;Where to start the string horizontally
- jsr tios::DrawStrXY ;call tios and put the string on the screen
- lea 10(a7),a7 ;Fix the stack pointer. (I have no idea why I must do this, e-mail me if you do.)
- endm ;End the macro.
-
- _main: ;Defines the _main label. The main loop of the program.
- jsr util::clr_scr ;Clear the screen, using the util library.
- WriteStr #1,#1,#1,message ;Put string "message" at 1,1 on the screen
- WriteStr #1,#9,#1,messageb ;Put string "messageb" at 1,9 on the screen
- WriteStr #1,#17,#1,messagec ;Put string "messagec" at 1,17 on the screen
- WriteStr #1,#25,#1,messaged ;Put string "messaged" at 1,25 on the screen
- jsr util::idle_loop ;Wait for a keypress, store keypress in d0
- cmp #51,d0 ;See if keypress is key #51, or the button marked 3 w/o 2nd, diamond, shift, or alpha
- beq _exit ;If the key truly is the 3 key, go to the label _exit
- jsr util::clr_scr ;Use the util libary to clear the screen.
- WriteStr #1,#1,#1,messagee ;Put messagee at 1,1 on the screen
- jsr util::idle_loop ;Wait for a keypress, store keypress in d0
- jmp _main ;Go back to label _main
-
- _exit: ;Label this secion _exit
- jsr util::clr_scr ;Clear the screen using util
- WriteStr #1,#1,#1,messagef ;Put messagef on the screen at 1,1
- WriteStr #1,#9,#1,messageg ;Put messageg on the screen at 1,9
- jsr util::idle_loop ;Wait for a keypress, store keypress in d0
- rts ;Exit the program!
-
- ;This is the data section. The entire data section is comprised of strings, which have been displayed in the above program.
- ;Note to newbies: make sure you always have dc.b and ,0! :)
-
- _comment: dc.b "Mogsoft's Secret Button 1.0",0
- message: dc.b "Welcome! You cannot exit",0
- messageb: dc.b "this program until you",0
- messagec: dc.b "find the secret key.",0
- messaged: dc.b "(Hint: It's not 3!)",0
- messagee: dc.b "Incorrect. Try again.",0
- messagef: dc.b "Wow! How'd you figure that",0
- messageg: dc.b "out?! You're psychic!",0
-
- end ;End the source. In your programs, MAKE SURE THERE'S A BLANK LINE AT THE END! :)
-