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
dc2f83d0
Verified
Commit
dc2f83d0
authored
2 years ago
by
João Magalhães
Browse files
Options
Downloads
Patches
Plain Diff
feat: new test stage
parent
9e0a00c2
No related branches found
No related tags found
1 merge request
!18
Multiple PPU fixes that make Boytacean pass dmg_acid2 🎉
Pipeline
#1653
failed
2 years ago
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+11
-0
11 additions, 0 deletions
.gitlab-ci.yml
src/ppu.rs
+34
-9
34 additions, 9 deletions
src/ppu.rs
with
45 additions
and
9 deletions
.gitlab-ci.yml
+
11
−
0
View file @
dc2f83d0
...
...
@@ -51,6 +51,17 @@ build-wasm:
-
frontends/web/lib
expire_in
:
1 day
test-rust
:
stage
:
test
parallel
:
matrix
:
-
RUST_VERSION
:
[
"
1.56.1"
,
"
1.60.0"
,
"
stable"
,
"
nightly"
]
script
:
-
rustup toolchain install $RUST_VERSION
-
rustup override set $RUST_VERSION
-
rustc --version
-
cargo test
deploy-netlify-preview
:
stage
:
deploy
script
:
...
...
This diff is collapsed.
Click to expand it.
src/ppu.rs
+
34
−
9
View file @
dc2f83d0
...
...
@@ -656,7 +656,7 @@ impl Ppu {
let
mut
mask
;
for
x
in
0
..
TILE_WIDTH
{
mask
=
1
<<
(
7
-
x
);
mask
=
1
<<
(
TILE_WIDTH
-
1
-
x
);
tile
.set
(
x
,
y
,
...
...
@@ -725,14 +725,6 @@ impl Ppu {
return
;
}
if
wx
>=
166
{
return
;
}
if
wy
>=
143
{
return
;
}
// calculates the LD (line delta) useful for draw operations where the window
// is repositioned, as the current line for tile calculus is different from
// the one currently in drawing
...
...
@@ -1022,3 +1014,36 @@ impl Default for Ppu {
Self
::
new
()
}
}
#[cfg(test)]
mod
tests
{
use
crate
::
ppu
::
Ppu
;
#[test]
fn
test_update_tile_simple
()
{
let
mut
ppu
=
Ppu
::
new
();
ppu
.vram
[
0x0000
]
=
0xff
;
ppu
.vram
[
0x0001
]
=
0xff
;
let
result
=
ppu
.tiles
()[
0
]
.get
(
0
,
0
);
assert_eq!
(
result
,
0
);
ppu
.update_tile
(
0x8000
,
0x00
);
let
result
=
ppu
.tiles
()[
0
]
.get
(
0
,
0
);
assert_eq!
(
result
,
3
);
}
#[test]
fn
test_update_tile_upper
()
{
let
mut
ppu
=
Ppu
::
new
();
ppu
.vram
[
0x1000
]
=
0xff
;
ppu
.vram
[
0x1001
]
=
0xff
;
let
result
=
ppu
.tiles
()[
256
]
.get
(
0
,
0
);
assert_eq!
(
result
,
0
);
ppu
.update_tile
(
0x9000
,
0x00
);
let
result
=
ppu
.tiles
()[
256
]
.get
(
0
,
0
);
assert_eq!
(
result
,
3
);
}
}
\ No newline at end of file
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