-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #90 from davidgiven/tests
Add MAME-based emulator tests for smoke testing the platforms.
- Loading branch information
Showing
21 changed files
with
469 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,4 +11,5 @@ export OBJ = .obj | |
.PHONY: all | ||
all: +all | ||
|
||
TARGETS = +all +mametest | ||
include build/ab.mk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
get_rom() { | ||
rom=$2 | ||
if [ "$rom" = "" ]; then | ||
rom=$(basename $1) | ||
fi | ||
if ! [ -f roms/$rom ]; then | ||
mkdir -p roms | ||
wget -q -O roms/$rom $1 | ||
fi | ||
} | ||
|
||
URL='https://archive.org/download/MAME217RomsOnlyMerged/MAME%200.217%20ROMs%20%28merged%29.zip' | ||
|
||
get_rom $URL/a2diskiing.zip | ||
get_rom $URL/a800xl.zip | ||
get_rom $URL/apple2e.zip | ||
get_rom $URL/bbcm.zip | ||
get_rom $URL/c1541.zip | ||
get_rom $URL/c64.zip | ||
get_rom $URL/d2fdc.zip | ||
get_rom $URL/oric1.zip | ||
get_rom $URL/oric_microdisc.zip | ||
get_rom $URL/saa5050.zip | ||
get_rom $URL/vic1001.zip | ||
get_rom $URL/pet4016.zip | ||
get_rom $URL/pet4032b.zip | ||
get_rom $URL/pet8032.zip | ||
get_rom $URL/c8050.zip | ||
get_rom $URL/c8050fdc.zip | ||
get_rom $URL/c4040.zip | ||
get_rom $URL/c2040_fdc.zip | ||
get_rom $URL/vic20_fe3.zip vic20.zip | ||
get_rom $URL/votrax.zip | ||
cp roms/votrax.zip roms/votrsc01a.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
diskimage=/tmp/$$.$4 | ||
trap "rm -f $diskimage" EXIT | ||
cp $2 $diskimage | ||
SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy chronic mame $1 -flop1 $diskimage -video none -autoboot_script $3 -nothrottle -nosleep -snapshot_directory snap -sound none -rompath roms |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
diskimage=/tmp/$$.$4 | ||
trap "rm -f $diskimage" EXIT | ||
cp $2 $diskimage | ||
SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy chronic mame $1 -ext microdisc -flop $diskimage -video none -autoboot_script $3 -nothrottle -nosleep -snapshot_directory snap -sound none -rompath roms |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
local c = coroutine.create(function() | ||
local machine = manager.machine | ||
local kbd = machine.natkeyboard | ||
local video = machine.video | ||
|
||
local function wait_kbd() | ||
while kbd.is_posting do | ||
emu.wait(0.1) | ||
end | ||
end | ||
|
||
emu.wait(6) | ||
|
||
kbd:post_coded("BEDIT{ENTER}") | ||
emu.wait(3) | ||
kbd:post_coded("10 lda #18{ENTER}") wait_kbd() | ||
kbd:post_coded("20 ldx #35{ENTER}") wait_kbd() | ||
kbd:post_coded("30 ldy #52{ENTER}") wait_kbd() | ||
kbd:post_coded("40 label: jmp label{ENTER}") wait_kbd() | ||
kbd:post_coded("save \"test.asm\"{ENTER}") wait_kbd() | ||
emu.wait(8) | ||
kbd:post_coded("quit{ENTER}") wait_kbd() | ||
emu.wait(1) | ||
kbd:post_coded("asm test.asm test.com{ENTER}") wait_kbd() | ||
emu.wait(20) | ||
kbd:post_coded("test{ENTER}") wait_kbd() | ||
emu.wait(3) | ||
|
||
local cpu = manager.machine.devices[':maincpu'] | ||
if (tostring(cpu.state.A) == "12") and (tostring(cpu.state.X) == "23") and (tostring(cpu.state.Y) == "34") then | ||
print("success!") | ||
os.exit(0) | ||
end | ||
|
||
print("fail") | ||
video:snapshot() | ||
for k, v in pairs(cpu.state) do | ||
print(k, type(v), tostring(v)) | ||
end | ||
|
||
os.exit(1) | ||
end) | ||
coroutine.resume(c) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
local c = coroutine.create(function() | ||
local machine = manager.machine | ||
local kbd = machine.natkeyboard | ||
local video = machine.video | ||
|
||
local function wait_kbd() | ||
while kbd.is_posting do | ||
emu.wait(0.1) | ||
end | ||
end | ||
|
||
emu.wait(4) | ||
|
||
kbd:post_coded("BEDIT{ENTER}") | ||
emu.wait(2) | ||
kbd:post_coded("10 lda #0x12{ENTER}") wait_kbd() | ||
kbd:post_coded("20 ldx #0x23{ENTER}") wait_kbd() | ||
kbd:post_coded("30 ldy #0x34{ENTER}") wait_kbd() | ||
kbd:post_coded("40 label: jmp label{ENTER}") wait_kbd() | ||
kbd:post_coded("save \"test.asm\"{ENTER}") wait_kbd() | ||
emu.wait(3) | ||
kbd:post_coded("quit{ENTER}") wait_kbd() | ||
emu.wait(3) | ||
kbd:post_coded("asm test.asm test.com{ENTER}") wait_kbd() | ||
emu.wait(20) | ||
kbd:post_coded("test{ENTER}") wait_kbd() | ||
emu.wait(5) | ||
|
||
local cpu = manager.machine.devices[':maincpu'] | ||
if (tostring(cpu.state.A) == "12") and (tostring(cpu.state.X) == "23") and (tostring(cpu.state.Y) == "34") then | ||
print("success!") | ||
os.exit(0) | ||
end | ||
|
||
print("fail") | ||
video:snapshot() | ||
for k, v in pairs(cpu.state) do | ||
print(k, type(v), tostring(v)) | ||
end | ||
|
||
os.exit(1) | ||
end) | ||
coroutine.resume(c) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.