Skip to content

Commit 2200612

Browse files
authored
Merge pull request #20 from speccytools/spectranext
Support for spectranext
2 parents 6bcf6f8 + 6370cf2 commit 2200612

58 files changed

Lines changed: 9527 additions & 431 deletions

Some content is hidden

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

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,3 +115,5 @@ xcuserdata
115115
/fusepb/DerivedData
116116
/fusepb/FuseHelp/.jekyll-cache
117117
/fusepb/FuseX.xcodeproj/xcshareddata
118+
/FuseX.dmg
119+
/dist

.gitmodules

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
11
[submodule "3rdparty/audiofile"]
22
path = 3rdparty/audiofile
3-
url = git@github.com:speccytools/fuse-audiofile.git
3+
url = ../fuse-audiofile
44
[submodule "3rdparty/libgcrypt"]
55
path = 3rdparty/libgcrypt
6-
url = git@github.com:speccytools/fuse-libgcrypt.git
7-
[submodule "fusepb/libspectrum"]
8-
path = fusepb/libspectrum
9-
url = https://github.com/speccytools/libspectrum.git
6+
url = ../fuse-libgcrypt
7+
[submodule "3rdparty/FuseGenerator"]
8+
path = 3rdparty/FuseGenerator
9+
url = ../fuse-generator
10+
[submodule "3rdparty/FuseImporter"]
11+
path = 3rdparty/FuseImporter
12+
url = ../fuse-importer
13+
[submodule "3rdparty/libspectrum"]
14+
path = 3rdparty/libspectrum
15+
url = ../libspectrum
16+
[submodule "3rdparty/mbedtls"]
17+
path = 3rdparty/mbedtls
18+
url = ../fuse-mbedtls

3rdparty/FuseGenerator

Submodule FuseGenerator added at bfcf032

3rdparty/FuseImporter

Submodule FuseImporter added at a525ddc

3rdparty/mbedtls

Submodule mbedtls added at fad3a59

Makefile

Lines changed: 169 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,45 @@
1-
.PHONY: 3rdparty audiofile libgcrypt clean-3rdparty
1+
.PHONY: 3rdparty audiofile libgcrypt FuseGenerator FuseImporter mbedtls clean-3rdparty list-teams fusex archive dist dmg clean
22

3-
3rdparty: audiofile libgcrypt
3+
# Signing parameters (can be overridden from command line)
4+
# Example: make 3rdparty DEVELOPMENT_TEAM="ABC123DEFG" CODE_SIGN_IDENTITY="Apple Development"
5+
DEVELOPMENT_TEAM ?=
6+
CODE_SIGN_IDENTITY ?=
7+
CODE_SIGN_STYLE ?= Automatic
8+
PROVISIONING_PROFILE_SPECIFIER ?=
9+
10+
# Archive path (can be overridden from command line)
11+
# Example: make archive ARCHIVE_PATH=./build/FuseX.xcarchive
12+
ARCHIVE_PATH ?= ./build/FuseX.xcarchive
13+
14+
# Automatically set CODE_SIGN_STYLE=Manual if Developer ID identity is specified
15+
ifneq ($(CODE_SIGN_IDENTITY),)
16+
ifeq ($(findstring Developer ID,$(CODE_SIGN_IDENTITY)),Developer ID)
17+
CODE_SIGN_STYLE := Manual
18+
endif
19+
endif
20+
21+
# Build common xcodebuild arguments for signing
22+
XCODEBUILD_SIGN_ARGS :=
23+
ifneq ($(DEVELOPMENT_TEAM),)
24+
XCODEBUILD_SIGN_ARGS += DEVELOPMENT_TEAM="$(DEVELOPMENT_TEAM)"
25+
endif
26+
ifneq ($(CODE_SIGN_IDENTITY),)
27+
XCODEBUILD_SIGN_ARGS += CODE_SIGN_IDENTITY="$(CODE_SIGN_IDENTITY)"
28+
XCODEBUILD_SIGN_ARGS += CODE_SIGN_IDENTITY_ALL="$(CODE_SIGN_IDENTITY)"
29+
endif
30+
ifneq ($(CODE_SIGN_STYLE),)
31+
XCODEBUILD_SIGN_ARGS += CODE_SIGN_STYLE="$(CODE_SIGN_STYLE)"
32+
endif
33+
ifneq ($(PROVISIONING_PROFILE_SPECIFIER),)
34+
XCODEBUILD_SIGN_ARGS += PROVISIONING_PROFILE_SPECIFIER="$(PROVISIONING_PROFILE_SPECIFIER)"
35+
endif
36+
37+
all: 3rdparty
38+
39+
fusepb:
40+
cd fusepb && make clean && make
41+
42+
3rdparty: audiofile libgcrypt FuseGenerator FuseImporter mbedtls
443

