diff --git a/016.copper_fun/Makefile b/016.copper_fun/Makefile index 90f554e..a45df89 100644 --- a/016.copper_fun/Makefile +++ b/016.copper_fun/Makefile @@ -6,6 +6,7 @@ BASE_ADDRESS=10000 include ../shared/base.mk out/copper-new.s: assets/test.gif out/copper_fun_generate + rm -f out/*.png /opt/ImageMagick/bin/convert assets/test.gif out/%05d.png ./convert.sh > out/copper-new.s diff --git a/016.copper_fun/convert.sh b/016.copper_fun/convert.sh index 041502b..e0b0195 100755 --- a/016.copper_fun/convert.sh +++ b/016.copper_fun/convert.sh @@ -3,6 +3,7 @@ for I in out/*.png; do if [ $ODD = 0 ] ; then echo `echo $I | sed -e 's/\///' -e 's/\.png//'`":" ./out/copper_fun_generate $I + #mv -f resized.png $I.resized.png echo " dc.l \$fffffffe" ODD=1 diff --git a/016.copper_fun/copper_fun.s b/016.copper_fun/copper_fun.s index fc71642..18c40d7 100644 --- a/016.copper_fun/copper_fun.s +++ b/016.copper_fun/copper_fun.s @@ -47,7 +47,7 @@ entry: move.l a1,(a0) move.l counter,d0 - cmpi.l #5,counter + cmpi.l #2,counter bne .ok move.l #0,counter move.l copperptr,a0 @@ -56,7 +56,7 @@ entry: move.l copperptr,d0 cmpi.l #end,d0 bne .ok - move.l #copper,copperptr + move.l #out00001,copperptr .ok addi.l #1,counter bra.b .mainLoop diff --git a/016.copper_fun/copper_fun_generate.c b/016.copper_fun/copper_fun_generate.c index 71b1366..e1ba1a9 100644 --- a/016.copper_fun/copper_fun_generate.c +++ b/016.copper_fun/copper_fun_generate.c @@ -6,7 +6,8 @@ #include #include -#define HEIGHT 256+16 +#define TOP 16 +#define HEIGHT 256+TOP #define COPPER_WIDTH 52 typedef struct { @@ -22,7 +23,7 @@ typedef struct { } image_t; image_t image = {0}; -config_t config = {.blur = 0.75}; +config_t config = {.blur = 1.0, .debug=0}; static void cleanup() @@ -73,7 +74,7 @@ getframedata(char* inputFile) abort_("Failed to read image %s\n", inputFile); } - int width = COPPER_WIDTH; + int width = COPPER_WIDTH-8; int height = HEIGHT; image.resizeImage=ResizeImage(image.image, width, height, BesselFilter, config.blur, &exception); @@ -95,9 +96,8 @@ main(int argc, char** argv) config.argv = argv; getframedata(argv[1]); - int startLine = 0x2c-16; - int screenHeight = HEIGHT; - int endLine = startLine+screenHeight; + int startLine = 0x2c-TOP; + int endLine = startLine+HEIGHT; int startHpos = 6+8; int i, line; @@ -114,7 +114,7 @@ main(int argc, char** argv) } for (i = 0; i < endw; i++) { - PixelPacket pixel = GetOnePixel(image.resizeImage, i, line-startLine); + PixelPacket pixel = GetOnePixel(image.resizeImage, i-10, line-startLine); printf("\tdc.w COLOR00,$%x%x%x\n", pixel.red>>4, pixel.green>>4, pixel.blue>>4); }