This commit is contained in:
Irmen de Jong 2022-04-03 17:33:50 +02:00
parent 5b3ccab7dc
commit ae45ce517e
10 changed files with 7 additions and 9 deletions

View File

@ -56,7 +56,7 @@ internal class BuiltinFunctionsAsmGen(private val program: Program,
ident
}
}
val argExpressions = mutableListOf(argExpression);
val argExpressions = mutableListOf(argExpression)
val fcall = BuiltinFunctionCall(IdentifierReference(listOf(name), Position.DUMMY), argExpressions, Position.DUMMY)
fcall.linkParents(scope)
translateFunctioncall(fcall, func, discardResult = false, resultToStack = false, null)

View File

@ -612,7 +612,7 @@ class AstToXmlConverter(internal val program: PtProgram,
}
if(asmSub.clobbers.isNotEmpty()) {
xml.elt("clobbers")
xml.attr("registers", asmSub.clobbers.map {it.name}.joinToString(","))
xml.attr("registers", asmSub.clobbers.joinToString(",") { it.name })
xml.endElt()
}
if(asmSub.retvalRegisters.isNotEmpty()) {

View File

@ -7,7 +7,6 @@ import prog8.ast.walk.AstWalker
import prog8.ast.walk.IAstModification
import prog8.code.core.*
import prog8.code.target.VMTarget
import prog8.code.target.virtual.VirtualMachineDefinition
import kotlin.math.floor

View File

@ -265,7 +265,7 @@ fun determineCompilationOptions(program: Program, compTarget: ICompilationTarget
.flatMap { (it as Directive).args }.toSet()
val floatsEnabled = allOptions.any { it.name == "enable_floats" }
val noSysInit = allOptions.any { it.name == "no_sysinit" }
var zpType: ZeropageType =
val zpType: ZeropageType =
if (zpoption == null)
if (floatsEnabled) ZeropageType.FLOATSAFE else ZeropageType.KERNALSAFE
else

View File

@ -7,7 +7,6 @@ import prog8.ast.statements.*
import prog8.ast.walk.AstWalker
import prog8.ast.walk.IAstModification
import prog8.ast.walk.IAstVisitor
import prog8.code.ast.PtIdentifier
import prog8.code.core.*
import prog8.code.target.VMTarget

View File

@ -7,7 +7,6 @@ import prog8.ast.statements.*
import prog8.ast.walk.IAstVisitor
import prog8.code.*
import prog8.code.core.ArrayDatatypes
import prog8.code.core.ElementToArrayTypes
import prog8.code.core.Position
import java.util.*

View File

@ -987,8 +987,7 @@ class FunctionCallExpression(override var target: IdentifierReference,
// multiple return values. Can occur for asmsub routines. If there is exactly one register return value, take that.
val registerReturns = stmt.asmReturnvaluesRegisters.filter {it.registerOrPair != null }
if(registerReturns.size==1) {
val reg = registerReturns.single().registerOrPair!!
return when(reg) {
return when(registerReturns.single().registerOrPair!!) {
RegisterOrPair.A,
RegisterOrPair.X,
RegisterOrPair.Y -> InferredTypes.InferredType.known(DataType.UBYTE)

View File

@ -855,3 +855,4 @@ case you have to use { } to enclose them::
}
else -> txt.print("don't know")
}

View File

@ -155,3 +155,4 @@ And for the Commander X16::
cx16.set_irq(uword handler_address, boolean useKernal) ; vsync irq
cx16.set_rasterirq(uword handler_address, uword rasterline) ; note: disables kernal irq handler! sys.wait() won't work anymore
cx16.restore_irq() ; set everything back to the systems default irq handler

View File

@ -34,7 +34,7 @@ class GraphicsWindow(val pixelWidth: Int, val pixelHeight: Int, val pixelScaling
contentPane.background = Color.BLACK
isResizable = false
isLocationByPlatform = true
defaultCloseOperation = JFrame.EXIT_ON_CLOSE
defaultCloseOperation = EXIT_ON_CLOSE
image = graphicsConfiguration.createCompatibleImage(pixelWidth, pixelHeight, Transparency.OPAQUE)
contentPane.add(BitmapScreenPanel(image, pixelScaling), BorderLayout.CENTER)
pack()