mirror of https://github.com/irmen/ksim65.git
added c64 test programs
This commit is contained in:
parent
2410ca48f9
commit
d7b443a677
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -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 $0314
|
||||
lda #>irq
|
||||
sta $0315
|
||||
lda #1
|
||||
sta $d01a
|
||||
cli
|
||||
rts
|
||||
|
||||
irq
|
||||
inc $0400
|
||||
asl $d019
|
||||
jmp $ea31
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -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
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -233,9 +233,11 @@ internal class Screen(private val chargenData: ByteArray, val ram: MemoryCompone
|
|||
private val coloredCharacterImageCache = mutableMapOf<Triple<Int, Int, Boolean>, 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)
|
||||
|
|
Loading…
Reference in New Issue