Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
c2511b2
Add iOS compilation test workflow
Beakerboy Jun 11, 2026
33842d6
Update ios-compile-test.yml
Beakerboy Jun 11, 2026
96111a2
Update ios-compile-test.yml
Beakerboy Jun 11, 2026
dc33dd4
Update ios-compile-test.yml
Beakerboy Jun 11, 2026
efd9cd6
Update ios-compile-test.yml
Beakerboy Jun 11, 2026
ea5be08
Update branch name from 'develop' to 'dev'
Beakerboy Jun 11, 2026
87d9a39
Update ios-compile-test.yml
Beakerboy Jun 11, 2026
d9747c9
Update ios-compile-test.yml
Beakerboy Jun 11, 2026
6606b71
Update ios-compile-test.yml
Beakerboy Jun 11, 2026
7252fec
Update ios-compile-test.yml
Beakerboy Jun 11, 2026
fbac3e6
Update ios-compile-test.yml
Beakerboy Jun 11, 2026
4e1b96f
Update ios-compile-test.yml
Beakerboy Jun 11, 2026
1ab9554
Update ios-compile-test.yml
Beakerboy Jun 11, 2026
66350fd
Update ios-compile-test.yml
Beakerboy Jun 11, 2026
8660ad0
Update ios-compile-test.yml
Beakerboy Jun 11, 2026
bda5813
Update ios-compile-test.yml
Beakerboy Jun 11, 2026
310359b
Update ios-compile-test.yml
Beakerboy Jun 11, 2026
536fe88
Update ios-compile-test.yml
Beakerboy Jun 11, 2026
864051d
Refactor iOS workflow for resource initialization
Beakerboy Jun 11, 2026
f6442bf
Update ios-compile-test.yml
Beakerboy Jun 11, 2026
ccbe0b6
Update ios-compile-test.yml
Beakerboy Jun 11, 2026
51dc0ee
Update ios-compile-test.yml
Beakerboy Jun 11, 2026
2527670
Update ios-compile-test.yml
Beakerboy Jun 11, 2026
32fca12
Update ios-compile-test.yml
Beakerboy Jun 11, 2026
6172b00
Update ios-compile-test.yml
Beakerboy Jun 11, 2026
773dadf
Update ios-compile-test.yml
Beakerboy Jun 11, 2026
62c4298
Update ios-compile-test.yml
Beakerboy Jun 11, 2026
93fcf41
Update ios-compile-test.yml
Beakerboy Jun 11, 2026
7212b26
Update ios-compile-test.yml
Beakerboy Jun 11, 2026
924debe
Update ios-compile-test.yml
Beakerboy Jun 11, 2026
fa5777d
Update ios-compile-test.yml
Beakerboy Jun 11, 2026
fdc47ee
Change target to scheme in iOS build workflow
Beakerboy Jun 11, 2026
21c827f
Update ios-compile-test.yml
Beakerboy Jun 11, 2026
5985041
Update ios-compile-test.yml
Beakerboy Jun 11, 2026
85c1e39
Update ios-compile-test.yml
Beakerboy Jun 11, 2026
1aa6bcb
Update ios-compile-test.yml
Beakerboy Jun 11, 2026
4dcc381
Create tile.c
Beakerboy Jun 11, 2026
26f029a
Update ios-compile-test.yml
Beakerboy Jun 11, 2026
aa7e99d
Update ios-compile-test.yml
Beakerboy Jun 11, 2026
d265cb2
Update ios-compile-test.yml
Beakerboy Jun 11, 2026
88f648a
Update ios-compile-test.yml
Beakerboy Jun 11, 2026
b38517f
Update iOS workflow for compilation and packaging
Beakerboy Jun 13, 2026
bda6d09
Delete nethack/src/tile.c (#22)
Beakerboy Jun 26, 2026
b779c8a
Add Blind and Nudist options
Beakerboy Jun 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions .github/workflows/ios-compile-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: iOS App Compilation & Packaging

on:
push:
branches: [ main, dev ]
pull_request:

jobs:
build-ipa:
runs-on: macos-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Compile and Run Tilemap Generator
run: |
# 1. Compile tilemap.c natively on the runner host
cd nethack/win
gcc -I../include -I../src -Wp,-w share/tilemap.c -o tilemap_generator

# 2. Execute the generator to output the missing tile mapping files
./tilemap_generator

# 3. Verify the generated file exists in the expected path
cd ..
ls -la src/
cd ..

- name: Force Xcode Version
run: sudo xcode-select -s /Applications/Xcode.app

- name: Fix Misplaced Entitlements Warning
run: |
sed -i '' '/Entitlements.pbxproj/d' iNetHack.xcodeproj/project.pbxproj || true
sed -i '' '/Entitlements.plist/d' iNetHack.xcodeproj/project.pbxproj || true

- name: "Step 1: Initialize Source and Sandbox Mock Assets"
run: |
mkdir -p dat lib nethack/dat nethack/lib
echo "mock data" > dat/nhdat
echo "mock library" > lib/placeholder.txt
echo "mock data" > nethack/dat/nhdat
echo "mock library" > nethack/lib/placeholder.txt

# Pre-build target structure for the real phone deployment path
mkdir -p build_output/Build/Products/Debug-iphoneos/iNetHack2.app/lib
echo "mock data" > build_output/Build/Products/Debug-iphoneos/iNetHack2.app/nhdat
echo "mock library" > build_output/Build/Products/Debug-iphoneos/iNetHack2.app/lib/placeholder.txt

- name: "Step 2: Compile App for Physical iPhone Hardware"
run: |
# We change the SDK to 'iphoneos' and target generic iOS devices
# so Xcode generates an arm64 binary for real phone processors.
xcodebuild build \
-project "iNetHack.xcodeproj" \
-scheme "iNetHack2" \
-configuration Debug \
-sdk iphoneos \
-destination "generic/platform=iOS" \
-derivedDataPath "build_output" \
ONLY_ACTIVE_ARCH=NO \
ARCHS="arm64" \
CODE_SIGNING_ALLOWED=NO \
CODE_SIGNING_REQUIRED=NO \
COMPILER_INDEX_STORE_ENABLE=NO \
XCODE_BUILD_SYSTEM_ENABLE_EAGER_LINKING=NO

- name: "Step 3: Package App Layout into an .ipa Installer"
run: |
# iOS requires the .app folder to live inside a folder named 'Payload'
# inside the zip archive to recognized it as an installable app (.ipa)
mkdir -p Payload
cp -r build_output/Build/Products/Debug-iphoneos/iNetHack2.app Payload/
zip -r iNetHack2.ipa Payload

- name: "Step 4: Upload Installer to GitHub Actions"
uses: actions/upload-artifact@v4
with:
name: iNetHack2-iPhone-Installer
path: iNetHack2.ipa
45 changes: 17 additions & 28 deletions Classes/iNethackAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -35,34 +35,29 @@ @implementation iNethackAppDelegate

@synthesize window;

- (void) loggingTest {
NSString *tmpFile = [FileLogger tmpFileName];
NSLog(@"tmpFile %@", tmpFile);
for (int i = 0; i < 500; ++i) {
FileLogger *logger = [[FileLogger alloc] initWithFile:tmpFile maxSize:250];
for (int j = 0; j < 1000; ++j) {
[logger logString:[NSString stringWithFormat:@"This is some logged line #%04d", j]];
}
[logger release];
}
[[NSFileManager defaultManager] removeItemAtPath:tmpFile error:NULL];
}

- (void)applicationDidFinishLaunching:(UIApplication *)application {
// [self loggingTest];
// return;

NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
BOOL startAsBlind = [defaults boolForKey:@"blind"];
BOOL startAsNudist = [defaults boolForKey:@"nudist"];
NSMutableArray *activeOptions = [NSMutableArray array];

if (startAsBlind) {
[activeOptions addObject:@"blind"];
}
if (startAsNudist) {
[activeOptions addObject:@"nudist"];
}
if ([activeOptions count] > 0) {
NSString *optionsString = [activeOptions componentsJoinedByString:@","];
setenv("NETHACKOPTIONS", [optionsString UTF8String], 1);
} else {
unsetenv("NETHACKOPTIONS");
}
BOOL badBonesSeen = [self checkNetHackDirectories];
//iNethack2: UPDATE: iOS9 the below fix actually causese issues. commenting out.
// [application setStatusBarOrientation:UIInterfaceOrientationPortrait animated:NO]; // prevent start orientation bug
[application setStatusBarStyle:UIStatusBarStyleLightContent animated:YES];

// use mainNavigationController.view to skip main menu

//iNethack2 commented out below, added line after, to get rid of "Application windows are expected to have a root view controller at the end of application launch" message
// [window addSubview:mainNavigationController.view];
[self.window setRootViewController:mainNavigationController];
//[window addSubview:mainMenuViewController.view];
[window makeKeyAndVisible];
self.window.frame = [UIScreen mainScreen].bounds; //iNethack2
[application setStatusBarHidden:YES];
Expand All @@ -74,9 +69,6 @@ - (void)applicationDidFinishLaunching:(UIApplication *)application {
}

- (void) applicationDidEnterBackground:(UIApplication *)application {
// 2.0.8 and earlier we used to run the routine when app was about to terminate to do a save.
// return [self applicationWillTerminate:application];

// Save the zoom level
[[NSUserDefaults standardUserDefaults] setFloat:[(MainView *) [[MainViewController instance] view] tileSize].width
forKey:kKeyTileSize];
Expand Down Expand Up @@ -159,9 +151,6 @@ - (BOOL) checkNetHackDirectories {
for (NSString *filename in filelist) {
NSLog(@"file %@", filename);
}

// simple test case for UI interaction with bad bones
//[self createTestBadBonesFile];

filelist= [[NSFileManager defaultManager] contentsOfDirectoryAtPath:@"." error:nil];

Expand Down
20 changes: 20 additions & 0 deletions Settings.bundle/advancedgameplay.plist
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,26 @@
<key>DefaultValue</key>
<false/>
</dict>
<dict>
<key>Type</key>
<string>PSToggleSwitchSpecifier</string>
<key>Title</key>
<string>Blind</string>
<key>Key</key>
<string>blind</string>
<key>DefaultValue</key>
<false/>
</dict>
<dict>
<key>Type</key>
<string>PSToggleSwitchSpecifier</string>
<key>Title</key>
<string>Nudist</string>
<key>Key</key>
<string>nudist</string>
<key>DefaultValue</key>
<false/>
</dict>
</array>
</dict>
</plist>