include "doorsos.h" ; general ROM calls include "graphlib.h" ; clr_scr function include "userlib.h" ; idle_loop xdef _main ; define program entry point xdef _comment ; define program comment xdef _ti89 ; compile for TI-89 xdef _ti92plus ; compile for TI-92 Plus ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; delay: move.w #0,d0 delay_repeat: add.w #1,d0 cmp delay_len,d0 bne delay_repeat bra continue _main: jsr graphlib::clr_scr ; clear the screen move.w #10,d0 move.w #10,d1 move.w #85,d2 move.w #50,d3 move.l #myStr,a0 jsr graphlib::box loop: tst.w (doorsos::kb_vars+$1C) ; check if a key was pressed beq delay ; no key was pressed. repeat move.w (doorsos::kb_vars+$1E),d0 ; key was pressed. store in d0 clr.w (doorsos::kb_vars+$1c) ; clear key flag cmp.w #264,d0 ; check if ESC was pressed bne loop ; ESC key was not pressed bra end ; goto \end continue: move.w numx,d0 move.w numy,d1 move.l #ball_sprite,a0 jsr graphlib::put_sprite checklr: cmp #0,dirx beq right cmp #1,dirx beq left checkud: cmp #0,diry beq down cmp #1,diry beq up bra loop moveleft: move #1,dirx bra checkud moveright: move #0,dirx bra checkud moveup: move #1,diry bra loop movedown: move #0,diry bra loop right: add.w #1,numx cmp #85,numx beq moveleft bra checkud left: sub.w #1,numx cmp #14,numx beq moveright bra checkud down: add.w #1,numy cmp #50,numy beq moveup bra loop up: sub.w #1,numy cmp #25,numy beq movedown bra loop end: move.w #25,numx move.w #25,numy clr.w dirx clr.w diry clr.w temp rts ; end of program ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; variable declaration section myStr dc.b "Hello, Ass!",0 ; string to be displayed myStr2 dc.b " ",0 ; string to be displayed _comment dc.b "Hello, Ass!",0 ; program comment numx dc.w 25 numy dc.w 25 temp dc.w 1 delay_len dc.w 15000 dirx dc.w 0 diry dc.w 0 ball_sprite: dc.w 8 dc.w 1 dc.b %00000000 dc.b %01100110 dc.b %00100010 dc.b %00001000 dc.b %00011000 dc.b %01000010 dc.b %00111100 dc.b %00000000 ball_sprite_mask: dc.b %11111111 dc.b %11111111 dc.b %11111111 dc.b %11111111 dc.b %11111111 dc.b %11111111 dc.b %11111111 dc.b %11111111 end ; end of the source code