Golden Sun Hacking Community

General Hacking => Non-GS Hacking => Topic started by: Luna_blade on 17, August, 2016, 07:20:25 AM

Title: Some idea I had
Post by: Luna_blade on 17, August, 2016, 07:20:25 AM
So yeah. I was thinking about emulators ROM's and stuff.
AFAIK there are no roms converted to a PC executable file.
Why not? It does take some time to translate all ROM commands to another Programming language, but so does making an emulator.
The big difference is that the graphics part needs to be designed specially and that you only work on one ROM.
But the advantage is that you can edit the game a lot easier and it would certainly run faster.

Is it even possible to convert a ROM?
Title: Re: Some idea I had
Post by: Daddy Poi's Oily Gorillas on 17, August, 2016, 09:17:41 AM
It may be possible, but it is likely difficult? (Esp. if 100% automated.)

@100%: I think one of the biggest challenges to automating the process might be knowing what's code and what is not? (One example is to imagine a pointer table of functions (Not all functions, just a group of them.)... and then an index that grabs a pointer... where the index doesn't have a cap.(Superstar Saga and Golden Sun do have pointer tables to a group of functions, for example.)

Not sure how much easier it would be to edit if you still have to manually put in all the names for functions/variables/etc. though. And with compiler optimizations, the flow may not look right either? Etc. (Depends on if said game has any of that info or not, likely not... if we're talking about things like GBA.)

But I suppose another question is: Is it worth it? When you could rewrite the whole thing anyway... in which it'd be even easier to read.)


---
Oh, and if I recall correctly... Making a GBA emulator is pretty easy in comparison to a DS or 3DS emulator... which is harder due to more stuff needing to be coded.
Title: Re: Some idea I had
Post by: leaf on 17, August, 2016, 06:16:26 PM
This doesn't sound terribly practical. It's mostly a semantic difference anyway. If you turn it into an executable, you're essentially making an emulator that can only run that one game. There's no real advantage to it.
Title: Re: Some idea I had
Post by: Daddy Poi's Oily Gorillas on 17, August, 2016, 09:19:22 PM
I suppose I agree with you... (in a way)... since well... Even if we did do such a conversion to allow for additional space in WRAM/IRAM/VRAM/etc... (and other features like clicking the screen.), we could still do that with the emulator instead. (But then only Homebrew/hacks would use whatever additions were added.)
Title: Re: Some idea I had
Post by: Luna_blade on 19, August, 2016, 12:56:40 AM
Quote from: foxIt may be possible, but it is likely difficult? (Esp. if 100% automated.)

@100%: I think one of the biggest challenges to automating the process might be knowing what's code and what is not? (One example is to imagine a pointer table of functions (Not all functions, just a group of them.)... and then an index that grabs a pointer... where the index doesn't have a cap.(Superstar Saga and Golden Sun do have pointer tables to a group of functions, for example.)

Not sure how much easier it would be to edit if you still have to manually put in all the names for functions/variables/etc. though. And with compiler optimizations, the flow may not look right either? Etc. (Depends on if said game has any of that info or not, likely not... if we're talking about things like GBA.)

But I suppose another question is: Is it worth it? When you could rewrite the whole thing anyway... in which it'd be even easier to read).
So if I understand correctly, emulators put the ROM in the RAM (and some even don't) but only convert the commands while executing?
Quote from: foxOh, and if I recall correctly... Making a GBA emulator is pretty easy in comparison to a DS or 3DS emulator... which is harder due to more stuff needing to be coded.
I can understand that.
Quote from: leafThis doesn't sound terribly practical. It's mostly a semantic difference anyway. If you turn it into an executable, you're essentially making an emulator that can only run that one game. There's no real advantage to it.
Well okay, but wouldn't it go faster because there is no overhead from the emulator?
Title: Re: Some idea I had
Post by: leaf on 19, August, 2016, 02:46:05 AM
Run... faster...? Are you out of your mind? Suppose for a moment that it actually did run faster. What possible benefit could you gain from that? It's already more than possible to play games at 1600% speed in VBA, which is already fast enough to be impossible to accurately play (as a human, that is; the game still emulates correctly). As it is, games already need a frame limiter just to prevent them from going at out of control high speeds due to the processing power of modern computers.

And you still seem to be missing the point that in order to play a game on PC that was built for a different set of hardware, you still need some form of emulation to act as the go-between. Games are optimized for the systems they're built for. This is especially true for old gameboy titles, which weren't made to be portable to other systems. The commands work at a very low level, going so far as to tell the system what registers to use to do something. It's not like we have C++ code or something that we can just compile and run on a PC; we're stuck with already-compiled code that's made to run on a specific set of hardware. Emulators work by essentially tricking the ROM into thinking it's working on the actual hardware, and then intercepting its outputs to convert them into a more PC-friendly state. It's not as simple as just telling it to output its display to a computer monitor instead of the gameboy screen, or changing a few variables to let it receive input from a keyboard. Without access to the source code, that's nontrivial even for modern games, which are specifically built to be cross-platform.

Title: Re: Some idea I had
Post by: Daddy Poi's Oily Gorillas on 19, August, 2016, 03:22:32 AM
QuoteSo if I understand correctly, emulators put the ROM in the RAM (and some even don't) but only convert the commands while executing?
Something like that. (Although, the real hardware likely reads straight off the cartridge (GBA has it memory mapped) and/or loads files at a time (like the DS)....)

"Faster" in the sense of human perception for VBA is likely pointless... But perhaps it was a matter of wrong word choice? Like say... how about more efficient? Can never get enough of savings from power consumption/ battery life, can you? (But the effort on work for too little of gains is probably not worth the time... esp. when you consider Moore's Law is already halving the size of the transistors each couple years... or something like that-ish. There are articles on the internet that say that may be coming close to an end, though.... But I'm sure the work on improvements when including tech as a whole, is far from over.) Also, things like solar panels that get power from the sun, thus making electricity potentially money-free in the long run... may make the savings seem nearly pointless. (Eventually./Hopefully.)

I can practically imagine a day in the future... when internet may be free. (Like internet.org)... and also, how computers could possibly be mainly display/sound devices... (With some RAM, obviously, etc.)  where the processor stuff happens over the internet/cloud... and we all know how fast Google servers are, right?  Didn't Google have some cheap Chromebook like that, forget now.
Title: Re: Some idea I had
Post by: Luna_blade on 20, August, 2016, 09:24:27 AM
I see why this doesn't work now.