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
5de8af66
Verified
Commit
5de8af66
authored
2 years ago
by
João Magalhães
Browse files
Options
Downloads
Patches
Plain Diff
feat: small refactor and some docs added
parent
050c2ca2
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.md
+3
-0
3 additions, 0 deletions
README.md
src/cpu.rs
+5
-5
5 additions, 5 deletions
src/cpu.rs
with
8 additions
and
5 deletions
README.md
+
3
−
0
View file @
5de8af66
...
@@ -11,6 +11,9 @@ A Game Boy emulator that is written in Rust 🦀.
...
@@ -11,6 +11,9 @@ A Game Boy emulator that is written in Rust 🦀.
*
[
GameBoy Emulation in JavaScript
](
http://imrannazar.com/GameBoy-Emulation-in-JavaScript:-The-CPU
)
*
[
GameBoy Emulation in JavaScript
](
http://imrannazar.com/GameBoy-Emulation-in-JavaScript:-The-CPU
)
*
[
POKEGB: a gameboy emulator that only plays Pokémon blue
](
https://binji.github.io/posts/pokegb
)
*
[
POKEGB: a gameboy emulator that only plays Pokémon blue
](
https://binji.github.io/posts/pokegb
)
*
[
Game Boy CPU Opcodes
](
https://izik1.github.io/gbops
)
*
[
Game Boy CPU Opcodes
](
https://izik1.github.io/gbops
)
### ROMs
*
[
GitHub - c-sp/gameboy-test-roms
](
https://github.com/c-sp/gameboy-test-roms
)
*
[
GitHub - c-sp/gameboy-test-roms
](
https://github.com/c-sp/gameboy-test-roms
)
### Emulators
### Emulators
...
...
This diff is collapsed.
Click to expand it.
src/cpu.rs
+
5
−
5
View file @
5de8af66
...
@@ -431,7 +431,7 @@ pub struct Cpu {
...
@@ -431,7 +431,7 @@ pub struct Cpu {
half_carry
:
bool
,
half_carry
:
bool
,
carry
:
bool
,
carry
:
bool
,
mmu
:
Mmu
,
mmu
:
Mmu
,
clo
cks
:
u32
,
ti
cks
:
u32
,
}
}
impl
Cpu
{
impl
Cpu
{
...
@@ -451,7 +451,7 @@ impl Cpu {
...
@@ -451,7 +451,7 @@ impl Cpu {
half_carry
:
false
,
half_carry
:
false
,
carry
:
false
,
carry
:
false
,
mmu
:
mmu
,
mmu
:
mmu
,
clo
cks
:
0
,
ti
cks
:
0
,
}
}
}
}
...
@@ -475,10 +475,10 @@ impl Cpu {
...
@@ -475,10 +475,10 @@ impl Cpu {
let
(
instruction_fn
,
instruction_size
,
instruction_str
)
=
instruction
;
let
(
instruction_fn
,
instruction_size
,
instruction_str
)
=
instruction
;
println!
(
"{}
\t
(
{:#
x})
\t
${:04x}"
,
instruction_str
,
opcode
,
pc
);
println!
(
"{}
\t
(
0x{:02
x})
\t
${:04x}"
,
instruction_str
,
opcode
,
pc
);
instruction_fn
(
self
);
instruction_fn
(
self
);
self
.
clo
cks
=
self
.
clo
cks
.wrapping_add
(
*
instruction_size
as
u32
);
self
.
ti
cks
=
self
.
ti
cks
.wrapping_add
(
*
instruction_size
as
u32
);
}
}
#[inline(always)]
#[inline(always)]
...
@@ -668,7 +668,7 @@ fn jr_nz_i8(cpu: &mut Cpu) {
...
@@ -668,7 +668,7 @@ fn jr_nz_i8(cpu: &mut Cpu) {
}
}
cpu
.pc
=
(
cpu
.pc
as
i16
)
.wrapping_add
(
byte
as
i16
)
as
u16
;
cpu
.pc
=
(
cpu
.pc
as
i16
)
.wrapping_add
(
byte
as
i16
)
as
u16
;
cpu
.
clo
cks
+
=
4
;
cpu
.
ti
cks
=
cpu
.ticks
.wrapping_add
(
4
)
;
}
}
fn
ld_hl_u16
(
cpu
:
&
mut
Cpu
)
{
fn
ld_hl_u16
(
cpu
:
&
mut
Cpu
)
{
...
...
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