Skip to content

Commit

Permalink
Removed useless pub(crate) from cpu.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
velllu committed Sep 7, 2023
1 parent 82cbfc0 commit e68beb3
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/cpu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type Cycles = u8;

// INC/DEC function
impl GameBoy {
pub(crate) fn increment_r(
fn increment_r(
&mut self,
register: OneByteRegister,
operator: Operator,
Expand All @@ -48,7 +48,7 @@ impl GameBoy {

// LD functions
impl GameBoy {
pub(crate) fn load_r_into_r(
fn load_r_into_r(
&mut self,
register_to_be_loaded: OneByteRegister,
register: OneByteRegister,
Expand All @@ -59,19 +59,19 @@ impl GameBoy {
*register = register_to_be_loaded;
}

pub(crate) fn load_i_into_r(&mut self, register: OneByteRegister) {
fn load_i_into_r(&mut self, register: OneByteRegister) {
let i = self.next(1);

let register = self.registers.get_r(register);
*register = i;
}

pub(crate) fn load_r_into_io(&mut self, register: OneByteRegister) {
fn load_r_into_io(&mut self, register: OneByteRegister) {
let register = *self.registers.get_r(register);
self.bus.write_byte((IO_START + self.next(1) as usize) as u16, register);
}

pub(crate) fn load_io_into_r(&mut self, register: OneByteRegister) {
fn load_io_into_r(&mut self, register: OneByteRegister) {
let i = self.next(1);

let register = self.registers.get_r(register);
Expand All @@ -81,24 +81,24 @@ impl GameBoy {

// CP functions
impl GameBoy {
pub(crate) fn compare_ra_to_i(&mut self) {
fn compare_ra_to_i(&mut self) {
self.flags.update_zero_flag(self.registers.a.wrapping_sub(self.next(1)));
}

pub(crate) fn compare_ra_to_r(&mut self, register: OneByteRegister) {
fn compare_ra_to_r(&mut self, register: OneByteRegister) {
let register = *self.registers.get_r(register);
self.flags.update_zero_flag(self.registers.a.wrapping_sub(register));
}

pub(crate) fn compare_ra_to_ram(&mut self, address: u16) {
fn compare_ra_to_ram(&mut self, address: u16) {
let ram = self.bus.read(address);
self.flags.update_zero_flag(self.registers.a.wrapping_sub(ram));
}
}

// Jump Functions
impl GameBoy {
pub(crate) fn jump(&mut self, address: u16) {
fn jump(&mut self, address: u16) {
self.registers.pc = address;
}

Expand All @@ -115,7 +115,7 @@ impl GameBoy {

// Bitwise operation functions (not all of them as of now)
impl GameBoy {
pub(crate) fn xor_r(&mut self, register: OneByteRegister) {
fn xor_r(&mut self, register: OneByteRegister) {
let register_a = *self.registers.get_r(OneByteRegister::A);
let register = self.registers.get_r(register);

Expand Down

0 comments on commit e68beb3

Please sign in to comment.