implements PLN-0130
This commit is contained in:
@@ -29,7 +29,6 @@ pub use resolver::{
|
||||
#[repr(u32)]
|
||||
pub enum Syscall {
|
||||
SystemHasCart = 0x0001,
|
||||
SystemRunCart = 0x0002,
|
||||
GfxClear = 0x1001,
|
||||
GfxFillRect = 0x1002,
|
||||
GfxDrawLine = 0x1003,
|
||||
|
||||
@@ -13,7 +13,6 @@ impl Syscall {
|
||||
pub fn from_u32(id: u32) -> Option<Self> {
|
||||
match id {
|
||||
0x0001 => Some(Self::SystemHasCart),
|
||||
0x0002 => Some(Self::SystemRunCart),
|
||||
0x1001 => Some(Self::GfxClear),
|
||||
0x1002 => Some(Self::GfxFillRect),
|
||||
0x1003 => Some(Self::GfxDrawLine),
|
||||
@@ -75,7 +74,6 @@ impl Syscall {
|
||||
pub fn name(&self) -> &'static str {
|
||||
match self {
|
||||
Self::SystemHasCart => "SystemHasCart",
|
||||
Self::SystemRunCart => "SystemRunCart",
|
||||
Self::GfxClear => "GfxClear",
|
||||
Self::GfxFillRect => "GfxFillRect",
|
||||
Self::GfxDrawLine => "GfxDrawLine",
|
||||
|
||||
@@ -74,6 +74,7 @@ fn resolver_rejects_removed_legacy_gfx_set_sprite_identity() {
|
||||
|
||||
#[test]
|
||||
fn resolver_rejects_userland_system_run_cart_identity() {
|
||||
assert!(Syscall::from_u32(0x0002).is_none());
|
||||
assert!(resolve_syscall("system", "run_cart", 1).is_none());
|
||||
|
||||
let requested = [SyscallIdentity { module: "system", name: "run_cart", version: 1 }];
|
||||
|
||||
@@ -173,7 +173,6 @@ impl NativeInterface for VmRuntimeHost<'_> {
|
||||
ret.push_bool(true);
|
||||
return Ok(());
|
||||
}
|
||||
Syscall::SystemRunCart => return Ok(()),
|
||||
_ => {}
|
||||
}
|
||||
|
||||
@@ -183,7 +182,6 @@ impl NativeInterface for VmRuntimeHost<'_> {
|
||||
|
||||
match syscall {
|
||||
Syscall::SystemHasCart => unreachable!(),
|
||||
Syscall::SystemRunCart => unreachable!(),
|
||||
Syscall::GfxClear => {
|
||||
let color = self.get_color(expect_int(args, 0)?)?;
|
||||
self.gfx2d_commands.push(Gfx2dCommand::Clear { color });
|
||||
|
||||
Reference in New Issue
Block a user