Initial xenia-rs

This commit is contained in:
MechaCat02
2026-04-12 18:25:46 +02:00
parent 1da37db584
commit 06a23212fb
50 changed files with 6759 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
use crate::{VfsDevice, VfsEntry, VfsError};
/// XISO disc image device. Parses Xbox 360 disc images.
pub struct DiscImageDevice {
name: String,
_data: Vec<u8>,
}
/// XISO sector size
pub const SECTOR_SIZE: usize = 0x800;
impl DiscImageDevice {
pub fn open(name: impl Into<String>, path: &std::path::Path) -> Result<Self, VfsError> {
let data = std::fs::read(path)?;
// TODO: validate XISO header
Ok(Self {
name: name.into(),
_data: data,
})
}
}
impl VfsDevice for DiscImageDevice {
fn name(&self) -> &str {
&self.name
}
fn list_root(&self) -> Result<Vec<VfsEntry>, VfsError> {
// TODO: Parse XISO directory tree
Ok(Vec::new())
}
fn read_file(&self, _path: &str) -> Result<Vec<u8>, VfsError> {
Err(VfsError::NotFound("Not yet implemented".into()))
}
fn stat(&self, _path: &str) -> Result<VfsEntry, VfsError> {
Err(VfsError::NotFound("Not yet implemented".into()))
}
}