Live data from Hacker News

Pokemon Emerald Ported to WebAssembly (100k FPS)

pokeemerald.com

101–108 of 108 posts

Re: Pokemon Emerald Ported to WebAssembly (100k FPS)

#101

Question to WASM and low level nerds: is this the sort of things LLMs are good at? Since the end verification is stable and conclusive and you can just "goal" this project into existence until this somewhat objective verification is met.

WASM is just a binary instruction format for a virtual stack machine. So instead of having many instruction sets for different CPUs and so on, you write for a portable VM (think of like JVM but lower level) that then can be ran on many CPUs and also on web browsers.

If there's already C code (for pokemon emerald there already was a decompiled C/ASM codebase), you usually just compile it and it works, or swap a few native dependencies with portable ones. If you have some ASM code already for some old architecture, then it's a pretty straight forward translation to WASM (not really, but iterable enough with LLMs). So yeah, you can have the first target for your thing to compile, then take a screenshot of first few frames for you to check visually and some framebuffer hashes for automatic verification and use those as an oracle for if it also works correctly. Then iterate a little more, maybe implement saving/loading and load a few checkpoints and register a few deterministic inputs and see some more framebuffer hashes, crashes, state checksums and you're good.

Re: Pokemon Emerald Ported to WebAssembly (100k FPS)

#104

Fun and pleasant. Speed up removes the chore feeling. I get bugs that make me loose the progress :(

pokeemerald.wasm.RunAnimScriptCommand@https://pokeemerald.com/web/app.js line 723 > WebAssembly.compile:wasm-function[1318]:0x18836f pokeemerald.wasm.OpponentDoMoveAnimation@https://pokeemerald.com/web/app.js line 723 > WebAssembly.compile:wasm-function[1611]:0x19cdc7 pokeemerald.wasm.BattleMainCB1@https://pokeemerald.com/web/app.js line 723 > WebAssembly.compile:wasm-function[2548]:0x1eee63 pokeemerald.wasm.WasmRunFrame@https://pokeemerald.com/web/app.js line 723 > WebAssembly.compile:wasm-function[7320]:0x30d5f3 runFrames@https://pokeemerald.com/web/app.js:763:22 runFramesForTick@https://pokeemerald.com/web/app.js:846:14 tick@https://pokeemerald.com/web/app.js:856:36

Re: Pokemon Emerald Ported to WebAssembly (100k FPS)

#105
post #23

Why Emerald -- is classic already done? If anyone has emulator suggestions, I recently attempted a playthrough and found that midway through my copy of red, the game was corrupted? Oddest thing -- hadn't reading the point where you do the "Missingno trick" near cinnebar. Anyways, I suspect the save got corrupted somehow but it made me swear off emulation and try a physical copy. (Which had the battery I replaced fail…

Try https://afterplay.io it’s cross platform, saves every 20 seconds and keeps your last 50 saves which you can recover from if anything goes wrong

Thanks, this looks akin to what I'm looking for. Maybe a few features I don't need but looks interesting.

Re: Pokemon Emerald Ported to WebAssembly (100k FPS)

#106
post #23

Why Emerald -- is classic already done? If anyone has emulator suggestions, I recently attempted a playthrough and found that midway through my copy of red, the game was corrupted? Oddest thing -- hadn't reading the point where you do the "Missingno trick" near cinnebar. Anyways, I suspect the save got corrupted somehow but it made me swear off emulation and try a physical copy. (Which had the battery I replaced fail…

I chose Pokemon Emerald because it is my favorite of the games that have been disassembled!

has RBY been disassembled, out of curiosity?

Re: Pokemon Emerald Ported to WebAssembly (100k FPS)

#107
post #71

Earlier quoted context omitted.

Yeah to be clear, I replaced the internal battery. I don't know if the issue is that it isn't seated properly, it was working for a spell. But I can't solder and don't want my first project to be a 1st gen copy of Pokemon. Anyways, I just want a "known good" emulator for the game boy. It could be a GBA emulator since that's backwards compatible, but I just want something simple to play Pokémon. To be clear I was weir…

mGBA is not bad, runs on any OS. There's also one for Mac, but I forget the name.

thank you for the suggestion. i value open source over MacOS compatibility, I can spin up a VM if needed.
Post reply on HN