Skip to content
Snippets Groups Projects
Verified Commit c5ef259a authored by João Magalhães's avatar João Magalhães :rocket:
Browse files

fix: better code format

parent 93e0d10e
No related branches found
No related tags found
1 merge request!23Support for serial data transfer 🔌
Pipeline #2501 passed
use crate::serial::SerialDevice;
pub struct PrinterDevice {
}
pub struct PrinterDevice {}
impl PrinterDevice {
pub fn new() -> Self {
......
......@@ -3,14 +3,12 @@ use std::io::{stdout, Write};
use crate::serial::SerialDevice;
pub struct StdoutDevice {
flush: bool
flush: bool,
}
impl StdoutDevice {
pub fn new(flush: bool) -> Self {
Self {
flush
}
Self { flush }
}
}
......
......@@ -2,6 +2,7 @@ use crate::{
apu::Apu,
cpu::Cpu,
data::{BootRom, CGB_BOOT, DMG_BOOT, DMG_BOOTIX, MGB_BOOTIX, SGB_BOOT},
devices::{printer::PrinterDevice, stdout::StdoutDevice},
gen::{COMPILATION_DATE, COMPILATION_TIME, COMPILER, COMPILER_VERSION},
mmu::Mmu,
pad::{Pad, PadKey},
......@@ -9,7 +10,7 @@ use crate::{
rom::Cartridge,
serial::Serial,
timer::Timer,
util::read_file, devices::{stdout::StdoutDevice, printer::PrinterDevice},
util::read_file,
};
use std::collections::VecDeque;
......
......@@ -2,8 +2,8 @@
pub mod apu;
pub mod cpu;
pub mod devices;
pub mod data;
pub mod devices;
pub mod gb;
pub mod gen;
pub mod inst;
......
......@@ -159,7 +159,7 @@ impl Serial {
if self.bit_count == 8 {
self.transferring = false;
self.length = 0;
self.bit_count = 0;
self.bit_count = 0;
// signals the interrupt for the serial
// transfer completion, indicating that
......@@ -175,8 +175,7 @@ impl Default for Serial {
}
}
pub struct NullDevice {
}
pub struct NullDevice {}
impl NullDevice {
pub fn new() -> Self {
......@@ -195,6 +194,5 @@ impl SerialDevice for NullDevice {
0xff
}
fn receive(&mut self, _: u8) {
}
fn receive(&mut self, _: u8) {}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment