Skip to content

Commit d0a62b6

Browse files
committed
v1.04
new: gamepad bindings (up to 16 buttons) new: github releases workflow by @zpl-zak (1,000 thanks!) new: next iteration of our local file browser new: support light/dark OS theme (Windows) new: +SHIFT key to capture UI layer (PIC,REC buttons) new: logos and branding images chg: added hints for zx models chg: avoid recording UI layer in videos chg: display dialog titles whenever possible chg: do not translate games before loading (AfterTheWar) chg: ESC/RMB presses will cancel the UI top layer (dialog/overlay layer) before switching to game browser chg: highlighted current selected option whenever possible chg: increased internal buffers for va() calls chg: removed Screenshot action from PRINT_SCREEN key mapping chg: replaced native (i)nfo dialog chg: simplified makefile: removed embed tool (MAKE) chg: ZXDB made ids clickable (forwards to SC page) fix: do not shorten tape silences when TurboROM is enabled (see: Alkatraz/TopoSoft games) fix: fixed bug that prevented excessively long named games (+128chars) from being included in zxdb listings (TheMojonTwins) fix: fixed issue2 from being selected within new UI menu fix: fixed local file browser while identifying some false positive file extensions (like .c) fix: fixed wrong window priority when displaying search dialog in fullscreen fix: made xinput library to be loaded dynamically; fixes those installations where DirectX is not pre-installed (Windows) fix: reduced heuristics for Kempston Mouse detection from (X+Y+MB to X+MB) since Arkanoid does not use Y coord :o) fix: use AVX in X64 builds and SSE2 in X86 builds (Windows) wip: toggled different GLX attributes in the hope that hw accelerated surface gets enabled (Linux)
1 parent 7c23300 commit d0a62b6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+11779
-10888
lines changed

.github/README.md

+28-28
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,30 @@
1-
# Spectral <img src="../src/res/img/noto_1f47b.png" width="5%" height="5%" />
2-
Sinclair ZX Spectrum emulator from the 80s.
1+
<p align="center">
2+
<img src="../src/res/logo/bar1.png" width="600"/><img src="../src/res/logo/logowbg.png" width="8%" height="8%"/><br/>
3+
</p>
34

