diff --git a/src/test/java/dk/camelot64/kickc/test/TestPrograms.java b/src/test/java/dk/camelot64/kickc/test/TestPrograms.java index 7a4ea6db5..508e25cee 100644 --- a/src/test/java/dk/camelot64/kickc/test/TestPrograms.java +++ b/src/test/java/dk/camelot64/kickc/test/TestPrograms.java @@ -1230,6 +1230,11 @@ public class TestPrograms { compileAndCompare("c64dtv-blittermin"); } + @Test + public void testC64DtvBlitterBox() throws IOException, URISyntaxException { + compileAndCompare("c64dtv-blitter-box"); + } + @Test public void testC64Dtv8bppChunkyStretch() throws IOException, URISyntaxException { compileAndCompare("c64dtv-8bppchunkystretch"); diff --git a/src/test/kc/c64dtv-blitter-box.kc b/src/test/kc/c64dtv-blitter-box.kc new file mode 100644 index 000000000..df9ab614f --- /dev/null +++ b/src/test/kc/c64dtv-blitter-box.kc @@ -0,0 +1,57 @@ +// Fill a box on the screen using the blitter + +import "c64dtv.kc" + +const byte* SCREEN = $400; +const byte[] SRCA = "camelot rules!"; +const byte[] SRCB = { $80 }; + +void main() { + + *DTV_FEATURE = DTV_FEATURE_ENABLE; + + // Instruct blitter not to continue previous blit + *DTV_BLITTER_CONTROL2 = DTV_BLIT_CLEAR_IRQ; + + *DTV_BLITTER_SRCA_LO = SRCA; + *DTV_BLITTER_SRCA_HI = 0; + *DTV_BLITTER_SRCA_MOD_LO = 0; + *DTV_BLITTER_SRCA_MOD_HI = 0; + *DTV_BLITTER_SRCA_LIN_LO = <$100uw; + *DTV_BLITTER_SRCA_LIN_HI = >$100uw; + *DTV_BLITTER_SRCA_STEP = 01; // Step 0.0 + + *DTV_BLITTER_SRCB_LO = SRCB; + *DTV_BLITTER_SRCB_HI = 0; + *DTV_BLITTER_SRCB_MOD_LO = 0; + *DTV_BLITTER_SRCB_MOD_HI = 0; + *DTV_BLITTER_SRCB_LIN_LO = <$100uw; + *DTV_BLITTER_SRCB_LIN_HI = >$100uw; + *DTV_BLITTER_SRCB_STEP = $00; // Step 0.0 + + *DTV_BLITTER_DEST_LO = SCREEN+40+5; + *DTV_BLITTER_DEST_HI = 0; + *DTV_BLITTER_DEST_MOD_LO = <21uw; + *DTV_BLITTER_DEST_MOD_HI = >21uw; + *DTV_BLITTER_DEST_LIN_LO = <19uw; + *DTV_BLITTER_DEST_LIN_HI = >19uw; + *DTV_BLITTER_DEST_STEP = $10; // Step 1.0 + + *DTV_BLITTER_LEN_LO = <20*10uw; + *DTV_BLITTER_LEN_HI = >20*10uw; + + *DTV_BLITTER_ALU = DTV_BLIT_ADD; + *DTV_BLITTER_TRANSPARANCY = DTV_BLIT_TRANSPARANCY_NONE; + + // Start blitter + *DTV_BLITTER_CONTROL = DTV_BLIT_FORCE_START | DTV_BLIT_SRCA_FWD | DTV_BLIT_SRCB_FWD| DTV_BLIT_DEST_FWD; + // Instruct blitter to continue at DEST and restart SRC A/B + *DTV_BLITTER_CONTROL2 = DTV_BLIT_DEST_CONT; + + // wait til blitter is ready + do {} while((*DTV_BLITTER_CONTROL2 & DTV_BLIT_STATUS_BUSY)!=0); + +} \ No newline at end of file diff --git a/src/test/kc/c64dtv-blittermin.kc b/src/test/kc/c64dtv-blittermin.kc index ee0002776..ffc43fa90 100644 --- a/src/test/kc/c64dtv-blittermin.kc +++ b/src/test/kc/c64dtv-blittermin.kc @@ -17,8 +17,8 @@ void main() { *DTV_BLITTER_SRCA_HI = 0; *DTV_BLITTER_SRCA_MOD_LO = 0; *DTV_BLITTER_SRCA_MOD_HI = 0; - *DTV_BLITTER_SRCA_LIN_LO = <$100; - *DTV_BLITTER_SRCA_LIN_HI = >$100; + *DTV_BLITTER_SRCA_LIN_LO = <$100uw; + *DTV_BLITTER_SRCA_LIN_HI = >$100uw; *DTV_BLITTER_SRCA_STEP = $10; // Step 1.0 *DTV_BLITTER_SRCB_LO = $100; + *DTV_BLITTER_SRCB_LIN_LO = <$100uw; + *DTV_BLITTER_SRCB_LIN_HI = >$100uw; *DTV_BLITTER_SRCB_STEP = $00; // Step 0.0 *DTV_BLITTER_DEST_LO = $100; + *DTV_BLITTER_DEST_LIN_LO = <$100uw; + *DTV_BLITTER_DEST_LIN_HI = >$100uw; *DTV_BLITTER_DEST_STEP = $10; // Step 1.0 *DTV_BLITTER_LEN_LO = SRCA_LEN;