Ok. So what’s interesting here, presumably, is that this isn’t a wasm GBA emulator (which also exist and work). This is the game itself compiled to wasm. Even though no official source code was ever published, there was a community based decompilation.
How long until this is DMCA'd? How has the project it's based on stuck around for so long? Do I perhaps misunderstand what this is? https://github.com/pret/pokeemerald
It's a port of a disassembly that requires you to provide your own ROM. The legality of such things is a tangled web that anyone producing them needs to navigate very, very carefully.
It's mostly argued around or against the application of fair use. I suggest consulting a lawyer if you're truly interested, as it quickly gets into legalese around what constitutes ownership, distribution, etc. Throw in a lack of extensive case law and you quickly get into opinions rather than legal bases.
I get the sense that these disassembly/decompilation projects believe that some types of IP-laden asset data can be shipped embedded into the project — not necessarily "legally", but in that they'll likely get away with doing so indefinitely — as long as:
1. those assets are stored in proprietary formats that only the game code itself understands, and
2. no tool exists in the project to extract the assets from these proprietary formats into open formats, unless that tool itself exists only in source-code form in the codebase, and requires the ROM as an input to compile it (even if in the case of such a tool, the ROM is doing nothing but serving as a "key" to unlock compilation.)
Basically, if you have to prove you have your own copy of the IP in order to make their embedded copy of the IP "legible", then it's very hard to construct an evidence-based DMCA takedown order that actually makes any coherent point about the project "distributing" said IP.
That being said, shipping assets like this at all, even if you "can get away with it", is ultimately just a kind of laziness / shortcut-taking. They do it because there's either no clear/simple/obvious way to automatically extract the given asset data from the ROM (e.g. because the relevant data is split up into various data planes + metadata bits that are stored "exploded" all over the ROM), so they just did it once by hand, committing the results; or because there's no clear/simple/obvious way to store the extracted asset data such that a regular compiler/assembler natively understands how to embed it into the binary in the particular form it was found in the original ROM. (Remember, re-assembling/compiling to the original ROM is always the test these projects use to ensure their disassembly/decompilation is preserving semantics. So they need to replicate every weird layout quirk the original dev tooling imposed upon the original ROM. And sometimes the original dev tooling included special-purpose domain-specific asset-codegen tools that aren't part of regular compiler toolchains.)
What these projects should actually be doing, is taking on the schlep: writing the extract tooling anyway, even if it's just "copy these bytes from here and these bytes from there, and spit them out as hex in an .asm file with this header"; and/or writing matching asset-codegen tooling to the tooling that likely existed in the platform SDK, to run before compile/assemble time, converting the extracted ROM asset files into a form (probably a bunch of little assembly files) that will land in the right places when linked back together to form the original ROM.
And, to be clear, they mostly do do this! These projects are very good at doing this!
But sometimes — especially on a larger project with many contributors — one or two things like this aren't audited properly, and fall through the cracks. Or they start out as temporary "bootstrap" approaches made during a private phase of development to get things working + compiling to a correct image; and then not all of those get cleaned up before the repo gets made public.
Perhaps I'm mistaken but the project doesn't need a copy of the original ROM at all right?
To be clear; I don't really understand the law around this - my own country is based on case law which means that even if I wanted to open source some of my reverse engineered games (I have a few private partial implementations of some old defunct game engines in-progress), the distinct lack of prior cases means, sadly, it's prudent not to release them at all while the companies are still active.
I’m of the opinion that projects like this should start hosting Forgejo instances in countries with favorable laws and just mirroring to Github for exposure.
Notably radicle is reportedly compatible with seed nodes that bridge between (ie are simultaneously available on) clearnet and overlays such as tor. (I haven't personally tested this just repeated what I read elsewhere.)
Copyright being as long as it is is a theft of our culture. I (and many of our generation) grew up with Pokemon, it's a common experience for many of us. A classic of our culture. Except we're not allowed to use it, remix it, build our own versions, etc. We still do, of course, but it's all illegal.
It didn't used to be this way.
I think 20-30 years of copyright should be plenty to extract whatever profits you deserve from the fruits of your labor. Anything beyond that is just holding culture hostage for the benefit of a few. It doesn't serve society in any meaningful way.
I get nervous releasing just symbols for a game and here is a full disassembly. I have no idea how tolerant the rights holders are to this kind of stuff. I guess you just roll the dice, but the power is in their hands how far they take action.
Well, the decomp requires you to provide your own ROM, and doesn't include any of the assets from the original game. So, that's probably okay for the most part.
This browser based version on the other hand, is in far murkier territory. The fact you don't need a ROM means the assets are definitely included by default on this site, and Nintendo would have a way better case for getting it taken down.
It's basically equivalent to those ROM sites that let you play GBA ROMs in the browser through an emulator written in JavaScript or WebAssembly.
But Nintendo's lawyers pay a lot less attention to anything prior to the Switch generation, and the same presumably goes for the Pokemon Company ones. If this project gets a lot of media coverage it's probably toast, but if it's mostly discussed on the odd programming forum like this one, it could survive a very long time.
Alternatively, you could have downloaded an existing one. What you did is just a roundabout way of acquiring one of the many WASM Rust GB emulators in the training set. Except it probably now has several problems from reconstruction. You didn't learn anything new from the process. It's just wasteful in several ways.
bro, I learned a lot, I did it step by step and discussed everything with Claude, then used the knowledge to build an emulator at work for a rtos machine (WIP)
I did a Pokémon Crystal playthrough several months ago, still great games!
I used an emulator on my laptop with increased speed so it made everything like walking and combat way faster which was really nice and I probably would have given up if it wasn't for that
Currently playing Pokémon Unbound, that is probably best ROM hack ever made. I grow up on 1st and 2nd GB and GBC games so Unbound feels a little bit bloated to me with 8 generations of monsters but man... This project is completely new experience, especially playing on retro hand-held like Trimui Brick Hammer.
Then I start to explore another Pokémon hacks and find out that those project has big fan community that are very enthusiastic about bringing new features to classical Pokémon formula. Documents/wiki on web are more detailed than original games has!
For example R.O.W.E mix all kind of modes that you can select, connect Johto and Kanto maps togather, gives you options to limit avalible generations of Pokémon's, so as veteran you can feel more like home.
Another hacks that I need to explore more - Pokémon Gaia and Pokémon Odyssey.
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... it's been a comedy of errors).
Emerald is well regarded as the best of Generation 3, which is the final of the traditional 2D games and can trade with Fire Red/Leaf Green (remakes of the classic)
Ah good point. I was looking into buying a used copy of Fire Red / Leaf Green and they were surprisingly expensive.
I have a copy of red, but even with a new battery the save function keeps failing. I suspect I didn't seat the battery well and I need to solder it, but I am not trained in that and reluctant to have my first project involve an expensive retro cart.
Maybe the internal battery died. I honestly recommend you look at GBC style handhelds or if you like the GBA style, Anbernic made one that looks insanely close to a GBA.
There also a craze of DS style emulators popping up. They all give you comfort knowing that your saves will be fine forever if you back them up, even if the device dies.
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 weirded out because an emulated copy glitched out, not the physical one. Physical one just had a battery issue.
There should be 2 options for speed, regular and sped up. Then there should be a key to speed the game up. When I was a kid, it was the space key for GBA. You could have the normal game and skip the boring parts fast.
Thanks for the info, I will look into this! I got past that battle and further into the game in my testing, but I don't think I've tried using an item in battle yet.
What are considered the best games in WASM? I recently got into playing around with WASM - it would've been great if this technology was prevalent during the Flash games era
Cool! I like the speeding up feature. I suggest making the UI indicate that you can press the keys `z` and `x` on the keyboard to trigger the A and B buttons respectively, I figured that out by pressing on my keyboard the A and B keys and then all the letter keys.
Btw, it seems there's a crash when you choose "Pokemon" in the "Fight/Bag/Pokemon/Run" menu:
Funny, I've been emulating games for literal decades at this point, but remapping buttons is one of the first things I did in every one of them, so I never knew the defaults hehe
There's an NPC who walks you to the pokemart and gives you a potion. For me that dialogue was something like "You receive a !" and it then said "You place it in the 23 pocket" -- seems related?
This is amazing. Are the left right up down controls a bit wonky? If I cycle through the letters in the name select menu it seem to buggily not actually go through it?
Really exciting to see more games ported to WASM. For anyone interested, I just did a HN post detailing a port I spent the last 5 days on - Xonotic, an arena FPS. Includes a technical writeup too:
This is super cool. Do you have any code up in a public repo that I could peek at? I've been working on and off on a static recompiler for playstation games, wasm was kind of my end goal.
Thanks man, feel free me to DM me on X if you'd like to discuss further, I am planning to push the code to a repo seeing as Xonotic is an OSS game and requires any changes to also be open sourced. And a Playstation recomp implemented in WASM is interesting to think about!
Heads up: GPLv3 dictates you deliver the source once you distribute the compiled code to someone else, not just that you plan to some time in the future.
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.
I know they're pretty standard controls, but I would suggest letting users remap keys.
Enter is off by itself, so you have to move a hand to press start. Switching to space would solve that.
(I prefer wasd for arrows, and h/j for b/a with y/u or u/I for start/select, but I think most b̵r̵a̵i̵n̵ ̵d̵a̵m̵a̵g̵e̵d̵ right handed people prefer arrows.)
I'm left-handed and I prefer ZX for AB and arrows for the D-pad. Which is actually the mirror of how the real Gameboy Advance was laid out.
...Why is the D-pad always on the left on all of the controllers/handhelds anyhow, and the buttons on the right? After all, they're aimed mainly at the right-handed people, right?
The story I heard was that early arcade games had the joystick on the right, and switched to the left to make it a bit harder so they'd make more money.
Another reason I prefer wasd is I mainly use laptops, they always have tiny arrow keys.
Working on an audio port at https://github.com/ottohg/pokeemerald-wasm, and I've gotten pretty far. It's working, but there are just accuracy and instrument issues that need to be sorted out before it's in a playable state.
Seems the game does not pick up my A press if I release and then re-press it again quickly. There are multiple frames between my release and re-press, so I have no idea why this is -- maybe something is interpreting key repeats instead of using raw keyup/keydown events?
Nice! FYI: It currently freezes if you attempt to go to your Pokemon from the menu, and also when your starter evolves at level 16, making it unplayable further.
eigenspace | a day ago
parasti | a day ago
ameliaquining | a day ago
The one caveat is that a PWA needs an icon but the project doesn't currently have one, so you'd have to design, find, or LLM-generate one.
dmitrygr | a day ago
[OP] tripplyons | a day ago
rootsudo | a day ago
ironbound | 13 hours ago
https://github.com/rh-hideout/pokeemerald-expansion
Luc | a day ago
fc417fc802 | a day ago
mathgeek | a day ago
yw3410 | a day ago
mathgeek | a day ago
derefr | a day ago
1. those assets are stored in proprietary formats that only the game code itself understands, and
2. no tool exists in the project to extract the assets from these proprietary formats into open formats, unless that tool itself exists only in source-code form in the codebase, and requires the ROM as an input to compile it (even if in the case of such a tool, the ROM is doing nothing but serving as a "key" to unlock compilation.)
Basically, if you have to prove you have your own copy of the IP in order to make their embedded copy of the IP "legible", then it's very hard to construct an evidence-based DMCA takedown order that actually makes any coherent point about the project "distributing" said IP.
That being said, shipping assets like this at all, even if you "can get away with it", is ultimately just a kind of laziness / shortcut-taking. They do it because there's either no clear/simple/obvious way to automatically extract the given asset data from the ROM (e.g. because the relevant data is split up into various data planes + metadata bits that are stored "exploded" all over the ROM), so they just did it once by hand, committing the results; or because there's no clear/simple/obvious way to store the extracted asset data such that a regular compiler/assembler natively understands how to embed it into the binary in the particular form it was found in the original ROM. (Remember, re-assembling/compiling to the original ROM is always the test these projects use to ensure their disassembly/decompilation is preserving semantics. So they need to replicate every weird layout quirk the original dev tooling imposed upon the original ROM. And sometimes the original dev tooling included special-purpose domain-specific asset-codegen tools that aren't part of regular compiler toolchains.)
What these projects should actually be doing, is taking on the schlep: writing the extract tooling anyway, even if it's just "copy these bytes from here and these bytes from there, and spit them out as hex in an .asm file with this header"; and/or writing matching asset-codegen tooling to the tooling that likely existed in the platform SDK, to run before compile/assemble time, converting the extracted ROM asset files into a form (probably a bunch of little assembly files) that will land in the right places when linked back together to form the original ROM.
And, to be clear, they mostly do do this! These projects are very good at doing this!
But sometimes — especially on a larger project with many contributors — one or two things like this aren't audited properly, and fall through the cracks. Or they start out as temporary "bootstrap" approaches made during a private phase of development to get things working + compiling to a correct image; and then not all of those get cleaned up before the repo gets made public.
yw3410 | a day ago
To be clear; I don't really understand the law around this - my own country is based on case law which means that even if I wanted to open source some of my reverse engineered games (I have a few private partial implementations of some old defunct game engines in-progress), the distinct lack of prior cases means, sadly, it's prudent not to release them at all while the companies are still active.
Lplololopo | a day ago
giancarlostoro | a day ago
oompydoompy74 | a day ago
elmt35 | a day ago
fc417fc802 | 22 hours ago
orlp | a day ago
It didn't used to be this way.
I think 20-30 years of copyright should be plenty to extract whatever profits you deserve from the fruits of your labor. Anything beyond that is just holding culture hostage for the benefit of a few. It doesn't serve society in any meaningful way.
bottlepalm | 23 hours ago
CM30 | 20 hours ago
This browser based version on the other hand, is in far murkier territory. The fact you don't need a ROM means the assets are definitely included by default on this site, and Nintendo would have a way better case for getting it taken down.
It's basically equivalent to those ROM sites that let you play GBA ROMs in the browser through an emulator written in JavaScript or WebAssembly.
But Nintendo's lawyers pay a lot less attention to anything prior to the Switch generation, and the same presumably goes for the Pokemon Company ones. If this project gets a lot of media coverage it's probably toast, but if it's mostly discussed on the odd programming forum like this one, it could survive a very long time.
ironbound | 12 hours ago
hawkice | a day ago
[OP] tripplyons | a day ago
ceroxylon | a day ago
CSMastermind | 22 hours ago
itsthecourier | a day ago
https://holy-lake-f6df.sdreyesg.workers.dev/
took me 3 hours with Opus. Opus knew the whole ISA, clock, bus quirks, etc. from their training without any external docs
mathgeek | a day ago
[OP] tripplyons | a day ago
itsthecourier | a day ago
BearOso | a day ago
itsthecourier | a day ago
oceansky | a day ago
vorticalbox | a day ago
gobdovan | a day ago
[OP] tripplyons | a day ago
Weetile | 22 hours ago
(Not original creator of the port!)
weird-eye-issue | a day ago
I used an emulator on my laptop with increased speed so it made everything like walking and combat way faster which was really nice and I probably would have given up if it wasn't for that
nosioptar | a day ago
I find it improves the game when I don't have to spend a bunch of time leveling up or earning gold for equipment.
t0bia_s | a day ago
Then I start to explore another Pokémon hacks and find out that those project has big fan community that are very enthusiastic about bringing new features to classical Pokémon formula. Documents/wiki on web are more detailed than original games has!
For example R.O.W.E mix all kind of modes that you can select, connect Johto and Kanto maps togather, gives you options to limit avalible generations of Pokémon's, so as veteran you can feel more like home.
Another hacks that I need to explore more - Pokémon Gaia and Pokémon Odyssey.
danielrmay | a day ago
firefax | a day ago
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... it's been a comedy of errors).
patrickcorrigan | a day ago
jeremyloy_wt | a day ago
So you have available all of the original Pokémon
firefax | 21 hours ago
I have a copy of red, but even with a new battery the save function keeps failing. I suspect I didn't seat the battery well and I need to solder it, but I am not trained in that and reluctant to have my first project involve an expensive retro cart.
[OP] tripplyons | a day ago
giancarlostoro | a day ago
There also a craze of DS style emulators popping up. They all give you comfort knowing that your saves will be fine forever if you back them up, even if the device dies.
firefax | 23 hours ago
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 weirded out because an emulated copy glitched out, not the physical one. Physical one just had a battery issue.
giancarlostoro | 19 hours ago
Innittech | a day ago
_vertigo | a day ago
Innittech | a day ago
zuzululu | a day ago
deadbabe | a day ago
wild_pointer | a day ago
Navaie | a day ago
[OP] tripplyons | a day ago
ianm218 | a day ago
prinny_ | a day ago
kmeisthax | 18 hours ago
wis | a day ago
Btw, it seems there's a crash when you choose "Pokemon" in the "Fight/Bag/Pokemon/Run" menu:
https://i.ibb.co/tpVV8q83/poke-fight-menu.png
sergiotapia | a day ago
folkrav | 23 hours ago
[OP] tripplyons | a day ago
airstrike | 19 hours ago
vesche | a day ago
[OP] tripplyons | a day ago
theowaway213456 | a day ago
[OP] tripplyons | a day ago
chownie | 21 hours ago
Redster | 21 hours ago
theowaway213456 | 20 hours ago
CarVac | 16 hours ago
arthurcolle | a day ago
astlouis44 | a day ago
https://news.ycombinator.com/item?id=48428133
potsandpans | a day ago
astlouis44 | 23 hours ago
X link: https://x.com/AlexStLouis10
zamadatix | 13 hours ago
simianwords | a day ago
gobdovan | 8 hours ago
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.
cadamsdotcom | a day ago
AND - I didn’t have to blow air on the cartridge connector for it to work?
Is this the future?
orliesaurus | 23 hours ago
nosioptar | 23 hours ago
Enter is off by itself, so you have to move a hand to press start. Switching to space would solve that.
(I prefer wasd for arrows, and h/j for b/a with y/u or u/I for start/select, but I think most b̵r̵a̵i̵n̵ ̵d̵a̵m̵a̵g̵e̵d̵ right handed people prefer arrows.)
Joker_vD | 21 hours ago
...Why is the D-pad always on the left on all of the controllers/handhelds anyhow, and the buttons on the right? After all, they're aimed mainly at the right-handed people, right?
nosioptar | 17 hours ago
Another reason I prefer wasd is I mainly use laptops, they always have tiny arrow keys.
nrightnour | 21 hours ago
Weetile | 8 hours ago
Weetile | 21 hours ago
https://github.com/ottohg/pokeemerald-wasm
LoganDark | 20 hours ago
shepherdjerred | 17 hours ago
I had a project 'discord plays pokemon' written in TypeScript that allowed users to play Pokemon together.
The architecture was a GPU accelerated Docker container running a full browser and desktop environment.
With this it can all be done in-process. I threw Claude at the problem and it worked!
https://github.com/shepherdjerred/monorepo/tree/main/package...
villgax | 16 hours ago
htshnr | 13 hours ago
banyek | 13 hours ago
weezing | 10 hours ago
ironbound | 12 hours ago
https://github.com/rh-hideout/pokeemerald-expansion/blob/mas...
ironbound | 12 hours ago
https://x.com/skewbed/status/2063217866233479587