[HN Gopher] You can make PS2 games in JavaScript
       ___________________________________________________________________
        
       You can make PS2 games in JavaScript
        
       Author : tosh
       Score  : 202 points
       Date   : 2025-11-21 16:42 UTC (6 hours ago)
        
 (HTM) web link (jslegenddev.substack.com)
 (TXT) w3m dump (jslegenddev.substack.com)
        
       | twosdai wrote:
       | Super cool. Thanks for sharing this. I've been looking for
       | something like this for a while.
        
       | kamranjon wrote:
       | This is pretty incredibly - Fabrice Bellard builds stuff that
       | just has such a wide spread impact - so cool that QuickJS enabled
       | an old system like PS2 to have a bit of a homebrew revival
       | through this AthenaEnv project
        
         | mschuster91 wrote:
         | My photoshop skills are near zero, otherwise I'd have long gone
         | and edited xkcd 2347 [1] to say next to the pillar "Something
         | Fabrice Bellard probably implemented while half asleep just to
         | prove he could do it".
         | 
         | There's _a lot_ of FOSS projects that have something written by
         | him in their dependency chain.
         | 
         | [1] https://xkcd.com/2347/
        
           | sandermvanvliet wrote:
           | Nano Banana to the rescue
           | https://box2.codenizer.nl/cloud/index.php/s/ZYHdsYZ9rdRNM2B
        
             | youainti wrote:
             | thanks!
        
             | bigfishrunning wrote:
             | Why use an LLM to do something that would take exactly the
             | same amount of time and a lot less energy to just do in
             | something like MS paint?
        
               | theultdev wrote:
               | I'd like to see metrics on that. But intuitively I'd say
               | AI is faster.
               | 
               | Basically it's opening the tab and typing your thought vs
               | speed running paint.
               | 
               | @sandermvanvliet what was the process and how long do you
               | estimate it took you?
               | 
               | Personally it would take me awhile to find the template,
               | the exact font and get the positioning just right.
               | 
               | I could make a crude one fast, and I've seen many crude
               | versions of this meme. But matching the font is a bit
               | more work, maybe there's a generator for it, but that's
               | not paint nor do I know where it exists.
        
               | deaddodo wrote:
               | "Speed running paint"? You mean opening the image and
               | dragging a text box over the existing text, changing the
               | font to comic sans, and typing the text?
               | 
               | There are complicated workflows in Paint, this is not one
               | of them.
        
               | wiseowise wrote:
               | > comic sans
               | 
               | It's not comic sans though, you've already failed.
        
               | wiseowise wrote:
               | > Why use an LLM to do something that would take exactly
               | the same amount of time and a lot less energy to just do
               | in something like MS paint?
               | 
               | Can you prove that it'll take same amount of time for
               | someone with
               | 
               | > My photoshop skills are near zero
               | 
               | to replicate the same level of quality as the generated
               | image? From the looks of it, LLM managed to generate
               | pixel perfect (or at least similar) font and probably
               | took a fraction of a minute for the author to generate.
        
           | 0x1ch wrote:
           | Looked him up, he quite literally pushed the first commits of
           | QEMU ever. Edit: And was the sole developer until 2007!
        
             | tombert wrote:
             | And ffmpeg. And TinyC. And a bunch of other things. The
             | dude is a legend.
        
             | deaddodo wrote:
             | Fabrice's DNA is infused in the FOSS ecosystem. He's an
             | avid and prolific developer. FFMpeg, Qemu, libbf, softfp,
             | BPG, jslinux, etc, etc, etc.
        
       | mclau153 wrote:
       | people will do anything to avoid using .gdscript and Godot....
        
         | ronsor wrote:
         | I like Godot, but you're not getting it running on a PS2.
        
           | charcircuit wrote:
           | gdscript does not do any fancy JIT or AOT compiling. I don't
           | see why you can't get gdscript running fairly easily.
        
             | wk_end wrote:
             | gdscript itself, sure, why not. Porting the entire Godot
             | engine would be a real feat though, especially because of
             | the PS2's technical limitations.
        
         | turnsout wrote:
         | To be fair, it's not as simple as building in Godot and
         | exporting to PS2.
        
           | bob1029 wrote:
           | https://github.com/distrohelena/retrongin
           | 
           | Unity has at least one experimental option that does exactly
           | this.
        
             | turnsout wrote:
             | It's too bad that Unity is a horrible company and a dying
             | platform
        
       | dinobones wrote:
       | Mega cool, I'm curious if there's a way to burn the ISO to a disc
       | and get this playing on a physical console?
        
         | bakugo wrote:
         | You'd need to hack the console to get it to load a burned disc,
         | but if you can do that, you can also just load it from USB.
         | 
         | Though I guess you could burn it to a disk anyway purely for
         | the sake of authenticity.
        
           | SpecialistK wrote:
           | USB on the PS2 is limited to 1.0 or 1.1 speeds, so a disc may
           | work better anyway.
        
             | deaddodo wrote:
             | Just to clarify, the difference on the PS2 is:
             | 
             | * CD: 3.6MB/s
             | 
             | * DVD: 5-8MB/s
             | 
             | * USB: 0.8-1.1MB/s
             | 
             | So the disk would almost definitely be the better option.
        
         | accrual wrote:
         | FreeMcBoot on a memory card + USB flash drive (or internal
         | disk) is a popular option to play on real hardware. Saves wear
         | and tear on the optical drive too.
        
           | Forgeties79 wrote:
           | I have sat on a freemcboot mem card for probably 6 years now.
           | I'll get around to it eventually...
        
             | accrual wrote:
             | It's a good time! I feel the PS2 is an iconic member of any
             | living room TV setup, especially with an SSD, a couple
             | controllers, and component out. Nice to have for hangouts!
        
         | tylergetsay wrote:
         | Combined with https://github.com/CTurt/FreeDVDBoot, I think it
         | would be possible
        
         | deadbabe wrote:
         | Why use physical disc instead of some optical drive mod
        
           | hamdingers wrote:
           | ODEs aren't common for the PS2 because they already support
           | flash drives, network shares, and (for fats) full size hard
           | drives.
        
       | ikamm wrote:
       | Already been posted here twice by the dev in the past two
       | months...
       | 
       | https://news.ycombinator.com/item?id=45436166
       | 
       | https://news.ycombinator.com/item?id=45778448
        
         | hombre_fatal wrote:
         | What's the point of linking discussions that have one comment
         | each?
         | 
         | The reason you see @dang link past submissions is so we can
         | read previous interesting discussion, not to shame submissions
         | that got no traction.
        
       | martijnvds wrote:
       | IBM PS2?
        
         | unleaded wrote:
         | Yes. https://github.com/SuperIlu/DOjS
        
       | Flux159 wrote:
       | The interesting part here is about AthenaEnv. It looks like it
       | uses QuickJS for the Javascript interpreter and wraps around the
       | native system libraries that the PS2 provides.
       | 
       | I'm wondering if there's a modern similar project that would
       | allow writing Javascript Canvas games (WebGPU / WebGL) and
       | publishing on Switch/2, PS5, and Xbox.
       | 
       | From my understanding, they explicitly disallow JITs so you can't
       | just wrap your JS game with Electron / Node Webkit and use V8.
       | I'm not sure if anyone has tried publishing a game using a
       | V8-jitless electron fork - the sdks for consoles are under NDA so
       | there's not really much written about it publicly & most games
       | using Unreal or Unity don't deal with these things themselves.
       | 
       | PC, Mac, and even mobile are surprisingly easier here because you
       | can just run the JS via electron or in a webview on mobile.
        
         | _james wrote:
         | The official Nintendo 3DS and Wii U SDKs both provided an
         | Electron-like framework that allowed games to be written with
         | web technologies. I seem to recall that it was discontinued at
         | some point before the Switch? The Switch does have a WebKit
         | browser applet that games can call to display web-based
         | content, but it's pretty limited since JIT is disabled like you
         | say. I've only ever seen it used for e-manuals.
        
         | JSLegendDev wrote:
         | I think the game Cross Code (a game written in JS) was ported
         | to consoles using a pretty complex process.
         | 
         | Here is a detailed blog post about the topic :
         | https://www.radicalfishgames.com/?p=6892
        
           | Flux159 wrote:
           | Yeah, I saw the video about that earlier which is what led me
           | to wonder if there was a native JS way now.
           | 
           | They used Kha in order to port only the console versions, the
           | desktop versions remained JS from my understanding:
           | https://github.com/Kode/Kha which is built on top of Haxe.
           | This works, but it also means not having a single codebase
           | anymore which would be one of the benefits of a JS based
           | system.
           | 
           | There are other options here - something like using an AOT JS
           | compiler like Porffor, but from my understanding it's never
           | been tested (and would probably be missing a lot of support
           | to get it working - like shimming canvas & providing a WebGPU
           | context that the compiled JS could execute against).
        
       | IvanK_net wrote:
       | Maybe they could simply make a modern web browser for PS2, where
       | you would simply open a website with the game :)
        
       | saghul wrote:
       | A similar thing, also using QuickJS, but for the Nintendo Switch:
       | https://github.com/TooTallNate/nx.js (I'm not the author).
        
         | Flux159 wrote:
         | Nice, this is similar to what I was wondering about - it looks
         | like it's pretty limited in capability right now (looks like it
         | only supports canvas2d at the moment:
         | https://nxjs.n8.io/runtime/rendering/canvas), but in theory it
         | would allow you to make a layer to convert WebGPU or WebGL
         | games for Switch (ignoring the huge performance drop going from
         | v8 / jit JS engines to QuickJS).
        
       ___________________________________________________________________
       (page generated 2025-11-21 23:00 UTC)