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
c7b4ad88
Verified
Commit
c7b4ad88
authored
2 years ago
by
João Magalhães
Browse files
Options
Downloads
Patches
Plain Diff
feat: new debug info
parent
498ab1a2
No related branches found
No related tags found
No related merge requests found
Pipeline
#845
passed
2 years ago
Stage: build
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/cpu.rs
+2
-2
2 additions, 2 deletions
src/cpu.rs
src/mmu.rs
+9
-2
9 additions, 2 deletions
src/mmu.rs
with
11 additions
and
4 deletions
src/cpu.rs
+
2
−
2
View file @
c7b4ad88
...
@@ -96,12 +96,12 @@ impl Cpu {
...
@@ -96,12 +96,12 @@ impl Cpu {
let
(
instruction_fn
,
instruction_time
,
instruction_str
)
=
instruction
;
let
(
instruction_fn
,
instruction_time
,
instruction_str
)
=
instruction
;
//
if *instruction_str == "! UNIMP !" {
if
!
self
.mmu
.boot_active
()
||
*
instruction_str
==
"! UNIMP !"
{
println!
(
println!
(
"{}
\t
(0x{:02x})
\t
${:04x} {}"
,
"{}
\t
(0x{:02x})
\t
${:04x} {}"
,
instruction_str
,
opcode
,
pc
,
is_prefix
instruction_str
,
opcode
,
pc
,
is_prefix
);
);
//
}
}
// calls the current instruction and increments the number of
// calls the current instruction and increments the number of
// cycles executed by the instruction time of the instruction
// cycles executed by the instruction time of the instruction
...
...
This diff is collapsed.
Click to expand it.
src/mmu.rs
+
9
−
2
View file @
c7b4ad88
...
@@ -30,6 +30,10 @@ impl Mmu {
...
@@ -30,6 +30,10 @@ impl Mmu {
&
mut
self
.ppu
&
mut
self
.ppu
}
}
pub
fn
boot_active
(
&
self
)
->
bool
{
self
.boot_active
}
pub
fn
read
(
&
mut
self
,
addr
:
u16
)
->
u8
{
pub
fn
read
(
&
mut
self
,
addr
:
u16
)
->
u8
{
match
addr
&
0xf000
{
match
addr
&
0xf000
{
// BOOT (256 B) + ROM0 (4 KB/16 KB)
// BOOT (256 B) + ROM0 (4 KB/16 KB)
...
@@ -74,9 +78,9 @@ impl Mmu {
...
@@ -74,9 +78,9 @@ impl Mmu {
match
addr
&
0x00f0
{
match
addr
&
0x00f0
{
0x40
|
0x50
|
0x60
|
0x70
=>
self
.ppu
.read
(
addr
),
0x40
|
0x50
|
0x60
|
0x70
=>
self
.ppu
.read
(
addr
),
0x00
=>
{
0x00
=>
{
//@todo implement the gamepad as a controller
println!
(
"Reading from Game Pad control 0x{:04x}"
,
addr
);
0x00
0x00
}
}
,
_
=>
{
_
=>
{
println!
(
"Reading from unknown IO control 0x{:04x}"
,
addr
);
println!
(
"Reading from unknown IO control 0x{:04x}"
,
addr
);
0x00
0x00
...
@@ -141,6 +145,9 @@ impl Mmu {
...
@@ -141,6 +145,9 @@ impl Mmu {
0x40
|
0x60
|
0x70
=>
{
0x40
|
0x60
|
0x70
=>
{
self
.ppu
.write
(
addr
,
value
);
self
.ppu
.write
(
addr
,
value
);
}
}
0x00
=>
{
println!
(
"Writing to Game Pad, timer, etc. control 0x{:04x} := 0x{:02x}"
,
addr
,
value
);
},
0x50
=>
match
addr
&
0x00ff
{
0x50
=>
match
addr
&
0x00ff
{
0x50
=>
self
.boot_active
=
false
,
0x50
=>
self
.boot_active
=
false
,
_
=>
{
_
=>
{
...
...
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