WIP Experimental Switch emulator in C#

Discussion in 'Switch - Emulation, Homebrew & Software Projects' started by gdkchan, Feb 5, 2018.

  1. ☠Emulator Team☠

    ☠Emulator Team☠ Advanced Member

    Newcomer
    1
    Feb 3, 2016
    Poland
     
    lordelan, AdamN and pol40 like this.
  2. BullyWiiPlaza

    BullyWiiPlaza Nintendo Hacking <3

    Member
    10
    Aug 2, 2014
    Germany
    False. Would you stop spreading lies? Obviously most game engines and emulators are written in C++. What I said was that most Linux tools are command line tools written in C when people could use managed languages already hence the tools crash sometimes due to bugs and they don't use GUIs which makes them "shitty" overall. It's also a fact that Linux has poor game and graphics engine support. So, this obviously has nothing to do with the language alone if you look at Windows or gaming consoles but have a nice day, troll. Apparently not such a good memory after all (This was a Linux topic, not a C++ topic). But now don't bother continuing to derail as usual, thanks. :rolleyes:
     
    Last edited by BullyWiiPlaza, Feb 9, 2018
  3. bailli

    bailli GBAtemp Regular

    Member
    6
    Oct 16, 2006
    Gambia, The
  4. Dr.Hacknik

    Dr.Hacknik Advanced Maniac | Dev | Trans

    Member
    9
    GBAtemp Patron
    Dr.Hacknik is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    Mar 26, 2014
    United States
    inside your fridge
    Ahem, explain how I can get more fps in Solus when it comes to games than Windows? Especially with a 1050 Ti? I'm really starting to question your logic.
     
  5. Kakkoii

    Kakkoii Old fart

    Member
    5
    Sep 14, 2007
    Canada
    Pretty sure that's because the Linux environment has a hell of a lot less overhead and abstraction than Windows. Game is compiled from the same damn code for either platform.

    Anyways, C# and relevant compilers have evolved over the years. C# is very much viable for developing high performance code on. It just takes someone knowledgeable enough with how the code gets compiled and the features available to you to do it.

     
    Dr.Hacknik likes this.
  6. punderino

    punderino aka Big-PeePee Swinger

    Member
    8
    Jan 5, 2016
    United States
    Kansas City, Missouri
    Linux has shit video driver support. In some games optimized directly for Linux you could, with a lot of work from the dev, get the same or more FPS than Windows, if it were more. It'd probably be because there's no shit running in the background. But I'm not gonna have spent as much as I did on my video card and not get to use it to its full potential just for Linux.

    Anyways, nice emulator! Glad a lot of these are showing up
     
  7. guily6669

    guily6669 GbaTemp is my Drug

    Member
    7
    Jun 3, 2013
    United States
    Doomed Island
    I wanted more the dev of this emulator to have answered :P

    But anyway my laptop even though it's old is not that crappy for a 2012 11.6 inch laptop...

    The I7 on it has close performance to my desktop I7 2600K though I have it at 4.9ghz so it goes way far ahead of the 3rd gen I7 on the laptop.

    And the GT650M probably can play BF1 at like medium settings, BF4 run around high with a few things off...

    Anyway a better Switch emulator might appear in the long future, though it would probably be pointless at that time when a new Nintendo comes out lool

    Even on my I7 at 4.9ghz with huge single thread performance close to 7700k at stock clocks and a RX480 with 580 bios and clocks it's still hard to play Zelda on Cemu, though I haven't tried the latest version yet :(.

    Ps: never had much luck with emulators :( unless old ones like mame32, NeoGeo, when I was a kid I played thousands of hours in them. Neo Bomberman is still the best :P
     
    Last edited by guily6669, Feb 10, 2018
  8. Joom

    Joom  ❤❤❤

    Member
    14
    Jan 8, 2016
    United States
    Wut...
     
    Dr.Hacknik likes this.
  9. MrFrodo18

    MrFrodo18 Advanced Member

    Newcomer
    4
    Dec 1, 2016
    United States
    I’m really excited to see where this goes!
     
  10. Cid2mizard

    Cid2mizard nintendomax

    Member
    7
    Aug 16, 2007
    France
    Maubeuge
    It's strange, I get an image inverted horizontally !
     

    Attached Files:

    Last edited by Cid2mizard, Feb 21, 2018
  11. filfat

    filfat Musician, Developer & Entrepreneur

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

    Our Patreon
    Nov 24, 2012
    Cid2mizard likes this.
  12. AdamN

    AdamN Member

    Newcomer
    2
    Jul 29, 2011
    Indonesia
    On the Net
    Btw, which visual studio is recommended to build Ryujinx? VS2015 or VS2017 (will both community edition do well)?
     
  13. emmauss

    emmauss GBAtemp Advanced Fan

    Member
    6
    May 12, 2014
    Ghana
    Accra, Ghana
    VS is not necessary to build and run ryujinx. just the .net core sdk is enough. but for debugging and development, use vs 2017. the latest public version is VS 2017 15.5.7
     
    AdamN likes this.
  14. Cid2mizard

    Cid2mizard nintendomax

    Member
    7
    Aug 16, 2007
    France
    Maubeuge
    for now when i push A on Ryujinx with read-controls example, Down, Held & Up panic. there seems to be a problem with the response of commands.
     
  15. AdamN

    AdamN Member

    Newcomer
    2
    Jul 29, 2011
    Indonesia
    On the Net
    Anyone managed to boot Puyo Puyo Tetris to logo (like shown by OP)?
    I tried using the binary from auto-build but i only gets blank screen running at 60 FPS (the FPS doesn't feels right since my PC spec is kindda low, AMD A6-6400K 2-cores @ 3.9Ghz, 8GB RAM, Radeon R270 2GB VRAM), and i don't see any error in the console

    ss-ryujinx-puyo-puyo.
     
    Last edited by AdamN, Feb 28, 2018
  16. gdkchan
    OP

    gdkchan GBAtemp Regular

    Member
    4
    Jul 8, 2015
    Brazil
    Hid issues should be fixed on this branch: https://github.com/gdkchan/Ryujinx/tree/hid_refactor.
     
    Cid2mizard likes this.
  17. Furoryan

    Furoryan Member

    Newcomer
    1
    Feb 23, 2017
    France
    Hello,
    I tried to read your code, but I'm not a C# dev, so there are some stuff with events I don't understand (the notation ?.Invoke).
    My questions :
    - where do you map the SharedMem for Hid? (offset location) Does it need to be mapped before giving the control to rtld or not?
    - I get stuck with my own emu on a null pointer dereferencing in the struct nn::am::g_Interfaces (with Puyo puyo). Do you have already encounter this problem?
    Thanks if you can help me!
     
  18. gdkchan
    OP

    gdkchan GBAtemp Regular

    Member
    4
    Jul 8, 2015
    Brazil
    You don't need to map the HID shared memory right aways, only when the game asks for it. Basically, it will call CreateAppletResource on the HID service, this will return an IAppletResourceInterface. Then it calls GetSharedMemoryHandle on the IAppletResource interface to get the handle for the HID shared memory. After that, it uses svcMapSharedMemory into a memory region on the process address space. The game can then read inside the HID mapped address to read input data.

    About your problem with nn::am::g_Interfaces, no I don't remember having such a problem.

    Also we have a discord if you want to join. Link is on the readme of the github page .
     
  19. jimmyj

    jimmyj Official founder of altariaism. Copyright jimmyj

    Member
    8
    May 26, 2017
    United Kingdom
    Hyrule
    can this display devkit pro built papà?
     
  20. Furoryan

    Furoryan Member

    Newcomer
    1
    Feb 23, 2017
    France
    Thanks for your response. I think I forgot something to initialize but I don't know what.
    Here is the last opcodes executed for Puyo puyo, it loads offset 72 (decimal) from nn::am::g_Interfaces. Zelda ends in a similar manner, but in fonction nn::am::GetSelfController(), with a different offset in structure g_Inerfaces. I don't think I have any more problems in my interpreter, but I really think I'm forgetting something to init.
    Loading on the rom is done in the same way than you:
    - rtld @0x8000000
    - empty page for args after rtld
    - page rounded up to next 0x1000
    - no guard pages between nso
    - execution starting at 0x8000000
    Only TSL page and Main stack are not mapped like you (I don't think it will change anything).
    Do I need to load anything else before giving the control to rtld?

    [FUNCTION _ZN2nn2am23GetApplicationFunctionsEv]
    Executing 0x196603c8 inst 0xf81e0ff3 STR X19, [X31, #-32]!
    mmu::write64 @0x19e4fcf0[aka stack pid 00] value=0x1a80a
    X31=0x19e4fcf0
    Executing 0x196603cc inst 0xa9017bfd STP X29, X30, [X31, #16]
    mmu::write64 @0x19e4fd00[aka stack pid 00] value=0x19e4fd20
    mmu::write64 @0x19e4fd08[aka stack pid 00] value=0x196c354c
    Executing 0x196603d0 inst 0x910043fd ADD X29, X31, #16
    X29=0x19e4fd00
    Executing 0x196603d4 inst 0xd0002fe8 ADRP X8, 6283264
    X8=0x19c5e000
    Executing 0x196603d8 inst 0xf942c908 LDR X8, [X8, #1424]
    Symbol : _ZN2nn2am12g_InterfacesE
    mmu::read64 @0x19c5e590 value=0x19c3b8e8
    X8=0x19c3b8e8
    Executing 0x196603dc inst 0xf9402513 LDR X19, [X8, #72]
    mmu::read64 @0x19c3b930 value=0x0
    X19=0x0
    Executing 0x196603e0 inst 0xb4000133 CBZ X19, 36
    Executing 0x19660404 inst 0xa9417bfd LDP X29, X30, [X31, #16]
    mmu::read64 @0x19e4fd00[aka stack pid 00] value=0x19e4fd20
    mmu::read64 @0x19e4fd08[aka stack pid 00] value=0x196c354c
    X29=0x19e4fd20
    Executing 0x19660408 inst 0xaa1303e0 MOV X0, X19
    X0=0x0
    Executing 0x1966040c inst 0xf84207f3 LDR X19, [X31], #32
    mmu::read64 @0x19e4fcf0[aka stack pid 00] value=0x1a80a
    X19=0x1a80a X31=0x19e4fd10
    Executing 0x19660410 inst 0xd65f03c0 RET X30
    Executing 0x196c354c inst 0xf9400008 LDR X8, [X0]
     
Quick Reply
Draft saved Draft deleted
Loading...