Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Atari 800 skeleton for "emutest" - ON HOLD #265

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ jobs:
make --silent -j 4
mkdir -p ${{ env.LIBRETRO_CORES_DIR }}
mv stella2014_libretro.so ${{ env.LIBRETRO_CORES_DIR }}
- name: 'Build "atari800" core'
if: steps.cache.outputs.cache-hit != 'true'
run: |
git clone https://github.com/libretro/libretro-atari800
cd libretro-atari800/
make --silent -j 4
mkdir -p ${{ env.LIBRETRO_CORES_DIR }}
mv atari800_libretro.so ${{ env.LIBRETRO_CORES_DIR }}
- name: Build Mesen-X core
if: steps.cache.outputs.cache-hit != 'true'
run: |
Expand Down
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ if(NOT CMAKE_CROSSCOMPILING)
PATHS ENV EMUTEST_DIR)
message(STATUS "Emutest test runner: ${EMUTEST_COMMAND}")

find_library(LIBRETRO_ATARI800_CORE
NAMES
atari800_libretro.so atari800_libretro.dylib atari800_libretro.dll
PATHS /lib64/libretro ENV LIBRETRO_CORES_DIR)
message(STATUS "Libretro Atari800 core: ${LIBRETRO_ATARI800_CORE}")

find_library(LIBRETRO_STELLA_CORE
NAMES
stella2014_libretro.so stella2014_libretro.dylib stella2014_libretro.dll
Expand Down
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -306,14 +306,21 @@ Copy `test/mesen_settings.xml` to this folder.

Install emutest (requires Go 1.21):
```console
$ go install https://github.com/kivutar/emutest
$ go install github.com/kivutar/emutest@latest
```

Make sure `$GOBIN` (usually `~/go/bin`) is included in your PATH environment variable so that CMake can find the binary, or set the `EMUTEST_DIR` environment variable to point to this directory before running `cmake -G` for the first time.
Make sure `$GOBIN` (usually `~/go/bin`) is included in your `PATH`
environment variable so that CMake can find the binary, or set the
`EMUTEST_DIR` environment variable to point to this directory before
running `cmake -G` for the first time.

You can verify emutest with `emutest -h < /dev/null` on the
command-line.

Build Libretro cores for desired target(s):

* Atari 2600 - https://github.com/libretro/stella2014-libretro
* Atari 800 - https://github.com/libretro/libretro-atari800
* NES - https://github.com/NovaSquirrel/Mesen-X

Copy the output Libretro core library files (they have extensions .so | .dylib | .dll) to a shared directory, maybe `$HOME/libretro`.
Expand Down
2 changes: 2 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ function(add_test_target target)
-DLLVM_MOS=${llvm_mos}
-DMESEN_COMMAND=${MESEN_COMMAND}
-DEMUTEST_COMMAND=${EMUTEST_COMMAND}
-DLIBRETRO_ATARI800_CORE=${LIBRETRO_ATARI800_CORE}
-DLIBRETRO_STELLA_CORE=${LIBRETRO_STELLA_CORE}
-DLIBRETRO_MESEN_CORE=${LIBRETRO_MESEN_CORE}
-DCMAKE_C_FLAGS=${config_flag}
Expand All @@ -41,3 +42,4 @@ add_test_target(nes-unrom)
add_test_target(nes-unrom-512)
add_test_target(atari2600-4k)
add_test_target(atari2600-3e)
add_test_target(atari8-dos)
5 changes: 5 additions & 0 deletions test/atari8-dos/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
cmake_minimum_required(VERSION 3.18)

project(test-atari8-dos LANGUAGES C)

include(./test.cmake)
7 changes: 7 additions & 0 deletions test/atari8-dos/hw.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

#include <stdio.h>

int main(void) {
puts("atari says hello");
for(;;);
}
9 changes: 9 additions & 0 deletions test/atari8-dos/test.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

include(../test.cmake)

#TODO; zp test
#TODO; .bss test
#TODO; .data test

add_a8_test(hw ../atari8-dos)
set_property(TEST test-hw PROPERTY ENVIRONMENT EMUTEST_FB_CRC_PASS=000000000)
8 changes: 8 additions & 0 deletions test/test.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ function(add_no_compile_test target)
set_property(TEST ${target}-no-compile PROPERTY WILL_FAIL YES)
endfunction()

function(add_a8_test name)
set(source_dir ".")
if(ARGC GREATER 1)
set(source_dir ${ARGV1})
endif()
add_emutest_test(${name} xex ${source_dir} LIBRETRO_ATARI800_CORE)
endfunction()

function(add_vcs_test name)
set(source_dir ".")
if(ARGC GREATER 1)
Expand Down