mirror of
https://github.com/irmen/prog8.git
synced 2025-11-09 13:17:14 +00:00
output_type is now part of custom target config and atari again defaults to .xex
This commit is contained in:
@@ -28,6 +28,7 @@ interface ICompilationTarget: IStringEncoding, IMemSizer {
|
|||||||
val libraryPath: Path?
|
val libraryPath: Path?
|
||||||
val customLauncher: List<String>
|
val customLauncher: List<String>
|
||||||
val additionalAssemblerOptions: String?
|
val additionalAssemblerOptions: String?
|
||||||
|
val defaultOutputType: OutputType
|
||||||
|
|
||||||
fun initializeMemoryAreas(compilerOptions: CompilationOptions)
|
fun initializeMemoryAreas(compilerOptions: CompilationOptions)
|
||||||
fun getFloatAsmBytes(num: Number): String
|
fun getFloatAsmBytes(num: Number): String
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ class C128Target: ICompilationTarget, IStringEncoding by Encoder, IMemSizer by N
|
|||||||
override val libraryPath = null
|
override val libraryPath = null
|
||||||
override val customLauncher: List<String> = emptyList()
|
override val customLauncher: List<String> = emptyList()
|
||||||
override val additionalAssemblerOptions = null
|
override val additionalAssemblerOptions = null
|
||||||
|
override val defaultOutputType = OutputType.PRG
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
const val NAME = "c128"
|
const val NAME = "c128"
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ class C64Target: ICompilationTarget, IStringEncoding by Encoder, IMemSizer by No
|
|||||||
override val libraryPath = null
|
override val libraryPath = null
|
||||||
override val customLauncher: List<String> = emptyList()
|
override val customLauncher: List<String> = emptyList()
|
||||||
override val additionalAssemblerOptions = null
|
override val additionalAssemblerOptions = null
|
||||||
|
override val defaultOutputType = OutputType.PRG
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
const val NAME = "c64"
|
const val NAME = "c64"
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ class ConfigFileTarget(
|
|||||||
override val BSSHIGHRAM_END: UInt,
|
override val BSSHIGHRAM_END: UInt,
|
||||||
override val BSSGOLDENRAM_START: UInt,
|
override val BSSGOLDENRAM_START: UInt,
|
||||||
override val BSSGOLDENRAM_END: UInt,
|
override val BSSGOLDENRAM_END: UInt,
|
||||||
|
override val defaultOutputType: OutputType,
|
||||||
override val libraryPath: Path,
|
override val libraryPath: Path,
|
||||||
override val customLauncher: List<String>,
|
override val customLauncher: List<String>,
|
||||||
override val additionalAssemblerOptions: String?,
|
override val additionalAssemblerOptions: String?,
|
||||||
@@ -110,6 +111,9 @@ class ConfigFileTarget(
|
|||||||
val assemblerOptionsStr = props.getProperty("assembler_options", "").trim()
|
val assemblerOptionsStr = props.getProperty("assembler_options", "").trim()
|
||||||
val assemblerOptions = if(assemblerOptionsStr.isBlank()) null else assemblerOptionsStr
|
val assemblerOptions = if(assemblerOptionsStr.isBlank()) null else assemblerOptionsStr
|
||||||
|
|
||||||
|
val outputTypeString = props.getProperty("output_type", "PRG")
|
||||||
|
val defaultOutputType = OutputType.valueOf(outputTypeString.uppercase())
|
||||||
|
|
||||||
return ConfigFileTarget(
|
return ConfigFileTarget(
|
||||||
configfile.nameWithoutExtension,
|
configfile.nameWithoutExtension,
|
||||||
Encoding.entries.first { it.prefix==props.getString("encoding") },
|
Encoding.entries.first { it.prefix==props.getString("encoding") },
|
||||||
@@ -121,6 +125,7 @@ class ConfigFileTarget(
|
|||||||
props.getInteger("bss_highram_end"),
|
props.getInteger("bss_highram_end"),
|
||||||
props.getInteger("bss_goldenram_start"),
|
props.getInteger("bss_goldenram_start"),
|
||||||
props.getInteger("bss_goldenram_end"),
|
props.getInteger("bss_goldenram_end"),
|
||||||
|
defaultOutputType,
|
||||||
libraryPath,
|
libraryPath,
|
||||||
customLauncher,
|
customLauncher,
|
||||||
assemblerOptions,
|
assemblerOptions,
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ class Cx16Target: ICompilationTarget, IStringEncoding by Encoder, IMemSizer by N
|
|||||||
override val libraryPath = null
|
override val libraryPath = null
|
||||||
override val customLauncher: List<String> = emptyList()
|
override val customLauncher: List<String> = emptyList()
|
||||||
override val additionalAssemblerOptions = null
|
override val additionalAssemblerOptions = null
|
||||||
|
override val defaultOutputType = OutputType.PRG
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
const val NAME = "cx16"
|
const val NAME = "cx16"
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ class PETTarget: ICompilationTarget, IStringEncoding by Encoder, IMemSizer by No
|
|||||||
override val libraryPath = null
|
override val libraryPath = null
|
||||||
override val customLauncher: List<String> = emptyList()
|
override val customLauncher: List<String> = emptyList()
|
||||||
override val additionalAssemblerOptions = null
|
override val additionalAssemblerOptions = null
|
||||||
|
override val defaultOutputType = OutputType.PRG
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
const val NAME = "pet32"
|
const val NAME = "pet32"
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ class VMTarget: ICompilationTarget, IStringEncoding by Encoder, IMemSizer by Nor
|
|||||||
override val libraryPath = null
|
override val libraryPath = null
|
||||||
override val customLauncher: List<String> = emptyList()
|
override val customLauncher: List<String> = emptyList()
|
||||||
override val additionalAssemblerOptions = null
|
override val additionalAssemblerOptions = null
|
||||||
|
override val defaultOutputType = OutputType.PRG
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
const val NAME = "virtual"
|
const val NAME = "virtual"
|
||||||
|
|||||||
@@ -384,13 +384,13 @@ internal fun determineCompilationOptions(program: Program, compTarget: ICompilat
|
|||||||
.toList()
|
.toList()
|
||||||
|
|
||||||
val outputType = if (outputTypeStr == null) {
|
val outputType = if (outputTypeStr == null) {
|
||||||
OutputType.PRG
|
compTarget.defaultOutputType
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
OutputType.valueOf(outputTypeStr)
|
OutputType.valueOf(outputTypeStr)
|
||||||
} catch (_: IllegalArgumentException) {
|
} catch (_: IllegalArgumentException) {
|
||||||
// set default value; actual check and error handling of invalid option is handled in the AstChecker later
|
// 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)
|
var launcherType = if (launcherTypeStr == null)
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
TODO
|
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
|
test irqs on various targets: set_irq, set_rasterirq
|
||||||
|
|
||||||
can memset/memsetw be written without the need of a temp register variable?
|
can memset/memsetw be written without the need of a temp register variable?
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
%import textio
|
%import textio
|
||||||
%zeropage basicsafe
|
%zeropage basicsafe
|
||||||
%launcher none
|
%launcher none
|
||||||
%output xex
|
|
||||||
|
|
||||||
; This example computes the first 20 values of the Fibonacci sequence.
|
; This example computes the first 20 values of the Fibonacci sequence.
|
||||||
; Note: this program is compatible with atari.
|
; Note: this program is compatible with atari.
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
%import textio
|
%import textio
|
||||||
%zeropage basicsafe
|
%zeropage basicsafe
|
||||||
%launcher none
|
%launcher none
|
||||||
%output xex
|
|
||||||
|
|
||||||
; hello world test for Atari 8-bit
|
; hello world test for Atari 8-bit
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
cpu = 6502
|
cpu = 6502
|
||||||
encoding = atascii
|
encoding = atascii
|
||||||
|
output_type = XEX
|
||||||
load_address = $2000
|
load_address = $2000
|
||||||
memtop = $ffff
|
memtop = $ffff
|
||||||
bss_highram_start = 0
|
bss_highram_start = 0
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
cpu = 65C02
|
cpu = 65C02
|
||||||
encoding = iso
|
encoding = iso
|
||||||
|
# output_type = PRG
|
||||||
load_address = $0800
|
load_address = $0800
|
||||||
memtop = $fc00
|
memtop = $fc00
|
||||||
bss_highram_start = 0
|
bss_highram_start = 0
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
cpu = 6502
|
cpu = 6502
|
||||||
encoding = petscii
|
encoding = petscii
|
||||||
|
# output_type = PRG
|
||||||
load_address = $0801
|
load_address = $0801
|
||||||
memtop = $cfe0
|
memtop = $cfe0
|
||||||
bss_highram_start = $c000
|
bss_highram_start = $c000
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
cpu = 65C02
|
cpu = 65C02
|
||||||
encoding = petscii
|
encoding = petscii
|
||||||
|
# output_type = PRG
|
||||||
load_address = $0801
|
load_address = $0801
|
||||||
memtop = $9f00
|
memtop = $9f00
|
||||||
bss_highram_start = $a000
|
bss_highram_start = $a000
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
cpu = 6502
|
cpu = 6502
|
||||||
encoding = petscii
|
encoding = petscii
|
||||||
|
# output_type = PRG
|
||||||
load_address = $0401
|
load_address = $0401
|
||||||
memtop = $8000
|
memtop = $8000
|
||||||
bss_highram_start = 0
|
bss_highram_start = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user