diff --git a/build.sbt b/build.sbt index 8392bf8..f3524a2 100644 --- a/build.sbt +++ b/build.sbt @@ -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 diff --git a/scratchpad/src/main/scala/com/htmlism/scratchpad/AsmProgram.scala b/firepower-core/src/main/scala/com/htmlism/firepower/core/AsmProgram.scala similarity index 97% rename from scratchpad/src/main/scala/com/htmlism/scratchpad/AsmProgram.scala rename to firepower-core/src/main/scala/com/htmlism/firepower/core/AsmProgram.scala index 90344a8..83328ef 100644 --- a/scratchpad/src/main/scala/com/htmlism/scratchpad/AsmProgram.scala +++ b/firepower-core/src/main/scala/com/htmlism/firepower/core/AsmProgram.scala @@ -1,4 +1,4 @@ -package com.htmlism.scratchpad +package com.htmlism.firepower.core import cats.Semigroup import cats.syntax.all._ diff --git a/scratchpad/src/main/scala/com/htmlism/scratchpad/CodeGenerator.scala b/firepower-core/src/main/scala/com/htmlism/firepower/core/CodeGenerator.scala similarity index 98% rename from scratchpad/src/main/scala/com/htmlism/scratchpad/CodeGenerator.scala rename to firepower-core/src/main/scala/com/htmlism/firepower/core/CodeGenerator.scala index f136fc9..f5f17f8 100644 --- a/scratchpad/src/main/scala/com/htmlism/scratchpad/CodeGenerator.scala +++ b/firepower-core/src/main/scala/com/htmlism/firepower/core/CodeGenerator.scala @@ -1,4 +1,4 @@ -package com.htmlism.scratchpad +package com.htmlism.firepower.core object CodeGenerator extends App: val allLetters = diff --git a/scratchpad/src/main/scala/com/htmlism/scratchpad/Companion.scala b/firepower-core/src/main/scala/com/htmlism/firepower/core/Companion.scala similarity index 50% rename from scratchpad/src/main/scala/com/htmlism/scratchpad/Companion.scala rename to firepower-core/src/main/scala/com/htmlism/firepower/core/Companion.scala index fde02fd..8249040 100644 --- a/scratchpad/src/main/scala/com/htmlism/scratchpad/Companion.scala +++ b/firepower-core/src/main/scala/com/htmlism/firepower/core/Companion.scala @@ -1,3 +1,3 @@ -package com.htmlism.scratchpad +package com.htmlism.firepower.core trait Companion[A]: def canon: A diff --git a/scratchpad/src/main/scala/com/htmlism/scratchpad/Encoded.scala b/firepower-core/src/main/scala/com/htmlism/firepower/core/Encoded.scala similarity index 82% rename from scratchpad/src/main/scala/com/htmlism/scratchpad/Encoded.scala rename to firepower-core/src/main/scala/com/htmlism/firepower/core/Encoded.scala index 77b2e0b..0822cdb 100644 --- a/scratchpad/src/main/scala/com/htmlism/scratchpad/Encoded.scala +++ b/firepower-core/src/main/scala/com/htmlism/firepower/core/Encoded.scala @@ -1,4 +1,4 @@ -package com.htmlism.scratchpad +package com.htmlism.firepower.core object Encoded: trait Byte[A]: diff --git a/scratchpad/src/main/scala/com/htmlism/scratchpad/GrantsWriteLeases.scala b/firepower-core/src/main/scala/com/htmlism/firepower/core/GrantsWriteLeases.scala similarity index 85% rename from scratchpad/src/main/scala/com/htmlism/scratchpad/GrantsWriteLeases.scala rename to firepower-core/src/main/scala/com/htmlism/firepower/core/GrantsWriteLeases.scala index 9c50df6..c798e1e 100644 --- a/scratchpad/src/main/scala/com/htmlism/scratchpad/GrantsWriteLeases.scala +++ b/firepower-core/src/main/scala/com/htmlism/firepower/core/GrantsWriteLeases.scala @@ -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 = diff --git a/scratchpad/src/main/scala/com/htmlism/scratchpad/Load.scala b/firepower-core/src/main/scala/com/htmlism/firepower/core/Load.scala similarity index 90% rename from scratchpad/src/main/scala/com/htmlism/scratchpad/Load.scala rename to firepower-core/src/main/scala/com/htmlism/firepower/core/Load.scala index e30c72e..96c46ab 100644 --- a/scratchpad/src/main/scala/com/htmlism/scratchpad/Load.scala +++ b/firepower-core/src/main/scala/com/htmlism/firepower/core/Load.scala @@ -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] = diff --git a/scratchpad/src/main/scala/com/htmlism/scratchpad/Loadable.scala b/firepower-core/src/main/scala/com/htmlism/firepower/core/Loadable.scala similarity index 79% rename from scratchpad/src/main/scala/com/htmlism/scratchpad/Loadable.scala rename to firepower-core/src/main/scala/com/htmlism/firepower/core/Loadable.scala index 3a9a8ac..47fd25a 100644 --- a/scratchpad/src/main/scala/com/htmlism/scratchpad/Loadable.scala +++ b/firepower-core/src/main/scala/com/htmlism/firepower/core/Loadable.scala @@ -1,4 +1,4 @@ -package com.htmlism.scratchpad +package com.htmlism.firepower.core trait Loadable[A]: def show(x: A): String diff --git a/scratchpad/src/main/scala/com/htmlism/scratchpad/Move.scala b/firepower-core/src/main/scala/com/htmlism/firepower/core/Move.scala similarity index 93% rename from scratchpad/src/main/scala/com/htmlism/scratchpad/Move.scala rename to firepower-core/src/main/scala/com/htmlism/firepower/core/Move.scala index b532014..5c6be09 100644 --- a/scratchpad/src/main/scala/com/htmlism/scratchpad/Move.scala +++ b/firepower-core/src/main/scala/com/htmlism/firepower/core/Move.scala @@ -1,4 +1,4 @@ -package com.htmlism.scratchpad +package com.htmlism.firepower.core // https://mads.atari8.info/mads_eng.html#_mv object Move: diff --git a/scratchpad/src/main/scala/com/htmlism/scratchpad/MutationStatus.scala b/firepower-core/src/main/scala/com/htmlism/firepower/core/MutationStatus.scala similarity index 75% rename from scratchpad/src/main/scala/com/htmlism/scratchpad/MutationStatus.scala rename to firepower-core/src/main/scala/com/htmlism/firepower/core/MutationStatus.scala index 56f0f61..baeb905 100644 --- a/scratchpad/src/main/scala/com/htmlism/scratchpad/MutationStatus.scala +++ b/firepower-core/src/main/scala/com/htmlism/firepower/core/MutationStatus.scala @@ -1,4 +1,4 @@ -package com.htmlism.scratchpad +package com.htmlism.firepower.core sealed trait MutationStatus diff --git a/scratchpad/src/main/scala/com/htmlism/scratchpad/ReadLease.scala b/firepower-core/src/main/scala/com/htmlism/firepower/core/ReadLease.scala similarity index 71% rename from scratchpad/src/main/scala/com/htmlism/scratchpad/ReadLease.scala rename to firepower-core/src/main/scala/com/htmlism/firepower/core/ReadLease.scala index f862434..f3cec3b 100644 --- a/scratchpad/src/main/scala/com/htmlism/scratchpad/ReadLease.scala +++ b/firepower-core/src/main/scala/com/htmlism/firepower/core/ReadLease.scala @@ -1,4 +1,4 @@ -package com.htmlism.scratchpad +package com.htmlism.firepower.core trait ReadLease[A] diff --git a/scratchpad/src/main/scala/com/htmlism/scratchpad/Reg.scala b/firepower-core/src/main/scala/com/htmlism/firepower/core/Reg.scala similarity index 79% rename from scratchpad/src/main/scala/com/htmlism/scratchpad/Reg.scala rename to firepower-core/src/main/scala/com/htmlism/firepower/core/Reg.scala index a8151cf..3d6ec56 100644 --- a/scratchpad/src/main/scala/com/htmlism/scratchpad/Reg.scala +++ b/firepower-core/src/main/scala/com/htmlism/firepower/core/Reg.scala @@ -1,4 +1,4 @@ -package com.htmlism.scratchpad +package com.htmlism.firepower.core trait Reg[A]: def hello: Boolean diff --git a/scratchpad/src/main/scala/com/htmlism/scratchpad/Register.scala b/firepower-core/src/main/scala/com/htmlism/firepower/core/Register.scala similarity index 95% rename from scratchpad/src/main/scala/com/htmlism/scratchpad/Register.scala rename to firepower-core/src/main/scala/com/htmlism/firepower/core/Register.scala index 530dc98..36969d5 100644 --- a/scratchpad/src/main/scala/com/htmlism/scratchpad/Register.scala +++ b/firepower-core/src/main/scala/com/htmlism/firepower/core/Register.scala @@ -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) diff --git a/scratchpad/src/main/scala/com/htmlism/scratchpad/ScratchPad.scala b/firepower-core/src/main/scala/com/htmlism/firepower/core/ScratchPad.scala similarity index 97% rename from scratchpad/src/main/scala/com/htmlism/scratchpad/ScratchPad.scala rename to firepower-core/src/main/scala/com/htmlism/firepower/core/ScratchPad.scala index 169bb01..ae90599 100644 --- a/scratchpad/src/main/scala/com/htmlism/scratchpad/ScratchPad.scala +++ b/firepower-core/src/main/scala/com/htmlism/firepower/core/ScratchPad.scala @@ -1,4 +1,4 @@ -package com.htmlism.scratchpad +package com.htmlism.firepower.core import cats._ import cats.syntax.all._ diff --git a/scratchpad/src/main/scala/com/htmlism/scratchpad/StatefulRegister.scala b/firepower-core/src/main/scala/com/htmlism/firepower/core/StatefulRegister.scala similarity index 60% rename from scratchpad/src/main/scala/com/htmlism/scratchpad/StatefulRegister.scala rename to firepower-core/src/main/scala/com/htmlism/firepower/core/StatefulRegister.scala index 0fca52d..8d326a1 100644 --- a/scratchpad/src/main/scala/com/htmlism/scratchpad/StatefulRegister.scala +++ b/firepower-core/src/main/scala/com/htmlism/firepower/core/StatefulRegister.scala @@ -1,3 +1,3 @@ -package com.htmlism.scratchpad +package com.htmlism.firepower.core trait StatefulRegister[A: Reg, F <: MutationStatus] diff --git a/scratchpad/src/main/scala/com/htmlism/scratchpad/Store.scala b/firepower-core/src/main/scala/com/htmlism/firepower/core/Store.scala similarity index 92% rename from scratchpad/src/main/scala/com/htmlism/scratchpad/Store.scala rename to firepower-core/src/main/scala/com/htmlism/firepower/core/Store.scala index 03af3c0..e6f697c 100644 --- a/scratchpad/src/main/scala/com/htmlism/scratchpad/Store.scala +++ b/firepower-core/src/main/scala/com/htmlism/firepower/core/Store.scala @@ -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] = diff --git a/scratchpad/src/main/scala/com/htmlism/scratchpad/WriteLease.scala b/firepower-core/src/main/scala/com/htmlism/firepower/core/WriteLease.scala similarity index 86% rename from scratchpad/src/main/scala/com/htmlism/scratchpad/WriteLease.scala rename to firepower-core/src/main/scala/com/htmlism/firepower/core/WriteLease.scala index 98d1a3b..df7ba17 100644 --- a/scratchpad/src/main/scala/com/htmlism/scratchpad/WriteLease.scala +++ b/firepower-core/src/main/scala/com/htmlism/firepower/core/WriteLease.scala @@ -1,4 +1,4 @@ -package com.htmlism.scratchpad +package com.htmlism.firepower.core trait WriteLease[A]: def canon: A diff --git a/scratchpad/src/main/scala/com/htmlism/scratchpad/addresses.scala b/firepower-core/src/main/scala/com/htmlism/firepower/core/addresses.scala similarity index 96% rename from scratchpad/src/main/scala/com/htmlism/scratchpad/addresses.scala rename to firepower-core/src/main/scala/com/htmlism/firepower/core/addresses.scala index 4c324d9..5006f09 100644 --- a/scratchpad/src/main/scala/com/htmlism/scratchpad/addresses.scala +++ b/firepower-core/src/main/scala/com/htmlism/firepower/core/addresses.scala @@ -1,4 +1,4 @@ -package com.htmlism.scratchpad +package com.htmlism.firepower.core sealed trait Address: def n: Int diff --git a/scratchpad/src/main/scala/com/htmlism/scratchpad/asm.scala b/firepower-core/src/main/scala/com/htmlism/firepower/core/asm.scala similarity index 98% rename from scratchpad/src/main/scala/com/htmlism/scratchpad/asm.scala rename to firepower-core/src/main/scala/com/htmlism/firepower/core/asm.scala index 0a41969..4946465 100644 --- a/scratchpad/src/main/scala/com/htmlism/scratchpad/asm.scala +++ b/firepower-core/src/main/scala/com/htmlism/firepower/core/asm.scala @@ -1,4 +1,4 @@ -package com.htmlism.scratchpad +package com.htmlism.firepower.core sealed trait Asm1[A]: def xs: List[String] diff --git a/scratchpad/src/main/scala/com/htmlism/scratchpad/package.scala b/firepower-core/src/main/scala/com/htmlism/firepower/core/package.scala similarity index 67% rename from scratchpad/src/main/scala/com/htmlism/scratchpad/package.scala rename to firepower-core/src/main/scala/com/htmlism/firepower/core/package.scala index c83b21f..3cd3543 100644 --- a/scratchpad/src/main/scala/com/htmlism/scratchpad/package.scala +++ b/firepower-core/src/main/scala/com/htmlism/firepower/core/package.scala @@ -1,6 +1,6 @@ -package com.htmlism +package com.htmlism.firepower -package object scratchpad: +package object core: object Reg: type A = Register.A diff --git a/scratchpad/src/main/scala/com/htmlism/scratchpad/syntax/package.scala b/firepower-core/src/main/scala/com/htmlism/firepower/core/syntax/package.scala similarity index 96% rename from scratchpad/src/main/scala/com/htmlism/scratchpad/syntax/package.scala rename to firepower-core/src/main/scala/com/htmlism/firepower/core/syntax/package.scala index 99cf87a..6ec428c 100644 --- a/scratchpad/src/main/scala/com/htmlism/scratchpad/syntax/package.scala +++ b/firepower-core/src/main/scala/com/htmlism/firepower/core/syntax/package.scala @@ -1,4 +1,4 @@ -package com.htmlism.scratchpad +package com.htmlism.firepower.core package object syntax: implicit class WriteRegisterOps[Addr](reg: WriteByteAddress[Addr]): diff --git a/scratchpad/src/test/scala/com/htmlism/scratchpad/ComplicatedResourceSuite.scala b/firepower-core/src/test/scala/com/htmlism/firepower/core/ComplicatedResourceSuite.scala similarity index 96% rename from scratchpad/src/test/scala/com/htmlism/scratchpad/ComplicatedResourceSuite.scala rename to firepower-core/src/test/scala/com/htmlism/firepower/core/ComplicatedResourceSuite.scala index c004aa5..3489bf8 100644 --- a/scratchpad/src/test/scala/com/htmlism/scratchpad/ComplicatedResourceSuite.scala +++ b/firepower-core/src/test/scala/com/htmlism/firepower/core/ComplicatedResourceSuite.scala @@ -1,4 +1,4 @@ -package com.htmlism.scratchpad +package com.htmlism.firepower.core import weaver.* object ComplicatedResourceSuite extends FunSuite: diff --git a/scratchpad/src/test/scala/com/htmlism/scratchpad/FeatureSpec.scala b/firepower-core/src/test/scala/com/htmlism/firepower/core/FeatureSpec.scala similarity index 94% rename from scratchpad/src/test/scala/com/htmlism/scratchpad/FeatureSpec.scala rename to firepower-core/src/test/scala/com/htmlism/firepower/core/FeatureSpec.scala index 02161cf..26052a9 100644 --- a/scratchpad/src/test/scala/com/htmlism/scratchpad/FeatureSpec.scala +++ b/firepower-core/src/test/scala/com/htmlism/firepower/core/FeatureSpec.scala @@ -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] diff --git a/scratchpad/src/test/scala/com/htmlism/scratchpad/MoveSuite.scala b/firepower-core/src/test/scala/com/htmlism/firepower/core/MoveSuite.scala similarity index 87% rename from scratchpad/src/test/scala/com/htmlism/scratchpad/MoveSuite.scala rename to firepower-core/src/test/scala/com/htmlism/firepower/core/MoveSuite.scala index bba26e2..b3e7f5d 100644 --- a/scratchpad/src/test/scala/com/htmlism/scratchpad/MoveSuite.scala +++ b/firepower-core/src/test/scala/com/htmlism/firepower/core/MoveSuite.scala @@ -1,4 +1,4 @@ -package com.htmlism.scratchpad +package com.htmlism.firepower.core import weaver._ diff --git a/scratchpad/src/test/scala/com/htmlism/scratchpad/RegisterSuite.scala b/firepower-core/src/test/scala/com/htmlism/firepower/core/RegisterSuite.scala similarity index 90% rename from scratchpad/src/test/scala/com/htmlism/scratchpad/RegisterSuite.scala rename to firepower-core/src/test/scala/com/htmlism/firepower/core/RegisterSuite.scala index dc68df2..aa215d6 100644 --- a/scratchpad/src/test/scala/com/htmlism/scratchpad/RegisterSuite.scala +++ b/firepower-core/src/test/scala/com/htmlism/firepower/core/RegisterSuite.scala @@ -1,4 +1,4 @@ -package com.htmlism.scratchpad +package com.htmlism.firepower.core import weaver.*