diff --git a/.gitignore b/.gitignore index 96ef6c0..5100c0b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /target Cargo.lock +/src/assets.rs \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml index e941cbf..b0d45c1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "gba-dvd" description = "A Gamebody Advance ROM that's just a dvd bounce screen saver" -version = "0.1.0" +version = "0.1.1" authors = ["Mason Ginter "] repository = "https://github.com/Hpmason/gba-dvd" readme = "README.md" diff --git a/src/main.rs b/src/main.rs index 063f00c..804f697 100644 --- a/src/main.rs +++ b/src/main.rs @@ -50,7 +50,7 @@ fn copy_tiles() { for i in 0..(dvd.len() / 8) { tile = Tile4bpp::new_tile(); for j in 0..8 { - tile.write(j, dvd[i * 8 + j]) + tile.0[j] = dvd[i * 8 + j]; } // first index is used for all sprites CHAR_DATA_4.index(i).write(tile); diff --git a/src/tiles/types.rs b/src/tiles/types.rs index e3796ad..160c430 100644 --- a/src/tiles/types.rs +++ b/src/tiles/types.rs @@ -1,14 +1,13 @@ use crate::prelude::*; #[derive(Debug, Clone, Copy, Default, PartialEq, Eq)] -pub struct Tile4bpp([u32; 8]); +pub struct Tile4bpp(pub [u32; 8]); #[derive(Debug, Clone, Copy, Default, PartialEq, Eq)] -pub struct Tile8bpp([u32; 16]); +pub struct Tile8bpp(pub [u32; 16]); pub trait Tile { fn new_tile() -> Self; - fn write(&mut self, ind: usize, t: u32); fn copy_to_block(self, ind: usize); } @@ -16,9 +15,6 @@ impl Tile for Tile4bpp { fn new_tile() -> Self { Tile4bpp::default() } - fn write(&mut self, ind: usize, t: u32) { - self.0[ind] = t; - } fn copy_to_block(self, ind: usize) { CHAR_DATA_4.index(ind).write(self); } @@ -28,9 +24,6 @@ impl Tile for Tile8bpp { fn new_tile() -> Self { Tile8bpp::default() } - fn write(&mut self, ind: usize, t: u32) { - self.0[ind] = t; - } fn copy_to_block(self, ind: usize) { CHAR_DATA_8.index(ind).write(self); }