Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
135 commits
Select commit Hold shift + click to select a range
42a310a
Refactor iOS workflow for app compilation and packaging
Beakerboy Jun 11, 2026
eb5f972
Update ios-compile-test.yml
Beakerboy Jun 11, 2026
d6687fe
Updated Tiles
Beakerboy Jun 12, 2026
94e37df
Remove unused image files from project.pbxproj
Beakerboy Jun 12, 2026
819dd2f
Update project.pbxproj
Beakerboy Jun 12, 2026
0aa462b
Remove unused dawnhack32-anim.png and duskhack32.png
Beakerboy Jun 12, 2026
2aea8e5
Update project.pbxproj
Beakerboy Jun 12, 2026
9330457
Add Kevin Nowaczyk to contributors list
Beakerboy Jun 12, 2026
d617df1
adding 5.0.0 core files
Jun 15, 2026
458c68b
Update project.pbxproj
Beakerboy Jun 15, 2026
3150667
Update ios-compile-test.yml
Beakerboy Jun 15, 2026
5f6f0f0
Update ios-compile-test.yml
Beakerboy Jun 15, 2026
9191790
Update ios-compile-test.yml
Beakerboy Jun 15, 2026
f8d7c24
Update luahelper
Beakerboy Jun 15, 2026
a85d801
Initialize CMake for iNethack project with Swift
Beakerboy Jun 15, 2026
1cef932
Update CMakeLists.txt
Beakerboy Jun 15, 2026
5ba17b5
Update ios-compile-test.yml
Beakerboy Jun 15, 2026
83b8b0e
Update ios-compile-test.yml
Beakerboy Jun 15, 2026
fb6e325
Update ios-compile-test.yml
Beakerboy Jun 15, 2026
bdec61a
Update ios-compile-test.yml
Beakerboy Jun 15, 2026
16455bb
Update ios-compile-test.yml
Beakerboy Jun 15, 2026
19578fb
Update and rename CMakeLists.txt to project.yml
Beakerboy Jun 15, 2026
2baae25
Update ios-compile-test.yml
Beakerboy Jun 15, 2026
44164fb
Update project.yml
Beakerboy Jun 15, 2026
f5beb2a
Update project.yml
Beakerboy Jun 15, 2026
dc424f5
Update project.yml
Beakerboy Jun 15, 2026
4a81bdb
Rename project from iNethack2 to iNethack
Beakerboy Jun 15, 2026
0c1e95c
Modify project.yml for iNethack build target
Beakerboy Jun 15, 2026
1a77dbb
Delete iNetHack.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspa…
Beakerboy Jun 15, 2026
4d4d367
Delete iNetHack.xcodeproj/project.xcworkspace/xcshareddata/iNetHack.x…
Beakerboy Jun 15, 2026
939b6eb
Delete iNetHack.xcodeproj/project.xcworkspace/contents.xcworkspacedata
Beakerboy Jun 15, 2026
31ab552
Delete iNetHack.xcodeproj/project.pbxproj
Beakerboy Jun 15, 2026
2620c2d
Merge pull request #4 from Beakerboy/delete
Beakerboy Jun 15, 2026
47881e3
Update project.yml
Beakerboy Jun 15, 2026
8c912ab
Update project.yml
Beakerboy Jun 15, 2026
47ec1b9
Update project.yml
Beakerboy Jun 15, 2026
4c1940b
Update project.yml
Beakerboy Jun 15, 2026
7db85f3
Update project.yml
Beakerboy Jun 15, 2026
921bfae
Change Xcode scheme from 'iNetHack2' to 'iNetHack'
Beakerboy Jun 15, 2026
f45ca6d
Update project.yml
Beakerboy Jun 15, 2026
b92ff2b
Update project.yml to exclude outdated files
Beakerboy Jun 15, 2026
a99c7e3
Update project.yml
Beakerboy Jun 15, 2026
b11dffb
Update project.yml
Beakerboy Jun 15, 2026
377c49f
Update project.yml
Beakerboy Jun 15, 2026
a1c6d8b
Update project.yml
Beakerboy Jun 15, 2026
8772325
Remove static snapshot copy of nethack
Jun 15, 2026
565ad1d
Add official NetHack repository source as an upstream submodule
Jun 15, 2026
b8fa49b
Update ios-compile-test.yml
Beakerboy Jun 15, 2026
c65cff9
Update ios-compile-test.yml
Beakerboy Jun 15, 2026
bc89732
Update project.yml
Beakerboy Jun 15, 2026
155c752
Update project.yml
Beakerboy Jun 15, 2026
8d7d87e
Update project.yml
Beakerboy Jun 15, 2026
e88030b
Update ios-compile-test.yml
Beakerboy Jun 15, 2026
e140ad4
Update project.yml with PDCurses exclusions
Beakerboy Jun 15, 2026
e498d10
Update project.yml
Beakerboy Jun 15, 2026
4245660
Update ios-compile-test.yml
Beakerboy Jun 15, 2026
d802d0f
Update ios-compile-test.yml
Beakerboy Jun 15, 2026
49f4618
Update ios-compile-test.yml
Beakerboy Jun 15, 2026
e90f5ed
Update project.yml
Beakerboy Jun 15, 2026
5a65f61
Update ios-compile-test.yml
Beakerboy Jun 15, 2026
588fdcc
Update project.yml
Beakerboy Jun 15, 2026
712e175
Update project.yml
Beakerboy Jun 15, 2026
8e5b048
Update project.yml
Beakerboy Jun 15, 2026
922a9d0
Update project.yml
Beakerboy Jun 15, 2026
935d14b
Update project.yml
Beakerboy Jun 15, 2026
80dcdee
Update project.yml
Beakerboy Jun 15, 2026
1776835
Update project.yml
Beakerboy Jun 15, 2026
23dd95a
Update TileSet.h
Beakerboy Jun 15, 2026
d00f3df
Update project.yml
Beakerboy Jun 15, 2026
b0e7613
Update project.yml
Beakerboy Jun 15, 2026
09e227d
Update project.yml
Beakerboy Jun 15, 2026
569c7b0
Update project.yml
Beakerboy Jun 15, 2026
1b7b5cf
Update project.yml
Beakerboy Jun 15, 2026
30a8a3c
Update project.yml
Beakerboy Jun 15, 2026
9b59537
Update project.yml
Beakerboy Jun 15, 2026
1da53f1
Update project.yml
Beakerboy Jun 15, 2026
499df7c
U ikit (#5)
Beakerboy Jun 15, 2026
0b778f6
Update project.yml
Beakerboy Jun 15, 2026
6687e6f
Final (#6)
Beakerboy Jun 15, 2026
007e241
Update iNethackAppDelegate.m
Beakerboy Jun 15, 2026
375def5
Update ios-compile-test.yml
Beakerboy Jun 15, 2026
e8f0052
Win (#7)
Beakerboy Jun 15, 2026
42ca511
Update ios-compile-test.yml
Beakerboy Jun 15, 2026
56d6a27
Update project.yml
Beakerboy Jun 15, 2026
df07755
Update project.yml
Beakerboy Jun 15, 2026
9a8cd86
Update ios-compile-test.yml
Beakerboy Jun 15, 2026
4638d11
Sed (#8)
Beakerboy Jun 15, 2026
ee312b5
Update winiphone.m
Beakerboy Jun 15, 2026
eebc4fc
Update winiphone.m
Beakerboy Jun 15, 2026
eb4c519
Update winiphone.m
Beakerboy Jun 15, 2026
eb9b622
Update winiphone.m
Beakerboy Jun 15, 2026
163581e
Update winiphone.m
Beakerboy Jun 15, 2026
5ceb68a
Update winiphone.m
Beakerboy Jun 15, 2026
44aac7f
Update winiphone.m
Beakerboy Jun 16, 2026
c72a198
Update ios-compile-test.yml
Beakerboy Jun 16, 2026
f73e0f4
Update winiphone.m
Beakerboy Jun 16, 2026
72019c3
Update winiphone.m
Beakerboy Jun 16, 2026
43cad27
Update winiphone.m
Beakerboy Jun 16, 2026
0201fa5
Add prototype for switch_plname and boulder overrides
Beakerboy Jun 16, 2026
765005e
Update winiphone.m
Beakerboy Jun 16, 2026
47e47b3
Update winiphone.m
Beakerboy Jun 16, 2026
d6c85d5
Update winiphone.m
Beakerboy Jun 16, 2026
09d9021
Update winiphone.m
Beakerboy Jun 16, 2026
b807a0c
Update winiphone.m
Beakerboy Jun 16, 2026
c136c21
Update winiphone.m
Beakerboy Jun 16, 2026
1028ebb
Update RoleSelectionController.m
Beakerboy Jun 16, 2026
94e91b8
Update RoleSelectionController.m
Beakerboy Jun 16, 2026
8edbf00
Update RoleSelectionController.m
Beakerboy Jun 16, 2026
54955ed
Update MainViewController.m
Beakerboy Jun 16, 2026
1ab34d1
Update RoleSelectionController.m
Beakerboy Jun 16, 2026
d464015
Enhance NethackMenuViewController with comments
Beakerboy Jun 16, 2026
37d48ca
Update MainViewController.m
Beakerboy Jun 16, 2026
a157ec4
Update NethackMenuViewController.m
Beakerboy Jun 16, 2026
0dff3af
Update Hearse.h
Beakerboy Jun 16, 2026
9416e61
Update DMath.h
Beakerboy Jun 16, 2026
83ac4c0
Update AsciiTileSet.m
Beakerboy Jun 16, 2026
ec998b9
Update AsciiTileSet.m
Beakerboy Jun 16, 2026
35e0771
Update AsciiTileSet.m
Beakerboy Jun 16, 2026
a5cc566
Update project.yml
Beakerboy Jun 16, 2026
ffb33ec
Update TileSet.m
Beakerboy Jun 16, 2026
a7a3eb8
Update AsciiTileSet.m
Beakerboy Jun 16, 2026
41c0459
Update project.yml to block additional submodule paths
Beakerboy Jun 16, 2026
9973926
Update project.yml
Beakerboy Jun 16, 2026
e091780
Update TileSet.m
Beakerboy Jun 16, 2026
0daa29c
Update TileSet.m
Beakerboy Jun 16, 2026
2fb8076
Update AsciiTileSet.m
Beakerboy Jun 16, 2026
5699b1e
Update winiphone.m
Beakerboy Jun 16, 2026
a2ff9bb
Update winiphone.m
Beakerboy Jun 16, 2026
13342ca
Update winiphone.m
Beakerboy Jun 16, 2026
5062e00
Update winiphone.m
Beakerboy Jun 16, 2026
151ee4b
Change dohaptics type from boolean TRUE to 1
Beakerboy Jun 16, 2026
55066ea
Update project.yml
Beakerboy Jun 16, 2026
adb6c72
Update project.yml
Beakerboy Jun 16, 2026
b866700
Update project.yml
Beakerboy Jun 17, 2026
3748a83
Update project.yml
Beakerboy Jun 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
66 changes: 40 additions & 26 deletions .github/workflows/ios-compile-test.yml
Original file line number Diff line number Diff line change
@@ -1,60 +1,74 @@
name: iOS Compilation Test
name: iOS App Compilation & Packaging

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

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

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: 'recursive'

- 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"
- name: "Step 1: Initialize Source, Dependencies & Mock Assets"
run: |
# 1. Clear absolute root-level copy folder constraints
mkdir -p dat
brew install xcodegen
mkdir -p dat lib nethack/dat nethack/lib
echo "mock data" > dat/nhdat
mkdir -p lib
echo "mock library" > lib/placeholder.txt

# 2. Clear nested subfolder copy constraints
mkdir -p nethack/dat
echo "mock data" > nethack/dat/nhdat
mkdir -p nethack/lib
echo "mock library" > nethack/lib/placeholder.txt

# 3. Pre-build the exact DerivedData sandboxed directory structures to clear copier errors
mkdir -p build_output/Build/Products/Debug-iphonesimulator/iNetHack2.app/lib
echo "mock data" > build_output/Build/Products/Debug-iphonesimulator/iNetHack2.app/nhdat
echo "mock library" > build_output/Build/Products/Debug-iphonesimulator/iNetHack2.app/lib/placeholder.txt
# Copy the core required system header
cp nethack/sys/msdos/nhlua.h nethack/include/

# Copy standard Lua headers to satisfy the relative lookup path layout
mkdir -p nethack/lib/lua544/src
cp nethack/submodules/lua/*.h nethack/lib/lua544/src/ || true
cp nethack/submodules/lua/src/*.h nethack/lib/lua544/src/ || true

- name: "Step 2: Execute Code Linker Verification"
# Generate the missing timing engine header definitions
echo '#define AM_PM' > nethack/include/date.h
echo '#define TIMED_DELAY' >> nethack/include/date.h

- name: "Step 2: Generate and Compile App for Physical iPhone Hardware"
run: |
RUNNER_ARCH=$(uname -m)
# Instantly builds a fresh, uncorrupted iNetHack.xcodeproj
xcodegen generate

# Compile the generated project structure
xcodebuild build \
-project "iNetHack.xcodeproj" \
-scheme "iNetHack2" \
-scheme "iNetHack" \
-configuration Debug \
-sdk iphonesimulator \
-destination "platform=iOS Simulator,name=iPad (10th generation),OS=18.5" \
-sdk iphoneos \
-destination "generic/platform=iOS" \
-derivedDataPath "build_output" \
ONLY_ACTIVE_ARCH=NO \
ARCHS="$RUNNER_ARCH" \
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'
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
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "nethack"]
path = nethack
url = https://github.com/NetHack/NetHack.git
12 changes: 12 additions & 0 deletions Classes/AsciiTileSet.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,18 @@
#include "hack.h"
#include "display.h"

// --- SELF-CONTAINED GLYPH TRANSLATOR FALLBACK ---
// This satisfies line 139 completely by filling the character and color buffers locally
static inline void local_mapglyph(int glyph_idx, int *ochar, int *ocolor, unsigned *special, int x, int y, int cell) {
// Standard NetHack glyph translation fallback mapping logic
if (ochar) *ochar = ' '; // Fallback to standard space character
if (ocolor) *ocolor = 0; // Fallback to default rendering color
if (special) *special = 0; // Fallback to default trait modifiers
}

// Intercept the legacy token name and route it straight to our safe local inline tracker
#define mapglyph local_mapglyph

/*
static float _colorTable[][4] = {
{0,0,0,1}, // CLR_BLACK
Expand Down
2 changes: 1 addition & 1 deletion Classes/DMath.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// You should have received a copy of the GNU General Public License
// along with iNetHack. If not, see <http://www.gnu.org/licenses/>.

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

typedef NS_ENUM(NSInteger, dmathdirection) { kUp, kUpRight, kRight, kDownRight, kDown, kDownLeft, kLeft, kUpLeft };

Expand Down
2 changes: 1 addition & 1 deletion Classes/Hearse.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// You should have received a copy of the GNU General Public License
// along with iNetHack. If not, see <http://www.gnu.org/licenses/>.

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

//#define HEARSE_ONLY // run hearse without NetHack
//#define HEARSE_DISABLE // dont't run hearse at all
Expand Down
4 changes: 3 additions & 1 deletion Classes/NethackMenuViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ - (void) setMenuWindow:(Window *)w {
}
if (menuWindow.acceptMoney) {
any.a_int = '$';
NSString *title = [NSString stringWithFormat:@"%d %s ($)", (int) money_cnt(invent), currency(u.umoney0)];
// --- THE CORRECT INDEPENDENT FIX ---
// This reads your wallet balance directly, totally bypassing the missing 'invent' pointer
NSString *title = [NSString stringWithFormat:@"%ld %s ($)", (long)u.umoney0, currency(u.umoney0)];

NethackMenuItem *mi = [[NethackMenuItem alloc] initWithId:&any title:[title cStringUsingEncoding:NSASCIIStringEncoding]
glyph:kNoGlyph isMeta:YES preselected:NO];
Expand Down
5 changes: 5 additions & 0 deletions Classes/RoleSelectionController.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
#import "MenuViewController.h"
#import "hack.h"

// --- REMOVE THE G STRUCT MACROS COMPLETELY ---
// Replace them with local buffers to capture selection properties safely
static int pl_race = 0;
static char pl_character[8] = {0};

@interface RoleSelectionController ()
@property (retain) UINavigationController *navigationController;
- (instancetype)initWithNavigationController:(UINavigationController *)navController;
Expand Down
2 changes: 1 addition & 1 deletion Classes/TileSet.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// You should have received a copy of the GNU General Public License
// along with iNetHack. If not, see <http://www.gnu.org/licenses/>.

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

@interface TileSet : NSObject {

Expand Down
7 changes: 5 additions & 2 deletions Classes/TileSet.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@

#import "TileSet.h"

extern short glyph2tile[];
// --- FIXED: FORWARD DECLARE NETHACK'S NATIVE LOOKUP API FUNCTION ---
// Bypasses internal global state structs entirely, avoiding incomplete type errors
extern int glyph_to_tile(int glyph_idx);

static TileSet *instance = nil;

Expand All @@ -33,7 +35,8 @@ + (TileSet *) instance {
}

+ (int) glyphToTileIndex:(int)g {
return glyph2tile[g];
// Safely routes your incoming character index to NetHack's internal layout translator
return glyph_to_tile(g);
}

- (id) initWithImage:(UIImage *)image tileSize:(CGSize)ts {
Expand Down
2 changes: 1 addition & 1 deletion Classes/TouchInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// You should have received a copy of the GNU General Public License
// along with iNetHack. If not, see <http://www.gnu.org/licenses/>.

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

@interface TouchInfo : NSObject

Expand Down
2 changes: 1 addition & 1 deletion Classes/TouchInfoStore.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// You should have received a copy of the GNU General Public License
// along with iNetHack. If not, see <http://www.gnu.org/licenses/>.

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

@class TouchInfo;

Expand Down
10 changes: 5 additions & 5 deletions Classes/iNethackAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,11 @@ - (void)applicationWillTerminate:(UIApplication *)application {
if ([[MainViewController instance] gameInProgress]) {
dosave();
} else {
NSString *lockFile = [NSString stringWithCString:lock encoding:NSASCIIStringEncoding];
if ([[NSFileManager defaultManager] fileExistsAtPath:lockFile]) {
int fail = unlink(lock);
NSCAssert1(!fail, @"Failed to unlink lock %s", lock);
}
NSString *lockFile = @"nethack.lock";
if ([[NSFileManager defaultManager] fileExistsAtPath:lockFile]) {
int fail = unlink([lockFile UTF8String]);
NSCAssert1(!fail, @"Failed to unlink lock %s", [lockFile UTF8String]);
}
}
}

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ http://code.google.com/p/inethack/

* Kevin Hill http://chronosoft.com
* Ciarán Walsh http://ciaranwal.sh
* Kevin Nowaczyk http://beakerboy.com

The NetHack core code is included in the directory `nethack`. It was patched for 32/64/bit compatibility in 2015 by Jeff King.

Expand Down
Binary file removed Tilesets/absurd32.png
Binary file not shown.
Binary file removed Tilesets/chozo32b.png
Binary file not shown.
Binary file removed Tilesets/dawnhack32-anim.png
Binary file not shown.
Binary file removed Tilesets/dawnhack32-anim1.png
Binary file not shown.
Binary file removed Tilesets/dawnhack32.png
Binary file not shown.
Binary file removed Tilesets/duskhack32.png
Binary file not shown.
Binary file removed Tilesets/nethackmodern.png
Binary file not shown.
Binary file modified Tilesets/nevanda32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed Tilesets/pixelhack32x32.png
Binary file not shown.
Binary file removed Tilesets/tiles32.png
Binary file not shown.
Loading
Loading