315

You can make PS2 games in JavaScript

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

3 days agokamranjon

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/

3 days agomschuster91

Nano Banana to the rescue https://box2.codenizer.nl/cloud/index.php/s/ZYHdsYZ9rdRNM2B

3 days agosandermvanvliet

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?

3 days agobigfishrunning

> 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.

3 days agowiseowise

1] delete the text

2] select any handwriting font

3] replace the text

no one will know the font was changed, no skills required.

AI is going to utterly cripple people intellectually and motivationally.

If you can't even do the above ten second process, you may want to make more of an effort before you find yourself utterly fucked and starving.

3 days agoPostOnce

>no one will know the font was changed

You're underestimating the effect typography has.

>you may want to make more of an effort

You seriously saying someone should put effort in editing a comic they didn't even cared on editing until they saw someone's comment? And somehow you equate the not putting effort to editing such comic to being fucked and starving?

AI hate sometimes makes people really lose their mind. Doing pointless random shit like this is a legit AI good application. Something that needs no creativity nor intellect to do. Just time. (And, most certainly, more than 10s.)

3 days agoforgotpwd16

Two parent comments suggested that a deep level of skill is required to:

1] drag a box around the text and press Delete 2] type some new text in there in a similar handwriting font

The implication is that we're all too stupid and everything is too hard to do even tasks so simple that they take double-digit seconds to accomplish for people with rudimentary computer skill.

We can do things. Saving 5 seconds is going to hurt worse than it helps in the long run... like asking GPT what 2+2 is because you can't figure it out.

3 days agoPostOnce

> Saving 5 seconds is going to hurt worse than it helps in the long run... like asking GPT what 2+2 is because you can't figure it out.

Looks line it has already started. See a therapist, please, you have an obsession.

3 days agowiseowise

It's better to consider the consequences of possible futures than not to; considering the future makes us human.

3 days agoPostOnce

“ AI is going to utterly cripple people intellectually and motivationally. If you can't even do the above ten second process, you may want to make more of an effort before you find yourself utterly fucked and starving.”

This does not sound like intellectual curiosity. Closer to polarized discourse that imho is making us less human.

2 days agomaddmann

When someone is not willing to even attempt to do a 30 second task, assumes they can't, asserts they can't, and people chime in to say AI is the only way they can achieve it, it seems worthwhile to point out the consequences.

Should we not be trying to do things?

Is it not in fact harmful to give up early on even such trivial tasks?

What happens when we actually need to do hard things?

2 days agoPostOnce

[dead]

2 days agocindyllm

Actually, a fair number of us will see the font change.

People are more aware of typography than you may realize.

...maybe you do!

In which case, this makes real sense: "[almost] nobody will care."

I wouldn't, but I sure would note the font change.

2 days agoddingus

I don't really know, but finding the right font family might take more time than the LLM

3 days agoaugusto-moura

In the case of xkcd you can mimic it with this one:

xkcd-font

Fonts derived from the handwriting of Randall Munroe, the xkcd webcomic author.

https://github.com/ipython/xkcd-font

3 days agoQuantumNomad_

1. I heard about nano banana and wanted to try it 2. I’m on my phone so no photoshop or whatever

2 days agosandermvanvliet

Because Nano Banana is better than wasting time for someone who isn't a 10 year veteran of MS Paint arts.

I'm tired of this kind of argument from anti-AI folks.

"Why not pick up a pencil instead?"

What if illustration was never "art"? What if it was always just a rote mechanical skill and the art itself was what the person was trying to communicate?

Maybe the technical aspects don't matter. Maybe it's the message we're conveying, our taste, our curation, our unique lens?

2 days agoechelon

Yes. The art is "take a comic I didn't draw and replace some text." The pro-ai crowd is certainly brimming with artistic ingenuity. So much insight! Thank God they're boiling the oceans for this.

a day agobigfishrunning

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.

3 days agotheultdev

“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.

3 days agodeaddodo

> comic sans

It's not comic sans though, you've already failed.

3 days agowiseowise

Why have you failed though? Is the point to try to deceive people to think that XKCD actually published something else? Why not modify the xkcd one without hinding the fact that you modified it?

3 days agofooofw

that fact you think it looks so good that it deceives is a point for ai.

the point is to make a quality meme fast. the guy he replied to appreciated it.

any fan of xkcd knows the original.

3 days agotheultdev

Ok

3 days agodeaddodo

Yeah, everyone knows xkcd uses its own font, Humor Sans.

3 days agocluckindan

Oh I did not know that.

3 days agofrizlab

[dead]

3 days agowalterreid

Do it yourself on live video. Otherwise this is such a baseless and needlessly accusatory comment

3 days agoAlmondsetat

[dead]

3 days agoHackerBarrel

thanks!

3 days agoyouainti

Looked him up, he quite literally pushed the first commits of QEMU ever. Edit: And was the sole developer until 2007!

3 days ago0x1ch

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.

3 days agodeaddodo

