Homebrew WIP Experimental Switch emulator in C#

emmauss

Well-Known Member
Member
Joined
May 12, 2014
Messages
522
Trophies
0
Age
28
Location
Accra, Ghana
XP
2,503
Country
Ghana
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]
join the discord group, it is much easily to chat there.
 

AdamN

Active Member
Newcomer
Joined
Jul 29, 2011
Messages
39
Trophies
0
Location
On the Net
Website
Visit site
XP
216
Country
Indonesia
the code. it is not that difficult to understand. just make sure your c# is good.
For emulation, he will need at least to have a basic knowledge of how a CPU worked, and how devices communicate (I/O & memory map), also how API/HLE worked, right? :D
A good reading for this is probably the Tegra X1 Technical Reference Manual (TRM) or it's datasheet

While for the programming language it self, he just need to know how to make an efficient and optimal code, and in the case of multi-threaded also need to know about race-condition/deadlock too :)
 
Last edited by AdamN,

emmauss

Well-Known Member
Member
Joined
May 12, 2014
Messages
522
Trophies
0
Age
28
Location
Accra, Ghana
XP
2,503
Country
Ghana
For emulation, he will need at least to have a basic knowledge of how a CPU worked, and how devices communicate (I/O & memory map), also how API/HLE worked, right? :D
A good reading for this is probably the Tegra X1 Technical Reference Manual (TRM) or it's datasheet

While for the programming language it self, he just need to know how to make an efficient and optimal code, and in the case of multi-threaded also need to know about race-condition/deadlock too :)
that is setting the level a bit to high, with the tegra reference sheet. we are currently focusing more on the hle aspect, ie the services and data types. swtchbrew got enough information about them to get started, we are just lacking tests, and the fact that there are probably less than 5 devs actively working on this. if you got some gpu experience( reading a ref sheet just aint gonna be enough), talk to @gdkchan as that is what he is working on now. otherwise we accept anything decent, well-thought out and working. so read the code first to see what you can do and understand, and chose what you would be focusing on.
 
  • Like
Reactions: AdamN

emmauss

Well-Known Member
Member
Joined
May 12, 2014
Messages
522
Trophies
0
Age
28
Location
Accra, Ghana
XP
2,503
Country
Ghana
unknown.png
Sonic Now runs at full speed on the latest master
 
  • Like
Reactions: NiagA and lordelan

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    BakerMan @ BakerMan: if only it had as much capability/power as i do omw to your mom's place