Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
boytacean
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
João Magalhães
boytacean
Commits
c5ef259a
Verified
Commit
c5ef259a
authored
1 year ago
by
João Magalhães
Browse files
Options
Downloads
Patches
Plain Diff
fix: better code format
parent
93e0d10e
No related branches found
No related tags found
1 merge request
!23
Support for serial data transfer 🔌
Pipeline
#2501
passed
1 year ago
Stage: build
Stage: test
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
src/devices/printer.rs
+1
-2
1 addition, 2 deletions
src/devices/printer.rs
src/devices/stdout.rs
+2
-4
2 additions, 4 deletions
src/devices/stdout.rs
src/gb.rs
+2
-1
2 additions, 1 deletion
src/gb.rs
src/lib.rs
+1
-1
1 addition, 1 deletion
src/lib.rs
src/serial.rs
+3
-5
3 additions, 5 deletions
src/serial.rs
with
9 additions
and
13 deletions
src/devices/printer.rs
+
1
−
2
View file @
c5ef259a
use
crate
::
serial
::
SerialDevice
;
pub
struct
PrinterDevice
{
}
pub
struct
PrinterDevice
{}
impl
PrinterDevice
{
pub
fn
new
()
->
Self
{
...
...
This diff is collapsed.
Click to expand it.
src/devices/stdout.rs
+
2
−
4
View file @
c5ef259a
...
...
@@ -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
}
}
}
...
...
This diff is collapsed.
Click to expand it.
src/gb.rs
+
2
−
1
View file @
c5ef259a
...
...
@@ -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
;
...
...
This diff is collapsed.
Click to expand it.
src/lib.rs
+
1
−
1
View file @
c5ef259a
...
...
@@ -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
;
...
...
This diff is collapsed.
Click to expand it.
src/serial.rs
+
3
−
5
View file @
c5ef259a
...
...
@@ -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
)
{}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment