diff --git a/nescant/src/main/scala/com/htmlism/nescant/ByteSource.scala b/nescant/src/main/scala/com/htmlism/nescant/ByteSource.scala
index 75465e0..5e43a3a 100644
--- a/nescant/src/main/scala/com/htmlism/nescant/ByteSource.scala
+++ b/nescant/src/main/scala/com/htmlism/nescant/ByteSource.scala
@@ -3,5 +3,5 @@ package com.htmlism.nescant
trait ByteSource[A]
object ByteSource:
- implicit val sourceForInt: ByteSource[Int] =
+ given sourceForInt: ByteSource[Int] =
new ByteSource[Int] {}
diff --git a/nescant/src/main/scala/com/htmlism/nescant/GlobalAddress.scala b/nescant/src/main/scala/com/htmlism/nescant/GlobalAddress.scala
index c0526e1..efa0df5 100644
--- a/nescant/src/main/scala/com/htmlism/nescant/GlobalAddress.scala
+++ b/nescant/src/main/scala/com/htmlism/nescant/GlobalAddress.scala
@@ -1,10 +1,10 @@
package com.htmlism.nescant
object GlobalAddress:
- implicit val sourceForGlobalAddress: ByteSource[GlobalAddress] =
+ given sourceForGlobalAddress: ByteSource[GlobalAddress] =
new ByteSource[GlobalAddress] {}
- implicit val sinkForGlobalAddress: ByteSink[GlobalAddress] =
+ given sinkForGlobalAddress: ByteSink[GlobalAddress] =
new ByteSink[GlobalAddress] {}
case class GlobalAddress(n: Int)
diff --git a/nescant/src/main/scala/com/htmlism/nescant/Operand.scala b/nescant/src/main/scala/com/htmlism/nescant/Operand.scala
index 931b862..1ec2024 100644
--- a/nescant/src/main/scala/com/htmlism/nescant/Operand.scala
+++ b/nescant/src/main/scala/com/htmlism/nescant/Operand.scala
@@ -4,5 +4,5 @@ trait Operand[A]:
def encode(x: A): String
object Operand:
- implicit val operandForInt: Operand[Int] =
+ given operandForInt: Operand[Int] =
_.toString
diff --git a/nescant/src/main/scala/com/htmlism/nescant/ReadWriteLocation.scala b/nescant/src/main/scala/com/htmlism/nescant/ReadWriteLocation.scala
index cd0ebb4..6b59c03 100644
--- a/nescant/src/main/scala/com/htmlism/nescant/ReadWriteLocation.scala
+++ b/nescant/src/main/scala/com/htmlism/nescant/ReadWriteLocation.scala
@@ -10,12 +10,12 @@ package com.htmlism.nescant
case class ReadWriteLocation[A](name: String, address: ZeroPageAddress)
object ReadWriteLocation:
- implicit def sourceForReadWriteLocation[A]: ByteSource[ReadWriteLocation[A]] =
+ given sourceForReadWriteLocation[A]: ByteSource[ReadWriteLocation[A]] =
new ByteSource[ReadWriteLocation[A]] {}
- implicit def sinkForReadWriteLocation[A]: ByteSink[ReadWriteLocation[A]] =
+ given sinkForReadWriteLocation[A]: ByteSink[ReadWriteLocation[A]] =
new ByteSink[ReadWriteLocation[A]] {}
- implicit def operandForReadWriteLocation[A]: Operand[ReadWriteLocation[A]] =
+ given operandForReadWriteLocation[A]: Operand[ReadWriteLocation[A]] =
new Operand[ReadWriteLocation[A]]:
def encode(x: ReadWriteLocation[A]): String = ""
diff --git a/nescant/src/main/scala/com/htmlism/nescant/VolatileDevice.scala b/nescant/src/main/scala/com/htmlism/nescant/VolatileDevice.scala
index f72179a..9d539b8 100644
--- a/nescant/src/main/scala/com/htmlism/nescant/VolatileDevice.scala
+++ b/nescant/src/main/scala/com/htmlism/nescant/VolatileDevice.scala
@@ -14,9 +14,9 @@ package com.htmlism.nescant
case class VolatileDevice[A](name: String, address: ZeroPageAddress)
object VolatileDevice:
- implicit def sourceForVolatileDevice[A]: ByteSource[VolatileDevice[A]] =
+ given sourceForVolatileDevice[A]: ByteSource[VolatileDevice[A]] =
new ByteSource[VolatileDevice[A]] {}
- implicit def operandForVolatileDevice[A]: Operand[VolatileDevice[A]] =
+ given operandForVolatileDevice[A]: Operand[VolatileDevice[A]] =
new Operand[VolatileDevice[A]]:
def encode(x: VolatileDevice[A]): String = ""
diff --git a/nescant/src/main/scala/com/htmlism/nescant/ZeroPageAddress.scala b/nescant/src/main/scala/com/htmlism/nescant/ZeroPageAddress.scala
index dc70fd4..972d594 100644
--- a/nescant/src/main/scala/com/htmlism/nescant/ZeroPageAddress.scala
+++ b/nescant/src/main/scala/com/htmlism/nescant/ZeroPageAddress.scala
@@ -1,10 +1,10 @@
package com.htmlism.nescant
object ZeroPageAddress:
- implicit val sourceForZeroPageAddress: ByteSource[ZeroPageAddress] =
+ given sourceForZeroPageAddress: ByteSource[ZeroPageAddress] =
new ByteSource[ZeroPageAddress] {}
- implicit val sinkForZeroPageAddress: ByteSink[ZeroPageAddress] =
+ given sinkForZeroPageAddress: ByteSink[ZeroPageAddress] =
new ByteSink[ZeroPageAddress] {}
case class ZeroPageAddress(n: Int)
diff --git a/src/main/scala/com/htmlism/mos6502/dsl/Address.scala b/src/main/scala/com/htmlism/mos6502/dsl/Address.scala
index 2a20deb..018bf6c 100644
--- a/src/main/scala/com/htmlism/mos6502/dsl/Address.scala
+++ b/src/main/scala/com/htmlism/mos6502/dsl/Address.scala
@@ -4,7 +4,7 @@ sealed trait Address:
def n: Int
object ZeroAddress:
- implicit val operandZero: Operand[ZeroAddress] =
+ given operandZero: Operand[ZeroAddress] =
new Operand[ZeroAddress]:
val operandType: OperandType =
MemoryLocation
@@ -15,13 +15,13 @@ object ZeroAddress:
def toAddressLiteral(x: ZeroAddress): String =
String.format("$%02x", x.n)
- implicit val definitionValueForZero: DefinitionValue[ZeroAddress] =
+ given definitionValueForZero: DefinitionValue[ZeroAddress] =
operandZero.toAddressLiteral(_)
case class ZeroAddress(n: Int) extends Address
object GlobalAddress:
- implicit val operandGlobal: Operand[GlobalAddress] =
+ given operandGlobal: Operand[GlobalAddress] =
new Operand[GlobalAddress]:
val operandType: OperandType =
MemoryLocation
@@ -32,7 +32,7 @@ object GlobalAddress:
def toAddressLiteral(x: GlobalAddress): String =
String.format("$%04x", x.n)
- implicit val definitionValueForGlobal: DefinitionValue[GlobalAddress] =
+ given definitionValueForGlobal: DefinitionValue[GlobalAddress] =
operandGlobal.toAddressLiteral(_)
case class GlobalAddress(n: Int) extends Address
diff --git a/src/main/scala/com/htmlism/mos6502/dsl/AsmDocumentContext.scala b/src/main/scala/com/htmlism/mos6502/dsl/AsmDocumentContext.scala
index 42af18f..f6e1db1 100644
--- a/src/main/scala/com/htmlism/mos6502/dsl/AsmDocumentContext.scala
+++ b/src/main/scala/com/htmlism/mos6502/dsl/AsmDocumentContext.scala
@@ -83,7 +83,7 @@ case class Definition[A](name: String, x: A, comment: Option[String])(using ev:
.value(x)
object Definition:
- implicit def namedResourceForDefinition[A]: NamedResource[Definition[A]] =
+ given namedResourceForDefinition[A]: NamedResource[Definition[A]] =
new NamedResource[Definition[A]]:
def toDefinitions(x: Definition[A]): List[Definition[_]] =
List(x)
diff --git a/src/main/scala/com/htmlism/mos6502/dsl/Color.scala b/src/main/scala/com/htmlism/mos6502/dsl/Color.scala
index 0b7a04c..ba60ec0 100644
--- a/src/main/scala/com/htmlism/mos6502/dsl/Color.scala
+++ b/src/main/scala/com/htmlism/mos6502/dsl/Color.scala
@@ -5,7 +5,7 @@ import cats.data.NonEmptyList
sealed trait Color
object Color:
- implicit val colorOperand: Operand[Color] =
+ given colorOperand: Operand[Color] =
new Operand[Color]:
def toAddressLiteral(x: Color): String =
"#" + x.toString.toLowerCase()
@@ -16,7 +16,7 @@ object Color:
def operandType: OperandType =
ValueLiteral
- implicit val colorEnum: EnumAsm[Color] =
+ given colorEnum: EnumAsm[Color] =
new EnumAsm[Color]:
def comment: String =
"Colors"
diff --git a/src/main/scala/com/htmlism/mos6502/dsl/DefinitionValue.scala b/src/main/scala/com/htmlism/mos6502/dsl/DefinitionValue.scala
index b8cd040..6edfbe8 100644
--- a/src/main/scala/com/htmlism/mos6502/dsl/DefinitionValue.scala
+++ b/src/main/scala/com/htmlism/mos6502/dsl/DefinitionValue.scala
@@ -8,5 +8,5 @@ trait DefinitionValue[A]:
def value(x: A): String
object DefinitionValue:
- implicit val definitionValueForInt: DefinitionValue[Int] =
+ given definitionValueForInt: DefinitionValue[Int] =
(x: Int) => String.format("$%02x", x)
diff --git a/src/main/scala/com/htmlism/mos6502/dsl/Mapping.scala b/src/main/scala/com/htmlism/mos6502/dsl/Mapping.scala
index 97fb019..67e6c8c 100644
--- a/src/main/scala/com/htmlism/mos6502/dsl/Mapping.scala
+++ b/src/main/scala/com/htmlism/mos6502/dsl/Mapping.scala
@@ -26,7 +26,7 @@ trait Mapping[A]:
def comment(x: A): String
object Mapping:
- implicit def mappingForBitField[A](using ev: BitField[A]): Mapping[A] =
+ given mappingForBitField[A](using ev: BitField[A]): Mapping[A] =
new Mapping[A]:
private lazy val valueMap =
ev.all
@@ -49,7 +49,7 @@ object Mapping:
def comment(x: A): String =
"" // TODO
- implicit def mappingForEnumAsm[A](using ev: EnumAsm[A]): Mapping[A] =
+ given mappingForEnumAsm[A](using ev: EnumAsm[A]): Mapping[A] =
new Mapping[A]:
private lazy val valueMap =
ev.all
diff --git a/src/main/scala/com/htmlism/mos6502/dsl/Operand.scala b/src/main/scala/com/htmlism/mos6502/dsl/Operand.scala
index 9d2c9ad..7fb4a2f 100644
--- a/src/main/scala/com/htmlism/mos6502/dsl/Operand.scala
+++ b/src/main/scala/com/htmlism/mos6502/dsl/Operand.scala
@@ -13,7 +13,7 @@ trait Operand[A]:
def operandType: OperandType
object Operand:
- implicit val operandInt: Operand[Int] =
+ given operandInt: Operand[Int] =
new Operand[Int]:
val operandType: OperandType =
ValueLiteral
@@ -24,7 +24,7 @@ object Operand:
def toAddressLiteral(x: Int): String =
String.format("#$%02x", x)
- implicit def operandForMapping[A](using ev: Mapping[A]): Operand[A] =
+ given operandForMapping[A](using ev: Mapping[A]): Operand[A] =
new Operand[A]:
def toAddressLiteral(x: A): String =
"#" + ev.label(x)
diff --git a/src/main/scala/com/htmlism/mos6502/dsl/ReadWriteLocation.scala b/src/main/scala/com/htmlism/mos6502/dsl/ReadWriteLocation.scala
index 7452a54..de6686e 100644
--- a/src/main/scala/com/htmlism/mos6502/dsl/ReadWriteLocation.scala
+++ b/src/main/scala/com/htmlism/mos6502/dsl/ReadWriteLocation.scala
@@ -19,7 +19,7 @@ case class ReadWriteLocation[A: Operand](name: String, address: ZeroAddress):
ctx.push(STA, this)
object ReadWriteLocation:
- implicit def operandForReadWriteLocation[A]: Operand[ReadWriteLocation[A]] =
+ given operandForReadWriteLocation[A]: Operand[ReadWriteLocation[A]] =
new Operand[ReadWriteLocation[A]]:
def toAddressLiteral(x: ReadWriteLocation[A]): String =
x.name
@@ -30,7 +30,7 @@ object ReadWriteLocation:
def operandType: OperandType =
MemoryLocation
- implicit def namedResourceForReadWriteLocation[A]: NamedResource[ReadWriteLocation[A]] =
+ given namedResourceForReadWriteLocation[A]: NamedResource[ReadWriteLocation[A]] =
new NamedResource[ReadWriteLocation[A]]:
def toDefinitions(x: ReadWriteLocation[A]): List[Definition[ZeroAddress]] =
List:
diff --git a/src/main/scala/com/htmlism/mos6502/dsl/VolatileDevice.scala b/src/main/scala/com/htmlism/mos6502/dsl/VolatileDevice.scala
index cd15cea..d026b3a 100644
--- a/src/main/scala/com/htmlism/mos6502/dsl/VolatileDevice.scala
+++ b/src/main/scala/com/htmlism/mos6502/dsl/VolatileDevice.scala
@@ -17,7 +17,7 @@ case class VolatileDevice[A](name: String, address: ZeroAddress):
// ctx.push(LDA, ev, s"write ${ev.toShow(x)} to $name ($n)")
object VolatileDevice:
- implicit def namedResourceForVolatileDevice[A]: NamedResource[VolatileDevice[A]] =
+ given namedResourceForVolatileDevice[A]: NamedResource[VolatileDevice[A]] =
new NamedResource[VolatileDevice[A]]:
def toDefinitions(x: VolatileDevice[A]): List[Definition[ZeroAddress]] =
List:
diff --git a/src/test/scala/com/htmlism/mos6502/dsl/DslSpec.scala b/src/test/scala/com/htmlism/mos6502/dsl/DslSpec.scala
index 37ea658..7d20dd8 100644
--- a/src/test/scala/com/htmlism/mos6502/dsl/DslSpec.scala
+++ b/src/test/scala/com/htmlism/mos6502/dsl/DslSpec.scala
@@ -90,7 +90,7 @@ case object Wisdom extends Triforce
case object Power extends Triforce
object Triforce:
- implicit val enumTriforce: EnumAsm[Triforce] =
+ given enumTriforce: EnumAsm[Triforce] =
new EnumAsm[Triforce]:
def comment: String =
"foo as enum"
@@ -112,7 +112,7 @@ case object Left extends TestDirection
case object Right extends TestDirection
object TestDirection:
- implicit val bitFieldDirection: BitField[TestDirection] =
+ given bitFieldDirection: BitField[TestDirection] =
new BitField[TestDirection]:
def definitionGroupComment: String =
"foo as bit field"
diff --git a/src/test/scala/com/htmlism/mos6502/dsl/snake/AsciiValue.scala b/src/test/scala/com/htmlism/mos6502/dsl/snake/AsciiValue.scala
index f53b128..0c3706e 100644
--- a/src/test/scala/com/htmlism/mos6502/dsl/snake/AsciiValue.scala
+++ b/src/test/scala/com/htmlism/mos6502/dsl/snake/AsciiValue.scala
@@ -4,7 +4,7 @@ package snake
import cats.data.NonEmptyList
object AsciiValue:
- implicit val asciiValueMapping: Mapping[AsciiValue] =
+ given asciiValueMapping: Mapping[AsciiValue] =
new Mapping[AsciiValue]:
def definitionGroupComment: String =
"ASCII values of keys controlling the snake"
diff --git a/src/test/scala/com/htmlism/mos6502/dsl/snake/Direction.scala b/src/test/scala/com/htmlism/mos6502/dsl/snake/Direction.scala
index 579cca0..a12da0f 100644
--- a/src/test/scala/com/htmlism/mos6502/dsl/snake/Direction.scala
+++ b/src/test/scala/com/htmlism/mos6502/dsl/snake/Direction.scala
@@ -4,7 +4,7 @@ package snake
import cats.data.NonEmptyList
object Direction:
- implicit val directionBitField: BitField[Direction] =
+ given directionBitField: BitField[Direction] =
new BitField[Direction]:
def definitionGroupComment: String =
"Directions"