mirror of
https://github.com/mcanlas/6502-opcodes.git
synced 2024-12-26 19:29:25 +00:00
add nescant
This commit is contained in:
parent
5fe085e09a
commit
151f68a55d
@ -13,6 +13,8 @@
|
||||
* IndirectX: argument is an 8-bit address; find a value at this address incremented by the value X
|
||||
* IndirectY: argument is an 8-bit address; find a value at this address; increment the value by Y
|
||||
|
||||
## TODO - Nescant
|
||||
|
||||
## TODO
|
||||
|
||||
1. operand support should be derived from enum support
|
||||
|
@ -8,3 +8,7 @@ lazy val root =
|
||||
.withCats
|
||||
.withTesting
|
||||
.withOrganizeImports
|
||||
.aggregate(nescant)
|
||||
|
||||
lazy val nescant =
|
||||
project.withCats.withTesting.withOrganizeImports
|
||||
|
@ -0,0 +1,5 @@
|
||||
package com.htmlism.nescant
|
||||
|
||||
object GlobalAddress {}
|
||||
|
||||
case class GlobalAddress(n: Int)
|
7
nescant/src/main/scala/com/htmlism/nescant/Operand.scala
Normal file
7
nescant/src/main/scala/com/htmlism/nescant/Operand.scala
Normal file
@ -0,0 +1,7 @@
|
||||
package com.htmlism.nescant
|
||||
|
||||
sealed trait Operand
|
||||
|
||||
case class LiteralOperand(value: String) extends Operand
|
||||
|
||||
case class NamedOperand(name: String, value: String) extends Operand
|
7
nescant/src/main/scala/com/htmlism/nescant/Sink.scala
Normal file
7
nescant/src/main/scala/com/htmlism/nescant/Sink.scala
Normal file
@ -0,0 +1,7 @@
|
||||
package com.htmlism.nescant
|
||||
|
||||
trait Sink[A]
|
||||
|
||||
object Sink {
|
||||
// TODO int cannot be a source
|
||||
}
|
8
nescant/src/main/scala/com/htmlism/nescant/Source.scala
Normal file
8
nescant/src/main/scala/com/htmlism/nescant/Source.scala
Normal file
@ -0,0 +1,8 @@
|
||||
package com.htmlism.nescant
|
||||
|
||||
trait Source[A]
|
||||
|
||||
object Source {
|
||||
// TODO int can be a source
|
||||
// TODO a volitile device can be a source
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
package com.htmlism.nescant
|
||||
|
||||
object ZeroPageAddress {}
|
||||
|
||||
case class ZeroPageAddress(n: Int)
|
11
nescant/src/main/scala/com/htmlism/nescant/dsl/package.scala
Normal file
11
nescant/src/main/scala/com/htmlism/nescant/dsl/package.scala
Normal file
@ -0,0 +1,11 @@
|
||||
package com.htmlism.nescant
|
||||
|
||||
package object dsl {
|
||||
implicit class AddressOps(n: Int) {
|
||||
def z: ZeroPageAddress =
|
||||
ZeroPageAddress(n)
|
||||
|
||||
def g: GlobalAddress =
|
||||
GlobalAddress(n)
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package com.htmlism.nescant
|
||||
package dsl
|
||||
|
||||
import org.scalatest.flatspec._
|
||||
import org.scalatest.matchers._
|
||||
|
||||
class PostFixOpsSpec extends AnyFlatSpec with should.Matchers {
|
||||
"Numbers" should "support zero page ops" in {
|
||||
123.z shouldBe ZeroPageAddress(123)
|
||||
}
|
||||
|
||||
it should "support global address ops" in {
|
||||
123.g shouldBe GlobalAddress(123)
|
||||
}
|
||||
}
|
@ -5,7 +5,7 @@ object LintingPlugin extends AutoPlugin {
|
||||
override def trigger = allRequirements
|
||||
|
||||
override lazy val globalSettings =
|
||||
addCommandAlias("fmt", List("all", "scalafmtSbt", "compile:scalafmt", "test:scalafmt").mkString(" ")) ++
|
||||
addCommandAlias("fmt", "scalafmtAll") ++
|
||||
addCommandAlias("fix", "scalafixAll")
|
||||
|
||||
object autoImport {
|
||||
|
Loading…
Reference in New Issue
Block a user