mirror of
https://github.com/KarolS/millfork.git
synced 2024-12-23 23:30:22 +00:00
Take into account that the sole byte parameter is passed via the accumulator in more locations
This commit is contained in:
parent
456c674a0c
commit
86ce4c75ad
@ -29,7 +29,9 @@ class Platform(
|
||||
val bankNumbers: Map[String, Int],
|
||||
val defaultCodeBank: String,
|
||||
val outputStyle: OutputStyle.Value
|
||||
)
|
||||
) {
|
||||
def cpuFamily: CpuFamily.Value = CpuFamily.forType(this.cpu)
|
||||
}
|
||||
|
||||
object Platform {
|
||||
|
||||
|
@ -20,6 +20,8 @@ object EmptyMemoryStoreRemoval extends AssemblyOptimization[AssemblyLine] {
|
||||
|
||||
override def optimize(f: NormalFunction, code: List[AssemblyLine], options: CompilationOptions): List[AssemblyLine] = {
|
||||
val paramVariables = f.params match {
|
||||
case NormalParamSignature(List(MemoryVariable(_, typ, _))) if typ.size == 1 =>
|
||||
Set[String]()
|
||||
case NormalParamSignature(ps) =>
|
||||
ps.map(_.name).toSet
|
||||
case _ =>
|
||||
|
@ -101,6 +101,8 @@ class Environment(val parent: Option[Environment], val prefix: String) {
|
||||
val p = get[Type]("pointer")
|
||||
val params = nf.fold(List[String]()) { f =>
|
||||
f.params match {
|
||||
case NormalParamSignature(List(MemoryVariable(_, typ, _))) if typ.size == 1 && options.platform.cpuFamily == CpuFamily.M6502 =>
|
||||
Nil
|
||||
case NormalParamSignature(ps) =>
|
||||
ps.map(p => p.name)
|
||||
case _ =>
|
||||
|
Loading…
Reference in New Issue
Block a user