Skip to content

Commit

Permalink
Add some images to README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
binji committed Feb 24, 2017
1 parent c77aa64 commit a42ae37
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 12 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,18 @@ A simple GB emulator.
* Disable/enable BG, Window and Sprite layers
* Convenient Python test harness using hashes to validate

## Screenshots

![Bionic Commando](/images/bionic.png)
![Donkey Kong](/images/dk.png)
![Kirby's Dreamland 2](/images/kirby2.png)
![Mole Mania](/images/mole.png)
![Mario's Picross](/images/picross.png)
![Trip World](/images/trip.png)
![Wario Land](/images/wario.png)
![Game Boy Wars](/images/wars.png)
![Is That a Demo in Your Pocket?](/images/pocket.png)

## Building

Requires [CMake](https://cmake.org) and
Expand Down
Binary file added images/bionic.png
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 images/dk.png
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 images/kirby2.png
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 images/mole.png
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 images/picross.png
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 images/pocket.png
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 images/trip.png
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 images/wario.png
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 images/wars.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 25 additions & 12 deletions scripts/anim.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
import common

OUT_ANIM_DIR = os.path.join(common.OUT_DIR, 'anim')

DEFAULT_FRAMES = 2400
OUT_SCREENSHOT_DIR = os.path.join(common.OUT_DIR, 'screenshot')
DEFAULT_ANIM_FRAMES = 2400
DEFAULT_SCREENSHOT_FRAMES = 300
CONTROLLER_INPUT_FILE = os.path.join(common.SCRIPT_DIR, 'input_move_right.txt')


Expand All @@ -30,6 +31,13 @@ def ChangeDir(new_dir, path):
return os.path.join(new_dir, os.path.basename(path))


def MakeDir(dir_name):
try:
os.makedirs(dir_name)
except OSError as e:
print(e)


def ConvertPPMstoMP4(tempdir, src):
srcs = ChangeExt(src, '.%08d.ppm')
dst = ChangeDir(OUT_ANIM_DIR, ChangeExt(src, '.mp4'))
Expand All @@ -43,16 +51,21 @@ def ConvertPPMstoMP4(tempdir, src):
dst)


def Run(rom):
def Run(rom, options):
start_time = time.time()
tempdir = None
try:
tempdir = tempfile.mkdtemp(prefix='rom_anims')
default_img = ChangeDir(tempdir, ChangeExt(rom, '.ppm'))
try:
common.RunTester(rom, DEFAULT_FRAMES, default_img,
controller_input=CONTROLLER_INPUT_FILE, animate=True)
ConvertPPMstoMP4(tempdir, default_img)
if options.screenshot:
default_img = ChangeDir(OUT_SCREENSHOT_DIR, ChangeExt(rom, '.ppm'))
common.RunTester(rom, DEFAULT_SCREENSHOT_FRAMES, default_img,
controller_input=CONTROLLER_INPUT_FILE)
else:
default_img = ChangeDir(tempdir, ChangeExt(rom, '.ppm'))
common.RunTester(rom, DEFAULT_ANIM_FRAMES, default_img,
controller_input=CONTROLLER_INPUT_FILE, animate=True)
ConvertPPMstoMP4(tempdir, default_img)
except common.Error as e:
print(str(e))
finally:
Expand All @@ -70,6 +83,8 @@ def main(args):
type=int, default=multiprocessing.cpu_count(),
help='num processes.')
parser.add_argument('-C', '--dir', help='search for ROMs in dir')
parser.add_argument('--screenshot', action='store_true',
help='Just grab screenshots')
parser.add_argument('patterns', metavar='pattern', nargs='*',
help='test patterns.')
options = parser.parse_args(args)
Expand All @@ -81,15 +96,13 @@ def main(args):
print(rom)
return 0

try:
os.makedirs(OUT_ANIM_DIR)
except OSError as e:
print(e)
MakeDir(OUT_ANIM_DIR)
MakeDir(OUT_SCREENSHOT_DIR)

start_time = time.time()
pool = multiprocessing.Pool(options.num_processes)
try:
results = [pool.apply_async(Run, (rom,)) for rom in roms]
results = [pool.apply_async(Run, (rom, options)) for rom in roms]
started = 0
completed = 0
while results:
Expand Down

0 comments on commit a42ae37

Please sign in to comment.