Skip to content

Commit

Permalink
Merge pull request #8 from c-sp/add-m-currie-roms
Browse files Browse the repository at this point in the history
Add m currie roms
  • Loading branch information
c-sp committed Jul 9, 2020
2 parents 6be9ac6 + c747e5a commit 243bc23
Show file tree
Hide file tree
Showing 4 changed files with 279 additions and 13 deletions.
97 changes: 96 additions & 1 deletion .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ env:
ARTIFACTS_NAME: job-artifacts
ARTIFACTS_PATH: artifacts
ZIP_ARTIFACT_NAME: gameboy-test-roms.zip
RGBDS_ARTIFACT_NAME: rgbds

jobs:

Expand Down Expand Up @@ -61,10 +62,104 @@ jobs:
path: ${{ env.ARTIFACTS_PATH }}


rgbds:
name: build RGBDS
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v2

- name: build RGBDS
run: src/assemble.sh rgbds

- name: upload RGBDS artifact
uses: actions/upload-artifact@v1
with:
name: ${{ env.RGBDS_ARTIFACT_NAME }}
path: ${{ env.ARTIFACTS_PATH }}


dmg-acid2:
name: build dmg-acid2 test rom
runs-on: ubuntu-latest
needs: [rgbds]
steps:
- name: checkout code
uses: actions/checkout@v2

- name: download artifacts
uses: actions/download-artifact@v1
with:
name: ${{ env.RGBDS_ARTIFACT_NAME }}
path: ${{ env.ARTIFACTS_PATH }}

- name: build dmg-acid2 test rom
run: src/assemble.sh dmg-acid2

- name: upload dmg-acid2 artifact
uses: actions/upload-artifact@v1
with:
name: ${{ env.ARTIFACTS_NAME }}
path: ${{ env.ARTIFACTS_PATH }}


cgb-acid2:
name: build cgb-acid2 test rom
runs-on: ubuntu-latest
needs: [rgbds]
steps:
- name: checkout code
uses: actions/checkout@v2

- name: download artifacts
uses: actions/download-artifact@v1
with:
name: ${{ env.RGBDS_ARTIFACT_NAME }}
path: ${{ env.ARTIFACTS_PATH }}

- name: build cgb-acid2 test rom
run: src/assemble.sh cgb-acid2

- name: upload cgb-acid2 artifact
uses: actions/upload-artifact@v1
with:
name: ${{ env.ARTIFACTS_NAME }}
path: ${{ env.ARTIFACTS_PATH }}


mealybug-tearoom-tests:
name: build mealybug-tearoom-tests
runs-on: ubuntu-latest
needs: [rgbds]
steps:
- name: install "rename"
run: |
sudo apt-get update -y
sudo apt-get install -y rename
- name: checkout code
uses: actions/checkout@v2

- name: download artifacts
uses: actions/download-artifact@v1
with:
name: ${{ env.RGBDS_ARTIFACT_NAME }}
path: ${{ env.ARTIFACTS_PATH }}

- name: build mealybug-tearoom-tests
run: src/assemble.sh mealybug-tearoom-tests

- name: upload mealybug-tearoom-tests artifact
uses: actions/upload-artifact@v1
with:
name: ${{ env.ARTIFACTS_NAME }}
path: ${{ env.ARTIFACTS_PATH }}


create-release-zip:
name: create release zip
runs-on: ubuntu-latest
needs: [blargg-suite, gambatte-suite, mooneye-gb-suite]
needs: [blargg-suite, gambatte-suite, mooneye-gb-suite, dmg-acid2, cgb-acid2, mealybug-tearoom-tests]
steps:
- name: checkout code
uses: actions/checkout@v2
Expand Down
21 changes: 18 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@

# master
## [v2.0](https://github.com/c-sp/gameboy-test-roms/releases/tag/v2.0) *(2020-07-09)*

