pouët.net

Checkorboard by Orb [web]

*****************************************************************************
* Checkorboard
*
* a small 128 byte checkerboard zoomer (including file header)
* for amiga ocs...
*
* ultra^orb 20110530
*
*****************************************************************************

release         equ     1
plane           equ     $0e

        section shortig, code_c
*****************************************************************************
mainloop:
	clr	d0
	moveq	#$40,d7
	add	d7,d1
	clr.l	d5
drawloop:

    lea     copper(pc),a0
    lea     $dff000+$180,a6
    move.l  a0,$80-$180(a6)
sync
    cmp.b   $06-$180(a6),d7
    bne.s   sync

	;write color
	move.l	d5,(a6)

	moveq   #plane,d5

	;bitplane adr is used to preform an and
	;on the zoom
	bclr	d5,d1

	;set bitplane
	move.l  d5,$e0-$180(a6)

	;calc screen ptr
	move	d7,d2
	lsr	#3,d2
	addq	#plane-($40/8),d2
	move	d2,a4

	;set pixels
	not	d7
	bclr	d7,(a4)
        add.w   d1,d0
	bmi.s	hh

	;swap for y check
	;bitplane adr is used for the colors
	swap	d5
	bset	d7,(a4)
hh
	not	d7

    addq.b  #1,d7
    bcc.s   drawloop

	;set colors to 0
	;saves window stop in the copperlist
	;also avoid some annoying flashing
	clr.l	(a6)

    if      release
    bra.s   mainloop
    else
    btst    #6,$bfe001
    bne.s   mainloop
    illegal
    endc

*****************************************************************************
copper
    dc.w    $009a,$7fff             ; irqs off
	dc.w	$0096,$0020				; sprites off

    dc.w    $008e,$4071             ; window start
    dc.w    $0092,$0058             ; fetch start
    dc.w    $0094,$00b0             ; fetch stop
    dc.w    $0100,$1200
*****************************************************************************
        end