6502-opcodes/nescant/src/main/scala/com/htmlism/nescant/VolatileDevice.scala

23 lines
680 B
Scala
Raw Normal View History

2020-08-28 06:50:34 +00:00
package com.htmlism.nescant
//import com.htmlism.mos6502.model._
/**
* For a memory-mapped device that may return different values across multiple reads (e.g. a random number generator)
*
2021-09-06 08:16:08 +00:00
* @param name
* A name for this device, used to alias its address
2020-08-28 06:50:34 +00:00
*
2021-09-06 08:16:08 +00:00
* @tparam A
* The output type of the read
2020-08-28 06:50:34 +00:00
*/
case class VolatileDevice[A](name: String, address: ZeroPageAddress)
2022-02-14 23:11:45 +00:00
object VolatileDevice:
2023-06-19 09:33:38 +00:00
given sourceForVolatileDevice[A]: ByteSource[VolatileDevice[A]] =
2020-08-28 16:31:13 +00:00
new ByteSource[VolatileDevice[A]] {}
2020-08-28 06:50:34 +00:00
2023-06-19 09:33:38 +00:00
given operandForVolatileDevice[A]: Operand[VolatileDevice[A]] =
2022-09-07 15:21:22 +00:00
new Operand[VolatileDevice[A]]:
2020-08-28 06:50:34 +00:00
def encode(x: VolatileDevice[A]): String = ""