Skip to content

Commit

Permalink
Make embed action require a path
Browse files Browse the repository at this point in the history
  • Loading branch information
Eggbertx committed Mar 3, 2024
1 parent a564247 commit eb46b74
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/cmake-ctest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
EMBED_ROM: games/oc8

jobs:
build:
Expand All @@ -28,7 +29,7 @@ jobs:

- name: Create dummy embed rom
working-directory: ${{github.workspace}}/
run: ./make.py embed
run: ./make.py embed ${{env.EMBED_ROM}}

- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
Expand Down
15 changes: 9 additions & 6 deletions make.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ def run_tests(print_opcodes = False):
def clean():
print("Cleaning up")
fs_action("delete", "build/")
del_files = glob.glob("oc8*") + glob.glob("src/*.o") + ["zcc_opt.def", "SDL2.dll", "src/rom_embed.h", "x64", "packages"]
del_files = glob.glob("oc8*") + glob.glob("src/*.o") + ["zcc_opt.def", "SDL2.dll", "src/rom_embed.h", "x64", "packages", "build"]
for del_file in del_files:
fs_action("delete", del_file)

Expand Down Expand Up @@ -287,17 +287,20 @@ def clean():
exit()
elif action in actions:
if action == "embed":
args = parser.parse_args()
create_embed(args.embed)
if len(sys.argv) != 2:
fatal_print(f"usage: {sys.argv[0]} embed path/to/romfile")
create_embed(sys.argv[1])
exit()
parser.add_argument("--embed",
help="embed a ROM file in OmniChip-8 for platforms that don't have file access (GameBoy, Commodore 64, etc)",
default="games/omnichip8")
platform = action
else:
fatal_print(f"Unrecognized action {action}, recognized actions: {actions}")

parser.add_argument("--embed",
help="embed a ROM file in OmniChip-8 for platforms that don't have file access (GameBoy, Commodore 64, etc)",
default="games/omnichip8")
args = parser.parse_args()

create_embed(args.embed)
build(platform, library,
args.__dict__.get("debug", False),
args.__dict__.get("embed", "games/omnichip8"))

0 comments on commit eb46b74

Please sign in to comment.