mirror of
https://github.com/mcanlas/6502-opcodes.git
synced 2025-02-03 12:30:21 +00:00
more definitions
This commit is contained in:
parent
87213fd0a4
commit
cf9e1f63b0
@ -53,7 +53,7 @@ case class DefinitionGroup(comment: String, xs: List[Definition[_]]) extends Top
|
||||
|
||||
val definitionLines =
|
||||
xs
|
||||
.map(d => f"define ${d.name}%-12s${d.value}")
|
||||
.map(d => f"define ${d.name}%-20s${d.value}")
|
||||
|
||||
(commentLine :: definitionLines)
|
||||
.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
|
||||
*/
|
||||
case class ReadWriteLocation[A](name: String, address: Address) {
|
||||
case class ReadWriteLocation[A](name: String, address: ZeroAddress) {
|
||||
def read(implicit ctx: AssemblyContext): Unit = {
|
||||
val _ = ctx
|
||||
// ctx.push(LDA, ev, s"write ${ev.toShow(x)} to $name ($n)")
|
||||
@ -24,7 +24,7 @@ object ReadWriteLocation {
|
||||
new Definable[ReadWriteLocation[A]] {
|
||||
def toDefinitions(x: ReadWriteLocation[A]): List[Definition[ZeroAddress]] =
|
||||
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
|
||||
*/
|
||||
case class VolatileDevice[A](name: String, address: Address) {
|
||||
case class VolatileDevice[A](name: String, address: ZeroAddress) {
|
||||
def read(implicit ctx: AssemblyContext): Unit = {
|
||||
val _ = ctx
|
||||
// ctx.push(LDA, ev, s"write ${ev.toShow(x)} to $name ($n)")
|
||||
@ -21,7 +21,7 @@ object VolatileDevice {
|
||||
new Definable[VolatileDevice[A]] {
|
||||
def toDefinitions(x: VolatileDevice[A]): List[Definition[ZeroAddress]] =
|
||||
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 =>
|
||||
val _ = g
|
||||
g.push(appleLocation)
|
||||
g.push(snakeDirection)
|
||||
g.push(snakeLength)
|
||||
}
|
||||
|
||||
bitField[Direction]
|
||||
|
Loading…
x
Reference in New Issue
Block a user