home *** CD-ROM | disk | FTP | other *** search
- include "tios.h";includes all libraries that I use
- include "util.h"
- include "linelib.h"
- include "graphlib.h"
-
- xdef _main ;program starts at main
- xdef _comment
- xdef _ti89 ;defines what calc is used
-
- _main:
- jsr util::clr_scr ;lib function which clears the screen
-
- move.w #2,-(a7) ;set to big font
- jsr tios::FontSetSys ;calls tios romcall which sets the desired font
-
- add.l #2,a7 ;fixes stack because a word(2 bytes) was pushed...if not fixed then CRASH
- move.w #4,-(a7) ;set to black on white
- pea tic(pc) ;pushes tic string onto the stac
- move.w #0,-(a7) ;y-coord
- move.w #0,-(a7) ;x-coord
- jsr tios::DrawStrXY ;calls ti romcall which displays a string (basically words)
- add.l #10,a7 ;fixes stack 3 words and one longword were pushed=10
-
- move.w #1,-(a7) ;small font
- jsr tios::FontSetSys
- add.l #2,a7
-
- move.w #4,-(a7) ;black on white
- pea by(pc) ;pushes by string on stack...refer to bottom of code
- move.w #12,-(a7) ;y-coord
- move.w #70,-(a7) ;x-coord -----------------see hello wold-----------------
- jsr tios::DrawStrXY ;calls ti rom call again
- add.l #10,a7 ;fixes stack again
-
- move.w #2,-(a7)
- jsr tios::FontSetSys ;large font
- add.l #2,a7
-
- move.w #4,-(a7) ;black on white
- pea scr(pc) ;pushes effective address of scr to stack
- move.w #22,-(a7) ;y-coord
- move.w #25,-(a7) ;x-coord
- jsr tios::DrawStrXY ;calls rom call again
- add.l #10,a7;fixes stack
- bsr title_screen_grid ;draws grid seen at title screen
- jsr util::idle_loop ;calls idle loop which waits for a key press and stores keycode in d0
- Begin: ;game jumps back here after someone wins (new game)
- bsr clear_vars ;clears all vars that may have been left by last game
- jsr util::clr_scr ;after key pressed (title screen exited) then clear the screen for the game
- bsr drawgrid ;calls sub routine which draws the grid using fline
- ;----program begins here----
- move #1,tracker ;x goes first
- ;-------------------------POSITION 1-------------------------------
- Pos1: ;set box to position 1
- move.w #49,box_x ; x coordinate is stored in variable box_x for later
- move.w #15,box_y
- move.w #51,xo_xpos ;set x-coord.if F1 pressed then x or o will be displayed
- move.w #17,xo_ypos ;set y-coord
- bsr box_sprite_setup ;goto box_sprite_setup subroutine
- test1:
- jsr util::idle_loop ;waits for keypress/stores keycode in d0
- test_esc1:
- cmp.w #264,d0 ;264=keycode of esc...cmp subtracts 264 from d0
- beq Exit ;if d0 - 264 =0 then esc was pressed...this says if z flag is set then goto Exit label
- test_up:
- cmp.w #337,d0 ;337 is keycode of up...check page 530 of 89 manual
- bne test_down ;if up wasn't pressed then check for down...goto down if z flag not set
- bsr box_erase_setup ;coordinates were set earlier...got box_erase_setup and delete old box
- bra Pos7 ; at subroutine "Pos7" a new box will be displayed
- test_down:
- cmp.w #340,d0 ;340=keycode of down
- bne test_right
- bsr box_erase_setup
- bra Pos4
- test_right:
- cmp.w #344,d0 ;344=keycode of right
- bne test_left
- bsr box_erase_setup
- bra Pos2
- test_left:
- cmp.w #338,d0 ;338=keycode of left arrow
- bne test_F1 ;if none of these keys were pressed then test all again *note*idle_loop called again
- bsr box_erase_setup ; so if left was pressed then goto pos3
- bra Pos3
- test_F1:
- cmp.w #268,d0
- bne test1
- move.w tracker,d4
- cmp.w #2,d4
- beq store_o
- store_x:
- cmp.b #10,x1 ;if x1 is already 10 then you can't go here again
- beq test1
- cmp.b #1,o1 ;if o1 is already 1 then you can't go here again
- beq test1
- move.b #10,x1 ;x's = 10 and o's = 1
- bsr setup_xo ; and later we can check who won
- bra test1
- store_o:
- cmp.b #1,o1 ;if o1 is already 1 then you can't go here again
- beq test1
- cmp.b #10,x1 ;if x1 is already 10 then you can't go here again
- beq test1
- move.b #1,o1 ;o's = 1 and x's = 10
- bsr setup_xo
- bra test1
- ;-----------------------------------POSITION 2------------------------------------
- Pos2:
- move.w #71,box_x ;set box in position2
- move.w #15,box_y
- move.w #73,xo_xpos ;set x-coord.if F1 pressed then x or o will be displayed
- move.w #17,xo_ypos ;set y-coord
- bsr box_sprite_setup
- test2:
- jsr util::idle_loop
- test_esc2:
- cmp.w #264,d0
- beq Exit
- test_up2:
- cmp.w #337,d0
- bne test_down2
- bsr box_erase_setup
- bra Pos8
- test_down2:
- cmp.w #340,d0
- bne test_right2
- bsr box_erase_setup
- bra Pos5
- test_right2:
- cmp.w #344,d0
- bne test_left2
- bsr box_erase_setup
- bra Pos3
- test_left2:
- cmp.w #338,d0
- bne test_F12
- bsr box_erase_setup
- bra Pos1
- test_F12:
- cmp.w #268,d0
- bne test2
- move.w tracker,d4
- cmp.w #2,d4
- beq store_o2
- store_x2:
- cmp.b #10,x2 ;if x2 is already 10 then you can't go here again
- beq test2
- cmp.b #1,o2 ;if o2 is already 1 then you can't go here again
- beq test2
- move.b #10,x2 ;x's = 10 and o's = 1
- bsr setup_xo ; and later we can check who won
- bra test2
- store_o2:
- cmp.b #1,o2 ;if o2 is already 1 then you can't go here again
- beq test2
- cmp.b #10,x2 ;if x2 is already 10 then you can't go here again
- beq test2
- move.b #1,o2 ;o's = 1 and x's = 10
- bsr setup_xo
- bra test2
- ;---------------------------------------------POSITION 3-----------------------------------------------
- Pos3:
- move.w #93,box_x ;set box in position1
- move.w #15,box_y
- move.w #95,xo_xpos ;set x-coord.if F1 pressed then x or o will be displayed
- move.w #17,xo_ypos ;set y-coord
- bsr box_sprite_setup
- test3:
- jsr util::idle_loop
- test_esc3:
- cmp.w #264,d0
- beq Exit
- test_up3:
- cmp.w #337,d0
- bne test_down3
- bsr box_erase_setup
- bra Pos9
- test_down3:
- cmp.w #340,d0
- bne test_right3
- bsr box_erase_setup
- bra Pos6
- test_right3:
- cmp.w #344,d0
- bne test_left3
- bsr box_erase_setup
- bra Pos1
- test_left3:
- cmp.w #338,d0
- bne test_F13
- bsr box_erase_setup
- bra Pos2
- test_F13:
- cmp.w #268,d0
- bne test3
- move.w tracker,d4
- cmp.w #2,d4
- beq store_o3
- store_x3:
- cmp.b #10,x3 ;if x3 is already 10 then you can't go here again
- beq test3
- cmp.b #1,o3 ;if o3 is already 1 then you can't go here again
- beq test3
- move.b #10,x3 ;x's = 10 and o's = 1
- bsr setup_xo ; and later we can check who won
- bra test3
- store_o3:
- cmp.b #1,o3 ;if o3 is already 1 then you can't go here again
- beq test3
- cmp.b #10,x3 ;if x3 is already 10 then you can't go here again
- beq test3
- move.b #1,o3 ;o's = 1 and x's = 10
- bsr setup_xo
- bra test3
- ;----------------------------------------------POSITION 4---------------------------------------------------------
- Pos4:
- move.w #49,box_x;set box in position1
- move.w #37,box_y
- move.w #51,xo_xpos ;set x-coord.if F1 pressed then x or o will be displayed
- move.w #39,xo_ypos ;set y-coord
- bsr box_sprite_setup
- test4:
- jsr util::idle_loop
- test_esc4:
- cmp.w #264,d0
- beq Exit
- test_up4:
- cmp.w #337,d0
- bne test_down4
- bsr box_erase_setup
- bra Pos1
- test_down4:
- cmp.w #340,d0
- bne test_right4
- bsr box_erase_setup
- bra Pos7
- test_right4:
- cmp.w #344,d0
- bne test_left4
- bsr box_erase_setup
- bra Pos5
- test_left4:
- cmp.w #338,d0
- bne test_F14
- bsr box_erase_setup
- bra Pos6
- test_F14:
- cmp.w #268,d0
- bne test4
- move.w tracker,d4
- cmp.w #2,d4
- beq store_o4
- store_x4:
- cmp.b #10,x4 ;if x4 is already 10 then you can't go here again
- beq test4
- cmp.b #1,o4 ;if o4 is already 1 then you can't go here again
- beq test4
- move.b #10,x4 ;x's = 10 and o's = 1
- bsr setup_xo ; and later we can check who won
- bra test4
- store_o4:
- cmp.b #1,o4 ;if o4 is already 1 then you can't go here again
- beq test4
- cmp.b #10,x4 ;if x4 is already 10 then you can't go here again
- beq test4
- move.b #1,o4 ;o's = 1 and x's = 10
- bsr setup_xo
- bra test4
-
- ;---------------------------------------POSITION 5----------------------------------------
- Pos5:
- move.w #71,box_x;set box in position1
- move.w #37,box_y
- move.w #73,xo_xpos ;set x-coord.if F1 pressed then x or o will be displayed
- move.w #39,xo_ypos ;set y-coord
- bsr box_sprite_setup
- test5:
- jsr util::idle_loop
- test_esc5:
- cmp.w #264,d0
- beq Exit
- test_up5:
- cmp.w #337,d0
- bne test_down5
- bsr box_erase_setup
- bra Pos2
- test_down5:
- cmp.w #340,d0
- bne test_right5
- bsr box_erase_setup
- bra Pos8
- test_right5:
- cmp.w #344,d0
- bne test_left5
- bsr box_erase_setup
- bra Pos6
- test_left5:
- cmp.w #338,d0
- bne test_F15
- bsr box_erase_setup
- bra Pos4
- test_F15:
- cmp.w #268,d0
- bne test5
- move.w tracker,d4
- cmp.w #2,d4
- beq store_o5
- store_x5:
- cmp.b #10,x5 ;if x5 is already 10 then you can't go here again
- beq test5
- cmp.b #1,o5 ;if o5 is already 1 then you can't go here again
- beq test5
- move.b #10,x5 ;x's = 10 and o's = 1
- bsr setup_xo ; and later we can check who won
- bra test5
- store_o5:
- cmp.b #1,o5 ;if o5 is already 1 then you can't go here again
- beq test5
- cmp.b #10,x5 ;if x5 is already 10 then you can't go here again
- beq test5
- move.b #1,o5 ;o's = 1 and x's = 10
- bsr setup_xo
- bra test5
-
- ;----------------------------------------POSITION 6-------------------------------------------
- Pos6:
- move.w #93,box_x;set box in position1
- move.w #37,box_y
- move.w #95,xo_xpos ;set x-coord.if F1 pressed then x or o will be displayed
- move.w #39,xo_ypos ;set y-coord
- bsr box_sprite_setup
- test6:
- jsr util::idle_loop
- test_esc6:
- cmp.w #264,d0
- beq Exit
- test_up6:
- cmp.w #337,d0
- bne test_down6
- bsr box_erase_setup
- bra Pos3
- test_down6:
- cmp.w #340,d0
- bne test_right6
- bsr box_erase_setup
- bra Pos9
- test_right6:
- cmp.w #344,d0
- bne test_left6
- bsr box_erase_setup
- bra Pos4
- test_left6:
- cmp.w #338,d0
- bne test_F16
- bsr box_erase_setup
- bra Pos5
- test_F16:
- cmp.w #268,d0
- bne test6
- move.w tracker,d4
- cmp.w #2,d4
- beq store_o6
- store_x6:
- cmp.b #10,x6 ;if x6 is already 10 then you can't go here again
- beq test6
- cmp.b #1,o6 ;if o6 is already 1 then you can't go here again
- beq test6
- move.b #10,x6 ;x's = 10 and o's = 1
- bsr setup_xo ; and later we can check who won
- bra test6
- store_o6:
- cmp.b #1,o6 ;if o6 is already 1 then you can't go here again
- beq test6
- cmp.b #10,x6 ;if x6 is already 10 then you can't go here again
- beq test6
- move.b #1,o6 ;o's = 1 and x's = 10
- bsr setup_xo
- bra test6
-
- ;-------------------------------------POSITION 7---------------------------------------
- Pos7:
- move.w #49,box_x;set box in position1
- move.w #59,box_y
- move.w #51,xo_xpos ;set x-coord.if F1 pressed then x or o will be displayed
- move.w #61,xo_ypos ;set y-coord
- bsr box_sprite_setup
- test7:
- jsr util::idle_loop
- test_esc7:
- cmp.w #264,d0
- beq Exit
- test_up7:
- cmp.w #337,d0
- bne test_down7
- bsr box_erase_setup
- bra Pos4
- test_down7:
- cmp.w #340,d0
- bne test_right7
- bsr box_erase_setup
- bra Pos1
- test_right7:
- cmp.w #344,d0
- bne test_left7
- bsr box_erase_setup
- bra Pos8
- test_left7:
- cmp.w #338,d0
- bne test_F17
- bsr box_erase_setup
- bra Pos9
- test_F17:
- cmp.w #268,d0
- bne test7
- move.w tracker,d4
- cmp.w #2,d4
- beq store_o7
- store_x7:
- cmp.b #10,x7 ;if x7 is already 10 then you can't go here again
- beq test7
- cmp.b #1,o7 ;if o7 is already 1 then you can't go here again
- beq test7
- move.b #10,x7 ;x's = 10 and o's = 1
- bsr setup_xo ; and later we can check who won
- bra test7
- store_o7:
- cmp.b #1,o7 ;if o7 is already 1 then you can't go here again
- beq test7
- cmp.b #10,x7 ;if x7 is already 10 then you can't go here again
- beq test7
- move.b #1,o7 ;o's = 1 and x's = 10
- bsr setup_xo
- bra test7
-
- ;---------------------------------------------POSITION 8----------------------------------------------------
- Pos8:
- move.w #71,box_x;set box in position1
- move.w #59,box_y
- move.w #73,xo_xpos ;set x-coord.if F1 pressed then x or o will be displayed
- move.w #61,xo_ypos ;set y-coord
- bsr box_sprite_setup
- test8:
- jsr util::idle_loop
- test_esc8:
- cmp.w #264,d0
- beq Exit
- test_up8:
- cmp.w #337,d0
- bne test_down8
- bsr box_erase_setup
- bra Pos5
- test_down8:
- cmp.w #340,d0
- bne test_right8
- bsr box_erase_setup
- bra Pos2
- test_right8:
- cmp.w #344,d0
- bne test_left8
- bsr box_erase_setup
- bra Pos9
- test_left8:
- cmp.w #338,d0
- bne test_F18
- bsr box_erase_setup
- bra Pos7
- test_F18:
- cmp.w #268,d0
- bne test8
- move.w tracker,d4
- cmp.w #2,d4
- beq store_o8
- store_x8:
- cmp.b #10,x8 ;if x8 is already 10 then you can't go here again
- beq test8
- cmp.b #1,o8 ;if o8 is already 1 then you can't go here again
- beq test8
- move.b #10,x8 ;x's = 10 and o's = 1
- bsr setup_xo ; and later we can check who won
- bra test8
- store_o8:
- cmp.b #1,o8 ;if o8 is already 1 then you can't go here again
- beq test8
- cmp.b #10,x8 ;if x8 is already 10 then you can't go here again
- beq test8
- move.b #1,o8 ;o's = 1 and x's = 10
- bsr setup_xo
- bra test8
-
- ;------------------------------------------POSITION 9-------------------------------------------------
- Pos9:
- move.w #93,box_x;set box in position1
- move.w #59,box_y
- move.w #95,xo_xpos ;set x-coord.if F1 pressed then x or o will be displayed
- move.w #61,xo_ypos ;set y-coord
- bsr box_sprite_setup
- test9:
- jsr util::idle_loop
- test_esc9:
- cmp.w #264,d0
- beq Exit
- test_up9:
- cmp.w #337,d0
- bne test_down9
- bsr box_erase_setup
- bra Pos6
- test_down9:
- cmp.w #340,d0
- bne test_right9
- bsr box_erase_setup
- bra Pos3
- test_right9:
- cmp.w #344,d0
- bne test_left9
- bsr box_erase_setup
- bra Pos7
- test_left9:
- cmp.w #338,d0
- bne test_F19
- bsr box_erase_setup
- bra Pos8
- test_F19:
- cmp.w #268,d0
- bne test9
- move.w tracker,d4
- cmp.w #2,d4
- beq store_o9
- store_x9:
- cmp.b #10,x9 ;if x9 is already 10 then you can't go here again
- beq test9
- cmp.b #1,o9 ;if o9 is already 1 then you can't go here again
- beq test9
- move.b #10,x9 ;x's = 10 and o's = 1
- bsr setup_xo ; and later we can check who won
- bra test9
- store_o9:
- cmp.b #1,o9 ;if o9 is already 1 then you can't go here again
- beq test9
- cmp.b #10,x9 ;if x9 is already 10 then you can't go here again
- beq test9
- move.b #1,o9 ;o's = 1 and x's = 10
- bsr setup_xo
- bra test9
-
- Exit:
- rts ;returns from game to shell/home if esc was pressed
-
-
- box_sprite_setup:
- move.w box_x,d0 ;put x-coord in d0
- move.w box_y,d1 ;put y-coord in d0
- move.l #box_sprite,a0 ;displays box;address of box_sprite
- jsr graphlib::put_sprite ;calls put_sprite which will create the box
- rts
-
- box_erase_setup:
- move.w box_x,d0 ;put the x-coordinate in do because that is how you use the putsprite routine
- move.w box_y,d1 ;y-coordinate in d1
- move.l #box_sprite_erase,a0 ;erases box;address of box_sprite_erase
- jsr graphlib::put_sprite ;calls putsprite which will ultimately delete the old box when moved
- rts ;returns from subroutine
-
- setup_xo:
- move.w xo_xpos,d0
- move.w xo_ypos,d1
- move.w tracker,d3
- cmp.w #2,d3
- beq setup_o ;if keeptrack = 2 then goto setup_o
- setup_x:
- move.l #x_sprite,a0
- jsr graphlib::put_sprite ;display x in desired location
- move.w #2,tracker ;next time o will be displayed
- bsr check_win
- rts
- setup_o:
- move.l #o_sprite,a0
- jsr graphlib::put_sprite ;display o in desired location
- move.w #1,tracker ;next time x will be displayed
- bsr check_win
- rts
-
- check_win:
- ;---------check if 3 x's in row one----------
- move.b x1,d5
- add.b x2,d5
- add.b x3,d5
- cmp.b #30,d5
- beq xwin
- ;--------check if 3 x's in row two-------------
- move.b x4,d5
- add.b x5,d5
- add.b x6,d5
- cmp.b #30,d5
- beq xwin
- ;---------check if 3 x's in row three---------
- move.b x7,d5
- add.b x8,d5
- add.b x9,d5
- cmp.b #30,d5
- beq xwin
- ;-----------check if 3 x's in column one--------
- move.b x1,d5
- add.b x4,d5
- add.b x7,d5
- cmp.b #30,d5
- beq xwin
- ;---------check if 3 x's in column two----------
- move.b x2,d5
- add.b x5,d5
- add.b x8,d5
- cmp.b #30,d5
- beq xwin
- ;---------check if 3 x's in column three----------
- move.b x3,d5
- add.b x6,d5
- add.b x9,d5
- cmp.b #30,d5
- beq xwin
- ;----------check if 3 x's are diagonal (pos1 through pos9)--------
- move.b x1,d5
- add.b x5,d5
- add.b x9,d5
- cmp.b #30,d5
- beq xwin
- ;---------------check if 3 x's are diagonal (pos7 through pos3)----------
- move.b x7,d5
- add.b x5,d5
- add.b x3,d5
- cmp.b #30,d5
- beq xwin
- ;---------check if 3 o's in row one----------
- move.b o1,d5
- add.b o2,d5
- add.b o3,d5
- cmp.b #3,d5
- beq owin
- ;--------check if 3 o's in row two-------------
- move.b o4,d5
- add.b o5,d5
- add.b o6,d5
- cmp.b #3,d5
- beq owin
- ;---------check if 3 o's in row three---------
- move.b o7,d5
- add.b o8,d5
- add.b o9,d5
- cmp.b #3,d5
- beq owin
- ;-----------check if 3 o's in column one--------
- move.b o1,d5
- add.b o4,d5
- add.b o7,d5
- cmp.b #3,d5
- beq owin
- ;---------check if 3 o's in column two----------
- move.b o2,d5
- add.b o5,d5
- add.b o8,d5
- cmp.b #3,d5
- beq owin
- ;---------check if 3 o's in column three----------
- move.b o3,d5
- add.b o6,d5
- add.b o9,d5
- cmp.b #3,d5
- beq owin
- ;----------check if 3 o's are diagonal (pos1 through pos9)--------
- move.b o1,d5
- add.b o5,d5
- add.b o9,d5
- cmp.b #3,d5
- beq owin
- ;---------------check if 3 o's are diagonal (pos7 through pos3)----------
- move.b o7,d5
- add.b o5,d5
- add.b o3,d5
- cmp.b #3,d5
- beq owin
- add.b #1,tie
- cmp.b #9,tie ;if noone won goto its_a_tie
- beq its_a_tie
- rts
-
- xwin:
- move.w #4,-(a7)
- pea xwins(pc)
- move.w #42,-(a7)
- move.w #56,-(a7)
- jsr tios::DrawStrXY
- add.l #10,a7
- jsr util::idle_loop
- bra Begin ;after someone wins start new game
-
- owin:
- move.w #4,-(a7)
- pea owins(pc)
- move.w #42,-(a7)
- move.w #56,-(a7)
- jsr tios::DrawStrXY
- add.l #10,a7
- jsr util::idle_loop
- bra Begin ;after someone wins start new game
-
- its_a_tie:
- move.w #4,-(a7)
- pea itsatie(pc)
- move.w #42,-(a7)
- move.w #40,-(a7)
- jsr tios::DrawStrXY
- add.l #10,a7
- jsr util::idle_loop
- bra Begin ;after someone wins start new game
-
-
-
- clear_vars:
- clr.b x1
- clr.b x2
- clr.b x3
- clr.b x4
- clr.b x5
- clr.b x6
- clr.b x7
- clr.b x8
- clr.b x9
- clr.b o1
- clr.b o2
- clr.b o3
- clr.b o4
- clr.b o5
- clr.b o6
- clr.b o7
- clr.b o8
- clr.b o9
- clr.b tie
- rts
-
- drawgrid: ;the draw grid routine draws 4 lines (the grid) using fline in the line library
- move.l #LCD_MEM,a0 ;line 1
- move.w #47,d0 ;x1
- move.w #57,d1 ;y1
- move.w #113,d2 ;x2
- move.w #57,d3 ;y2
- jsr linelib::fline ;calls library function
-
- move.l #LCD_MEM,a0;line 2
- move.w #47,d0
- move.w #35,d1
- move.w #113,d2
- move.w #35,d3
- jsr linelib::fline
-
- move.l #LCD_MEM,a0;line 3
- move.w #69,d0
- move.w #79,d1
- move.w #69,d2
- move.w #13,d3
- jsr linelib::fline
-
- move.l #LCD_MEM,a0;line 4
- move.w #91,d0
- move.w #79,d1
- move.w #91,d2
- move.w #13,d3
- jsr linelib::fline
- rts;returns from subroutine
-
-
- title_screen_grid: ;draws the grid you see during the title screen
- move.l #LCD_MEM,a0 ;line 1
- move.w #75,d0 ;x1
- move.w #35,d1 ;y1
- move.w #65,d2 ;x2
- move.w #90,d3 ;y2
- jsr linelib::fline ;calls library function
-
- move.l #LCD_MEM,a0;line 2
- move.w #95,d0
- move.w #35,d1;down
- move.w #85,d2
- move.w #90,d3
- jsr linelib::fline
-
- move.l #LCD_MEM,a0;line 3
- move.w #45,d0
- move.w #60,d1
- move.w #120,d2
- move.w #45,d3
- jsr linelib::fline
-
- move.l #LCD_MEM,a0;line 4
- move.w #45,d0
- move.w #80,d1
- move.w #120,d2
- move.w #65,d3
- jsr linelib::fline
-
- rts;return
-
-
-
- box_sprite:
- dc.w 19;height of box_sprite
- dc.w 3;width
- dc.b %11111111,%11111111,%11100000 ;1
- dc.b %10000000,%00000000,%00100000 ;this is the box that is moved around
- dc.b %10000000,%00000000,%00100000
- dc.b %10000000,%00000000,%00100000
- dc.b %10000000,%00000000,%00100000
- dc.b %10000000,%00000000,%00100000
- dc.b %10000000,%00000000,%00100000
- dc.b %10000000,%00000000,%00100000
- dc.b %10000000,%00000000,%00100000
- dc.b %10000000,%00000000,%00100000 ;10
- dc.b %10000000,%00000000,%00100000
- dc.b %10000000,%00000000,%00100000
- dc.b %10000000,%00000000,%00100000
- dc.b %10000000,%00000000,%00100000
- dc.b %10000000,%00000000,%00100000
- dc.b %10000000,%00000000,%00100000
- dc.b %10000000,%00000000,%00100000
- dc.b %10000000,%00000000,%00100000
- dc.b %11111111,%11111111,%11100000 ;19
-
- mask:
- dc.b %00000000,%00000000,%00000000 ;mask of box_sprite
- dc.b %00000000,%00000000,%00000000 ;all 0's lets the box be transparent
- dc.b %00000000,%00000000,%00000000 ; so the x's and o's will not be erased
- dc.b %00000000,%00000000,%00000000
- dc.b %00000000,%00000000,%00000000
- dc.b %00000000,%00000000,%00000000
- dc.b %00000000,%00000000,%00000000
- dc.b %00000000,%00000000,%00000000
- dc.b %00000000,%00000000,%00000000
- dc.b %00000000,%00000000,%00000000 ;10
- dc.b %00000000,%00000000,%00000000
- dc.b %00000000,%00000000,%00000000
- dc.b %00000000,%00000000,%00000000
- dc.b %00000000,%00000000,%00000000
- dc.b %00000000,%00000000,%00000000
- dc.b %00000000,%00000000,%00000000
- dc.b %00000000,%00000000,%00000000
- dc.b %00000000,%00000000,%00000000
- dc.b %00000000,%00000000,%00000000 ;19
-
- box_sprite_erase:
- dc.w 19 ;height
- dc.w 3 ;width
- dc.b %00000000,%00000000,%00000000;1
- dc.b %00000000,%00000000,%00000000
- dc.b %00000000,%00000000,%00000000
- dc.b %00000000,%00000000,%00000000 ;all 0's to erase the box
- dc.b %00000000,%00000000,%00000000
- dc.b %00000000,%00000000,%00000000
- dc.b %00000000,%00000000,%00000000
- dc.b %00000000,%00000000,%00000000
- dc.b %00000000,%00000000,%00000000
- dc.b %00000000,%00000000,%00000000 ;10
- dc.b %00000000,%00000000,%00000000
- dc.b %00000000,%00000000,%00000000
- dc.b %00000000,%00000000,%00000000
- dc.b %00000000,%00000000,%00000000
- dc.b %00000000,%00000000,%00000000
- dc.b %00000000,%00000000,%00000000
- dc.b %00000000,%00000000,%00000000
- dc.b %00000000,%00000000,%00000000 ;18
- dc.b %00000000,%00000000,%00000000
-
- mask2:
- dc.b %11111111,%11111111,%11100000 ;mask of the box_erase_sprite
- dc.b %10000000,%00000000,%00100000 ;the 1's will delete the black lines of the box
- dc.b %10000000,%00000000,%00100000
- dc.b %10000000,%00000000,%00100000
- dc.b %10000000,%00000000,%00100000
- dc.b %10000000,%00000000,%00100000
- dc.b %10000000,%00000000,%00100000
- dc.b %10000000,%00000000,%00100000
- dc.b %10000000,%00000000,%00100000
- dc.b %10000000,%00000000,%00100000 ;10
- dc.b %10000000,%00000000,%00100000
- dc.b %10000000,%00000000,%00100000
- dc.b %10000000,%00000000,%00100000
- dc.b %10000000,%00000000,%00100000
- dc.b %10000000,%00000000,%00100000
- dc.b %10000000,%00000000,%00100000
- dc.b %10000000,%00000000,%00100000
- dc.b %10000000,%00000000,%00100000
- dc.b %11111111,%11111111,%11100000 ;19
-
- x_sprite:
- dc.w 15
- dc.w 2
- dc.b %10000000,%00000010;1
- dc.b %01000000,%00000100
- dc.b %00100000,%00001000
- dc.b %00010000,%00010000
- dc.b %00001000,%00100000
- dc.b %00000100,%01000000
- dc.b %00000010,%10000000
- dc.b %00000001,%00000000
- dc.b %00000010,%10000000
- dc.b %00000100,%01000000;10
- dc.b %00001000,%00100000
- dc.b %00010000,%00010000
- dc.b %00100000,%00001000
- dc.b %01000000,%00000100
- dc.b %10000000,%00000010;15
- mask3:
- dc.b 0,0;1
- dc.b 0,0
- dc.b 0,0
- dc.b 0,0
- dc.b 0,0
- dc.b 0,0
- dc.b 0,0
- dc.b 0,0
- dc.b 0,0
- dc.b 0,0;10
- dc.b 0,0
- dc.b 0,0
- dc.b 0,0
- dc.b 0,0
- dc.b 0,0;15
-
- o_sprite:
- dc.w 15
- dc.w 2
- dc.b %00000111,%11000000;1
- dc.b %00011000,%00110000
- dc.b %00100000,%00001000
- dc.b %01000000,%00000100
- dc.b %01000000,%00000100
- dc.b %10000000,%00000010
- dc.b %10000000,%00000010
- dc.b %10000000,%00000010
- dc.b %10000000,%00000010
- dc.b %10000000,%00000010;10
- dc.b %01000000,%00000100
- dc.b %01000000,%00000100
- dc.b %00100000,%00001000
- dc.b %00011000,%00110000
- dc.b %00000111,%11000000;15
- mask4:
- dc.b 0,0;1
- dc.b 0,0
- dc.b 0,0
- dc.b 0,0
- dc.b 0,0
- dc.b 0,0
- dc.b 0,0
- dc.b 0,0
- dc.b 0,0
- dc.b 0,0;10
- dc.b 0,0
- dc.b 0,0
- dc.b 0,0
- dc.b 0,0
- dc.b 0,0;15
-
- ;----------------------------------KEEP TRACK OF POSITIONS BEING USED--------------------------
- x1 dc.b 0 ;keep track if x was put in position 1
- x2 dc.b 0 ;keep track if x was put in position 2
- x3 dc.b 0
- x4 dc.b 0
- x5 dc.b 0
- x6 dc.b 0
- x7 dc.b 0
- x8 dc.b 0
- x9 dc.b 0
- o1 dc.b 0 ;keep track if o was put in position 1
- o2 dc.b 0 ;keep track if o was put in positon 2
- o3 dc.b 0
- o4 dc.b 0
- o5 dc.b 0
- o6 dc.b 0
- o7 dc.b 0
- o8 dc.b 0
- o9 dc.b 0
-
- tie dc.b 0 ;if tie=9 nobody wins
-
-
-
- ;-----------------------------------------------------COORDINATES---------------------------------------------
- xo_xpos dc.w 0 ;x-coordinate of the x's and o's
- xo_ypos dc.w 0 ;y-coordinate of teh x's and o's
-
- box_x dc.w 0 ;x-coordinate of box displayed
- box_y dc.w 0 ;y-coordinate of box displayed
-
- tracker dc.w 0 ;keeps track of who's turn...
-
- itsatie:
- dc.b "Nobody Wins",0 ;if noone wins print "nobody wins"
- xwins:
- dc.b "X Wins",0
- owins:
- dc.b "O Wins",0
- tic:
- dc.b "T i c T a c T o e",0 ;words displayed at title screen
- by:
- dc.b "By:",0
- scr:
- dc.b "Steven Reagan",0 ;me the author
- _comment:
- dc.b "Tic Tac Toe by: S43R80@aol.com",0 ;description of the program
-
- end
-
-
-
-