; RESET TECsoft'S demo by WILD COPPER in 1988 RESET=$6a000 waittof=-$10e OpenLib=-$228 Read=-42 Open=-30 Close=-36 O_RDONLY=$3ed MEMF_CHIP=$2 AllocMem=-$0c6 zizicsize=30674 palette=$40000 ;adresse des couleurs. palette1=$41000 nb=1 ;nbr. de VB avant de schtroumpfer. funzel=17 ;nb de VB avant clignotement. ecdebpl1=$20d20 ecdebpl2=$23520 lgbitmap=4600-40 ecfin=ecdebpl1+lgbitmap ecfin2=ecdebpl2+lgbitmap adrcopper=$43000 L1=$30 L2=L1+80 max=480 min=320 start: move.l 4,a6 clr d0 lea gfxlib,a1 jsr OpenLib(a6) move.l d0,gfxbase move.l d0,a6 move.l 4,a6 clr d0 lea doslib,a1 jsr OpenLib(a6) move.l d0,dosbase move.l d0,a6 **** pr_MsgPort=92 sm_ArgList=36 wa_Lock=0 sub.l a1,a1 ;callsys findtask move.l 4.w,a6 jsr -$126(a6) move.l d0,a4 lea pr_MsgPort(a4),a0 ;callsys waitport move.l 4.w,a6 jsr -$180(a6) lea pr_MsgPort(a4),a0 ;callsys GetMsg move.l 4.w,a6 jsr -$174(a6) move.l d0,a2 move.l sm_ArgList(a2),d0 move.l d0,a0 move.l wa_Lock(a0),d1 ; callsys currentdir move.l dosbase,a6 jsr -$60(a6) ******* move.l dosbase,a6 move.l #zizicname,d1 move.l #O_RDONLY,d2 jsr Open(a6) move.l d0,d1 move.l d0,d4 move.l zizicptr,d2 move.l #zizicsize,d3 jsr Read(a6) move.l d4,d1 jsr Close(a6) move.l #picname,d1 move.l #O_RDONLY,d2 jsr Open(a6) move.l d0,d1 move.l d0,d4 move.l picptr,d2 move.l #108,d3 jsr Read(a6) move.l d4,d1 move.l picptr,d2 move.l #10240,d3 jsr Read(a6) move.l d4,d1 move.l picptr,d2 add.l #10240,d2 move.l #10240,d3 jsr Read(a6) move.l d4,d1 jsr Close(a6) move.l #vecteur,$80 trap #0 vecteur: move #$7fff,$dff09a move.l 4,a6 ;pt exex.lib move.l #RESET,a0 ;adresse de MON reset move.l a0,$2a(a6) ;COLDCAPTURE lea $22(a6),a1 ;ChkSum (uword) des 24 mots precedents clr.w d0 ;utilise pour le cheksum move.w #$17,d1 ;compteur (->24 fois) chksum: add.w (a1)+,d0 dbf d1,chksum not.w d0 ;on inverse tout! move.w d0,(a1) ; d0==>ChkSum lea prg,a0 lea RESET,a1 move.w #prgsize/2-1,d0 zoupla: move.w (a0)+,(a1)+ dbf d0,zoupla move.l gfxbase,a0 move.l 34(a0),a0 move.l (a0),a0 move.l 36(a0),a0 move.l 4(a0),a0 move.l 8(a0),WBmap1 move.l 12(a0),WBmap2 move.l WBmap1,a1 move.l picptr,a0 add.l #197*40,a0 move #[20*[256-197]]-1,d0 ooloop: move (a0)+,(a1)+ dbf d0,ooloop move.l WBmap2,a1 move.l picptr,a0 add.l #[256+197]*40,a0 move #[20*[256-197]]-1,d0 ooloop1: move (a0)+,(a1)+ dbf d0,ooloop1 move.l WBmap2,a0 add.l #128*40,a0 move.l a0,WBmap3 move.l #$0001fffe,(A0)+ move.l #$00960020,(a0)+ move.l #$01040024,(A0)+ move.l #$01020000,(A0)+ move.l #$01080000,(A0)+ move.l #$010a0000,(A0)+ move.l #$01002200,(A0)+ move.l #$008e2c81,(A0)+ move.l #$0090f4c1,(A0)+ move.l #$00920038,(A0)+ move.l #$009400d0,(A0)+ move.l #$01800000,(A0)+ move.l a0,chg_color move.l #$01820f00,(A0)+ move.l #$01840f00,(A0)+ move.l #$01860000,(A0)+ move.l #$01880000,(A0)+ move.l #$2c01fffe,(A0)+ move.l WBmap1,d0 swap d0 move #$00e0,(A0)+ move d0,(A0)+ swap d0 move #$00e2,(A0)+ move d0,(A0)+ move.l WBmap2,d0 swap d0 move #$00e4,(A0)+ move d0,(A0)+ swap d0 move #$00e6,(A0)+ move d0,(A0)+ move.l #$6701fffe,(A0)+ move.l #$01000200,(A0)+ move.l #$fffffffe,(A0)+ move.l WBMAP3,$dff080 move #1,$dff084 move.l #bouclesanfin,$6c move #$c020,$dff09a move #$000f,$dff096 la_oui: bra.s la_oui bouclesanfin: move.l a0,-(sp) sub #1,compt_irq bne.s av_old_irq move #25,compt_irq move.l chg_color,a0 tst 2(a0) bne.s red move #$0f00,2(A0) bra.s av_old_irq red: move #$0000,2(A0) av_old_irq: move.l (sp)+,a0 old_irq: move #$20,$dff09c rte compt_irq: dc.w 25 chg_color: dc.l 0 WBmap1: dc.l 0 WBmap2: dc.l 0 WBmap3: dc.l 0 prg: move.w #$7a0,$dff096 movem.l d0-d7/a0-a6,-(sp) move.l 4,a6 ;pt exex.lib move.l #RESET,a0 ;adresse de MON reset move.l a0,$2a(a6) ;COLDCAPTURE lea $22(a6),a1 ;ChkSum (uword) des 24 mots precedents clr.w d0 ;utilise pour le cheksum move.w #$17,d1 ;compteur (->24 fois) toto: add.w (a1)+,d0 dbf d1,toto not.w d0 ;on inverse tout! move.w d0,(a1) ; d0==>ChkSum move.l picptr(pc),a0 move.l a0,a1 add.l #10240,a1 lea $20000,a2 lea $22800,a3 move.w #5119,d0 rvb: move.w (a0)+,(a2)+ move.w (a1)+,(a3)+ dbf d0,rvb move.w #150,d0 lea $50000,a0 jklp: move.w #$7fff,(a0)+ move.w #37,d1 notclear: move.w #$ffff,(a0)+ dbf d1,notclear move.w #$fffe,(a0)+ dbf d0,jklp lea palette1,a0 move.l a0,a1 lea palette,a2 lea add(pc),a5 continue: move.w (a5)+,d0 cmp.w #$ffff,d0 beq c_est_fini move.w d0,d1 sub.w d1,d1 move.w #12,d2 re: add.w d0,d1 move.w d1,(a0)+ move.w d1,(a2)+ move.w d1,(a2)+ dbf d2,re move.w #12,d2 re1: sub.w d0,d1 move.w d1,(a0)+ move.w d1,(a2)+ move.w d1,(a2)+ dbf d2,re1 bra continue add: dc.w $001,$101,$100,$110,$010,$011,$111,$ffff c_est_fini: sub.l a1,a0 lea long1(pc),a1 lea long(pc),a3 sub.l #2,a0 move.l a0,(a1) move.l a0,d0 lsl.l #1,d0 move.l d0,(a3) jsr make_copper(pc) move.l #adrcopper,$dff080 lea prgfin(pc),a0 move.l a0,$dff0a0 move.w #zizicsize/2,$dff0a4 move.w #min,$dff0a6 move.w #127,$dff0a8 move.l a0,$dff0b0 move.w #zizicsize/2,$dff0b4 move.w #min,$dff0b6 move.w #127,$dff0b8 move.l a0,$dff0c0 move.w #zizicsize/2,$dff0c4 move.w #min,$dff0c6 move.w #127,$dff0c8 move.l a0,$dff0d0 move.w #zizicsize/2,$dff0d4 move.w #min,$dff0d6 move.w #127,$dff0d8 move.w #$838f,$dff096 ;audio + copper + bitmap enable move.w #$0020,$dff096 ;sprites disable move.w #$dff088,d0 ;copjmp1 lea saved1(pc),a5 lea saved0(pc),a4 move.w #min,(a4) move.w #1,(a5) lea savea6(pc),a0 lea zig(pc),a1 move.l a1,(a0) lea compt(pc),a0 move.w #funzel,(a0) ici: lea saved1(pc),a5 lea saved0(pc),a4 move.w saved0(pc),d0 move.w saved1(pc),d1 move.w d0,$dff0a6 move.w d0,$dff0b6 move.w d0,$dff0c6 move.w d0,$dff0d6 add.w d1,d0 cmp.w #max,d0 bne hop neg d1 hop: cmp.w #min,d0 bne zoup neg d1 zoup: move.w d0,(a4) move.w d1,(a5) Enc: move.l data(pc),a0 move.w #2,d2 move.w #L2-L1-1,d7 move.l long(pc),d0 move.l long1(pc),d5 add.l #palette1,d5 lea palette,a1 add.l d0,a1 move.l savea2(pc),a2 move.l savea3(pc),a3 move.l savea4(pc),a4 move.l savea5(pc),a5 move.l savea6(pc),a6 rolcolor: move.w (a2)+,0(a0,d2.w) addq.w #4,d2 move.w (a3)+,0(a0,d2.w) addq.w #4,d2 move.w (a4)+,0(a0,d2.w) addq.w #4,d2 move.w (a5)+,0(a0,d2.w) addq.w #4,d2 move.w (a6)+,d3 move.w d3,d4 lsl.w #4,d4 add.w d4,d3 move.w d3,0(a0,d2.w) add.w #8,d2 move.l a0,-(sp) lea zigend(pc),a0 cmp.l a0,a6 bls ok lea zig(pc),a6 ok: move.l (sp)+,a0 cmp.l a1,a2 bls ok1 lea palette,a2 ok1: cmp.l a1,a3 bls ok2 lea palette,a3 ok2: cmp.l d5,a4 bls ok3 lea palette1,a4 ok3: cmp.l a1,a5 bls ok4 lea palette,a5 ok4: dbf d7,rolcolor move.l savea6(pc),a6 move.l savea2(pc),a2 move.l savea3(pc),a3 move.l savea4(pc),a4 move.l savea5(pc),a5 move.w ral(pc),d6 subq.w #1,d6 bne cont move.w #nb,d6 add.l #2,a6 cont: lea ral(pc),a0 move.w d6,(a0) sub.l #2,a2 add.l #2,a3 add.l #4,a4 add.l #2,a5 lea zigend(pc),a0 cmp.l a0,a6 bls okw lea zig(pc),a6 okw: cmp.l a1,a3 bls okw1 lea palette,a3 okw1: cmp.l d5,a4 bls okw2 lea palette1,a4 okw2: cmp.l #palette,a2 bhi okw3 move.l a1,a2 okw3: cmp.l a1,a5 bls okw4 lea palette,a5 okw4: lea savea2(pc),a0 move.l a2,(a0) lea savea3(pc),a0 move.l a3,(a0) lea savea4(pc),a0 move.l a4,(a0) lea savea5(pc),a0 move.l a5,(a0) lea savea6(pc),a0 move.l a6,(a0) move.l bitpl1(pc),a0 move.l bitpl2(pc),a1 move.l rouleau(pc),a2 lea tableau(pc),a3 move.w #265,d0 ;nombre de lignes-1 coca: move.w (a3)+,d1 ext.l d1 add.l d1,a0 add.l d1,a1 cmp.l #ecfin,a0 blt ok_mec move.l a0,a5 sub.l #ecfin,a5 lea ecdebpl1,a0 lea ecdebpl2,a1 add.l a5,a0 add.l a5,a1 ok_mec: cmp.l #ecdebpl1,a0 bge tadelachance move.l a0,a5 sub.l #ecdebpl1,a5 lea ecfin,a0 lea ecfin2,a1 add.l a5,a0 add.l a5,a1 tadelachance: move.l a0,d6 move.l a1,d7 swap d6 move.w d6,(a2) add.l #4,a2 swap d6 move.w d6,(a2) add.l #4,a2 swap d7 move.w d7,(a2) add.l #4,a2 swap d7 move.w d7,(a2) add.l #16,a2 dbf d0,coca lea bitpl1(pc),a3 lea bitpl2(pc),a4 move.l bitpl1(pc),a0 move.l bitpl2(pc),a1 add.l #40,a0 add.l #40,a1 cmp.l #ecfin,a0 blt voukonaissezcelledubelgekirantredanunekremerie lea ecdebpl1,a0 lea ecdebpl2,a1 voukonaissezcelledubelgekirantredanunekremerie: move.l a0,(a3) move.l a1,(a4) gleurk: move.w compt(pc),d7 subq.w #1,d7 bne ouiii ; bchg #1,$bfe001 move.w saved0(pc),d7 lsr.w #6,d7 ouiii: lea compt(pc),a0 move.w d7,(a0) btst #6,$bfe001 bne retst movem.l (sp)+,d0-d7/a0-a6 move.w #$7fff,$dff096 jmp (a5) retst: btst #5,$dff01f beq retst move.w #$20,$dff09c ;reset le bit 5(vbr) bra ici ;****************** make_copper ************************* make_copper: lea copper(pc),a0 lea adrcopper,a1 lea copperend(pc),a2 vas_y_toto: move.w (a0)+,(a1)+ cmp.l a2,a0 bne vas_y_toto move.l a1,a2 add.l #4,a2 lea data(pc),a3 move.l a2,(a3) move.w #L1,d0 ding_dong: move.w d0,d1 lsl.w #8,d1 addq.w #1,d1 move.w d1,(a1)+ move.l #$fffe0182,(a1)+ move.l #$00000184,(a1)+ move.l #$00000186,(a1)+ move.l #$00000180,(a1)+ move.l #$00000102,(a1)+ move.w #$0000,(a1)+ addq.w #1,d0 cmp.w #L2+1,d0 bne ding_dong move.w d0,d1 addq.w #1,d0 lsl.w #8,d1 addq.w #1,d1 move.w d1,(a1)+ move.l #$fffe018a,(a1)+ move.l #$050c018c,(a1)+ move.l #$09ef018e,(a1)+ move.l #$0e700188,(a1)+ move.l #$00000102,(a1)+ move.w #$0000,(a1)+ move.l #$01003200,(a1)+ move.l #$00e80005,(a1)+ move.l #$00ea0000,(a1)+ lea rouleau(pc),a2 move.l a1,a3 add.l #10,a3 move.l a3,(a2) lea decal(pc),a2 lea decalfin(pc),a3 ouarf: move.w d0,d1 bne sprotz move.w #$ffdf,d1 bra piou sprotz: andi.w #$00ff,d1 lsl.w #8,d1 addq.w #1,d1 piou: move.w d1,(a1)+ move.l #$fffe0102,(a1)+ move.w (a2),(a1)+ move.l #$00e00000,(a1)+ move.l #$00e20000,(a1)+ move.l #$00e40000,(a1)+ move.l #$00e60000,(a1)+ move.w #$180,(a1)+ move.w (a2)+,d7 move.w d7,d6 lsl.w #4,d6 andi.w #$f00,d6 ori.w d6,d7 move.w d7,(a1)+ addq.b #1,d0 cmp.b #$3e,d0 bne ouarf move.l #$fffffffe,(a1)+ RTS rouleau: dc.l 0 data: dc.l 0 copper: dc.w $0001,$fffe dc.w $e0,2,$e2,$2800,$e4,2,$e6,0 dc.w $104,$24,$102,0,$108,0,$10a,0 dc.w $100,$2200 dc.w $8e,$2c70,$90,$40c1,$92,$30,$94,$c8 dc.w $0101,$fffe ; on commence a la ligne $38 dc.w $184,$000,$180,0,$186,0 dc.w $182,$000 dc.b L1-1,$01 dc.w $fffe dc.w $e0,2,$e2,$2800,$e4,2,$e6,0 dc.w $104,$24,$102,0,$108,0,$10a,0 dc.w $182,0,$184,0,$186,0 copperend: nop decal: dc.w $ff,$ff,$ff,$ff,$ff,$ff dc.w $ff,$ff,$ee,$ee,$dd,$dd,$cc,$cc,$bb,$bb,$aa,$aa dc.w $99,$99,$88,$88,$77,$77,$66,$66,$55,$55,$44,$44 dc.w $33,$33,$22,$22,$11,$11 blk.w 25,0 dc.w 0,$44,$77,$99,$aa,$bb,$cc,$dd,$dd,$ee,$ee,$ee dc.w $ff,$ff,$ff,$ff,$ff,$ff,$ee,$ee,$ee,$dd,$dd,$cc,$bb dc.w $aa,$99,$77,$44,$00 dc.w 0,$44,$77,$99,$aa,$bb,$cc,$dd,$dd,$ee,$ee,$ee dc.w $ff,$ff,$ff,$ff,$ff,$ff,$ee,$ee,$ee,$dd,$dd,$cc,$bb dc.w $aa,$99,$77,$44,$00 dc.w 0,$44,$77,$99,$aa,$bb,$cc,$dd,$dd,$ee,$ee,$ee dc.w $ff,$ff,$ff blk.w 50,$ff decalfin: nop zizicptr: dc.l RESET+prgsize zizicname: dc 'WILD:zizic',0 even picptr: dc.l RESET+prgsize+zizicsize picname: dc 'WILD:pic',0 doslib: dc 'dos.library',0 gfxlib: dc 'graphics.library',0 even gfxbase: dc.l 0 DosBase: dc.l 0 saved0: dc.l 0 saved1: dc.l 0 compt: dc.l 0 long: dc.l 0 long1: dc.l 0 savea2: dc.l palette savea3: dc.l palette+$104-2*13 savea4: dc.l palette1+$410 savea5: dc.l palette+$28a savea6: dc.l 0 zig: dc.w 15,15,15,15 dc.w 14,14,14,13,13,12,11,10,9,7 dc.w 5,4,3,2,2,1,1,1,0,0,0,0 dc.w 0,0,0,0,1,1,1,2,2,3,4 dc.w 5,7,9,10,11,12,13,13,14,14,14,15,15,15 zigend: dc.w 15 ral: dc.w nb bitpl1: dc.l ecdebpl1 bitpl2: dc.l ecdebpl2 tableau: dc.w 40,40,40,40,40,40,40 blk.w 32,80 blk.w 23,40 dc.w 240,120,120,120 blk.w 22,40 dc.w 120,120,120,240 dc.w -240,-120,-120,-120 blk.w 22,-40 dc.w -120,-120,-120,-240 dc.w 240,120,120,120 blk.w 11,40 blk.w 50,40 prgfin: nop prgsize=prgfin-prg