├── .circleci ├── config.yml └── publish.sh ├── .editorconfig ├── .gitattributes ├── .gitignore ├── .travis.yml ├── CHANGES.adoc ├── LICENSE ├── README.md ├── build.gradle.kts ├── buildSrc ├── build.gradle.kts ├── settings.gradle.kts └── src │ └── main │ └── kotlin │ ├── rbt.adapter.inbound.gradle.gradle.kts │ ├── rbt.adapter.outbound.gradle.gradle.kts │ ├── rbt.domain.gradle.kts │ └── rbt.kotlin.gradle.kts ├── compilers └── kickass │ ├── adapters │ ├── in │ │ └── gradle │ │ │ ├── build.gradle.kts │ │ │ └── src │ │ │ └── main │ │ │ └── kotlin │ │ │ └── com │ │ │ └── github │ │ │ └── c64lib │ │ │ └── rbt │ │ │ └── compilers │ │ │ └── kickass │ │ │ └── adapters │ │ │ └── in │ │ │ └── gradle │ │ │ ├── Assemble.kt │ │ │ ├── AssembleSpec.kt │ │ │ ├── Clean.kt │ │ │ ├── ResolveDevDeps.kt │ │ │ └── functions.kt │ └── out │ │ ├── filedownload │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── main │ │ │ └── kotlin │ │ │ └── com │ │ │ └── github │ │ │ └── c64lib │ │ │ └── rbt │ │ │ └── compilers │ │ │ └── kickass │ │ │ └── adapters │ │ │ └── out │ │ │ └── filedownload │ │ │ └── DownloadKickAssemblerAdapter.kt │ │ └── gradle │ │ ├── build.gradle.kts │ │ └── src │ │ └── main │ │ └── kotlin │ │ └── com │ │ └── github │ │ └── c64lib │ │ └── rbt │ │ └── compilers │ │ └── kickass │ │ └── adapters │ │ └── out │ │ └── gradle │ │ ├── CommandLineBuilder.kt │ │ ├── DeleteFilesAdapter.kt │ │ ├── KickAssembleAdapter.kt │ │ ├── KickAssembleSpecAdapter.kt │ │ ├── ReadVersionAdapter.kt │ │ ├── SaveVersionAdapter.kt │ │ └── functions.kt │ ├── build.gradle.kts │ └── src │ ├── main │ └── kotlin │ │ └── com │ │ └── github │ │ └── c64lib │ │ └── rbt │ │ └── compilers │ │ └── kickass │ │ ├── domain │ │ └── KickAssemblerSettings.kt │ │ └── usecase │ │ ├── CleanBuildArtefactsUseCase.kt │ │ ├── DownloadKickAssemblerUseCase.kt │ │ ├── GenerateKickAssSourceUseCase.kt │ │ ├── KickAssembleSpecUseCase.kt │ │ ├── KickAssembleUseCase.kt │ │ └── port │ │ ├── DeleteFilesPort.kt │ │ ├── DownloadKickAssemblerPort.kt │ │ ├── KickAssemblePort.kt │ │ ├── KickAssembleSpecPort.kt │ │ ├── ReadVersionPort.kt │ │ └── SaveVersionPort.kt │ └── test │ └── kotlin │ └── com │ └── github │ └── c64lib │ └── rbt │ └── compilers │ └── kickass │ └── usecase │ └── .gitkeep ├── dependencies ├── adapters │ ├── in │ │ └── gradle │ │ │ ├── build.gradle.kts │ │ │ └── src │ │ │ └── main │ │ │ └── kotlin │ │ │ └── com │ │ │ └── github │ │ │ └── c64lib │ │ │ └── rbt │ │ │ └── dependencies │ │ │ └── adapters │ │ │ └── in │ │ │ └── gradle │ │ │ └── DownloadDependencies.kt │ └── out │ │ └── gradle │ │ ├── build.gradle.kts │ │ └── src │ │ └── main │ │ └── kotlin │ │ └── com │ │ └── github │ │ └── c64lib │ │ └── rbt │ │ └── dependencies │ │ └── adapters │ │ └── out │ │ └── gradle │ │ ├── DownloadDependencyAdapter.kt │ │ ├── ReadDependencyVersionAdapter.kt │ │ ├── SaveDependencyVersionAdapter.kt │ │ └── UntarDependencyAdapter.kt ├── build.gradle.kts └── src │ └── main │ └── kotlin │ └── com │ └── github │ └── c64lib │ └── rbt │ └── dependencies │ └── usecase │ ├── ResolveGitHubDependencyUseCase.kt │ └── port │ ├── DownloadDependencyPort.kt │ ├── ReadDependencyVersionPort.kt │ ├── SaveDependencyVersionPort.kt │ └── UntarDependencyPort.kt ├── doc ├── Gemfile ├── Gemfile.lock ├── asciidoctor.css ├── build.gradle.kts ├── clean.css ├── concept │ ├── _02_overview.adoc │ ├── _03_processes.adoc │ ├── _04_requirements.adoc │ ├── _10_architecture.adoc │ ├── asciidoctor.css │ ├── clean.css │ ├── img │ │ ├── domain-asm-project-model.svg │ │ ├── domain-processors.svg │ │ ├── overall-hexagon.svg │ │ ├── process-assembling-deps.svg │ │ ├── process-converter.svg │ │ └── process-simple-assembling.svg │ └── index.adoc ├── diagram │ ├── domain-asm-project-model.excalidraw │ ├── domain-processors.excalidraw │ ├── overall-hexagon.excalidraw │ ├── process-assembling-deps.excalidraw │ ├── process-converter.excalidraw │ └── process-simple-assembling.excalidraw ├── img │ ├── ci-flow.excalidraw.png │ ├── native-deps.png │ ├── pipelines.png │ └── retro-tool-overview.png ├── index-docinfo-footer.html ├── index-docinfo.html └── index.adoc ├── emulators └── vice │ ├── adapters │ └── out │ │ └── gradle │ │ ├── build.gradle.kts │ │ └── src │ │ ├── main │ │ └── kotlin │ │ │ └── com │ │ │ └── github │ │ │ └── c64lib │ │ │ └── rbt │ │ │ └── emulators │ │ │ └── vice │ │ │ └── adapters │ │ │ └── out │ │ │ └── gradle │ │ │ ├── CommandLineBuilder.kt │ │ │ ├── QueryForViceVersionAdapter.kt │ │ │ └── RunTestOnViceAdapter.kt │ │ └── test │ │ └── kotlin │ │ └── com │ │ └── github │ │ └── c64lib │ │ └── rbt │ │ └── emulators │ │ └── vice │ │ └── adapters │ │ └── out │ │ └── gradle │ │ └── CommandLineBuilderTest.kt │ ├── build.gradle.kts │ └── src │ └── main │ └── kotlin │ └── com │ └── github │ └── c64lib │ └── rbt │ └── emulators │ └── vice │ ├── domain │ ├── JamAction.kt │ └── ViceException.kt │ └── usecase │ ├── QueryForViceVersionUseCase.kt │ ├── RunTestOnViceUseCase.kt │ ├── constants.kt │ └── port │ ├── QueryForViceVersionPort.kt │ ├── RunTestOnVicePort.kt │ └── ViceParameters.kt ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── infra └── gradle │ ├── build.gradle.kts │ └── src │ └── main │ └── kotlin │ └── com │ └── github │ └── c64lib │ └── gradle │ ├── RetroAssemblerPlugin.kt │ └── tasks │ ├── Build.kt │ └── Preprocess.kt ├── processors ├── charpad │ ├── adapters │ │ └── in │ │ │ └── gradle │ │ │ ├── build.gradle.kts │ │ │ └── src │ │ │ └── main │ │ │ └── kotlin │ │ │ └── com │ │ │ └── github │ │ │ └── c64lib │ │ │ └── rbt │ │ │ └── processors │ │ │ └── charpad │ │ │ └── adapters │ │ │ └── in │ │ │ └── gradle │ │ │ ├── Charpad.kt │ │ │ └── CharpadMetaOutput.kt │ ├── build.gradle.kts │ └── src │ │ ├── main │ │ └── kotlin │ │ │ └── com │ │ │ └── github │ │ │ └── c64lib │ │ │ └── rbt │ │ │ └── processors │ │ │ └── charpad │ │ │ ├── domain │ │ │ ├── CTMHeader.kt │ │ │ ├── CharAttributesProducer.kt │ │ │ ├── CharColoursProducer.kt │ │ │ ├── CharMaterialsProducer.kt │ │ │ ├── CharScreenColoursProducer.kt │ │ │ ├── CharsetProducer.kt │ │ │ ├── ColouringMethod.kt │ │ │ ├── Dimensions.kt │ │ │ ├── HeaderProducer.kt │ │ │ ├── InsufficientDataException.kt │ │ │ ├── InvalidCTMFormatException.kt │ │ │ ├── MapCoord.kt │ │ │ ├── MapProducer.kt │ │ │ ├── ScreenMode.kt │ │ │ ├── TileColoursProducer.kt │ │ │ ├── TileProducer.kt │ │ │ ├── TileScreenColoursProducer.kt │ │ │ ├── TileSetDimensions.kt │ │ │ └── TileTagsProducer.kt │ │ │ └── usecase │ │ │ ├── ProcessCharpadUseCase.kt │ │ │ ├── post6 │ │ │ ├── BlockBasedCTMProcessor.kt │ │ │ ├── CTM6Processor.kt │ │ │ ├── CTM7Processor.kt │ │ │ ├── CTM8Processor.kt │ │ │ └── CTM9Processor.kt │ │ │ └── pre6 │ │ │ └── CTM5Processor.kt │ │ └── test │ │ ├── kotlin │ │ └── com │ │ │ └── github │ │ │ └── c64lib │ │ │ └── rbt │ │ │ └── processors │ │ │ └── charpad │ │ │ ├── domain │ │ │ └── MapProducerTest.kt │ │ │ └── usecase │ │ │ ├── CTM5ByteArrayMock.kt │ │ │ ├── CTMByteArrayMock.kt │ │ │ ├── CharpadProcessorTest.kt │ │ │ ├── TextHiresCTMTest.kt │ │ │ └── TextMulticCTMTest.kt │ │ └── resources │ │ ├── text-hires │ │ ├── text-hi-per-char-notiles-ctm5.ctm │ │ ├── text-hi-per-char-notiles-ctm6.ctm │ │ ├── text-hi-per-char-notiles-ctm7.ctm │ │ ├── text-hi-per-char-notiles-ctm8-beta.ctm │ │ ├── text-hi-per-char-notiles-ctm8.ctm │ │ ├── text-hi-per-char-notiles-ctm82.ctm │ │ ├── text-hi-per-char-tiles-ctm5.ctm │ │ ├── text-hi-per-char-tiles-ctm6.ctm │ │ ├── text-hi-per-char-tiles-ctm7.ctm │ │ ├── text-hi-per-char-tiles-ctm8-beta.ctm │ │ ├── text-hi-per-char-tiles-ctm8.ctm │ │ ├── text-hi-per-char-tiles-ctm82.ctm │ │ ├── text-hi-per-tile-ctm5.ctm │ │ ├── text-hi-per-tile-ctm6.ctm │ │ ├── text-hi-per-tile-ctm7.ctm │ │ ├── text-hi-per-tile-ctm8-beta.ctm │ │ ├── text-hi-per-tile-ctm8.ctm │ │ └── text-hi-per-tile-ctm82.ctm │ │ └── text-multic │ │ ├── text-mc-per-char-notiles-ctm5.ctm │ │ ├── text-mc-per-char-notiles-ctm6.ctm │ │ ├── text-mc-per-char-notiles-ctm7.ctm │ │ ├── text-mc-per-char-notiles-ctm8.ctm │ │ ├── text-mc-per-char-tiles-ctm5.ctm │ │ ├── text-mc-per-char-tiles-ctm6.ctm │ │ ├── text-mc-per-char-tiles-ctm7.ctm │ │ ├── text-mc-per-char-tiles-ctm8.ctm │ │ ├── text-mc-per-tile-ctm5.ctm │ │ ├── text-mc-per-tile-ctm6.ctm │ │ ├── text-mc-per-tile-ctm7.ctm │ │ └── text-mc-per-tile-ctm8.ctm ├── goattracker │ ├── adapters │ │ ├── in │ │ │ └── gradle │ │ │ │ ├── build.gradle.kts │ │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── kotlin │ │ │ │ └── com │ │ │ │ └── github │ │ │ │ └── c64lib │ │ │ │ └── rbt │ │ │ │ └── processors │ │ │ │ └── goattracker │ │ │ │ └── adapters │ │ │ │ └── in │ │ │ │ └── gradle │ │ │ │ └── Goattracker.kt │ │ └── out │ │ │ └── gradle │ │ │ ├── build.gradle.kts │ │ │ └── src │ │ │ └── main │ │ │ └── kotlin │ │ │ └── com │ │ │ └── github │ │ │ └── c64lib │ │ │ └── rbt │ │ │ └── processors │ │ │ └── goattracker │ │ │ └── adapters │ │ │ └── out │ │ │ └── gradle │ │ │ └── ExecuteGt2RelocAdapter.kt │ ├── build.gradle.kts │ └── src │ │ └── main │ │ └── kotlin │ │ └── com │ │ └── github │ │ └── c64lib │ │ └── rbt │ │ └── processors │ │ └── goattracker │ │ └── usecase │ │ ├── PackSongUseCase.kt │ │ └── port │ │ └── ExecuteGt2RelocPort.kt ├── image │ ├── adapters │ │ ├── in │ │ │ └── gradle │ │ │ │ ├── build.gradle.kts │ │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── kotlin │ │ │ │ └── com │ │ │ │ └── github │ │ │ │ └── c64lib │ │ │ │ └── rbt │ │ │ │ └── processors │ │ │ │ └── image │ │ │ │ └── adapters │ │ │ │ └── in │ │ │ │ └── gradle │ │ │ │ └── ProcessImage.kt │ │ └── out │ │ │ ├── file │ │ │ ├── build.gradle.kts │ │ │ └── src │ │ │ │ ├── main │ │ │ │ └── kotlin │ │ │ │ │ └── com │ │ │ │ │ └── github │ │ │ │ │ └── c64lib │ │ │ │ │ └── rbt │ │ │ │ │ └── processors │ │ │ │ │ └── image │ │ │ │ │ └── adapters │ │ │ │ │ └── out │ │ │ │ │ └── file │ │ │ │ │ ├── C64CharsetWriter.kt │ │ │ │ │ ├── C64SpriteWriter.kt │ │ │ │ │ └── WriterUtils.kt │ │ │ │ └── test │ │ │ │ └── kotlin │ │ │ │ └── com │ │ │ │ └── github │ │ │ │ └── c64lib │ │ │ │ └── rbt │ │ │ │ └── processors │ │ │ │ └── image │ │ │ │ └── adapters │ │ │ │ └── out │ │ │ │ └── file │ │ │ │ ├── C64CharsetWriterTest.kt │ │ │ │ └── C64SpriteWriterTest.kt │ │ │ └── png │ │ │ ├── build.gradle.kts │ │ │ └── src │ │ │ ├── main │ │ │ └── kotlin │ │ │ │ └── com │ │ │ │ └── github │ │ │ │ └── c64lib │ │ │ │ └── rbt │ │ │ │ └── processors │ │ │ │ └── image │ │ │ │ └── adapters │ │ │ │ └── out │ │ │ │ └── png │ │ │ │ └── ReadPngImageAdapter.kt │ │ │ └── test │ │ │ ├── kotlin │ │ │ └── com │ │ │ │ └── github │ │ │ │ └── c64lib │ │ │ │ └── rbt │ │ │ │ └── processors │ │ │ │ └── image │ │ │ │ └── adapters │ │ │ │ └── out │ │ │ │ └── png │ │ │ │ └── ReadPngImageAdapterTest.kt │ │ │ └── resources │ │ │ ├── test-png-2.png │ │ │ └── test-png.png │ ├── build.gradle.kts │ └── src │ │ ├── main │ │ └── kotlin │ │ │ └── com │ │ │ └── github │ │ │ └── c64lib │ │ │ └── rbt │ │ │ └── processors │ │ │ └── image │ │ │ ├── domain │ │ │ └── Image.kt │ │ │ └── usecase │ │ │ ├── CutImageUseCase.kt │ │ │ ├── CutSourceImageUseCase.kt │ │ │ ├── ExtendImageUseCase.kt │ │ │ ├── FlipImageUseCase.kt │ │ │ ├── ReadSourceImageUseCase.kt │ │ │ ├── ReduceResolutionUseCase.kt │ │ │ ├── SplitImageUseCase.kt │ │ │ ├── WriteImageUseCase.kt │ │ │ └── port │ │ │ ├── ReadImagePort.kt │ │ │ ├── WriteCharsetPort.kt │ │ │ └── WriteSpritePort.kt │ │ └── test │ │ └── kotlin │ │ └── com │ │ └── github │ │ └── c64lib │ │ └── rbt │ │ └── processors │ │ └── image │ │ ├── domain │ │ └── ImageTest.kt │ │ └── usecase │ │ ├── CutSourceImageUseCaseTest.kt │ │ ├── FlipImageUseCaseTest.kt │ │ ├── ReduceResolutionUseCaseTest.kt │ │ └── SplitImageUseCaseTest.kt └── spritepad │ ├── adapters │ └── in │ │ └── gradle │ │ ├── build.gradle.kts │ │ └── src │ │ └── main │ │ └── kotlin │ │ └── com │ │ └── github │ │ └── c64lib │ │ └── rbt │ │ └── processors │ │ └── spritepad │ │ └── adapters │ │ └── in │ │ └── gradle │ │ └── Spritepad.kt │ ├── build.gradle.kts │ └── src │ └── main │ └── kotlin │ └── com │ └── c64lib │ └── rbt │ └── processors │ └── spritepad │ ├── domain │ ├── InvalidSPDFormatException.kt │ └── SpriteProducer.kt │ └── usecase │ ├── ProcessSpritepadUseCase.kt │ └── spd4 │ └── SPD4Processor.kt ├── settings.gradle.kts ├── shared ├── binary-utils │ ├── build.gradle.kts │ └── src │ │ ├── main │ │ └── kotlin │ │ │ └── com │ │ │ └── github │ │ │ └── c64lib │ │ │ └── rbt │ │ │ └── shared │ │ │ └── binutils │ │ │ ├── ByteArrayExtensions.kt │ │ │ ├── ByteExtensions.kt │ │ │ ├── ByteUtils.kt │ │ │ ├── IntExtensions.kt │ │ │ └── Word.kt │ │ └── test │ │ └── kotlin │ │ └── com │ │ └── github │ │ └── c64lib │ │ └── rbt │ │ └── shared │ │ └── binutils │ │ ├── ToUnsignedIntTest.kt │ │ ├── ToWordTest.kt │ │ └── WordTest.kt ├── domain │ ├── build.gradle.kts │ └── src │ │ ├── main │ │ └── kotlin │ │ │ └── com │ │ │ └── github │ │ │ └── c64lib │ │ │ ├── rbt │ │ │ └── shared │ │ │ │ └── domain │ │ │ │ ├── AutostartPrgMode.kt │ │ │ │ ├── Axis.kt │ │ │ │ ├── Color.kt │ │ │ │ ├── Dependency.kt │ │ │ │ ├── DependencyType.kt │ │ │ │ ├── DependencyVersion.kt │ │ │ │ ├── IllegalConfigurationException.kt │ │ │ │ ├── IllegalInputException.kt │ │ │ │ ├── OutOfDataException.kt │ │ │ │ ├── OutputFormat.kt │ │ │ │ ├── SemVer.kt │ │ │ │ └── source │ │ │ │ └── source.kt │ │ │ └── retroassembler │ │ │ └── domain │ │ │ └── AssemblerType.kt │ │ └── test │ │ └── kotlin │ │ └── com │ │ └── github │ │ └── c64lib │ │ └── rbt │ │ └── shared │ │ └── domain │ │ └── SemVerTest.kt ├── filedownload │ ├── build.gradle.kts │ └── src │ │ └── main │ │ └── kotlin │ │ └── com │ │ └── github │ │ └── c64lib │ │ └── rbt │ │ └── shared │ │ └── filedownload │ │ └── FileDownloader.kt ├── gradle │ ├── build.gradle.kts │ └── src │ │ ├── main │ │ └── kotlin │ │ │ └── com │ │ │ └── github │ │ │ └── c64lib │ │ │ └── rbt │ │ │ └── shared │ │ │ └── gradle │ │ │ ├── TaskGroups.kt │ │ │ ├── Tasks.kt │ │ │ ├── dsl │ │ │ ├── CharpadPipelineExtension.kt │ │ │ ├── FilterAwareExtension.kt │ │ │ ├── GoattrackerMusicExtension.kt │ │ │ ├── GoattrackerPipelineExtension.kt │ │ │ ├── ImageCutExtension.kt │ │ │ ├── ImageExtendExtension.kt │ │ │ ├── ImageFlipExtension.kt │ │ │ ├── ImagePipelineExtension.kt │ │ │ ├── ImageReduceResolutionExtension.kt │ │ │ ├── ImageSplitExtension.kt │ │ │ ├── ImageTransformationExtension.kt │ │ │ ├── ImageWriterExtension.kt │ │ │ ├── InterleaverExtension.kt │ │ │ ├── MapExtension.kt │ │ │ ├── MetadataExtension.kt │ │ │ ├── NybblerExtension.kt │ │ │ ├── OutputExtension.kt │ │ │ ├── OutputsExtension.kt │ │ │ ├── PreprocessingExtension.kt │ │ │ ├── RetroAssemblerPluginExtension.kt │ │ │ ├── SpritepadPipelineExtension.kt │ │ │ ├── SpritesExtension.kt │ │ │ ├── SpritesOutputsExtension.kt │ │ │ └── StartEndExtension.kt │ │ │ ├── extensions.kt │ │ │ └── fllter │ │ │ ├── BinaryInterleaver.kt │ │ │ └── Nybbler.kt │ │ └── test │ │ └── kotlin │ │ └── com │ │ └── github │ │ └── c64lib │ │ └── rbt │ │ └── shared │ │ └── gradle │ │ └── filter │ │ ├── BinaryInterleaverTest.kt │ │ ├── ByteArrayExtensions.kt │ │ ├── NybblerTest.kt │ │ └── TestUtils.kt ├── processor │ ├── build.gradle.kts │ └── src │ │ └── main │ │ └── kotlin │ │ └── com │ │ └── github │ │ └── c64lib │ │ └── rbt │ │ └── shared │ │ └── processor │ │ ├── BinaryProducer.kt │ │ ├── FisInput.kt │ │ ├── InputByteStream.kt │ │ ├── Output.kt │ │ ├── OutputBuffer.kt │ │ ├── OutputProducer.kt │ │ ├── Processor.kt │ │ └── ScalableBinaryProducer.kt └── testutils │ ├── build.gradle.kts │ └── src │ └── main │ └── kotlin │ └── com │ └── github │ └── c64lib │ └── rbt │ └── shared │ └── testutils │ └── TestUtils.kt └── testing └── 64spec ├── adapters └── in │ └── gradle │ ├── build.gradle.kts │ └── src │ └── main │ └── kotlin │ └── com │ └── github │ └── c64lib │ └── rbt │ └── testing │ └── a64spec │ └── adapters │ └── in │ └── gradle │ ├── Test.kt │ └── TestReport.kt ├── build.gradle.kts └── src └── main └── kotlin └── com └── github └── c64lib └── rbt └── testing └── a64spec └── usecase ├── Run64SpecTestUseCase.kt ├── TestResult.kt └── functions.kt /.circleci/publish.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | git config --global user.name "$USER_NAME" 4 | git config --global user.email "$USER_EMAIL" 5 | 6 | ls -al 7 | 8 | git stash 9 | git remote rm origin 10 | git remote add origin https://maciejmalecki:"$GITHUB_TOKEN"@github.com/c64lib/gradle-retro-assembler-plugin.git 11 | 12 | ls -al 13 | 14 | find . -maxdepth 1 ! -name 'doc' ! -name '.git' ! -name '.gitignore' ! -name '.circleci' -exec rm -rf {} \; 15 | mv doc/build/docs/asciidoc/* . 16 | rm -R doc 17 | 18 | ls -al 19 | 20 | git add -fA 21 | git commit --allow-empty -m "$(git log master -1 --pretty=%B)" 22 | git push -f origin master:gh-pages 23 | 24 | echo "deployed successfully" 25 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | gradlew text eol=lf 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | **/build/ 3 | /out/ 4 | /doc/out 5 | 6 | # Ignore Gradle GUI config 7 | gradle-app.setting 8 | 9 | # Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) 10 | !gradle-wrapper.jar 11 | 12 | # Cache of project 13 | .gradletasknamecache 14 | 15 | # # Work around https://youtrack.jetbrains.com/issue/IDEA-116898 16 | # gradle/wrapper/gradle-wrapper.properties 17 | 18 | # IDE files 19 | /.idea 20 | *.iml 21 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: java 2 | jdk: openjdk12 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Gradle Retro Assembler Plugin 2 | 3 | [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) 4 | [![CircleCI](https://circleci.com/gh/c64lib/gradle-retro-assembler-plugin/tree/master.svg?style=shield)](https://circleci.com/gh/c64lib/gradle-retro-assembler-plugin/tree/master) 5 | [![CircleCI](https://circleci.com/gh/c64lib/gradle-retro-assembler-plugin/tree/develop.svg?style=shield)](https://circleci.com/gh/c64lib/gradle-retro-assembler-plugin/tree/develop) 6 | 7 | This is a plugin for [Gradle build tool](https://gradle.org/) that adds capability of building Assembly projects for MOS 65xx family of microprocessors. 8 | 9 | Currently, the plugin supports [Kick Assembler](http://theweb.dk/KickAssembler/Main.html#frontpage) as the only ASM dialect. 10 | 11 | Retro Build Tool is published at: https://plugins.gradle.org/plugin/com.github.c64lib.retro-assembler. 12 | 13 | There is also a Linux-based docker image available: https://github.com/c64lib/c64libci. All functions of Retro Build Tool with work on this image. The image is designed to be used with CI environments (such as CircleCI). 14 | 15 | ## User's Manual 16 | 17 | A complete User's Manual is available at the following address: 18 | 19 | https://c64lib.github.io/gradle-retro-assembler-plugin/ 20 | 21 | ## Change log 22 | 23 | A change log together with the list of available versions can be seen at: 24 | 25 | https://c64lib.github.io/gradle-retro-assembler-plugin/#_change_log 26 | -------------------------------------------------------------------------------- /build.gradle.kts: -------------------------------------------------------------------------------- 1 | val kotlinVersion: String by project 2 | val gradleDownloadTaskVersion: String by project 3 | val tagPropertyName = "tag" 4 | 5 | plugins { 6 | kotlin("jvm") 7 | id("com.diffplug.spotless") 8 | } 9 | 10 | 11 | allprojects { 12 | 13 | group = "com.github.c64lib" 14 | version = "1.7.6" 15 | 16 | if (project.hasProperty(tagPropertyName)) { 17 | version = project.property(tagPropertyName) ?: version 18 | } 19 | 20 | repositories { 21 | mavenCentral() 22 | jcenter { 23 | url = uri("https://jcenter.bintray.com/") 24 | } 25 | } 26 | } 27 | 28 | 29 | tasks { 30 | val collectTestResults by register("collectTestResults") { 31 | group = "verification" 32 | doLast { 33 | fileTree(".") { 34 | include("**/build/test-results/test/*.xml") 35 | exclude("build/") 36 | }.forEach { 37 | copy { 38 | from(it) 39 | into("$buildDir/test-results/gradle") 40 | } 41 | } 42 | } 43 | } 44 | collectTestResults.dependsOn(named("test")) 45 | } 46 | 47 | dependencies { 48 | implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10") 49 | } 50 | -------------------------------------------------------------------------------- /buildSrc/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | `kotlin-dsl` 3 | } 4 | 5 | repositories { 6 | gradlePluginPortal() 7 | mavenCentral() 8 | jcenter { 9 | url = uri("https://jcenter.bintray.com/") 10 | } 11 | } 12 | 13 | dependencies { 14 | implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.0") 15 | implementation("com.diffplug.spotless:spotless-plugin-gradle:6.12.0") 16 | } 17 | -------------------------------------------------------------------------------- /buildSrc/settings.gradle.kts: -------------------------------------------------------------------------------- 1 | rootProject.name = "buildSrc" 2 | -------------------------------------------------------------------------------- /buildSrc/src/main/kotlin/rbt.adapter.inbound.gradle.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("rbt.kotlin") 3 | } 4 | 5 | dependencies { 6 | implementation(gradleApi()) 7 | } 8 | -------------------------------------------------------------------------------- /buildSrc/src/main/kotlin/rbt.adapter.outbound.gradle.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("rbt.kotlin") 3 | } 4 | 5 | dependencies { 6 | implementation(gradleApi()) 7 | } 8 | -------------------------------------------------------------------------------- /buildSrc/src/main/kotlin/rbt.domain.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("rbt.kotlin") 3 | } 4 | -------------------------------------------------------------------------------- /buildSrc/src/main/kotlin/rbt.kotlin.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("org.jetbrains.kotlin.jvm") 3 | id("com.diffplug.spotless") 4 | } 5 | 6 | java { 7 | sourceCompatibility = JavaVersion.VERSION_11 8 | targetCompatibility = JavaVersion.VERSION_11 9 | } 10 | 11 | tasks.withType { 12 | kotlinOptions { 13 | jvmTarget = "11" 14 | } 15 | } 16 | 17 | spotless { 18 | kotlin { 19 | ktfmt() 20 | endWithNewline() 21 | licenseHeaderFile(rootProject.file("LICENSE")) 22 | } 23 | } 24 | 25 | repositories { 26 | mavenCentral() 27 | jcenter { 28 | url = uri("https://jcenter.bintray.com/") 29 | } 30 | } 31 | 32 | dependencies { 33 | implementation("org.jetbrains.kotlin:kotlin-stdlib:1.7.0") 34 | implementation("io.vavr:vavr:1.0.0-alpha-3") 35 | implementation("io.vavr:vavr-kotlin:0.10.2") 36 | testImplementation("org.junit.jupiter:junit-jupiter:5.7.0") 37 | testImplementation("io.kotest:kotest-runner-junit5:4.5.0") 38 | testImplementation("org.mockito:mockito-core:3.11.2") 39 | } 40 | 41 | tasks.withType { useJUnitPlatform() } 42 | -------------------------------------------------------------------------------- /compilers/kickass/adapters/in/gradle/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("rbt.adapter.inbound.gradle") 3 | } 4 | 5 | group = "com.github.c64lib.retro-assembler.compilers.kickass.in" 6 | 7 | dependencies { 8 | implementation(project(":compilers:kickass")) 9 | implementation(project(":shared:gradle")) 10 | implementation(project(":shared:domain")) 11 | } 12 | -------------------------------------------------------------------------------- /compilers/kickass/adapters/in/gradle/src/main/kotlin/com/github/c64lib/rbt/compilers/kickass/adapters/in/gradle/functions.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.compilers.kickass.adapters.`in`.gradle 26 | -------------------------------------------------------------------------------- /compilers/kickass/adapters/out/filedownload/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("rbt.adapter.outbound.gradle") 3 | } 4 | 5 | group = "com.github.c64lib.retro-assembler.compilers.kickass.out" 6 | 7 | dependencies { 8 | implementation(project(":compilers:kickass")) 9 | implementation(project(":shared:filedownload")) 10 | } 11 | -------------------------------------------------------------------------------- /compilers/kickass/adapters/out/filedownload/src/main/kotlin/com/github/c64lib/rbt/compilers/kickass/adapters/out/filedownload/DownloadKickAssemblerAdapter.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.compilers.kickass.adapters.out.filedownload 26 | 27 | import com.github.c64lib.rbt.compilers.kickass.usecase.port.DownloadKickAssemblerPort 28 | import com.github.c64lib.rbt.shared.filedownload.FileDownloader 29 | import java.io.File 30 | import java.net.URL 31 | import org.gradle.api.Project 32 | 33 | class DownloadKickAssemblerAdapter( 34 | private val project: Project, 35 | private val downloader: FileDownloader 36 | ) : DownloadKickAssemblerPort { 37 | override fun download(url: URL, target: String): File = 38 | downloader.download(url, project.file(target).toPath()).toFile() 39 | } 40 | -------------------------------------------------------------------------------- /compilers/kickass/adapters/out/gradle/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("rbt.adapter.outbound.gradle") 3 | } 4 | 5 | group = "com.github.c64lib.retro-assembler.compilers.kickass.out" 6 | 7 | dependencies { 8 | implementation(project(":compilers:kickass")) 9 | implementation(project(":shared:domain")) 10 | } 11 | -------------------------------------------------------------------------------- /compilers/kickass/adapters/out/gradle/src/main/kotlin/com/github/c64lib/rbt/compilers/kickass/adapters/out/gradle/DeleteFilesAdapter.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.compilers.kickass.adapters.out.gradle 26 | 27 | import com.github.c64lib.rbt.compilers.kickass.usecase.port.DeleteFilesPort 28 | import org.gradle.api.Project 29 | 30 | class DeleteFilesAdapter(private val project: Project) : DeleteFilesPort { 31 | 32 | override fun deleteFiles(pattern: String) = 33 | project.fileTree(".").matching { it.include("**/$pattern") }.forEach { project.delete(it) } 34 | } 35 | -------------------------------------------------------------------------------- /compilers/kickass/adapters/out/gradle/src/main/kotlin/com/github/c64lib/rbt/compilers/kickass/adapters/out/gradle/ReadVersionAdapter.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.compilers.kickass.adapters.out.gradle 26 | 27 | import com.github.c64lib.rbt.compilers.kickass.usecase.port.ReadVersionPort 28 | import com.github.c64lib.rbt.shared.domain.SemVer 29 | import java.nio.file.Files 30 | import org.gradle.api.Project 31 | 32 | class ReadVersionAdapter(private val project: Project) : ReadVersionPort { 33 | override fun readVersion(file: String): SemVer? = 34 | if (Files.exists(project.file(file).toPath())) { 35 | Files.readString(project.file(file).toPath()).let { 36 | val version = it.trim() 37 | return SemVer.fromStringOrNull(version) 38 | } 39 | } else { 40 | null 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /compilers/kickass/adapters/out/gradle/src/main/kotlin/com/github/c64lib/rbt/compilers/kickass/adapters/out/gradle/functions.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.compilers.kickass.adapters.out.gradle 26 | 27 | import java.io.File 28 | 29 | internal fun prgFile(file: File) = fileWithoutExtension(file) + ".prg" 30 | 31 | private fun fileWithoutExtension(file: File) = 32 | file.canonicalPath.substring(0, file.canonicalPath.lastIndexOf('.')) 33 | -------------------------------------------------------------------------------- /compilers/kickass/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("rbt.domain") 3 | } 4 | 5 | group = "com.github.c64lib.retro-assembler" 6 | 7 | dependencies { 8 | implementation(project(":shared:domain")) 9 | implementation(project(":shared:processor")) 10 | } 11 | -------------------------------------------------------------------------------- /compilers/kickass/src/main/kotlin/com/github/c64lib/rbt/compilers/kickass/domain/KickAssemblerSettings.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.compilers.kickass.domain 26 | 27 | import com.github.c64lib.rbt.shared.domain.SemVer 28 | import java.io.File 29 | 30 | data class KickAssemblerSettings(val pathToExecutable: File, val version: SemVer) 31 | -------------------------------------------------------------------------------- /compilers/kickass/src/main/kotlin/com/github/c64lib/rbt/compilers/kickass/usecase/CleanBuildArtefactsUseCase.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.compilers.kickass.usecase 26 | 27 | import com.github.c64lib.rbt.compilers.kickass.usecase.port.DeleteFilesPort 28 | 29 | class CleanBuildArtefactsUseCase(private val deleteFilesPort: DeleteFilesPort) { 30 | fun apply() = 31 | listOf("*.prg", "*.specOut", "*.dbg", "*.sym", "*.vs").forEach { 32 | deleteFilesPort.deleteFiles(it) 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /compilers/kickass/src/main/kotlin/com/github/c64lib/rbt/compilers/kickass/usecase/KickAssembleSpecUseCase.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.compilers.kickass.usecase 26 | 27 | import com.github.c64lib.rbt.compilers.kickass.usecase.port.KickAssembleSpecPort 28 | import java.io.File 29 | 30 | class KickAssembleSpecUseCase(private val kickAssembleSpecPort: KickAssembleSpecPort) { 31 | fun apply(command: KickAssembleSpecCommand) = 32 | kickAssembleSpecPort.assemble( 33 | command.libDirs, command.defines, command.resultFileName, command.source) 34 | } 35 | 36 | data class KickAssembleSpecCommand( 37 | val libDirs: List, 38 | val defines: List, 39 | val resultFileName: String, 40 | val source: File 41 | ) 42 | -------------------------------------------------------------------------------- /compilers/kickass/src/main/kotlin/com/github/c64lib/rbt/compilers/kickass/usecase/KickAssembleUseCase.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.compilers.kickass.usecase 26 | 27 | import com.github.c64lib.rbt.compilers.kickass.usecase.port.KickAssemblePort 28 | import com.github.c64lib.rbt.shared.domain.OutputFormat 29 | import java.io.File 30 | 31 | class KickAssembleUseCase(private val kickAssemblePort: KickAssemblePort) { 32 | fun apply(command: KickAssembleCommand) = 33 | kickAssemblePort.assemble( 34 | command.libDirs, command.defines, command.values, command.source, command.outputFormat) 35 | } 36 | 37 | data class KickAssembleCommand( 38 | val libDirs: List, 39 | val defines: List, 40 | val values: Map, 41 | val source: File, 42 | val outputFormat: OutputFormat 43 | ) 44 | -------------------------------------------------------------------------------- /compilers/kickass/src/main/kotlin/com/github/c64lib/rbt/compilers/kickass/usecase/port/DeleteFilesPort.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.compilers.kickass.usecase.port 26 | 27 | interface DeleteFilesPort { 28 | fun deleteFiles(pattern: String) 29 | } 30 | -------------------------------------------------------------------------------- /compilers/kickass/src/main/kotlin/com/github/c64lib/rbt/compilers/kickass/usecase/port/DownloadKickAssemblerPort.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.compilers.kickass.usecase.port 26 | 27 | import java.io.File 28 | import java.net.URL 29 | 30 | interface DownloadKickAssemblerPort { 31 | fun download(url: URL, target: String): File 32 | } 33 | -------------------------------------------------------------------------------- /compilers/kickass/src/main/kotlin/com/github/c64lib/rbt/compilers/kickass/usecase/port/KickAssemblePort.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.compilers.kickass.usecase.port 26 | 27 | import com.github.c64lib.rbt.shared.domain.OutputFormat 28 | import java.io.File 29 | 30 | interface KickAssemblePort { 31 | fun assemble( 32 | libDirs: List, 33 | defines: List, 34 | values: Map, 35 | source: File, 36 | outputFormat: OutputFormat 37 | ): Unit 38 | } 39 | -------------------------------------------------------------------------------- /compilers/kickass/src/main/kotlin/com/github/c64lib/rbt/compilers/kickass/usecase/port/KickAssembleSpecPort.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.compilers.kickass.usecase.port 26 | 27 | import java.io.File 28 | 29 | interface KickAssembleSpecPort { 30 | fun assemble(libDirs: List, defines: List, resultFileName: String, source: File) 31 | } 32 | -------------------------------------------------------------------------------- /compilers/kickass/src/main/kotlin/com/github/c64lib/rbt/compilers/kickass/usecase/port/ReadVersionPort.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.compilers.kickass.usecase.port 26 | 27 | import com.github.c64lib.rbt.shared.domain.SemVer 28 | 29 | interface ReadVersionPort { 30 | fun readVersion(file: String): SemVer? 31 | } 32 | -------------------------------------------------------------------------------- /compilers/kickass/src/main/kotlin/com/github/c64lib/rbt/compilers/kickass/usecase/port/SaveVersionPort.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.compilers.kickass.usecase.port 26 | 27 | import com.github.c64lib.rbt.shared.domain.SemVer 28 | 29 | interface SaveVersionPort { 30 | fun saveVersion(file: String, version: SemVer) 31 | } 32 | -------------------------------------------------------------------------------- /compilers/kickass/src/test/kotlin/com/github/c64lib/rbt/compilers/kickass/usecase/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c64lib/gradle-retro-assembler-plugin/2d0af982d2adc0c4a0fb864382720ee177f8899d/compilers/kickass/src/test/kotlin/com/github/c64lib/rbt/compilers/kickass/usecase/.gitkeep -------------------------------------------------------------------------------- /dependencies/adapters/in/gradle/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("rbt.adapter.inbound.gradle") 3 | } 4 | 5 | group = "com.github.c64lib.retro-assembler.dependencies.in" 6 | 7 | dependencies { 8 | implementation(project(":shared:domain")) 9 | implementation(project(":shared:gradle")) 10 | implementation(project(":dependencies")) 11 | } 12 | -------------------------------------------------------------------------------- /dependencies/adapters/out/gradle/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("rbt.adapter.outbound.gradle") 3 | } 4 | 5 | group = "com.github.c64lib.retro-assembler.dependencies.out" 6 | 7 | dependencies { 8 | implementation(project(":dependencies")) 9 | implementation(project(":shared:domain")) 10 | implementation(project(":shared:filedownload")) 11 | implementation(project(":shared:gradle")) 12 | } 13 | -------------------------------------------------------------------------------- /dependencies/adapters/out/gradle/src/main/kotlin/com/github/c64lib/rbt/dependencies/adapters/out/gradle/ReadDependencyVersionAdapter.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.dependencies.adapters.out.gradle 26 | 27 | import com.github.c64lib.rbt.dependencies.usecase.port.ReadDependencyVersionPort 28 | import java.nio.file.Files 29 | import org.gradle.api.Project 30 | 31 | class ReadDependencyVersionAdapter(private val project: Project) : ReadDependencyVersionPort { 32 | override fun readVersion(file: String): String? = 33 | if (Files.exists(project.file(file).toPath())) { 34 | Files.readString(project.file(file).toPath()) 35 | } else { 36 | null 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /dependencies/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("rbt.domain") 3 | } 4 | 5 | group = "com.github.c64lib.retro-assembler" 6 | 7 | dependencies { 8 | implementation(project(":shared:domain")) 9 | } 10 | -------------------------------------------------------------------------------- /dependencies/src/main/kotlin/com/github/c64lib/rbt/dependencies/usecase/port/DownloadDependencyPort.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.dependencies.usecase.port 26 | 27 | import java.io.File 28 | import java.net.URL 29 | 30 | interface DownloadDependencyPort { 31 | fun download(url: URL, dependencyName: String): File 32 | } 33 | -------------------------------------------------------------------------------- /dependencies/src/main/kotlin/com/github/c64lib/rbt/dependencies/usecase/port/ReadDependencyVersionPort.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.dependencies.usecase.port 26 | 27 | interface ReadDependencyVersionPort { 28 | fun readVersion(file: String): String? 29 | } 30 | -------------------------------------------------------------------------------- /dependencies/src/main/kotlin/com/github/c64lib/rbt/dependencies/usecase/port/SaveDependencyVersionPort.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.dependencies.usecase.port 26 | 27 | interface SaveDependencyVersionPort { 28 | fun saveVersion(file: String, version: String) 29 | } 30 | -------------------------------------------------------------------------------- /dependencies/src/main/kotlin/com/github/c64lib/rbt/dependencies/usecase/port/UntarDependencyPort.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.dependencies.usecase.port 26 | 27 | import java.io.File 28 | 29 | interface UntarDependencyPort { 30 | fun untar(source: File) 31 | } 32 | -------------------------------------------------------------------------------- /doc/Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | gem 'asciidoctor', '~> 2.0', '>= 2.0.12' 3 | gem 'asciidoctor-diagram' 4 | gem 'asciidoctor-kroki' 5 | -------------------------------------------------------------------------------- /doc/Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://rubygems.org/ 3 | specs: 4 | asciidoctor (2.0.14) 5 | asciidoctor-diagram (2.1.0) 6 | asciidoctor (>= 1.5.7, < 3.x) 7 | asciidoctor-diagram-ditaamini (~> 0.13) 8 | asciidoctor-diagram-plantuml (~> 1.2021) 9 | rexml 10 | asciidoctor-diagram-ditaamini (0.13.1) 11 | asciidoctor-diagram-plantuml (1.2021.0) 12 | asciidoctor-kroki (0.4.0) 13 | asciidoctor (~> 2.0) 14 | rexml (3.2.5) 15 | 16 | PLATFORMS 17 | x64-mingw32 18 | x86_64-linux 19 | 20 | DEPENDENCIES 21 | asciidoctor (~> 2.0, >= 2.0.12) 22 | asciidoctor-diagram 23 | asciidoctor-kroki 24 | 25 | BUNDLED WITH 26 | 2.1.4 27 | -------------------------------------------------------------------------------- /doc/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("org.asciidoctor.jvm.convert") version "3.3.2" 3 | } 4 | 5 | tasks { 6 | "asciidoctor"(org.asciidoctor.gradle.jvm.AsciidoctorTask::class) { 7 | sourceDir(".") 8 | baseDirIsProjectDir() 9 | resources(delegateClosureOf { 10 | from("img") { 11 | include("**/*.jpeg") 12 | include("**/*.png") 13 | include("**/*.svg") 14 | into("img") 15 | } 16 | from("concept/img") { 17 | include("**/*.jpeg") 18 | include("**/*.png") 19 | include("**/*.svg") 20 | into("concept/img") 21 | } 22 | }) 23 | } 24 | } 25 | 26 | asciidoctorj { 27 | modules { 28 | diagram.use() 29 | diagram.setVersion("1.5.16") 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /doc/clean.css: -------------------------------------------------------------------------------- 1 | /* Asciidoctor default stylesheet | MIT License | https://asciidoctor.org */ 2 | 3 | @import url("//fonts.googleapis.com/css?family=Noto+Sans:300,600italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400,700"); 4 | @import url(https://cdn.jsdelivr.net/gh/asciidoctor/asciidoctor@2.0/data/stylesheets/asciidoctor-default.css); /* Default asciidoc style framework - important */ 5 | 6 | /* CUSTOMISATIONS */ 7 | /* Change the values in root for quick customisation. If you want even more fine grain... venture further. */ 8 | 9 | :root{ 10 | --maincolor:#FFFFFF; 11 | --primarycolor:#2c3e50; 12 | --secondarycolor:#ba3925; 13 | --tertiarycolor: #186d7a; 14 | --sidebarbackground:#CCC; 15 | --linkcolor:#b71c1c; 16 | --linkcoloralternate:#f44336; 17 | --white:#FFFFFF; 18 | --black:#000000; 19 | } 20 | 21 | /* Text styles */ 22 | h1{color:var(--primarycolor) !important;} 23 | h2,h3,h4,h5,h6{color:var(--secondarycolor) !important;} 24 | .title{color:var(--tertiarycolor) !important; font-family:"Noto Sans",sans-serif !important;font-style: normal !important; font-weight: normal !important;} 25 | p{font-family: "Noto Sans",sans-serif !important} 26 | 27 | /* Table styles */ 28 | th{font-family: "Noto Sans",sans-serif !important} 29 | 30 | /* Responsiveness fixes */ 31 | video { 32 | max-width: 100%; 33 | } 34 | 35 | @media all and (max-width: 600px) { 36 | table { 37 | width: 55vw!important; 38 | font-size: 3vw; 39 | } 40 | -------------------------------------------------------------------------------- /doc/concept/_02_overview.adoc: -------------------------------------------------------------------------------- 1 | = Overview 2 | 3 | == Retro assembler project model 4 | 5 | The source model of any retro assembler (MOS 6502 based) project is very simplified. 6 | There is no interim form of compilation process and there is no linker. 7 | The only means to reuse shared code is to use import directive therefore for the project it is sufficient to know all entry point files and assembly them one by one into executables (i.e. PRG files). 8 | All internal dependencies are specified within source files. 9 | All external dependencies must be handled externally (via retro assembler build tool). 10 | 11 | image:img/domain-asm-project-model.svg[] 12 | 13 | There are other kind of files kept in the project: 14 | 15 | * data files of Charpad or similar software for developing tiled-based backgrounds, 16 | * data files of Spritepad or similar software for developing sprites, 17 | * source files of GoatTracker for SID music sources, 18 | * plain images in any format to be displayed. 19 | 20 | All these files should be kept in source form and then convert via processors to embeddable form (i.e. binary). 21 | It should be possible to compress binary form if needed, i.e. via Exomizer. 22 | 23 | image:img/domain-processors.svg[] 24 | 25 | -------------------------------------------------------------------------------- /doc/concept/_03_processes.adoc: -------------------------------------------------------------------------------- 1 | = Processes 2 | 3 | == Simple assembling process 4 | 5 | In its simplest form we take a single `asm` file (an entry file) and compile it with Assembler (i.e. with KickAssembler) to get an output file (in this case this is an executable `prg` file). 6 | There can be plenty of additional files that are included implicitly to the entry file via `import` directive. 7 | For these "includes" files no separate output files are generated. 8 | 9 | image::img/process-simple-assembling.svg[] 10 | 11 | 12 | == Resolving external dependencies 13 | 14 | Include files can be delivered as external dependencies. 15 | In this case these dependencies must be resolved before assembling. 16 | Resolving usually means: downloading them into some volatile place to enable contained `asm` files to be included by project sources. 17 | 18 | image::img/process-assembling-deps.svg[] 19 | 20 | 21 | == Converting resource files into assembly 22 | 23 | Third party software can be used to produce meaningful resources such as graphical or musical data. 24 | These resources require further processing in order to be embedded into the assembly program. 25 | Dedicated processors can be used to accomplish this conversion task. 26 | These processors produce `asm` files that can be included into the main program. 27 | Alternatively, processors can produce binary data that can also be embedded into assembly as data blocks. 28 | 29 | image::img/process-converter.svg[] 30 | -------------------------------------------------------------------------------- /doc/concept/_04_requirements.adoc: -------------------------------------------------------------------------------- 1 | = Requirements 2 | 3 | == Portability 4 | 5 | The Build Tool should basically run everywhere where Java runs. 6 | 7 | == Resource processors 8 | 9 | These processors are intended for pre-assembling usage. 10 | 11 | === Charpad converter 12 | 13 | Converts Charpad source file into the following outcomes: 14 | 15 | * charset file, 16 | * block definition, 17 | * map definition. 18 | 19 | Any of the outcome is optional. 20 | Any of the outcome can be either and assembly file or binary file. 21 | Each of the outcome can result in more than one file (i.e. big map can be divided into few smaller maps using coordinates). 22 | 23 | === Spritepad converter 24 | 25 | === GoatTracker converter 26 | 27 | === PNG converter 28 | 29 | == Generic processors 30 | 31 | These processors can be used at any stage of building. 32 | 33 | === Cruncher/packer 34 | 35 | == Postprocessors 36 | 37 | These processors are intended for post-assembling usage. 38 | 39 | === 1541 disk maker 40 | 41 | Produces one or more 1541 disk images with: 42 | 43 | * given directory structure, 44 | * converted binary files, 45 | * assembled binary files, 46 | * source binary files. 47 | 48 | === TAP maker 49 | 50 | Produces a TAP file with blocks originated from: 51 | 52 | * converted binary files, 53 | * assembled binary files, 54 | * source binary files. 55 | -------------------------------------------------------------------------------- /doc/concept/_10_architecture.adoc: -------------------------------------------------------------------------------- 1 | = Architecture 2 | 3 | This tool is following a hexagonal architecture principle that is depicted on the following picture. 4 | 5 | image::img/overall-hexagon.svg[] 6 | -------------------------------------------------------------------------------- /doc/concept/clean.css: -------------------------------------------------------------------------------- 1 | /* Asciidoctor default stylesheet | MIT License | https://asciidoctor.org */ 2 | 3 | @import url("//fonts.googleapis.com/css?family=Noto+Sans:300,600italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400,700"); 4 | @import url(https://cdn.jsdelivr.net/gh/asciidoctor/asciidoctor@2.0/data/stylesheets/asciidoctor-default.css); /* Default asciidoc style framework - important */ 5 | 6 | /* CUSTOMISATIONS */ 7 | /* Change the values in root for quick customisation. If you want even more fine grain... venture further. */ 8 | 9 | :root{ 10 | --maincolor:#FFFFFF; 11 | --primarycolor:#2c3e50; 12 | --secondarycolor:#ba3925; 13 | --tertiarycolor: #186d7a; 14 | --sidebarbackground:#CCC; 15 | --linkcolor:#b71c1c; 16 | --linkcoloralternate:#f44336; 17 | --white:#FFFFFF; 18 | --black:#000000; 19 | } 20 | 21 | /* Text styles */ 22 | h1{color:var(--primarycolor) !important;} 23 | h2,h3,h4,h5,h6{color:var(--secondarycolor) !important;} 24 | .title{color:var(--tertiarycolor) !important; font-family:"Noto Sans",sans-serif !important;font-style: normal !important; font-weight: normal !important;} 25 | p{font-family: "Noto Sans",sans-serif !important} 26 | 27 | /* Table styles */ 28 | th{font-family: "Noto Sans",sans-serif !important} 29 | 30 | /* Responsiveness fixes */ 31 | video { 32 | max-width: 100%; 33 | } 34 | 35 | @media all and (max-width: 600px) { 36 | table { 37 | width: 55vw!important; 38 | font-size: 3vw; 39 | } 40 | -------------------------------------------------------------------------------- /doc/concept/index.adoc: -------------------------------------------------------------------------------- 1 | = Retro Assembler build tools 2 | :icons: font 3 | :toc: left 4 | :sectnums: 5 | :stylesheet: clean.css 6 | :source-highlighter: highlight.js 7 | :highlightjs-languages: assembly 8 | :includedir: concept/ 9 | 10 | WARNING: This document is under development! 11 | 12 | This is initial concept paper of Retro Build Tool - an automation device to build various 8-bit targeted assembly projects. 13 | 14 | include::{includedir}_02_overview.adoc[leveloffset=+1] 15 | 16 | include::{includedir}_03_processes.adoc[leveloffset=+1] 17 | 18 | include::{includedir}_04_requirements.adoc[leveloffset=+1] 19 | 20 | include::{includedir}_10_architecture.adoc[leveloffset=+1] 21 | -------------------------------------------------------------------------------- /doc/img/ci-flow.excalidraw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c64lib/gradle-retro-assembler-plugin/2d0af982d2adc0c4a0fb864382720ee177f8899d/doc/img/ci-flow.excalidraw.png -------------------------------------------------------------------------------- /doc/img/native-deps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c64lib/gradle-retro-assembler-plugin/2d0af982d2adc0c4a0fb864382720ee177f8899d/doc/img/native-deps.png -------------------------------------------------------------------------------- /doc/img/pipelines.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c64lib/gradle-retro-assembler-plugin/2d0af982d2adc0c4a0fb864382720ee177f8899d/doc/img/pipelines.png -------------------------------------------------------------------------------- /doc/img/retro-tool-overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c64lib/gradle-retro-assembler-plugin/2d0af982d2adc0c4a0fb864382720ee177f8899d/doc/img/retro-tool-overview.png -------------------------------------------------------------------------------- /doc/index-docinfo-footer.html: -------------------------------------------------------------------------------- 1 | 9 | 19 | 27 | -------------------------------------------------------------------------------- /doc/index-docinfo.html: -------------------------------------------------------------------------------- 1 | 2 | 13 | 29 | -------------------------------------------------------------------------------- /emulators/vice/adapters/out/gradle/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("rbt.adapter.outbound.gradle") 3 | } 4 | 5 | group = "com.github.c64lib.retro-assembler.emulators.vice" 6 | 7 | dependencies { 8 | implementation(project(":emulators:vice")) 9 | implementation(project(":shared:domain")) 10 | implementation(project(":shared:gradle")) 11 | } 12 | -------------------------------------------------------------------------------- /emulators/vice/adapters/out/gradle/src/test/kotlin/com/github/c64lib/rbt/emulators/vice/adapters/out/gradle/CommandLineBuilderTest.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.emulators.vice.adapters.out.gradle 26 | 27 | import org.junit.jupiter.api.Assertions.* 28 | 29 | class CommandLineBuilderTest {} 30 | -------------------------------------------------------------------------------- /emulators/vice/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("rbt.domain") 3 | } 4 | 5 | group = "com.github.c64lib.retro-assembler" 6 | 7 | dependencies { 8 | implementation(project(":shared:domain")) 9 | } 10 | -------------------------------------------------------------------------------- /emulators/vice/src/main/kotlin/com/github/c64lib/rbt/emulators/vice/domain/JamAction.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.emulators.vice.domain 26 | 27 | enum class JamAction(val code: Int) { 28 | SHOW_DIALOG(0), 29 | CONTINUE(1), 30 | START_MON(2), 31 | SOFT_RESET(3), 32 | HARD_RESET(4), 33 | QUIT(5), 34 | NONE(-1) 35 | } 36 | -------------------------------------------------------------------------------- /emulators/vice/src/main/kotlin/com/github/c64lib/rbt/emulators/vice/domain/ViceException.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.emulators.vice.domain 26 | 27 | class ViceException(msg: String) : RuntimeException(msg) 28 | -------------------------------------------------------------------------------- /emulators/vice/src/main/kotlin/com/github/c64lib/rbt/emulators/vice/usecase/QueryForViceVersionUseCase.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.emulators.vice.usecase 26 | 27 | import com.github.c64lib.rbt.emulators.vice.usecase.port.QueryForViceVersionPort 28 | import com.github.c64lib.rbt.shared.domain.SemVer 29 | 30 | class QueryForViceVersionUseCase(private val queryForViceVersionPort: QueryForViceVersionPort) { 31 | fun queryForVersion(executable: String = defaultExecutable): SemVer = 32 | queryForViceVersionPort.queryForVersion(executable) 33 | } 34 | -------------------------------------------------------------------------------- /emulators/vice/src/main/kotlin/com/github/c64lib/rbt/emulators/vice/usecase/RunTestOnViceUseCase.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.emulators.vice.usecase 26 | 27 | import com.github.c64lib.rbt.emulators.vice.usecase.port.RunTestOnVicePort 28 | import com.github.c64lib.rbt.emulators.vice.usecase.port.ViceParameters 29 | import java.io.File 30 | 31 | data class RunTestOnViceCommand(val autostart: File, val monCommands: File) 32 | 33 | class RunTestOnViceUseCase(private val runTestOnVicePort: RunTestOnVicePort) { 34 | fun apply(command: RunTestOnViceCommand) = 35 | runTestOnVicePort.run( 36 | ViceParameters(testToRun = command.autostart, monCommandsFile = command.monCommands)) 37 | } 38 | -------------------------------------------------------------------------------- /emulators/vice/src/main/kotlin/com/github/c64lib/rbt/emulators/vice/usecase/constants.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.emulators.vice.usecase 26 | 27 | val defaultExecutable = "x64sc" 28 | -------------------------------------------------------------------------------- /emulators/vice/src/main/kotlin/com/github/c64lib/rbt/emulators/vice/usecase/port/QueryForViceVersionPort.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.emulators.vice.usecase.port 26 | 27 | import com.github.c64lib.rbt.shared.domain.SemVer 28 | 29 | interface QueryForViceVersionPort { 30 | fun queryForVersion(executable: String): SemVer 31 | } 32 | -------------------------------------------------------------------------------- /emulators/vice/src/main/kotlin/com/github/c64lib/rbt/emulators/vice/usecase/port/RunTestOnVicePort.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.emulators.vice.usecase.port 26 | 27 | interface RunTestOnVicePort { 28 | fun run(parameters: ViceParameters) 29 | } 30 | -------------------------------------------------------------------------------- /emulators/vice/src/main/kotlin/com/github/c64lib/rbt/emulators/vice/usecase/port/ViceParameters.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.emulators.vice.usecase.port 26 | 27 | import java.io.File 28 | 29 | data class ViceParameters(val testToRun: File, val monCommandsFile: File) 30 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | kotlinVersion = 1.7.0 2 | gradleDownloadTaskVersion = 3.4.3 3 | vavrVersion = 1.0.0-alpha-3 4 | vavrKotlinVersion = 0.10.2 5 | kotestVersion = 4.5.0 6 | junitVersion = 5.7.0 7 | pngjVersion = 2.1.0 8 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c64lib/gradle-retro-assembler-plugin/2d0af982d2adc0c4a0fb864382720ee177f8899d/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /infra/gradle/src/main/kotlin/com/github/c64lib/gradle/tasks/Build.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.gradle.tasks 26 | 27 | import com.github.c64lib.rbt.shared.gradle.GROUP_BUILD 28 | import org.gradle.api.DefaultTask 29 | 30 | open class Build : DefaultTask() { 31 | init { 32 | description = "Builds the project" 33 | group = GROUP_BUILD 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /infra/gradle/src/main/kotlin/com/github/c64lib/gradle/tasks/Preprocess.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.gradle.tasks 26 | 27 | import com.github.c64lib.rbt.shared.gradle.GROUP_BUILD 28 | import org.gradle.api.DefaultTask 29 | 30 | abstract class Preprocess : DefaultTask() { 31 | 32 | init { 33 | description = "Runs all preprocessors" 34 | group = GROUP_BUILD 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /processors/charpad/adapters/in/gradle/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("rbt.adapter.inbound.gradle") 3 | } 4 | 5 | group = "com.github.c64lib.retro-assembler.processors.charpad.adapters.in" 6 | 7 | dependencies { 8 | implementation(project(":processors:charpad")) 9 | implementation(project(":shared:domain")) 10 | implementation(project(":shared:gradle")) 11 | implementation(project(":shared:binary-utils")) 12 | implementation(project(":shared:processor")) 13 | implementation(project(":compilers:kickass")) 14 | } 15 | -------------------------------------------------------------------------------- /processors/charpad/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("rbt.domain") 3 | } 4 | 5 | group = "com.github.c64lib.retro-assembler" 6 | 7 | dependencies { 8 | implementation(project(":shared:domain")) 9 | implementation(project(":shared:processor")) 10 | implementation(project(":shared:binary-utils")) 11 | testImplementation(project(":shared:testutils")) 12 | } 13 | -------------------------------------------------------------------------------- /processors/charpad/src/main/kotlin/com/github/c64lib/rbt/processors/charpad/domain/CTMHeader.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.processors.charpad.domain 26 | 27 | data class CTMHeader( 28 | val version: Byte, 29 | val backgroundColour0: Byte, 30 | val backgroundColour1: Byte, 31 | val backgroundColour2: Byte, 32 | val backgroundColour3: Byte, 33 | val charColour: Byte, 34 | val colouringMethod: ColouringMethod, 35 | val screenMode: ScreenMode, 36 | val tileDimensions: Dimensions?, 37 | val mapDimensions: Dimensions 38 | ) { 39 | 40 | val useTiles = tileDimensions != null 41 | } 42 | -------------------------------------------------------------------------------- /processors/charpad/src/main/kotlin/com/github/c64lib/rbt/processors/charpad/domain/CharAttributesProducer.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.processors.charpad.domain 26 | 27 | import com.github.c64lib.rbt.shared.processor.Output 28 | import com.github.c64lib.rbt.shared.processor.ScalableBinaryProducer 29 | 30 | /** 31 | * Produces pre-3.0 style of charset color encoding: material code as hi nybble, color code as lo 32 | * nibble. 33 | */ 34 | class CharAttributesProducer(start: Int = 0, end: Int = 65536, output: Output) : 35 | ScalableBinaryProducer(start = start, end = end, output = output) 36 | -------------------------------------------------------------------------------- /processors/charpad/src/main/kotlin/com/github/c64lib/rbt/processors/charpad/domain/CharColoursProducer.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.processors.charpad.domain 26 | 27 | import com.github.c64lib.rbt.shared.processor.Output 28 | import com.github.c64lib.rbt.shared.processor.ScalableBinaryProducer 29 | 30 | /** 31 | * Produces primary color for characters. In Charpad 3.0 it is always the fourth byte (pen 11), it 32 | * normally goes to color RAM. 33 | */ 34 | class CharColoursProducer(start: Int = 0, end: Int = 65536, output: Output) : 35 | ScalableBinaryProducer(start = start, end = end, output = output) 36 | -------------------------------------------------------------------------------- /processors/charpad/src/main/kotlin/com/github/c64lib/rbt/processors/charpad/domain/CharMaterialsProducer.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.processors.charpad.domain 26 | 27 | import com.github.c64lib.rbt.shared.processor.Output 28 | import com.github.c64lib.rbt.shared.processor.ScalableBinaryProducer 29 | 30 | class CharMaterialsProducer(start: Int = 0, end: Int = 65536, output: Output) : 31 | ScalableBinaryProducer(start = start, end = end, output = output) 32 | -------------------------------------------------------------------------------- /processors/charpad/src/main/kotlin/com/github/c64lib/rbt/processors/charpad/domain/CharScreenColoursProducer.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.processors.charpad.domain 26 | 27 | import com.github.c64lib.rbt.shared.processor.Output 28 | import com.github.c64lib.rbt.shared.processor.ScalableBinaryProducer 29 | 30 | /** 31 | * Produces screen ram colors of bitmap modes. In Charpad 3.0 it is always the second and third byte 32 | * (pen 01 and 10), encoded in single byte using nybbles. 33 | */ 34 | class CharScreenColoursProducer(start: Int = 0, end: Int = 65536, output: Output) : 35 | ScalableBinaryProducer(start = start, end = end, output = output) 36 | -------------------------------------------------------------------------------- /processors/charpad/src/main/kotlin/com/github/c64lib/rbt/processors/charpad/domain/CharsetProducer.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.processors.charpad.domain 26 | 27 | import com.github.c64lib.rbt.shared.processor.Output 28 | import com.github.c64lib.rbt.shared.processor.ScalableBinaryProducer 29 | 30 | class CharsetProducer(start: Int = 0, end: Int = 65536, output: Output) : 31 | ScalableBinaryProducer(start = start, end = end, scale = 8, output) 32 | -------------------------------------------------------------------------------- /processors/charpad/src/main/kotlin/com/github/c64lib/rbt/processors/charpad/domain/ColouringMethod.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.processors.charpad.domain 26 | 27 | enum class ColouringMethod(val value: Byte) { 28 | Global(0), 29 | PerTile(1), 30 | PerChar(2) 31 | } 32 | 33 | internal fun colouringMethodFrom(value: Byte): ColouringMethod = 34 | when (value) { 35 | ColouringMethod.Global.value -> ColouringMethod.Global 36 | ColouringMethod.PerTile.value -> ColouringMethod.PerTile 37 | ColouringMethod.PerChar.value -> ColouringMethod.PerChar 38 | else -> throw InvalidCTMFormatException("Unknown colouring method: $value.") 39 | } 40 | -------------------------------------------------------------------------------- /processors/charpad/src/main/kotlin/com/github/c64lib/rbt/processors/charpad/domain/Dimensions.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.processors.charpad.domain 26 | 27 | data class Dimensions(val width: T, val height: T) 28 | -------------------------------------------------------------------------------- /processors/charpad/src/main/kotlin/com/github/c64lib/rbt/processors/charpad/domain/HeaderProducer.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.processors.charpad.domain 26 | 27 | import com.github.c64lib.rbt.shared.processor.Output 28 | import com.github.c64lib.rbt.shared.processor.OutputProducer 29 | 30 | class HeaderProducer(private val output: Output) : OutputProducer { 31 | override fun write(data: CTMHeader) = output.write(data) 32 | } 33 | -------------------------------------------------------------------------------- /processors/charpad/src/main/kotlin/com/github/c64lib/rbt/processors/charpad/domain/InsufficientDataException.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.processors.charpad.domain 26 | 27 | class InsufficientDataException(message: String) : RuntimeException(message) 28 | -------------------------------------------------------------------------------- /processors/charpad/src/main/kotlin/com/github/c64lib/rbt/processors/charpad/domain/InvalidCTMFormatException.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.processors.charpad.domain 26 | 27 | class InvalidCTMFormatException(msg: String) : RuntimeException(msg) 28 | -------------------------------------------------------------------------------- /processors/charpad/src/main/kotlin/com/github/c64lib/rbt/processors/charpad/domain/MapCoord.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.processors.charpad.domain 26 | 27 | data class MapCoord(val x: Int, val y: Int) 28 | 29 | val minTopLeftMapCoord = MapCoord(0, 0) 30 | 31 | val maxRightBottomMapCoord = MapCoord(65536, 65536) 32 | -------------------------------------------------------------------------------- /processors/charpad/src/main/kotlin/com/github/c64lib/rbt/processors/charpad/domain/ScreenMode.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.processors.charpad.domain 26 | 27 | enum class ScreenMode(val value: Byte) { 28 | TextHires(0), 29 | TextMulticolor(1), 30 | TextExtendedBackground(2), 31 | BitmapHires(3), 32 | BitmapMulticolor(4) 33 | } 34 | 35 | internal fun screenModeFrom(value: Byte): ScreenMode = 36 | when (value) { 37 | ScreenMode.TextHires.value -> ScreenMode.TextHires 38 | ScreenMode.TextMulticolor.value -> ScreenMode.TextMulticolor 39 | ScreenMode.TextExtendedBackground.value -> ScreenMode.TextExtendedBackground 40 | ScreenMode.BitmapHires.value -> ScreenMode.BitmapHires 41 | ScreenMode.BitmapMulticolor.value -> ScreenMode.BitmapMulticolor 42 | else -> throw InvalidCTMFormatException("Unsupported screen mode: $value.") 43 | } 44 | -------------------------------------------------------------------------------- /processors/charpad/src/main/kotlin/com/github/c64lib/rbt/processors/charpad/domain/TileColoursProducer.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.processors.charpad.domain 26 | 27 | import com.github.c64lib.rbt.shared.processor.Output 28 | import com.github.c64lib.rbt.shared.processor.ScalableBinaryProducer 29 | 30 | class TileColoursProducer(start: Int = 0, end: Int = 65536, output: Output) : 31 | ScalableBinaryProducer(start = start, end = end, output = output) 32 | -------------------------------------------------------------------------------- /processors/charpad/src/main/kotlin/com/github/c64lib/rbt/processors/charpad/domain/TileProducer.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.processors.charpad.domain 26 | 27 | import com.github.c64lib.rbt.shared.processor.Output 28 | import com.github.c64lib.rbt.shared.processor.ScalableBinaryProducer 29 | 30 | class TileProducer(start: Int = 0, end: Int = 65536, output: Output) : 31 | ScalableBinaryProducer(start = start, end = end, scale = 2, output = output) 32 | -------------------------------------------------------------------------------- /processors/charpad/src/main/kotlin/com/github/c64lib/rbt/processors/charpad/domain/TileScreenColoursProducer.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.processors.charpad.domain 26 | 27 | import com.github.c64lib.rbt.shared.processor.Output 28 | import com.github.c64lib.rbt.shared.processor.ScalableBinaryProducer 29 | 30 | class TileScreenColoursProducer(start: Int = 0, end: Int = 65536, output: Output) : 31 | ScalableBinaryProducer(start = start, end = end, output = output) 32 | -------------------------------------------------------------------------------- /processors/charpad/src/main/kotlin/com/github/c64lib/rbt/processors/charpad/domain/TileSetDimensions.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.processors.charpad.domain 26 | 27 | data class TileSetDimensions(val numTiles: Int, val width: Byte, val height: Byte) 28 | -------------------------------------------------------------------------------- /processors/charpad/src/main/kotlin/com/github/c64lib/rbt/processors/charpad/domain/TileTagsProducer.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.processors.charpad.domain 26 | 27 | import com.github.c64lib.rbt.shared.processor.Output 28 | import com.github.c64lib.rbt.shared.processor.ScalableBinaryProducer 29 | 30 | class TileTagsProducer(start: Int = 0, end: Int = 65536, output: Output) : 31 | ScalableBinaryProducer(start = start, end = end, output = output) 32 | -------------------------------------------------------------------------------- /processors/charpad/src/test/resources/text-hires/text-hi-per-char-notiles-ctm5.ctm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c64lib/gradle-retro-assembler-plugin/2d0af982d2adc0c4a0fb864382720ee177f8899d/processors/charpad/src/test/resources/text-hires/text-hi-per-char-notiles-ctm5.ctm -------------------------------------------------------------------------------- /processors/charpad/src/test/resources/text-hires/text-hi-per-char-notiles-ctm6.ctm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c64lib/gradle-retro-assembler-plugin/2d0af982d2adc0c4a0fb864382720ee177f8899d/processors/charpad/src/test/resources/text-hires/text-hi-per-char-notiles-ctm6.ctm -------------------------------------------------------------------------------- /processors/charpad/src/test/resources/text-hires/text-hi-per-char-notiles-ctm7.ctm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c64lib/gradle-retro-assembler-plugin/2d0af982d2adc0c4a0fb864382720ee177f8899d/processors/charpad/src/test/resources/text-hires/text-hi-per-char-notiles-ctm7.ctm -------------------------------------------------------------------------------- /processors/charpad/src/test/resources/text-hires/text-hi-per-char-notiles-ctm8-beta.ctm: -------------------------------------------------------------------------------- 1 | CTM  ڰ~BB~$$BB~B@@B~fBBBBfڱ ڲ    ڳ( -------------------------------------------------------------------------------- /processors/charpad/src/test/resources/text-hires/text-hi-per-char-notiles-ctm8.ctm: -------------------------------------------------------------------------------- 1 | CTM ڰ~BB~$$BB~B@@B~fBBBBfڱ ڲڳ( -------------------------------------------------------------------------------- /processors/charpad/src/test/resources/text-hires/text-hi-per-char-notiles-ctm82.ctm: -------------------------------------------------------------------------------- 1 | CTMR ڰ~BB~$$BB~B@@B~fBBBBfڱ ڲڳ( -------------------------------------------------------------------------------- /processors/charpad/src/test/resources/text-hires/text-hi-per-char-tiles-ctm5.ctm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c64lib/gradle-retro-assembler-plugin/2d0af982d2adc0c4a0fb864382720ee177f8899d/processors/charpad/src/test/resources/text-hires/text-hi-per-char-tiles-ctm5.ctm -------------------------------------------------------------------------------- /processors/charpad/src/test/resources/text-hires/text-hi-per-char-tiles-ctm6.ctm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c64lib/gradle-retro-assembler-plugin/2d0af982d2adc0c4a0fb864382720ee177f8899d/processors/charpad/src/test/resources/text-hires/text-hi-per-char-tiles-ctm6.ctm -------------------------------------------------------------------------------- /processors/charpad/src/test/resources/text-hires/text-hi-per-char-tiles-ctm7.ctm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c64lib/gradle-retro-assembler-plugin/2d0af982d2adc0c4a0fb864382720ee177f8899d/processors/charpad/src/test/resources/text-hires/text-hi-per-char-tiles-ctm7.ctm -------------------------------------------------------------------------------- /processors/charpad/src/test/resources/text-hires/text-hi-per-char-tiles-ctm8-beta.ctm: -------------------------------------------------------------------------------- 1 | CTM  ڰ~BB~$$BB~B@@B~fBBBBfڱ ڲ       ڳڴڵUntitledUntitledUntitledڶ  -------------------------------------------------------------------------------- /processors/charpad/src/test/resources/text-hires/text-hi-per-char-tiles-ctm8.ctm: -------------------------------------------------------------------------------- 1 | CTM ڰ~BB~$$BB~B@@B~fBBBBfڱ ڲڳڴڵUntitledUntitledUntitledڶ  -------------------------------------------------------------------------------- /processors/charpad/src/test/resources/text-hires/text-hi-per-char-tiles-ctm82.ctm: -------------------------------------------------------------------------------- 1 | CTMR ڰ~BB~$$BB~B@@B~fBBBBfڱ ڲڳڴڵUntitledUntitledUntitledڶ  -------------------------------------------------------------------------------- /processors/charpad/src/test/resources/text-hires/text-hi-per-tile-ctm5.ctm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c64lib/gradle-retro-assembler-plugin/2d0af982d2adc0c4a0fb864382720ee177f8899d/processors/charpad/src/test/resources/text-hires/text-hi-per-tile-ctm5.ctm -------------------------------------------------------------------------------- /processors/charpad/src/test/resources/text-hires/text-hi-per-tile-ctm6.ctm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c64lib/gradle-retro-assembler-plugin/2d0af982d2adc0c4a0fb864382720ee177f8899d/processors/charpad/src/test/resources/text-hires/text-hi-per-tile-ctm6.ctm -------------------------------------------------------------------------------- /processors/charpad/src/test/resources/text-hires/text-hi-per-tile-ctm7.ctm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c64lib/gradle-retro-assembler-plugin/2d0af982d2adc0c4a0fb864382720ee177f8899d/processors/charpad/src/test/resources/text-hires/text-hi-per-tile-ctm7.ctm -------------------------------------------------------------------------------- /processors/charpad/src/test/resources/text-hires/text-hi-per-tile-ctm8-beta.ctm: -------------------------------------------------------------------------------- 1 | CTM  ڰ~BB~$$BB~B@@B~fBBBBfڱ ڲڳ   ڴڵUntitledUntitledUntitledڶ  -------------------------------------------------------------------------------- /processors/charpad/src/test/resources/text-hires/text-hi-per-tile-ctm8.ctm: -------------------------------------------------------------------------------- 1 | CTM ڰ~BB~$$BB~B@@B~fBBBBfڱ ڲڳڴڵUntitledUntitledUntitledڶ  -------------------------------------------------------------------------------- /processors/charpad/src/test/resources/text-hires/text-hi-per-tile-ctm82.ctm: -------------------------------------------------------------------------------- 1 | CTMR ڰ~BB~$$BB~B@@B~fBBBBfڱ ڲڳڴڵUntitledUntitledUntitledڶ  -------------------------------------------------------------------------------- /processors/charpad/src/test/resources/text-multic/text-mc-per-char-notiles-ctm5.ctm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c64lib/gradle-retro-assembler-plugin/2d0af982d2adc0c4a0fb864382720ee177f8899d/processors/charpad/src/test/resources/text-multic/text-mc-per-char-notiles-ctm5.ctm -------------------------------------------------------------------------------- /processors/charpad/src/test/resources/text-multic/text-mc-per-char-notiles-ctm6.ctm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c64lib/gradle-retro-assembler-plugin/2d0af982d2adc0c4a0fb864382720ee177f8899d/processors/charpad/src/test/resources/text-multic/text-mc-per-char-notiles-ctm6.ctm -------------------------------------------------------------------------------- /processors/charpad/src/test/resources/text-multic/text-mc-per-char-notiles-ctm7.ctm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c64lib/gradle-retro-assembler-plugin/2d0af982d2adc0c4a0fb864382720ee177f8899d/processors/charpad/src/test/resources/text-multic/text-mc-per-char-notiles-ctm7.ctm -------------------------------------------------------------------------------- /processors/charpad/src/test/resources/text-multic/text-mc-per-char-tiles-ctm5.ctm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c64lib/gradle-retro-assembler-plugin/2d0af982d2adc0c4a0fb864382720ee177f8899d/processors/charpad/src/test/resources/text-multic/text-mc-per-char-tiles-ctm5.ctm -------------------------------------------------------------------------------- /processors/charpad/src/test/resources/text-multic/text-mc-per-char-tiles-ctm6.ctm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c64lib/gradle-retro-assembler-plugin/2d0af982d2adc0c4a0fb864382720ee177f8899d/processors/charpad/src/test/resources/text-multic/text-mc-per-char-tiles-ctm6.ctm -------------------------------------------------------------------------------- /processors/charpad/src/test/resources/text-multic/text-mc-per-char-tiles-ctm7.ctm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c64lib/gradle-retro-assembler-plugin/2d0af982d2adc0c4a0fb864382720ee177f8899d/processors/charpad/src/test/resources/text-multic/text-mc-per-char-tiles-ctm7.ctm -------------------------------------------------------------------------------- /processors/charpad/src/test/resources/text-multic/text-mc-per-char-tiles-ctm8.ctm: -------------------------------------------------------------------------------- 1 | CTM   ڰ~BB~(~~~~~~~~~~~~(ڱ ڲ    2 |  ڳڴڵUntitledUntitledUntitledڶ  -------------------------------------------------------------------------------- /processors/charpad/src/test/resources/text-multic/text-mc-per-tile-ctm5.ctm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c64lib/gradle-retro-assembler-plugin/2d0af982d2adc0c4a0fb864382720ee177f8899d/processors/charpad/src/test/resources/text-multic/text-mc-per-tile-ctm5.ctm -------------------------------------------------------------------------------- /processors/charpad/src/test/resources/text-multic/text-mc-per-tile-ctm6.ctm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c64lib/gradle-retro-assembler-plugin/2d0af982d2adc0c4a0fb864382720ee177f8899d/processors/charpad/src/test/resources/text-multic/text-mc-per-tile-ctm6.ctm -------------------------------------------------------------------------------- /processors/charpad/src/test/resources/text-multic/text-mc-per-tile-ctm7.ctm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c64lib/gradle-retro-assembler-plugin/2d0af982d2adc0c4a0fb864382720ee177f8899d/processors/charpad/src/test/resources/text-multic/text-mc-per-tile-ctm7.ctm -------------------------------------------------------------------------------- /processors/charpad/src/test/resources/text-multic/text-mc-per-tile-ctm8.ctm: -------------------------------------------------------------------------------- 1 | CTM   ڰ~BB~(~~~~~~~~~~~~(ڱ ڲڳ   2 |  ڴڵUntitledUntitledUntitledڶ  -------------------------------------------------------------------------------- /processors/goattracker/adapters/in/gradle/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { id("rbt.adapter.inbound.gradle") } 2 | 3 | group = "com.github.c64lib.retro-assembler.processors.goattracker.in" 4 | 5 | dependencies { 6 | implementation(project(":processors:goattracker")) 7 | implementation(project(":shared:gradle")) 8 | } 9 | -------------------------------------------------------------------------------- /processors/goattracker/adapters/out/gradle/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { id("rbt.adapter.outbound.gradle") } 2 | 3 | group = "com.github.c64lib.retro-assembler.processors.goattracker.out" 4 | 5 | dependencies { 6 | implementation(project(":processors:goattracker")) 7 | implementation(project(":shared:gradle")) 8 | } 9 | -------------------------------------------------------------------------------- /processors/goattracker/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("rbt.domain") 3 | } 4 | 5 | group = "com.github.c64lib.retro-assembler" 6 | -------------------------------------------------------------------------------- /processors/goattracker/src/main/kotlin/com/github/c64lib/rbt/processors/goattracker/usecase/port/ExecuteGt2RelocPort.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.processors.goattracker.usecase.port 26 | 27 | import com.github.c64lib.rbt.processors.goattracker.usecase.PackSongCommand 28 | 29 | interface ExecuteGt2RelocPort { 30 | fun execute(packSongCommand: PackSongCommand) 31 | } 32 | -------------------------------------------------------------------------------- /processors/image/adapters/in/gradle/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("rbt.adapter.inbound.gradle") 3 | } 4 | 5 | group = "com.github.c64lib.retro-assembler.processors.image.adapters.in" 6 | 7 | dependencies { 8 | implementation(project(":processors:image")) 9 | implementation(project(":shared:domain")) 10 | implementation(project(":shared:gradle")) 11 | implementation(project(":shared:binary-utils")) 12 | implementation(project(":shared:processor")) 13 | implementation(project(":shared:domain")) 14 | } 15 | -------------------------------------------------------------------------------- /processors/image/adapters/out/file/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("rbt.adapter.outbound.gradle") 3 | } 4 | 5 | group = "com.github.c64lib.retro-assembler.processors.image" 6 | 7 | dependencies { 8 | implementation(project(":processors:image")) 9 | implementation(project(":shared:domain")) 10 | implementation(project(":shared:gradle")) 11 | } 12 | -------------------------------------------------------------------------------- /processors/image/adapters/out/file/src/main/kotlin/com/github/c64lib/rbt/processors/image/adapters/out/file/WriterUtils.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | import java.io.File 26 | import org.gradle.api.Project 27 | 28 | internal fun normalize(project: Project, output: File?, outputToBuildDir: Boolean): File? = 29 | if (output != null && outputToBuildDir) { 30 | // TODO refactor! 31 | 32 | val outputRelativePath = 33 | project.layout.projectDirectory.asFile.toPath().relativize(output.toPath()) 34 | val resultPath = 35 | project.layout.buildDirectory 36 | .dir(project.buildDir.absolutePath) 37 | .get() 38 | .asFile 39 | .toPath() 40 | .resolve(outputRelativePath) 41 | resultPath.parent?.toFile()?.mkdirs() 42 | resultPath.toFile() 43 | } else { 44 | output 45 | } 46 | -------------------------------------------------------------------------------- /processors/image/adapters/out/png/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("rbt.kotlin") 3 | } 4 | 5 | val pngjVersion: String by project 6 | 7 | group = "com.github.c64lib.retro-assembler.processors.image" 8 | 9 | dependencies { 10 | implementation(project(":processors:image")) 11 | implementation(project(":shared:domain")) 12 | implementation("ar.com.hjg:pngj:$pngjVersion") 13 | } 14 | -------------------------------------------------------------------------------- /processors/image/adapters/out/png/src/test/resources/test-png-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c64lib/gradle-retro-assembler-plugin/2d0af982d2adc0c4a0fb864382720ee177f8899d/processors/image/adapters/out/png/src/test/resources/test-png-2.png -------------------------------------------------------------------------------- /processors/image/adapters/out/png/src/test/resources/test-png.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c64lib/gradle-retro-assembler-plugin/2d0af982d2adc0c4a0fb864382720ee177f8899d/processors/image/adapters/out/png/src/test/resources/test-png.png -------------------------------------------------------------------------------- /processors/image/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("rbt.domain") 3 | } 4 | 5 | group = "com.github.c64lib.retro-assembler" 6 | 7 | dependencies { 8 | implementation(project(":shared:domain")) 9 | } 10 | -------------------------------------------------------------------------------- /processors/image/src/main/kotlin/com/github/c64lib/rbt/processors/image/usecase/CutImageUseCase.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.processors.image.usecase 26 | 27 | import com.github.c64lib.rbt.processors.image.domain.Image 28 | 29 | data class CutImageCommand( 30 | val image: Image, 31 | val left: Int, 32 | val top: Int, 33 | val width: Int, 34 | val height: Int 35 | ) 36 | 37 | class CutImageUseCase { 38 | fun apply(command: CutImageCommand): Image = 39 | command.image.subImage(command.top, command.left, command.width, command.height) 40 | } 41 | -------------------------------------------------------------------------------- /processors/image/src/main/kotlin/com/github/c64lib/rbt/processors/image/usecase/ExtendImageUseCase.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.processors.image.usecase 26 | 27 | import com.github.c64lib.rbt.processors.image.domain.Image 28 | import com.github.c64lib.rbt.shared.domain.Color 29 | 30 | data class ExtendImageCommand( 31 | val image: Image, 32 | val newWidth: Int, 33 | val newHeight: Int, 34 | val fillColor: Color = Color(0, 0, 0, 0) 35 | ) 36 | 37 | class ExtendImageUseCase { 38 | fun apply(command: ExtendImageCommand): Image = 39 | command.image.extend(command.newWidth, command.newHeight, command.fillColor) 40 | } 41 | -------------------------------------------------------------------------------- /processors/image/src/main/kotlin/com/github/c64lib/rbt/processors/image/usecase/ReadSourceImageUseCase.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.processors.image.usecase 26 | 27 | import com.github.c64lib.rbt.processors.image.domain.Image 28 | import com.github.c64lib.rbt.processors.image.usecase.port.ReadImagePort 29 | import java.io.File 30 | 31 | data class ReadSourceImageCommand(val file: File) 32 | 33 | class ReadSourceImageUseCase(private val readImagePort: ReadImagePort) { 34 | fun apply(command: ReadSourceImageCommand): Image = readImagePort.read(command.file) 35 | } 36 | -------------------------------------------------------------------------------- /processors/image/src/main/kotlin/com/github/c64lib/rbt/processors/image/usecase/port/ReadImagePort.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.processors.image.usecase.port 26 | 27 | import com.github.c64lib.rbt.processors.image.domain.Image 28 | import java.io.File 29 | 30 | interface ReadImagePort { 31 | fun read(file: File): Image 32 | } 33 | -------------------------------------------------------------------------------- /processors/image/src/main/kotlin/com/github/c64lib/rbt/processors/image/usecase/port/WriteCharsetPort.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.processors.image.usecase.port 26 | 27 | import com.github.c64lib.rbt.processors.image.domain.Image 28 | import java.io.File 29 | 30 | interface WriteCharsetPort { 31 | fun write(image: Image, toFile: File, useBuildDir: Boolean) 32 | } 33 | -------------------------------------------------------------------------------- /processors/image/src/main/kotlin/com/github/c64lib/rbt/processors/image/usecase/port/WriteSpritePort.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.processors.image.usecase.port 26 | 27 | import com.github.c64lib.rbt.processors.image.domain.Image 28 | import java.io.File 29 | 30 | interface WriteSpritePort { 31 | fun write(image: Image, toFile: File, useBuildDir: Boolean) 32 | } 33 | -------------------------------------------------------------------------------- /processors/spritepad/adapters/in/gradle/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("rbt.adapter.inbound.gradle") 3 | } 4 | 5 | group = "com.github.c64lib.retro-assembler.processors.spritepad.in" 6 | 7 | dependencies { 8 | implementation(project(":processors:spritepad")) 9 | implementation(project(":shared:gradle")) 10 | implementation(project(":shared:binary-utils")) 11 | implementation(project(":shared:processor")) 12 | } 13 | -------------------------------------------------------------------------------- /processors/spritepad/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("rbt.domain") 3 | } 4 | 5 | group = "com.github.c64lib.retro-assembler" 6 | 7 | dependencies { 8 | implementation(project(":shared:domain")) 9 | implementation(project(":shared:processor")) 10 | implementation(project(":shared:binary-utils")) 11 | } 12 | -------------------------------------------------------------------------------- /processors/spritepad/src/main/kotlin/com/c64lib/rbt/processors/spritepad/domain/InvalidSPDFormatException.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.c64lib.rbt.processors.spritepad.domain 26 | 27 | class InvalidSPDFormatException(msg: String) : RuntimeException(msg) 28 | -------------------------------------------------------------------------------- /settings.gradle.kts: -------------------------------------------------------------------------------- 1 | rootProject.name = "retro-assembler" 2 | 3 | include(":infra:gradle") 4 | 5 | include(":shared:domain") 6 | include(":shared:filedownload") 7 | include(":shared:gradle") 8 | include(":shared:binary-utils") 9 | include(":shared:processor") 10 | include(":shared:testutils") 11 | 12 | include(":compilers:kickass") 13 | include(":compilers:kickass:adapters:in:gradle") 14 | include(":compilers:kickass:adapters:out:gradle") 15 | include(":compilers:kickass:adapters:out:filedownload") 16 | 17 | include(":emulators:vice") 18 | include(":emulators:vice:adapters:out:gradle") 19 | 20 | include(":testing:64spec") 21 | include(":testing:64spec:adapters:in:gradle") 22 | 23 | include(":dependencies") 24 | include(":dependencies:adapters:in:gradle") 25 | include(":dependencies:adapters:out:gradle") 26 | 27 | include(":processors:goattracker") 28 | include(":processors:goattracker:adapters:in:gradle") 29 | include(":processors:goattracker:adapters:out:gradle") 30 | 31 | include(":processors:spritepad") 32 | include(":processors:spritepad:adapters:in:gradle") 33 | 34 | include(":processors:charpad") 35 | include(":processors:charpad:adapters:in:gradle") 36 | 37 | include(":processors:image") 38 | include(":processors:image:adapters:in:gradle") 39 | include(":processors:image:adapters:out:png") 40 | include(":processors:image:adapters:out:file") 41 | 42 | include(":doc") 43 | -------------------------------------------------------------------------------- /shared/binary-utils/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("rbt.kotlin") 3 | } 4 | 5 | group = "com.github.c64lib.retro-assembler" 6 | 7 | dependencies { 8 | implementation(project(":shared:domain")) 9 | implementation(project(":shared:processor")) 10 | } 11 | -------------------------------------------------------------------------------- /shared/binary-utils/src/main/kotlin/com/github/c64lib/rbt/shared/binutils/ByteArrayExtensions.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.shared.binutils 26 | 27 | fun concatByteArray(arrays: Collection): ByteArray = 28 | arrays.fold(ByteArray(0)) { acc, bytes -> acc + bytes } 29 | 30 | fun byteArrayOfInts(vararg value: Int): ByteArray = value.map { it.toUnsignedByte() }.toByteArray() 31 | 32 | infix fun ByteArray.concat(right: ByteArray): ByteArray = concatByteArray(listOf(this, right)) 33 | -------------------------------------------------------------------------------- /shared/binary-utils/src/main/kotlin/com/github/c64lib/rbt/shared/binutils/ByteExtensions.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.shared.binutils 26 | 27 | fun Byte.toUnsignedInt() = this.toInt() and 0xFF 28 | -------------------------------------------------------------------------------- /shared/binary-utils/src/main/kotlin/com/github/c64lib/rbt/shared/binutils/IntExtensions.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.shared.binutils 26 | 27 | fun Int.toUnsignedByte() = (this and 0xFF).toByte() 28 | 29 | fun Int.toUnsignedByteHi() = ((this and 0xFF00) shr 8).toByte() 30 | -------------------------------------------------------------------------------- /shared/domain/build.gradle.kts: -------------------------------------------------------------------------------- 1 | val kotlinVersion: String by project 2 | val vavrVersion: String by project 3 | val vavrKotlinVersion: String by project 4 | val tagPropertyName = "tag" 5 | 6 | plugins { 7 | id("rbt.kotlin") 8 | } 9 | 10 | group = "com.github.c64lib.retro-assembler.shared" 11 | 12 | dependencies { 13 | implementation("org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion") 14 | } 15 | -------------------------------------------------------------------------------- /shared/domain/src/main/kotlin/com/github/c64lib/rbt/shared/domain/AutostartPrgMode.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.shared.domain 26 | 27 | enum class AutostartPrgMode(val code: Int) { 28 | VIRTUAL_FS(0), 29 | INJECT_TO_RAM(1), 30 | COPY_TO_D64(2), 31 | NONE(-1) 32 | } 33 | -------------------------------------------------------------------------------- /shared/domain/src/main/kotlin/com/github/c64lib/rbt/shared/domain/Axis.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.shared.domain 26 | 27 | enum class Axis { 28 | X, 29 | Y, 30 | BOTH 31 | } 32 | -------------------------------------------------------------------------------- /shared/domain/src/main/kotlin/com/github/c64lib/rbt/shared/domain/Color.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.shared.domain 26 | 27 | data class Color(val red: Int, val green: Int, val blue: Int, val alpha: Int) 28 | -------------------------------------------------------------------------------- /shared/domain/src/main/kotlin/com/github/c64lib/rbt/shared/domain/Dependency.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.shared.domain 26 | 27 | data class Dependency( 28 | val type: DependencyType, 29 | val name: String, 30 | val version: DependencyVersion, 31 | val prefix: String = "" 32 | ) 33 | -------------------------------------------------------------------------------- /shared/domain/src/main/kotlin/com/github/c64lib/rbt/shared/domain/DependencyType.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.shared.domain 26 | 27 | enum class DependencyType { 28 | GitHub 29 | } 30 | -------------------------------------------------------------------------------- /shared/domain/src/main/kotlin/com/github/c64lib/rbt/shared/domain/DependencyVersion.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.shared.domain 26 | 27 | data class DependencyVersion(val version: String) 28 | -------------------------------------------------------------------------------- /shared/domain/src/main/kotlin/com/github/c64lib/rbt/shared/domain/IllegalConfigurationException.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.shared.domain 26 | 27 | /** Error that indicates wrong general configuration of the plugin. */ 28 | class IllegalConfigurationException(msg: String) : RuntimeException(msg) 29 | -------------------------------------------------------------------------------- /shared/domain/src/main/kotlin/com/github/c64lib/rbt/shared/domain/IllegalInputException.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.shared.domain 26 | 27 | /** Error that indicates wrong arrangement of input configuration / parameters. */ 28 | class IllegalInputException(msg: String) : RuntimeException(msg) 29 | -------------------------------------------------------------------------------- /shared/domain/src/main/kotlin/com/github/c64lib/rbt/shared/domain/OutOfDataException.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.shared.domain 26 | 27 | class OutOfDataException(message: String) : RuntimeException(message) 28 | -------------------------------------------------------------------------------- /shared/domain/src/main/kotlin/com/github/c64lib/rbt/shared/domain/OutputFormat.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.shared.domain 26 | 27 | enum class OutputFormat { 28 | PRG, 29 | BIN 30 | } 31 | -------------------------------------------------------------------------------- /shared/domain/src/main/kotlin/com/github/c64lib/retroassembler/domain/AssemblerType.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.retroassembler.domain 26 | 27 | @Deprecated("Will be removed in 2.0.0") 28 | enum class AssemblerType { 29 | KickAssembler, 30 | None 31 | } 32 | -------------------------------------------------------------------------------- /shared/filedownload/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("rbt.kotlin") 3 | } 4 | 5 | group = "com.github.c64lib.retro-assembler.shared" 6 | -------------------------------------------------------------------------------- /shared/filedownload/src/main/kotlin/com/github/c64lib/rbt/shared/filedownload/FileDownloader.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.shared.filedownload 26 | 27 | import java.io.BufferedInputStream 28 | import java.net.URL 29 | import java.nio.file.Files 30 | import java.nio.file.Path 31 | import java.nio.file.StandardCopyOption 32 | 33 | class FileDownloader { 34 | fun download(url: URL, target: Path): Path { 35 | val connection = url.openConnection() 36 | val bufferSize = 4096 37 | connection.getInputStream().use { inputStream -> 38 | Files.createDirectories(target.parent) 39 | Files.copy( 40 | BufferedInputStream(inputStream, bufferSize), target, StandardCopyOption.REPLACE_EXISTING) 41 | } 42 | return target 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /shared/gradle/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("rbt.kotlin") 3 | } 4 | 5 | group = "com.github.c64lib.retro-assembler.shared" 6 | 7 | dependencies { 8 | implementation(gradleApi()) 9 | implementation(project(":shared:domain")) 10 | implementation(project(":shared:processor")) 11 | } 12 | -------------------------------------------------------------------------------- /shared/gradle/src/main/kotlin/com/github/c64lib/rbt/shared/gradle/TaskGroups.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.shared.gradle 26 | 27 | const val GROUP_BUILD = "build" 28 | -------------------------------------------------------------------------------- /shared/gradle/src/main/kotlin/com/github/c64lib/rbt/shared/gradle/Tasks.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.shared.gradle 26 | 27 | // official tasks 28 | const val TASK_BUILD = "build" 29 | 30 | const val TASK_ASM = "asm" 31 | 32 | const val TASK_CLEAN = "clean" 33 | 34 | const val TASK_RESOLVE_DEV_DEPENDENCIES = "resolveDevDeps" 35 | 36 | const val TASK_DEPENDENCIES = "downloadDeps" 37 | 38 | const val TASK_TEST = "test" 39 | 40 | const val TASK_ASM_SPEC = "asmSpec" 41 | 42 | const val TASK_CHARPAD = "charpad" 43 | 44 | const val TASK_SPRITEPAD = "spritepad" 45 | 46 | const val TASK_GOATTRACKER = "goattracker" 47 | 48 | const val TASK_IMAGE = "image" 49 | 50 | const val TASK_PREPROCESS = "preprocess" 51 | -------------------------------------------------------------------------------- /shared/gradle/src/main/kotlin/com/github/c64lib/rbt/shared/gradle/dsl/ImageCutExtension.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.shared.gradle.dsl 26 | 27 | import javax.inject.Inject 28 | import org.gradle.api.model.ObjectFactory 29 | 30 | abstract class ImageCutExtension : ImageTransformationExtension { 31 | 32 | @Inject constructor(objectFactory: ObjectFactory) : super(objectFactory) 33 | 34 | var left: Int = 0 35 | var top: Int = 0 36 | var width: Int? = null 37 | var height: Int? = null 38 | } 39 | -------------------------------------------------------------------------------- /shared/gradle/src/main/kotlin/com/github/c64lib/rbt/shared/gradle/dsl/ImageExtendExtension.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.shared.gradle.dsl 26 | 27 | import com.github.c64lib.rbt.shared.domain.Color 28 | import javax.inject.Inject 29 | import org.gradle.api.model.ObjectFactory 30 | 31 | abstract class ImageExtendExtension : ImageTransformationExtension { 32 | 33 | @Inject constructor(objectFactory: ObjectFactory) : super(objectFactory) 34 | 35 | var newWidth: Int? = null 36 | var newHeight: Int? = null 37 | var fillColor: Color = Color(0, 0, 0, 255) 38 | } 39 | -------------------------------------------------------------------------------- /shared/gradle/src/main/kotlin/com/github/c64lib/rbt/shared/gradle/dsl/ImageFlipExtension.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.shared.gradle.dsl 26 | 27 | import com.github.c64lib.rbt.shared.domain.Axis 28 | import javax.inject.Inject 29 | import org.gradle.api.model.ObjectFactory 30 | 31 | abstract class ImageFlipExtension : ImageTransformationExtension { 32 | 33 | @Inject constructor(objectFactory: ObjectFactory) : super(objectFactory) 34 | 35 | var axis: Axis = Axis.Y 36 | } 37 | -------------------------------------------------------------------------------- /shared/gradle/src/main/kotlin/com/github/c64lib/rbt/shared/gradle/dsl/ImagePipelineExtension.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.shared.gradle.dsl 26 | 27 | import java.io.File 28 | import javax.inject.Inject 29 | import org.gradle.api.model.ObjectFactory 30 | import org.gradle.api.provider.Property 31 | import org.gradle.api.tasks.Input 32 | import org.gradle.api.tasks.InputFiles 33 | 34 | abstract class ImagePipelineExtension : ImageTransformationExtension { 35 | 36 | @Inject constructor(objectFactory: ObjectFactory) : super(objectFactory) 37 | 38 | @InputFiles abstract fun getInput(): Property 39 | 40 | @Input abstract fun getUseBuildDir(): Property 41 | } 42 | -------------------------------------------------------------------------------- /shared/gradle/src/main/kotlin/com/github/c64lib/rbt/shared/gradle/dsl/ImageReduceResolutionExtension.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.shared.gradle.dsl 26 | 27 | import javax.inject.Inject 28 | import org.gradle.api.model.ObjectFactory 29 | 30 | abstract class ImageReduceResolutionExtension : ImageTransformationExtension { 31 | 32 | @Inject constructor(objectFactory: ObjectFactory) : super(objectFactory) 33 | 34 | var reduceX: Int = 1 35 | var reduceY: Int = 1 36 | } 37 | -------------------------------------------------------------------------------- /shared/gradle/src/main/kotlin/com/github/c64lib/rbt/shared/gradle/dsl/ImageSplitExtension.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.shared.gradle.dsl 26 | 27 | import javax.inject.Inject 28 | import org.gradle.api.model.ObjectFactory 29 | 30 | abstract class ImageSplitExtension : ImageTransformationExtension { 31 | @Inject constructor(objectFactory: ObjectFactory) : super(objectFactory) 32 | 33 | var width: Int? = null 34 | var height: Int? = null 35 | } 36 | -------------------------------------------------------------------------------- /shared/gradle/src/main/kotlin/com/github/c64lib/rbt/shared/gradle/dsl/ImageWriterExtension.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.shared.gradle.dsl 26 | 27 | import java.io.File 28 | import javax.inject.Inject 29 | import org.gradle.api.model.ObjectFactory 30 | import org.gradle.api.provider.Property 31 | import org.gradle.api.tasks.OutputFile 32 | 33 | abstract class ImageWriterExtension @Inject constructor(private val objectFactory: ObjectFactory) { 34 | 35 | @OutputFile abstract fun getOutput(): Property 36 | } 37 | -------------------------------------------------------------------------------- /shared/gradle/src/main/kotlin/com/github/c64lib/rbt/shared/gradle/dsl/InterleaverExtension.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.shared.gradle.dsl 26 | 27 | import java.io.File 28 | 29 | open class InterleaverExtension { 30 | 31 | var output: File? = null 32 | } 33 | -------------------------------------------------------------------------------- /shared/gradle/src/main/kotlin/com/github/c64lib/rbt/shared/gradle/dsl/MapExtension.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.shared.gradle.dsl 26 | 27 | import javax.inject.Inject 28 | import org.gradle.api.file.ProjectLayout 29 | 30 | internal const val CHARPAD_DIR = "charpad" 31 | 32 | abstract class MapExtension @Inject constructor(project: ProjectLayout) : 33 | FilterAwareExtension(CHARPAD_DIR, project) { 34 | var left: Int = 0 35 | var top: Int = 0 36 | var right: Int = 65536 37 | var bottom: Int = 65536 38 | } 39 | -------------------------------------------------------------------------------- /shared/gradle/src/main/kotlin/com/github/c64lib/rbt/shared/gradle/dsl/NybblerExtension.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.shared.gradle.dsl 26 | 27 | import java.io.File 28 | 29 | open class NybblerExtension { 30 | var loOutput: File? = null 31 | var hiOutput: File? = null 32 | var normalizeHi: Boolean = true 33 | } 34 | -------------------------------------------------------------------------------- /shared/gradle/src/main/kotlin/com/github/c64lib/rbt/shared/gradle/dsl/SpritesExtension.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.shared.gradle.dsl 26 | 27 | import javax.inject.Inject 28 | import org.gradle.api.file.ProjectLayout 29 | 30 | abstract class SpritesExtension @Inject constructor(project: ProjectLayout) : 31 | FilterAwareExtension("spritepad", project) { 32 | var start: Int = 0 33 | var end: Int = 65536 34 | } 35 | -------------------------------------------------------------------------------- /shared/gradle/src/main/kotlin/com/github/c64lib/rbt/shared/gradle/dsl/SpritesOutputsExtension.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.shared.gradle.dsl 26 | 27 | import java.util.* 28 | import javax.inject.Inject 29 | import org.gradle.api.Action 30 | import org.gradle.api.model.ObjectFactory 31 | 32 | abstract class SpritesOutputsExtension 33 | @Inject 34 | constructor(private val objectFactory: ObjectFactory) { 35 | 36 | val sprites = LinkedList() 37 | 38 | fun sprites(action: Action) { 39 | val ex = objectFactory.newInstance(SpritesExtension::class.java) 40 | action.execute(ex) 41 | sprites.add(ex) 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /shared/gradle/src/main/kotlin/com/github/c64lib/rbt/shared/gradle/dsl/StartEndExtension.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.shared.gradle.dsl 26 | 27 | import javax.inject.Inject 28 | import org.gradle.api.file.ProjectLayout 29 | 30 | abstract class StartEndExtension @Inject constructor(project: ProjectLayout) : 31 | FilterAwareExtension(CHARPAD_DIR, project) { 32 | var start: Int = 0 33 | var end: Int = 65536 34 | } 35 | -------------------------------------------------------------------------------- /shared/gradle/src/main/kotlin/com/github/c64lib/rbt/shared/gradle/extensions.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.shared.gradle 26 | 27 | import org.gradle.api.Project 28 | 29 | fun Project.getStringProperty(name: String): String? { 30 | val propertyValue = this.properties["forceDownload"] 31 | return if (propertyValue is String) { 32 | propertyValue 33 | } else { 34 | null 35 | } 36 | } 37 | 38 | fun Project.getBooleanProperty(name: String): Boolean? = this.getStringProperty(name)?.toBoolean() 39 | -------------------------------------------------------------------------------- /shared/gradle/src/test/kotlin/com/github/c64lib/rbt/shared/gradle/filter/ByteArrayExtensions.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.shared.gradle.filter 26 | 27 | fun concatByteArray(arrays: Collection): ByteArray = 28 | arrays.fold(ByteArray(0)) { acc, bytes -> acc + bytes } 29 | -------------------------------------------------------------------------------- /shared/processor/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("rbt.kotlin") 3 | } 4 | 5 | group = "com.github.c64lib.retro-assembler" 6 | 7 | dependencies { 8 | implementation(project(":shared:domain")) 9 | } 10 | -------------------------------------------------------------------------------- /shared/processor/src/main/kotlin/com/github/c64lib/rbt/shared/processor/BinaryProducer.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.shared.processor 26 | 27 | open class BinaryProducer(private val output: Output) : OutputProducer { 28 | override fun write(data: ByteArray) = output.write(data) 29 | } 30 | -------------------------------------------------------------------------------- /shared/processor/src/main/kotlin/com/github/c64lib/rbt/shared/processor/FisInput.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.shared.processor 26 | 27 | import java.io.FileInputStream 28 | 29 | class FisInput(private val fis: FileInputStream) : InputByteStream { 30 | 31 | private var readCounter = 0 32 | 33 | override fun read(amount: Int): ByteArray { 34 | val result = fis.readNBytes(amount) 35 | readCounter += result.size 36 | return result 37 | } 38 | 39 | override fun readCounter(): Int = readCounter 40 | } 41 | -------------------------------------------------------------------------------- /shared/processor/src/main/kotlin/com/github/c64lib/rbt/shared/processor/InputByteStream.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.shared.processor 26 | 27 | /** Denotes input data that is always a byte stream. */ 28 | interface InputByteStream { 29 | fun read(amount: Int): ByteArray 30 | fun readByte() = read(1)[0] 31 | fun readCounter(): Int 32 | } 33 | -------------------------------------------------------------------------------- /shared/processor/src/main/kotlin/com/github/c64lib/rbt/shared/processor/Output.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.shared.processor 26 | 27 | typealias BinaryOutput = Output 28 | 29 | interface TextOutput : Output { 30 | fun writeLn(data: String) 31 | fun writeLn() = writeLn("") 32 | } 33 | 34 | interface Output { 35 | fun write(data: T) 36 | } 37 | -------------------------------------------------------------------------------- /shared/processor/src/main/kotlin/com/github/c64lib/rbt/shared/processor/OutputProducer.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.shared.processor 26 | 27 | interface OutputProducer { 28 | fun write(data: T) 29 | } 30 | -------------------------------------------------------------------------------- /shared/processor/src/main/kotlin/com/github/c64lib/rbt/shared/processor/Processor.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.shared.processor 26 | 27 | interface Processor { 28 | fun process(inputByteStream: InputByteStream) 29 | } 30 | -------------------------------------------------------------------------------- /shared/testutils/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("rbt.kotlin") 3 | } 4 | 5 | group = "com.github.c64lib.retro-assembler" 6 | 7 | dependencies { 8 | implementation(project(":shared:binary-utils")) 9 | implementation(project(":shared:processor")) 10 | } 11 | -------------------------------------------------------------------------------- /testing/64spec/adapters/in/gradle/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("rbt.adapter.inbound.gradle") 3 | } 4 | 5 | group = "com.github.c64lib.retro-assembler.testing.64spec.in" 6 | 7 | dependencies { 8 | implementation(project(":testing:64spec")) 9 | implementation(project(":shared:gradle")) 10 | } 11 | -------------------------------------------------------------------------------- /testing/64spec/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("rbt.domain") 3 | } 4 | 5 | group = "com.github.c64lib.retro-assembler" 6 | 7 | dependencies { 8 | implementation(project(":emulators:vice")) 9 | } 10 | -------------------------------------------------------------------------------- /testing/64spec/src/main/kotlin/com/github/c64lib/rbt/testing/a64spec/usecase/TestResult.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.testing.a64spec.usecase 26 | 27 | data class TestResult(val successCount: Int = 0, val totalCount: Int = 0, val message: String) 28 | -------------------------------------------------------------------------------- /testing/64spec/src/main/kotlin/com/github/c64lib/rbt/testing/a64spec/usecase/functions.kt: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2018-2023 c64lib: The Ultimate Commodore 64 Library 5 | Copyright (c) 2018-2023 Maciej Małecki 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | package com.github.c64lib.rbt.testing.a64spec.usecase 26 | 27 | import java.io.File 28 | 29 | fun prgFile(file: File) = fileWithoutExtension(file) + ".prg" 30 | 31 | fun resultFile(file: File) = fileWithoutExtension(file) + ".specOut" 32 | 33 | fun viceSymbolFile(file: File) = fileWithoutExtension(file) + ".vs" 34 | 35 | private fun fileWithoutExtension(file: File) = 36 | file.canonicalPath.substring(0, file.canonicalPath.lastIndexOf('.')) 37 | --------------------------------------------------------------------------------