@program prog_code,prog_name field equ 0 x equ 480 y equ 482 oldstack equ 484 stack equ 4000 prog_code: moveq #40,d0 move.l #4000,d1 lea program(pc),a0 jmp skittles[check_version] program: lea (a1),a6 lea text_start(pc),a4 lea text_end(pc),a5 jsr skittles[scroll_text] move.w #$2000,sr move.l sp,oldstack(a6) lea stack(a6),sp moveq #15,d0 moveq #2,d1 lea (a6),a1 loopt: move.b d1,(a1)+ dbra d0,loopt moveq #27,d0 loops: move.b d1,(a1) move.b d1,15(a1) lea 16(a1),a1 dbra d0,loops moveq #15,d0 loopb: move.b d1,(a1)+ dbra d0,loopb jsr skittles[cllcd] moveq #1,d0 moveq #14,d2 defo: moveq #1,d1 defi: bsr putchar bsr find_square movem.l d0/d1/a0/a1,-(sp) move.w #8,d0 jsr flib[random] move.b #0,(a5) tst.w d0 bne.s nomine move.b #1,(a5) nomine: movem.l (sp)+,d0/d1/a0/a1 addq.w #1,d1 cmp.w #15,d1 bne.s defi addq.w #1,d0 cmp.w #29,d0 bne.s defo moveq #0,d0 move.b d0,17(a6) move.b d0,30(a6) move.b d0,449(a6) move.b d0,462(a6) move.w #1,x(a6) move.w #1,y(a6) moveq #0,d7 bra.s okee mainlp: tst.w $75b0 beq.s mainlp clr.w $75b0 move.w $75b2,d7 okee: moveq #0,d6 move.w x(a6),d0 moveq #0,d1 moveq #0,d2 bsr putchar moveq #15,d1 bsr putchar moveq #0,d0 move.w y(a6),d1 bsr putchar moveq #29,d0 bsr putchar cmp.w #338,d7 seq d6 add.w d6,d6 cmp.w #342,d7 seq d6 add.w d6,d6 cmp.w #339,d7 seq d6 tst.w d6 beq.s no_up cmp.w #1,d1 beq.s no_up subq.w #1,d1 no_up: moveq #0,d6 cmp.w #344,d7 seq d6 add.w d6,d6 cmp.w #345,d7 seq d6 add.w d6,d6 cmp.w #348,d7 seq d6 tst.w d6 beq.s no_down cmp.w #14,d1 beq.s no_down addq.w #1,d1 no_down: move.w d1,y(a6) move.w x(a6),d0 moveq #0,d6 cmp.w #345,d7 seq d6 add.w d6,d6 cmp.w #337,d7 seq d6 add.w d6,d6 cmp.w #339,d7 seq d6 tst.w d6 beq.s no_left cmp.w #1,d0 beq.s no_left subq.w #1,d0 no_left: moveq #0,d6 cmp.w #340,d7 seq d6 add.w d6,d6 cmp.w #342,d7 seq d6 add.w d6,d6 cmp.w #348,d7 seq d6 tst.w d6 beq.s no_right cmp.w #28,d0 beq.s no_right addq.w #1,d0 no_right move.w d0,x(a6) moveq #0,d1 moveq #11,d2 bsr putchar moveq #15,d1 moveq #12,d2 bsr putchar moveq #0,d0 move.w y(a6),d1 moveq #9,d2 bsr putchar moveq #29,d0 moveq #10,d2 bsr putchar move.w x(a6),d0 bsr find_square cmp.w #268,d7 bne.s no_flag cmp.b #4,(a5) beq.s no_flag bchg #1,(a5) beq.s unflag moveq #14,d2 bsr putchar bra.s no_step unflag: moveq #13,d2 bsr putchar no_flag: cmp.w #272,d7 bne.s no_step cmp.b #1,(a5) bgt.s no_step beq.s dead bsr step no_step: bsr.s checkwin cmp.w #264,d7 bne mainlp exitit: move.w #$2700,sr jsr skittles[wait_esc] move.l oldstack(a6),sp rts checkwin lea (a6),a0 move.w #479,d0 cwl: tst.b (a0)+ beq.s return dbra d0,cwl bsr.s clrtop moveq #1,d1 moveq #0,d0 lea message_win(pc),a1 jsr skittles[text] bra.s exitit clrtop: lea LCD_MEM,a5 moveq #0,d0 moveq #59,d1 lclrtop: move.l d0,(a5)+ dbra d1,lclrtop return: rts dead: bsr clrtop moveq #1,d1 moveq #0,d0 lea message_lose(pc),a1 jsr skittles[text] bra.s exitit message_lose: dc.b "YOU LOSE!!!!!!!!!!!!!!!!!!!! Press ESC ",0 message_win: dc.b "Wow!!! You won MineSwp 92!!! Press ESC ",0 putchar: movem.l d0/d1/d2/a0/a1,-(sp) lea LCD_MEM,a0 mulu #240,d1 add.w d1,a0 add.w d0,a0 lsl.w #3,d2 lea chars(pc),a1 add.w d2,a1 moveq #7,d2 loopc: move.b (a1)+,(a0) lea 30(a0),a0 dbra d2,loopc movem.l (sp)+,d0/d1/d2/a0/a1 rts find_square: move.w d0,d3 lsl.w #4,d3 add.w d1,d3 lea 0(a6,d3.w),a5 rts s2: bsr.s putchar tst.w d2 bne.s nostep subq.w #1,d0 ;(-1,0) bsr.s step addq.w #2,d0 ;(1,0) bsr.s step subq.w #1,d1 ;(1,-1) bsr.s step subq.w #1,d0 ;(0,-1) bsr.s step subq.w #1,d0 ;(-1,-1) bsr.s step addq.w #2,d1 ;(-1,1) bsr.s step addq.w #2,d0 ;(1,1) bsr.s step subq.w #1,d0 ;(0,1) bsr.s step subq.w #1,d1 ;(0,0) nostep: rts step: bsr.s find_square tst.b (a5) bne.s nostep move.b #4,(a5) moveq #0,d2 btst #0,-17(a5) beq.s tl1 addq.w #1,d2 tl1: btst #0,-16(a5) beq.s tl2 addq.w #1,d2 tl2: btst #0,-15(a5) beq.s tl3 addq.w #1,d2 tl3: btst #0,-1(a5) beq.s tl4 addq.w #1,d2 tl4: btst #0,1(a5) beq.s tl5 addq.w #1,d2 tl5: btst #0,15(a5) beq.s tl6 addq.w #1,d2 tl6: btst #0,16(a5) beq.s tl7 addq.w #1,d2 tl7: btst #0,17(a5) beq.s tl8 addq.w #1,d2 tl8: bra s2 chars: dc.b %00000000 dc.b %00000000 dc.b %00000000 dc.b %00000000 dc.b %00000000 dc.b %00000000 dc.b %00000000 dc.b %00000000 dc.b %00000000 dc.b %00001000 dc.b %00011000 dc.b %00101000 dc.b %00001000 dc.b %00001000 dc.b %01111110 dc.b %00000000 dc.b %00000000 dc.b %00011000 dc.b %00100100 dc.b %00000100 dc.b %00001000 dc.b %00010000 dc.b %00111100 dc.b %00000000 dc.b %00011000 dc.b %00100100 dc.b %00000100 dc.b %00111000 dc.b %00000100 dc.b %00100100 dc.b %00011000 dc.b %00000000 dc.b %00000000 dc.b %00100100 dc.b %00100100 dc.b %00100100 dc.b %00111110 dc.b %00000100 dc.b %00000100 dc.b %00000000 dc.b %00000000 dc.b %00111100 dc.b %00100000 dc.b %00111100 dc.b %00000100 dc.b %00100100 dc.b %00011000 dc.b %00000000 dc.b %00000000 dc.b %00011100 dc.b %00100000 dc.b %00111000 dc.b %00100100 dc.b %00100100 dc.b %00011000 dc.b %00000000 dc.b %00000000 dc.b %00111100 dc.b %00000100 dc.b %00001000 dc.b %00010000 dc.b %00100000 dc.b %00100000 dc.b %00000000 dc.b %00000000 dc.b %00011000 dc.b %00100100 dc.b %00011000 dc.b %00011000 dc.b %00100100 dc.b %00011000 dc.b %00000000 dc.b %00011000 ;9 dc.b %00001100 dc.b %00000110 dc.b %11111111 dc.b %11111111 dc.b %00000110 dc.b %00001100 dc.b %00011000 dc.b %00011000 ;10 dc.b %00110000 dc.b %01100000 dc.b %11111111 dc.b %11111111 dc.b %01100000 dc.b %00110000 dc.b %00011000 dc.b %00000000 ;11 dc.b %00011000 dc.b %00011000 dc.b %10011001 dc.b %11011011 dc.b %01111110 dc.b %00111100 dc.b %00011000 dc.b %00011000 ;12 dc.b %00111100 dc.b %01111110 dc.b %11011011 dc.b %10011001 dc.b %00011000 dc.b %00011000 dc.b %00011000 dc.b %00000000 ;13 dc.b %00000100 dc.b %00011100 dc.b %01111100 dc.b %00000100 dc.b %00000100 dc.b %00000100 dc.b %00000000 dc.b %10001000 ;14 dc.b %00000001 dc.b %00000000 dc.b %00000000 dc.b %10000000 dc.b %00000001 dc.b %00000000 dc.b %01000100 prog_name: dc.b "1.0.006 / Patrick Davidson",0 text_start: dc.b " " dc.b "Welcome to MineSwp 92! This is " dc.b "a minesweeper-style game. Press any " dc.b "key to start the game. In the " dc.b "game, use the cursor pad to " dc.b "move around. To step on a " dc.b "square, press F5. To flag a " dc.b "square, press F1. " dc.b "To give you a good start, you can " dc.b "step on the four corners as they are always safe. " dc.b "This game was programmed by " dc.b "Patrick Davidson. It was finished " dc.b "on June 22, 1997. To contact me, " dc.b "send E-Mail to ariwsi@juno.com " dc.b " " text_end: reloc_open add_library skittles add_library flib reloc_close end