mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-03-10 21:21:51 +09:00
moving everything neatly into the assets directory
This commit is contained in:
@@ -22,14 +22,16 @@ public class AppLoader {
|
||||
appConfig.resizable = false;
|
||||
appConfig.title = appTitle;
|
||||
appConfig.forceExit = true;
|
||||
appConfig.width = 720;//560;
|
||||
appConfig.height = 375;//448;
|
||||
appConfig.width = 560;
|
||||
appConfig.height = 448;
|
||||
|
||||
|
||||
// val vm = VM(64.kB(), TheRealWorld(), arrayOf(GenericBios))
|
||||
VM vm = new VM(64 << 10, new TheRealWorld(), new VMProgramRom[]{GenericBios.INSTANCE});
|
||||
//VM vm = new VM(64 << 10, new TheRealWorld(), new VMProgramRom[]{BasicBios.INSTANCE, BasicRom.INSTANCE});
|
||||
//VM vm = new VM(64 << 10, new TheRealWorld(), new VMProgramRom[]{OEMBios.INSTANCE, BasicRom.INSTANCE});
|
||||
|
||||
//VM vm = new VM(64 << 10, new TheRealWorld(), new VMProgramRom[]{GenericBios.INSTANCE});
|
||||
VM vm = new VM(64 << 10, new TheRealWorld(), new VMProgramRom[]{TBASRelBios.INSTANCE});
|
||||
new LwjglApplication(new VMGUI(vm, appConfig), appConfig);
|
||||
}
|
||||
|
||||
|
||||
@@ -33,8 +33,8 @@ class VMGUI(val vm: VM, val appConfig: LwjglApplicationConfiguration) : Applicat
|
||||
override fun create() {
|
||||
super.create()
|
||||
|
||||
//gpu = GraphicsAdapter(vm, GraphicsAdapter.DEFAULT_CONFIG_COLOR_CRT)
|
||||
gpu = TexticsAdapter(vm)
|
||||
gpu = GraphicsAdapter(vm, GraphicsAdapter.DEFAULT_CONFIG_COLOR_CRT)
|
||||
//gpu = TexticsAdapter(vm)
|
||||
//gpu = CharacterLCDdisplay(vm)
|
||||
|
||||
vm.peripheralTable[1] = PeripheralEntry(
|
||||
|
||||
@@ -6,11 +6,11 @@ import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.tsvm.VM
|
||||
|
||||
class CharacterLCDdisplay(vm: VM) : GraphicsAdapter(vm, AdapterConfig(
|
||||
"pmlcd_inverted", 960, 400, 80, 25, 249, 255, 262144L, "./lcd.png", 0.7f, TEXT_TILING_SHADER_LCD, DRAW_SHADER_FRAG_LCD
|
||||
"pmlcd_inverted", 960, 400, 80, 25, 249, 255, 262144L, "lcd.png", 0.7f, TEXT_TILING_SHADER_LCD, DRAW_SHADER_FRAG_LCD
|
||||
)
|
||||
) {
|
||||
|
||||
private val machine = Texture("./8025_textonly.png")
|
||||
private val machine = Texture("./assets/8025_textonly.png")
|
||||
|
||||
override fun peek(addr: Long): Byte? {
|
||||
return when (addr) {
|
||||
|
||||
@@ -59,7 +59,7 @@ open class GraphicsAdapter(val vm: VM, val config: AdapterConfig, val sgr: Super
|
||||
val channel = it % 4
|
||||
rgba.shr((3 - channel) * 8).and(255) / 255f
|
||||
}
|
||||
protected val chrrom0 = Texture(config.chrRomPath)
|
||||
protected val chrrom0 = Texture("./assets/"+config.chrRomPath)
|
||||
protected val faketex: Texture
|
||||
|
||||
internal val spriteAndTextArea = UnsafeHelper.allocate(10660L)
|
||||
@@ -1245,11 +1245,11 @@ void main() {
|
||||
|
||||
val DEFAULT_CONFIG_COLOR_CRT = AdapterConfig(
|
||||
"crt_color",
|
||||
560, 448, 80, 32, 254, 255, 256.kB(), "./FontROM7x14.png", 0.32f, TEXT_TILING_SHADER_COLOUR
|
||||
560, 448, 80, 32, 254, 255, 256.kB(), "FontROM7x14.png", 0.32f, TEXT_TILING_SHADER_COLOUR
|
||||
)
|
||||
val DEFAULT_CONFIG_PMLCD = AdapterConfig(
|
||||
"pmlcd_inverted",
|
||||
560, 448, 80, 32, 254, 255, 256.kB(), "./FontROM7x14.png", 0.64f, TEXT_TILING_SHADER_LCD, DRAW_SHADER_FRAG_LCD
|
||||
560, 448, 80, 32, 254, 255, 256.kB(), "FontROM7x14.png", 0.64f, TEXT_TILING_SHADER_LCD, DRAW_SHADER_FRAG_LCD
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -39,8 +39,9 @@ class IOSpace(val vm: VM) : PeriBase, InputProcessor {
|
||||
private val keyEventBuffers = ByteArray(8)
|
||||
|
||||
init {
|
||||
blockTransferPorts[1].attachDevice(TestFunctionGenerator())
|
||||
blockTransferPorts[0].attachDevice(TestDiskDrive(vm, 0, File("assets/")))
|
||||
//blockTransferPorts[1].attachDevice(TestFunctionGenerator())
|
||||
//blockTransferPorts[0].attachDevice(TestDiskDrive(vm, 0, File("assets")))
|
||||
blockTransferPorts[0].attachDevice(TestDiskDrive(vm, 0, File("assets/disk0")))
|
||||
}
|
||||
|
||||
private fun composeBlockTransferStatus(portno: Int): Int {
|
||||
|
||||
@@ -13,7 +13,7 @@ class TTY(val vm: VM) : GlassTty(TEXT_ROWS, TEXT_COLS), PeriBase {
|
||||
const val TEXT_COLS = 80
|
||||
}
|
||||
|
||||
private val chrrom = Texture("./tty.png")
|
||||
private val chrrom = Texture("./assets/tty.png")
|
||||
private val textBuffer = UnsafeHelper.allocate(TEXT_ROWS * TEXT_COLS * 2L)
|
||||
override var rawCursorPos = 0
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ class TexticsAdapter(vm: VM) : GraphicsAdapter(vm, AdapterConfig(
|
||||
0.64f
|
||||
)) {*/
|
||||
|
||||
private val crtGradTex = Texture("./crt_grad.png")
|
||||
private val crtGradTex = Texture("./assets/crt_grad.png")
|
||||
|
||||
companion object {
|
||||
val crtColor = hashMapOf(
|
||||
|
||||
@@ -65,5 +65,24 @@ object BasicRom : VMProgramRom {
|
||||
contents.toString(VM.CHARSET)
|
||||
}
|
||||
|
||||
override fun get(addr: Int): Byte = contents[addr]
|
||||
}
|
||||
|
||||
object TBASRelBios : VMProgramRom {
|
||||
private val contents: ByteArray
|
||||
|
||||
init {
|
||||
val bytes = File("./assets/bios/tbasdist.js").readBytes()
|
||||
contents = bytes.sliceArray(0 until minOf(65536, bytes.size))
|
||||
}
|
||||
|
||||
override fun readAll(): String {
|
||||
// check if bios is compressed in gzip
|
||||
return if (contents.startsWith(GZIP_HEADER))
|
||||
CompressorDelegate.decomp(contents).toString(VM.CHARSET)
|
||||
else
|
||||
contents.toString(VM.CHARSET)
|
||||
}
|
||||
|
||||
override fun get(addr: Int): Byte = contents[addr]
|
||||
}
|
||||
Reference in New Issue
Block a user