assets loaded by bank id instead of name
This commit is contained in:
@@ -547,15 +547,26 @@ All other `gfx` syscalls remain `void` unless a future domain revision introduce
|
||||
|
||||
`gfx.set_sprite` returns `status:int`.
|
||||
|
||||
ABI:
|
||||
1. `bank_id: int` — index of the tile bank
|
||||
2. `index: int` — sprite index (0..511)
|
||||
3. `x: int` — x coordinate
|
||||
4. `y: int` — y coordinate
|
||||
5. `tile_id: int` — tile index within the bank
|
||||
6. `palette_id: int` — palette index (0..63)
|
||||
7. `active: bool` — visibility toggle
|
||||
8. `flip_x: bool` — horizontal flip
|
||||
9. `flip_y: bool` — vertical flip
|
||||
10. `priority: int` — layer priority (0..4)
|
||||
|
||||
Minimum status table:
|
||||
|
||||
- `0` = `OK`
|
||||
- `1` = `ASSET_NOT_FOUND`
|
||||
- `2` = `INVALID_SPRITE_INDEX`
|
||||
- `3` = `INVALID_ARG_RANGE`
|
||||
|
||||
Operational notes:
|
||||
|
||||
- no fallback to default bank when the sprite asset name cannot be resolved;
|
||||
- no fallback to default bank when the sprite bank id cannot be resolved;
|
||||
- no silent no-op for invalid index/range;
|
||||
- `palette_id` and `priority` must be validated against runtime-supported ranges.
|
||||
|
||||
@@ -192,6 +192,15 @@ In the current MVP:
|
||||
- `audio.play` returns `status:int`;
|
||||
- `audio.play_sample` returns `status:int`.
|
||||
|
||||
ABI `audio.play`:
|
||||
1. `bank_id: int` — index of the sound bank
|
||||
2. `sample_id: int` — index of the sample within the bank
|
||||
3. `voice_id: int` — index of the voice to use (0..15)
|
||||
4. `volume: int` — volume level (0..255)
|
||||
5. `pan: int` — panning (0..255)
|
||||
6. `pitch: float` — playback rate
|
||||
7. `loop_mode: int` — `0` for Off, `1` for On
|
||||
|
||||
Return-shape matrix in v1 syscall surface:
|
||||
|
||||
| Syscall | Return | Policy basis |
|
||||
@@ -205,12 +214,11 @@ Return-shape matrix in v1 syscall surface:
|
||||
- `1` = `VOICE_INVALID`
|
||||
- `2` = `SAMPLE_NOT_FOUND`
|
||||
- `3` = `ARG_RANGE_INVALID`
|
||||
- `4` = `ASSET_NOT_FOUND`
|
||||
- `5` = `NO_EFFECT`
|
||||
|
||||
Operational rules:
|
||||
|
||||
- no fallback to default bank when an asset cannot be resolved;
|
||||
- no fallback to default bank when a bank id cannot be resolved;
|
||||
- no silent no-op for invalid `voice_id`;
|
||||
- invalid `voice_id` must return `VOICE_INVALID`, not `ARG_RANGE_INVALID`;
|
||||
- invalid numeric ranges (e.g. `volume`, `pan`, `pitch`) must return explicit status.
|
||||
|
||||
Reference in New Issue
Block a user