From 4829c63c504a0951709f87bb3a6a5c1afb72b1a9 Mon Sep 17 00:00:00 2001 From: Thomas Daley Date: Thu, 26 Feb 2026 16:33:07 -0800 Subject: [PATCH 1/9] use size correctly on windows open_file_dialog implementation --- windows/src/open_file_dialog.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/windows/src/open_file_dialog.cc b/windows/src/open_file_dialog.cc index 0a9cfa5..3dc0502 100644 --- a/windows/src/open_file_dialog.cc +++ b/windows/src/open_file_dialog.cc @@ -5,14 +5,14 @@ #include #include -int open_file_dialog(char *rom_filepath, char *filters, size_t size) { +int open_file_dialog(char *rom_filepath, size_t size, char *filters) { /* open file dialogue */ - char cwd[PATH_MAX]; - GetCurrentDirectory(PATH_MAX, cwd); + char cwd[size]; + GetCurrentDirectory(size, cwd); OPENFILENAME ofn; - char szFile[PATH_MAX]; + char szFile[size]; /* open a file name */ ZeroMemory( &ofn , sizeof( ofn)); @@ -21,7 +21,7 @@ int open_file_dialog(char *rom_filepath, char *filters, size_t size) { ofn.lpstrFile = szFile ; ofn.lpstrFile[0] = '\0'; ofn.nMaxFile = sizeof( szFile ); - ofn.lpstrFilter = "Chip8\0*.ch8\0All\0*.*\0"; + ofn.lpstrFilter = filters; ofn.nFilterIndex =1; ofn.lpstrFileTitle = NULL ; ofn.nMaxFileTitle = 0 ; @@ -41,5 +41,5 @@ int open_file_dialog(char *rom_filepath, char *filters, size_t size) { } int open_file_dialog(char *rom_filepath, size_t size) { - return open_file_dialog(rom_filepath, "Chip8\0*.ch8\0All\0*.*\0", size); + return open_file_dialog(rom_filepath, size, "Chip8\0*.ch8\0All\0*.*\0"); } From 46861edc1076e754a92aaa3132f2754617f4135c Mon Sep 17 00:00:00 2001 From: Thomas Daley Date: Thu, 26 Feb 2026 17:50:25 -0800 Subject: [PATCH 2/9] improve size and error handling of open_file_dialog funcs --- linux/src/open_file_dialog.cc | 2 ++ macos/src/open_file_dialog.mm | 2 ++ shared/open_file_dialog.h | 2 +- shared/profiles.c | 2 +- windows/src/open_file_dialog.cc | 23 ++++++++++++++++------- 5 files changed, 22 insertions(+), 9 deletions(-) diff --git a/linux/src/open_file_dialog.cc b/linux/src/open_file_dialog.cc index bb9d2fa..5f4706d 100644 --- a/linux/src/open_file_dialog.cc +++ b/linux/src/open_file_dialog.cc @@ -70,6 +70,8 @@ std::vector open_file_dialog(const std::string &title, const std::s } int open_file_dialog(char *rom_filepath, size_t size) { + if (rom_filepath == nullptr || size == 0) return -1; + std::vector fileTypes = {"ch8", "CH8", "chip-8", "CHIP-8", "Chip-8"}; const char* defaultDir = ""; // unify behavior: let OS choose last-used/home std::vector files = open_file_dialog("Chip8", defaultDir, fileTypes); diff --git a/macos/src/open_file_dialog.mm b/macos/src/open_file_dialog.mm index cbabe66..a44dd6b 100644 --- a/macos/src/open_file_dialog.mm +++ b/macos/src/open_file_dialog.mm @@ -45,6 +45,8 @@ } int open_file_dialog(char *rom_filepath, size_t size) { + if (rom_filepath == nullptr || size == 0) return -1; + std::vector fileTypes = {"ch8", "CH8", "chip-8", "CHIP-8", "Chip-8"}; const char* defaultDir = ""; // unify behavior: let OS choose last-used/home std::vector files = open_file_dialog("Chip8", defaultDir, fileTypes); diff --git a/shared/open_file_dialog.h b/shared/open_file_dialog.h index 5c5a565..b09d0bd 100644 --- a/shared/open_file_dialog.h +++ b/shared/open_file_dialog.h @@ -10,7 +10,7 @@ extern "C" { /* Opens a file dialog to select a ROM file. * The selected file path is copied to `rom_filepath`. * The `size` parameter specifies the size of the `rom_filepath` buffer. - * Returns 1 if a file was selected, 0 if cancelled, or -1 on error. + * Returns 0 if a file was selected, 1 if cancelled, or -1 on error. */ int open_file_dialog(char *rom_filepath, size_t size); diff --git a/shared/profiles.c b/shared/profiles.c index 1669295..ab046f7 100644 --- a/shared/profiles.c +++ b/shared/profiles.c @@ -229,7 +229,7 @@ const struct profile* profile_lookup(const sha256_hash_t *sha256) { char matched_hash_hex[65]; bytes_to_hex(profile_map[idx].key.bytes, matched_hash_hex, sizeof(matched_hash_hex)); - printf("Lookup result: found idx=%td name=%s\n", idx, matched_hash_hex, profile_map[idx].value.rom_name); + printf("Lookup result: found idx=%td name=%s\n", idx, profile_map[idx].value.rom_name); quirks_print(&profile_map[idx].value.quirks, "Lookup quirks:"); return &profile_map[idx].value; } diff --git a/windows/src/open_file_dialog.cc b/windows/src/open_file_dialog.cc index 3dc0502..397a388 100644 --- a/windows/src/open_file_dialog.cc +++ b/windows/src/open_file_dialog.cc @@ -4,23 +4,32 @@ #include #include #include +#include + +int open_file_dialog(char *rom_filepath, size_t size, const char *filters) { + if (rom_filepath == NULL || size == 0 || size > MAXDWORD) { + return -1; + } + + const DWORD buffer_size = (DWORD)size; -int open_file_dialog(char *rom_filepath, size_t size, char *filters) { /* open file dialogue */ - char cwd[size]; - GetCurrentDirectory(size, cwd); + std::vector cwd(MAX_PATH, '\0'); + if (GetCurrentDirectoryA((DWORD)cwd.size(), cwd.data()) == 0) { + return -1; + } OPENFILENAME ofn; - char szFile[size]; + std::vector szFile(buffer_size, '\0'); /* open a file name */ ZeroMemory( &ofn , sizeof( ofn)); ofn.lStructSize = sizeof ( ofn ); ofn.hwndOwner = NULL ; - ofn.lpstrFile = szFile ; + ofn.lpstrFile = szFile.data() ; ofn.lpstrFile[0] = '\0'; - ofn.nMaxFile = sizeof( szFile ); + ofn.nMaxFile = buffer_size; ofn.lpstrFilter = filters; ofn.nFilterIndex =1; ofn.lpstrFileTitle = NULL ; @@ -36,7 +45,7 @@ int open_file_dialog(char *rom_filepath, size_t size, char *filters) { return 1; } - strncpy(rom_filepath, szFile, size); + snprintf(rom_filepath, size, "%s", szFile.data()); return 0; } From 9388e55c397060c9f777f975a82e168762b21f6c Mon Sep 17 00:00:00 2001 From: Thomas Daley Date: Thu, 26 Feb 2026 17:52:51 -0800 Subject: [PATCH 3/9] fix pointer reference --- windows/src/open_file_dialog.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/windows/src/open_file_dialog.cc b/windows/src/open_file_dialog.cc index 397a388..5e52e4e 100644 --- a/windows/src/open_file_dialog.cc +++ b/windows/src/open_file_dialog.cc @@ -38,7 +38,7 @@ int open_file_dialog(char *rom_filepath, size_t size, const char *filters) { ofn.Flags = OFN_PATHMUSTEXIST|OFN_FILEMUSTEXIST ; /* change current working directory back to location of executable */ - SetCurrentDirectory(cwd); + SetCurrentDirectoryA(cwd.data()); if (!GetOpenFileName( &ofn)) { /* user hit cancel */ From dfe087589fa6b30398bd5b32c590a3fd87bbea5b Mon Sep 17 00:00:00 2001 From: Thomas Daley Date: Thu, 26 Feb 2026 21:02:09 -0800 Subject: [PATCH 4/9] increase upper limit on cpu frequency to 9000 hz --- linux/makefile | 4 ++-- macos/makefile | 15 +++++++++------ shared/chip8.h | 2 +- shared/gui.cc | 2 +- windows/makefile | 4 ++-- 5 files changed, 15 insertions(+), 12 deletions(-) diff --git a/linux/makefile b/linux/makefile index 349ce69..592e939 100644 --- a/linux/makefile +++ b/linux/makefile @@ -145,10 +145,10 @@ release/$(APP_EXE): $(SDL_LIB) $(OBJS) cp $(SDL_LIB) release/libSDL2-2.0.so.0 $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(INCLUDE_DIRS) $(OBJS) -o $@ $(LDFLAGS) -run-debug: debug/$(APP_EXE) +run-debug: debug/$(APP_EXE) debug/profiles.ini ./debug/$(APP_EXE) -run-release: release/$(APP_EXE) +run-release: release/$(APP_EXE) release/profiles.ini ./release/$(APP_EXE) # Removes build artifacts (objects, executables) but keeps SDL diff --git a/macos/makefile b/macos/makefile index ac828f0..a47a8c9 100644 --- a/macos/makefile +++ b/macos/makefile @@ -81,14 +81,14 @@ $(SDL_LIB): # Generate license header from LICENSE file $(LICENSE_HEADER): ../LICENSE - python3 ../tools/generate_license_header.py ../LICENSE $(LICENSE_HEADER) + python3 ../tools/generate_license_header.py $< $(LICENSE_HEADER) # Generate bootrom header from ROM file -$(BOOTROM_HEADER): $(BOOTROM_SOURCE) - python3 ../tools/generate_bootrom_header.py $(BOOTROM_SOURCE) $(BOOTROM_HEADER) +$(BOOTROM_HEADER): ../roms/Kiwi8_logo_2.ch8 + python3 ../tools/generate_bootrom_header.py $< $(BOOTROM_HEADER) # Generate Info.plist from template with version substitution -$(APP_MANIFEST): $(APP_MANIFEST).in +$(APP_MANIFEST): src/Info.plist.in sed -e 's/@APP_NAME@/$(APP_NAME)/g' -e 's/@VERSION@/$(VERSION)/g' -e 's/@SUB_VERSION@/$(SUB_VERSION)/g' $< > $@ # Pattern rules for incremental compilation @@ -110,6 +110,9 @@ $(APP_MANIFEST): $(APP_MANIFEST).in %.o: ../shared/%.cc $(LICENSE_HEADER) $(BOOTROM_HEADER) $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(INCLUDE_DIRS) -c $< -o $@ +%.i: %.c $(LICENSE_HEADER) $(BOOTROM_HEADER) + $(CC) $(CFLAGS) $(CPPFLAGS) $(INCLUDE_DIRS) -E $< -o $@ + debug/profiles.ini: $(PROFILES_INI) mkdir -p debug cp $(PROFILES_INI) debug/profiles.ini @@ -161,10 +164,10 @@ release/$(APP_BUNDLE)/Contents/Frameworks/libSDL2-2.0.0.dylib: $(SDL_LIB) # .app bundle release/$(APP_BUNDLE): release/$(APP_BUNDLE)/Contents/MacOS/$(APP_EXE) release/$(APP_BUNDLE)/Contents/Info.plist release/$(APP_BUNDLE)/Contents/Resources/Kiwi8.icns release/$(APP_BUNDLE)/Contents/Frameworks/libSDL2-2.0.0.dylib -run-debug: debug/$(APP_EXE) +run-debug: debug/$(APP_EXE) debug/profiles.ini ./debug/$(APP_EXE) -run-release: release/$(APP_BUNDLE) +run-release: release/$(APP_BUNDLE) release/$(APP_BUNDLE)/Contents/Resources/profiles.ini open release/$(APP_BUNDLE) # Removes build artifacts (objects, app bundle) but keeps SDL diff --git a/shared/chip8.h b/shared/chip8.h index 9c8fcaa..27f86dd 100644 --- a/shared/chip8.h +++ b/shared/chip8.h @@ -18,7 +18,7 @@ extern "C" { #define FONTS_SIZE 80 #define CYCLES_PER_STEP 12 /* ~720 inst/sec if ticking at 60hz */ #define MIN_CYCLES_PER_STEP 1 -#define MAX_CYCLES_PER_STEP 50 +#define MAX_CYCLES_PER_STEP 150 /* You've reached level 9000! */ #define TICKS 60 /* hz - Timer count down rate */ static const unsigned char chip8_fontset[FONTS_SIZE] = { diff --git a/shared/gui.cc b/shared/gui.cc index 098b6df..a23324b 100644 --- a/shared/gui.cc +++ b/shared/gui.cc @@ -64,7 +64,7 @@ static void gui_help_windows(void) { "A cross-platform Chip-8 interpreter written\n" "in C-Style C++ using SDL2, ImGui, and OpenGL.\n" "\n" - "\n" + "https://github.com/Diesel-Net/kiwi-8\n" ); ImGui::End(); diff --git a/windows/makefile b/windows/makefile index ea7ecbc..19550d5 100644 --- a/windows/makefile +++ b/windows/makefile @@ -155,10 +155,10 @@ release\$(APP_EXE): $(SDL_LIB) $(OBJS) $(APP_RES) COPY ..\external\sdl\build\bin\SDL2.dll release\SDL2.dll MOVE $(APP_EXE) $@ -run-debug: +run-debug: debug\$(APP_EXE) debug\profiles.ini debug\$(APP_EXE) -run-release: +run-release: release\$(APP_EXE) release\profiles.ini release\$(APP_EXE) # Clean any leftover build files (keeps SDL) From 5d58522188140f76271178a71f0b8e66efdbd5e9 Mon Sep 17 00:00:00 2001 From: Thomas Daley Date: Fri, 27 Feb 2026 12:08:40 -0800 Subject: [PATCH 5/9] comment --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b4851f7..86f8e9b 100644 --- a/README.md +++ b/README.md @@ -113,7 +113,7 @@ The following must be installed and added to your **PATH**: ## Building on Linux (Debian) -The following must be added to your **PATH**: +The following must be installed and added to your **PATH**: >gcc
>g++
From 1ff7fdd65ec74af944d527a4c2362fa6f970ca18 Mon Sep 17 00:00:00 2001 From: Thomas Daley Date: Fri, 27 Feb 2026 20:44:38 -0800 Subject: [PATCH 6/9] change to bool and comment --- shared/chip8.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared/chip8.h b/shared/chip8.h index 27f86dd..e25bcee 100644 --- a/shared/chip8.h +++ b/shared/chip8.h @@ -46,7 +46,7 @@ struct chip8 { /* whether or not cpu is currently halted by opcode FX0A */ bool cpu_halt; - /* whether or not emulation is currently paused. */ + /* whether or not emulation is currently paused via user. */ bool paused; /* All quirk toggles */ @@ -64,7 +64,7 @@ struct chip8 { /* rom profile tracking */ char rom_filename[PATH_MAX]; /* basename of currently loaded ROM */ - int rom_loaded; /* 1 if user ROM loaded, 0 if bootrom */ + bool rom_loaded; /* registers */ unsigned char V[NUM_REGISTERS]; From 5d16684068c90bb04f00d01042cf9ec382110671 Mon Sep 17 00:00:00 2001 From: Thomas Daley Date: Fri, 27 Feb 2026 20:47:50 -0800 Subject: [PATCH 7/9] use bool --- shared/chip8.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared/chip8.c b/shared/chip8.c index 65c0b48..99284f6 100644 --- a/shared/chip8.c +++ b/shared/chip8.c @@ -119,7 +119,7 @@ int chip8_load_bootrom() { memcpy(chip8.memory + ENTRY_POINT, bootrom, BOOTROM_SIZE); /* Mark as bootrom (not user ROM) */ - chip8.rom_loaded = 0; + chip8.rom_loaded = false; chip8.rom_filename[0] = '\0'; return 0; @@ -174,7 +174,7 @@ int chip8_load_rom(const char *rom_filepath) { chip8.rom_filename[sizeof(chip8.rom_filename) - 1] = '\0'; /* Mark as user ROM (not bootrom) */ - chip8.rom_loaded = 1; + chip8.rom_loaded = true; char notif_msg[TOAST_MSG_MAX]; snprintf(notif_msg, sizeof(notif_msg), "ROM loaded: %s", chip8.rom_filename); toast_show(TOAST_SUCCESS, notif_msg); From 2c9c6a2f48cb7f667264d3080baae6a71dd01a55 Mon Sep 17 00:00:00 2001 From: Thomas Daley Date: Sat, 28 Feb 2026 13:11:18 -0800 Subject: [PATCH 8/9] tidy up and reuse vars --- linux/makefile | 19 +++++++++---------- macos/makefile | 17 ++++++++--------- windows/makefile | 21 ++++++++++----------- 3 files changed, 27 insertions(+), 30 deletions(-) diff --git a/linux/makefile b/linux/makefile index 592e939..6f3a62c 100644 --- a/linux/makefile +++ b/linux/makefile @@ -62,7 +62,9 @@ SDL_LIB = ../external/sdl/build/lib/libSDL2-2.0.so.0 # Generated headers LICENSE_HEADER = ../shared/license.h BOOTROM_HEADER = ../shared/bootrom.h -BOOTROM_SOURCE = ../roms/Kiwi8_logo_2.ch8 + +# ROM Profiles database (source of truth) +PROFILES_INI = ../shared/profiles.ini OBJS = audio.o \ chip8.o \ @@ -79,11 +81,8 @@ OBJS = audio.o \ imgui_impl_sdl.o \ sha256.o -DEPS = $(OBJS:.o=.d) - -PROFILES_INI = ../shared/profiles.ini - # Include auto-generated dependency files (must be before targets) +DEPS = $(OBJS:.o=.d) -include $(DEPS) .DEFAULT_GOAL := all @@ -100,11 +99,11 @@ $(SDL_LIB): # Generate license header from LICENSE file $(LICENSE_HEADER): ../LICENSE - python3 ../tools/generate_license_header.py ../LICENSE $(LICENSE_HEADER) + python3 ../tools/generate_license_header.py $< $@ # Generate bootrom header from ROM file -$(BOOTROM_HEADER): $(BOOTROM_SOURCE) - python3 ../tools/generate_bootrom_header.py $(BOOTROM_SOURCE) $(BOOTROM_HEADER) +$(BOOTROM_HEADER): ../roms/Kiwi8_logo_2.ch8 + python3 ../tools/generate_bootrom_header.py $< $@ # Pattern rules for incremental compilation %.o: src/%.cc @@ -127,11 +126,11 @@ $(BOOTROM_HEADER): $(BOOTROM_SOURCE) debug/profiles.ini: $(PROFILES_INI) mkdir -p debug - cp $(PROFILES_INI) debug/profiles.ini + cp $(PROFILES_INI) $@ release/profiles.ini: $(PROFILES_INI) mkdir -p release - cp $(PROFILES_INI) release/profiles.ini + cp $(PROFILES_INI) $@ # debug executable debug/$(APP_EXE): $(SDL_LIB) $(OBJS) diff --git a/macos/makefile b/macos/makefile index a47a8c9..67565e4 100644 --- a/macos/makefile +++ b/macos/makefile @@ -43,7 +43,9 @@ SDL_LIB = ../external/sdl/build/lib/libSDL2-2.0.0.dylib # Generated headers LICENSE_HEADER = ../shared/license.h BOOTROM_HEADER = ../shared/bootrom.h -BOOTROM_SOURCE = ../roms/Kiwi8_logo_2.ch8 + +# ROM Profiles database (source of truth) +PROFILES_INI = ../shared/profiles.ini OBJS = audio.o \ chip8.o \ @@ -60,11 +62,8 @@ OBJS = audio.o \ imgui_impl_sdl.o \ sha256.o -DEPS = $(OBJS:.o=.d) - -PROFILES_INI = ../shared/profiles.ini - # Include auto-generated dependency files (must be before targets) +DEPS = $(OBJS:.o=.d) -include $(DEPS) .DEFAULT_GOAL := all @@ -81,11 +80,11 @@ $(SDL_LIB): # Generate license header from LICENSE file $(LICENSE_HEADER): ../LICENSE - python3 ../tools/generate_license_header.py $< $(LICENSE_HEADER) + python3 ../tools/generate_license_header.py $< $@ # Generate bootrom header from ROM file $(BOOTROM_HEADER): ../roms/Kiwi8_logo_2.ch8 - python3 ../tools/generate_bootrom_header.py $< $(BOOTROM_HEADER) + python3 ../tools/generate_bootrom_header.py $< $@ # Generate Info.plist from template with version substitution $(APP_MANIFEST): src/Info.plist.in @@ -115,11 +114,11 @@ $(APP_MANIFEST): src/Info.plist.in debug/profiles.ini: $(PROFILES_INI) mkdir -p debug - cp $(PROFILES_INI) debug/profiles.ini + cp $(PROFILES_INI) $@ release/$(APP_BUNDLE)/Contents/Resources/profiles.ini: $(PROFILES_INI) mkdir -p release/$(APP_BUNDLE)/Contents/Resources - cp $(PROFILES_INI) release/$(APP_BUNDLE)/Contents/Resources/profiles.ini + cp $(PROFILES_INI) $@ # debug executable debug/$(APP_EXE): $(SDL_LIB) $(OBJS) diff --git a/windows/makefile b/windows/makefile index 19550d5..5a62f06 100644 --- a/windows/makefile +++ b/windows/makefile @@ -66,7 +66,9 @@ SDL_LIB = ..\external\sdl\build\lib\SDL2.lib # Generated headers LICENSE_HEADER = ..\shared\license.h BOOTROM_HEADER = ..\shared\bootrom.h -BOOTROM_SOURCE = ..\roms\Kiwi8_logo_2.ch8 + +# ROM Profiles database (source of truth) +PROFILES_INI = ..\shared\profiles.ini OBJS = audio.obj \ chip8.obj \ @@ -83,12 +85,9 @@ OBJS = audio.obj \ imgui_draw.obj \ sha256.obj -PROFILES_INI = ..\shared\profiles.ini - # Default target all: debug\profiles.ini debug\$(APP_EXE) release\profiles.ini release\$(APP_EXE) - # Build SDL (force rebuild with: nmake sdl) sdl: powershell -ExecutionPolicy Bypass -File build_sdl.ps1 -ARCH $(SDL_ARCH) @@ -99,11 +98,11 @@ $(SDL_LIB): # Generate license header from LICENSE file $(LICENSE_HEADER): ..\LICENSE - python3 ..\tools\generate_license_header.py ..\LICENSE $(LICENSE_HEADER) + python3 ..\tools\generate_license_header.py $< $@ # Generate bootrom header from ROM file -$(BOOTROM_HEADER): $(BOOTROM_SOURCE) - python3 ..\tools\generate_bootrom_header.py $(BOOTROM_SOURCE) $(BOOTROM_HEADER) +$(BOOTROM_HEADER): ..\roms\Kiwi8_logo_2.ch8 + python3 ..\tools\generate_bootrom_header.py $< $@ # Inference rules for incremental compilation {src}.cc{}.obj: @@ -126,10 +125,10 @@ $(BOOTROM_HEADER): $(BOOTROM_SOURCE) # Explicit rules for files depending on generated headers gui.obj: ..\shared\gui.cc $(LICENSE_HEADER) - $(CC) $(CFLAGS) $(CPPFLAGS) /c $(INCLUDE_DIRS) ..\shared\gui.cc + $(CC) $(CFLAGS) $(CPPFLAGS) /c $(INCLUDE_DIRS) $< chip8.obj: ..\shared\chip8.c $(BOOTROM_HEADER) - $(CC) $(CFLAGS) $(CPPFLAGS) /c $(INCLUDE_DIRS) ..\shared\chip8.c + $(CC) $(CFLAGS) $(CPPFLAGS) /c $(INCLUDE_DIRS) $< $(APP_RES): src\Kiwi8.rc resources\Kiwi8.ico RC src\Kiwi8.rc @@ -137,11 +136,11 @@ $(APP_RES): src\Kiwi8.rc resources\Kiwi8.ico debug\profiles.ini: $(PROFILES_INI) IF NOT EXIST debug MKDIR debug - COPY $(PROFILES_INI) debug\profiles.ini + COPY $(PROFILES_INI) $@ release\profiles.ini: $(PROFILES_INI) IF NOT EXIST release MKDIR release - COPY $(PROFILES_INI) release\profiles.ini + COPY $(PROFILES_INI) $@ debug\$(APP_EXE): $(SDL_LIB) $(OBJS) $(APP_RES) $(CXX) $(CXXFLAGS) $(CPPFLAGS) /Zi /Fe$(APP_NAME) $(INCLUDE_DIRS) $(OBJS) $(APP_RES) $(LDFLAGS) /SUBSYSTEM:CONSOLE From dc492ab7f0f2e8545fdf44f3d8b73f6aa65d8300 Mon Sep 17 00:00:00 2001 From: Thomas Daley Date: Sat, 28 Feb 2026 15:48:42 -0800 Subject: [PATCH 9/9] windows NMAKE only supplies `$<` from inference rules --- windows/makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/windows/makefile b/windows/makefile index 5a62f06..70ad718 100644 --- a/windows/makefile +++ b/windows/makefile @@ -98,11 +98,11 @@ $(SDL_LIB): # Generate license header from LICENSE file $(LICENSE_HEADER): ..\LICENSE - python3 ..\tools\generate_license_header.py $< $@ + python3 ..\tools\generate_license_header.py ..\LICENSE $@ # Generate bootrom header from ROM file $(BOOTROM_HEADER): ..\roms\Kiwi8_logo_2.ch8 - python3 ..\tools\generate_bootrom_header.py $< $@ + python3 ..\tools\generate_bootrom_header.py ..\roms\Kiwi8_logo_2.ch8 $@ # Inference rules for incremental compilation {src}.cc{}.obj: @@ -125,10 +125,10 @@ $(BOOTROM_HEADER): ..\roms\Kiwi8_logo_2.ch8 # Explicit rules for files depending on generated headers gui.obj: ..\shared\gui.cc $(LICENSE_HEADER) - $(CC) $(CFLAGS) $(CPPFLAGS) /c $(INCLUDE_DIRS) $< + $(CC) $(CFLAGS) $(CPPFLAGS) /c $(INCLUDE_DIRS) ..\shared\gui.cc chip8.obj: ..\shared\chip8.c $(BOOTROM_HEADER) - $(CC) $(CFLAGS) $(CPPFLAGS) /c $(INCLUDE_DIRS) $< + $(CC) $(CFLAGS) $(CPPFLAGS) /c $(INCLUDE_DIRS) ..\shared\chip8.c $(APP_RES): src\Kiwi8.rc resources\Kiwi8.ico RC src\Kiwi8.rc