News: 11 March 2016 - Forum Rules

Author Topic: Two roms, shared controls, and a toggle...  (Read 5157 times)

spman2099

  • Jr. Member
  • **
  • Posts: 3
    • View Profile
Two roms, shared controls, and a toggle...
« on: December 04, 2013, 02:53:55 pm »
Okay, so I am hoping to get some input from people who know what they are doing (you guys). What would be the difficulty of jerry-rigging an emulator to run two roms simultaneously, while also having one set of inputs control both games? Also, I would like to implement a toggle key that would freely switch between the two roms, hopefully seamlessly, would that be a difficult proposition? I hope this isn't in the wrong place, and I appreciate any assistance given. Cheers!

FAST6191

  • Hero Member
  • *****
  • Posts: 3517
    • View Profile
Re: Two roms, shared controls, and a toggle...
« Reply #1 on: December 04, 2013, 05:24:19 pm »
I am not entirely sure what you aim to accomplish but I will run through the thought exercise.

You might be able to do such a thing with savestates and load commands. Generally though nobody really needs to run two instances of a game (or multiple games) within a single emulator -- old console games did it all in a single console, handhelds tended to be separate systems and so emulated separately and the newer systems with local system link have not really been emulated yet where others mainly went over the internet which brings a whole host of other problems (some of these have been emulated though).

However is there should be no great difficulties in running two instances of the emulator, mapping the controls the same in each and alt tabbing (most emulators will have a pause when inactive option if you want that sort of thing) between them.
« Last Edit: December 05, 2013, 07:03:04 am by FAST6191 »

spman2099

  • Jr. Member
  • **
  • Posts: 3
    • View Profile
Re: Two roms, shared controls, and a toggle...
« Reply #2 on: December 04, 2013, 05:52:57 pm »
Sorry, I should have given you more context...

The hope would be that, if such a setup could be arranged, it would be an invaluable tool for people attempting to learn Japanese. The Japanese and the English versions of the game would be running concurrently; the user could freely switch between the two "games", which would essentially be operating as the same game due to the unified controls, and could assist themselves in understanding the Japanese text. Now, this would most certainly be an intermediate tool, as the user would probably need Hiragana and Katakana at the very least to even hope to assemble some kind of context, but it could still be VERY useful.

Obviously, in order for something like this to work, it would need to operate smoothly (this would be key to its success). This would probably mean some genuine editing of the emulator's code would probably be required.

BRPXQZME

  • Hero Member
  • *****
  • Posts: 4572
  • じー
    • View Profile
    • The BRPXQZME Network
Re: Two roms, shared controls, and a toggle...
« Reply #3 on: December 04, 2013, 06:36:30 pm »
Ah, a little bit like Arcadia Remix?

First of all, coding difficulty is all about how familiar someone is with a codebase and relevant techniques, so only someone who actually has to do it could say how easy it is. For instance, I haven’t touched any emulator code in a while, so even if I did recall the architecture of the program, I’d have to do a lot of snooping around to remember exactly how things are done.

As far as specific challenges go, it would probably depend on the program. You can easily expect there to be a lot of coupling (overreliance on interconnected program parts) and global state (only expecting one of a particular thing to exist and monopolizing it, which makes it hard to create another instance) in these programs, and those are will take quite a bit of time “fixing”. You probably wouldn’t have trouble with doubling the emulated systems’ memory, for instance, but ensuring that the graphics and input are hooked up correctly will take quite a bit of effort.

Depending on how accurate you want the emulation to be, using separate processes/windows and hijacking various I/O things would probably be faster to do in a jiffy, particularly if you have a machine dedicated to it. (It should not pose too much difficulty to sync up the framerates this way if you’re careful.)

P.S. (seeing the second post) for it to make games dual-language you would have to guarantee a lot of things you simply can’t guarantee programmatically (e.g. no difference in random number generation so you don’t have NPCs going off in different directions and battles ending at different times, no difference in script timing or length, etc.). A lot depends on the game in question, but for the majority of JRPGs, simple solutions would go straight out the window!
we are in a horrible and deadly danger

KingMike

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 7412
  • *sigh* A changed avatar. Big deal.
    • View Profile
Re: Two roms, shared controls, and a toggle...
« Reply #4 on: December 05, 2013, 01:28:57 am »
However is there are difficulty in running two instances of the emulator, mapping the controls the same in each and alt tabbing (most emulators will have a pause when inactive option if you want that sort of thing) between them?

