moving everything neatly into the assets directory

This commit is contained in:
minjaesong
2020-12-24 11:00:32 +09:00
parent 74b1279ed4
commit 608f61c617
111 changed files with 98 additions and 28 deletions

View File

@@ -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);
}

View File

@@ -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(

View File

@@ -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) {

View File

@@ -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
)

View File

@@ -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 {

View File

@@ -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

View File

@@ -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(

View File

@@ -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]
}