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
268193f4
Verified
Commit
268193f4
authored
2 years ago
by
João Magalhães
Browse files
Options
Downloads
Patches
Plain Diff
feat: better drawing of line
parent
85b6d502
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
src/mmu.rs
+0
-1
0 additions, 1 deletion
src/mmu.rs
src/ppu.rs
+7
-5
7 additions, 5 deletions
src/ppu.rs
with
7 additions
and
6 deletions
src/mmu.rs
+
0
−
1
View file @
268193f4
...
...
@@ -111,7 +111,6 @@ impl Mmu {
}
// Graphics: VRAM (8k)
0x8000
|
0x9000
=>
{
println!
(
"WRITING TO VRAM"
);
self
.ppu.vram
[(
addr
&
0x1fff
)
as
usize
]
=
value
;
if
addr
<
0x9800
{
self
.ppu
.update_tile
(
addr
,
value
);
...
...
This diff is collapsed.
Click to expand it.
src/ppu.rs
+
7
−
5
View file @
268193f4
...
...
@@ -214,16 +214,18 @@ impl Ppu {
let
y
=
((
self
.scy
+
self
.line
)
&
0x07
)
as
usize
;
let
mut
x
=
(
self
.scx
&
0x07
)
as
usize
;
let
mut
frame_offset
=
self
.line
as
usize
*
SCREEN_WIDTH
*
RGBA_SIZE
;
// calculates the index of the initial tile in drawing,
// if the tile data set in use is #1, the indices are
// signed, then calculates a real tile offset
let
mut
tile_index
=
self
.vram
[
map_offset
+
line_offset
]
as
usize
;
// if the tile data set in use is #1, the
// indices are signed, calculates a real tile offset
if
self
.bg_tile
&&
tile_index
<
128
{
tile_index
+=
256
;
}
// calculates the frame buffer offset position assuming the proper
// Game Boy screen width and RGBA pixel (4 bytes) size
let
mut
frame_offset
=
self
.line
as
usize
*
SCREEN_WIDTH
*
RGBA_SIZE
;
for
_index
in
0
..
SCREEN_WIDTH
{
// in case the end of tile width has been reached then
// a new tile must be retrieved for plotting
...
...
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