Homebrew CitrAGB - 3DS GBA Emulator (WIP)

Roazer

Active Member
Newcomer
Joined
Sep 6, 2015
Messages
39
Trophies
0
Age
24
XP
82
Country
Netherlands
No idee, because i dont realy have that problem fire red runs almost perfectly for me on mgba (n3ds, 10.0.0-27E, ironhax, latest nightly ). EDIT: are you sure you are using mgba? Since this is citragb thread, just asking to be sure.
Well i have citrGBA and mGBA but i used mGBA. citrGBA crases FireRed.

(Btw het is niet idee je schrijft idea ;))
 

Roazer

Active Member
Newcomer
Joined
Sep 6, 2015
Messages
39
Trophies
0
Age
24
XP
82
Country
Netherlands
Well then its the 3ds, from what most have reported the o3ds is somewhat slow EDIT: with mgba EDIT END:

(en ja ik haal de twee talen well eens door mekaar)
Ok so il just wait then on a New Update of the Emulators then...

(lol)
 

shinyquagsire23

SALT/Sm4sh Leak Guy
OP
Member
Joined
Nov 18, 2012
Messages
1,977
Trophies
2
Age
26
Location
Las Vegas
XP
3,765
Country
United States
So did you get it to work as a CIA? I just tried to build it (from the github source) and I get an "an error has occurred" after the "3DS" boot animation.

EDIT: I did what aliaspider suggested in that comment (the cheapest and most certainly worst option, reduced ROM_TRANSLATION_CACHE_SIZE to 2MB) and now the emu works, hehe

It sure feels great to have a fast GBA emulator in a installable CIA!
But for some reason dynarec works only under rxTools' devmode (or isn't compatible with my 9.9 emunand).
There's also an error message after we close it (via "X"), just like what happens to Micro SD Management.
Ooh, I actually just saw that comment (school sucks and I forget to check things). If nobody has made a PR I'll go ahead and fix that. One question though, by it only working in RxTools, do you mean it fails in GW's firmware? If that's the case, then there's a good chance they block 0x7B access, or the RSF isn't configured properly and RxToole just grants access to all SVCs.
 

piratesephiroth

I wish I could read
Member
Joined
Sep 5, 2013
Messages
3,453
Trophies
2
Age
103
XP
3,234
Country
Brazil
Ooh, I actually just saw that comment (school sucks and I forget to check things). If nobody has made a PR I'll go ahead and fix that. One question though, by it only working in RxTools, do you mean it fails in GW's firmware? If that's the case, then there's a good chance they block 0x7B access, or the RSF isn't configured properly and RxToole just grants access to all SVCs.
I mean it doesn't work on rxTools emunand. I didn't actually try on GW yet (rxTools is so much easier :rofl2:).
(I edited the RSF and added ControlProcessMemory to the allowed system calls before building it)
 
Last edited by piratesephiroth,

shinyquagsire23

SALT/Sm4sh Leak Guy
OP
Member
Joined
Nov 18, 2012
Messages
1,977
Trophies
2
Age
26
Location
Las Vegas
XP
3,765
Country
United States
I mean it doesn't work on rxTools emunand. I didn't actually try on GW yet (rxTools is so much easier :rofl2:).
(I edited the RSF and added ControlProcessMemory to the allowed system calls before building it)
I wasn't aware that devmode and emuNAND were separate. In any case I might try that with my own devices and see how it goes. Maybe it'll also fix an experiment I was trying to conduct with ninjhax2 and dynrec.
 

piratesephiroth

I wish I could read
Member
Joined
Sep 5, 2013
Messages
3,453
Trophies
2
Age
103
XP
3,234
Country
Brazil
I wasn't aware that devmode and emuNAND were separate. In any case I might try that with my own devices and see how it goes. Maybe it'll also fix an experiment I was trying to conduct with ninjhax2 and dynrec.
And yeah, GW blocks it. Always on interpret mode, both on emunand and sysnand.
As a bonus, the emulator freezes the 3DS when we close it with the X button..
 

JJTapia19

I fight for my friends.
Member
Joined
May 31, 2015
Messages
2,171
Trophies
1
Age
32
XP
2,438
Country
Puerto Rico
And yeah, GW blocks it. Always on interpret mode, both on emunand and sysnand. As a bonus, the emulator freezes the 3DS when we close it with the X button..
Would the problem be firmLaunch? That's the thing devmode disables and gateway mode always have enabled. I bealive reinand doesn't have it so someone could test it in reinand emunand. I would do it but I'm not home :/
 

shinyquagsire23

SALT/Sm4sh Leak Guy
OP
Member
Joined
Nov 18, 2012
Messages
1,977
Trophies
2
Age
26
Location
Las Vegas
XP
3,765
Country
United States
Would the problem be firmLaunch? That's the thing devmode disables and gateway mode always have enabled. I bealive reinand doesn't have it so someone could test it in reinand emunand. I would do it but I'm not home :/
No, it's an issue of GW trying to protect the ARM11 kernel portion of their code (and preventing easy privilege escalation for ARM9 to potentially dump that). Which sucks because now CitrAGB as a .cia will only work on other CFWs.

