-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Objs #93
Objs #93
Conversation
8321360
to
06a92b0
Compare
fpt/src/ppu.rs
Outdated
@@ -78,6 +83,10 @@ impl Ppu { | |||
fn oam_scan(&mut self) { | |||
if self.dots_this_frame % 456 == (80 - 1) { | |||
self.tilemap = self.bus.with_vram(VRamContents::load); | |||
let oam = self.bus.copy_range(map::OAM); | |||
self.sprites = (0..40) | |||
.map(|sprite_index| Sprite::load(&oam[sprite_index * 4..(sprite_index * 4 + 4)])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you explain the magic numbers here? the * 4 and + 4.
the ppu already has lots of magic numbers I introduced that I dislike 😅
fpt/src/ppu.rs
Outdated
let mut pixel = tile.get_pixel(yy % 8, xx % 8); | ||
|
||
for sprite in self.sprites.iter() { | ||
let sprite_x: i32 = sprite.x as i32 - 8; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we remove the repeated as i32 casts somehow?
fixes #67