mirror of
https://github.com/irmen/ksim65.git
synced 2024-06-10 17:29:28 +00:00
do not crash anymore when multicolor mode is enabled
This commit is contained in:
parent
1123ddf482
commit
2ad73432f6
|
@ -148,17 +148,17 @@ internal class Screen(private val chargen: Rom, val ram: MemoryComponent) : JPan
|
||||||
|
|
||||||
private fun renderCharacterMode(vicBank: Address, vicVMCSB: Int, multiColorMode: Boolean) {
|
private fun renderCharacterMode(vicBank: Address, vicVMCSB: Int, multiColorMode: Boolean) {
|
||||||
if (multiColorMode) {
|
if (multiColorMode) {
|
||||||
TODO("multicolor character mode")
|
// TODO multicolor character mode, for now, falls back to normal char mode
|
||||||
} else {
|
}
|
||||||
// normal character mode
|
|
||||||
val screenAddress = vicBank+(vicVMCSB ushr 4) shl 10
|
// normal character mode
|
||||||
val charsetAddress = (vicVMCSB and 0b00001110) shl 10
|
val screenAddress = vicBank+(vicVMCSB ushr 4) shl 10
|
||||||
for (y in 0 until ScreenDefs.SCREEN_HEIGHT_CHARS) {
|
val charsetAddress = (vicVMCSB and 0b00001110) shl 10
|
||||||
for (x in 0 until ScreenDefs.SCREEN_WIDTH_CHARS) {
|
for (y in 0 until ScreenDefs.SCREEN_HEIGHT_CHARS) {
|
||||||
val char = ram[screenAddress+x+y*ScreenDefs.SCREEN_WIDTH_CHARS].toInt()
|
for (x in 0 until ScreenDefs.SCREEN_WIDTH_CHARS) {
|
||||||
val color = ram[0xd800+x+y*ScreenDefs.SCREEN_WIDTH_CHARS].toInt() // colors always at $d800
|
val char = ram[screenAddress+x+y*ScreenDefs.SCREEN_WIDTH_CHARS].toInt()
|
||||||
drawColoredChar(x, y, char, color, vicBank+charsetAddress)
|
val color = ram[0xd800+x+y*ScreenDefs.SCREEN_WIDTH_CHARS].toInt() // colors always at $d800
|
||||||
}
|
drawColoredChar(x, y, char, color, vicBank+charsetAddress)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user