Hypothetical question: What would happen if you emulated a system... on that same system?

Discussion in 'General Gaming Discussion' started by DutchyDutch, Aug 8, 2016.

  1. DutchyDutch
    OP

    DutchyDutch COPYRIGHT LOLOLOLOL

    Member
    873
    431
    Nov 16, 2014
    Netherlands
    I don't know, this is something I've been wondering for a while now. What would happen if you took a console (3DS, for example) and then created an 3DS emulator for the 3DS. Would it run perfectly? Or would it not run at all? Is it even possible? Sorry for such a stupid question, this stuff just kinda interests me. :P
     
  2. The Real Jdbye

    The Real Jdbye Always Remember 30/07/08

    Member
    GBAtemp Patron
    The Real Jdbye is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    12,306
    5,329
    Mar 17, 2010
    Norway
    Alola
    It would run poorly (1-2fps) if it ran at all. Just look at 3DeSmuME. The 3DS is way more powerful than the DS and it still runs poorly.
    Generally it would probably not even run because the emulator itself would need more RAM than running the games natively and there probably wouldn't be enough RAM to run the emulator.
     
    B_E_P_I_S_M_A_N likes this.
  3. sj33

    sj33 GBAtemp Addict

    Member
    2,717
    1,719
    Oct 22, 2013
    Japan
    I'm not sure I understand how that applies to the OP's question.

    It sounds essentially impossible because the emulator would be 'translating' system calls that already exist in the system, thus no translating would actually need to be done. I mean, you could create a close 'emulation' sandbox, but no actual emulation would be taking place.
     
  4. The Real Jdbye

    The Real Jdbye Always Remember 30/07/08

    Member
    GBAtemp Patron
    The Real Jdbye is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    12,306
    5,329
    Mar 17, 2010
    Norway
    Alola
    That's why I mentioned 3DesMuME. It's emulating an architecture on the same architecture, so it's the closest example of what OP is asking about. It's still emulation as it's still doing all the same things that emulating on a PC or a mobile device would do, it's just redundant and a waste of CPU cycles.
     
  5. DutchyDutch
    OP

    DutchyDutch COPYRIGHT LOLOLOLOL

    Member
    873
    431
    Nov 16, 2014
    Netherlands
    I thought that since emulation works best if the system has a similar architecture, the emulation could be near perfect since everything is exactly the same. But then again, the Wii can't emulate the Gamecube, and the Wii's basically an overclocked gamecube.
     
  6. sj33

    sj33 GBAtemp Addict

    Member
    2,717
    1,719
    Oct 22, 2013
    Japan
    I'm not sure what you mean. The Wii can execute GameCube calls natively. That's what Nintendont does.
     
  7. gamesquest1

    gamesquest1 Nabnut

    Member
    GBAtemp Patron
    gamesquest1 is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    14,152
    9,504
    Sep 23, 2013
    like dosbox or vmware running windows7 in windows 7

    i think it would just depend on the system and how the emulator is made, but for it to work decent i assume it would have to be more of a virtual machine setup rather than actual emulation
     
  8. DutchyDutch
    OP

    DutchyDutch COPYRIGHT LOLOLOLOL

    Member
    873
    431
    Nov 16, 2014
    Netherlands
    Yeah but I mean that the Wii isn't strong enough to emulate the Gamecube, despite having similar architectures. Just like how the 3DS isn't strong enough to emulate the DS, but it can run DS games natively.
     
  9. gbaboy123

    gbaboy123 Banned

    Banned
    412
    115
    May 14, 2011
    United States
    tree with wi fi
    so you mean like emulating snes on a emulated wii on pc right? I mean its possible but first of all you will get poor performance so any emulator developer would prefer to work on emulating only one console at a time instead of emulating another console through the console he is currently emulating. it may be possible but its not smart at all
     
  10. gamesquest1

    gamesquest1 Nabnut

    Member
    GBAtemp Patron
    gamesquest1 is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    14,152
    9,504
    Sep 23, 2013
    i think he means actually emulating the system your already on i.e like running citra on a 3ds, as stupid as that may be :wtf:
     
    DutchyDutch likes this.
  11. Coto

    Coto GBAtemp Addict

    Member
    2,379
    418
    Jun 4, 2010
    Chile
    well if you take the dynarec way, its emulation, on the other hand if you extend opcode properties (such as the opcode offset out of a table of opcodes), then it redirects to hardware opcodes, then its closer to virtualization. On each isolated case you have your own set of packed registers, not mixable, unless you swap emulation-virtualization context, pretty much like gbaemu4ds does when entering bios swi opcodes (software irq (literally) -> swap stacks -> hardware irq (irq handler) -> exit -> restore software irq ). This is made specifically so if the assembler routine (virtualized) ever triggers a swi , it falls back to a dynarec handler (for emulation side), and then the hardware IRQ handler comes in so whatever opcode decided from swi makes use of hardware resources. (edit: also the IRQ handler redirects to a bios irq software opcode as well (for mapping vba bios opcodes), but this would make the explanation a tad more confusing. :P
     
    Last edited by Coto, Aug 8, 2016
  12. sj33

    sj33 GBAtemp Addict

    Member
    2,717
    1,719
    Oct 22, 2013
    Japan
    Do you need to translate English into English? French into French? German into German?

    Both the Wii and GameCube use PPC instructions that are, for the most part, the same.
     
  13. gbaboy123

    gbaboy123 Banned

    Banned
    412
    115
    May 14, 2011
    United States
    tree with wi fi
    ohhh well there's no point on that considering the 3ds itself would run better, but how can you emulate a console that's already doing what you are trying to archive in the emulation ok I don't understand the question so am out, peace :nayps3:
     
    Last edited by gbaboy123, Aug 8, 2016
    gamesquest1 likes this.
  14. DutchyDutch
    OP

    DutchyDutch COPYRIGHT LOLOLOLOL

    Member
    873
    431
    Nov 16, 2014
    Netherlands
    That's the thing, it's a hypothetical quesiton, there's no point into doing this, but I was wondering if it's even possible. I guess it could have some use if it were to run good, like being
    able to play 3DS games using an emulator in the homebrew launcher, but that wouldn't even be worth the effort.
     
  15. Kameryn

    Kameryn Member

    Newcomer
    13
    3
    Jun 18, 2007
    Canada
    Not really no.

    The platform used to emulate needs to be considerably more powerful to do the emulation, let alone run a game on top of it at a decent fps.
     
    Last edited by Kameryn, Aug 8, 2016
  16. gbaboy123

    gbaboy123 Banned

    Banned
    412
    115
    May 14, 2011
    United States
    tree with wi fi
    I really don't think you can do that then, the best answer we could get you is that nobody has ever tried doing this so we really don't know exactly what will happen but I think It would run really bad if you attempted to do that, I don't really see how for example the 3ds would handle the emulation of itself I really don't think it will handle it considering he already has what you are trying to emulate but when attempting to emulate the same console on the console there would be some kind of software running and I think that the 3ds would no be able to handle that
     
    Last edited by gbaboy123, Aug 8, 2016
  17. FAST6191

    FAST6191 Techromancer

    pip Reporter
    23,722
    9,594
    Nov 21, 2005
    United Kingdom
    There are virtual machines on the PC, and things like dosbox which will run on what is still an X86 system. Depending upon the type of emulation you would end up with a kind of hypervisor, which would be lovely for injecting cheats and mods remapping controls and possibly making savestates. If you have a more modern system that actually runs an operating system worth speaking of (the DS does not, the 3ds does, the 360 does, the wii does not really but it is more than the DS) then it is probably easier to attack the OS of the computer in question -- there were control remapping things for the 360 that went down that path.
    As others said though emulation is a process known for its rather impressive overheads and more than a few games on more than a few systems peg the CPU and memory more or less throughout. To that end unless you managed to boost the RAM and have overclocked the thing it is probably not going to do you much good, and instead if I wanted cheats I would think about how I could inject my code aka hook the game instead -- it is how things like GBAATM and DSATM work, also how a lot of flash carts do things. Savestates from within a system without external hardware is considered an impressive trick to be able to pull off, generally you would want to halt a system and read everything out, hope any write only areas of memory can live without what you can't get (else you have to figure out a basic will almost always work setup or somehow hook the writes to it and note them down at all points) and then somehow write it somewhere you control and can keep for however long you need it for, restoring, assuming you want to do it*, is the reverse of this really.

    *you might not as you might just want the memory dumps for debugging/cheating/hacking purposes.