iPod Nano 2G port (Rockbox plugin)#20
Merged
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.
Adds
ports/iPod: a Rockbox plugin port of Junkbot for the iPod Nano 2G, compiled as Embedded Swift forarmv4t-none-none-eabi(the Nano's FPU-less ARM940T) and linked intojunkbot.rockby Rockbox's own build system. Modeled on celeste-swift's iPod port.Architecture
plugin/junkbot.c): the plugin loop, click-wheel input, scrolled world blit, level intro / win-lose / status text (Rockbox's own font, so no font asset), and the HOLD pause menu.source/Plugin.swift): theGameEngine, current level, a click-wheel aiming cursor, and the scrolled viewport, exposed as@_cdeclentry points.source/Renderer.swiftrasterizes the engine'sRenderCommandlist into an RGB565 canvas (adapted fromports/3DS).plugin/rockbox_shim.c): TLSF allocator over the plugin buffer, non-atomic__atomic_*(single-threaded plugin on a core with no atomic instructions),mem*helpers, stack protector, entropy, and the libm gaps (floor/ceil/round).Assets load from the filesystem
Unlike every other port, neither sprites nor levels are compiled in — both live in
/.rockbox/junkbot/and load into the audio buffer at startup:sprites.bin(~5.6 MB RGB555 pixel data); only the small per-sprite offset table is compiled in.levels.bin(~1.1 MB, all 121 campaign levels). The generated level data every other port embeds is ~1.6 MB of code — over 3× a plugin's entire 512 KBPLUGIN_RAM(the first device link overflowed by 1.3 MB).tools/LevelPack(a host tool importingJunkbotCorenatively) serializesembeddedLevelsinto a binary catalog and round-trip-verifies the blob through the device decoder at build time; the codec is one file compiled into both the tool and the plugin so the field order can't drift. Final plugin: 167 KB text.Controls
Building
Verified
make swift: armv4t Embedded Swift object passes the undefined-symbol audit and archives cleanly (swift-6.3.2-RELEASE).make assets: LevelPack round-trips all 121 levels through the device decoder with zero field mismatches.make sim: the C host compiles and linksjunkbot.rockagainst the pinned Rockbox tree's UI simulator with no warnings.make rock: device build links at 167 KB text / 221 KB total, inside the 512 KBPLUGIN_RAM.make install) for on-hardware testing.Audio is not started yet (
rb_audio_sfxis a no-op); the README documents the phased plan.