diff --git a/c64testprgs/apaw.prg b/c64testprgs/apaw.prg new file mode 100644 index 0000000..c547d26 Binary files /dev/null and b/c64testprgs/apaw.prg differ diff --git a/c64testprgs/charset.prg b/c64testprgs/charset.prg new file mode 100644 index 0000000..6178244 Binary files /dev/null and b/c64testprgs/charset.prg differ diff --git a/c64testprgs/concubism.prg b/c64testprgs/concubism.prg new file mode 100644 index 0000000..d79e5a5 Binary files /dev/null and b/c64testprgs/concubism.prg differ diff --git a/c64testprgs/deadsun.prg b/c64testprgs/deadsun.prg new file mode 100644 index 0000000..576fb46 Binary files /dev/null and b/c64testprgs/deadsun.prg differ diff --git a/c64testprgs/gotmyeyesonyou.prg b/c64testprgs/gotmyeyesonyou.prg new file mode 100644 index 0000000..26cf7b2 Binary files /dev/null and b/c64testprgs/gotmyeyesonyou.prg differ diff --git a/c64testprgs/keyboardtest.prg b/c64testprgs/keyboardtest.prg new file mode 100644 index 0000000..24b5493 Binary files /dev/null and b/c64testprgs/keyboardtest.prg differ diff --git a/c64testprgs/mabooty.prg b/c64testprgs/mabooty.prg new file mode 100644 index 0000000..788342d Binary files /dev/null and b/c64testprgs/mabooty.prg differ diff --git a/c64testprgs/makeup.prg b/c64testprgs/makeup.prg new file mode 100644 index 0000000..808afdc Binary files /dev/null and b/c64testprgs/makeup.prg differ diff --git a/c64testprgs/medusa.prg b/c64testprgs/medusa.prg new file mode 100644 index 0000000..d058e9f Binary files /dev/null and b/c64testprgs/medusa.prg differ diff --git a/c64testprgs/rasterIRQ.asm b/c64testprgs/rasterIRQ.asm new file mode 100644 index 0000000..7e3620b --- /dev/null +++ b/c64testprgs/rasterIRQ.asm @@ -0,0 +1,30 @@ + + *=$0801 + .word (+), 2005 + .null $9e, format("%d", start) ++ .word 0 + + * = 2084 + + +start + sei + lda #$7f + sta $dc0d + and $d011 + sta $d011 + lda #123 + sta $d012 + lda #irq + sta $0315 + lda #1 + sta $d01a + cli + rts + +irq + inc $0400 + asl $d019 + jmp $ea31 diff --git a/c64testprgs/rasterIRQ.prg b/c64testprgs/rasterIRQ.prg new file mode 100644 index 0000000..cdfd31f Binary files /dev/null and b/c64testprgs/rasterIRQ.prg differ diff --git a/c64testprgs/scarecrow.prg b/c64testprgs/scarecrow.prg new file mode 100644 index 0000000..a22af75 Binary files /dev/null and b/c64testprgs/scarecrow.prg differ diff --git a/c64testprgs/spritepos.prg b/c64testprgs/spritepos.prg new file mode 100644 index 0000000..08b1a46 Binary files /dev/null and b/c64testprgs/spritepos.prg differ diff --git a/c64testprgs/testTOD.asm b/c64testprgs/testTOD.asm new file mode 100644 index 0000000..3c8c843 --- /dev/null +++ b/c64testprgs/testTOD.asm @@ -0,0 +1,134 @@ + CIA1 = $DC00 + CIA2 = $DD00 + SCREEN = $0400 + + *=$0801 + .word (+), 2005 + .null $9e, format("%d", start) ++ .word 0 + + * = 2084 + + +start + jsr $e544 ; clear screen + lda CIA1+15 + and #%01111111 + sta CIA1+15 + lda CIA2+15 + and #%01111111 + sta CIA2+15 + + lda #$08 + sta CIA1+11 + lda #$13 + sta CIA2+11 + lda #$59 + sta CIA1+10 + lda #$20 + sta CIA2+10 + lda #$50 + sta CIA1+9 + lda #$40 + sta CIA2+9 + lda #$00 + sta CIA1+8 + sta CIA2+8 + + lda CIA1+8 ; start TOD timer in CIA1 + lda CIA2+8 ; start TOD timer in CIA2 + +loop + lda CIA1+8 + ora #'0' + sta SCREEN+0 + + lda CIA2+8 + ora #'0' + sta SCREEN+0+40 + + lda CIA1+9 + tay + lsr a + lsr a + lsr a + lsr a + ora #'0' + sta SCREEN+2 + tya + and #$0f + ora #'0' + sta SCREEN+3 + + lda CIA2+9 + tay + lsr a + lsr a + lsr a + lsr a + ora #'0' + sta SCREEN+2+40 + tya + and #$0f + ora #'0' + sta SCREEN+3+40 + + lda CIA1+10 + tay + lsr a + lsr a + lsr a + lsr a + ora #'0' + sta SCREEN+5 + tya + and #$0f + ora #'0' + sta SCREEN+6 + + lda CIA2+10 + tay + lsr a + lsr a + lsr a + lsr a + ora #'0' + sta SCREEN+5+40 + tya + and #$0f + ora #'0' + sta SCREEN+6+40 + + lda CIA1+11 + tay + lsr a + lsr a + lsr a + lsr a + ora #'0' + sta SCREEN+8 + tya + and #$0f + ora #'0' + sta SCREEN+9 + + lda CIA2+11 + tay + lsr a + lsr a + lsr a + lsr a + ora #'0' + sta SCREEN+8+40 + tya + and #$0f + ora #'0' + sta SCREEN+9+40 + + jmp loop + + + + + + diff --git a/c64testprgs/testTOD.prg b/c64testprgs/testTOD.prg new file mode 100644 index 0000000..0d1a878 Binary files /dev/null and b/c64testprgs/testTOD.prg differ diff --git a/c64testprgs/timer32.prg b/c64testprgs/timer32.prg new file mode 100644 index 0000000..4089597 Binary files /dev/null and b/c64testprgs/timer32.prg differ diff --git a/c64testprgs/wizzine.prg b/c64testprgs/wizzine.prg new file mode 100644 index 0000000..e467f3b Binary files /dev/null and b/c64testprgs/wizzine.prg differ diff --git a/c64testprgs/woolonhermind.prg b/c64testprgs/woolonhermind.prg new file mode 100644 index 0000000..411b2e2 Binary files /dev/null and b/c64testprgs/woolonhermind.prg differ diff --git a/src/main/kotlin/razorvine/c64emu/Screen.kt b/src/main/kotlin/razorvine/c64emu/Screen.kt index 26946d4..3a711cd 100644 --- a/src/main/kotlin/razorvine/c64emu/Screen.kt +++ b/src/main/kotlin/razorvine/c64emu/Screen.kt @@ -233,9 +233,11 @@ internal class Screen(private val chargenData: ByteArray, val ram: MemoryCompone private val coloredCharacterImageCache = mutableMapOf, BufferedImage>() private fun drawColoredChar(x: Int, y: Int, char: Int, color: Int, charsetAddr: Address) { - // The vic 'sees' the charset rom at these addresses: $1000 + $1800, $9000 + $9800 - // so we can use pre-loaded images to efficiently draw the characters. - // If the address is different, the vic takes charset data from RAM instead. + // The vic 'sees' the charset ROM at these addresses: $1000(normal) + $1800(shifted), $9000(normal) + $9800(shifted) + // so we can use pre-loaded images to efficiently draw the default ROM characters. + // If the address is different, the vic takes charset data from RAM instead (thus allowing user defined charsets) + // A user-supplied character set in RAM must begin at an address that is 2048 byte aligned, + // and lies within the same 16K VIC bank as the screen character memory. // TODO: currently custom charsets taken from RAM aren't supported val shifted = charsetAddr and 0x0800 != 0 val charImage = getCharImage(char, color, shifted)