Homebrew [WIP] 3DeSmume (DS emulator for 3DS)

Hikari06

Well-Known Member
Member
Joined
Nov 20, 2012
Messages
999
Trophies
0
XP
936
Country
Ecuador
This looks like an interesting project but although I might sound stupid since I've never really worked on any emulator, I was wondering why you are using a recompiler (may it be dynamic or not) considering that the Nintendo DS is using the same architecture as the Nintendo 3DS, that is ARM. As far as I know, the instruction set should be the same and recompilation should not be required. I do understand that a compatibilty layer must be written in order to redirect the inputs and the outputs properly and manage the memory but this would definitely be way faster than recompilation.
 
Last edited by Hikari06,

Apache Thunder

I have cameras in your head!
Member
Joined
Oct 7, 2007
Messages
4,434
Trophies
3
Age
36
Location
Levelland, Texas
Website
www.mariopc.co.nr
XP
6,815
Country
United States
Nintendo DS graphics and slot-1 commands are handled on Arm9 and hardware calls like wifi and security by arm7. Arm7 is turned off in CTR mode and Arm9 is busy doing security stuff while in CTR mode so you can't use Arm9 for anything since it's busy running Process9. (and this process handles all filesystem and crypto calls, so you can't exactly retask it without crashing the system)

So Arm11 must be used. Arm11 is not quite the same as Arm9 so making DS games run on Arm11 is not a cake walk. While similar there's a lot more differences under the hood that would present a lot of problems.
 
Last edited by Apache Thunder,

Hector_of_Troy

Well-Known Member
Member
Joined
Feb 9, 2016
Messages
146
Trophies
0
XP
135
Country
Italy
Nintendo DS graphics and slot-1 commands are handled on Arm9 and hardware calls like wifi and security by arm7. Arm7 is turned off in CTR mode and Arm9 is busy doing security stuff while in CTR mode so you can't use Arm9 for anything since it's busy running Process9.

So Arm11 must be used. Arm11 is not quite the same as Arm9 so making DS games run on Arm11 is not a cake walk. While similar there's a lot more differences under the hood that would present a lot of problems.
Wouldn't making the emulator an arm9 payload allow us to get to the arm9 and arm7's set of instructions as CTR mode hasn't started yet?
 

Apache Thunder

I have cameras in your head!
Member
Joined
Oct 7, 2007
Messages
4,434
Trophies
3
Age
36
Location
Levelland, Texas
Website
www.mariopc.co.nr
XP
6,815
Country
United States
Yeah you could code a Arm9 payload of some kind and maybe init arm7 too. Arm7 isn't normally active in CTR mode so no telling if it can work. But Arm11 could be tasked with emulating some of the things Arm7 did. But that depends on what hardware Arm11 can access.

Not sure how much you can have Arm9 do. Arm9 in CTR mode normally handles files system stuff. I believe SD/NAND access in CTR mode is governed by arm9 (though maybe Arm11 could access Wifi). I don't know if Arm11 could ever be made to access SD directly. If not, then init of Arm7 could be important to getting all of this to work. Trying to multitask Arm9 to handle all the hardware calls + running the DS game is probably not a good idea. Though one plus is that in CTR mode Arm9 has access to slot-1 I believe and DS games use Arm9 for slot-1 stuff. (for DSi, Arm7 was used for SD I think?)

I doubt Arm9 runs much faster in CTR mode then it does in NTR/TWL mode. It is legacy hardware afterall. It's only purpose in CTR mode was low level security stuff. It doesn't have to run as fast as Arm11.

I don't know what clock speed it runs at in CTR mode actually. It may not change clockspeeds at all actually and run the same speed as DSi mode. It only would downclock for GBA and NTR modes.
 
Last edited by Apache Thunder,
D

Deleted User

Guest
tumblr_mvp734zzHR1rwcupjo2_400.gif
 

Swiftloke

Hwaaaa!
Member
Joined
Jan 26, 2015
Messages
1,772
Trophies
1
Location
Nowhere
XP
1,506
Country
United States
@Apache Thunder @Hector_of_Troy I hope you guys know that you are just describing TWL_FIRM. This is just a port of DeSmuME and you can't compare it to re-implementing or reverse engineering TWL_FIRM.
You do realize exactly how hard it is to mess with TWL-FIRM at all, right? Ask @MarcusD.
Noone likes it when someone else says "Eh but you can do it this way its simple". It's. Not. Simple.
 

I_AM_L_FORCE

Unban me from Discord
Member
Joined
Feb 19, 2015
Messages
1,064
Trophies
0
Age
23
Location
London
XP
1,537
Country
United Kingdom
@Apache Thunder @Hector_of_Troy I hope you guys know that you are just describing TWL_FIRM. This is just a port of DeSmuME and you can't compare it to re-implementing or reverse engineering TWL_FIRM.
He was talking about the hardware involved and clockspeeds of said arm processors, and what hardware they can access. He was saying what would theoretically be needed for an arm9 payload, not TWL implementation afaik
 

Sono

cripple piss
Developer
Joined
Oct 16, 2015
Messages
2,827
Trophies
2
Location
home
XP
9,389
Country
Hungary

Apache Thunder

I have cameras in your head!
Member
Joined
Oct 7, 2007
Messages
4,434
Trophies
3
Age
36
Location
Levelland, Texas
Website
www.mariopc.co.nr
XP
6,815
Country
United States
Yes you could implement arm9 payload or re-implement TWL_FIRM. NEITHER of which would be easy by any stretch of the imagination. Your better off waiting for this Desmume port to get full speed as I'm sure it may achieve that at some point. Definitely before anyone manages to modify/re-implement TWL_FIRM or create a custom arm9 payload for psuado TWL emulation.
 
D

Deleted User

Guest
@Apache Thunder
Awesome writes dude!

By the way, I was told from a very credible source that the original factory AGB or TWL firm has access to the SD/has access to load roms off the SD. Is this true?

If you'd like, I can send you the conversation that was held on discord about it... Thanks for everything sir!
 

Sono

cripple piss
Developer
Joined
Oct 16, 2015
Messages
2,827
Trophies
2
Location
home
XP
9,389
Country
Hungary
@Apache Thunder
Awesome writes dude!

By the way, I was told from a very credible source that the original factory AGB or TWL firm has access to the SD/has access to load roms off the SD. Is this true?

If you'd like, I can send you the conversation that was held on discord about it... Thanks for everything sir!

Well, even if it has access to SD, we can't play DS games installed as cia, because I doubt TWL_FIRM touches the code at all other than copying it to memory and jumping to it. Since DS games access the card slot, and TWL_FIRM kinda just acts as a loader, it's not possible to redirect the card slot to anything else, because that would require HARDWARE MODIFICATION to the system to be even possible at all.
 
D

Deleted User

Guest
Well, even if it has access to SD, we can't play DS games installed as cia, because I doubt TWL_FIRM touches the code at all other than copying it to memory and jumping to it. Since DS games access the card slot, and TWL_FIRM kinda just acts as a loader, it's not possible to redirect the card slot to anything else, because that would require HARDWARE MODIFICATION to the system to be even possible at all.
Not saying that we'd take that approach of it. We don't even know HOW Nintendo loaded these roms- but supposively it was possible with the factory TWL or AGB firm.

It would not require a hardware modification but it would probably require a redNand or A9LH to allow for non-official firms to be installed.

If this is true, I believe that Nintendo used some sort of ROM selector kind of set up like how test menu is set up
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Psionic Roshambo @ Psionic Roshambo: I hate when there is a line at the gang bang