mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-03-07 11:51:49 +09:00
hp 264x font update
This commit is contained in:
BIN
hp2640.kra
LFS
BIN
hp2640.kra
LFS
Binary file not shown.
BIN
hp2640.png
BIN
hp2640.png
Binary file not shown.
|
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 6.1 KiB |
@@ -35,12 +35,12 @@ open class GraphicsAdapter(val vm: VM, val config: AdapterConfig) :
|
||||
return vm
|
||||
}
|
||||
|
||||
private val WIDTH = config.width
|
||||
private val HEIGHT = config.height
|
||||
private val VRAM_SIZE = config.vramSize
|
||||
private val TTY_FORE_DEFAULT = config.ttyDefaultFore
|
||||
private val TTY_BACK_DEFAULT = config.ttyDefaultBack
|
||||
private val theme = config.theme
|
||||
protected val WIDTH = config.width
|
||||
protected val HEIGHT = config.height
|
||||
protected val VRAM_SIZE = config.vramSize
|
||||
protected val TTY_FORE_DEFAULT = config.ttyDefaultFore
|
||||
protected val TTY_BACK_DEFAULT = config.ttyDefaultBack
|
||||
protected val theme = config.theme
|
||||
|
||||
internal val framebuffer = Pixmap(WIDTH, HEIGHT, Pixmap.Format.Alpha)
|
||||
protected var rendertex = Texture(1, 1, Pixmap.Format.RGBA8888)
|
||||
@@ -50,7 +50,7 @@ open class GraphicsAdapter(val vm: VM, val config: AdapterConfig) :
|
||||
rgba.shr((3 - channel) * 8).and(255) / 255f
|
||||
}
|
||||
protected val chrrom0 = Texture(config.chrRomPath)
|
||||
private val faketex: Texture
|
||||
protected val faketex: Texture
|
||||
|
||||
internal val spriteAndTextArea = UnsafeHelper.allocate(10660L)
|
||||
protected val unusedArea = ByteArray(92)
|
||||
@@ -576,9 +576,9 @@ open class GraphicsAdapter(val vm: VM, val config: AdapterConfig) :
|
||||
rendertex = Texture(framebuffer, Pixmap.Format.RGBA8888, false)
|
||||
|
||||
outFBOs[1].inUse {
|
||||
blendNormal(batch)
|
||||
batch.shader = null
|
||||
batch.inUse {
|
||||
blendNormal(batch)
|
||||
batch.color = decayColor
|
||||
batch.draw(outFBOs[0].colorBufferTexture, 0f, HEIGHT.toFloat(), WIDTH.toFloat(), -HEIGHT.toFloat())
|
||||
}
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
package net.torvald.tsvm.peripheral
|
||||
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.GL20
|
||||
import com.badlogic.gdx.graphics.Pixmap
|
||||
import com.badlogic.gdx.graphics.Texture
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.tsvm.VM
|
||||
import net.torvald.tsvm.kB
|
||||
import kotlin.math.absoluteValue
|
||||
|
||||
class TexticsAdapter(vm: VM) : GraphicsAdapter(vm, AdapterConfig(
|
||||
"crt",
|
||||
@@ -31,6 +34,8 @@ class TexticsAdapter(vm: VM) : GraphicsAdapter(vm, AdapterConfig(
|
||||
0.64f
|
||||
)) {*/
|
||||
|
||||
private val crtGradTex = Texture("./crt_grad.png")
|
||||
|
||||
override fun peek(addr: Long): Byte? {
|
||||
return when (addr) {
|
||||
in 0 until 250880 -> (-1).toByte()
|
||||
@@ -45,4 +50,24 @@ class TexticsAdapter(vm: VM) : GraphicsAdapter(vm, AdapterConfig(
|
||||
}
|
||||
}
|
||||
|
||||
private val TEX_HEIGHT = WIDTH * Math.sqrt(HEIGHT.toDouble() / WIDTH).toFloat()
|
||||
private val ALIGN = (HEIGHT - TEX_HEIGHT).absoluteValue / 2f
|
||||
|
||||
override fun render(delta: Float, batch: SpriteBatch, xoff: Float, yoff: Float) {
|
||||
super.render(delta, batch, xoff, yoff)
|
||||
|
||||
// CRT's default grey
|
||||
batch.inUse {
|
||||
batch.enableBlending()
|
||||
batch.setBlendFunction(GL20.GL_ONE, GL20.GL_ONE_MINUS_SRC_COLOR)
|
||||
batch.color = Color.WHITE
|
||||
batch.draw(crtGradTex, xoff, HEIGHT + ALIGN + yoff, WIDTH.toFloat(), -TEX_HEIGHT)
|
||||
//batch.draw(crtGradTex, xoff, HEIGHT + yoff, WIDTH.toFloat(), -HEIGHT.toFloat())
|
||||
}
|
||||
}
|
||||
|
||||
override fun dispose() {
|
||||
crtGradTex.dispose()
|
||||
super.dispose()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user