mirror of
https://github.com/mcanlas/6502-opcodes.git
synced 2025-08-11 05:25:10 +00:00
more definitions
This commit is contained in:
@@ -53,7 +53,7 @@ case class DefinitionGroup(comment: String, xs: List[Definition[_]]) extends Top
|
|||||||
|
|
||||||
val definitionLines =
|
val definitionLines =
|
||||||
xs
|
xs
|
||||||
.map(d => f"define ${d.name}%-12s${d.value}")
|
.map(d => f"define ${d.name}%-20s${d.value}")
|
||||||
|
|
||||||
(commentLine :: definitionLines)
|
(commentLine :: definitionLines)
|
||||||
.mkString("\n")
|
.mkString("\n")
|
||||||
|
@@ -7,7 +7,7 @@ package com.htmlism.mos6502.dsl
|
|||||||
*
|
*
|
||||||
* @tparam A The input type of the write and the output type of the read
|
* @tparam A The input type of the write and the output type of the read
|
||||||
*/
|
*/
|
||||||
case class ReadWriteLocation[A](name: String, address: Address) {
|
case class ReadWriteLocation[A](name: String, address: ZeroAddress) {
|
||||||
def read(implicit ctx: AssemblyContext): Unit = {
|
def read(implicit ctx: AssemblyContext): Unit = {
|
||||||
val _ = ctx
|
val _ = ctx
|
||||||
// ctx.push(LDA, ev, s"write ${ev.toShow(x)} to $name ($n)")
|
// ctx.push(LDA, ev, s"write ${ev.toShow(x)} to $name ($n)")
|
||||||
@@ -24,7 +24,7 @@ object ReadWriteLocation {
|
|||||||
new Definable[ReadWriteLocation[A]] {
|
new Definable[ReadWriteLocation[A]] {
|
||||||
def toDefinitions(x: ReadWriteLocation[A]): List[Definition[ZeroAddress]] =
|
def toDefinitions(x: ReadWriteLocation[A]): List[Definition[ZeroAddress]] =
|
||||||
List {
|
List {
|
||||||
Definition(x.name, 0x00.z)
|
Definition(x.name, x.address)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -9,7 +9,7 @@ package com.htmlism.mos6502.dsl
|
|||||||
*
|
*
|
||||||
* @tparam A The return type of the read
|
* @tparam A The return type of the read
|
||||||
*/
|
*/
|
||||||
case class VolatileDevice[A](name: String, address: Address) {
|
case class VolatileDevice[A](name: String, address: ZeroAddress) {
|
||||||
def read(implicit ctx: AssemblyContext): Unit = {
|
def read(implicit ctx: AssemblyContext): Unit = {
|
||||||
val _ = ctx
|
val _ = ctx
|
||||||
// ctx.push(LDA, ev, s"write ${ev.toShow(x)} to $name ($n)")
|
// ctx.push(LDA, ev, s"write ${ev.toShow(x)} to $name ($n)")
|
||||||
@@ -21,7 +21,7 @@ object VolatileDevice {
|
|||||||
new Definable[VolatileDevice[A]] {
|
new Definable[VolatileDevice[A]] {
|
||||||
def toDefinitions(x: VolatileDevice[A]): List[Definition[ZeroAddress]] =
|
def toDefinitions(x: VolatileDevice[A]): List[Definition[ZeroAddress]] =
|
||||||
List {
|
List {
|
||||||
Definition(x.name, 0x00.z)
|
Definition(x.name, x.address)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -141,7 +141,9 @@ class Easy6502Spec extends AnyFlatSpec with should.Matchers {
|
|||||||
}
|
}
|
||||||
|
|
||||||
group("snake") { implicit g =>
|
group("snake") { implicit g =>
|
||||||
val _ = g
|
g.push(appleLocation)
|
||||||
|
g.push(snakeDirection)
|
||||||
|
g.push(snakeLength)
|
||||||
}
|
}
|
||||||
|
|
||||||
bitField[Direction]
|
bitField[Direction]
|
||||||
|
Reference in New Issue
Block a user