Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
Eggbertx committed Oct 3, 2024
1 parent 86685b7 commit ea1e578
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 46 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2016-2022, Eggbertx
Copyright (c) 2016-2024, Eggbertx
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
79 changes: 41 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,74 +1,77 @@
OmniChip-8
=======
[![8 tests passed](https://camo.githubusercontent.com/bdd31bf1696c33215025e20012715cce1717bb089ec88cb3f3084cb1e797d745/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f74657374732d382532307061737365642d73756363657373)](https://github.com/Eggbertx/OmniChip-8/actions/runs/8145050872/job/22260484280)
# OmniChip-8
![9 tests passed](https://camo.githubusercontent.com/0d2dde873dda4d7bad1ee1f669b215cb425fb15baf6c21e13bf0180709edbd77/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f74657374732d392532307061737365642d73756363657373)

A Chip-8 emulator with heavy emphasis on being as cross-platform as humanly possible
OmniChip-8 A Chip-8 emulator with heavy emphasis on being as cross-platform as humanly possible

# Building instructions

Building instructions
-----
## Desktop (SDL)
Run `python make.py`. In Windows, it is able to use Visual Studio (via the msbuild command) or mingw.
### Visual Studio

### Screenshot
![SDL screenshot](./screenshots/sdl.png)

### Using Visual Studio
Visual Studio should automatically download the SDL2 nuget packages when you build the project.
### msbuild (Developer Command Prompt for VS 20XX)

### Using msbuild (Developer Command Prompt for VS 20XX)
If you have [NuGet](https://www.nuget.org/) installed, you can run `nuget restore` to install the SDL2 nuget dependency packages. Otherwise, you will either need to install NuGet or open OmniChip-8.sln in Visual Studio and build it once to have it download the packages.

After you have them installed, you can run `python make.py build`
### mingw

### Using mingw
Run `pacman -S base-devel mingw-w64-x86_64-gcc mingw-w64-x86_64-SDL2` before using make.py.

## Desktop (curses, UNIX-like OSs)
Run `python make.py curses`

### Screenshot
![ncurses screenshot](./screenshots/curses.png)

## Commodore 64 (requires cc65)
Run `python make.py c64`
## sim65 (requires cc65)
Run `python make.py sim6502`

### Screenshot
![Commodore 64 screenshot](./screenshots/c64.png)


## GameBoy (requires z88dk)
Run `python make.py gb`

Testing
------
To test OmniChip-8, run the following commands
```Shell
cmake -B build
cd build
make && make test
```
To generate a coverage report, run `make lcov` from the build directory after you have run the above commands (including `make test`). This requires [lcov](https://github.com//linux-test-project/lcov) to be installed. If no errors are returned, the report will be generated in the build/lcov/ directory.
### Screenshot
![GameBoy screenshot](./screenshots/gb.png)


Supported platforms
------
## Mostly done
* Desktop SDL
## sim65 (requires cc65)
Run `python make.py sim6502`

![SDL screenshot](./screenshots/sdl.png)
* (n)curses

![ncurses screenshot](./screenshots/curses.png)
* Commodore 64
# Testing
To test OmniChip-8, run `./make.py test`. This will build and run the test suites, and generate a test coverage report which you can view in a browser. This requires cmake, ctest, and lcov.

![Commodore 64 screenshot](./screenshots/c64.png)
* GameBoy
If you want to just run the tests without generating a coverage report (removing the need for lcov), run `./make test --no-coverage`.

![Gameboy screenshot](./screenshots/gb.png)

# Supported platforms
## Mostly done
* Desktop SDL
* WebAssembly
* (n)curses
* Commodore 64
* GameBoy
* sim65


## Planned
* WebAssembly + SDL
* TI-8x
* Apple II
* NES
* Sphere, via WebAssembly/Emscripten
* MS-DOS/FreeDOS/DR-DOS
* DOS

## Maybe/hopefully
* NES
* Sphere, via WebAssembly/Emscripten
* Magic-1
* Bare metal x86


Games
------
# Games
All of the games in `games/` are public domain, and came from [here](https://www.zophar.net/pdroms/chip8/chip-8-games-pack.html) except for omnichip8, oc8, and their respective .c8 sources.
19 changes: 12 additions & 7 deletions make.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,19 +233,20 @@ def build(platform = "native", library = "sdl", debugging = False, debug_keys=Fa

print("Built OmniChip-8 successfully")

def run_tests():
test_commands = (
def run_tests(coverage = True):
test_commands = [
"cmake -B build",
"cmake --build build",
"ctest --test-dir build",
"cmake --build build -t lcov"
)
"ctest --test-dir build"
]
if coverage:
test_commands.append("cmake --build build -t lcov")
create_embed("games/omnichip8")
for cmd in test_commands:
status = run_cmd(cmd, realtime=True, print_command=True)
if status[1] != 0:
fatal_print("Failed running test command(s)")
print("Tests completed without errors, coverage reports should be in ./build/lcov/html/")
print("Tests completed without errors" + (", coverage reports should be in ./build/lcov/html/" if coverage else ""))

def clean():
print("Cleaning up")
Expand All @@ -261,7 +262,11 @@ def clean():
library = "sdl"
parser = argparse.ArgumentParser(description = "OmniChip-8 build script")
if action == "test":
run_tests()
parser.add_argument("--no-coverage",
action="store_true",
help="Run tests without generating a coverage report")
args = parser.parse_args()
run_tests(not args.no_coverage)
elif action == "clean":
clean()
elif action == "help" or action == "--help" or action == "-h":
Expand Down

0 comments on commit ea1e578

Please sign in to comment.