include "pk92lib.h" include "tios.h" include "flib.h" include "graphlib.h" include "hexlib.h" include macros.h xdef _main xdef _comment include "f:\ti92\element\data.inc" Blacken MACRO move.w \1,d0 move.w \2,d1 move.w #11,d2 move.w #9,d3 clr.w d4 jsr graphlib::fill ENDM WriteStrp MACRO move.w \3,-(a7) pea \4 move.w \2,-(a7) move.w \1,-(a7) jsr tios::DrawStrXY lea 10(a7),a7 ENDM _main: clr.w d5 clr.w d6 main: jsr flib::zap_screen clr.w d0 lea img(PC),a0 jsr pk92lib::Extract tst.b d0 bne \error1 move.w #25,d1 move.w #768,d7 move.l #LCD_MEM,a2 bsr \affiche bsr titre bsr \test cmp.w #$108,d0 bne main rts \affiche: move.l (a1)+,(a2)+ dbra d1,\affiche jsr flib::zap_screen addq #2,a1 \affiche1: move.l (a1)+,(a2)+ dbra d7,\affiche1 jsr pk92lib::FreeMem rts \test: move.w d5,d0 lsl.w #4,d0 sub.w d5,d0 sub.w d5,d0 sub.w d5,d0 add.w #3,d0 move.w d0,xg move.w d6,d0 lsl.w #3,d0 add.w d6,d0 add.w d6,d0 add.w d6,d0 add.w #5,d0 move.w d0,yg Blacken xg,yg \get_key: jsr flib::idle_loop cmp.w #264,d0 beq \fin cmp.w #337,d0 beq \test1 cmp.w #340,d0 beq \test2 cmp.w #344,d0 beq \test3 cmp.w #338,d0 beq \test4 cmp.w #13,d0 beq \test5 jmp \get_key \test1: tst.w d5 beq \get_key Blacken xg,yg sub.w #1,d5 tst.w d6 bne \t11 clr.w d5 jmp \test \t11: cmp.w #11,d5 bne \t12 cmp.w #3,d6 blt \met1x \t12: cmp.w #3,d5 bne \t14 cmp.w #8,d6 bne \t13 move.w #6,d6 move.w #2,d5 \t13: cmp.w #7,d6 bne \t14 move.w #5,d6 move.w #2,d5 \t14: jmp \test \test2: cmp.w #17,d5 beq \get_key Blacken xg,yg add.w #1,d5 tst.w d6 bne \t21 move.w #17,d5 jmp \test \t21: cmp.w #2,d5 bne \t22 cmp.w #3,d6 blt \met12x \t22: cmp.w #3,d5 bne \t24 \t23: cmp.w #6,d6 bne \t24 move.w #7,d6 move.w #4,d5 \t24: jmp \test \test3: cmp.w #8,d6 beq \get_key Blacken xg,yg add.w #1,d6 cmp.w #6,d6 bne \t31 cmp.w #3,d5 beq \decy bgt \met7y \t31: cmp.w #7,d6 bne \t32 cmp.w #2,d5 bgt \t32 blt \decy beq \t33 \t32: jmp \test \t33: move.w #8,d6 move.w #4,d5 jmp \test \test4: tst.w d6 beq \get_key Blacken xg,yg sub.w #1,d6 cmp.w #6,d6 bne \t41 move.w #5,d6 \t41: cmp.w #2,d6 bne \t42 cmp.w #1,d5 blt \t42 beq \t42 cmp.w #12,d5 bgt \t42 beq \t42 add.w #1,d6 \t42: tst.w d6 bne \t43 tst.w d5 beq \t43 cmp.w #17,d5 bgt \t43 beq \t43 add.w #1,d6 \t43: jmp \test \test5: tst.w d6 ;y=0 bne \t51 tst.w d5 beq \c1 bne \c2 \t51: cmp.w #1,d6 ;y=1 bne \t53 tst.w d5 beq \c3 cmp.w #1,d5 beq \c4 move.w #5,d1 \t52: move.w #17,d0 sub.w d1,d0 cmp.w d0,d5 beq \c5_10 dbra d1,\t52 \t53: cmp.w #2,d6 ;y=2 bne \t55 tst.w d5 beq \c11 cmp.w #1,d5 beq \c12 move.w #5,d1 \t54: move.w #17,d0 sub.w d1,d0 cmp.w d0,d5 beq \c13_18 dbra d1,\t54 \t55: cmp.w #3,d6 ;y=3 bne \t57 move.w #17,d0 \t56: cmp.w d0,d5 beq \c19_36 dbra d0,\t56 \t57: cmp.w #4,d6 ;y=4 bne \t59 move.w #17,d0 \t58: cmp.w d0,d5 beq \c37_54 dbra d0,\t58 \t59: cmp.w #5,d6 ;y=5 bne \t62 move.w #2,d0 \t60: cmp.w d0,d5 beq \c55_57 dbra d0,\t60 move.w #14,d1 \t61: move.w d1,d0 add.w #3,d0 cmp.w d0,d5 beq \c58_72 dbra d1,\t61 \t62: cmp.w #6,d6 ;y=6 bne \t64 move.w #2,d0 \t63: cmp.w d0,d5 beq \c73_75 dbra d0,\t63 \t64: cmp.w #7,d6 ;y=7 bne \t66 move.w #13,d1 \t65: move.w d1,d0 add.w #4,d0 cmp.w d0,d5 beq \c76_89 dbra d1,\t65 \t66: cmp.w #8,d6 ;y=8 bne \fin move.w #13,d1 \t67: move.w d1,d0 add.w #4,d0 cmp.w d0,d5 beq \c90_103 dbra d1,\t67 \c1: move.w #1,d0 jmp \propr \c2: move.w #2,d0 jmp \propr \c3: move.w #3,d0 jmp \propr \c4: move.w #4,d0 jmp \propr \c5_10: sub.w #7,d0 jmp \propr \c11: move.w #11,d0 jmp \propr \c12: move.w #12,d0 jmp \propr \c13_18: add.w #1,d0 jmp \propr \c19_36: add.w #19,d0 jmp \propr \c37_54: add.w #37,d0 jmp \propr \c55_57: add.w #55,d0 jmp \propr \c58_72: add.w #69,d0 jmp \propr \c73_75: add.w #87,d0 jmp \propr \c76_89: add.w #54,d0 jmp \propr \c90_103: add.w #86,d0 jmp \propr \met1x: move.w #1,d5 jmp \t12 \met12x: move.w #12,d5 jmp \t22 \met7y: move.w #7,d6 jmp \t31 \decy: sub.w #1,d6 jmp \t31 \error1: jsr pk92lib::FreeMem rts \fin: rts \propr: jsr flib::zap_screen movem d5-d7,-(a7) move.w d0,-(a7) move.w d0,d3 lea data(PC),a0 jsr pk92lib::Extract tst.b d0 bne \error2 move.w d3,d0 clr.l d6 clr.l d5 move.b d0,d5 move.b d0,d6 divu #100,d5 move.w d5,d0 move.w #13,d2 bsr afficher_chiffre move.l d6,d0 move.w d5,d4 clr.l d5 move.w d4,d5 mulu #100,d5 sub.w d5,d0 move.w d0,d6 divu #10,d0 move.l #14,d2 move.w d0,d4 clr.l d0 move.w d4,d0 bsr afficher_chiffre mulu #10,d0 sub.w d0,d6 move.w d6,d0 move.l #15,d2 bsr afficher_chiffre SetFont #1 WriteStrp #0,#14,#1,txt1(a1) WriteStrp #0,#24,#1,txt2(a1) WriteStrp #0,#34,#1,txt3(a1) WriteStrp #0,#44,#1,txt4(a1) WriteStrp #0,#54,#1,txt5(a1) WriteStrp #0,#64,#1,txt6(a1) WriteStrp #0,#74,#1,txt7(a1) WriteStrp #0,#84,#1,txt8(a1) WriteStrp #0,#94,#1,txt9(a1) WriteStrp #0,#104,#1,txt10(a1) move.w (a7)+,d0 sub.w #1,d0 lea table(a1),a3 lea noms(a1),a4 lea buffer(PC),a2 clr.l d1 move.b d0,d1 lsl #1,d1 move.w 0(a3,d1.w),d7 move.w 2(a3,d1.w),d1 add.w d7,a4 sub.w d7,d1 move.w d1,d5 sub.w #1,d5 move.w #14,d6 move.w #78,d7 bsr afficher_noms lea masseato(a1),a4 move.l #8,d5 move.w #34,d6 move.w #140,d7 bsr afficher_nombres lea elecneg(a1),a4 move.l #5,d5 move.w #54,d6 move.w #177,d7 bsr afficher_nombres lea massevol(a1),a4 move.l #6,d5 move.w #44,d6 move.w #160,d7 bsr afficher_nombres lea ebull(a1),a4 move.l #6,d5 move.w #64,d6 move.w #100,d7 bsr afficher_nombres lea fusion(a1),a4 move.l #7,d5 move.w #74,d6 move.w #75,d7 bsr afficher_nombres lea Hvapo(a1),a4 move.l #7,d5 move.w #84,d6 move.w #152,d7 bsr afficher_nombres lea Hfusion(a1),a4 move.l #6,d5 move.w #94,d6 move.w #118,d7 bsr afficher_nombres lea capcalo(a1),a4 move.l #5,d5 move.w #104,d6 move.w #180,d7 bsr afficher_nombres jsr pk92lib::FreeMem bsr titre movem (a7)+,d5-d7 jsr flib::idle_loop rts \error2: jsr pk92lib::FreeMem move.w (a7)+,d0 movem (a7)+,d5-d7 rts titre: movem d0-d7/a0-a3,-(a7) SetFont #0 WriteStr #40,#115,#1,title movem (a7)+,d0-d7/a0-a3 rts afficher_nombres: clr.l d1 move.b d0,d1 mulu d5,d1 add.w d1,a4 afficher_noms: bsr clear_buffer move.w d5,d3 sub.w #1,d3 loop2: move.b (a4)+,(a2)+ dbra d3,loop2 move.w d0,-(a7) WriteStr d7,d6,#1,buffer move.w (a7)+,d0 sub.w d5,a4 sub.w d5,a2 rts afficher_chiffre: move.l #3,d1 move.w #0,d4 jsr hexlib::put_hex fin: rts clear_buffer: move.w #20,d2 loop0: move.b #0,(a2)+ dbra d2,loop0 sub.w #21,a2 rts xg dc.w 0 yg dc.w 0 img: incbin "f:\ti92\element\pic.p92" data: incbin "f:\ti92\element\data.p92" txt dc.b "uncompression error",0 title dc.b "Luc CHAMBON : galahad@thepentagon.com",0 buffer ds.b 22 _comment: dc.b "Tableau périodique par Luc CHAMBON",0 end