mirror of
https://github.com/mcanlas/6502-opcodes.git
synced 2024-05-28 21:41:31 +00:00
Compare commits
5 Commits
861824be39
...
860a788b87
Author | SHA1 | Date | |
---|---|---|---|
|
860a788b87 | ||
|
355668b757 | ||
|
fba3e7e44b | ||
|
ee87a131ea | ||
|
e8e7ab1413 |
|
@ -5,7 +5,8 @@ object Move:
|
||||||
def constA[A, X: Encoded.Byte](x: X, dest: WriteLease.ByteAddress[A]): Asm2[Reg.A, A] =
|
def constA[A, X: Encoded.Byte](x: X, dest: WriteLease.ByteAddress[A]): Asm2[Reg.A, A] =
|
||||||
Load
|
Load
|
||||||
.constA(x)
|
.constA(x)
|
||||||
.widenWith[A] andThen Store.fromA(dest)
|
.widenWith[A]
|
||||||
|
.andThen(Store.fromA(dest))
|
||||||
|
|
||||||
def from[R: Register, A: ReadLease.ByteAddress, B: WriteLease.ByteAddress]: Asm3[R, A, B] =
|
def from[R: Register, A: ReadLease.ByteAddress, B: WriteLease.ByteAddress]: Asm3[R, A, B] =
|
||||||
Asm3Instructions(List(""))
|
Asm3Instructions(List(""))
|
||||||
|
|
|
@ -2,7 +2,7 @@ package com.htmlism.firepower.core
|
||||||
|
|
||||||
import weaver.*
|
import weaver.*
|
||||||
object ComplicatedResourceSuite extends FunSuite:
|
object ComplicatedResourceSuite extends FunSuite:
|
||||||
class Player[A <: Player[_]](address: Int):
|
class Player[A <: Player[?]](address: Int):
|
||||||
def headAddr: Int =
|
def headAddr: Int =
|
||||||
address
|
address
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ object Scala3Plugin extends AutoPlugin {
|
||||||
override def trigger: PluginTrigger = AllRequirements
|
override def trigger: PluginTrigger = AllRequirements
|
||||||
|
|
||||||
override val buildSettings: Seq[Setting[?]] = Seq(
|
override val buildSettings: Seq[Setting[?]] = Seq(
|
||||||
scalaVersion := "3.3.1"
|
scalaVersion := "3.4.0-RC1"
|
||||||
)
|
)
|
||||||
|
|
||||||
override val projectSettings: Seq[Setting[?]] = Seq(
|
override val projectSettings: Seq[Setting[?]] = Seq(
|
||||||
|
|
|
@ -42,7 +42,7 @@ case class Subroutine(name: String, fragment: AsmFragment, jumpRegistry: ListSet
|
||||||
def toAsm: String =
|
def toAsm: String =
|
||||||
name + ":" + "\n" + fragment.toAsm
|
name + ":" + "\n" + fragment.toAsm
|
||||||
|
|
||||||
case class DefinitionGroup(comment: String, xs: List[Definition[_]]) extends TopLevelAsmDocumentFragment:
|
case class DefinitionGroup(comment: String, xs: List[Definition[?]]) extends TopLevelAsmDocumentFragment:
|
||||||
def toAsm: String =
|
def toAsm: String =
|
||||||
val groupCommentLine =
|
val groupCommentLine =
|
||||||
"; " + comment
|
"; " + comment
|
||||||
|
@ -62,7 +62,7 @@ case class DefinitionGroup(comment: String, xs: List[Definition[_]]) extends Top
|
||||||
.mkString("\n")
|
.mkString("\n")
|
||||||
|
|
||||||
class DefinitionGroupContext:
|
class DefinitionGroupContext:
|
||||||
private val xs: ListBuffer[Definition[_]] =
|
private val xs: ListBuffer[Definition[?]] =
|
||||||
ListBuffer()
|
ListBuffer()
|
||||||
|
|
||||||
def push[A](x: A)(using ev: NamedResource[A]): Unit =
|
def push[A](x: A)(using ev: NamedResource[A]): Unit =
|
||||||
|
@ -85,7 +85,7 @@ case class Definition[A](name: String, x: A, comment: Option[String])(using ev:
|
||||||
object Definition:
|
object Definition:
|
||||||
given namedResourceForDefinition[A]: NamedResource[Definition[A]] =
|
given namedResourceForDefinition[A]: NamedResource[Definition[A]] =
|
||||||
new NamedResource[Definition[A]]:
|
new NamedResource[Definition[A]]:
|
||||||
def toDefinitions(x: Definition[A]): List[Definition[_]] =
|
def toDefinitions(x: Definition[A]): List[Definition[?]] =
|
||||||
List(x)
|
List(x)
|
||||||
|
|
||||||
def apply[A: DefinitionValue](name: String, x: A): Definition[A] =
|
def apply[A: DefinitionValue](name: String, x: A): Definition[A] =
|
||||||
|
|
|
@ -6,4 +6,4 @@ trait NamedResource[A]:
|
||||||
* A `Definable` can emit multiple definitions. Usually in the case of `word`s being split across two
|
* A `Definable` can emit multiple definitions. Usually in the case of `word`s being split across two
|
||||||
* byte-definitions
|
* byte-definitions
|
||||||
*/
|
*/
|
||||||
def toDefinitions(x: A): List[Definition[_]]
|
def toDefinitions(x: A): List[Definition[?]]
|
||||||
|
|
|
@ -54,7 +54,7 @@ class Easy6502Spec extends AnyFlatSpec with should.Matchers:
|
||||||
val doc =
|
val doc =
|
||||||
asmDoc { implicit ctx =>
|
asmDoc { implicit ctx =>
|
||||||
asm { implicit a =>
|
asm { implicit a =>
|
||||||
registers.X.loop("incrementing", 2 upTo 5) { implicit a =>
|
registers.X.loop("incrementing", 2.upTo(5)) { implicit a =>
|
||||||
a.push(INY)
|
a.push(INY)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user