;DeMine V1.0 by CandyMan (Gervaise Philippe) include "doorsos.h" include "graphlib.h" include "userlib.h" xdef _main xdef _comment xdef _ti89 wait MACRO move.l d1,-(a7) move.l \1,d1 \waitloop nop nop nop nop nop nop dbra d1,\waitloop move.l (a7)+,d1 ENDM _main set_for_menu: move.w #1,-(a7) ;on choisit la fonte jsr doorsos::FontSetSys ; lea 2(a7),a7 ;on restore la pile jsr graphlib::clr_scr ;on efface l'ecran jsr graphlib::gray4 move.w #1,graphlib::choosescreen move.l graphlib::plane1,a1 jsr graphlib::clr_scr ;******************************************************************************* ;******************************************************************************* ;******************************************************************************* changenmine: move.l graphlib::plane0,a1 ;choisit le plan 1 comme plan courant move.w #30,d0 ;Affiche le premier plan du titre move.w #0,d1 ; move.b #%11111111,d3 ; move.l #title_plan1,a0 ; jsr graphlib::put_sprite_mask ; move.l graphlib::plane1,a1 ;choisit le plan 2 comme plan courant move.w #30,d0 ;Affiche le deuxieme plan du titre move.w #0,d1 ; move.b #%11111111,d3 ; move.l #title_plan2,a0 ; jsr graphlib::put_sprite_mask ; move.l graphlib::plane0,a1 ;choisit le plan 1 comme plan courant move.w #45,d0 ;Affiche le premier plan du titre move.w #15,d1 ; move.b #%11111111,d3 ; move.l #by_plan1,a0 ; jsr graphlib::put_sprite_mask ; move.l graphlib::plane1,a1 ;choisit le plan 2 comme plan courant move.w #45,d0 ;Affiche le deuxieme plan du titre move.w #15,d1 ; move.b #%11111111,d3 ; move.l #by_plan2,a0 ; jsr graphlib::put_sprite_mask ; move.l graphlib::plane0,a1 ;choisit le plan 1 comme plan courant move.w #0,-(a7) ;on choisit la fonte (petite) jsr doorsos::FontSetSys ; lea 2(a7),a7 ;on restore la pile move.w #36,d0 move.w #29,d1 move.l #mail,a0 bsr writestr move.w #1,-(a7) ;on choisit la fonte (moyenne) jsr doorsos::FontSetSys ; lea 2(a7),a7 ;on restore la pile move.w #0,d0 ;Ecrit la chaine "Difficulty < >" move.w #40,d1 ; move.l #difficulty_str,a0 ; bsr writestr ; move.l graphlib::plane0,a1 ;choisit le plan 1 comme plan courant move.w #0,-(a7) ;Ecrit "Best times" en inverse move.l #highscore,-(a7) ; move.w #60,-(a7) ;Ecrit en (57,50) move.w #47,-(a7) ; jsr doorsos::DrawStrXY ; lea 10(a7),a7 ;Remet la pile comme avant move.w #0,d0 move.w #70,d1 move.l #score1,a0 bsr writestr move.w #0,d0 move.w #80,d1 move.l #score2,a0 bsr writestr move.w #0,d0 move.w #90,d1 move.l #score3,a0 bsr writestr wait_choice: move.b difficulty,d0 cmp.b #1,d0 bne test_normal move.l #diff_easy,a0 move.b #20,nmine bra write_difficulty test_normal cmp.b #2,d0 bne test_hard move.l #diff_normal,a0 move.b #30,nmine bra write_difficulty test_hard: cmp.b #3,d0 bne write_difficulty move.l #diff_hard,a0 move.b #40,nmine bra write_difficulty write_difficulty: move.w #0,-(a7) ;Ecrit le choix de la difficulte move.l a0,-(a7) ; move.w #40,-(a7) ;Ecrit en (75,40) en inverse (0) move.w #75,-(a7) ; jsr doorsos::DrawStrXY ; lea 10(a7),a7 ;Remet la pile comme avant jsr userlib::idle_loop cmp.w #338,d0 beq dec_difficulty cmp.w #344,d0 beq inc_difficulty cmp.w #13,d0 beq startgame cmp.w #264,d0 bne wait_choice clr.w graphlib::choosescreen jsr graphlib::gray2 rts ;sort du programme dec_difficulty: sub.b #1,difficulty tst.b difficulty bne wait_choice move.b #3,difficulty bra wait_choice inc_difficulty: add.b #1,difficulty move.b difficulty,d0 cmp.b #4,d0 bne wait_choice move.b #1,difficulty bra wait_choice ;******************************************************************************* ;******************************************************************************* ;******************************************************************************* startgame: move.b #1,posx ;position x du curseur move.b #1,posy ;position y du curseur move.b #0,nblock ;nombre de bloc demines move.b #0,boom_value move.b #0,win move.w #0,timer move.w #0,sec move.b #1,currentx move.b #1,currenty move.l #time,a0 ;efface le temps du jeu precedent moveq #2,d0 ; \timeloop ; move.b #32,(a0)+ ; dbra d0,\timeloop ; move.w #0,-(a7) ;on choisit la petite fonte jsr doorsos::FontSetSys ; lea 2(a7),a7 ;on restore la pile clr.w graphlib::choosescreen jsr graphlib::gray2 move.l #data,a0 ;mise a 1 des donnees move #143,d0 ;on va remplir 144 cases \loop: move.b #1,(a0)+ dbra d0,\loop jsr graphlib::clr_scr ;generation du champs de mine moveq #0,d0 move.b nmine,d6 ;d6 -> nombre de mines restant a mettre restartloop: move.b #145,d7 ;Nombre de cases a gerer move.l #data,a0 ;Adresse de la premiere case du terrain dataloop: sub.b #1,d7 ;est-t-on a la derniere case ? tst.b d7 beq restartloop ;si oui on recommence a la deuxieme case add.l #1,a0 ;nouvelle case courante : la suivante move.b (a0),d0 ;y a-t-il une mine sur la case courante cmp.b #3,d0 ; beq dataloop ;si oui on va a la case suivante move.b #14,d0 ; jsr userlib::random ;determine aleatoirement si une mine sera sur la case cmp.b #1,d0 ; bne dataloop ;si pas de mine (>1) -> case suivante move.b #3,(a0) ;on met une mine sur la case sub.b #1,d6 ;une mine en moins dans le compteur tst.b d6 ;on verifie s'il reste encore des mines a mettre bne dataloop ;si oui on passe a la case suivante jsr graphlib::clr_scr ;efface l'ecran bsr drawgrid ;affiche l'ecran de jeu move.l #c_cursor,a0 ;affiche le curseur dans la case (0,0) bsr draw_mouse ; bsr change_int move.w #0,-(a7) jsr doorsos::ST_busy pea info(pc) jsr doorsos::ST_showHelp lea 6(a7),a7 bsr writeinfo bra waitkey ;******************************************************************************* ;******************************************************************************* ;******************************************************************************* getstr: move.l #name_empty,a2 ;rempli la chaine d espaces moveq #9,d7 \loopstr move.b #32,(a2)+ dbra d7,\loopstr move.l #name_empty,a2 moveq #0,d7 ;d7 -> position dans la chaine get_new_car: move.l #name_empty,a0 move.w #83,d0 move.w #20,d1 bsr writestr jsr userlib::idle_loop cmp.w #13,d0 ;validation de l entree beq end_getstr cmp.w #257,d0 ;backspace beq del_car bra add_car del_car tst d7 beq get_new_car sub.l #1,a2 move.b #32,(a2) sub.b #1,d7 bra get_new_car add_car cmp.b #10,d7 beq get_new_car add.b #1,d7 move.b d0,(a2)+ bra get_new_car end_getstr: rts ;******************************************************************************* ;******************************************************************************* ;******************************************************************************* waitkey: tst.b boom_value bne boom tst.b win bne win_game move.w timer,d0 cmp.w #350,d0 blt no_inc_sec add.w #1,sec move.w #0,timer bsr writetime no_inc_sec: move.w #%11111110,d0 ;pour les touches de directions bsr getkey btst #0,d0 beq m_top btst #1,d0 beq m_left btst #2,d0 beq m_bottom btst #3,d0 beq m_right btst #4,d0 beq put_flag btst #5,d0 bne check_escape bsr demine_case check_escape: move.w #%10111111,d0 ;pour la touche Esc bsr getkey btst #0,d0 bne waitkey ;******************************************************************************* ;******************************* Si on a perdu ********************************* ;******************************************************************************* boom: bsr restore_int bsr load_screen moveq #0,d7 ;affichage de la position des mines miney: moveq #0,d6 minex: moveq #0,d0 moveq #0,d1 move.b d6,d0 move.b d7,d1 asl #4,d1 add.b d0,d1 move.l #data,a0 add.l d1,a0 move.b (a0),d0 cmp.b #3,d0 ;y a-t-il une mine sur la case courante blt drawempty drawmine: ;il y a une mine, on affiche une mine move.l d6,d0 move.l d7,d1 move.l #c_mine,a0 bsr drawblock bra nextdraw drawempty: ;il y a pas de mine, on affiche un bloc vide move.l d6,d0 move.l d7,d1 move.l #c_empty,a0 bsr drawblock nextdraw: add.b #1,d6 cmp.b #16,d6 bne minex ;Regarde s'il reste des cases dans la ligne courante add.b #1,d7 cmp.b #9,d7 bne miney ;regarde s'il reste encore des lignes a traiter jsr userlib::idle_loop ;on attends une frappe de touche jsr userlib::idle_loop ;on attends une frappe de touche jsr graphlib::clr_scr ;on efface l'ecran move.w #1,-(a7) ;on choisit la fonte jsr doorsos::FontSetSys ; lea 2(a7),a7 ;on restore la pile bra set_for_menu ;on revient a l'ecran principal ;******************************************************************************* ;******************************************************************************* ;******************************************************************************* put_flag: moveq #0,d0 move.b posy,d0 sub.b #1,d0 asl #4,d0 add.b posx,d0 sub.b #1,d0 move.l #data,a0 add.l d0,a0 move.b (a0),d0 tst.b d0 beq waitkey cmp.b #1,d0 ;si case = 1 alors on met un flag beq draw_flag cmp.b #3,d0 ;si case = 3 alors on met un flag beq draw_flag sub.b #1,d0 move.b d0,(a0) bsr load_screen move.l #c_full,a0 clr.w d0 move.b posx,d0 sub.b #1,d0 clr.w d1 move.b posy,d1 sub.b #1,d1 bsr drawblock bsr draw_mouse wait #40000 bra waitkey draw_flag: add.b #1,d0 move.b d0,(a0) bsr load_screen move.l #c_flag,a0 clr.w d0 move.b posx,d0 sub.b #1,d0 clr.w d1 move.b posy,d1 sub.b #1,d1 bsr drawblock bsr draw_mouse wait #40000 bra waitkey ;******************************************************************************* ;******************************************************************************* ;******************************************************************************* load_screen: move.w #0,d0 move.b posx,d0 sub.b #1,d0 mulu #9,d0 add.b startx,d0 add.b #5,d0 asr.w #3,d0 sub.b #1,d0 move.w #0,d1 move.b currenty,d1 add.b #4,d1 move.w #4,d2 move.w #16,d3 move.w handle,d4 jsr graphlib::memtoscr rts save_screen: move.w #0,d0 move.b posx,d0 sub.b #1,d0 mulu #9,d0 add.b startx,d0 add.b #5,d0 asr.w #3,d0 sub.b #1,d0 move.w #0,d1 move.b currenty,d1 add.b #4,d1 move.w #4,d2 move.w #16,d3 jsr graphlib::scrtomem move.w d4,handle rts ;******************************************************************************* ;******************************************************************************* ;******************************************************************************* draw_mouse: bsr save_screen moveq #0,d0 moveq #0,d1 move.b currentx,d0 add.b #13,d0 move.b currenty,d1 add.b #4,d1 move.l #c_mouse,a0 move.l #c_mousemask,a2 jsr graphlib::put_sprite2 rts ;******************************************************************************* ;******************************************************************************* ;******************************************************************************* win_game: bsr restore_int move.w #1,-(a7) ;on choisit la fonte jsr doorsos::FontSetSys ; lea 2(a7),a7 ;on restore la pile jsr graphlib::clr_scr ;on efface l'ecran move.w #0,d0 move.w #0,d1 move.l #won_str,a0 bsr writestr jsr userlib::idle_loop jsr graphlib::clr_scr ;on efface l'ecran move.b difficulty,d0 cmp.b #1,d0 beq score_easy cmp.b #2,d0 beq score_normal cmp.b #3,d0 beq score_hard beq win_end score_easy: move.w score_sec1,d0 cmp.w sec,d0 ble no_high bsr new_high move.l #score1,a0 move.w sec,score_sec1 bra score_end score_normal: move.w score_sec2,d0 cmp.w sec,d0 ble no_high bsr new_high move.l #score2,a0 move.w sec,score_sec2 bra score_end score_hard: move.w score_sec3,d0 cmp.w sec,d0 ble no_high bsr new_high move.l #score3,a0 move.w sec,score_sec3 bra score_end score_end: move.l a0,a1 add.l #9,a1 ;ecrit le nom dans le tableau des scores move.l #name_empty,a2 ; moveq #9,d0 ; \loopwin move.b (a2)+,(a1)+ ; dbra d0,\loopwin ; move.l a0,a1 ;efface l'ancien temps dans le tableau add.l #23,a1 ; move.b #32,(a1)+ ; move.b #32,(a1)+ ; move.b #32,(a1)+ ; add.l #25,a0 ;ecrit le temps dans le tableau des scores move.w sec,d0 ; bsr writed0 ; bra win_end no_high: win_end: bra set_for_menu new_high: jsr graphlib::clr_scr ;on efface l'ecran move.w #5,d0 move.w #0,d1 move.l #wow_str,a0 bsr writestr move.w #5,d0 move.w #20,d1 move.l #name_str,a0 bsr writestr bsr getstr rts ;******************************************************************************* ;*********************** Gere les mouvements************************************ ;******************************************************************************* m_top: ;On va en haut move.b currenty,d0 ;peut-on aller en haut ? cmp.b #9,d0 ; ble waitkey ; bsr load_screen sub.b #9,currenty bra m_all m_bottom: ;on va en bas move.b currenty,d0 ;peut-on aller en bas ? cmp.b #72,d0 ; bge waitkey ; bsr load_screen add.b #9,currenty bra m_all m_left: ;on va a gauche move.w #0,d0 move.b currentx,d0 ;peut-on aller a gauche ? cmp.w #9,d0 ble waitkey bsr load_screen sub.b #9,currentx bra m_all m_right: ;on va a droite move.w #0,d0 move.b currentx,d0 ;peut-on aller a droite ? cmp.w #135,d0 ; bge waitkey ; bsr load_screen add.b #9,currentx bra m_all m_all: moveq #0,d0 move.b currentx,d0 sub.b #1,d0 divu #9,d0 move.b d0,posx add.b #1,posx moveq #0,d0 move.b currenty,d0 sub.b #1,d0 divu #9,d0 move.b d0,posy add.b #1,posy move.l #c_cursor,a0 bsr draw_mouse lea nbmine_empty(pc),a0 ;efface le nombre de mines move.w #8,d0 ; move.w #85,d1 ; bsr writestr ; bsr countbomb moveq #0,d0 ;teste si la case a ete demine move.l #data,a0 ;dans ce cas on affiche le move.b posy,d0 ;nombre de mines autour de la case sub.b #1,d0 ; asl #4,d0 ; add.b posx,d0 ; sub.b #1,d0 ; add.l d0,a0 ; move.b (a0),d0 ; tst.b d0 ; bne invalid_case ; lea nbmine(pc),a0 ; bsr writenb ;affiche le nombre de mines invalid_case: wait #40000 ;attente pour les touches bra waitkey ;******************************************************************************* ;******************************************************************************* ;******************************************************************************* ;affiche un bloc contenu dans a0 a la position (d0,d1) relative au quadrillage ; drawblock: mulu #9,d0 add.b #1,d0 add.b startx,d0 mulu #9,d1 add.b #1,d1 add.b starty,d1 move.b #%11111111,d3 jsr graphlib::put_sprite_mask rts drawgrid: ;affiche la grille et les cases ;Lignes horizontales move.w #2,d3 move.w #9,d0 ;x1 move.w #153,d2 ;x2 move.w #0,d1 ;y1 gridhoriz: jsr graphlib::horiz ;on dessine une ligne horizontale add.w #9,d1 cmp.w #90,d1 bne gridhoriz ;Lignes verticales move.w #9,d0 ;x1 move.w #0,d1 ;y1 move.w #81,d2 ;y2 gridvert: jsr graphlib::vert ;on dessine une ligne verticale add.w #9,d0 cmp.w #162,d0 bne gridvert move.l #c_full,a0 ;bloc a afficher (case pleine) move.w #0,d7 blocky: move.w #0,d6 blockx: move.b d6,d0 move.b d7,d1 bsr drawblock add.b #1,d6 cmp.b #16,d6 bne blockx add.b #1,d7 cmp.b #9,d7 bne blocky rts ;******************************************************************************* ;******************************************************************************* ;******************************************************************************* writestr: move.w #4,-(a7) ;d0->x, d1->y, a0 -> adresse de la chaine move.l a0,-(a7) ; move.w d1,-(a7) ; move.w d0,-(a7) ; jsr doorsos::DrawStrXY ; lea 10(a7),a7 ;Remet la pile comme avant rts ;******************************************************************************* ;***************** Cherche recusivement les cases sans mines ******************* ;******************************************************************************* check_around: move.l (a7)+,a6 ;sauvegarde PC precedent move.b (a7)+,posx ;depile posx move.b (a7)+,posy ;depile posy move.l a6,-(a7) ;restaure PC precedent move.b posx,d0 ;posx est-il hors limite ? (<1) tst.b d0 bne xsup0 rts xsup0: cmp.b #17,d0 ;posx est-il hors limite ? (>16) bne xinf16 rts xinf16: move.b posy,d0 ;posy est-il hors limite ? (<1) tst.b d0 bne ysup0 rts ysup0: cmp.b #10,d0 ;posy est-il hors limite ? (>9) bne yinf9 rts yinf9: moveq #0,d0 ;est-on deja passe sur la case courante ? move.l #mdata,a0 ; move.l #data,a2 ; move.b posy,d0 ; sub.b #1,d0 ; asl #4,d0 ; add.b posx,d0 ; sub.b #1,d0 ; add.l d0,a0 ; add.l d0,a2 ; move.b (a0),d0 ; tst.b d0 ; beq valid_case ;si non on continue rts ;si oui on quitte valid_case: move.b #1,(a0) ;la case est maintenant consideree comme faite move.b (a2),d0 ;la case est-elle deja deminee ? tst.b d0 ; bne not_new ;si non on la demine rts not_new: move.b #0,(a2) ; add.b #1,nblock ;donc une case en plus sur 144 move.w #0,d0 ;on affiche la case move.w #0,d1 ; move.b posx,d0 ; sub.b #1,d0 move.b posy,d1 ; sub.b #1,d1 move.l #c_empty,a0 ; bsr drawblock ; bsr countbomb ;on compte le nombre de mines autour move.b nbomb,d0 ; tst.b d0 ;en a-t-on 0 ? beq no_exit ;si oui on continue rts ;si non on quitte no_exit: sub.b #1,posx sub.b #1,posy move.l #2,d7 \loopx move.b posy,-(a7) move.b posx,-(a7) move.l d7,-(a7) move.b posy,-(a7) move.b posx,-(a7) bsr check_around move.l (a7)+,d7 move.b (a7)+,posx move.b (a7)+,posy add.b #1,posx dbra d7,\loopx sub.b #3,posx add.b #1,posy move.l #2,d7 \loopx2 move.b posy,-(a7) move.b posx,-(a7) move.l d7,-(a7) move.b posy,-(a7) move.b posx,-(a7) bsr check_around move.l (a7)+,d7 move.b (a7)+,posx move.b (a7)+,posy add.b #1,posx dbra d7,\loopx2 sub.b #3,posx add.b #1,posy move.l #2,d7 \loopx3 move.b posy,-(a7) move.b posx,-(a7) move.l d7,-(a7) move.b posy,-(a7) move.b posx,-(a7) bsr check_around move.l (a7)+,d7 move.b (a7)+,posx move.b (a7)+,posy add.b #1,posx dbra d7,\loopx3 rts ;******************************************************************************* ;******************************************************************************* ;******************************************************************************* demine_case: bsr load_screen move.l #data,a0 moveq #0,d0 move.b posy,d0 sub.b #1,d0 mulu #16,d0 add.b posx,d0 sub.b #1,d0 add.l d0,a0 ;ao pointe sur la position du curseur dans data move.b (a0),d0 ;on est sur une mine ? (d0 >= 3 = oui) cmp.b #3,d0 ; bne no_boom ; move.b #1,boom_value ;dans ce cas boom ! bsr draw_mouse ; rts ; no_boom: move.b (a0),d0 ;on regarde si on est deja alle sur cette case tst.b d0 beq no_case move.l #mdata,a0 ;mise a 0 des donnees move #143,d0 ;on va remplir 144 cases \loop: move.b #0,(a0)+ dbra d0,\loop move.b posy,-(a7) move.b posx,-(a7) move.l d7,-(a7) move.b posy,-(a7) move.b posx,-(a7) bsr check_around move.l (a7)+,d7 move.b (a7)+,posx move.b (a7)+,posy move.b #144,d0 ;on regarde si on a demine toutes les cases sub.b nmine,d0 ; cmp.b nblock,d0 ; bne no_case move.b #1,win ;On a gagne, Win=1 wait #65000 rts no_case: bsr draw_mouse lea nbmine(pc),a0 bsr writenb bsr writeinfo rts ;******************************************************************************* ;**************** Affiche le nombre de mines autour du curseur ***************** ;******************************************************************************* countbomb: move.b #0,nbomb ;nombre de mines autour du curseur, 0 move.l #data,a0 moveq #0,d0 move.b posy,d0 sub.b #1,d0 mulu #16,d0 add.b posx,d0 sub.b #1,d0 add.l d0,a0 ;ao pointe sur la position du curseur dans data bomb_left: sub.l #1,a0 move.b posx,d0 cmp.b #1,d0 beq bomb_right move.b (a0),d0 cmp.b #3,d0 blt bomb_lefttop add.b #1,nbomb bomb_lefttop: move.b posy,d0 cmp.b #1,d0 beq bomb_right sub.l #16,a0 move.b (a0),d0 add.l #16,a0 cmp.b #3,d0 blt bomb_right add.b #1,nbomb bomb_right: add.l #2,a0 move.b posx,d0 cmp.b #16,d0 beq bomb_top move.b (a0),d0 cmp.b #3,d0 blt bomb_rightbottom add.b #1,nbomb bomb_rightbottom: move.b posy,d0 cmp.b #9,d0 beq bomb_top add.l #16,a0 move.b (a0),d0 sub.l #16,a0 cmp.b #3,d0 blt bomb_top add.b #1,nbomb bomb_top: sub.l #17,a0 move.b posy,d0 cmp.b #1,d0 beq bomb_bottom move.b (a0),d0 cmp.b #3,d0 blt bomb_righttop add.b #1,nbomb bomb_righttop: move.b posx,d0 cmp.b #16,d0 beq bomb_bottom add.l #1,a0 move.b (a0),d0 sub.l #1,a0 cmp.b #3,d0 blt bomb_bottom add.b #1,nbomb bomb_bottom: add.l #32,a0 move.b posy,d0 cmp.b #9,d0 beq count_end move.b (a0),d0 cmp.b #3,d0 blt bomb_leftbottom add.b #1,nbomb bomb_leftbottom: move.b posx,d0 cmp.b #1,d0 beq count_end sub.l #1,a0 move.b (a0),d0 add.l #1,a0 cmp.b #3,d0 blt count_end add.b #1,nbomb count_end: rts ;******************************************************************************* ;******************************************************************************* ;******************************************************************************* writenb: move.b nbomb,d0 ;Ecrit le nombre de mines autour du curseur add.b #48,d0 ; move.b d0,(a0) ; move.w #8,d0 move.w #85,d1 bsr writestr rts ;******************************************************************************* ;******************************************************************************* ;******************************************************************************* writetime: lea time(pc),a0 add.l #3,a0 moveq #0,d0 move.w sec,d0 bsr writed0 move.l #time,a0 move.w #70,d0 move.w #85,d1 bsr writestr rts ;******************************************************************************* ;******************************************************************************* ;******************************************************************************* writeinfo: lea blockinfo(pc),a0 add.l #8,a0 moveq #3,d0 \loop move.b #32,(a0)+ dbra d0,\loop lea blockinfo(pc),a0 ; add.l #11,a0 moveq #0,d0 move.b nblock,d0 bsr writed0 move.l #blockinfo,a0 move.w #94,d0 move.w #85,d1 bsr writestr rts ;******************************************************************************* ;************ taduit le nombre d0 en caractere dans la chaine en a0 ************ ;******************************************************************************* writed0: moveq #0,d1 divu #10,d0 ;apres, d0->prochain nombre,d1->chiffre voulu swap d0 move.w d0,d1 clr.w d0 swap d0 ;d0 -> prochain nombre; d1 -> chiffre a afficher add.b #48,d1 ;on affiche le chiffre move.b d1,(a0) ;on le met dans la chaine sub.l #1,a0 ;on modifie le pointeur sur la chaine cmp.w #0,d0 ;on regarde s'il reste encore des chiffres bne writed0 rts ;******************************************************************************* ;******************************************************************************* ;******************************************************************************* change_int: clr.l d0 move.w #$0700,d0 trap #1 bclr.b #2,($600001) move.l ($64),old_int move.l #new_int,($64) bset.b #2,($600001) trap #1 rts restore_int: clr.l d0 move.w #$0700,d0 trap #1 bclr.b #2,($600001) move.l old_int,($64) bset.b #2,($600001) trap #1 rts new_int: add.w #1,timer rte ;******************************************************************************* ;******************************************************************************* ;******************************************************************************* getkey: move.w d0,($600018) nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop clr.w d0 move.b ($60001B),d0 rts ;******************************************************************************* ;******************************** Donnees ************************************** ;******************************************************************************* c_mouse: dc.w 16 dc.w 1 dc.b %10000000 dc.b %11000000 dc.b %10100000 dc.b %10010000 dc.b %10001000 dc.b %10000100 dc.b %10000010 dc.b %10000001 dc.b %10000001 dc.b %10000111 dc.b %10010100 dc.b %10101010 dc.b %11001010 dc.b %10000101 dc.b %00000101 dc.b %00000011 c_mousemask: dc.b %10000000 dc.b %11000000 dc.b %11100000 dc.b %11110000 dc.b %11111000 dc.b %11111100 dc.b %11111110 dc.b %11111111 dc.b %11111111 dc.b %11111111 dc.b %11111100 dc.b %11101110 dc.b %11001110 dc.b %10000111 dc.b %00000111 dc.b %00000011 c_cursor: dc.w 8 dc.w 1 dc.b %00000000 dc.b %00111100 dc.b %01100110 dc.b %01011010 dc.b %01011010 dc.b %01100110 dc.b %00111100 dc.b %00000000 c_full: dc.w 8 dc.w 1 dc.b %01010101 dc.b %10101010 dc.b %01010101 dc.b %10101010 dc.b %01010101 dc.b %10101010 dc.b %01010101 dc.b %10101010 c_flag: dc.w 8 dc.w 1 dc.b %01001001 dc.b %00100100 dc.b %10010010 dc.b %01001001 dc.b %00100100 dc.b %10010010 dc.b %01001001 dc.b %00100100 c_empty: dc.w 8 dc.w 1 dc.b %00000000 dc.b %00000000 dc.b %00000000 dc.b %00000000 dc.b %00000000 dc.b %00000000 dc.b %00000000 dc.b %00000000 c_mine: dc.w 8 dc.w 1 dc.b %10000001 dc.b %01011010 dc.b %00100100 dc.b %01011010 dc.b %01011010 dc.b %00100100 dc.b %01011010 dc.b %10000001 title_plan1: dc.w 18 dc.w 13 dc.b %00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%10000000,%00000010 dc.b %00000000,%00000000,%00000000 dc.b %11110000,%00000000,%00000001,%10000110,%00011000,%00000000,%00000000,%00000001,%10000011,%10000111 dc.b %00000000,%00000111,%11000000 dc.b %11111100,%00000000,%00000011,%10001110,%00011000,%00000000,%00000000,%00000001,%11000011,%10011110 dc.b %00000000,%00001111,%11100000 dc.b %11111111,%00000000,%00000011,%10001110,%00000000,%00000000,%00000000,%00000000,%11000011,%00011111 dc.b %00000000,%00011100,%01100000 dc.b %11100111,%10000001,%00000011,%11001111,%00000001,%10000000,%00000000,%00000000,%11000111,%00000111 dc.b %00000000,%00011000,%01110000 dc.b %11100011,%10001111,%11000011,%11011111,%00011001,%11111000,%01111100,%00000000,%11100110,%00000111 dc.b %00000000,%00111000,%01110000 dc.b %11100001,%11011111,%11000011,%11011111,%00011001,%11111100,%11111110,%00000000,%01100110,%00000111 dc.b %00000000,%00011000,%01110000 dc.b %11100000,%11011100,%11000111,%11011011,%00011001,%11001101,%11001110,%00000000,%01101110,%00000111 dc.b %00000000,%00111000,%01110000 dc.b %11100000,%11011111,%11000110,%11111011,%00011001,%11001101,%11111100,%00000000,%01111100,%00000111 dc.b %00000000,%00011000,%01110000 dc.b %11100001,%11011111,%00000110,%11111011,%10011001,%10001101,%11110000,%00000000,%01111100,%00000111 dc.b %00000000,%00011000,%01100000 dc.b %11100001,%10011100,%11101110,%01110011,%10011001,%10001101,%11001110,%00000000,%00111100,%00000111 dc.b %00000000,%00011100,%11100000 dc.b %11111111,%10011111,%11101110,%01110001,%10011001,%10001100,%11111110,%00000000,%00111000,%00011111 dc.b %10000000,%00001111,%11000000 dc.b %11111111,%00001111,%11001100,%01100001,%10011001,%10001100,%01111100,%00000000,%00010000,%00011111 dc.b %10000011,%00000111,%10000000 dc.b %00011000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000 dc.b %00000000,%00000000,%00000000 dc.b %00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000 dc.b %00000000,%00000000,%00000000 dc.b %00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000 dc.b %00000000,%00000000,%00000000 dc.b %00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000 dc.b %00000000,%00000000,%00000000 dc.b %00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000 dc.b %00000000,%00000000,%00000000 title_plan2: dc.w 18 dc.w 13 dc.b %01000000,%00000000,%00000000,%00000100,%00000000,%00000000,%00000000,%00000000,%00000001,%00000000 dc.b %00000000,%00000011,%10000000 dc.b %01101000,%00000000,%00000001,%00001110,%00011000,%00000000,%00000000,%00000000,%11000001,%10001110 dc.b %00000000,%00001111,%11000000 dc.b %01111110,%00000000,%00000001,%10000110,%00011000,%00000000,%00000000,%00000000,%11000011,%00001111 dc.b %00000000,%00011111,%11100000 dc.b %01001110,%00000000,%00000011,%11001111,%00000000,%00000000,%00000000,%00000001,%11000111,%00011110 dc.b %00000000,%00011000,%11110000 dc.b %11001011,%00000010,%10000011,%10011110,%10011000,%00011000,%00111000,%00000000,%11100010,%00010110 dc.b %11000000,%00011000,%10100000 dc.b %01011101,%11000111,%11000011,%10101110,%11111001,%11111100,%11111100,%00000000,%01011111,%01100110 dc.b %11000000,%00011001,%10111000 dc.b %11011110,%10001111,%11100111,%11101111,%11111001,%11111100,%11111100,%00000000,%11111110,%01100110 dc.b %11000000,%00110001,%10111100 dc.b %01011101,%11111001,%11100010,%11111111,%11111001,%11111100,%11011100,%00000000,%01110100,%11100010 dc.b %11000000,%00011011,%00111100 dc.b %11011101,%11111011,%10111111,%11111011,%11111001,%11111111,%10111111,%10000000,%01101110,%11000110 dc.b %11000000,%00111011,%01100100 dc.b %11011000,%11111110,%11111110,%01110101,%01111011,%11111111,%11111111,%10000000,%00111111,%11000010 dc.b %11000000,%00011111,%01111110 dc.b %11011011,%11111111,%01110110,%11111101,%11111011,%11111111,%11110111,%10000000,%00111011,%10001111 dc.b %11000000,%00011111,%11100100 dc.b %11111111,%10001111,%11111100,%11111111,%11111011,%11111111,%11111111,%10000000,%00111111,%10011111 dc.b %11000011,%00001111,%11101100 dc.b %01111110,%00110111,%10110110,%10111111,%11111011,%11111111,%10111011,%00000000,%00111111,%10000111 dc.b %01100111,%00000011,%11001100 dc.b %00100110,%01110111,%11111101,%11001111,%10110011,%10111101,%11111111,%10000000,%00000111,%00000000 dc.b %11100010,%00000001,%11111100 dc.b %00011111,%11100001,%11111000,%10001100,%00110011,%00110001,%11011111,%10000000,%00000111,%00000001 dc.b %11100000,%00000001,%11111000 dc.b %00001111,%11000000,%11100000,%00000000,%00000000,%00000000,%00000111,%00000000,%00000000,%00000000 dc.b %11000000,%00000000,%01100000 dc.b %00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000 dc.b %00000000,%00000000,%00000000 dc.b %00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000 dc.b %00000000,%00000000,%00000000 by_plan1: dc.w 16 dc.w 10 dc.b %00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000 dc.b %01000000,%00000000,%00001111,%00000000,%00000000,%11000000,%00010001,%00000000,%00000000,%00000000 dc.b %11000000,%00000000,%00011011,%00000000,%00000000,%10000000,%00110011,%00000000,%00000000,%00000000 dc.b %01111001,%00010000,%00110000,%00110001,%01000011,%11010001,%00111011,%00001100,%01010000,%00000000 dc.b %11111101,%10110000,%00110000,%01111011,%11101111,%11110011,%00111011,%10011110,%01111000,%00000000 dc.b %11001101,%10110000,%00100000,%11001011,%10101100,%11011011,%00111111,%10110010,%11101000,%00000000 dc.b %11001100,%11100000,%00100000,%11001011,%00101100,%11001110,%01101111,%10110010,%11001000,%00000000 dc.b %01001100,%11100000,%00110111,%11011011,%00101100,%11001110,%01101100,%10110110,%11001000,%00000000 dc.b %11111000,%01100000,%00111110,%01111111,%00100111,%11001100,%01101100,%11011111,%11001000,%00000000 dc.b %00000000,%11000000,%00000000,%00000001,%00100000,%00001100,%00000000,%00000000,%01001000,%00000000 dc.b %00000000,%11000000,%00000000,%00000000,%00000000,%00001000,%00000000,%00000000,%00000000,%00000000 dc.b %00000000,%10000000,%00000000,%00000000,%00000000,%00011000,%00000000,%00000000,%00000000,%00000000 dc.b %00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000 dc.b %00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000 dc.b %00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000 dc.b %00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000 by_plan2: dc.w 16 dc.w 10 dc.b %01000000,%00000000,%00000011,%00000000,%00000000,%10000000,%00000000,%00000000,%00000000,%00000000 dc.b %11000000,%00000000,%00001111,%00000000,%00000000,%10000000,%00110011,%00000000,%00000000,%00000000 dc.b %01000000,%00000000,%00011101,%00000000,%00000000,%11000000,%00011011,%00000000,%00000000,%00000000 dc.b %11010010,%00001000,%00010000,%00011010,%10100110,%10100001,%00110011,%10000010,%10101000,%00000000 dc.b %01111011,%00011000,%00100000,%11111101,%11100111,%10011011,%00110111,%00111111,%11111000,%00000000 dc.b %01000101,%10110000,%01100000,%01111101,%01111000,%10111010,%01101010,%00010111,%01011100,%00000000 dc.b %01000101,%11110000,%01100011,%11011101,%11111000,%10111110,%00111100,%11110111,%01111100,%00000000 dc.b %11111110,%01100000,%00101010,%01101101,%01111111,%10111100,%01011111,%11011011,%01011110,%00000000 dc.b %01111111,%11011100,%00011100,%01111001,%11111111,%10110111,%11001111,%10111110,%01111111,%00000000 dc.b %00111001,%01111100,%00001100,%00111110,%11011111,%11111111,%11101111,%11111111,%10110110,%00000000 dc.b %00000111,%10011100,%00000000,%00001111,%11100011,%11111101,%11000111,%10000101,%11111000,%00000000 dc.b %00000001,%11001000,%00000000,%00000011,%00000000,%00001001,%10000000,%00000000,%11000000,%00000000 dc.b %00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000 dc.b %00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000 dc.b %00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000 dc.b %00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000 old_int dc.l 0 timer dc.w 0 sec dc.w 0 boom_value dc.b 0 win dc.b 0 posx dc.b 1 posy dc.b 1 currentx dc.b 1 currenty dc.b 1 startx dc.b 9 starty dc.b 0 handle dc.w 0 difficulty dc.b 1 nbomb dc.b 0 nblock dc.b 0 nmine dc.b 1 score_sec1 dc.w 999 score_sec2 dc.w 999 score_sec3 dc.w 999 title dc.b "DeMine V1.0 by CandyMan",0 mail dc.b "CandyMan@I-France.com",0 time dc.b " ",0 blockinfo dc.b "blocks : / 144",0 blockinfo_empty dc.b " ",0 nbmine dc.b " mine(s)",0 nbmine_empty dc.b " ",0 nminestr dc.b "Nombre de mines < >",0 info dc.b "DeMine V1.0 CandyMan@I-France.com",0 difficulty_str dc.b "Difficulty < >",0 diff_easy dc.b "Easy (20)",0 diff_normal dc.b "Normal (30)",0 diff_hard dc.b "Hard (40)",0 highscore dc.b "Best times",0 score1 dc.b "Easy CandyMan 999",0 score2 dc.b "Normal CandyMan 999",0 score3 dc.b "Hard CandyMan 999",0 score_empty dc.b " ",0 name_empty dc.b " ",0 won_str dc.b "Congratulation, you won",0 wow_str dc.b "Wow, what a great time !",0 name_str dc.b "Your name : < >",0 _comment dc.b "DeMine V1.0 by CandyMan",0 BSS ;case = 0 -> Vide decouvert ;case = 1 -> Vide non decouvert ;case = 2 -> Vide non decouvert avec un drapeau ;case = 3 -> Mine ;case = 4 -> Mine avec un drapeau data ds.b 144 mdata ds.b 144 end