implements PLN-0024

This commit is contained in:
bQUARKz 2026-04-17 17:56:37 +01:00
parent cc700c6cf8
commit 3fef407efc
Signed by: bquarkz
SSH Key Fingerprint: SHA256:Z7dgqoglWwoK6j6u4QC87OveEq74WOhFN+gitsxtkf8
3 changed files with 17 additions and 5 deletions

View File

@ -63,6 +63,18 @@ fn resolver_rejects_unknown_identity() {
} }
} }
#[test]
fn resolver_rejects_removed_legacy_gfx_set_sprite_identity() {
assert!(resolve_syscall("gfx", "set_sprite", 1).is_none());
let requested = [SyscallIdentity { module: "gfx", name: "set_sprite", version: 1 }];
let err = resolve_program_syscalls(&requested, caps::ALL).unwrap_err();
assert_eq!(
err,
LoadError::UnknownSyscall { module: "gfx".into(), name: "set_sprite".into(), version: 1 }
);
}
#[test] #[test]
fn resolver_enforces_capabilities() { fn resolver_enforces_capabilities() {
let requested = [SyscallIdentity { module: "gfx", name: "clear", version: 1 }]; let requested = [SyscallIdentity { module: "gfx", name: "clear", version: 1 }];

View File

@ -42,10 +42,10 @@ pub fn generate() -> Result<()> {
ret_slots: 0, ret_slots: 0,
}, },
SyscallDecl { SyscallDecl {
module: "gfx".into(), module: "composer".into(),
name: "set_sprite".into(), name: "emit_sprite".into(),
version: 1, version: 1,
arg_slots: 10, arg_slots: 9,
ret_slots: 1, ret_slots: 1,
}, },
]; ];
@ -124,9 +124,9 @@ fn heavy_load(rom: &mut Vec<u8>) {
// --- clear screen --- // --- clear screen ---
rom.extend(asm("PUSH_I32 0\nHOSTCALL 0")); rom.extend(asm("PUSH_I32 0\nHOSTCALL 0"));
// --- call status-first syscall path once per frame and drop status --- // --- call composer-domain sprite emission path once per frame and drop status ---
rom.extend(asm( rom.extend(asm(
"PUSH_I32 0\nPUSH_I32 0\nPUSH_I32 0\nPUSH_I32 0\nPUSH_I32 0\nPUSH_I32 0\nPUSH_BOOL 0\nPUSH_BOOL 0\nPUSH_BOOL 0\nPUSH_I32 0\nHOSTCALL 4\nPOP_N 1", "PUSH_I32 0\nPUSH_I32 0\nPUSH_I32 0\nPUSH_I32 0\nPUSH_I32 0\nPUSH_I32 0\nPUSH_BOOL 0\nPUSH_BOOL 0\nPUSH_I32 0\nHOSTCALL 4\nPOP_N 1",
)); ));
// --- draw 500 discs --- // --- draw 500 discs ---