Skip to content

Commit

Permalink
added mbc3 tester (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
c-sp authored Feb 12, 2024
2 parents d7108b5 + e780c1d commit 815cdd2
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/assemble-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ SCRIPT_DIR=$(dirname "$0")
"$SCRIPT_DIR/assemble.sh" gambatte-roms
"$SCRIPT_DIR/assemble.sh" gbmicrotest
"$SCRIPT_DIR/assemble.sh" little-things-gb
"$SCRIPT_DIR/assemble.sh" mbc3-tester
"$SCRIPT_DIR/assemble.sh" mealybug-tearoom-tests
"$SCRIPT_DIR/assemble.sh" mooneye-test-suite
"$SCRIPT_DIR/assemble.sh" mooneye-test-suite-wilbertpol
Expand Down
30 changes: 30 additions & 0 deletions src/assemble.sh
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,34 @@ build_little_things_gb()
}


build_mbc3_tester()
{
print_cmd_title

chmod +x "$ARTIFACTS_DIR/rgbds/"*
PATH="$ARTIFACTS_DIR/rgbds:$PATH"

ARTIFACT_NAME=mbc3-tester
ARTIFACT=$(mkdir_artifact $ARTIFACT_NAME)

REPO=$(mktemp -d)
cd "$REPO"
git clone https://github.com/EricKirschenmann/MBC3-Tester-gb.git .
git checkout 40065adab0e2a5597621bb7e7e4812d0e0f43da7

cd disassembly
make all
cd -

cp disassembly/game.gb "$ARTIFACT/mbc3-tester.gb"
cp README.md "$ARTIFACT/mbc3-tester-readme.md"

cd "$SRC_DIR"
cp mbc3-tester-expected/*.png "$ARTIFACT"

cp "$SRC_DIR/howto/mbc3-tester.md" "$ARTIFACT/game-boy-test-roms-howto.md"
}


build_mealybug_tearoom_tests()
{
Expand Down Expand Up @@ -634,6 +662,7 @@ CMD_DMG_ACID2=dmg-acid2
CMD_GAMBATTE=gambatte-roms
CMD_GBMICROTEST=gbmicrotest
CMD_LITTLE_THINGS_GB=little-things-gb
CMD_MBC3_TESTER=mbc3-tester
CMD_MEALYBUG_TEAROOM_TESTS=mealybug-tearoom-tests
CMD_MOONEYE_TEST_SUITE=mooneye-test-suite
CMD_MOONEYE_TEST_SUITE_WILBERTPOL=mooneye-test-suite-wilbertpol
Expand Down Expand Up @@ -666,6 +695,7 @@ case ${CMD} in
"${CMD_GAMBATTE}") build_gambatte_hwtests "$@" ;;
"${CMD_GBMICROTEST}") build_gbmicrotest "$@" ;;
"${CMD_LITTLE_THINGS_GB}") build_little_things_gb "$@" ;;
"${CMD_MBC3_TESTER}") build_mbc3_tester "$@" ;;
"${CMD_MEALYBUG_TEAROOM_TESTS}") build_mealybug_tearoom_tests "$@" ;;
"${CMD_MOONEYE_TEST_SUITE}") build_mooneye_test_suite "$@" ;;
"${CMD_MOONEYE_TEST_SUITE_WILBERTPOL}") build_mooneye_test_suite_wilbertpol "$@" ;;
Expand Down
27 changes: 27 additions & 0 deletions src/howto/mbc3-tester.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# MBC3 Bank Tester

The [MBC3 Bank Tester](https://github.com/EricKirschenmann/MBC3-Tester-gb)
is compiled with [RGBDS](https://github.com/gbdev/rgbds).

## Game Boy Devices & SoC Revisions

Untested on real hardware but it should work on all revisions since it tests a cartridge.

## Exit Condition

This tests loops indefinitely. The result can be checked after first 40 frames.

## Test Success/Failure

Test success/failure can be determined by
[a screenshot](https://github.com/c-sp/gameboy-test-roms/tree/master/src/mbc3-tester-expected/)
comparison.

To create comparable screenshots,
your emulator should calculate colors as follows:

- `#000000`, `#555555`, `#AAAAAA` and `#FFFFFF` are used for the four DMG LCD
shades
- LCD shades for CGB compatibility mode are:
- background: `#000000`, `#0063C6`, `#7BFF31` and `#FFFFFF`
- objects: `#000000`, `#943939`, `#FF8484` and `#FFFFFF`
Binary file added src/mbc3-tester-expected/mbc3-tester-cgb.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/mbc3-tester-expected/mbc3-tester-dmg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 815cdd2

Please sign in to comment.