HNHacker News
TopNewBestAskShowJobs

theunamedguy

838 karma · joined June 30, 2014

submissionscomments
theunamedguy··on Gimp 2.10.32 on Apple Silicon (2022)
Porting complex applications (especially those written in C) from x86 to ARM can be pretty non-trivial.

I can't speak to the GIMP code in particular, but I've done several x86->ARM source ports of other complex software, and each time there are things which work on x86 and don't work on ARM, resulting in nasty crashes, or worse.

See here for one of those (not AArch64, but ARM nonetheless): https://news.ycombinator.com/item?id=22176285

theunamedguy··on The Subcontrabassoon Project
We live in an age where combining music, software, and signal processing can let you do some amazing things. I can imagine a high-fidelity simulation of this instrument's timbre before it's ever built, by using the mechanical CAD model to produce an acoustic model, and then modeling the response of the wood to an incident acoustic wave.
theunamedguy··on Show HN: Quake 1 ported to the Apple Watch
Finally, something that I can speak to!

I once ported Quake 1 to the Rockbox operating system for MP3 players, which enabled it to run on the Apple iPod: https://www.youtube.com/watch?v=r6V-4AZ7pkA

The whole world of software ports basically boils down to "anything is possible, given enough memory, pixels, and time". The actual process of porting anything is sometimes incredibly tedious (e.g. "scour the entire source code for unaligned memory accesses, and manually rewrite all of them"), but also gives a chance to do some very clever things (like, "use the piezo speaker to beep out the address of a fault, because nothing else works on the device after a crash").

What made me do it was 1) the satisfaction I got from seeing my work produce something which, at first glance, shouldn't exist (Quake... on an MP3 player?), all while 2) learning deeply about software close to the bare metal, which is fairly hard to do early in one's career. There's of course also the factor of having lots of free time - I did my port when I was still a student with not very many responsibilities, so I could afford to spend entire evenings and weekends poring through mountains of C code. Nowadays, not so much...

theunamedguy··on Show HN: Quake 1 ported to the Apple Watch
Finally, something that I can speak to!

I once ported Quake 1 to the Rockbox operating system for MP3 players, which enabled it to run on the Apple iPod: https://www.youtube.com/watch?v=r6V-4AZ7pkA

The whole world of software ports basically boils down to "anything is possible, given enough memory, pixels, and time". The actual process of porting anything is sometimes incredibly tedious (e.g. "scour the entire source code for unaligned memory accesses, and manually rewrite all of them"), but also gives a chance to do some very clever things (like, "use the piezo speaker to beep out the address of a fault, because nothing else works on the device after a crash").

What made me do it was 1) the satisfaction I got from seeing my work produce something which, at first glance, shouldn't exist (Quake... on an MP3 player?), all while 2) learning deeply about software close to the bare metal, which is fairly hard to do early in one's career. There's of course also the factor of having lots of free time - I did my port when I was still a student with not very many responsibilities, so I could afford to spend entire evenings and weekends poring through mountains of C code. Nowadays, not so much...

theunamedguy··on Avoid all links to kicad-pcb.org – Use kicad.org
There is no way this could work. The EDA tool (e.g. KiCAD) is only the first step of the fabrication process - you generate Gerbers from your KiCAD board layout, which are a highly standardized format that can be viewed in a variety of independent pieces of software. There are also multiple stages of design validation - both in the design phase, and then in the physical phase of actually inspecting your fabricated boards. The chances of any "malicious" circuitry slipping in are next to nil.
theunamedguy··on Dissecting the Apple M1 GPU, Part IV
A big shoutout to Alyssa here. For those of you who don't know, she is doing this work as a college student.
theunamedguy··on Duke Nukem 3D Mirror Universe
This runs on the clickwheel iPod nano, by the way: https://www.youtube.com/watch?v=OV8etSGH86M
theunamedguy··on Seasonal Spirals
This is getting at the idea behind the Fourier transform. 3b1b did an excellent video with exactly this visualization:

https://www.youtube.com/watch?v=spUNpyF58BY

The idea is that wrapping a function around a circle at the right frequency (i.e. length per spiral) will cause peaks and troughs to align. It just happens here that the "right" frequency is 1/year.

theunamedguy··on Quake's 3-D Engine: The Big Picture by Michael Abrash (2000)
Not quite iOS, but: https://news.ycombinator.com/item?id=22162834
theunamedguy··on QuakeJS – A Quake Port to JavaScript with Emscripten
The AGPTek Rocker is one of our last targets still in production and can be acquired for around $50. I haven't used one myself, but from what I hear it's fairly decent but not perfect.
theunamedguy··on QuakeJS – A Quake Port to JavaScript with Emscripten
This reminds me of my port of Quake 1 to Rockbox (for MP3 players): https://news.ycombinator.com/item?id=22162834
theunamedguy··on Porting Quake to the iPod Classic
That's correct. I realize my parent comment was ambiguous. I'm the author of the port; the video is by a different developer who's since taken it down.
theunamedguy··on Porting Quake to the iPod Classic
I'll add in another fun anecdote while I'm at it.

