6502-opcodes/firepower-cpu/src/main/scala/com/htmlism/firepower/cpu/UByte.scala

16 lines
236 B
Scala
Raw Normal View History

2024-01-04 19:24:43 +00:00
package com.htmlism.firepower.cpu
opaque type UByte =
Byte
extension (b: UByte)
def inc: UByte =
((b & 0xff) + 1).toByte
def dec: UByte =
((b & 0xff) - 1).toByte
object UByte:
def apply(n: Int): UByte =
n.toByte