diff --git a/prometeu-compiler/prometeu-build-pipeline/src/main/java/p/studio/compiler/Compile.java b/prometeu-compiler/prometeu-build-pipeline/src/main/java/p/studio/compiler/Compile.java index 5bec8d2c..707f1c58 100644 --- a/prometeu-compiler/prometeu-build-pipeline/src/main/java/p/studio/compiler/Compile.java +++ b/prometeu-compiler/prometeu-build-pipeline/src/main/java/p/studio/compiler/Compile.java @@ -5,9 +5,11 @@ import p.studio.compiler.workspaces.BuilderPipelineService; import p.studio.utilities.logs.LogAggregator; public class Compile { + private static final String PROJECT = "fragments"; + public static void main(String[] args) { final var logAggregator = LogAggregator.stdout(); - final var config = new BuilderPipelineConfig(false, "test-projects/main"); + final var config = new BuilderPipelineConfig(false, "test-projects/%s".formatted(PROJECT)); BuilderPipelineService.INSTANCE.run(config, logAggregator); } } diff --git a/prometeu-packer/prometeu-packer-v1/src/main/java/p/packer/PackMain.java b/prometeu-packer/prometeu-packer-v1/src/main/java/p/packer/PackMain.java index ab7d8bc9..6b6db3dd 100644 --- a/prometeu-packer/prometeu-packer-v1/src/main/java/p/packer/PackMain.java +++ b/prometeu-packer/prometeu-packer-v1/src/main/java/p/packer/PackMain.java @@ -8,12 +8,14 @@ import p.packer.messages.PackerProjectContext; import java.nio.file.Path; public final class PackMain { + private static final String PROJECT = "fragments"; + private PackMain() { } public static void main(String[] args) { final Path projectRoot = args.length == 0 - ? Path.of("test-projects/main") + ? Path.of("test-projects/%s".formatted(PROJECT)) : Path.of(args[0]); final String projectId = projectRoot.getFileName() == null ? "project" diff --git a/test-projects/fragments/.studio/activities.json b/test-projects/fragments/.studio/activities.json new file mode 100644 index 00000000..1ccd6bae --- /dev/null +++ b/test-projects/fragments/.studio/activities.json @@ -0,0 +1,11 @@ +[ { + "source" : "Assets", + "message" : "0 assets loaded", + "severity" : "SUCCESS", + "sticky" : false +}, { + "source" : "Assets", + "message" : "Asset scan started", + "severity" : "INFO", + "sticky" : false +} ] \ No newline at end of file diff --git a/test-projects/fragments/assets/.prometeu/cache.json b/test-projects/fragments/assets/.prometeu/cache.json new file mode 100644 index 00000000..0b0e5946 --- /dev/null +++ b/test-projects/fragments/assets/.prometeu/cache.json @@ -0,0 +1,4 @@ +{ + "schema_version" : 1, + "assets" : [ ] +} \ No newline at end of file diff --git a/test-projects/fragments/assets/.prometeu/index.json b/test-projects/fragments/assets/.prometeu/index.json new file mode 100644 index 00000000..184e1c08 --- /dev/null +++ b/test-projects/fragments/assets/.prometeu/index.json @@ -0,0 +1,5 @@ +{ + "schema_version" : 1, + "next_asset_id" : 1, + "assets" : [ ] +} \ No newline at end of file diff --git a/test-projects/fragments/cartridge/assets.pa b/test-projects/fragments/cartridge/assets.pa new file mode 100644 index 00000000..8a1dc8ae Binary files /dev/null and b/test-projects/fragments/cartridge/assets.pa differ diff --git a/test-projects/fragments/cartridge/manifest.json b/test-projects/fragments/cartridge/manifest.json new file mode 100644 index 00000000..4f20a259 --- /dev/null +++ b/test-projects/fragments/cartridge/manifest.json @@ -0,0 +1,10 @@ +{ + "magic": "PMTU", + "cartridge_version": 1, + "app_id": 1, + "title": "Fragments", + "app_version": "0.1.0", + "app_mode": "Game", + "entrypoint": "0", + "capabilities": ["log", "gfx", "asset"] +} diff --git a/test-projects/fragments/cartridge/program.pbx b/test-projects/fragments/cartridge/program.pbx new file mode 100644 index 00000000..ba33b859 Binary files /dev/null and b/test-projects/fragments/cartridge/program.pbx differ diff --git a/test-projects/fragments/prometeu.json b/test-projects/fragments/prometeu.json new file mode 100644 index 00000000..a9c5ccd5 --- /dev/null +++ b/test-projects/fragments/prometeu.json @@ -0,0 +1,8 @@ +{ + "name": "fragments", + "version": "1.0.0", + "language": "pbs", + "stdlib": "1", + "dependencies": [ + ] +} diff --git a/test-projects/fragments/run.sh b/test-projects/fragments/run.sh new file mode 100755 index 00000000..3f792c15 --- /dev/null +++ b/test-projects/fragments/run.sh @@ -0,0 +1,7 @@ +#!/bin/zsh + +set -e + +cp build/assets.pa cartridge +cp build/program.pbx cartridge +./runtime/prometeu run cartridge diff --git a/test-projects/fragments/runtime b/test-projects/fragments/runtime new file mode 120000 index 00000000..567e7714 --- /dev/null +++ b/test-projects/fragments/runtime @@ -0,0 +1 @@ +../../../runtime/dist-staging/stable/prometeu-cli-aarch64-apple-darwin/ \ No newline at end of file diff --git a/test-projects/fragments/src/main.pbs b/test-projects/fragments/src/main.pbs new file mode 100644 index 00000000..a4eb381d --- /dev/null +++ b/test-projects/fragments/src/main.pbs @@ -0,0 +1,64 @@ +import { Color } from @core:color; +import { Gfx } from @sdk:gfx; + +declare global ticks: int = 0; +declare const SCREEN_W: int = 320; +declare const SCREEN_H: int = 180; +declare const CELL: int = 4; + +[Init] +fn init() -> void +{ + ticks = 0; +} + +[Frame] +fn frame() -> void +{ + ticks += 1; + Gfx.fill_rect(0, 0, SCREEN_W, CELL, new Color((ticks * 97 + 500) % 65535)); + Gfx.fill_rect(0, 4, SCREEN_W, CELL, new Color((ticks * 110 + 1200) % 65535)); + Gfx.fill_rect(0, 8, SCREEN_W, CELL, new Color((ticks * 123 + 1900) % 65535)); + Gfx.fill_rect(0, 12, SCREEN_W, CELL, new Color((ticks * 136 + 2600) % 65535)); + Gfx.fill_rect(0, 16, SCREEN_W, CELL, new Color((ticks * 149 + 3300) % 65535)); + Gfx.fill_rect(0, 20, SCREEN_W, CELL, new Color((ticks * 162 + 4000) % 65535)); + Gfx.fill_rect(0, 24, SCREEN_W, CELL, new Color((ticks * 175 + 4700) % 65535)); + Gfx.fill_rect(0, 28, SCREEN_W, CELL, new Color((ticks * 188 + 5400) % 65535)); + Gfx.fill_rect(0, 32, SCREEN_W, CELL, new Color((ticks * 201 + 6100) % 65535)); + Gfx.fill_rect(0, 36, SCREEN_W, CELL, new Color((ticks * 214 + 6800) % 65535)); + Gfx.fill_rect(0, 40, SCREEN_W, CELL, new Color((ticks * 227 + 7500) % 65535)); + Gfx.fill_rect(0, 44, SCREEN_W, CELL, new Color((ticks * 240 + 8200) % 65535)); + Gfx.fill_rect(0, 48, SCREEN_W, CELL, new Color((ticks * 253 + 8900) % 65535)); + Gfx.fill_rect(0, 52, SCREEN_W, CELL, new Color((ticks * 266 + 9600) % 65535)); + Gfx.fill_rect(0, 56, SCREEN_W, CELL, new Color((ticks * 279 + 10300) % 65535)); + Gfx.fill_rect(0, 60, SCREEN_W, CELL, new Color((ticks * 292 + 11000) % 65535)); + Gfx.fill_rect(0, 64, SCREEN_W, CELL, new Color((ticks * 305 + 11700) % 65535)); + Gfx.fill_rect(0, 68, SCREEN_W, CELL, new Color((ticks * 318 + 12400) % 65535)); + Gfx.fill_rect(0, 72, SCREEN_W, CELL, new Color((ticks * 331 + 13100) % 65535)); + Gfx.fill_rect(0, 76, SCREEN_W, CELL, new Color((ticks * 344 + 13800) % 65535)); + Gfx.fill_rect(0, 80, SCREEN_W, CELL, new Color((ticks * 357 + 14500) % 65535)); + Gfx.fill_rect(0, 84, SCREEN_W, CELL, new Color((ticks * 370 + 15200) % 65535)); + Gfx.fill_rect(0, 88, SCREEN_W, CELL, new Color((ticks * 383 + 15900) % 65535)); + Gfx.fill_rect(0, 92, SCREEN_W, CELL, new Color((ticks * 396 + 16600) % 65535)); + Gfx.fill_rect(0, 96, SCREEN_W, CELL, new Color((ticks * 409 + 17300) % 65535)); + Gfx.fill_rect(0, 100, SCREEN_W, CELL, new Color((ticks * 422 + 18000) % 65535)); + Gfx.fill_rect(0, 104, SCREEN_W, CELL, new Color((ticks * 435 + 18700) % 65535)); + Gfx.fill_rect(0, 108, SCREEN_W, CELL, new Color((ticks * 448 + 19400) % 65535)); + Gfx.fill_rect(0, 112, SCREEN_W, CELL, new Color((ticks * 461 + 20100) % 65535)); + Gfx.fill_rect(0, 116, SCREEN_W, CELL, new Color((ticks * 474 + 20800) % 65535)); + Gfx.fill_rect(0, 120, SCREEN_W, CELL, new Color((ticks * 487 + 21500) % 65535)); + Gfx.fill_rect(0, 124, SCREEN_W, CELL, new Color((ticks * 500 + 22200) % 65535)); + Gfx.fill_rect(0, 128, SCREEN_W, CELL, new Color((ticks * 513 + 22900) % 65535)); + Gfx.fill_rect(0, 132, SCREEN_W, CELL, new Color((ticks * 526 + 23600) % 65535)); + Gfx.fill_rect(0, 136, SCREEN_W, CELL, new Color((ticks * 539 + 24300) % 65535)); + Gfx.fill_rect(0, 140, SCREEN_W, CELL, new Color((ticks * 552 + 25000) % 65535)); + Gfx.fill_rect(0, 144, SCREEN_W, CELL, new Color((ticks * 565 + 25700) % 65535)); + Gfx.fill_rect(0, 148, SCREEN_W, CELL, new Color((ticks * 578 + 26400) % 65535)); + Gfx.fill_rect(0, 152, SCREEN_W, CELL, new Color((ticks * 591 + 27100) % 65535)); + Gfx.fill_rect(0, 156, SCREEN_W, CELL, new Color((ticks * 604 + 27800) % 65535)); + Gfx.fill_rect(0, 160, SCREEN_W, CELL, new Color((ticks * 617 + 28500) % 65535)); + Gfx.fill_rect(0, 164, SCREEN_W, CELL, new Color((ticks * 630 + 29200) % 65535)); + Gfx.fill_rect(0, 168, SCREEN_W, CELL, new Color((ticks * 643 + 29900) % 65535)); + Gfx.fill_rect(0, 172, SCREEN_W, CELL, new Color((ticks * 656 + 30600) % 65535)); + Gfx.fill_rect(0, 176, SCREEN_W, CELL, new Color((ticks * 669 + 31300) % 65535)); +} diff --git a/test-projects/fragments/src/mod.barrel b/test-projects/fragments/src/mod.barrel new file mode 100644 index 00000000..665da591 --- /dev/null +++ b/test-projects/fragments/src/mod.barrel @@ -0,0 +1 @@ +pub fn frame() -> void; \ No newline at end of file