I know I've used bsnes in the past to test out running two versions at once.
(one test was Super Mario All-Stars NTSC and PAL. Though it's not possible to sync them to the point they can be played simultaneously, they otherwise appear to be damn near identical in timing for all practical purposes.
Or did Nintendo only mess up the Wii version? I remember as the NTSC version was quickly becoming a collector's item, PAL gamers were bemoaning the PAL version like the plague. :P
I do know the PAL NES version of SMB was oddly faster than the NTSC NES version.)
"My watch says 30 chickens" Google, 2018

FAST6191

  • Hero Member
  • *****
  • Posts: 3517
    • View Profile
Re: Two roms, shared controls, and a toggle...
« Reply #5 on: December 05, 2013, 07:08:28 am »
Gah wrote half the sentence and then realised I wanted to add something to another before going back to screw up the meaning. Wording tweaked.

Anyway as others mentioned this can be tricky if the game has been changed at all (and things often are, and that is before we consider the literal vs interpreted thing).
What I might be more inclined to do is find an emulator that supports a programming language (many will have Lua) and dump the script separately before having the lua act as a low rent debugger (set it to watch reads on a pointer table or something) that serves up a predumped Japanese or English script accordingly. Bonus there is such things are desirable by some disabled people so you might find something there or get some assistance in the matter.

henke37

  • Hero Member
  • *****
  • Posts: 643
    • View Profile
Re: Two roms, shared controls, and a toggle...
« Reply #6 on: December 05, 2013, 07:11:11 am »
There is an obvious problem with the idea: The games risk desynchronizing. Dialog will obviously differ, and as such the time to display it will too. And even a minor difference can prevent synchronization. Sure, it is less bad when the player can resynchronize the games, but that isn't possible in practice. Platforming games and other games with per frame incremental movement are very sensitive to timing. And anything involving random numbers is just begging for the RNGs to be desynchronized, especially those that use highly volatile data like nanosecond timers.

STARWIN

  • Sr. Member
  • ****
  • Posts: 456
    • View Profile
Re: Two roms, shared controls, and a toggle...
« Reply #7 on: December 05, 2013, 12:07:36 pm »
I'd probably look for ways of using existing netplay implementations for this. The basic idea would be running two instances of the emulator, either both at same computer (if possible) or with two computers. In both cases at the same time, no switching. Speculatively, if:

-the emulator supports netplay
-the emulator supports runtime texture replacing
-the netplay sync mechanism operates using states not affected by texture replacing
-there is a translation available for the game that operates by replacing the textures

, then a limited solution would already exist. I'm not familiar with texture replacing or the systems where such things exist, so this is very speculative.

In more general terms, if you can decouple the translated text strongly enough from the (other) gamestate, you have some hope. Applying the translation automatically, but after the emulator has done its netplay magic, seems like a relatively easy path, though I guess it depends on how the system handles its 2D graphics.

The most obvious romhack-ish method for this would be to incorporate both languages in one translation, and let the player switch language/routines with an unused/unimportant (ingame) key. In that case you have to trigger the text drawing again in some way as well. Probably difficult if you are not familiar with the asm changes / game logic. No need to run two instances / sync non-equal state then.

KingMike

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 7412
  • *sigh* A changed avatar. Big deal.
    • View Profile
Re: Two roms, shared controls, and a toggle...
« Reply #8 on: December 06, 2013, 12:28:26 am »
I guess someone has TASed Mega Man 3-6 simultaneously, but there's got to be some crazy person out there who has somehow managed to TAS the whole NES series at once.
Mega Man games have such great music that listening to six at once will be audio bliss :D
"My watch says 30 chickens" Google, 2018

r57shell

  • Jr. Member
  • **
  • Posts: 13
    • View Profile
Re: Two roms, shared controls, and a toggle...
« Reply #9 on: December 06, 2013, 09:37:54 am »
In some cases for Genesis, you may try to run Netplay for 2 players with different ROMs.

More info:
1) Get Gens emulator or its modification (surreal/rerecording...)
2) make two different directories, for example "eng, jap"
3) place in correspondent directories different ROMs but wit same name.
4) run two gens (1), (2).
5) open in gens (1) ROM from eng directory, and in gens (2) open ROM from jap directory.
6) File->Netplay and start standard netplay (for more info about netplay google or ask someone)
in both emulators in game list there will be ROM with same name, but from different directories.
In some cases, it will not desync. Give it to try :).

Same trick can be done with Kega Fusion, but ROMs must be patched in to have same CRC32. I don't remember exactly.

spman2099

  • Jr. Member
  • **
  • Posts: 3
    • View Profile
Re: Two roms, shared controls, and a toggle...
« Reply #10 on: December 06, 2013, 09:02:13 pm »
Thanks a lot, guys. There is a lot to process here, but I am hoping that I can make a setup work. Cheers!