I finally beat Super Mario Bros! I only used 50 separate save states and restarted from them countless times 😅
NES Emulator: Existentials Crisis
In which I discover the performance downsides of Swift existentials, to the tune of hundreds of thousands of dynamically dispatched function calls per second.
https://www.sadlerjw.com/2025/08/22/nes-emulator-existentials-crisis/
I made a website for my NES emulator, and there's a macOS build anyone can download and use! (There are a list of caveats on the website.)
A TestFlight build is in review for iPhone and iPad, so that will come later.
https://nesbit.app
Nesbit, my NES emulator written from scratch in Swift, is available for macOS and now there’s a TestFlight for iOS and iPadOS too! It has an on-screen controller for touch devices and supports hardware keyboards and gamepads on all platforms. (It only supports mapper 0 roms for now, though.)
You can find details, plus the TestFlight link and a direct download for macOS, on the website: https://nesbit.app
I feel sick. The guy came with an appropriate amount of skepticism and he was still hoodwinked by ChatGPT for nearly a month.
https://mastodon.social/@kashhill/115011576505782614
Ruining the Swift-iness of my code to get some huge performance wins. Instead of completely pinning the CPU at 60 FPS now I’m using 50-70% of the CPU.
Using existentials in tight loops is bad news. But existentials are so CONVEEENIENT 😩
More things are working! I think from the video series that inspired this project, these palette issues will go away once I implement sprites. (So far we’re just seeing backgrounds.)
🤞
SPRITES!!!
I changed something that’s corrupting the palette’s background, but SPRITES ARE WORKING!
THIS CLOSE to perfect! Looks like I have an off-by-one error with the scrolling on the scanline at the bottom of the hud area, but otherwise I’m absolutely over the moon with this!
I had to dip into UIKit to make a controller that worked with multiple simultaneous touches and tracked touches when they enter a view instead of just when touches _begin_ in a view, but this thing is properly playable now! (I am bad at Mario though)
I had to look at the Delta source code for inspiration because as far as I can tell UIControl.Event.touchDragEnter does not behave as advertised. Thanks @rileytestut!
Kershaw for the Dodgers vs Scherzer for the Jays AND Buck Martinez is back on the Jays broadcast‽ Should be one of the better games of the sEEEason!
I figured, the NES is 40+ years old, shouldn’t be too hard to emulate it fast enough.
I was wrong. With the PPU generating garbage pixels (I’m not far enough along to run real games yet) I’m only getting 30fps on my iPhone 14 Pro.
I may have to lose some of the Swiftiness of my code to make it fast enough. It needs to run at 60fps (for NTSC) because the CPU and PPU and their numbers of clock cycles per frame are directly tied together.
I say “garbage” pixels and not “random” pixels because generating random pixels using UInt8.random() produced single-digit frames per second. Randomness is expensive!
I’ve got ROMs loading into my NES emulator (mapper 0 only for now) and things are extremely not working! Found a big ol’ bug in my jump instructions. I’m sure there are many more to come.
Update: there were bugs in like 8 of my instructions 🫣
The test ROM I’m using is insisting that I implement the illegal instructions, and I’m not interested in that right now, so on to trying to make graphics render. I’m even less sure what’s going wrong here.
Some things are working! (Other things are not (not pictured).)
Glad I never got around to buying one. Yikes.
https://social.lol/@adam/114959554043586459
Writing an NES emulator in Swift dev diary: CPU instructions!
https://www.sadlerjw.com/2025/08/02/nes-emulator-cpu-instructions/
On an absolute lark, I’m writing an NES emulator in Swift that I’ll probably never finish…
https://www.sadlerjw.com/2025/07/31/writing-an-nes-emulator-in-swift/
I haven’t been this engaged by a project in years. Except Factorio. Does Factorio count?
@thomasfuchs unless I’m misunderstanding you, this is how it works on iPadOS 18 too. When I scroll down a page (whether on portrait or landscape), the address bar and tabs collapse.
(I’m on 18.5 but I don’t have 26 installed anywhere to compare.)
@thomasfuchs why can’t either of these dudes reliably spell “Replit,” the name of the thing they’re talking about 🤨
This is an absolutely _stunning_ performance of Rachmaninov’s 3rd Piano Concerto. I’ve heard many versions, and Argerich’s is my favourite, but Yunchan makes so many interesting choices, and he’s just 18 years old here. Marin Alsop conducting.
Well worth the 45 minutes.
https://youtube.com/watch?v=DPJL488cfRw
If you know the piece well, watch the concert first. Then watch this video and see how much you noticed of the bits that make it special.
I was pleased that I noticed a few, but I learned a lot: https://youtu.be/DhUFLepewgA?si=Xale4mAFRoSrbE0X
Software development is a field brimming with table saws. Compilers, high level languages, IDEs...
Quitting programming because of AI is like quitting carpentry because IKEA came along and changed the game, vastly reducing most people's need for carpenters.
I'm not saying it's the end of our industry, but it's hugely demoralizing to many of us, and companies are salivating over how many of us they can get rid of.
(Of course, the better analogy is textiles in the 1800s)
https://www.manton.org/2025/07/03/simon-willison-quitting-programming-as.html
@marioguzman I’m always taken by the clarity of hierarchy in these old screenshots between the chrome, source list, and what Apple would call “content” today.
Even more so now that the first stated design principle of Liquid Glass is hierarchy, which is barely noticeable in their new designs in comparison!
New iOS “Liquid Glass” design: looks super cool, technically impressive, major contrast issues and visually distracting during scrolling.
The first betas for iOS 7 had similar readability issues. Hopefully this gets adjusted before release like it was then.
https://mastodon.blaede.family/@cassidy/114656864133285114
“I Think I’m Done Thinking About genAI For Now”
https://blog.glyph.im/2025/06/i-think-im-done-thinking-about-genai-for-now.html
The iOS text editing system added a “finish my sentence” type of autocomplete in I think iOS 18. (I know Gmail’s had that for years and years, but I don’t use Gmail.)
Does anyone else find themselves taking a suggested sentence completion as a cue like “I’d better find a different way to finish this sentence, even if it was pretty much what I already had in mind?”
I know it’s irrational, but I definitely do that. Not even on purpose - it just happens.
A genuine question: when people talk about AI they talk about non-deterministic computing. Is that really true? Do LLMs and such not produce the same output given identical input? Or do they mean “unpredictable to humans,” as in, we have no idea what will happen if we haven’t tried this exact input before?
(I am aware of context windows, I consider them part of the input in the context of this question.)
Apparently it really does mean non-deterministic. From @cocoaphony’s article https://cocoaphony.micro.blog/2025/06/16/tilai-thoughts-on-ai.html
(cc @mattiem since you were also wondering)
AI is nondeterministic. Just because a prompt worked once does not mean it will work the same way a second time. Even with the same prompt, context and model, an LLM will generally produce different results. This is intentional. How random the results will be is a tunable property called temperature, so for activities that should have consistent behaviors, it can be helpful to reduce the temperature. Reducing the temperature prevents the model from straying as far from its training data, so setting it too low can make it unable to adapt to novel inputs.



