mirror of
https://github.com/mcanlas/6502-opcodes.git
synced 2025-04-11 21:37:15 +00:00
scratch pad is now core
This commit is contained in:
parent
7e9ff1f02c
commit
037c292c64
@ -3,13 +3,13 @@ lazy val firepower =
|
||||
.in(file("."))
|
||||
.withCats
|
||||
.withTesting
|
||||
.aggregate(nescant, scratchpad, demo)
|
||||
.aggregate(nescant, core, demo)
|
||||
|
||||
lazy val nescant =
|
||||
project.withCats.withTesting
|
||||
|
||||
lazy val scratchpad =
|
||||
project
|
||||
lazy val core =
|
||||
module("core")
|
||||
.withCats
|
||||
.withTesting
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.htmlism.scratchpad
|
||||
package com.htmlism.firepower.core
|
||||
|
||||
import cats.Semigroup
|
||||
import cats.syntax.all._
|
@ -1,4 +1,4 @@
|
||||
package com.htmlism.scratchpad
|
||||
package com.htmlism.firepower.core
|
||||
|
||||
object CodeGenerator extends App:
|
||||
val allLetters =
|
@ -1,3 +1,3 @@
|
||||
package com.htmlism.scratchpad
|
||||
package com.htmlism.firepower.core
|
||||
trait Companion[A]:
|
||||
def canon: A
|
@ -1,4 +1,4 @@
|
||||
package com.htmlism.scratchpad
|
||||
package com.htmlism.firepower.core
|
||||
|
||||
object Encoded:
|
||||
trait Byte[A]:
|
@ -1,4 +1,4 @@
|
||||
package com.htmlism.scratchpad
|
||||
package com.htmlism.firepower.core
|
||||
|
||||
trait GrantsWriteLeases[A]:
|
||||
def withWriteLease[B](f: WriteLease[A] => B)(using A: Companion[A]): B =
|
@ -1,4 +1,4 @@
|
||||
package com.htmlism.scratchpad
|
||||
package com.htmlism.firepower.core
|
||||
|
||||
object Load:
|
||||
def constA[B: Encoded.Byte](x: B): Asm1[Reg.A] =
|
@ -1,4 +1,4 @@
|
||||
package com.htmlism.scratchpad
|
||||
package com.htmlism.firepower.core
|
||||
|
||||
trait Loadable[A]:
|
||||
def show(x: A): String
|
@ -1,4 +1,4 @@
|
||||
package com.htmlism.scratchpad
|
||||
package com.htmlism.firepower.core
|
||||
|
||||
// https://mads.atari8.info/mads_eng.html#_mv
|
||||
object Move:
|
@ -1,4 +1,4 @@
|
||||
package com.htmlism.scratchpad
|
||||
package com.htmlism.firepower.core
|
||||
|
||||
sealed trait MutationStatus
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.htmlism.scratchpad
|
||||
package com.htmlism.firepower.core
|
||||
|
||||
trait ReadLease[A]
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.htmlism.scratchpad
|
||||
package com.htmlism.firepower.core
|
||||
|
||||
trait Reg[A]:
|
||||
def hello: Boolean
|
@ -1,4 +1,4 @@
|
||||
package com.htmlism.scratchpad
|
||||
package com.htmlism.firepower.core
|
||||
|
||||
// on the 6502, every register of this kind can store and load; so that capability was not parceled out into traits
|
||||
// (unlike read/write leases)
|
@ -1,4 +1,4 @@
|
||||
package com.htmlism.scratchpad
|
||||
package com.htmlism.firepower.core
|
||||
|
||||
import cats._
|
||||
import cats.syntax.all._
|
@ -1,3 +1,3 @@
|
||||
package com.htmlism.scratchpad
|
||||
package com.htmlism.firepower.core
|
||||
|
||||
trait StatefulRegister[A: Reg, F <: MutationStatus]
|
@ -1,4 +1,4 @@
|
||||
package com.htmlism.scratchpad
|
||||
package com.htmlism.firepower.core
|
||||
|
||||
object Store:
|
||||
def fromA[A](dest: WriteLease.ByteAddress[A]): Asm2[Reg.A, A] =
|
@ -1,4 +1,4 @@
|
||||
package com.htmlism.scratchpad
|
||||
package com.htmlism.firepower.core
|
||||
|
||||
trait WriteLease[A]:
|
||||
def canon: A
|
@ -1,4 +1,4 @@
|
||||
package com.htmlism.scratchpad
|
||||
package com.htmlism.firepower.core
|
||||
|
||||
sealed trait Address:
|
||||
def n: Int
|
@ -1,4 +1,4 @@
|
||||
package com.htmlism.scratchpad
|
||||
package com.htmlism.firepower.core
|
||||
|
||||
sealed trait Asm1[A]:
|
||||
def xs: List[String]
|
@ -1,6 +1,6 @@
|
||||
package com.htmlism
|
||||
package com.htmlism.firepower
|
||||
|
||||
package object scratchpad:
|
||||
package object core:
|
||||
object Reg:
|
||||
type A =
|
||||
Register.A
|
@ -1,4 +1,4 @@
|
||||
package com.htmlism.scratchpad
|
||||
package com.htmlism.firepower.core
|
||||
|
||||
package object syntax:
|
||||
implicit class WriteRegisterOps[Addr](reg: WriteByteAddress[Addr]):
|
@ -1,4 +1,4 @@
|
||||
package com.htmlism.scratchpad
|
||||
package com.htmlism.firepower.core
|
||||
|
||||
import weaver.*
|
||||
object ComplicatedResourceSuite extends FunSuite:
|
@ -1,9 +1,9 @@
|
||||
package com.htmlism.scratchpad
|
||||
package com.htmlism.firepower.core
|
||||
|
||||
import org.scalatest.funsuite.AnyFunSuite
|
||||
import org.scalatest.matchers.should._
|
||||
|
||||
import com.htmlism.scratchpad.syntax._
|
||||
import com.htmlism.firepower.core.syntax._
|
||||
|
||||
object ExampleRegister extends ZeroPageAddress(0x01, "example") with WriteOnlyByteAddress[ExampleRegister]
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.htmlism.scratchpad
|
||||
package com.htmlism.firepower.core
|
||||
|
||||
import weaver._
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.htmlism.scratchpad
|
||||
package com.htmlism.firepower.core
|
||||
|
||||
import weaver.*
|
||||
|
Loading…
x
Reference in New Issue
Block a user