HNHacker News
TopNewBestAskShowJobs

daniel5151

87 karma · joined July 7, 2016

submissionscomments
daniel5151··on Turning a dumb AC unit smart (without losing my security deposit)
Truth be told, while I had known about ESPHome while working on this project, for some reason, I just felt the urge to hack together my own firmware.

It might've been because my early testing was done via an old Arduino Uno board, and I must've figured that I might as well port the sketch over to the ESP32 once I had it working.

(I'm general though, I will say that LLMs can totally write bespoke one-off firmwares like this, and I don't feel too bad about it, given that it's running entirely within my LAN, and will never actually get "productized")

daniel5151··on Turning a dumb AC unit smart (without losing my security deposit)
I discuss this quite early in the writeup. There is a whole section on why a smart plug will not work here.
daniel5151··on Turning a dumb AC unit smart (without losing my security deposit)
Oh, hey, I'm the author!

Happy to answer any questions :)

daniel5151··on QEMU-iOS, an emulator for legacy Apple devices
If you're curious about emulating even older apple devices (Clickwheel iPod), I worked on an emulator for a few months called `clicky`. Very nifty project, given the weird and undocumented architecture of those early iPods

https://github.com/daniel5151/clicky

daniel5151··on BPF for HID Drivers
Oh hey, that bit about turning a Surface Dial into a mouse is pretty neat! I wonder if I can use eBPF to simplify my user mode surface dial driver...

https://github.com/daniel5151/surface-dial-linux

daniel5151··on Show HN: iPod Clickwheel.js
Any chance I could borrow this code for my (very WIP) classic clickwheel iPod emulator? I've actually got an experimental WASM build of it up and running, so this would be super appropriate!

https://github.com/daniel5151/clicky

daniel5151··on Terminal escape sequences in Git commit email field
Reading that just made me want to re-watch 1995's Hackers
daniel5151··on Phantom Types in Gleam
I know it's a toy example, but it's a _really bad idea_ to use a float as a backing type for currency.

https://stackoverflow.com/questions/3730019/why-not-use-doub...

daniel5151··on 1977: Zork
One of the coolest technical aspects of early Infocom text adventure games is that most games weren't actually written using native assembly code for the platforms they ran on, and were instead compiled down to "z-code", a bytecode which ran on the "z-machine" virtual machine architecture. Z-machines are pretty niftly little bits of tech, as while they have a lot in common with regular 'ol machine code, the z-machine spec also includes dedicated instructions for fetching text input from the user, outputting text to the console, saving/loading data to disk, etc...

Having games target the abstract z-machine platform made it incredibly easy for Infocom to port games across platforms, as instead of re-writing every game from scratch, they could simply write a z-machine interpreter for said platform, and immediately gain access to their entire adventure game catalog!

A happy side-effect of all this is that it's super easy to run these classic adventure games on modern platforms, as instead of emulating the UI/UX of a 80s microcomputer, it's possible to write a z-machine interpreter that takes full advantage of modern GUIs.

One of my personal favorite modern z-machine interpreters is `encrusted` [1], which is written in Rust that runs on the Web thanks to WebAssembly. As a fun side-project, I ended up forking the project and making `embcrusted` [2], a z-machine interpreter that can run on embedded platforms without a full C-library. In a weekend or two of hacking, I was able to port a z-machine interpreter to my mechanical keyboard, in order to get the "authentic" experience of playing a text-adventure game through a teletype :)

[1] https://github.com/DeMille/encrusted

[2] https://github.com/daniel5151/embcrusted

daniel5151··on Ask HN: What is your “I don't care if this succeeds” project?
[clicky](https://github.com/daniel5151/clicky) is an emulator for Clickwheel iPods I worked on in the many boring months between University graduation and starting full time work.

Unlike retro consoles/handhelds, there doesn't seem to be much nostalgia in the public consciousness for OG iPods - which is fair, given that most people just see them as antiquated MP3 players. That said, some of the later models did have some pretty neat little games which have yet to be preserved, and can only be played by owning the original hardware.

It was a lot of fun hacking away at the project, and I'd made a surprising amount of progress given that I'd opted to roll my own full-system emulator (in Rust!) as opposed to using something like QEMU.

Who knows, maybe when I have more free time I'll revisit the project and keep pushing it closer to completion. Not sure when though - emulation is a real time hog when you're also juggling a full time job!

daniel5151··on Pop OS 20.04 LTS
Hahaha, just this morning I'd made a 19.10 live USB to re-install PopOS on my desktop. If only I had procrastinated a little longer...
daniel5151··on Zelda Screen Transitions Are Undefined Behaviour
I actually had to wrestle with this exact effect while working on wideNES [1]. By saving a screenshot of the screen at each frame alongside with it's PPUSCROLL value, it's possible to gradually build-up a map of the level as it's explored. Moreover, on subsequent playthroughs of the same level, it's possible to sync the map with the on-screen action, effectively enabling a "widescreen" mode for old NES games (with certain limitations).

Lots of games used funky scrolling mechanics, typically to create status bars, but of all the different games I tested with, TLOZ was by-far the weirdest, requiring an entire special case to get working!

I don't have any screenshots of my own, but some japanese website recently covered wideNES, posting screenshots of it working with the original Legent of Zelda.[2]

[1] http://prilik.com/blog/2018/08/24/wideNES.html

[2] https://emulog.net/fc-nes-emulator-anese-how-to-use-widenes/

daniel5151··on K-Cup creator John Sylvan regrets inventing Keurig coffee pod system
Whoosh
daniel5151··on WideNES – Peeking Past the Edge of NES Games
Thanks!

The Nesdev wiki is the bible for writing NES emulators. It has all the technical documentation you'll need to implement the various aspects of NES hardware. It also has plenty of test ROMs, which are incredibly useful for verifying implementation details!

http://wiki.nesdev.com/w/index.php/NES_reference_guide

Fair warning, while it's pretty easy to get a half-decent 6502 emulator up and running, implementing the PPU is incredibly tricky. If you don't have a lot of experience writing emulators, I'd recommend starting with a simpler system, like the CHIP-8, before tackling the NES.

daniel5151··on WideNES – Peeking Past the Edge of NES Games
Hey, I'm the author!

If you've got any questions, fire away!