[fix] Get sensible y coordinates
This commit is contained in:
@@ -44,10 +44,13 @@ impl <'a> Cpu<'a>{
|
|||||||
for _i in 0..65536{
|
for _i in 0..65536{
|
||||||
let address_to_execute = self.get_pc();
|
let address_to_execute = self.get_pc();
|
||||||
|
|
||||||
//fetch
|
//execute p1
|
||||||
self.copy_u24(address_to_execute)?;
|
self.copy_u24(address_to_execute)?;
|
||||||
|
//execute p2
|
||||||
let new_pc_location = address_to_execute+2*(Self::PC_LEN as u32) ;
|
let new_pc_location = address_to_execute+2*(Self::PC_LEN as u32) ;
|
||||||
|
|
||||||
let new_pc = self.memory.try_get_u24(new_pc_location)?;
|
let new_pc = self.memory.try_get_u24(new_pc_location)?;
|
||||||
|
|
||||||
self.set_pc(new_pc);
|
self.set_pc(new_pc);
|
||||||
}
|
}
|
||||||
log::debug!("Finished internal loop");
|
log::debug!("Finished internal loop");
|
||||||
|
@@ -25,17 +25,11 @@ impl <'a> SDLGraphicsAdapter<'a> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
pub fn draw(&self, canvas:&mut WindowCanvas) -> EmulatorResult<()> {
|
pub fn draw(&self, canvas:&mut WindowCanvas) -> EmulatorResult<()> {
|
||||||
let mut canvas_ref = &canvas;
|
|
||||||
let fb = self.graphics_processor.get_framebuffer();
|
let fb = self.graphics_processor.get_framebuffer();
|
||||||
for i in 0..fb.len() {
|
|
||||||
let i = i as u32;
|
|
||||||
let y_coord = i&0xff00;
|
|
||||||
let x_coord = i&0x00ff;
|
|
||||||
|
|
||||||
}
|
|
||||||
let xyc = fb.iter().enumerate().map(|(i,e)| {
|
let xyc = fb.iter().enumerate().map(|(i,e)| {
|
||||||
let i = i as u32;
|
let i = i as u32;
|
||||||
let y_coord = i&0xff00;
|
let y_coord = i&0xff00 >> 8;
|
||||||
let x_coord = i&0x00ff;
|
let x_coord = i&0x00ff;
|
||||||
let color = Color::new(*e);
|
let color = Color::new(*e);
|
||||||
(x_coord,y_coord,color)
|
(x_coord,y_coord,color)
|
||||||
|
Reference in New Issue
Block a user