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
e62baabd
Commit
e62baabd
authored
Oct 11, 2022
by
Vivian Roest
Browse files
Options
Downloads
Patches
Plain Diff
make roms public
parent
e827f664
No related branches found
No related tags found
1 merge request
!1
make roms public
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/lib.rs
+9
-4
9 additions, 4 deletions
src/lib.rs
with
9 additions
and
4 deletions
src/lib.rs
+
9
−
4
View file @
e62baabd
...
@@ -13,6 +13,11 @@ mod nestest;
...
@@ -13,6 +13,11 @@ mod nestest;
use
crate
::
nestest
::
nestest_status_code
;
use
crate
::
nestest
::
nestest_status_code
;
pub
const
ROM_ALL_INSTR
:
&
[
u8
]
=
include_bytes!
(
"roms/all_instrs.nes"
);
pub
const
ROM_NESTEST
:
&
[
u8
]
=
include_bytes!
(
"roms/nestest.nes"
);
pub
const
ROM_NROM_TEST
:
&
[
u8
]
=
include_bytes!
(
"roms/nrom-test.nes"
);
pub
const
ROM_OFFICIAL_ONLY
:
&
[
u8
]
=
include_bytes!
(
"roms/official_only.nes"
);
/// Implement this trait to run our test on our CPU via the [`run_tests`] function.
/// Implement this trait to run our test on our CPU via the [`run_tests`] function.
pub
trait
TestableCpu
:
Cpu
+
Sized
+
'static
{
pub
trait
TestableCpu
:
Cpu
+
Sized
+
'static
{
/// This function is used by the test suite to get a handle on your CPU
/// This function is used by the test suite to get a handle on your CPU
...
@@ -86,9 +91,9 @@ pub fn run_tests<T: TestableCpu>(selector: TestSelector) -> Result<(), String> {
...
@@ -86,9 +91,9 @@ pub fn run_tests<T: TestableCpu>(selector: TestSelector) -> Result<(), String> {
/// https://github.com/christopherpow/nes-test-roms/tree/master/instr_test-v5
/// https://github.com/christopherpow/nes-test-roms/tree/master/instr_test-v5
fn
all_instrs
<
T
:
TestableCpu
+
'static
>
(
only_official
:
bool
)
->
Result
<
(),
String
>
{
fn
all_instrs
<
T
:
TestableCpu
+
'static
>
(
only_official
:
bool
)
->
Result
<
(),
String
>
{
let
(
rom
,
limit
)
=
if
only_official
{
let
(
rom
,
limit
)
=
if
only_official
{
(
include_bytes!
(
"roms/official_only.nes"
)
,
350
)
(
ROM_OFFICIAL_ONLY
,
350
)
}
else
{
}
else
{
(
include_bytes!
(
"roms/all_instrs.nes"
)
,
500
)
(
ROM_ALL_INSTR
,
500
)
};
};
let
handle
=
thread
::
spawn
(
move
||
{
let
handle
=
thread
::
spawn
(
move
||
{
...
@@ -152,7 +157,7 @@ fn all_instrs<T: TestableCpu + 'static>(only_official: bool) -> Result<(), Strin
...
@@ -152,7 +157,7 @@ fn all_instrs<T: TestableCpu + 'static>(only_official: bool) -> Result<(), Strin
/// Runs the nestest rom:
/// Runs the nestest rom:
/// https://github.com/christopherpow/nes-test-roms/blob/master/other/nestest.nes
/// https://github.com/christopherpow/nes-test-roms/blob/master/other/nestest.nes
fn
nestest
<
T
:
TestableCpu
+
'static
>
()
->
Result
<
(),
String
>
{
fn
nestest
<
T
:
TestableCpu
+
'static
>
()
->
Result
<
(),
String
>
{
let
rom
=
include_bytes!
(
"roms/nestest.nes"
)
;
let
rom
=
ROM_NESTEST
;
let
handle
=
thread
::
spawn
(||
{
let
handle
=
thread
::
spawn
(||
{
// TODO: make initial program counter obsolete by modifying nestest
// TODO: make initial program counter obsolete by modifying nestest
...
@@ -182,7 +187,7 @@ fn nestest<T: TestableCpu + 'static>() -> Result<(), String> {
...
@@ -182,7 +187,7 @@ fn nestest<T: TestableCpu + 'static>() -> Result<(), String> {
/// runs our own nrom test rom
/// runs our own nrom test rom
/// https://gitlab.ewi.tudelft.nl/software-fundamentals/nes-nrom-test
/// https://gitlab.ewi.tudelft.nl/software-fundamentals/nes-nrom-test
fn
nrom_test
<
T
:
TestableCpu
+
'static
>
()
->
Result
<
(),
String
>
{
fn
nrom_test
<
T
:
TestableCpu
+
'static
>
()
->
Result
<
(),
String
>
{
let
rom
=
include_bytes!
(
"roms/nrom-test.nes"
)
;
let
rom
=
ROM_NROM_TEST
;
let
handle
=
thread
::
spawn
(||
{
let
handle
=
thread
::
spawn
(||
{
let
mut
cpu
=
T
::
get_cpu
(
rom
)
.map_err
(|
i
|
TestError
::
Custom
(
i
.to_string
()))
?
;
let
mut
cpu
=
T
::
get_cpu
(
rom
)
.map_err
(|
i
|
TestError
::
Custom
(
i
.to_string
()))
?
;
...
...
...
...
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