544
audiofile:
645
@echo "Building audiofile Framework..."
@@ -10,7 +49,8 @@ audiofile:
1049
-configuration Deployment \
1150
SYMROOT=build \
1251
BUILD_DIR=build \
13-
CONFIGURATION_BUILD_DIR=build/Deployment
52+
CONFIGURATION_BUILD_DIR=build/Deployment \
53+
$(XCODEBUILD_SIGN_ARGS)
1454

1555
libgcrypt:
1656
@echo "Building gcrypt Framework..."
@@ -20,9 +60,134 @@ libgcrypt:
2060
-configuration Deployment \
2161
SYMROOT=build \
2262
BUILD_DIR=build \
23-
CONFIGURATION_BUILD_DIR=build/Deployment
63+
CONFIGURATION_BUILD_DIR=build/Deployment \
64+
$(XCODEBUILD_SIGN_ARGS)
65+
66+
FuseGenerator:
67+
@echo "Building FuseGenerator Framework..."
68+
cd 3rdparty/FuseGenerator && \
69+
xcodebuild -project FuseGenerator.xcodeproj \
70+
-target "FuseGenerator" \
71+
-configuration Deployment \
72+
SYMROOT=build \
73+
BUILD_DIR=build \
74+
CONFIGURATION_BUILD_DIR=build/Deployment \
75+
$(XCODEBUILD_SIGN_ARGS)
76+
77+
FuseImporter:
78+
@echo "Building FuseImporter Framework..."
79+
cd 3rdparty/FuseImporter && \
80+
xcodebuild -project FuseImporter.xcodeproj \
81+
-target "FuseImporter" \
82+
-configuration Deployment \
83+
SYMROOT=build \
84+
BUILD_DIR=build \
85+
CONFIGURATION_BUILD_DIR=build/Deployment \
86+
$(XCODEBUILD_SIGN_ARGS)
87+
88+
mbedtls:
89+
@echo "Building mbedtls Framework..."
90+
cd 3rdparty/mbedtls && \
91+
xcodebuild -project mbedtls.xcodeproj \
92+
-target "mbedtls" \
93+
-configuration Deployment \
94+
SYMROOT=build \
95+
BUILD_DIR=build \
96+
CONFIGURATION_BUILD_DIR=build/Deployment \
97+
$(XCODEBUILD_SIGN_ARGS)
98+
99+
list-teams:
100+
@echo "Available code signing identities and development teams:"
101+
@echo ""
102+
@if security find-identity -v -p codesigning 2>/dev/null | grep -q "valid identities found"; then \
103+
echo "Unique Development Team IDs:"; \
104+
security find-identity -v -p codesigning 2>/dev/null | \
105+
grep -oE '\([A-Z0-9]{10}\)' | \
106+
sed 's/[()]//g' | \
107+
sort -u | \
108+
while read team; do \
109+
echo " $$team"; \
110+
done; \
111+
echo ""; \
112+
echo "Full identity list:"; \
113+
security find-identity -v -p codesigning 2>/dev/null; \
114+
else \
115+
echo "No code signing identities found. Make sure you have certificates installed in your keychain."; \
116+
fi
117+
118+
fusex: 3rdparty fusepb
119+
@echo "Building FuseX app..."
120+
cd fusepb && \
121+
xcodebuild -project FuseX.xcodeproj \
122+
-target FuseX \
123+
-configuration Deployment \
124+
SYMROOT=build \
125+
BUILD_DIR=build \
126+
CONFIGURATION_BUILD_DIR=build/Deployment \
127+
$(XCODEBUILD_SIGN_ARGS)
128+
129+
archive: 3rdparty fusepb
130+
@echo "Archiving FuseX app..."
131+
@mkdir -p build
132+
cd fusepb && \
133+
xcodebuild archive \
134+
-project FuseX.xcodeproj \
135+
-scheme FuseX \
136+
-configuration Deployment \
137+
-archivePath "$(CURDIR)/$(ARCHIVE_PATH)" \
138+
SYMROOT=build \
139+
BUILD_DIR=build \
140+
CONFIGURATION_BUILD_DIR=build/Deployment \
141+
$(XCODEBUILD_SIGN_ARGS)
142+
@echo "Archive created at: $(ARCHIVE_PATH)"
143+
144+
dist:
145+
@echo "Checking for dist/FuseX.app..."
146+
@if [ ! -d "dist/FuseX.app" ]; then \
147+
echo "Error: dist/FuseX.app not found. Please copy FuseX.app to dist/ first."; \
148+
exit 1; \
149+
fi
150+
@echo "dist/FuseX.app found."
151+
152+
dmg: dist
153+
@echo "Creating FuseX.dmg..."
154+
@if ! command -v create-dmg >/dev/null 2>&1; then \
155+
echo "Error: create-dmg is not installed. Install it with: brew install create-dmg"; \
156+
exit 1; \
157+
fi
158+
@rm -f FuseX.dmg
159+
@if create-dmg \
160+
--volname "FuseX" \
161+
--window-pos 200 120 \
162+
--window-size 600 300 \
163+
--icon-size 100 \
164+
--icon "FuseX.app" 175 120 \
165+
--hide-extension "FuseX.app" \
166+
--app-drop-link 425 120 \
167+
FuseX.dmg \
168+
dist/; then \
169+
if [ -f "FuseX.dmg" ]; then \
170+
echo "DMG created successfully: FuseX.dmg"; \
171+
else \
172+
echo "Error: DMG file was not created"; \
173+
exit 1; \
174+
fi \
175+
else \
176+
echo "Error: create-dmg failed"; \
177+
exit 1; \
178+
fi
24179

