;APS00000000000000000000000000000000000000000000000000000000000000000000000000000000 ;APS00000000000000000000000000000000000000000000000000000000000000000000000000000000 ;APS0000002B0000002B0000002B0000002B0000002B0000002B0000002B0000002B0000002B0000002B **************************************** ** ** aga/ecs startup ** ** (C) 1999 Copy`n`Paste technologi ** ** Rouge the intro ** ** ** #1. sort skarm ** #2. copper ind ** #3. rouge logo ind ** #4. Rouge logo fader vak ** #5. skirver text ** #6. scrolelr copper ind ** #7. fraktal ** #8. fade fraktal ** #9. interference ** #10. fader ** #11. scroll ind ** #12. text ** #13. bobler ** ** ** Rouge the intro ** --------------- ** ** won #2 price in the Intro compo at Scene meeting 99 ** ** ** ** ** ** ** ** ** ** ** ** size = 31080 packede ** ** Husk at the Player Bruger int level 6! OG p61_init trasher regs ** **************************************** include 'asm_includes:copper+blittermacros.s' include 'asm_includes:hardware.i' * include 'asm_includes:exec/exec.i' include 'asmpro:startup/time_macro.asm' ;MyDmacon=%10000001111001111 myDmacon=SETIT+AUD0EN+AUD1EN+AUD2EN+AUD3EN+BLTEN+COPEN+BPLEN+BLTPRI ; +------+----------+--------------------------------------------+ ; | BIT# | FUNCTION | DESCRIPTION | ; +------+----------+--------------------------------------------+ ; | 15 | SET/CLR | Set/Clear control bit. Determines if bits | ; | | | written wit a 1 get set or cleared. | ; | | | Bits written witn a zero are unchanged. | ; | 14 | BBUSY | Blitter busy status bit (read only) | ; | 13 | BZERO | Blitter logic zero status bit. (read only) | ; | 12 | X | | ; | 11 | X | | ; | 10 | BLTPRI | Blitter DMA prioiry (over CPU micro) | ; | | | (also called "blitter nasty") | ; | | | (disables /BLS pin, preventing micro | ; | | | from stealing any bus cycles while | ; | | | blitter DMA is running) | ; | 09 | DMAEN | Enable all DMA below (also UHRES DMA) | ; | 08 | BPLEN | Bit plane DMA enable | ; | 07 | COPEN | Coprocessor DMA enable | ; | 06 | BLTEN | Blitter DMA enable | ; | 05 | SPREN | Sprite DMA enable | ; | 04 | DSKEN | Disk DMA enable | ; | 03 | AUD3EN | Audio chanel 3 DMA enable | ; | 02 | AUD2EN | Audio chanel 2 DMA enable | ; | 01 | AUD1EN | Audio chanel 1 DMA enable | ; | 00 | AUD0EN | Audio chanel 0 DMA enable | ; +------+----------+--------------------------------------------+ ;MyIntena=%1110000000101000 MyIntena=SETIT+PORTS+VERTB+INTEN+EXTER ; +------+----------+-------+--------------------------------------------+ ; | BIT# | FUNCTION | LEVEL | DESCRIPTION | ; +------+----------+-------+--------------------------------------------+ ; | 15 | SET/CLR | | Set/clear control bit. Determines if bits | ; | | | | written with a 1 get set or cleared. Bits | ; | | | | written with a zero are always unchanged. | ; | 14 | INTEN | | Master interrupt (enable only, no request) | ; | 13 | EXTER | 6 | External interrupt | ; | 12 | DSKSYN | 5 | Disk sync register (DSKSYNC) matches disk | ; | 11 | RBF | 5 | Serial port receive buffer full | ; | 10 | AUD3 | 4 | Audio channel 3 block finished | ; | 09 | AUD2 | 4 | Audio channel 2 block finished | ; | 08 | AUD1 | 4 | Audio channel 1 block finished | ; | 07 | AUD0 | 4 | Audio channel 0 block finished | ; | 06 | BLIT | 3 | Blitter has finished | ; | 05 | VERTB | 3 | Start of vertical blank | ; | 04 | COPER | 3 | Coprocessor | ; | 03 | PORTS | 2 | I/O Ports and timers | ; | 02 | SOFT | 1 | Reserved for software initated interrupt. | ; | 01 | DSKBLK | 1 | Disk block finished | ; | 00 | TBE | 1 | Serial port transmit buffer empty | ; +------+----------+-------+--------------------------------------------+ mybplcon=%0001001000000000 ; +------+---------+---------------------------------------------------------+ ; | BIT# | BPLCON0 | DESCRIPTION | ; +------+---------+---------------------------------------------------------+ ; | 15 | HIRES | HIRES = High resoloution (640*200/640*400 interlace) | ; | | | mode | ; | 14 | BPU2 | Bit plane use code 0000-1000 (NODE thru 8 inclusive) | ; | 13 | BPU1 | | ; | 12 | BPU0 | | ; | 11 | HAM | Hold and modify mode, now using either 6 or 8 bit | ; | | | planes. | ; | 10 | DPF | Double playfield (PFI=odd FP2= even bit planes) | ; | | | now available in all resoloutions. | ; | | | (If BPU=6 and HAM=0 and DPF=0 a special mode is | ; | | | defined that allows bitplane 6 to cause an intensity | ; | | | reduction of the other 5 bitplanes. The color | ; | | | register output selected by 5 bitplanes is shifted | ; | | | to half intensity by the 6th bit plane. This is | ; | | | called EXTRA-HALFBRITE Mode. | ; | 09 | COLOR | Enables color burst output signal | ; | 08 | GAUD | Genlock audio enable. This level appears on the ZD | ; | | | pin on denise during all blanking periods, unless ZDCLK | ; | | | bit is set. | ; | 07 | UHRES | Ultrahi res enables the UHRES pointers (for 1k*1k) (also| ; | | | needs bits in DMACON (hires chips only). | ; | | | Disables hard stops for vert, horiz display windows. | ; | 06 | SHRES | Super hi-res mode (35ns pixel width) | ; | 05 | BYPASS=0| Bitplanes are scrolled and prioritized normally, but | ; | | | bypass color table and 8 bit wide data appear on R(7:0).| ; | 04 | BPU3=0 | See above (BPU0/1/2) | ; | 03 | LPEN | Light pen enable (reset on power up) | ; | 02 | LACE | Interlace enable (reset on power up) | ; | 01 | ERSY | External resync (HSYNC, VSYNC pads become inputs) | ; | | | (reset on power up) | ; | 00 | ECSENA=0| When low (default), the following bits in BPLCON3 are | ; | | | disabled: BRDRBLNK,BRDNTRAN,ZDCLKEN,BRDSPRT, and | ; | | | EXTBLKEN. These 5 bits can always be set by writing | ; | | | to BPLCON3, however there effects are inhibited until | ; | | | ECSENA goes high. This allows rapid context switching | ; | | | between pre-ECS viewports and new ones. | ; +------+---------+---------------------------------------------------------+ section code,code_f uwtro: jmp letsfakeit dc.b '(C) 1999 Copy`n`Paste technology',00 CNOP 0,4 letsfakeit: bsr.w TakeSystem bsr.w test_cpu_type lea.l planesptr+2,a0 move.l _Planar1,d0 move.l #$04,d1 bsr.w setup_planes_ntsc MOVEM.L D0-D7/A0-A6,-(A7) lea P61_data,a0 ;Module sub.l a1,a1 ;No separate samples moveq #0,d0 bsr.w p61_init MOVEM.L (A7)+,D0-D7/A0-A6 move.w #$7fff,intena(a6) ;disable interrupt lea.l $dff000,a6 lea.l timer_level3(pc),a0 lea.l vectorbase(pc),a1 * lea.l vbrbase(pc),a1 move.l (a1),a2 move.l a0,$6c(a2) move.w #myintena,intena(a6) move.w #mydmacon,dmacon(a6) ** satter forst copper og skarm op lea.l blackass_colors,a0 move.l a0,current_colors move.l current_colors,a0 lea.l copper_colors+2,a1 bsr.w setup_color lea.l copper,a0 lea.l $dff000,a6 initc a0 ** slut ud haloj er slut bsr.w waitrotte bsr.w p61_end move.w #$7fff,intena(a6) ;disable interrupt bsr.w restoresystem rts ** level3 timer interrupt timer_level3: movem.l d0-d7/a0-a6,-(sp) lea.l $dff000,a6 lea.l loop_timer(pc),a0 addq.l #01,(a0) move.w #$0020,$dff09c move.w #$0020,$dff09c movem.l (sp)+,d0-d7/a0-a6 rte TEST_CPU_TYPE: MOVE.L 4.w,A0 MOVE.B $129(A0),D0 MOVE.L #68040,D1 ;68040 BTST #$03,D0 BNE.B .exit MOVE.L #68030,D1 ;68030 BTST #$02,D0 BNE.B .exit MOVE.L #68020,D1 ;68020 BTST #$01,D0 BNE.B .exit MOVE.L #68010,D1 ;68010 BTST #$00,D0 BNE.B .exit MOVE.L #68000,D1 ;68000 .exit MOVE.L D1,CPU_TYPE RTS ** d1 for taller hvor meget der skal scrollers ned ** scroller top copperen ind scroll_copper_in: * move.l #10,d1 .j1 clr.w d0 move.w topcoppos,d0 add.w #$01,topcoppos move.w d0,d7 add.w #$0b,d7 lsl.w #8,d7 or.w #1,d7 move.w d7,cop_topline move.w topcoppos,d0 add.w #$01,topcoppos move.w d0,d7 add.w #$0b,d7 lsl.w #8,d7 or.w #1,d7 move.w d7,cop_midcol clr.w d0 move.w badcoppos,d0 sub.w #$01,badcoppos move.w d0,d7 * add.w #$40,d7 lsl.w #8,d7 or.w #1,d7 move.w d7,cop_buttomcol move.w badcoppos,d0 sub.w #$01,badcoppos move.w d0,d7 * add.w #$41,d7 lsl.w #8,d7 or.w #1,d7 move.w d7,cop_buttomline bsr.w waitvbl dbra d1,.j1 rts ** d1 for taller hvor meget der skal scrollers op ** scroller top copperen ind scroll_copper_out_full: * move.l #10,d1 .j1 clr.w d0 move.w topcoppos,d0 sub.w #$01,topcoppos move.w d0,d7 add.w #$0b,d7 lsl.w #8,d7 or.w #1,d7 move.w d7,cop_midcol move.w topcoppos,d0 sub.w #$01,topcoppos move.w d0,d7 add.w #$0b,d7 lsl.w #8,d7 or.w #1,d7 move.w d7,cop_topline clr.w d0 move.w badcoppos,d0 add.w #$01,badcoppos move.w d0,d7 * add.w #$40,d7 lsl.w #8,d7 or.w #1,d7 move.w d7,cop_buttomline move.w badcoppos,d0 add.w #$01,badcoppos move.w d0,d7 * add.w #$41,d7 lsl.w #8,d7 or.w #1,d7 move.w d7,cop_buttomcol bsr.w waitvbl dbra d1,.j1 rts scroll_copper_buttom_in: .j1 clr.w d0 move.w badcoppos,d0 sub.w #$01,badcoppos move.w d0,d7 * add.w #$40,d7 lsl.w #8,d7 or.w #1,d7 move.w d7,cop_buttomcol move.w badcoppos,d0 sub.w #$01,badcoppos move.w d0,d7 * add.w #$41,d7 lsl.w #8,d7 or.w #1,d7 move.w d7,cop_buttomline bsr.w waitvbl dbra d1,.j1 rts scroll_copper_buttom_out: .j1 clr.w d0 move.w badcoppos,d0 add.w #$01,badcoppos move.w d0,d7 * add.w #$40,d7 lsl.w #8,d7 or.w #1,d7 move.w d7,cop_buttomline move.w badcoppos,d0 add.w #$01,badcoppos move.w d0,d7 * add.w #$41,d7 lsl.w #8,d7 or.w #1,d7 move.w d7,cop_buttomcol bsr.w waitvbl dbra d1,.j1 rts topcoppos: dc.w $0b * currenet linie pos badcoppos: dc.w $40 cnop 0,2 ** sletter en 320x200x5 buffer med blitteren ** a0 ptr til buffer ** d0 nr planes clean_buffer_ntsc: movem.l d0-d7/a0-a6,-(a7) lea.l clean_planar,a0 move.l aktiv_buffer,a1 .blit: wblit blita a0 blitd a1 setadmod 0,00 ;skal vare moduls * 2! fixadj %0000,%1001,%11110000,0 doblit 20,200 add.l #8000,a1 dbra d0,.blit movem.l (a7)+,d0-d7/a0-a6 rts ** sletter en 320x200x5 buffer med blitteren ** a0 ptr til buffer ** d0 nr planes clean_buffer_pal: movem.l d0-d7/a0-a6,-(a7) lea.l clean_planar,a0 move.l aktiv_buffer,a1 .blit: wblit blita a0 blitd a1 setadmod 0,00 ;skal vare moduls * 2! fixadj %0000,%1001,%11110000,0 doblit 20,256 add.l #10240,a1 dbra d0,.blit movem.l (a7)+,d0-d7/a0-a6 rts ** satter paletten op ** a0 - ptr to 32 farver som skal sattes ind i copperen ** a1 - ptr to copper list colors part +2 setup_color: movem.l d0/a0-a1,-(A7) * lea.l logo_colors,a0 * lea.l copper_colors+2,a1 move.l #32-1,d0 .cop: move.w (a0)+,(a1) addq #4,a1 dbra d0,.cop movem.l (a7)+,d0/a0-a1 rts ** a0 - ptr to 32 farver som skal cycles cycle_color: move.l #32-1,d0 move.l current_colors,a0 * move.l a0,a1 * add.l #[32*2]-2,a1 * move.w (a1),d2 .loop: move.w (a0)+,(a0) dbra d0,.loop sub.l #[32*2]-2,a1 move.w d1,(a1) rts ** fade den fake copper en ned ** derefter skal man selv opdatere copperlisten FadeToBlack: AddQ.w #1,fadeCounter Move.w fadeCounter(PC),d0 Cmp.w fadeSpeed,d0 Blt.w .exit Move.w #0,fadeCounter move.l current_colors,a1 * Lea current_colors,a1 MoveQ #32-1,d0 .forCuls Move.w (a1)+,d1 Tst.w d1 Beq.w .skip Move.w d1,d7 Move.b d1,d2 Move.b d1,d3 Lsr.w #8,d1 And.b #$f0,d2 And.b #$0f,d3 Tst.b d1 Beq.w .redOk Sub.w #$100,d7 .redOk Tst.b d2 Beq.w .grnOk Sub.w #$010,d7 .grnOk Tst.b d3 Beq.w .blueOk SubQ #$001,d7 .blueOk Move.w d7,-2(a1) .skip Dbf d0,.forCuls .exit Rts ** venter pa vertical blank waitvbl:btst #00,$dff005 ;check beam pos beq.s waitvbl .w: btst #00,$dff005 ;check beam pos bne.s .w rts rts ** venter pa at venstre muse knap bliver pandet en` waitrotte: btst #$06,$bfe001 bne.s waitrotte rts ** reseter vbl_loop_timer reset_time: lea.l time,a0 move.l #$00,(A0) rts reset_loop_timer: lea.l loop_timer,a0 move.l #$00,(A0) rts ** ** ** d0 - bpl1modulus ** d1 - bpl2modulus ** setup_mirror: move.w #bpl1mod,cop_mirror move.w d0,cop_mirror+2 move.w #bpl2mod,cop_mirror+4 move.w d1,cop_mirror+6 rts ** satter planar planere op ** a0 ptr til copperlist planesptr+2 ** d0 ptr til planar memory ** d1 antal planes-1 setup_planes_ntsc: * lea.l planesptr+2,a0 * move.l _Planar1,d0 * move.l #$04,d1 .loop: move.w d0,4(a0) ; gemmer low wordet swap d0 move.w d0,(a0) ; gemnmer high wordet swap d0 add.l #(320*200)/8,d0 addq.l #8,a0 dbra d1,.loop move.w #diwstrt,frameset move.w #$2c81,frameset+2 move.w #diwstop,frameset+4 move.w #$f4c1,frameset+6 rts rts setup_planes_pal: * lea.l planesptr+2,a0 * move.l _Planar1,d0 * move.l #$04,d1 .loop: move.w d0,4(a0) ; gemmer low wordet swap d0 move.w d0,(a0) ; gemnmer high wordet swap d0 add.l #(320*256)/8,d0 addq.l #8,a0 dbra d1,.loop move.w #diwstrt,frameset move.w #$2c51,frameset+2 move.w #diwstop,frameset+4 move.w #$2ca1,frameset+6 rts rts ** ** skum data kode ** ** alt den kode som vi ikke skal pille ved ** cnop 0,2 include 'asmpro:startup/takesystem.asm' * take-/restore-system * include 'sm:startup-code.asm' cnop 0,2 include 'asmpro:startup/gfxmacros.s' cnop 0,2 include 'asmpro:startup/timer_macro.s' cnop 0,2 include 'asmpro:startup/p6104.asm' * the player 6.104 cnop 0,8 ** timer data store time: dc.l 0 loop_timer: dc.l 0 cpu_type: dc.l 0 current_colors: dc.l 0 fadeSpeed Dc.w 0 fadeCounter Dc.w 0 cnop 0,2 aktiv_buffer: dc.l 0 render_buffer: dc.l 0 _Planar1 dc.l Planar1 xcord: dc.w 0 dc.w 0 section copper,DATA_C cnop 0,8 copper: frameset: dc.w diwstrt,$2c81 * standart dc.w diwstop,$f4c1 *ntsc = $2c81 - $f4c1 * dc.w diwstop,$2cc1 *pal = $2c81 - $2cc1 copmode 5,0,0,0,0 dc.w fmode,$0000 dc.w ddfstrt,$0038 dc.w ddfstop,$00d0 dc.w bplcon1,$0000 dc.w bplcon2,$0000 dc.w bplcon3,$0000 dc.w bpl1mod,$0000 dc.w bpl2mod,$0000 * dc.w bpl1mod,2*40 * dc.w bpl2mod,2*40 copper_colors: dc.w $0180,$0000,$0182,$0000,$0184,$0000,$0186,$0000 dc.w $0188,$0000,$018A,$0000,$018C,$0000,$018E,$0000 dc.w $0190,$0000,$0192,$0000,$0194,$0000,$0196,$0000 dc.w $0198,$0000,$019A,$0000,$019C,$0000,$019E,$0000 dc.w $01A0,$0000,$01A2,$0000,$01A4,$0000,$01A6,$0000 dc.w $01A8,$0000,$01AA,$0000,$01AC,$0000,$01AE,$0000 dc.w $01B0,$0000,$01B2,$0000,$01B4,$0000,$01B6,$0000 dc.w $01B8,$0000,$01BA,$0000,$01BC,$0000,$01BE,$0000 dc.w $1001,$fffe planesptr: dc.w bpl1pth,$0,bpl1ptl,$0 dc.w bpl2pth,$0,bpl2ptl,$0 dc.w bpl3pth,$0,bpl3ptl,$0 dc.w bpl4pth,$0,bpl4ptl,$0 dc.w bpl5pth,$0,bpl5ptl,$0 cop_topcol wait 0,$0 copcol 0,$0034 cop_topline wait 0,$00 copcol 0,$0fff cop_midcol wait 0,$00 copcol 0,$0 dc.l $ffdffffe * hopper ned under den 200 y raster linje cop_buttomline wait 0,$40 copcol 0,$0fff cop_mirror: dc.w bpl1mod,$0000 dc.w bpl2mod,$0000 cop_buttomcol wait 0,$41 copcol 0,$0034 copcol 1,$0455 copcol 2,$0798 copcol 3,$0acc dc.l $fffffffe dc.l $fffffffe dc.l $fffffffe blackass_colors: ds.w 32 section musik,DATA_C p61_data: incbin 'asmpro:startup/p61.sexual reproduction' section data,DATA_C cnop 0,8 section planar,BSS_C cnop 0,8 Planar1 ds.b ((320*200)/8)*5 clean_planar: ds.b ((320*256)/8) tom: ds.l 16 .