Hacking the Nintendo DSi Browser
farlow.dev
farlow.dev
I guess that was inevitable. So much exposed code over so much time.
I remember having a bunch of lunch/dinner discussions about this browser with the two developers actually doing that port in ~2005. It was a super secret and exciting project back then.
We worked in the same small Opera Software office of 30 people or so. They were really frustrated with the code footprint limitations of the DS.
As in the memory or the final binary size? I would have thought memory management was the tricky part -- even with the mandatory 8 MB expansion in the GBA slot -- but I suppose they would have been under even more pressure to fit it onto the smallest cart possible, with the cost of the expansion pack added for every unit
The Opera code was very memory efficient after having gone through so many memory usage optimizations triggered by lots of mobile platform ports.
It was a really long time ago, sorry :)
The Wikipedia page [1] claims* they had an MMU on the expansion cart - so they could have taken your advice :)
* I couldn't find a source, and AFAICT the DeSmuME emulator [2] seems to treat it like a big chunk of linear memory?
[1] https://en.wikipedia.org/wiki/Nintendo_DS_Browser#Memory_Exp... [2] https://github.com/TASEmulators/desmume/blob/master/desmume/...
E: I forgot about the mobile Opera ports, that also tracks - I'd love to read about the engineering that went into them!
Can't really meaningfully expand on that, most of that happened before I joined in 2004, but I can tell you that the fact that Opera was extremely memory efficient made Opera Mini (250M monthly uniques, 150k web page transcodes/s) economically possible starting 2005.
We needed to keep the browser/window state around for each user until they clicked the next link. If we threw it out, any javascript state would be lost.
Reading about Mini doing layout specifically for devices with <128px wide displays, I wonder how well today's responsive design frameworks would deal with that...
The DS browser (which seems to be what you're talking about) was 2 physical cartridges, one that slotted into the regular DS game slot and an 8GB memory expansion cart that went in the GBA slot. The DSi's browser was built in, and the system didn't even have a GBA slot.
e: On a tangent, the Nintendo DS homebrew scene did end up with a standard (DLDI) for accessing flashcart storage, including the SD/CF slots on some GBA flashcarts -- so you would not have gotten 8 GB of RAM, but if you paid through the nose, you could potentially have made your DS swap out memory pages to an 8 GB memory card :V
I actually preferred the DSi's web browser to the browser on my iPod Touch, because the DSi's dual screens were utilized in a clever way that made it easier to view websites formatted for desktops. (Mobiile-optimized websites mostly weren't a thing yet.)
By contrast, the browser on the original DS was a barely usable nightmare. I'm sure the developers did what they could with the limited hardware available, but the result ran extremely slowly.
Nintendo is pretty litigious about this sort of stuff but I guess because this is such an old system they're able to get away with documenting exploit process like this.
Does anybody on HN know of other similar eng-focused guides for this sort of stuff out in the wild, or authors to follow?
One of the prominent figures out of that scene, marcan, is now leading the Asahi Linux (i.e. Linux on Apple Silicon) project.
(Another, bushing, sadly passed away in 2016: https://hackmii.com/ben. RIP.)
In other words, it's comparable to an early 90s PC. The fact that it can run a browser, complete with JS support, seems nearly unbelievable these days.
That surprised me as I wondered just how much JS capabilities the browser has; then I realised that article was written in 2013, when Twitter was still relatively sane and not the bloated SPA it is today (yet the actual content being displayed is not much different from 10 years ago.)
The old-net kind of works on the DSi's browser, utilizing snapshots. But SSL issues today have also made the browser quite cumbersome.
When I turn off my laptop on battery the next day it's dead because for some stupid reason we can't even get turning devices off right anymore.
Of course you can play DS games on 3ds, but you have to choose between blurry non integer scaling to full screen or crisp native but small with black borders. The games look better running at native res on the big screen of the DSi XL.
This is targetting a piece of software and operating system from 15 years ago.
Valve should let the Deck be targeted as a standalone platform in its own right, rather than a PC that just happens to be portable. Let there be a dedicated SDK and APIs that let us just optimize for the Deck without worrying about how a game might look or run on a proper desktop/laptop.