Homebrew yuzu Nintendo Switch emulator discussion

Furoryan

Active Member
Newcomer
Joined
Feb 23, 2017
Messages
35
Trophies
0
Age
39
XP
98
Country
France
I'm working on a switch emulator since beginning of october.
After checking the code, I think I am in a more advanced state.
Just by example :

u32 ARM_Unicorn::GetVFPReg(int /*index*/) const {
UNIMPLEMENTED();
return {};
}

void ARM_Unicorn::SetVFPReg(int /*index*/, u32 /*value*/) {
UNIMPLEMENTED();
}

So, they don't have an implementation for the VFP...
It took me more than a month to implement a functionnal VFP (but not full), and some opcodes are really harsh to emulate, as ARMv8 is compliant with IEEE 754, but has some extra features...
Today, I'm able to run the majority of dumps inside the main function (which calls nnMain). (So I successfully pass .INIT and .INIT_ARRAY sections).
I have found some fields explanation.
For example, for the thread context, (http://switchbrew.org/index.php?title=Thread_Local_Storage), offset 0x08 is a pointer to the next Thread (threads must be chained link in one way or another). This information has been updated 2 days ago, but is incomplete. At offset 0x1C8, it is a reference to the Main Thread (the information is not yet filled on switchbrew). In fact, it's the only way to pass some code in Zelda BOTW and other games. I don't know how to contribute to switchbrew...
I have some problems with the memory manager. Every call to malloc/calloc leads to a null pointer, but I don't find a symbol to fill in the symbol tables. So I will try to overwrite the calls to these functions. (Zelda BOTW doesn't do dynamic allocations in INIT/INIT_ARRAY sections, so for this game I'm going to nnMain).

I expect to be able to get the first screen in one month or two...

For Yuzu, I really think the first release is too soon, the code looks really garbage... (lots of dead code, too many unimplemented things, etc..., but the code of Citra is not really good too, the emulator still runs at low speed for too many games).
Also, I'm seraching help to understand TLS_DESC relocation, I have relocated the first u64 with the function name, but I don't know what to do with the second u64. (ARM document "IHI0056B_aaelf64.pdf" is not really explicit). It concerns only a few games.

Sorry for my bad english though!

Regards,
F
 

gdkchan

Well-Known Member
Member
Joined
Jul 8, 2015
Messages
181
Trophies
0
Age
26
XP
425
Country
Brazil
I'm working on a switch emulator since beginning of october.
...
F

You shouldn't be relocating the NSO binaries yourself, the relocation/linking work is done by rtld. You only really need to start running rtld at 0x0, and it should relocate/link everything, as long your cpu is stable enough and svcQueryMemory is working correctly (since rtld uses that to find the segments on memory). Also not nice calling someone else code gargabe. I think its good to release it at the current stage to get as much help as possible.
 

Nezztor

Well-Known Member
Member
Joined
Nov 8, 2016
Messages
488
Trophies
0
XP
1,338
Country
Mexico
Damn, first homebrew appears in the wild, then TX announces they have something in store, then fail0verflow too, this week a kernelhax and possible compatibility for all FW...
AND NOW THIS?!

Man, I wonder if Miyamoto can even sleep at night lately with all these wonderful things being released for the Switch, seeing how their so called most secure system to date got fucked up the ass. lol

And wait for pokemon or metroid release, they will destroy all security to the point we will have a new 3ds with HD graphics
 

yardie

Banned!
Banned
Joined
Mar 27, 2016
Messages
1,334
Trophies
1
XP
1,549
Country
United States
What is this name YUZU? Can somebody explain me?
You could have googled it to figure it out. Why don't people like to use their heads nowadays???

Citrus junos or yuzu is a citrus fruit and plant in the family Rutaceae. It is called yuja in Korean cuisine context. Both Japanese yuzu and Korean yuja are cognates of Chinese yòuzi, but the Chinese word means pomelo.
 
  • Like
Reactions: Edgy_Edge

Edgy_Edge

Well-Known Member
Member
Joined
Apr 2, 2017
Messages
186
Trophies
0
XP
313
Country
Uganda
You could have googled it to figure it out. Why don't people like to use their heads nowadays???

Citrus junos or yuzu is a citrus fruit and plant in the family Rutaceae. It is called yuja in Korean cuisine context. Both Japanese yuzu and Korean yuja are cognates of Chinese yòuzi, but the Chinese word means pomelo.
From the name YUZU I couldn't even imagined it's a fucking lemon. I'd prefer something NX related.
 
  • Like
Reactions: spotanjo3

Hurtz007

Well-Known Member
Newcomer
Joined
Aug 22, 2015
Messages
95
Trophies
0
Age
29
XP
312
Country
United States
Dayum!... Looks like I know what to download after I'm done moving... Yuzu + rainway streaming to switch = SWITCHCEPTION!
 

Furoryan

Active Member
Newcomer
Joined
Feb 23, 2017
Messages
35
Trophies
0
Age
39
XP
98
Country
France
You shouldn't be relocating the NSO binaries yourself, the relocation/linking work is done by rtld. You only really need to start running rtld at 0x0, and it should relocate/link everything, as long your cpu is stable enough and svcQueryMemory is working correctly (since rtld uses that to find the segments on memory). Also not nice calling someone else code gargabe. I think its good to release it at the current stage to get as much help as possible.
I have written my own minimal dynamic linker... So no rtld for me.
But I have found the code of rtld of FreeBSD : https://svnweb.freebsd.org/base/sta...lf/aarch64/reloc.c?view=markup&pathrev=317189

static void
188 reloc_tlsdesc(Obj_Entry *obj, const Elf_Rela *rela, Elf_Addr *where)
189 {
190 if (ELF_R_SYM(rela->r_info) == 0) {
191 where[0] = (Elf_Addr)_rtld_tlsdesc;
192 where[1] = obj->tlsoffset + rela->r_addend;
193 } else {
194 where[0] = (Elf_Addr)_rtld_tlsdesc_dynamic;
195 where[1] = (Elf_Addr)reloc_tlsdesc_alloc(obj, rela);
196 }
197 }
I have a rela->r_info which leads to a symbol with ST_TYPE=6 (that is, a TLS symbol). I have copied the address of the function to my equivalent of where[0]. But I don't know what is exactly where[1]. It seems to be NSO dependant (the obj). From what I have understand, the function generates an unique offset number to the TLS storage. And where[1] is the place for the argument to the function???


Sorry to have said "garbage", but their code really appears to me as a copy/paste from the citra code..., and it also emulates nothing...! I think a lot of people will said "Yeah, it's super, I can play SMO on my PC", and be deceived just after trying to emulate a homebrew...
I have started my project from scratch, and I think it's clearly better to understand everything (I must admit have copied some code from Mephisto, for the system calls).
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
  • Quincy @ Quincy:
    Usually when such a big title leaks the Temp will be the first to report about it (going off of historical reports here, Pokemon SV being the latest one I can recall seeing pop up here)
  • K3Nv2 @ K3Nv2:
    I still like how a freaking mp3 file hacks webos all that security defeated by text yet again
  • BigOnYa @ BigOnYa:
    They have simulators for everything nowdays, cray cray. How about a sim that shows you playing the Switch.
  • K3Nv2 @ K3Nv2:
    That's called yuzu
    +1
  • BigOnYa @ BigOnYa:
    I want a 120hz 4k tv but crazy how more expensive the 120hz over the 60hz are. Or even more crazy is the price of 8k's.
  • K3Nv2 @ K3Nv2:
    No real point since movies are 30fps
  • BigOnYa @ BigOnYa:
    Not a big movie buff, more of a gamer tbh. And Series X is 120hz 8k ready, but yea only 120hz 4k games out right now, but thinking of in the future.
  • K3Nv2 @ K3Nv2:
    Mostly why you never see TV manufacturers going post 60hz
  • BigOnYa @ BigOnYa:
    I only watch tv when i goto bed, it puts me to sleep, and I have a nas drive filled w my fav shows so i can watch them in order, commercial free. I usually watch Married w Children, or South Park
  • K3Nv2 @ K3Nv2:
    Stremio ruined my need for nas
  • BigOnYa @ BigOnYa:
    I stream from Nas to firestick, one on every tv, and use Kodi. I'm happy w it, plays everything. (I pirate/torrent shows/movies on pc, and put on nas)
  • K3Nv2 @ K3Nv2:
    Kodi repost are still pretty popular
  • BigOnYa @ BigOnYa:
    What the hell is Kodi reposts? what do you mean, or "Wut?" -xdqwerty
  • K3Nv2 @ K3Nv2:
    Google them basically web crawlers to movie sites
  • BigOnYa @ BigOnYa:
    oh you mean the 3rd party apps on Kodi, yea i know what you mean, yea there are still a few cool ones, in fact watched the new planet of the apes movie other night w wifey thru one, was good pic surprisingly, not a cam
  • BigOnYa @ BigOnYa:
    Damn, only $2.06 and free shipping. Gotta cost more for them to ship than $2.06
    +1
  • BigOnYa @ BigOnYa:
    I got my Dad a firestick for Xmas and showed him those 3rd party sites on Kodi, he loves it, all he watches anymore. He said he has got 3 letters from AT&T already about pirating, but he says f them, let them shut my internet off (He wants out of his AT&T contract anyways)
  • K3Nv2 @ K3Nv2:
    That's where stremio comes to play never got a letter about it
  • BigOnYa @ BigOnYa:
    I just use a VPN, even give him my login and password so can use it also, and he refuses, he's funny.
  • BigOnYa @ BigOnYa:
    I had to find and get him an old style flip phone even without text, cause thats what he wanted. No text, no internet, only phone calls. Old, old school.
  • Psionic Roshambo @ Psionic Roshambo:
    @BigOnYa, Lol I bought a new USB card reader thing on AliExpress last month for I think like 87 cents. Free shipping from China... It arrived it works and honestly I don't understand how it was so cheap.
    +1
    Psionic Roshambo @ Psionic Roshambo: @BigOnYa, Lol I bought a new USB card reader thing on AliExpress last month for I think like 87... +1