Remove legacy JVM-specific file system, shell, and related implementations; migrate to platform-agnostic and common main modules.

This commit is contained in:
2025-08-14 16:04:13 +02:00
parent 63f9a1f928
commit c7552c2a95
133 changed files with 981 additions and 898 deletions

View File

@@ -0,0 +1,38 @@
package mtmc.os.shell.builtins
import mtmc.emulator.MonTanaMiniComputer
import mtmc.os.shell.ShellCommand
import mtmc.tokenizer.MTMCToken
import mtmc.tokenizer.MTMCTokenizer
class SpeedCommand : ShellCommand() {
private val speeds = listOf(
1, 10, 100, 1000, 10000, 100000, 1000000
)
@Throws(Exception::class)
override fun exec(tokens: MTMCTokenizer, computer: MonTanaMiniComputer) {
if (tokens.match(MTMCToken.TokenType.IDENTIFIER)) {
computer.speed = 0
} else if (tokens.match(MTMCToken.TokenType.INTEGER)) {
val speed = tokens.consumeAsInteger()
if (!speeds.contains(speed)) {
usageException()
}
computer.speed = speed
} else {
usageException()
}
}
override val help: String
get() = """
speed <val> - set the speed of the computer
where <val> is one of:
raw - run with no simulated speed delay
1 - run the computer at 1hz
10 - run the computer at 10hz
100 - run the computer at 100hz
1000 - run the computer at 1khz
""".trimIndent()
}