mirror of
https://github.com/mcanlas/6502-opcodes.git
synced 2024-09-27 06:54:33 +00:00
16 lines
236 B
Scala
16 lines
236 B
Scala
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
|