mirror of
https://github.com/irmen/prog8.git
synced 2025-02-18 05:30:34 +00:00
launch box16 emulator with the vice monlist file that contains symbols+breakpoints
This commit is contained in:
parent
b824c0b125
commit
85897ef8cd
@ -4,6 +4,7 @@ import prog8.compiler.*
|
|||||||
import prog8.compiler.target.CpuType
|
import prog8.compiler.target.CpuType
|
||||||
import prog8.compiler.target.IMachineDefinition
|
import prog8.compiler.target.IMachineDefinition
|
||||||
import prog8.compiler.target.IMachineFloat
|
import prog8.compiler.target.IMachineFloat
|
||||||
|
import prog8.compiler.target.cbm.viceMonListPostfix
|
||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
import kotlin.math.absoluteValue
|
import kotlin.math.absoluteValue
|
||||||
import kotlin.math.pow
|
import kotlin.math.pow
|
||||||
@ -43,7 +44,7 @@ internal object C64MachineDefinition: IMachineDefinition {
|
|||||||
|
|
||||||
for(emulator in listOf("x64sc", "x64")) {
|
for(emulator in listOf("x64sc", "x64")) {
|
||||||
println("\nStarting C-64 emulator $emulator...")
|
println("\nStarting C-64 emulator $emulator...")
|
||||||
val cmdline = listOf(emulator, "-silent", "-moncommands", "$programName.vice-mon-list",
|
val cmdline = listOf(emulator, "-silent", "-moncommands", "$programName.$viceMonListPostfix",
|
||||||
"-autostartprgmode", "1", "-autostart-warp", "-autostart", "$programName.prg")
|
"-autostartprgmode", "1", "-autostart-warp", "-autostart", "$programName.prg")
|
||||||
val processb = ProcessBuilder(cmdline).inheritIO()
|
val processb = ProcessBuilder(cmdline).inheritIO()
|
||||||
val process: Process
|
val process: Process
|
||||||
|
@ -6,11 +6,14 @@ import prog8.compiler.target.IAssemblyProgram
|
|||||||
import prog8.compiler.target.generatedLabelPrefix
|
import prog8.compiler.target.generatedLabelPrefix
|
||||||
import java.nio.file.Path
|
import java.nio.file.Path
|
||||||
|
|
||||||
|
|
||||||
|
internal const val viceMonListPostfix = "vice-mon-list"
|
||||||
|
|
||||||
class AssemblyProgram(override val name: String, outputDir: Path, private val compTarget: String) : IAssemblyProgram {
|
class AssemblyProgram(override val name: String, outputDir: Path, private val compTarget: String) : IAssemblyProgram {
|
||||||
private val assemblyFile = outputDir.resolve("$name.asm")
|
private val assemblyFile = outputDir.resolve("$name.asm")
|
||||||
private val prgFile = outputDir.resolve("$name.prg")
|
private val prgFile = outputDir.resolve("$name.prg")
|
||||||
private val binFile = outputDir.resolve("$name.bin")
|
private val binFile = outputDir.resolve("$name.bin")
|
||||||
private val viceMonListFile = outputDir.resolve("$name.vice-mon-list")
|
private val viceMonListFile = outputDir.resolve("$name.$viceMonListPostfix")
|
||||||
|
|
||||||
override fun assemble(options: CompilationOptions): Int {
|
override fun assemble(options: CompilationOptions): Int {
|
||||||
// add "-Wlong-branch" to see warnings about conversion of branch instructions to jumps (default = do this silently)
|
// add "-Wlong-branch" to see warnings about conversion of branch instructions to jumps (default = do this silently)
|
||||||
|
@ -4,6 +4,7 @@ import prog8.compiler.*
|
|||||||
import prog8.compiler.target.CpuType
|
import prog8.compiler.target.CpuType
|
||||||
import prog8.compiler.target.IMachineDefinition
|
import prog8.compiler.target.IMachineDefinition
|
||||||
import prog8.compiler.target.c64.C64MachineDefinition
|
import prog8.compiler.target.c64.C64MachineDefinition
|
||||||
|
import prog8.compiler.target.cbm.viceMonListPostfix
|
||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
|
|
||||||
internal object CX16MachineDefinition: IMachineDefinition {
|
internal object CX16MachineDefinition: IMachineDefinition {
|
||||||
@ -33,9 +34,18 @@ internal object CX16MachineDefinition: IMachineDefinition {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun launchEmulator(selectedEmulator: Int, programName: String) {
|
override fun launchEmulator(selectedEmulator: Int, programName: String) {
|
||||||
val emulatorName: String = when(selectedEmulator) {
|
val emulatorName: String
|
||||||
1 -> "x16emu"
|
val extraArgs: List<String>
|
||||||
2 -> "box16"
|
|
||||||
|
when(selectedEmulator) {
|
||||||
|
1 -> {
|
||||||
|
emulatorName = "x16emu"
|
||||||
|
extraArgs = emptyList()
|
||||||
|
}
|
||||||
|
2 -> {
|
||||||
|
emulatorName = "box16"
|
||||||
|
extraArgs = listOf("-sym", "$programName.$viceMonListPostfix")
|
||||||
|
}
|
||||||
else -> {
|
else -> {
|
||||||
System.err.println("Cx16 target only supports x16emu and box16 emulators.")
|
System.err.println("Cx16 target only supports x16emu and box16 emulators.")
|
||||||
return
|
return
|
||||||
@ -44,7 +54,7 @@ internal object CX16MachineDefinition: IMachineDefinition {
|
|||||||
|
|
||||||
for(emulator in listOf(emulatorName)) {
|
for(emulator in listOf(emulatorName)) {
|
||||||
println("\nStarting Commander X16 emulator $emulator...")
|
println("\nStarting Commander X16 emulator $emulator...")
|
||||||
val cmdline = listOf(emulator, "-scale", "2", "-run", "-prg", "$programName.prg")
|
val cmdline = listOf(emulator, "-scale", "2", "-run", "-prg", "$programName.prg") + extraArgs
|
||||||
val processb = ProcessBuilder(cmdline).inheritIO()
|
val processb = ProcessBuilder(cmdline).inheritIO()
|
||||||
val process: Process
|
val process: Process
|
||||||
try {
|
try {
|
||||||
|
@ -3,7 +3,6 @@ TODO
|
|||||||
|
|
||||||
For next release
|
For next release
|
||||||
^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^
|
||||||
- add -sym vicemonlist support when launching box16 emulator (requires box16 bugfix to not freeze)
|
|
||||||
- rename libdirs option to srcdirs?
|
- rename libdirs option to srcdirs?
|
||||||
- can we derive module.name from module.source (taking just the filename base)?
|
- can we derive module.name from module.source (taking just the filename base)?
|
||||||
- can Position.file be a Path- making the source variable for nodes unnecessary?
|
- can Position.file be a Path- making the source variable for nodes unnecessary?
|
||||||
|
Loading…
x
Reference in New Issue
Block a user