theunamedguy | 3 years ago | on: Gimp 2.10.32 on Apple Silicon (2022)
theunamedguy's comments
theunamedguy | 3 years ago | on: The Subcontrabassoon Project
theunamedguy | 3 years ago | on: Show HN: Quake 1 ported to the Apple Watch
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 | 3 years ago | on: Show HN: Quake 1 ported to the Apple Watch
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 | 4 years ago | on: Avoid all links to kicad-pcb.org – Use kicad.org
theunamedguy | 4 years ago | on: Dissecting the Apple M1 GPU, Part IV
theunamedguy | 5 years ago | on: Duke Nukem 3D Mirror Universe
theunamedguy | 5 years ago | on: Seasonal Spirals
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 | 5 years ago | on: Quake's 3-D Engine: The Big Picture by Michael Abrash (2000)
theunamedguy | 6 years ago | on: QuakeJS – A Quake Port to JavaScript with Emscripten
theunamedguy | 6 years ago | on: QuakeJS – A Quake Port to JavaScript with Emscripten
theunamedguy | 6 years ago | on: Porting Quake to the iPod Classic
theunamedguy | 6 years ago | on: Porting Quake to the iPod Classic
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 | 6 years ago | on: Porting Quake to the iPod Classic
theunamedguy | 6 years ago | on: Porting Quake to the iPod Classic
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 | 6 years ago | on: Porting Quake to the iPod Classic
That video was recorded by another developer, who had some personal (non-legal) concerns with it and plans to reshoot.
theunamedguy | 6 years ago | on: Porting Quake to the iPod Classic
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 | 6 years ago | on: Show HN: CNC Engraving Toolpath Generator
theunamedguy | 6 years ago | on: Learning hardware programming as a software engineer
theunamedguy | 6 years ago | on: Show HN: Space Invaders in C
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