Homebrew CitrAGB - 3DS GBA Emulator (WIP)

hippy dave

BBMB
Member
Joined
Apr 30, 2012
Messages
9,912
Trophies
2
XP
29,743
Country
United Kingdom
Great work mate, it's looking awesome. Guru Logic Champ is now running at a playable speed in-game. It's just the in-between bits that lag, the dreaded level-complete screen takes ages! Once we can auto-frameskip tho I'm sure it will be all good.
 

kane159

Well-Known Member
Member
Joined
May 28, 2013
Messages
215
Trophies
1
Age
35
XP
1,244
Country
Taiwan
Alpha transparency has strange coloration at the moment, not sure why, but that's probably it. And the X button I already said doesn't work (for now). Just eject the cart to exit while I get that figured out.
ohh now i see that :P not paying attention before :P anyway,most of game i play is almost playable 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
Crashes :(
I've put the .3dsx file into root/3ds-> Start -> Back to 3DS Homescreen
Make sure you have Ninjhax 1.1 or 1.1b, otherwise it will crash immediately after launching. The client checks for ninjhax first, and then if you have ninjhax it will run a small test to make sure it can execute in the translation buffers. If this test fails, it will crash, because it will be executing code in normally non-executable areas which probably weren't set executable due to older ninjhax versions. Also make sure you have your gba_bios.bin where it should be.


I really like it but there appears to be no sound, and there is no way to pick a different game or go back to the Homebrew Launcher once you've selected a game- The former might be harder to implement, but can you add the latter?

Sound I'm definitely working on next, because it's a good way to gauge speeds in-game vs just looking at it. And as of now, no, you can't return to select different games. Basically the issue is that with the stack pointer fix I did earlier it makes it a bit tricky to return at all, so it'll need some work before I can return at least to the homebrew launcher safely.


Hopefully it'll become much more functional in the future.
With the dynrec core out of the way, functionality is next in line for fixing. My current plan of action is getting sound working, then returning back to the menu, then saves, save states, pausing the game to select another game, and all the other stuff in gpsp I left out for now.
 

Kazanye

Member
Newcomer
Joined
Nov 30, 2014
Messages
12
Trophies
0
Age
39
XP
55
Country
France
Hey man. Thank you so much for all your efforts towards proper GBA emulation on the 3DS. I've tried CitrAGB today and I was amazed to see that KuruKuruKururin was playable ! At first, I didn't understand why CitrAGB crashed when I tried to open my GBA rom folder, so I just copied the rom file to root folder, shortened the name to a few character, and it launched properly. Just one thing weird: during the game, it felt like the game was slowing down when I moved diagonally, compared to when I moved in straight lines.

With the dynrec core out of the way, functionality is next in line for fixing. My current plan of action is getting sound working, then returning back to the menu, then saves, save states, pausing the game to select another game, and all the other stuff in gpsp I left out for now.

Dynrec really is a big improvement. Although I think you should implement saves and game select next. It would make it easier for us to track bugs and such. What do you think ?
 

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
Just updated the .3dsx so that you can properly exit while in dynrec mode. Makes going between games a bit easier now, although a mid-game menu still needs to be added. I'll probably move the menu button to a touch screen tap and let X and Y be rebound to whatever buttons the user wants once that is done. But if you're doing any sort of bug seeking or whatever, I'd definitely recommend redownloading.
 

kraan

Well-Known Member
Newcomer
Joined
Dec 12, 2014
Messages
84
Trophies
0
Age
33
Location
Merowe
Website
www.matsindia.wordpress.com
XP
85
Country
Just updated the .3dsx so that you can properly exit while in dynrec mode. Makes going between games a bit easier now, although a mid-game menu still needs to be added. I'll probably move the menu button to a touch screen tap and let X and Y be rebound to whatever buttons the user wants once that is done. But if you're doing any sort of bug seeking or whatever, I'd definitely recommend redownloading.


Awesome, I was tired of testing 1 game and rebooting my 3Ds ;D

Game speed has improved, although some titles are still not really playable. Great job so far, looking forward to new updates!
 

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
Awesome, I was tired of testing 1 game and rebooting my 3Ds ;D

Game speed has improved, although some titles are still not really playable. Great job so far, looking forward to new updates!

Yeah, I've noticed a lot of titles are not really all that playable just going through some of the personal ones I've gotten picked out for testing. Kinda sucks but there's not a whole lot I can do in some areas, although I can certainly try to optimize things the best I can and get that all working nicely.

Aside from that, it seems I'm on a rather nice roll for improvements today. After a long day of messing with things it seems I've finally managed to get the sound working. I had to rewrite quite a bit of things in regards to how it streams to the speakers, mostly because it was designed to be used with SDL not CSND. Either way, the .3dsx is updated for sound now. Due to the nature of how the sound is outputted, if the game does not run 100% speed there will be gaps between sample ouputs. So the audio itself might make it appear that the game is running at full speed, however, there will be large gaps in the sound depending on how fast the emulator is actually going. I might try to thread sound sometime soon so that I can just stream it with fewer samples at a time and not lag the main thread, but for now I'll make due with what I have. And just as a proof of concept for sound (for those who want to play around with a full speed demo w/ sound), I have a working demo file here for testing. It's a small homebrew demo I made a while back which streams several LZ77 compressed frames as a video sequence along with some sound, and luckily on CitrAGB it runs full speed, and is a rather excellent demo for sound at the moment.

TLDR; Get the .3dsx from the main post and test this GBA homebrew if you want to hear what sound sounds like at full speed
 

gbazone

Well-Known Member
Member
Joined
Jun 6, 2014
Messages
212
Trophies
0
XP
713
Country
I tried Advance Wars on the latest build this morning and It was painfully slow - I believe because of the background scaling and rotating effect (mode 7?). Also, I could only get the ROM to load from the root of the SD card, whenever I tried to go into /gba it froze Cubic Ninja and kicked me back to the 3ds menu, which I hadn't seen before. Anyway, keep up the great work, this shows a ton of promise!
 

kraan

Well-Known Member
Newcomer
Joined
Dec 12, 2014
Messages
84
Trophies
0
Age
33
Location
Merowe
Website
www.matsindia.wordpress.com
XP
85
Country
While speed has definitely improved, the Emulator seems to crash every now and then. It sends me straight back to the Home Menu and reboots after. This has been happening with Golden Sun and Advance Wars. (haven't tested out any others on 1.1.b)

Keep up the great job.
 

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 tried Advance Wars on the latest build this morning and It was painfully slow - I believe because of the background scaling and rotating effect (mode 7?). Also, I could only get the ROM to load from the root of the SD card, whenever I tried to go into /gba it froze Cubic Ninja and kicked me back to the 3ds menu, which I hadn't seen before. Anyway, keep up the great work, this shows a ton of promise!
Mode 7 might be part of it, but larger games with a lot more subroutines will lag a lot more due to invalidating the cache a LOT more often than simpler games. Also, note taken, not sure what the deal is with folders tbh, but I'll look into it.


I also can't load from folders any more.
Note taken, didn't change anything with folders lately but I might have done something to cause it to error.


While speed has definitely improved, the Emulator seems to crash every now and then. It sends me straight back to the Home Menu and reboots after. This has been happening with Golden Sun and Advance Wars. (haven't tested out any others on 1.1.b)

Keep up the great job.

Golden Sun is notirous for being problematic with dynrecs due to self-modifying code, although that *shouldn't* be an issue with the current dynrec. Not sure about Advance Wars though. It might just be that both are very large games (I know Golden Sun is a VERY large game, about 16MB or 32MB IIRC), and the current reallocated stack is being overflown as well. Might just double the stack for good measure if that's the case.

EDIT:
Also, just fixed game config loading as well as saving (as a result of the game config fix as well as file writing fixes). New .3dsx is in the main post as usual, and you will also need a game_config.txt file in the root of your SD card. You can find one from my GitHub here or you can find one other places as well. Basically it just lets gpsp know which save type to use and whether or not to enable RTC support for that game.
 

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
Just to be curious, how much average speed increase gave the dynarec to games?
Depends on the game really. Games and homebrew with a small main loop (ie the demo in my main post) will run at full speed, even with audio. Games like Pokemon, Golden Sun, and Advanced wars with really large code bases with lots of subroutines will run sluggish, around 60-70% speed. It will likely get better once I add HW video vs software rendering, but I also need smea to update (if he can) his cache invalidation function to allow me to specify the areas to invalidate, since that code seems to be taking a rather large chunk of time in the dynrec loop unfortunately. So it's faster than interpretation, just not full speed yet.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    K3Nv2 @ K3Nv2: https://www.amazon.com/gp/product/B09ZLRDMXX/ref=ox_sc_act_title_1?tag=slickdeals09-20&ascsubtag=...