output_type is now part of custom target config and atari again defaults to .xex

This commit is contained in:
Irmen de Jong 2025-04-09 20:43:44 +02:00
parent 37b3868ca3
commit 0ee42b9aa0
16 changed files with 18 additions and 6 deletions

View File

@ -28,6 +28,7 @@ interface ICompilationTarget: IStringEncoding, IMemSizer {
val libraryPath: Path?
val customLauncher: List<String>
val additionalAssemblerOptions: String?
val defaultOutputType: OutputType
fun initializeMemoryAreas(compilerOptions: CompilationOptions)
fun getFloatAsmBytes(num: Number): String

View File

@ -12,6 +12,7 @@ class C128Target: ICompilationTarget, IStringEncoding by Encoder, IMemSizer by N
override val libraryPath = null
override val customLauncher: List<String> = emptyList()
override val additionalAssemblerOptions = null
override val defaultOutputType = OutputType.PRG
companion object {
const val NAME = "c128"

View File

@ -13,6 +13,7 @@ class C64Target: ICompilationTarget, IStringEncoding by Encoder, IMemSizer by No
override val libraryPath = null
override val customLauncher: List<String> = emptyList()
override val additionalAssemblerOptions = null
override val defaultOutputType = OutputType.PRG
companion object {
const val NAME = "c64"

View File

@ -24,6 +24,7 @@ class ConfigFileTarget(
override val BSSHIGHRAM_END: UInt,
override val BSSGOLDENRAM_START: UInt,
override val BSSGOLDENRAM_END: UInt,
override val defaultOutputType: OutputType,
override val libraryPath: Path,
override val customLauncher: List<String>,
override val additionalAssemblerOptions: String?,
@ -110,6 +111,9 @@ class ConfigFileTarget(
val assemblerOptionsStr = props.getProperty("assembler_options", "").trim()
val assemblerOptions = if(assemblerOptionsStr.isBlank()) null else assemblerOptionsStr
val outputTypeString = props.getProperty("output_type", "PRG")
val defaultOutputType = OutputType.valueOf(outputTypeString.uppercase())
return ConfigFileTarget(
configfile.nameWithoutExtension,
Encoding.entries.first { it.prefix==props.getString("encoding") },
@ -121,6 +125,7 @@ class ConfigFileTarget(
props.getInteger("bss_highram_end"),
props.getInteger("bss_goldenram_start"),
props.getInteger("bss_goldenram_end"),
defaultOutputType,
libraryPath,
customLauncher,
assemblerOptions,

View File

@ -12,6 +12,7 @@ class Cx16Target: ICompilationTarget, IStringEncoding by Encoder, IMemSizer by N
override val libraryPath = null
override val customLauncher: List<String> = emptyList()
override val additionalAssemblerOptions = null
override val defaultOutputType = OutputType.PRG
companion object {
const val NAME = "cx16"

View File

@ -12,6 +12,7 @@ class PETTarget: ICompilationTarget, IStringEncoding by Encoder, IMemSizer by No
override val libraryPath = null
override val customLauncher: List<String> = emptyList()
override val additionalAssemblerOptions = null
override val defaultOutputType = OutputType.PRG
companion object {
const val NAME = "pet32"

View File

@ -13,6 +13,7 @@ class VMTarget: ICompilationTarget, IStringEncoding by Encoder, IMemSizer by Nor
override val libraryPath = null
override val customLauncher: List<String> = emptyList()
override val additionalAssemblerOptions = null
override val defaultOutputType = OutputType.PRG
companion object {
const val NAME = "virtual"

View File

@ -384,13 +384,13 @@ internal fun determineCompilationOptions(program: Program, compTarget: ICompilat
.toList()
val outputType = if (outputTypeStr == null) {
OutputType.PRG
compTarget.defaultOutputType
} else {
try {
OutputType.valueOf(outputTypeStr)
} catch (_: IllegalArgumentException) {
// set default value; actual check and error handling of invalid option is handled in the AstChecker later
OutputType.PRG
compTarget.defaultOutputType
}
}
var launcherType = if (launcherTypeStr == null)

View File

@ -1,8 +1,6 @@
TODO
====
atari customtarget: default output should be .xex not .prg (10.5 still did it correctly)
test irqs on various targets: set_irq, set_rasterirq
can memset/memsetw be written without the need of a temp register variable?

View File

@ -1,7 +1,6 @@
%import textio
%zeropage basicsafe
%launcher none
%output xex
; This example computes the first 20 values of the Fibonacci sequence.
; Note: this program is compatible with atari.

View File

@ -1,7 +1,6 @@
%import textio
%zeropage basicsafe
%launcher none
%output xex
; hello world test for Atari 8-bit

View File

@ -3,6 +3,7 @@
cpu = 6502
encoding = atascii
output_type = XEX
load_address = $2000
memtop = $ffff
bss_highram_start = 0

View File

@ -3,6 +3,7 @@
cpu = 65C02
encoding = iso
# output_type = PRG
load_address = $0800
memtop = $fc00
bss_highram_start = 0

View File

@ -2,6 +2,7 @@
cpu = 6502
encoding = petscii
# output_type = PRG
load_address = $0801
memtop = $cfe0
bss_highram_start = $c000

View File

@ -2,6 +2,7 @@
cpu = 65C02
encoding = petscii
# output_type = PRG
load_address = $0801
memtop = $9f00
bss_highram_start = $a000

View File

@ -2,6 +2,7 @@
cpu = 6502
encoding = petscii
# output_type = PRG
load_address = $0401
memtop = $8000
bss_highram_start = 0