AmigaExamples/014.lace_mode
alpine9000 ffc5f1f93d Got build working on newer OSX, included missing ADFs 2019-06-11 13:58:03 +10:00
..
bin Got build working on newer OSX, included missing ADFs 2019-06-11 13:58:03 +10:00
screenshots Added better screenshot 2016-03-11 21:13:12 +11:00
Makefile Updated post resize 2016-03-12 12:44:49 +11:00
README.md Update README.md 2016-03-11 21:26:23 +11:00
constants.i Improved version of lace_mode 2016-03-10 10:42:57 +11:00
demo.pal Initial test of laced mode 2016-03-10 08:44:32 +11:00
gigi.pal Updated post resize 2016-03-12 12:44:49 +11:00
init.s Removed -phxass assembler argument 2016-03-20 21:11:56 +11:00
lace_mode.s Removed -phxass assembler argument 2016-03-20 21:11:56 +11:00
utils.s Initial test of laced mode 2016-03-10 08:44:32 +11:00

README.md

interlaced playfield

For interlace mode, we can enable it by simply setting the LACE bit in BPLCON0:

  move.w	#(SCREEN_BIT_DEPTH<<12)|COLOR_ON|HOMOD|LACE,BPLCON0(a6)

Now each alternating frame will be offset vertically by half a scan line.

So for this to work, we need to make some other changes. Firstly we need twice the number of rows in our bitplane data. Then on each alternating frame we need to set up the bitplane pointers such that they point at the correct set of row data. For this we set up two copper lists, then poke offset bitplane pointers into one of them:

 ;; poke the bitplane pointers for the two copper lists.
 move.l	#SCREEN_WIDTH_BYTES*SCREEN_BIT_DEPTH,d0
 lea 	copper(pc),a0
 bsr.s	pokeBitplanePointers
 
 moveq.l	#0,d0
 lea 	copperLOF(pc),a0
 bsr.s	pokeBitplanePointers	

Then, during the vertical blank, depending on the LOF bit in the VPOSR register, we install the correct copper list:

 .mainLoop:
	bsr     waitVerticalBlank
	btst.w  #VPOSRLOFBIT,VPOSR(a6)
	beq.s   .lof
	lea     copper(pc),a0
	move.l  a0,COP1LC(a6)
	bra     .done
 .lof:
	lea     copperLOF(pc),a0
	move.l  a0,COP1LC(a6)
 .done
	bra     .mainLoop

This example allows your to enable/disable INTERLACE mode in the Makefile:

INTERLACE=1

try it

interlaced

interlaced

non-interlaced

non-interlaced