pr 50
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,176 @@
|
||||
0000 GetLocal U32(0)
|
||||
0006 GetLocal U32(1)
|
||||
000C Add
|
||||
000E Ret
|
||||
0010 PushConst U32(1)
|
||||
0016 SetLocal U32(0)
|
||||
001C PushConst U32(2)
|
||||
0022 SetLocal U32(1)
|
||||
0028 GetLocal U32(0)
|
||||
002E GetLocal U32(1)
|
||||
0034 Call U32(0)
|
||||
003A SetLocal U32(2)
|
||||
0040 GetLocal U32(2)
|
||||
0046 PushConst U32(3)
|
||||
004C Eq
|
||||
004E JmpIfFalse U32(92)
|
||||
0054 Jmp U32(74)
|
||||
005A PushBounded U32(2016)
|
||||
0060 Syscall U32(4112)
|
||||
0066 Jmp U32(110)
|
||||
006C PushBounded U32(63488)
|
||||
0072 Syscall U32(4112)
|
||||
0078 Jmp U32(110)
|
||||
007E Syscall U32(8208)
|
||||
0084 GetLocal U32(50)
|
||||
008A GateRelease
|
||||
008C SetLocal U32(50)
|
||||
0092 GetLocal U32(49)
|
||||
0098 GateRelease
|
||||
009A SetLocal U32(49)
|
||||
00A0 GetLocal U32(48)
|
||||
00A6 GateRelease
|
||||
00A8 SetLocal U32(48)
|
||||
00AE GetLocal U32(47)
|
||||
00B4 GateRelease
|
||||
00B6 SetLocal U32(47)
|
||||
00BC GetLocal U32(46)
|
||||
00C2 GateRelease
|
||||
00C4 SetLocal U32(46)
|
||||
00CA GetLocal U32(45)
|
||||
00D0 GateRelease
|
||||
00D2 SetLocal U32(45)
|
||||
00D8 GetLocal U32(44)
|
||||
00DE GateRelease
|
||||
00E0 SetLocal U32(44)
|
||||
00E6 GetLocal U32(43)
|
||||
00EC GateRelease
|
||||
00EE SetLocal U32(43)
|
||||
00F4 GetLocal U32(42)
|
||||
00FA GateRelease
|
||||
00FC SetLocal U32(42)
|
||||
0102 GetLocal U32(41)
|
||||
0108 GateRelease
|
||||
010A SetLocal U32(41)
|
||||
0110 GetLocal U32(40)
|
||||
0116 GateRelease
|
||||
0118 SetLocal U32(40)
|
||||
011E GetLocal U32(39)
|
||||
0124 GateRelease
|
||||
0126 SetLocal U32(39)
|
||||
012C GetLocal U32(38)
|
||||
0132 GateRelease
|
||||
0134 SetLocal U32(38)
|
||||
013A GetLocal U32(37)
|
||||
0140 GateRelease
|
||||
0142 SetLocal U32(37)
|
||||
0148 GetLocal U32(36)
|
||||
014E GateRelease
|
||||
0150 SetLocal U32(36)
|
||||
0156 GetLocal U32(35)
|
||||
015C GateRelease
|
||||
015E SetLocal U32(35)
|
||||
0164 GetLocal U32(34)
|
||||
016A GateRelease
|
||||
016C SetLocal U32(34)
|
||||
0172 GetLocal U32(33)
|
||||
0178 GateRelease
|
||||
017A SetLocal U32(33)
|
||||
0180 GetLocal U32(32)
|
||||
0186 GateRelease
|
||||
0188 SetLocal U32(32)
|
||||
018E GetLocal U32(31)
|
||||
0194 GateRelease
|
||||
0196 SetLocal U32(31)
|
||||
019C GetLocal U32(30)
|
||||
01A2 GateRelease
|
||||
01A4 SetLocal U32(30)
|
||||
01AA GetLocal U32(29)
|
||||
01B0 GateRelease
|
||||
01B2 SetLocal U32(29)
|
||||
01B8 GetLocal U32(28)
|
||||
01BE GateRelease
|
||||
01C0 SetLocal U32(28)
|
||||
01C6 GetLocal U32(27)
|
||||
01CC GateRelease
|
||||
01CE SetLocal U32(27)
|
||||
01D4 GetLocal U32(26)
|
||||
01DA GateRelease
|
||||
01DC SetLocal U32(26)
|
||||
01E2 GetLocal U32(25)
|
||||
01E8 GateRelease
|
||||
01EA SetLocal U32(25)
|
||||
01F0 GetLocal U32(24)
|
||||
01F6 GateRelease
|
||||
01F8 SetLocal U32(24)
|
||||
01FE GetLocal U32(23)
|
||||
0204 GateRelease
|
||||
0206 SetLocal U32(23)
|
||||
020C GetLocal U32(22)
|
||||
0212 GateRelease
|
||||
0214 SetLocal U32(22)
|
||||
021A GetLocal U32(21)
|
||||
0220 GateRelease
|
||||
0222 SetLocal U32(21)
|
||||
0228 GetLocal U32(20)
|
||||
022E GateRelease
|
||||
0230 SetLocal U32(20)
|
||||
0236 GetLocal U32(19)
|
||||
023C GateRelease
|
||||
023E SetLocal U32(19)
|
||||
0244 GetLocal U32(18)
|
||||
024A GateRelease
|
||||
024C SetLocal U32(18)
|
||||
0252 GetLocal U32(17)
|
||||
0258 GateRelease
|
||||
025A SetLocal U32(17)
|
||||
0260 GetLocal U32(16)
|
||||
0266 GateRelease
|
||||
0268 SetLocal U32(16)
|
||||
026E GetLocal U32(15)
|
||||
0274 GateRelease
|
||||
0276 SetLocal U32(15)
|
||||
027C GetLocal U32(14)
|
||||
0282 GateRelease
|
||||
0284 SetLocal U32(14)
|
||||
028A GetLocal U32(13)
|
||||
0290 GateRelease
|
||||
0292 SetLocal U32(13)
|
||||
0298 GetLocal U32(12)
|
||||
029E GateRelease
|
||||
02A0 SetLocal U32(12)
|
||||
02A6 GetLocal U32(11)
|
||||
02AC GateRelease
|
||||
02AE SetLocal U32(11)
|
||||
02B4 GetLocal U32(10)
|
||||
02BA GateRelease
|
||||
02BC SetLocal U32(10)
|
||||
02C2 GetLocal U32(9)
|
||||
02C8 GateRelease
|
||||
02CA SetLocal U32(9)
|
||||
02D0 GetLocal U32(8)
|
||||
02D6 GateRelease
|
||||
02D8 SetLocal U32(8)
|
||||
02DE GetLocal U32(7)
|
||||
02E4 GateRelease
|
||||
02E6 SetLocal U32(7)
|
||||
02EC GetLocal U32(6)
|
||||
02F2 GateRelease
|
||||
02F4 SetLocal U32(6)
|
||||
02FA GetLocal U32(5)
|
||||
0300 GateRelease
|
||||
0302 SetLocal U32(5)
|
||||
0308 GetLocal U32(4)
|
||||
030E GateRelease
|
||||
0310 SetLocal U32(4)
|
||||
0316 GetLocal U32(3)
|
||||
031C GateRelease
|
||||
031E SetLocal U32(3)
|
||||
0324 GetLocal U32(21)
|
||||
032A JmpIfFalse U32(824)
|
||||
0330 Jmp U32(806)
|
||||
0336 PushBounded U32(31)
|
||||
033C Syscall U32(4112)
|
||||
0342 Jmp U32(830)
|
||||
0348 Jmp U32(830)
|
||||
034E Ret
|
||||
Binary file not shown.
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"script_fe": "pbs",
|
||||
"entry": "src/main.pbs"
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
// CartridgeCanonical.pbs
|
||||
// Purpose: VM Heartbeat Test (Industrial Baseline)
|
||||
|
||||
declare struct Color(raw: bounded)
|
||||
[[
|
||||
BLACK: Color(0b),
|
||||
WHITE: Color(65535b),
|
||||
RED: Color(63488b),
|
||||
GREEN: Color(2016b),
|
||||
BLUE: Color(31b)
|
||||
]]
|
||||
|
||||
declare struct ButtonState(
|
||||
pressed: bool,
|
||||
released: bool,
|
||||
down: bool,
|
||||
hold_frames: bounded
|
||||
)
|
||||
|
||||
declare struct Pad(
|
||||
up: ButtonState,
|
||||
down: ButtonState,
|
||||
left: ButtonState,
|
||||
right: ButtonState,
|
||||
a: ButtonState,
|
||||
b: ButtonState,
|
||||
x: ButtonState,
|
||||
y: ButtonState,
|
||||
l: ButtonState,
|
||||
r: ButtonState,
|
||||
start: ButtonState,
|
||||
select: ButtonState
|
||||
)
|
||||
|
||||
declare contract Gfx host {
|
||||
fn clear(color: Color): void;
|
||||
}
|
||||
|
||||
declare contract Input host {
|
||||
fn pad(): Pad;
|
||||
}
|
||||
|
||||
fn add(a: int, b: int): int {
|
||||
return a + b;
|
||||
}
|
||||
|
||||
fn frame(): void {
|
||||
// 1. Locals & Arithmetic
|
||||
let x = 10;
|
||||
let y = 20;
|
||||
let z = add(x, y);
|
||||
|
||||
// 2. Control Flow (if)
|
||||
if z == 30 {
|
||||
// 3. Syscall Clear
|
||||
Gfx.clear(Color.GREEN);
|
||||
} else {
|
||||
Gfx.clear(Color.RED);
|
||||
}
|
||||
|
||||
// 4. Input Snapshot & Nested Member Access
|
||||
let p = Input.pad();
|
||||
if p.a.down {
|
||||
Gfx.clear(Color.BLUE);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user