Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
NES Emulator testing
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
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
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Computer and Embedded Systems Engineering
Software Fundamentals
NES Emulator testing
Commits
1f55a0bc
Commit
1f55a0bc
authored
Sep 23, 2022
by
Vivian Roest
Browse files
Options
Downloads
Patches
Plain Diff
add basic nrom test
https://gitlab.ewi.tudelft.nl/software-fundamentals/nes-nrom-test
parent
46115579
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
Cargo.lock
+1
-1
1 addition, 1 deletion
Cargo.lock
Cargo.toml
+1
-1
1 addition, 1 deletion
Cargo.toml
src/lib.rs
+30
-2
30 additions, 2 deletions
src/lib.rs
src/roms/nrom-test.nes
+0
-0
0 additions, 0 deletions
src/roms/nrom-test.nes
with
32 additions
and
4 deletions
Cargo.lock
+
1
−
1
View file @
1f55a0bc
...
...
@@ -1031,7 +1031,7 @@ dependencies = [
[[package]]
name = "tudelft-nes-test"
version = "1.
0
.0"
version = "1.
1
.0"
dependencies = [
"bitflags",
"log",
...
...
This diff is collapsed.
Click to expand it.
Cargo.toml
+
1
−
1
View file @
1f55a0bc
[package]
name
=
"tudelft-nes-test"
version
=
"1.
0
.0"
version
=
"1.
1
.0"
edition
=
"2021"
authors
=
[
"Victor Roest <victor@xirion.net>"
,
...
...
This diff is collapsed.
Click to expand it.
src/lib.rs
+
30
−
2
View file @
1f55a0bc
...
...
@@ -23,8 +23,9 @@ bitflags! {
const
NESTEST
=
0b00000001
;
const
ALL_INSTRS
=
0b00000010
;
const
OFFICIAL_INSTRS
=
0b00000100
;
const
ALL
=
Self
::
NESTEST
.bits
|
Self
::
ALL_INSTRS
.bits
;
const
DEFAULT
=
Self
::
OFFICIAL_INSTRS
.bits
;
const
NROM_TEST
=
0b00001000
;
const
ALL
=
Self
::
NESTEST
.bits
|
Self
::
ALL_INSTRS
.bits
|
Self
::
NROM_TEST
.bits
;
const
DEFAULT
=
Self
::
OFFICIAL_INSTRS
.bits
|
Self
::
NROM_TEST
.bits
;
}
}
...
...
@@ -47,6 +48,10 @@ pub fn run_tests<T: TestableCpu>(selector: TestSelector) -> Result<(), String> {
nestest
::
<
T
>
()
?
;
}
if
selector
.contains
(
TestSelector
::
NROM_TEST
)
{
nrom_test
::
<
T
>
()
?
;
}
Ok
(())
}
...
...
@@ -147,6 +152,29 @@ fn nestest<T: TestableCpu + 'static>() -> Result<(), String> {
process_handle
(
"nestest"
,
handle
)
}
/// runs our own nrom test rom
/// https://gitlab.ewi.tudelft.nl/software-fundamentals/nes-nrom-test
fn
nrom_test
<
T
:
TestableCpu
+
'static
>
()
->
Result
<
(),
String
>
{
let
rom
=
include_bytes!
(
"roms/nrom-test.nes"
);
let
handle
=
thread
::
spawn
(||
{
let
mut
cpu
=
T
::
get_cpu
(
rom
)
.map_err
(|
i
|
TestError
::
Custom
(
i
.to_string
()))
?
;
run_cpu_headless_for
(
&
mut
cpu
,
Mirroring
::
Horizontal
,
10
)
.map_err
(|
i
|
TestError
::
Custom
(
i
.to_string
()))
?
;
if
cpu
.memory_read
(
0x42
)
!=
0x43
{
Err
(
TestError
::
String
(
"memory location 0x42 is wrong after executing nrom_test"
.to_owned
()))
}
else
if
cpu
.memory_read
(
0x43
)
!=
0x6A
{
Err
(
TestError
::
String
(
"memory location 0x43 is wrong after executing nrom_test"
.to_owned
()))
}
else
{
Ok
(())
}
});
process_handle
(
"nrom_test"
,
handle
)
}
#[derive(Debug,
Error)]
enum
TestError
{
#[error(
"{0}"
)]
...
...
This diff is collapsed.
Click to expand it.
src/roms/nrom-test.nes
0 → 100644
+
0
−
0
View file @
1f55a0bc
File added
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
sign in
to comment