Also I'm working on pushing changes at the moment, it'll be a bit. Might actually bother fixing the sound file now too...
 

piratesephiroth

I wish I could read
Member
Joined
Sep 5, 2013
Messages
3,453
Trophies
2
Age
103
XP
3,234
Country
Brazil
No, it's an issue of GW trying to protect the ARM11 kernel portion of their code (and preventing easy privilege escalation for ARM9 to potentially dump that). Which sucks because now CitrAGB as a .cia will only work on other CFWs.

Also I'm working on pushing changes at the moment, it'll be a bit. Might actually bother fixing the sound file now too...
Just tested it on rxTools' sysnand and it stuck in interpreter mode too. Only works in devmode indeed.

Now either it's blocked or adding ControlProcessMemory to the allowed sys calls isn't enough.
Could it be something related to CitrAGB relying on that libkhax thing to get kernel access? (no idea if that's active outside of the homebrew menu environment)
 

aliaspider

Well-Known Member
Member
Joined
Apr 14, 2015
Messages
344
Trophies
0
XP
1,358
Country
Tunisia
I simply call this https://github.com/libretro/gpsp/blob/master/3ds/3ds_utils.c#L9-L19. with svcbackdoor from rxtool normal mode to get acces to ControlProcessMemory from a cia.
for some reason svcbackdoor can be made available with the rsf but not ControlProcessMemory, so I used that to overwrite the thread svc access control and it worked nicely, no need to start in devmode.
 

piratesephiroth

I wish I could read
Member
Joined
Sep 5, 2013
Messages
3,453
Trophies
2
Age
103
XP
3,234
Country
Brazil
I simply call this https://github.com/libretro/gpsp/blob/master/3ds/3ds_utils.c#L9-L19. with svcbackdoor from rxtool normal mode to get acces to ControlProcessMemory from a cia.
for some reason svcbackdoor can be made available with the rsf but not ControlProcessMemory, so I used that to overwrite the thread svc access control and it worked nicely, no need to start in devmode.
I'm gonna try right now. Or actually not right now.. gonna have to go do something else.
 
Last edited by piratesephiroth,

shinyquagsire23

SALT/Sm4sh Leak Guy
OP
Member
Joined
Nov 18, 2012
Messages
1,977
Trophies
2
Age
26
Location
Las Vegas
XP
3,765
Country
United States
OK, I fixed up CitrAGB for .cia. @piratesephiroth, I found that my 9.6 kver was incorrect for 9.6 when testing on my o3DS, so perhaps that is what caused the issues with GW. The N3DS offsets are somewhat inferred from the differences in the o3DS FIRM, but I don't think anyone will be using those anyhow. 10.0 isn't supported yet, although I'll go ahead and check this out really quick. There is also now only one binary which should work across ninjhax1 and ninjhax2, ninjhax2 currently has kernel mode disabled due to libkhax still not working. I added .cia install instructions to the main post for those who need it.

For testing, I'd love to see if it works across different CFWs, including GWs. If it works (or doesn't), feel free to let me know.

EDIT: Also just fixed the audio, so now that's working fine.
 
Last edited by shinyquagsire23,

piratesephiroth

I wish I could read
Member
Joined
Sep 5, 2013
Messages
3,453
Trophies
2
Age
103
XP
3,234
Country
Brazil
OK, I fixed up CitrAGB for .cia. @piratesephiroth, I found that my 9.6 kver was incorrect for 9.6 when testing on my o3DS, so perhaps that is what caused the issues with GW. The N3DS offsets are somewhat inferred from the differences in the o3DS FIRM, but I don't think anyone will be using those anyhow. 10.0 isn't supported yet, although I'll go ahead and check this out really quick. There is also now only one binary which should work across ninjhax1 and ninjhax2, ninjhax2 currently has kernel mode disabled due to libkhax still not working. I added .cia install instructions to the main post for those who need it.

For testing, I'd love to see if it works across different CFWs, including GWs. If it works (or doesn't), feel free to let me know.

EDIT: Also just fixed the audio, so now that's working fine.
All right. I"ll test it in a few hours. (Not at home right now)
 

shinyquagsire23

SALT/Sm4sh Leak Guy
OP
Member
Joined
Nov 18, 2012
Messages
1,977
Trophies
2
Age
26
Location
Las Vegas
XP
3,765
Country
United States
OK I added offsets for 10.0.0, definitely should work for o3DS, no idea on N3DS because I can't exactly test that :P

There's a new download for both 3dsx and cia for that. Probably will fix the GW issues, provided you're on the latest version of their stuff. Their kernel spoofing could very well throw things off though because that's kinda what I check.

Tried the CitraGB .cia on my N3DS. Works, but is VERY slow. Runs with Interpret.

System version?
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    K3Nv2 @ K3Nv2: Stop doing drugs