include "base.s" ********* CONST *********************************** W = 320 ; screen/bitplane width in memory (in px) H = 256 ; screen/bitplane height in memoty (in px) BPLS = 5 ; number of bitplanes LEFF = 320 ; effective screen width (DDFSTOP-DDFSTRT)*2+16 MODULOS = W/8*BPLS-LEFF/8 ; number of bytes to skip per line ; W/8-LEFF/8 if non IL ; W/8*BPLS-LEFF/8 if IL BPLSIZE = W/8 ; bytes taken by one bitplane ; W/8*H if non IL ; W/8 if IL LINESIZE = W/8*BPLS ; Lentght of image line in bytes ; W/8 if non IL ; W/8*BPLS if IL ********* INIT ************************************ run: lea CUSTOM,a6 ; move the base to a6 move.w #$8380,DMACON(a6) ; activate copper+ BPL in DMA channel move.l #copper,COP1LCH(a6) ; move new copper to copper register move.w #0,COPJMP1(a6) ; (H and L) & activate new copper lea copperbpl,a0 ; set the needed variables before move.l #screen,d0 ; branching to rotine to bsr pokebpls ; poke bpls memoory ptr to copper ********* MAIN ************************************ main: bsr waitVBI ; wait for the vertical blanc ; before updating the screen btst #6,$BFE001 ; is lmb prssed bne main ; 0 = pressed rts ********* ROUTINES *********************************** *** poke bipls addresses into copper * a0: bpls pointer in copperlist * d0: address of bpls in memory pokebpls: moveq #BPLS-1,d7 ; loop counter = number of bpls loopbpl: move.w d0,6(a0) ; low word in BPL1PTL swap d0 ; swap low and high move.w d0,2(a0) ; high word into BPL1PTH swap d0 ; original address back add.l #BPLSIZE,d0 ; d0 points to bpl2 data add.l #8,a0 ; a0 points to next bplptr dbf d7,loopbpl rts ********* DATA in FAST MEM ************************ ********* DATA in CHIP MEM ************************ section copperlist,data_C copper: dc.w BPLCON0,BPLS<<12!$0200 ; set bitplane number dc.w DIWSTRT,$2C81 ; define display window size dc.w DIWSTOP,$F4C1 ; 320 X 200 pixels ; $F4C1 for 200 px high ; $2CC1 dor 256 px high dc.w DDFSTRT,$38 ; define display data fetch dc.w DDFSTOP,$D0 ; size to 320 pxels dc.w BPL1MOD,MODULOS ; skip xxx px per line dc.w BPL2MOD,MODULOS copperbpl: dc.w BPL1PTH,$0000 ; give denise the pointer dc.w BPL1PTL,$0000 ; to the first bitplane dc.w BPL2PTH,$0000 ; give denise the pointer dc.w BPL2PTL,$0000 ; to the second bitplane dc.w BPL3PTH,$0000 ; give denise the pointer dc.w BPL3PTL,$0000 ; to the third bitplane dc.w BPL4PTH,$0000 ; give denise the pointer dc.w BPL4PTL,$0000 ; to the fotrh bitplane dc.w BPL5PTH,$0000 ; give denise the pointer dc.w BPL5PTL,$0000 ; to the fifth bitplane dc.w BPL6PTH,$0000 ; give denise the pointer dc.w BPL6PTL,$0000 ; to the sixth bitplane palette: include "AH_KingTut.palette" dc.w $FFFF,$FFFE ; copper end screen: incbin "AH_KingTutIL320x256x5.raw"