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
6bc8fc27
Verified
Commit
6bc8fc27
authored
2 years ago
by
João Magalhães
Browse files
Options
Downloads
Patches
Plain Diff
feat: better format
parent
c7b4ad88
No related branches found
No related tags found
No related merge requests found
Pipeline
#846
passed
2 years ago
Stage: build
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/mmu.rs
+29
-27
29 additions, 27 deletions
src/mmu.rs
with
29 additions
and
27 deletions
src/mmu.rs
+
29
−
27
View file @
6bc8fc27
...
@@ -80,7 +80,7 @@ impl Mmu {
...
@@ -80,7 +80,7 @@ impl Mmu {
0x00
=>
{
0x00
=>
{
println!
(
"Reading from Game Pad control 0x{:04x}"
,
addr
);
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
...
@@ -129,39 +129,41 @@ impl Mmu {
...
@@ -129,39 +129,41 @@ impl Mmu {
self
.ram
[(
addr
&
0x1fff
)
as
usize
]
=
value
;
self
.ram
[(
addr
&
0x1fff
)
as
usize
]
=
value
;
}
}
// Working RAM Shadow, I/O, Zero-page RAM
// Working RAM Shadow, I/O, Zero-page RAM
0xf000
=>
match
addr
&
0x0f00
{
0xf000
=>
{
0x000
|
0x100
|
0x200
|
0x300
|
0x400
|
0x500
|
0x600
|
0x700
|
0x800
|
0x900
match
addr
&
0x0f00
{
|
0xa00
|
0xb00
|
0xc00
|
0xd00
=>
{
0x000
|
0x100
|
0x200
|
0x300
|
0x400
|
0x500
|
0x600
|
0x700
|
0x800
self
.ram
[(
addr
&
0x1fff
)
as
usize
]
=
value
;
|
0x900
|
0xa00
|
0xb00
|
0xc00
|
0xd00
=>
{
}
self
.ram
[(
addr
&
0x1fff
)
as
usize
]
=
value
;
0xe00
=>
{
}
println!
(
"Writing to PPU OAM at 0x{:04x}"
,
addr
);
0xe00
=>
{
}
println!
(
"Writing to PPU OAM at 0x{:04x}"
,
addr
);
0xf00
=>
{
}
if
addr
>=
0xff80
{
0xf00
=>
{
self
.ppu.hram
[(
addr
&
0x007f
)
as
usize
]
=
value
;
if
addr
>=
0xff80
{
}
else
{
self
.ppu.hram
[(
addr
&
0x007f
)
as
usize
]
=
value
;
match
addr
&
0x00f0
{
}
else
{
0x40
|
0x60
|
0x70
=>
{
match
addr
&
0x00f0
{
self
.ppu
.write
(
addr
,
value
);
0x40
|
0x60
|
0x70
=>
{
}
self
.ppu
.write
(
addr
,
value
);
0x00
=>
{
}
println!
(
"Writing to Game Pad, timer, etc. control 0x{:04x} := 0x{:02x}"
,
addr
,
value
);
0x00
=>
{
},
println!
(
"Writing to Game Pad, timer, etc. control 0x{:04x} := 0x{:02x}"
,
addr
,
value
);
0x50
=>
match
addr
&
0x00ff
{
}
0x50
=>
self
.boot_active
=
false
,
0x50
=>
match
addr
&
0x00ff
{
0x50
=>
self
.boot_active
=
false
,
_
=>
{
println!
(
"Writing to unknown IO control 0x{:04x}"
,
addr
);
}
},
_
=>
{
_
=>
{
println!
(
"Writing to unknown IO control 0x{:04x}"
,
addr
);
println!
(
"Writing to unknown IO control 0x{:04x}"
,
addr
);
}
}
},
_
=>
{
println!
(
"Writing to unknown IO control 0x{:04x}"
,
addr
);
}
}
}
}
}
}
addr
=>
panic!
(
"Writing in unknown location 0x{:04x}"
,
addr
),
}
}
addr
=>
panic!
(
"Writing in unknown location 0x{:04x}"
,
addr
),
}
},
addr
=>
panic!
(
"Writing in unknown location 0x{:04x}"
,
addr
),
addr
=>
panic!
(
"Writing in unknown location 0x{:04x}"
,
addr
),
}
}
}
}
...
...
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