amiga_imgv

diff src/amiga/gfx.c @ 6:ae0ada629b03

wohooo it works :)
author John Tsiombikas <nuclear@member.fsf.org>
date Fri, 27 Oct 2017 15:42:58 +0300
parents 0d3d7b020e6a
children 3d9aaefb8ba6
line diff
     1.1 --- a/src/amiga/gfx.c	Fri Oct 27 12:32:24 2017 +0300
     1.2 +++ b/src/amiga/gfx.c	Fri Oct 27 15:42:58 2017 +0300
     1.3 @@ -1,4 +1,5 @@
     1.4  #include <stdio.h>
     1.5 +#include <assert.h>
     1.6  #include <proto/exec.h>
     1.7  #include "gfx.h"
     1.8  #include "copper.h"
     1.9 @@ -32,7 +33,7 @@
    1.10  	prev_intreq = REG_INTREQR;
    1.11  	prev_adkcon = REG_ADKCONR;
    1.12  
    1.13 -	if(init_copper(0, 0) == -1) {
    1.14 +	if(init_copper(1400, 0) == -1) {
    1.15  		return -1;
    1.16  	}
    1.17  
    1.18 @@ -225,17 +226,19 @@
    1.19  		add_copper(COPPER_MOVE(REGN_COLOR(i), img->palette[i]));
    1.20  		logmsg("copper palette[%d]: %x\n", i, (unsigned int)img->palette[i]);
    1.21  	}
    1.22 -#if 0
    1.23  	/* add copper instructions for palette changes according to the image changelist */
    1.24  	prev_line = -1;
    1.25  	while(chg) {
    1.26  		assert(chg->line >= prev_line);
    1.27  		if(chg->line != prev_line) {
    1.28 +			if(chg->line > 255 && prev_line < 255) {
    1.29 +				add_copper(COPPER_VWAIT(255));
    1.30 +			}
    1.31  			prev_line = chg->line;
    1.32  			add_copper(COPPER_VWAIT(chg->line));
    1.33  		}
    1.34  		add_copper(COPPER_MOVE(REGN_COLOR(chg->entry >> 12), chg->entry & 0xfff));
    1.35 +		chg = chg->next;
    1.36  	}
    1.37 -#endif
    1.38  	add_copper(COPPER_END);
    1.39  }