This commit is contained in:
Nilton Constantino
2026-02-02 13:54:01 +00:00
parent 99d3dc38a1
commit 6732111328
15 changed files with 571 additions and 167 deletions
+1 -1
View File
@@ -2,5 +2,5 @@
"name": "canonical",
"version": "0.1.0",
"script_fe": "pbs",
"entry": "src/main.pbs"
"entry": "src/main/modules/main.pbs"
}
@@ -1,4 +1,4 @@
declare struct Color(raw: bounded)
pub declare struct Color(raw: bounded)
[[
BLACK: Color(0b),
WHITE: Color(65535b),
@@ -7,6 +7,6 @@ declare struct Color(raw: bounded)
BLUE: Color(31b)
]]
declare contract Gfx host {
pub declare contract Gfx host {
fn clear(color: Color): void;
}
@@ -1,11 +1,11 @@
declare struct ButtonState(
pub declare struct ButtonState(
pressed: bool,
released: bool,
down: bool,
hold_frames: bounded
)
declare struct Pad(
pub declare struct Pad(
up: ButtonState,
down: ButtonState,
left: ButtonState,
@@ -20,10 +20,6 @@ declare struct Pad(
select: ButtonState
)
declare contract Input host {
pub declare contract Input host {
fn pad(): Pad;
}
fn add(a: int, b: int): int {
return a + b;
}
+1 -1
View File
@@ -3,7 +3,7 @@
"version": "0.1.0",
"script_fe": "pbs",
"kind": "app",
"entry": "src/main.pbs",
"entry": "src/main/modules/main.pbs",
"out": "build/program.pbc",
"dependencies": {
"sdk": "../sdk"
@@ -1,4 +1,9 @@
import { Color, Gfx, Input } from "@test01:sdk";
import { Color, Gfx } from "@sdk:gfx";
import { Input } from "@sdk:input";
fn add(a: int, b: int): int {
return a + b;
}
fn frame(): void {
// 1. Locals & Arithmetic