you CAN fix stupid!!!!!

This commit is contained in:
Alex Janka 2023-04-24 18:45:33 +10:00
parent a81d082e16
commit d3c67622eb
2 changed files with 11 additions and 7 deletions

View file

@ -534,8 +534,11 @@ where
}; };
let tiledata_offset = tile_px_y * 2; let tiledata_offset = tile_px_y * 2;
let tile_addr = (self.lcdc.tile_area.get_addr(self.vram.get(tilemap_addr)) let tile_addr = (self.lcdc.tile_area.get_addr(
+ tiledata_offset as u16) self.vram
.get_with_bank(tilemap_addr, VramBank::Bank0)
.unwrap(),
) + tiledata_offset as u16)
.unwrap(); .unwrap();
let lsbs = self let lsbs = self

View file

@ -267,7 +267,7 @@ impl Default for Stat {
} }
} }
#[derive(Serialize, Deserialize, Clone, Copy)] #[derive(Serialize, Deserialize, Clone, Copy, Debug)]
pub enum VramBank { pub enum VramBank {
Bank0 = 0, Bank0 = 0,
Bank1 = 1, Bank1 = 1,
@ -386,6 +386,7 @@ pub struct GpuInterrupts {
pub vblank: bool, pub vblank: bool,
} }
#[derive(Debug)]
pub(super) struct BgAttributes { pub(super) struct BgAttributes {
pub(super) bg_priority: bool, pub(super) bg_priority: bool,
pub(super) flip_v: bool, pub(super) flip_v: bool,
@ -397,11 +398,11 @@ pub(super) struct BgAttributes {
impl Default for BgAttributes { impl Default for BgAttributes {
fn default() -> Self { fn default() -> Self {
Self { Self {
bg_priority: Default::default(), bg_priority: false,
flip_v: Default::default(), flip_v: false,
flip_h: Default::default(), flip_h: false,
tile_bank: VramBank::Bank0, tile_bank: VramBank::Bank0,
palette: Default::default(), palette: 0,
} }
} }
} }