There are virtually no good ways to debug code on-device with Rockbox, short of adding in a bunch of function calls to print variable values to the device's screen. This usual method, though slow, works surprisingly well with most bugs -- but this assumes that the code is in a sane enough state to be able to write to the screen properly (stack corruption, for example, would render it unusable).

There were a few bugs which were not debuggable with this "trace all the things" method, and those were the ones which required the most ingenuity. I remember having to root out a few bugs which absolutely trashed the processor state and made complex things (like function calls to print things) fail miserably.

One such class of bug was the unaligned read (this is ARM, remember). Thankfully, ARM has a way to set an "alignment trap" to trigger an interrupt when an invalid unaligned read happens. The only problem was that, of course, I couldn't figure out what code was responsible for the unaligned read.

My solution to this was quite the gem -- I modified the ARM exception handler to use the iPod's internal piezo buzzer to beep out the faulting PC address in a sequence of 32 high/low pitched beeps. The piezo, driven by a single memory-mapped register, could be controlled with minimal code (and most importantly, no function calls).

theunamedguy··on Porting Quake to the iPod Classic
Here: https://www.youtube.com/watch?v=r6V-4AZ7pkA
theunamedguy··on Porting Quake to the iPod Classic
Thanks!

Resolving that bug took quite a bit of serendipity. The break came when I was on the verge of giving up on the assembly rewrite and reverting back to C. I'd left my "frozen" iPod sitting around for a while. ~15 minutes later, I came back, and everything was back to normal -- this was evidence that I was not seeing a true lockup, but rather an extremely long delay (consistent with an integer wraparound).

theunamedguy··on Porting Quake to the iPod Classic
(Author of linked post.)

That video was recorded by another developer, who had some personal (non-legal) concerns with it and plans to reshoot.

theunamedguy··on Porting Quake to the iPod Classic
Author here. This is actually a fairly old project of mine by now, but I just recently submitted it to Hackaday, which is probably why it's surfaced here.

The original video demo has been taken down by the author (not me) due to some concerns of his, but he is reportedly planning to reshoot it soon.

In the meantime, though, a Duke3D demo (running on the same software stack) is available here: https://www.youtube.com/watch?v=OV8etSGH86M

EDIT: I've gotten a quick recording up: https://www.youtube.com/watch?v=r6V-4AZ7pkA (apologies for the mirrored video)

theunamedguy··on Show HN: CNC Engraving Toolpath Generator
Good idea! I'm not sure that's easily achievable with my current architecture, though.
theunamedguy··on Learning hardware programming as a software engineer
+1 for the nit-pick. Hardware programming make me think of FPGA design and Verilog, etc. I'd call this 'embedded programming'.
theunamedguy··on Show HN: Space Invaders in C
Excellent work! Clean C is underrated nowadays.
theunamedguy··on Rockbox – Free music player firmware
I learned C and open-source through hacking on this. Fond memories!

PS: We have a Quake port - https://www.rockbox.org/wiki/PluginQuake :)

theunamedguy··on Open-Sourcing Windows Calculator
I have a hard time believing this and can't find any details online. Source please?
theunamedguy··on T * sin (t) ≈ Christmas tree
A charged particle moving at an angle to a magnetic field like that found at the ends of a solenoid (increasing field strength) would produce the desired motion.

Example: https://s3-us-west-2.amazonaws.com/courses-images/wp-content...

theunamedguy··on But why is a sphere's surface area four times its shadow? [video]
I don't see why this is getting downvoted. It's a perfectly valid argument that's very much in the spirit of 3b1b.
theunamedguy··on Every 7.8μs your computer’s memory has a hiccup
It's just a conversion factor to make the units come out nicely. He could have easily done T = 1/f to give the refresh interval in seconds, but with such a short duration, it helps to convert it to nanoseconds (1e9 ns = 1 s).
theunamedguy··on Stacking concrete blocks is a surprisingly efficient way to store energy
Quick question: how does the electricity get from the train (in motion) to the grid? Using the rails as conductors could work, but I'm not sure how efficient that would be.
theunamedguy··on Nvidia CEO Unveils Turing, Nvidia’s eighth-generation GPU architecture
A bit of a clickbait title, even though it's the original headline.

Maybe a mention of the realtime ray-tracing would make it better suited for HN?

theunamedguy··on Walmart stumbles with its 'last mile' package delivery plan
It'd be much harder to keep people accountable. Who do you blame when the product arrives damaged (or not at all)?
theunamedguy··on Rockbox 3.14 released
Well, it /is/ possible to run our SDL app on a raspi...
theunamedguy··on Rockbox 3.14 released
Good to hear! We always welcome volunteers, see our development guide below. As for DAPs, I personally recommend the iPod classic (6G) if you can get one. It might be marked as "unusable" at the moment, but don't let that scare you off -- that's only because of a slight technicality.

https://www.rockbox.org/wiki/DevelopmentGuide

Page 1 of 2Next →