And ffmpeg. And TinyC. And a bunch of other things. The dude is a legend.

3 days agotombert

The author's short diversion about the hassle of using a random website for zip2iso functionality and asking about a cli tool for doing such conversion lead me to create this cross-platform python script with no external dependencies: https://github.com/scottvr/GENISO/blob/main/ZIP2ISO.py

Longer explanation in the comments of TFA, but short version is that it was mostly "vibe-coded" using Gemini3 Pro instead of having to read the ISO9660 spec, which was also impressive to me.

3 days agoycombiredd

mkisofs might also do the trick.

3 days agok3vinw

It would, but it would be platform-specific and an external dependency. It was my first thought too until I started planning out it working cross-platform.

9 hours agoycombiredd

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?

3 days agodinobones

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.

3 days agobakugo

USB on the PS2 is limited to 1.0 or 1.1 speeds, so a disc may work better anyway.

3 days agoSpecialistK

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.

3 days agodeaddodo

USB is fine for PS1/retro games; should be more than enough for AthenaEnv. The difference only matters for PS2 backups. And there're more options than those two. HDD/SSD, Ethernet, MX4SIO/SIO2SD, MMCE (SD2PSX et al).

3 days agoforgotpwd16

Is it possible to use PS1 games and USB simultaneously? I thought the USB was handled by the B/C chips.

3 days agoSpecialistK

That's true; network too. Can play digital backups (off USB/Eth) only by using POPStarter (for those unaware, POPS being Sony's PS1 emulator ripped off the single game that was officially used on). Although POPS isn't really that good (was used, experimentally, only once afterall), USB throughput isn't an issue.

3 days agoforgotpwd16

Can also use a micro SD adapter through the mem card slot. Generally considered a bit better experience than a USB drive.

3 days agokcb

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.

3 days agoaccrual

I have sat on a freemcboot mem card for probably 6 years now. I’ll get around to it eventually…

3 days agoForgeties79

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!

3 days agoaccrual

Oh damn can you get some real performance boost out of an SSD? Do you install it or does it hang out externally?

3 days agoForgeties79

The original Phat PS2 models support internal IDE disks, though it's easy to convert them to SATA with an inexpensive adapter. Then prepare the SSD and install (I use WinHIIP, "obsolete" but works fine). It noticably improves startup and load times in games!

Some also swap the fan for a Noctua to give it a complete "quiet upgrade", but my stock fan isn't very loud.

2 days agoaccrual

Very cool. Jotting this down for later, appreciate it

2 days agoForgeties79

Why use physical disc instead of some optical drive mod

3 days agodeadbabe

ODEs aren't common for the PS2 because they already support flash drives, network shares, and (for fats) full size hard drives.

3 days agohamdingers

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.

3 days agoFlux159

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

3 days agoJSLegendDev

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).

3 days agoFlux159

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.

3 days ago_james

Maybe they could simply make a modern web browser for PS2, where you would simply open a website with the game :)

3 days agoIvanK_net

Chrome apparently has a minimum memory requirement of 4GB, so you'd need to shrink it down to one-one-hundred-and-twenty-eighth its size to squeeze it into the PS2's 32MB of RAM.

3 days agowk_end

Easy peasy, just remove the telemetry.

3 days agocluckindan

A similar thing, also using QuickJS, but for the Nintendo Switch: https://github.com/TooTallNate/nx.js (I'm not the author).

3 days agosaghul

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).

3 days agoFlux159

Cool article. AthenaEnv is an alternative follow-up to, also by same dev, Enceladus which uses Lua instead. Besides games they're used, and even more popular for this use case, homebrew apps. Examples being RETROLauncher & POPSLoader for Enceladus, and OSD-XMB for Athena.

3 days agoforgotpwd16

Even the PS2 isn't safe from JavaScript.

3 days agomobeigi

Super cool. Thanks for sharing this. I've been looking for something like this for a while.

3 days agotwosdai

people will do anything to avoid using .gdscript and Godot....

3 days agomclau153

I like Godot, but you're not getting it running on a PS2.

3 days agoronsor

gdscript does not do any fancy JIT or AOT compiling. I don't see why you can't get gdscript running fairly easily.

3 days agocharcircuit

gdscript itself, sure, why not. Porting the entire Godot engine would be a real feat though, especially because of the PS2’s technical limitations.

3 days agowk_end

To be fair, it's not as simple as building in Godot and exporting to PS2.

3 days agoturnsout

https://github.com/distrohelena/retrongin

Unity has at least one experimental option that does exactly this.

3 days agobob1029

It's too bad that Unity is a horrible company and a dying platform

3 days agoturnsout

[dead]

3 days agoBrian-Watkins

[dead]

3 days agoSteve-Tony

[dead]

3 days agoanimanoir

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

3 days agoikamm

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.

3 days agohombre_fatal

[dead]

3 days agoohboyhereitgoes
[deleted]
3 days ago

First link isn't by the author and second link is a different article...