# v1.1
- use
[dmg-acid2:8a98ce731f](https://github.com/mattcurrie/dmg-acid2/tree/8a98ce731f)
*(2020-04-21)*
- use
[cgb-acid2:76c4e2c42d](https://github.com/mattcurrie/cgb-acid2/tree/76c4e2c42d)
*(2020-04-21)*
- use
[mealybug-tearoom-tests:844b92ea59](https://github.com/mattcurrie/mealybug-tearoom-tests/tree/844b92ea59)
*(2019-10-24)*
- compile dmg-acid2, cgb-acid2 and mealybug-tearoom-tests with
[RGBDS:8b60efa149](https://github.com/rednex/rgbds/tree/8b60efa149)
*(2020-06-27)*


## [v1.1](https://github.com/c-sp/gameboy-test-roms/releases/tag/v1.1) *(2020-06-14)*

- use
[mooneye-gb:6b9488fa3e](https://github.com/Gekkio/mooneye-gb/tree/6b9488fa3e)
Expand All @@ -15,7 +29,8 @@
[gambatte:56e3371151](https://github.com/sinamas/gambatte/tree/56e3371151)
*(2020-03-08)*

# v1.0

## [v1.0](https://github.com/c-sp/gameboy-test-roms/releases/tag/v1.0) *(2020-06-13)*

- compile Mooneye GB test roms with
[wla-dx:d9a3237cc2](https://github.com/vhelin/wla-dx/tree/d9a3237cc2)
Expand Down
44 changes: 36 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,28 @@

Have a Gameboy emulator you want to test for accuracy?
This collection of
[compiled Gameboy test suites](https://github.com/c-sp/gameboy-test-roms/releases)
[compiled Gameboy test roms](https://github.com/c-sp/gameboy-test-roms/releases)
might help.
It includes:

* [Mooneye GB](https://github.com/Gekkio/mooneye-gb)
test suite written by
[Joonas Javanainen](https://github.com/Gekkio)
* [Blargg's test roms](https://github.com/retrio/gb-test-roms)
written by
[Blargg](http://blargg.8bitalley.com)
* [cgb-acid2](https://github.com/mattcurrie/cgb-acid2)
test rom written by
[Matt Currie](https://github.com/mattcurrie)
* [dmg-acid2](https://github.com/mattcurrie/dmg-acid2)
test rom written by
[Matt Currie](https://github.com/mattcurrie)
* [Gambatte](https://github.com/sinamas/gambatte)
test suite written by
[sinamas](https://github.com/sinamas)
* [Gameboy test suite](https://github.com/retrio/gb-test-roms)
* [Mealybug Tearoom Tests](https://github.com/mattcurrie/mealybug-tearoom-tests)
written by
[Blargg](http://blargg.8bitalley.com/)
[Matt Currie](https://github.com/mattcurrie)
* [Mooneye GB](https://github.com/Gekkio/mooneye-gb)
test suite written by
[Joonas Javanainen](https://github.com/Gekkio)



Expand Down Expand Up @@ -42,8 +51,8 @@ The time required for a test to finish varies:

| test | emulated seconds |
|---|---|
| `cgb_cpu_instrs` | 30 |
| `dmg_cpu_instrs` | 54 |
| `cgb_cpu_instrs` | 31 |
| `dmg_cpu_instrs` | 55 |
| `cgb_instr_timing` | 1 |
| `dmg_instr_timing` | 1 |
| `cgb_mem_timing` | 4 |
Expand All @@ -58,6 +67,25 @@ respective [screenshot](src/blargg-expected).



## cgb-acid2, dmg-acid2, Mealybug Tearoom Tests

[cgb-acid2](https://github.com/mattcurrie/cgb-acid2),
[dmg-acid2](https://github.com/mattcurrie/dmg-acid2) and the
[Mealybug Tearoom Tests](https://github.com/mattcurrie/mealybug-tearoom-tests)
are located at `cgb-acid2/`, `dmg-acid2/` and `mealybug-tearoom-tests/`
respectively.
They are compiled with [RGBDS](https://github.com/rednex/rgbds).

### Exit Condition

Each of these test roms executes opcode `0x40: LD B, B` when finished.

### Test Success

For each test rom there is a screenshot of the expected result.
Some tests come with multiple screenshots to cover different Gameboy hardware.


## Gambatte test suite

[Gambatte](https://github.com/sinamas/gambatte)
Expand Down
130 changes: 129 additions & 1 deletion src/assemble.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,13 @@ print_usage_and_exit()
{
echo "usages:"
echo " $0 $CMD_BLARGG"
echo " $0 $CMD_DMG_ACID2"
echo " $0 $CMD_CGB_ACID2"
echo " $0 $CMD_GAMBATTE"
echo " $0 $CMD_MEALYBUG_TEAROOM_TESTS"
echo " $0 $CMD_MOONEYE_GB"
echo " $0 $CMD_RELEASE_ZIP <zip-file>"
echo " $0 $CMD_RGBDS"
exit 1
}

Expand Down Expand Up @@ -56,7 +60,11 @@ tar_rm_artifact()
untar_all_artifacts()
{
# untar and remove all tar files in the current directory
for f in *.tar*; do tar -xvf "$f" && rm "$f"; done
for f in *.tar*; do
if [ -f "$f" ]; then
tar -xvf "$f" && rm "$f"
fi
done
}


Expand Down Expand Up @@ -133,6 +141,117 @@ assemble_mooneye_gb()



build_rgbds()
{
ARTIFACT_NAME=rgbds
ARTIFACT=$(mkdir_artifact $ARTIFACT_NAME)

REPO_RGBDS=$(mktemp -d)
cd "$REPO_RGBDS"
git clone https://github.com/rednex/rgbds.git .
git checkout 8b60efa1495128301a407e93bd7c4ac0eb0b0f1e
make

cp rgbasm rgbfix rgbgfx rgblink "$ARTIFACT"

tar_rm_artifact $ARTIFACT_NAME
}



build_dmg_acid2()
{
# extract RGBDS artifacts
cd "$ARTIFACTS_DIR"
untar_all_artifacts
PATH="$ARTIFACTS_DIR/rgbds:$PATH"

ARTIFACT_NAME=dmg-acid2
ARTIFACT=$(mkdir_artifact $ARTIFACT_NAME)

REPO_DMG_ACID2=$(mktemp -d)
cd "$REPO_DMG_ACID2"
git clone --recurse-submodules https://github.com/mattcurrie/dmg-acid2 .
git checkout 8a98ce731f96dde032ffb22ec36dc985d78fdb18
make

cp build/dmg-acid2.gb "$ARTIFACT"
cp img/reference-cgb.png "$ARTIFACT/dmg-acid2-cgb.png"
cp img/reference-dmg.png "$ARTIFACT/dmg-acid2-dmg.png"

tar_rm_artifact $ARTIFACT_NAME
}



build_cgb_acid2()
{
# extract RGBDS artifacts
cd "$ARTIFACTS_DIR"
untar_all_artifacts
PATH="$ARTIFACTS_DIR/rgbds:$PATH"

ARTIFACT_NAME=cgb-acid2
ARTIFACT=$(mkdir_artifact $ARTIFACT_NAME)

REPO_CGB_ACID2=$(mktemp -d)
cd "$REPO_CGB_ACID2"
git clone --recurse-submodules https://github.com/mattcurrie/cgb-acid2 .
git checkout 76c4e2c42de62141dacc829232eb9e2531a79538
make

cp build/cgb-acid2.gbc "$ARTIFACT"
cp img/reference.png "$ARTIFACT/cgb-acid2.png"

tar_rm_artifact $ARTIFACT_NAME
}



build_mealybug_tearoom_tests()
{
# extract RGBDS artifacts
cd "$ARTIFACTS_DIR"
untar_all_artifacts
PATH="$ARTIFACTS_DIR/rgbds:$PATH"

ARTIFACT_NAME=mealybug-tearoom-tests
ARTIFACT=$(mkdir_artifact $ARTIFACT_NAME)

REPO_MEALYBUG_TEAROOM_TESTS=$(mktemp -d)
cd "$REPO_MEALYBUG_TEAROOM_TESTS"
git clone https://github.com/mattcurrie/mealybug-tearoom-tests.git .
git checkout 844b92ea59986cfb8a9bb66a94dd8c771aa113de
make

# Ubuntu (GitHub runner) symlinks "rename" to the Perl script "prename".
# Fedora comes with the regular "rename".
# As these two are not compatible and I thus would not be able
# to test this script on my machine, we do this the hard way ...
for f in expected/CPU\ CGB\ C/*.png; do
mv -- "$f" "${f%.png}_cgb_c.png"
done
for f in expected/CPU\ CGB\ D/*.png; do
mv -- "$f" "${f%.png}_cgb_d.png"
done
for f in expected/DMG-CPU\ B/*.png; do
mv -- "$f" "${f%.png}_dmg_b.png"
done
for f in expected/DMG-blob/*.png; do
mv -- "$f" "${f%.png}_dmg_blob.png"
done

cp build/*.gb "$ARTIFACT"
cp expected/CPU\ CGB\ C/*.png "$ARTIFACT"
cp expected/CPU\ CGB\ D/*.png "$ARTIFACT"
cp expected/DMG-CPU\ B/*.png "$ARTIFACT"
cp expected/DMG-blob/*.png "$ARTIFACT"

tar_rm_artifact $ARTIFACT_NAME
}



create_release_zip()
{
ZIP_FILE=$1
Expand All @@ -149,6 +268,7 @@ create_release_zip()

# create new zip file
untar_all_artifacts
rm -rf rgbds
zip -r "$ZIP_FILE" .
}

Expand All @@ -163,6 +283,10 @@ create_release_zip()
CMD_BLARGG=blargg-roms
CMD_GAMBATTE=gambatte-roms
CMD_MOONEYE_GB=mooneye-gb-roms
CMD_RGBDS=rgbds
CMD_DMG_ACID2=dmg-acid2
CMD_CGB_ACID2=cgb-acid2
CMD_MEALYBUG_TEAROOM_TESTS=mealybug-tearoom-tests
CMD_RELEASE_ZIP=release-zip

# identify repository directories based on the path of this script
Expand All @@ -181,6 +305,10 @@ case ${CMD} in
${CMD_BLARGG}) assemble_blargg $@ ;;
${CMD_GAMBATTE}) assemble_gambatte $@ ;;
${CMD_MOONEYE_GB}) assemble_mooneye_gb $@ ;;
${CMD_RGBDS}) build_rgbds $@ ;;
${CMD_DMG_ACID2}) build_dmg_acid2 $@ ;;
${CMD_CGB_ACID2}) build_cgb_acid2 $@ ;;
${CMD_MEALYBUG_TEAROOM_TESTS}) build_mealybug_tearoom_tests $@ ;;
${CMD_RELEASE_ZIP}) create_release_zip $@ ;;

*) print_usage_and_exit ;;
Expand Down

0 comments on commit 243bc23

Please sign in to comment.