Add a Nintendo DS port (Embedded Swift, CoreModel + Wi-Fi)#6
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a Nintendo DS port (
NDS/) built with Embedded Swift for the DS's ARM946E-S (armv5te-none-none-eabi), reusing the real model stack —CoreFuelingentities and predicates on top ofCoreModel's in-memory store andFetchRequestevaluation engine — with live data fetched over Wi‑Fi. No hardcoded locations, no hardcoded server.Screen split: the top screen renders the UI through a software rasterizer; the bottom (touch) screen hosts libnds' on-screen keyboard, which types into the locations search field.
How it works
Location.Query.searchpredicate and CoreModel's pure-SwiftFetchRequest.evaluate; detail rows readFuelProductentities through the location's relationship. The DS usesCoreModel.InMemoryStorage(the synchronous store) because bare-metal armv5te ships no_Concurrencyruntime for the actor-basedInMemoryModelStorage./v1/locationsand/v1/fuelprice. A small byte-scanning JSON walker parses the same{status, message, data}envelope the other front ends decode (Embedded Swift has noJSONDecoder) and maps records intoCoreModel.ModelData, mirroringFuelingAPI's mapping key for key.tools/gen_server.pybakesFUELING_SERVER_URL(the same variable the playground and Android use) into a generated, gitignoredServerConfig.swift, defaulting to the local test server. Hostnames resolve on-device via DNS.httpsis rejected at build time — the DS has no TLS stack.ports/NDS(branchfeature/nds) and adapted: runtime byte-array titles instead ofStaticString, a search bar, and right-aligned detail values.Companion changes
CoreFueling:Model.fuelingnow builds under Embedded (entity descriptions assembled from each type's own attribute/relationship tables, since the Embedded declarations don't conform toEntity);LocationCoordinatebindssin/cos/atan2directly on bare-metal targets, which have no importable libc module.Scripts/test-server.py: new--bindoption (default unchanged) so emulators reaching the host over NAT can be served.Depends on PureSwift/CoreModel#29, which gates the async
ModelStorage/actor oncanImport(_Concurrency), publishesInMemoryStorage, and fixes an internalCollection.containshelper that was an every-element membership test rather than a subsequence search — invisible on platforms where Foundation'sStringProtocol.containsshadows it, but under Embedded it made searching "mill" match "1150 Timber Lane".Testing
swift build+ full suite, 27 tests pass.Notes for reviewers
armv5te-none-none-eabislice (release toolchains only shiparmv4t); override withmake SWIFTC=…. Also devkitPro (devkitARM, libnds, calico, ndstool) and python3 with Pillow.10.0.2.2host alias (connect fails with errno 113), so emulator testing pointsFUELING_SERVER_URLat the host's LAN IP with the test server bound to0.0.0.0.