implements Glyph and update Tile to use active (dsc16: done)

This commit is contained in:
2026-04-09 07:59:55 +01:00
parent c4aca95635
commit c83b0402ff
7 changed files with 32 additions and 14 deletions
@@ -7,12 +7,12 @@ use prometeu_hal::color::Color;
use prometeu_hal::log::{LogLevel, LogSource};
use prometeu_hal::sprite::Sprite;
use prometeu_hal::syscalls::Syscall;
use prometeu_hal::tile::Tile;
use prometeu_hal::vm_fault::VmFault;
use prometeu_hal::{
AudioOpStatus, GfxOpStatus, HostContext, HostReturn, NativeInterface, SyscallId, expect_bool,
expect_int,
};
use prometeu_hal::glyph::Glyph;
impl VirtualMachineRuntime {
fn syscall_log_write(&mut self, level_val: i64, tag: u16, msg: String) -> Result<(), VmFault> {
@@ -139,7 +139,7 @@ impl NativeInterface for VirtualMachineRuntime {
let index = expect_int(args, 1)? as usize;
let x = expect_int(args, 2)? as i32;
let y = expect_int(args, 3)? as i32;
let tile_id = expect_int(args, 4)? as u16;
let glyph_id = expect_int(args, 4)? as u16;
let palette_id = expect_int(args, 5)? as u8;
let active = expect_bool(args, 6)?;
let flip_x = expect_bool(args, 7)?;
@@ -162,7 +162,10 @@ impl NativeInterface for VirtualMachineRuntime {
}
*hw.gfx_mut().sprite_mut(index) = Sprite {
tile: Tile { id: tile_id, flip_x: false, flip_y: false, palette_id },
glyph: Glyph {
glyph_id,
palette_id,
},
x,
y,
bank_id,