Re:Zelda: A Link to the Past (SNES) re-implemented in C
by saltymug76 on Monday January 30, 2023 @12:59PM
(#34583717)
How did you get it to do that?
I asked it to translate Z_00.asm to C and it said:
"I'm sorry, I cannot translate a disassembly of code written in assembly language to C."
Re:Zelda: A Link to the Past (SNES) re-implemented in C
by bhouston on Monday January 30, 2023 @02:00PM
(#34584733)
"Can you covert the following assembly code for the NES into C code?"
[cut and past a bunch of code that fit within the ChatGPT buffer]
And it worked.
Re:Zelda: A Link to the Past (SNES) re-implemented in C
by foxyv on Monday January 30, 2023 @02:35PM
(#34585205)
I don't think that looks right. It looks like C code but mostly is just empty loops and missing references.
for (i = 0; i < Square1Note; ++i) {
// Output audio waveform data
}
Re:Zelda: A Link to the Past (SNES) re-implemented in C
by bhouston on Monday January 30, 2023 @02:51PM
(#34585429)
As I said, it is calling subroutines in the code snippet I asked it to translate. I didn't include all of the subroutines. Thus it has stubs for those. To do this properly, you need to basically create a graph of all the subroutines and then ask it to translate the leaf nodes first and slowly work your way up to the root nodes, or something like that. ChatGPT has length limitations for each prompt so you need to have a strategy to overcome those.
Re:Zelda: A Link to the Past (SNES) re-implemented in C
by foxyv on Wednesday February 01, 2023 @10:46AM
(#34612107)
That's pretty cool. I wonder if it would work well paired with FernFlower to decompile and de-obfuscate Java byte code. I often find myself stuck with a JAR where the source was never pushed to GIT and have to re-create it from decompiled source.
Re:Zelda: A Link to the Past (SNES) re-implemented in C
by mockery on Tuesday January 31, 2023 @10:30AM
(#34596311)
SongTable won’t compile (on any modern compiler) because the number of initializers (36) doesn’t match the declaration (32)
https://www.romhacking.net/forum/index.php?topic=32277.0
And then GPTChat gave me this:
The places where it can not fill in the details is because there are subroutines that are called whose body I didn't include in the prompt. Basically if you take a recursive approach where you feed ChatGPT incrementally the subroutines and whatnot, it can reconstruct it.