Homebrew yuzu Nintendo Switch emulator discussion

gdkchan

Well-Known Member
Member
Joined
Jul 8, 2015
Messages
181
Trophies
0
Age
26
XP
425
Country
Brazil
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).

I don't see why you're trying to do the relocation yourself, also freebsd's rtld won't be of much help since the Switch is different. The rtld if part of the ExeFS so every game contains the rtld code, and the right thing to do is running it and leting it do the relocation/calling nnMain. It also needs to call nnInitializeSdkModule (or something like this) before it calls nnMain, and a bunch of other initialization code. Trying to replicate what rtld does on your emulator is just not worth it.

Anyway, I don't think this thread is the place to talk about those technical details. Why don't you join the yuzu discord channel, we can share knowledge there so everyone benefits, you can also reach me on discord if you want and I can try explaining what rtld does in more detail.
 
  • Like
Reactions: hurrz and DaVince

Edgy_Edge

Well-Known Member
Member
Joined
Apr 2, 2017
Messages
186
Trophies
0
XP
313
Country
Uganda
Great job guys! But I think you should give Nintendo at least a small chance to make money on the console. With this emulator we'll never see Metroid Prime 5, because you'll f@cking kill Nintendo)
 

Edgy_Edge

Well-Known Member
Member
Joined
Apr 2, 2017
Messages
186
Trophies
0
XP
313
Country
Uganda
Let me quote you

"My body is ready. If it lets me play Switch roms."

You're a damn hypocrite
Roms on my Switch yes. Because piracy is inevitable. maybe piracy will boost the sales of Switch. But with emulator it'll totally kill it. Or you that kind of person who anyway buys GBA even if you have mGBA on a smartphone?
 

masaki88

Well-Known Member
Member
Joined
Dec 9, 2014
Messages
292
Trophies
0
Age
35
Location
Bor, Novgorodskaya Oblast',
Website
www.youtube.com
XP
213
Country
Russia
Great job guys! But I think you should give Nintendo at least a small chance to make money on the console. With this emulator we'll never see Metroid Prime 5, because you'll f@cking kill Nintendo)
Calm dawn. No one kill switch or nintendo. Emulator still cannot run games and if its happen i realy don t think its will be playable in this year. People who want to play normaly - buy switch. Realy, better play on release great games than wait year or two for free playing thorough emulator. I buy switch and not dissapointed. Switch great console with great games. In future many great games came out and better buy switch to play it. Emulation is good when you cannot buy console but if you have money but wait for emulator its i think shame. Good games cost good moneys and its fair.
 

ShadowOne333

QVID PRO QVO
Editorial Team
Joined
Jan 17, 2013
Messages
12,200
Trophies
2
XP
33,916
Country
Mexico
Roms on my Switch yes. Because piracy is inevitable. maybe piracy will boost the sales of Switch. But with emulator it'll totally kill it. Or you that kind of person who anyway buys GBA even if you have mGBA on a smartphone?
Well Citra didn't stop Nintendo from putting games in it consistenly, did it?
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Xdqwerty @ Xdqwerty: @salazarcosplay, gta v is down since november 2021