mirror of
https://gitlab.com/camelot/kickc.git
synced 2025-02-20 00:29:10 +00:00
Added a blitter box
This commit is contained in:
parent
9cec38d075
commit
eed4018450
@ -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");
|
||||
|
57
src/test/kc/c64dtv-blitter-box.kc
Normal file
57
src/test/kc/c64dtv-blitter-box.kc
Normal file
@ -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_MI = >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_MI = >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_MI = >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);
|
||||
|
||||
}
|
@ -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 = <SRCB;
|
||||
@ -26,8 +26,8 @@ void main() {
|
||||
*DTV_BLITTER_SRCB_HI = 0;
|
||||
*DTV_BLITTER_SRCB_MOD_LO = 0;
|
||||
*DTV_BLITTER_SRCB_MOD_HI = 0;
|
||||
*DTV_BLITTER_SRCB_LIN_LO = <$100;
|
||||
*DTV_BLITTER_SRCB_LIN_HI = >$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 = <SCREEN;
|
||||
@ -35,8 +35,8 @@ void main() {
|
||||
*DTV_BLITTER_DEST_HI = 0;
|
||||
*DTV_BLITTER_DEST_MOD_LO = 0;
|
||||
*DTV_BLITTER_DEST_MOD_HI = 0;
|
||||
*DTV_BLITTER_DEST_LIN_LO = <$100;
|
||||
*DTV_BLITTER_DEST_LIN_HI = >$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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user