4-
![image](https://github.com/r-lyeh/Spectral/assets/35402248/8d8ee594-fafd-4538-993f-9840bf9fc245)
5-
![image](https://github.com/r-lyeh/Spectral/assets/35402248/c1257c88-56c0-4325-926a-b0cbf8b19ae5)
6-
![image](https://github.com/r-lyeh/Spectral/assets/35402248/99bc9b7a-aa8e-421b-bd8b-8556a4d0dfcb)
7-
8-
## About
9-
Spectral is an experimental emulator that I have been randomly assembling [since the pandemic days](https://twitter.com/r_rlyeh/status/1280964279903158273), inspired by my old fZX32 emulator. Accuracy and performance are long-term goals, but the primary focus is just having fun with this thing. Hardcore ZX users will find little value in this emulator right now, but I hope newbies may find its ease of use somehow appealing to try.
5+
Spectral is an experimental Sinclair ZX Spectrum emulator from the 80s, which has been randomly assembled [since the pandemic days](https://twitter.com/r_rlyeh/status/1280964279903158273). Accuracy and performance are long-term goals, but the primary focus is just having fun with this thing. Hardcore ZX users will find little value in this emulator right now, but I hope newbies may find its ease of use somehow appealing to try.
106
That being said, Spectral has a very compatible TAP/TZX loader and some other interesting features that provide me some fun in these days.
117
Code is highly experimental and prone to change in the future. I will keep altering/breaking things randomly for good sake.
128

13-
## Features and wishlist
9+
<p align="center">
10+
<img src="https://github.com/r-lyeh/Spectral/assets/35402248/8d8ee594-fafd-4538-993f-9840bf9fc245"/><br/>
11+
<img src="https://github.com/user-attachments/assets/05de75a6-ae3c-4da8-9896-8cc89efbb5e6"/><br/>
12+
<img src="https://github.com/user-attachments/assets/fcc20345-c619-48df-af26-e37c8af99a6c"/>
13+
</p>
14+
15+
# Roadmap and features
16+
- [ ] Extra accurate Z80 backend. <!-- @todo: contended mem, contended ports, memptr, snow, Q, floating bus (+2a/+3) -->
17+
- [ ] Cycle accurate (border, multicolor, etc).
18+
- [ ] RZX support. <!-- @todo: rzx loadsave http://ramsoft.bbk.org.omegahg.com/rzxform.html -->
19+
- [ ] MP3s.
20+
- [ ] Netplay.
21+
- [ ] Optimized.
22+
- [x] Unlicensed.
1423
- [x] Single executable.
15-
- [x] Z80. Z80 Disassembler.
24+
- [x] Z80. Z80 Disassembler. 3.5/7/14 MHz.
1625
- [x] 16, 48, 128, +2, +2A, +3, Pentagon128 models.
1726
- [x] Issue 2/3 keyboards.
18-
- [x] ULA/ULA+ graphics.
27+
- [x] ULA/ULA+ graphics. 25/30/50/60Hz fps lock.
1928
- [x] Beeper/AY chips. Turbosound (Turbo-AY).
2029
- [x] Kempston mouse. <!-- @todo: AMX mouse.-->
2130
- [x] Kempston/Fuller/Cursor/Sinclair joysticks. Gamepad support (Windows, Linux). <!-- @todo: invert joystick/mouse axes/buttons -->
@@ -28,7 +37,6 @@ Code is highly experimental and prone to change in the future. I will keep alter
2837
- [x] Nec µ765/Betadisk interfaces.
2938
- [x] Auto load games. Auto play/stop tape. TurboROM.
3039
- [x] Graphical tape browser.
31-
- [x] 25/30/50/60Hz fps lock.
3240
- [x] Run-Ahead.
3341
- [x] POK support. <!-- @todo: cheats finder; useful? -->
3442
- [x] Gunstick, Lightgun. <!-- Cheetah Defender Lightgun, Magnum Light Phaser, Stack Light Rifle -->
@@ -40,23 +48,15 @@ Code is highly experimental and prone to change in the future. I will keep alter
4048
- [x] ZXDB Browser. ZXDB Gallery. <!-- @todo: 3d tape cases. -->
4149
- [x] Can translate game menus from some languages into English.
4250
- [x] Games can be appended to executable and get a standalone game viewer.
43-
- [ ] Extra accurate Z80 backend. <!-- @todo: contended mem, contended ports, memptr, snow, Q, floating bus (+2a/+3) -->
44-
- [ ] Cycle accurate (border, multicolor, etc).
45-
- [ ] RZX support. <!-- @todo: rzx loadsave http://ramsoft.bbk.org.omegahg.com/rzxform.html -->
46-
- [ ] MP3s.
47-
- [ ] Netplay.
48-
- [ ] Optimized.
49-
- [x] Unlicensed.
5051

51-
## Downloads
52-
Download any binary release from [Releases section](https://github.com/r-lyeh/Spectral/releases).
52+
# Downloads
53+
Download both source code and binary releases from [these links](https://github.com/r-lyeh/Spectral/releases).
5354

5455
Alternatively, you can build the emulator yourself:
55-
- `git clone https://github.com/r-lyeh/Spectral`
5656
- Windows users double click `MAKE.bat` file.
5757
- Linux/MacOS users can run `sh MAKE.bat` instead.
5858

59-
## Usage
59+
# Usage
6060
Spectral can be configured with a mouse.
6161

6262
Here are some keyboard shortcuts, though:
@@ -66,18 +66,18 @@ Here are some keyboard shortcuts, though:
6666

6767
Hold any F1..F12 key for 2 seconds to redefine it.
6868

69-
## Credits
69+
# Credits
7070
Andre Weissflog, for their many single-header libraries! (Zlib licensed). Peter Sovietov and wermipls, for their accurate AY chip emulator (MIT licensed). Ulrich Doewich and Colin Pitrat, for their uPD765A floppy disk controller (GPL licensed). Marat Fayzullin for their WD1793/FDI controllers (Proprietary). Sean Middleditch for their gamepad code (MIT licensed). Sergey Bulba for their ay2sna tool (Public Domain). Potapov Vsevolod Viktorovich for their rusfaq website. Andrew Owen and Geoff Wearmouth for their custom ROMs. Simon Owen for their DSK technical websites. Santiago Romero, Philip Kendall, James McKay for their FOSS emulators. Damian Vila for their BESCII truetype font (CC-1.0). lalaoopybee, for their lovely tube shader. Günter Woigk, Juan Carlos González Amestoy and David Colmenero for their floppy sound recordings. The ZXDB devs. The ZX Spectrum Discord folks. All the ZX community!
7171

72-
## Unlicense
72+
# Unlicense
7373
This software is released into the [public domain](https://unlicense.org/). Also dual-licensed as [0-BSD](https://opensource.org/licenses/0BSD) or [MIT (No Attribution)](https://github.com/aws/mit-0) for those countries where public domain is a concern (sigh). Any contribution to this repository is implicitly subjected to the same release conditions aforementioned.
7474

75-
## Links
75+
# Links
7676
- [Introduction to the ZX Spectrum](https://en.wikipedia.org/wiki/ZX_Spectrum), entry on Wikipedia.
77-
- [SpecEmu](https://specemu.zxe.io/), my favourite ZX emulator on Windows.
77+
- [SpecEmu](https://specemu.zxe.io/), my favourite ZX emulator on Windows. Also, see [other alternatives](https://alternativeto.net/software/spectral/).
7878
- [SpectrumComputing](https://spectrumcomputing.co.uk/), [WorldOfSpectrum](https://worldofspectrum.net/), [ZXArt](https://zxart.ee/), [Virtual TRDOS](https://vtrd.in/) and [ZXInfo](https://zxinfo.dk/) are the best online resources (imho).
7979
- [Crash](https://archive.org/details/crash-magazine), [YourSinclair](https://archive.org/details/your-sinclair-magazine), [SinclairUser](https://archive.org/details/sinclair-user-magazine) and [MicroHobby(ES)](https://archive.org/details/microhobby-magazine) are great old paper magazines.
80-
- [ZXDB](https://github.com/zxdb/ZXDB), [game maps](https://maps.speccy.cz/), [game cheats](https://www.the-tipshop.co.uk/), [RZX](https://worldofspectrum.net/RZXformat.html)[replays](https://www.rzxarchive.co.uk/) and [game longplays](https://www.youtube.com/@rzxarchive).
80+
- [ZXDB](https://github.com/zxdb/ZXDB), [game maps](https://maps.speccy.cz/), [game cheats](https://www.the-tipshop.co.uk/), [RZX](https://worldofspectrum.net/RZXformat.html) [replays](https://www.rzxarchive.co.uk/) and [game longplays](https://www.youtube.com/@SpectrumComputing).
8181
- [Daily ZX videos](https://www.youtube.com/results?search_query=zx+spectrum&sp=CAI%253D), on YouTube.
8282

8383
[![](https://github.com/r-lyeh/Spectral/actions/workflows/build.yml/badge.svg)](https://github.com/r-lyeh/Spectral/actions/workflows/build.yml) <a href="https://discord.gg/UpB7nahEFU"><img alt="Discord" src="https://img.shields.io/discord/354670964400848898?color=5865F2&label=Chat&logo=discord&logoColor=white"/></a>

.github/workflows/release.yml

+113
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
2+
name: Create Pre-Release
3+
4+
on:
5+
workflow_dispatch:
6+
inputs:
7+
version:
8+
description: 'Version number (e.g. v1.05 becomes 105)'
9+
required: true
10+
11+
jobs:
12+
create-release:
13+
runs-on: ubuntu-latest
14+
outputs:
15+
upload_url: ${{ steps.create_release.outputs.upload_url }}
16+
steps:
17+
- uses: actions/checkout@v3
18+
with:
19+
fetch-depth: 0
20+
- name: Generate Release Notes
21+
id: generate_release_notes
22+
run: |
23+
# Get commits since last tag or from beginning if no tags exist
24+
LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
25+
if [ -z "$LAST_TAG" ]; then
26+
COMMITS=$(git log --pretty=format:"- %s (%h)" --no-merges)
27+
else
28+
COMMITS=$(git log ${LAST_TAG}..HEAD --pretty=format:"- %s (%h)" --no-merges)
29+
fi
30+
echo "RELEASE_NOTES<<EOF" >> $GITHUB_ENV
31+
echo "## What's Changed" >> $GITHUB_ENV
32+
echo "$COMMITS" >> $GITHUB_ENV
33+
echo "EOF" >> $GITHUB_ENV
34+
- name: Create Release
35+
id: create_release
36+
uses: actions/create-release@v1
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
with:
40+
tag_name: ${{ github.event.inputs.version }}
41+
release_name: Spectral ${{ github.event.inputs.version }}
42+
body: ${{ env.RELEASE_NOTES }}
43+
draft: true
44+
prerelease: false
45+
46+
build-windows:
47+
needs: create-release
48+
runs-on: windows-latest
49+
steps:
50+
- uses: actions/checkout@v3
51+
- name: Setup MSBuild
52+
uses: microsoft/setup-msbuild@v1.1
53+
- name: Build Windows
54+
run: ./MAKE.bat
55+
- name: Upload Windows Artifact
56+
uses: actions/upload-release-asset@v1
57+
env:
58+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59+
with:
60+
upload_url: ${{ needs.create-release.outputs.upload_url }}
61+
asset_path: ./Spectral.exe
62+
asset_name: Spectral-${{ github.event.inputs.version }}.exe
63+
asset_content_type: application/vnd.microsoft.portable-executable
64+
65+
build-ubuntu:
66+
needs: create-release
67+
runs-on: ubuntu-20.04 ## ubuntu-latest
68+
steps:
69+
- uses: actions/checkout@v3
70+
- name: Install Dependencies
71+
run: |
72+
sudo apt-get update
73+
sudo apt-get install -y build-essential libgtk-3-dev
74+
- name: Build Ubuntu
75+
run: sh MAKE.bat
76+
- name: Upload Ubuntu Artifact
77+
uses: actions/upload-release-asset@v1
78+
env:
79+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
80+
with:
81+
upload_url: ${{ needs.create-release.outputs.upload_url }}
82+
asset_path: ./Spectral.linux
83+
asset_name: Spectral-${{ github.event.inputs.version }}.linux
84+
asset_content_type: application/x-executable
85+
86+
build-macos:
87+
needs: create-release
88+
runs-on: macos-13 ##macos-latest
89+
steps:
90+
- uses: actions/checkout@v3
91+
- name: Build macOS
92+
run: sh MAKE.bat
93+
- name: Upload macOS Artifact
94+
uses: actions/upload-release-asset@v1
95+
env:
96+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
97+
with:
98+
upload_url: ${{ needs.create-release.outputs.upload_url }}
99+
asset_path: ./Spectral.dmg
100+
asset_name: Spectral-${{ github.event.inputs.version }}.dmg
101+
asset_content_type: application/x-apple-diskimage
102+
- name: Create source archive
103+
run: |
104+
git archive --format=tar.gz --output=source.tar.gz HEAD
105+
- name: Upload sources
106+
uses: actions/upload-release-asset@v1
107+
env:
108+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
109+
with:
110+
upload_url: ${{ needs.create-release.outputs.upload_url }}
111+
asset_path: ./source.tar.gz
112+
asset_name: Spectral-${{ github.event.inputs.version }}.tar.gz
113+
asset_content_type: application/gzip

MAKE.bat

+47-26
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@ if [ "$(uname)" != "Darwin" ]; then
2020
# compile -------------------------------------------------------------------- do not use -O3 below. zxdb cache will contain 0-byte files otherwise.
2121
gcc src/app.c -I src -o ./Spectral.linux -O2 -DNDEBUG=3 -D_GNU_SOURCE -Wno-unused-result -Wno-unused-value -Wno-format -Wno-multichar -Wno-pointer-sign -Wno-string-plus-int -Wno-empty-body -lm -lX11 -lGL -lasound -lpthread -ludev $* || exit
2222
upx -9 Spectral.linux
23-
src/res/embed.linux Spectral.linux @SpectralEmBeDdEd
24-
src/res/embed.linux Spectral.linux src/res/zxdb/Spectral.db.gz
25-
src/res/embed.linux Spectral.linux @SpectralEmBeDdEd
23+
#src/res/embed.linux Spectral.linux @SpectralEmBeDdEd
24+
#src/res/embed.linux Spectral.linux src/res/zxdb/Spectral.db.gz
25+
#src/res/embed.linux Spectral.linux @SpectralEmBeDdEd
26+
cat Spectral.linux src/res/embed src/res/zxdb/Spectral.db.gz src/res/embed > Spectral.linux
2627

2728
fi
2829

@@ -31,9 +32,10 @@ if [ "$(uname)" = "Darwin" ]; then
3132
# compile --------------------------------------------------------------------
3233
export SDKROOT=$(xcrun --show-sdk-path)
3334
gcc -ObjC src/app.c -I src -o ./Spectral.osx -O3 -DNDEBUG=3 -Wno-unused-result -Wno-unused-value -Wno-format -Wno-multichar -Wno-pointer-sign -Wno-string-plus-int -Wno-empty-body -Wno-dangling-else -framework cocoa -framework iokit -framework CoreFoundation -framework CoreAudio -framework AudioToolbox -framework OpenGL -lm $* || exit
34-
src/res/embed.osx Spectral.osx @SpectralEmBeDdEd
35-
src/res/embed.osx Spectral.osx src/res/zxdb/Spectral.db.gz
36-
src/res/embed.osx Spectral.osx @SpectralEmBeDdEd
35+
#src/res/embed.osx Spectral.osx @SpectralEmBeDdEd
36+
#src/res/embed.osx Spectral.osx src/res/zxdb/Spectral.db.gz
37+
#src/res/embed.osx Spectral.osx @SpectralEmBeDdEd
38+
cat Spectral.osx src/res/embed src/res/zxdb/Spectral.db.gz src/res/embed > Spectral.osx
3739

3840
# embed icon and make .app
3941
test -d Spectral.app && rm -rf Spectral.app
@@ -65,7 +67,7 @@ if "%1"=="" (
6567
)
6668

6769
if "%1"=="-h" (
68-
echo make [deb^|dev^|opt^|rel] [compiler-flags]
70+
echo make [bug^|dev^|opt^|rel] [compiler-flags]
6971
exit /b
7072
)
7173

@@ -120,14 +122,12 @@ if "%1"=="tidy" (
120122

121123
if "%1"=="dev" (
122124
call make nil /Zi %ALL_FROM_2ND% || goto error
123-
src\res\embed Spectral.exe @SpectralEmBeDdEd
124-
src\res\embed Spectral.exe src\res\zxdb\Spectral.db.gz
125-
src\res\embed Spectral.exe @SpectralEmBeDdEd
125+
copy /b/y Spectral.exe+src\res\embed+src\res\zxdb\Spectral.db.gz+src\res\embed Spectral.exe > nul
126126

127127
exit /b
128128
)
129129

130-
if "%1"=="deb" (
130+
if "%1"=="bug" (
131131
call make dev /fsanitize=address %ALL_FROM_2ND% || goto error
132132

133133
tasklist /fi "ImageName eq remedybg.exe" 2>NUL | find /I "exe">NUL || (where /q remedybg.exe && start remedybg -q -g Spectral.exe)
@@ -136,19 +136,19 @@ if "%1"=="deb" (
136136
)
137137

138138
if "%1"=="opt" (
139+
rem /dynamicdeopt
139140
rem do not use /O1 or /O2 below. ayumi drums will be broken in AfterBurner.dsk otherwise (not anymore?)
140141
rem do not use /O2 below. +3 FDC may behave weirdly otherwise (AfterBurner.dsk/GNG.dsk)
141-
rem do not use /arch:AVX2 to maximize compatibility. see issue #4
142142
rem false positives: +1 (vs19) .. +4 (vs22) - secureage (bc of DNDEBUG and optimization flags lol)
143-
call make nil /Ox /MT /DNDEBUG /GL /GF /arch:AVX %ALL_FROM_2ND% || goto error
143+
call make nil /Ox /MT /DNDEBUG /GL /GF %ALL_FROM_2ND% || goto error
144144
rem false positives: +12
145145
rem where /q upx.exe && upx Spectral.exe
146+
146147
rem false positives: +2 - crowdstrike falcon, cylance
147-
src\res\embed Spectral.exe @SpectralEmBeDdEd
148-
copy /y Spectral.exe SpectralNoZXDB.exe
148+
copy /b/y Spectral.exe+src\res\embed SpectralNoZXDB.exe > nul
149149
rem false positives: +1 - microsoft (defender)
150-
src\res\embed Spectral.exe src\res\zxdb\Spectral.db.gz
151-
src\res\embed Spectral.exe @SpectralEmBeDdEd
150+
copy /b/y SpectralNoZXDB.exe+src\res\zxdb\Spectral.db.gz+src\res\embed Spectral.exe > nul
151+
152152
exit /b
153153
)
154154

@@ -162,7 +162,7 @@ if "%1"=="rel" (
162162
del *.ilk 1>nul 2>nul
163163
del *.pdb 1>nul 2>nul
164164

165-
exit /b 1
165+
exit /b
166166
)
167167

168168
where /q cl.exe || call "%VS170COMNTOOLS%/../../VC/Auxiliary/Build/vcvarsx86_amd64.bat" >nul 2>nul
@@ -180,8 +180,12 @@ set "cc=clang-cl -Wno-multichar -Wno-unused-value -Wno-macro-redefined -Wno-impl
180180
(where /q clang-cl || set "cc=cl" >nul 2>nul)
181181
)
182182

183-
echo !cc! src\app.c src\sys_window.cc -I src /FeSpectral.exe %ALL_FROM_2ND%
184-
!cc! src\app.c src\sys_window.cc -I src /FeSpectral.exe %ALL_FROM_2ND% || goto error
183+
rem X86 use /arch:SSE2 to maximize performance
184+
rem X64 do not use /arch:AVX2 to maximize compatibility. see issue #4
185+
if "%__DOTNET_PREFERRED_BITNESS%"=="32" (set ARCH=/arch:SSE2) else (set ARCH=/arch:AVX)
186+
187+
echo !cc! src\app.c src\sys_window.cc -I src /FeSpectral.exe !ARCH! %ALL_FROM_2ND%
188+
!cc! src\app.c src\sys_window.cc -I src /FeSpectral.exe !ARCH! %ALL_FROM_2ND% || goto error
185189

186190

187191
for /F "skip=1 delims=" %%F in ('
@@ -193,14 +197,31 @@ for /F "skip=1 delims=" %%F in ('
193197
set year=%%N
194198
)
195199
)
196-
where /q rcedit-x64.exe && rcedit-x64 "Spectral.exe" --set-file-version "!year!.!month!.!today!.!today!!month!"
197-
where /q rcedit-x64.exe && rcedit-x64 "Spectral.exe" --set-product-version "1.03 Spectral"
198-
where /q rcedit-x64.exe && rcedit-x64 "Spectral.exe" --set-icon src\res\img\noto_1f47b.ico
199-
rem where /q rcedit-x64.exe && rcedit-x64 "Spectral.exe" --set-version-string "version" "value"
200-
rem where /q rcedit-x64.exe && rcedit-x64 "Spectral.exe" --set-resource-string "version" "value"
200+
201+
rem where /q rcedit-x64 || (git clone https://github.com/electron/rcedit && pushd rcedit && git checkout 28a1319 && rc src\rcedit.rc && cl /Fercedit-x64 src\*.res src\*.c* /EHsc version.lib && copy *.exe /y .. && popd)
202+
rem where /q rcedit-x64 || (git clone https://github.com/electron/rcedit/ && pushd rcedit && cmake . && msbuid rcedit.sln && popd)
203+
rem where /q rcedit-x64 || (
204+
rem git clone https://github.com/electron/rcedit && pushd rcedit && git checkout 28a1319
205+
rem echo cmake_minimum_required^(VERSION 3.15^) > CMakeLists.txt
206+
rem echo set^(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded"^) >> CMakeLists.txt
207+
rem echo project^(rcedit^) >> CMakeLists.txt
208+
rem echo add_executable^(rcedit src/main.cc src/rescle.cc src/rcedit.rc^) >> CMakeLists.txt
209+
rem echo target_link_libraries^(rcedit version.lib^) >> CMakeLists.txt
210+
rem cmake . && msbuild rcedit.sln
211+
rem copy /y Debug\rcedit.exe ..\rcedit-x64.exe
212+
rem popd
213+
rem )
214+
215+
where /q rcedit-x64 || curl -LO https://github.com/electron/rcedit/releases/download/v2.0.0/rcedit-x64.exe
216+
where /q rcedit-x64 && rcedit-x64 "Spectral.exe" --set-file-version "!year!.!month!.!today!.!today!!month!"
217+
where /q rcedit-x64 && rcedit-x64 "Spectral.exe" --set-product-version "1.04 Spectral"
218+
where /q rcedit-x64 && rcedit-x64 "Spectral.exe" --set-icon src\res\img\noto_1f47b.ico
219+
rem where /q rcedit-x64 && rcedit-x64 "Spectral.exe" --set-version-string "version" "value"
220+
rem where /q rcedit-x64 && rcedit-x64 "Spectral.exe" --set-resource-string "version" "value"
221+
201222
rem where /Q ResourceHacker.exe && ResourceHacker.exe -open Spectral.exe -save Spectral.exe -action addskip -res src\res\img\noto_1f47b.ico -mask ICONGROUP,MAINICON,0
202223

203-
if "%__DOTNET_PREFERRED_BITNESS%"=="1" (
224+
if "%__DOTNET_PREFERRED_BITNESS%"=="32" (
204225
move /y Spectral.exe SpectralX86.exe
205226
)
206227

src/3rd_dir.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ int dir_yield(dir *d, const char *pathfile, char *name, int namelen) {
117117

118118
dir *dir_open(const char *pathfile, const char *mode) {
119119
dir *d = (dir*)REALLOC(0, sizeof(dir)), zero = {0}; *d = zero;
120-
d->recursive = (mode[0] == 'R' || mode[0] == 'r');
120+
d->recursive = mode && (mode[0] == 'R' || mode[0] == 'r');
121121

122122
char *clean = STRDUP( pathfile );
123123
for( int i = 0; clean[i]; ++i ) if(clean[i] == '\\') clean[i] = '/';

0 commit comments

Comments
 (0)