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
45de318a
Verified
Commit
45de318a
authored
1 year ago
by
João Magalhães
Browse files
Options
Downloads
Patches
Plain Diff
chore: initial DMG improvement refactor
parent
cb035495
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!24
Performance optimisations
Pipeline
#2831
passed
1 year ago
Stage: build
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/ppu.rs
+12
-5
12 additions, 5 deletions
src/ppu.rs
with
12 additions
and
5 deletions
src/ppu.rs
+
12
−
5
View file @
45de318a
...
...
@@ -1068,18 +1068,27 @@ impl Ppu {
}
let
switch_bg_window
=
(
self
.gb_mode
==
GameBoyMode
::
Cgb
&&
!
self
.dmg_compat
)
||
self
.switch_bg
;
if
switch_bg_window
{
self
.render_map_no_cgb
(
self
.bg_map
,
self
.scx
,
self
.scy
,
0
,
0
,
self
.ly
);
if
self
.gb_mode
==
GameBoyMode
::
Dmg
{
self
.render_map_dmg
(
self
.bg_map
,
self
.scx
,
self
.scy
,
0
,
0
,
self
.ly
);
}
else
{
self
.render_map
(
self
.bg_map
,
self
.scx
,
self
.scy
,
0
,
0
,
self
.ly
);
}
}
if
switch_bg_window
&&
self
.switch_window
{
self
.render_map_no_cgb
(
self
.window_map
,
0
,
0
,
self
.wx
,
self
.wy
,
self
.window_counter
);
if
self
.gb_mode
==
GameBoyMode
::
Dmg
{
self
.render_map_dmg
(
self
.window_map
,
0
,
0
,
self
.wx
,
self
.wy
,
self
.window_counter
);
}
else
{
self
.render_map
(
self
.window_map
,
0
,
0
,
self
.wx
,
self
.wy
,
self
.window_counter
);
}
}
if
self
.switch_obj
{
self
.render_objects
();
}
}
fn
render_map_
no_cgb
(
&
mut
self
,
map
:
bool
,
scx
:
u8
,
scy
:
u8
,
wx
:
u8
,
wy
:
u8
,
ld
:
u8
)
{
fn
render_map_
dmg
(
&
mut
self
,
map
:
bool
,
scx
:
u8
,
scy
:
u8
,
wx
:
u8
,
wy
:
u8
,
ld
:
u8
)
{
// in case the target window Y position has not yet been reached
// then there's nothing to be done, returns control flow immediately
if
self
.ly
<
wy
{
...
...
@@ -1231,8 +1240,6 @@ impl Ppu {
// obtains the reference to the attributes of the new tile in
// drawing for meta processing (CGB only)
// @TODO: This strategy seems a bit naive, need to figure out
// if there's a better way to do this and a more performant one
let
mut
tile_attr
=
if
self
.dmg_compat
{
&
DEFAULT_TILE_ATTR
}
else
{
...
...
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