25180
clean-3rdparty:
26181
@echo "Cleaning 3rdparty build artifacts..."
27182
rm -rf 3rdparty/audiofile/build
28183
rm -rf 3rdparty/libgcrypt/build
184+
rm -rf 3rdparty/FuseGenerator/build
185+
rm -rf 3rdparty/FuseImporter/build
186+
rm -rf 3rdparty/mbedtls/build
187+
188+
clean: clean-3rdparty
189+
@echo "Cleaning FuseX build artifacts..."
190+
rm -rf fusepb/build
191+
rm -rf build
192+
rm -rf dist
193+
rm -f FuseX.dmg

debugger/breakpoint.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626

2727
#include "config.h"
2828

29+
#include "gdbserver.h"
30+
2931
#include <ctype.h>
3032
#include <string.h>
3133

@@ -254,6 +256,13 @@ debugger_check( debugger_breakpoint_type type, libspectrum_dword value )
254256
libspectrum_free( bp );
255257
signal_breakpoints_updated = 1;
256258
}
259+
260+
// Activate gdbserver with breakpoint trap reason
261+
extern char gdbserver_debugging_enabled;
262+
extern int gdbserver_activate_with_reason(int trap_reason);
263+
if (gdbserver_debugging_enabled) {
264+
gdbserver_activate_with_reason(DEBUG_TRAP_REASON_BREAKPOINT);
265+
}
257266
}
258267

259268
}

0 commit comments

Comments
 (0)