CitrAGB - 3DS GBA Emulator (WIP)

Discussion in '3DS - Homebrew Development and Emulators' started by shinyquagsire23, Dec 18, 2014.

  1. shinyquagsire23
    OP

    shinyquagsire23 SALT/Sm4sh Leak Guy

    Member
    1,961
    3,231
    Nov 18, 2012
    United States
    Las Vegas
    Greets all,

    So I've been working on a thing for a while. I had originally abandoned the project because I thought it was unable to be done without the use of dynamic recompilation, however as it turns out it was in fact possible. I present my 3DS GBA Emulator: CitrAGB, a 3DS GBA emulator based on gpsp.

    [​IMG]
    [​IMG]

    As of now, compatibility is technically on-par with whatever gpsp's interpreter is able to handle, however, due to the nature of the port some games will not run or crash on particular parts. Flipping the screen to it's proper orientation did a bit of damage which might take a bit to get fixed up, and a lot of things still need implementation. But, on the plus side, many games that do run actually run fairly well, around 50% speed in optimal cases, or as low as 20% if the game uses extremely inefficient idle loops. In the future I also plan on hopefully porting gpsp's dynrec CPU to be able to work on the 3DS as well, once smea updated ninjhax to allow developers to set RAM pages executable. This will increase emulation speed dramatically.

    Controls:
    A, B, Start, Select, L, R, and the D/C-Pad all map out to their rightful GBA buttons. Y is bound to select, and X currently exits back to the homebrew menu

    Sauce Code:
    You can find the source code for CitrAGB on my GitHub here. Once again, this is very much a work in progress and extremely buggy, but the bugs will be fixed and the emulator refined with time. However, if you encounter bugs let me know the game name and when the bug occurs so I have games to test against while fixing bugs.

    Installation Instructions:

    For Ninjhax:
    First, grab the .3dsx here and rename it/place it in sd:/3ds/<name of .3dsx>. You can also grab the smdh here and give it the same name and place it in the same directory as the 3dsx. Next, download game_config.txt from here and a sample homebrew application here to make sure everything is set up right before you run regular GBA ROMs. The last thing you will need is gba_bios.bin. You can either dump this/find this online, or you can use Normatt's open source GBA bios here. A proper GBA bios dump is preferred, Normatt's bios has shown issues with some games. Once you have gba_bios.bin, place it either in the root of your SD card or in /gba.

    For CFW:
    Grab the .cia from here and place it anywhere on your SD card. Use a .cia manager such as FBI, BRM, or DevMen to install it. Next, download game_config.txt from here and a sample homebrew application here to make sure everything is set up right before you run regular GBA ROMs. The last thing you will need is gba_bios.bin. You can either dump this/find this online, or you can use Normatt's open source GBA bios here. A proper GBA bios dump is preferred, although Normatt's bios hasn't shown any issues as of yet. Once you have gba_bios.bin, place it either in the root of your SD card or in /gba.

    After downloading everything, your SD card structure should look something like this:
    game_config.txt
    gba_bios.bin
    demo.gba
    /3ds/<3dsx name>/<3dsx name>.3dsx
    (3dsx only)
    /3ds/<3dsx name>/<3dsx name>.smdh (3dsx only)

    Currently Known Bugs:
    • Any video issues which may arise
    Special Thanks
    Big thanks to Normatt, smea, yellows8 and plutoo for helping me get this working. Probably wouldn't have got anywhere in some places without your help. Special thanks to @aliaspider for pointing out a fix for .cia.
     
    Last edited by shinyquagsire23, Sep 20, 2015


  2. DarkKnightPT

    DarkKnightPT GBAtemp Regular

    Member
    123
    24
    May 18, 2014
    nice, I would like to test it out I really like gpsp, can you post a .cia version of it or 3ds please? Thanks
     
    supermalloch likes this.
  3. Guurak

    Guurak Newbie

    Newcomer
    1
    2
    Dec 5, 2011
    United States
    Does not work for me. I boot up the 3dsx file and 3/4 of the screen turns grey on both screens. Then it boots back to the system menu and restarts.
     
    LinkMain111 and Derfderk like this.
  4. shinyquagsire23
    OP

    shinyquagsire23 SALT/Sm4sh Leak Guy

    Member
    1,961
    3,231
    Nov 18, 2012
    United States
    Las Vegas
    Hm, can't say I've gotten that. Any particular 3DS/system version you're running on? Make sure you've copied the file correctly, it should be 1.2MB in size. On that note, I'll also try re-uploading the .3dsx as well.
     
  5. kane159

    kane159 GBAtemp Regular

    Member
    139
    27
    May 28, 2013
    Taiwan
    me too ,and when i tried to build from source it gaves me this error,donno whats wrong :/

     
  6. shinyquagsire23
    OP

    shinyquagsire23 SALT/Sm4sh Leak Guy

    Member
    1,961
    3,231
    Nov 18, 2012
    United States
    Las Vegas
    Shoot, I forgot a file. Pull the latest changes and try compiling now.
     
  7. kraan

    kraan Advanced Member

    Newcomer
    84
    18
    Dec 12, 2014
    Merowe
    Awesome, I'll be sure to test this out as soon as my copy of QN arrives. Great job.
     
  8. kane159

    kane159 GBAtemp Regular

    Member
    139
    27
    May 28, 2013
    Taiwan
    hummm same error here , maybe git just havent update the file yet, ill try it later
     
  9. Idaho

    Idaho GBAtemp Advanced Fan

    Member
    671
    402
    Oct 3, 2013
    France
    That's great, will we be able to also have it as .cia ? GBA emulation is one of the main goal in term on emulation on the 3DS, let's make it happen :3
     
  10. piratesephiroth

    piratesephiroth I wish I could read

    Member
    2,838
    1,386
    Sep 5, 2013
    Brazil
    I'm getting that same error.
     
  11. ChrisRX

    ChrisRX GBAtemp Fan

    Member
    490
    218
    Nov 8, 2006
    Margen67 likes this.
  12. Joshmas

    Joshmas Advanced Member

    Newcomer
    52
    12
    Dec 18, 2014
    Would anyone be able to post an updated .3dsx file im having issues compiling.
     
  13. shinyquagsire23
    OP

    shinyquagsire23 SALT/Sm4sh Leak Guy

    Member
    1,961
    3,231
    Nov 18, 2012
    United States
    Las Vegas
  14. Xenon Hacks

    Xenon Hacks GBAtemp Guru

    Member
    7,041
    3,347
    Nov 13, 2014
    United States
    Weird I dont even see it in HBL
    Whats the proper pathing for this?
     
  15. Chrisser_75

    Chrisser_75 GBAtemp Regular

    Member
    256
    107
    Dec 12, 2014
    Germany
    Germany
    the .3dsx from here doesn't work. :(
    has someone a working "new" compiled .3dsx?
    #I'mAnoob
     
  16. Shadowtrance

    Shadowtrance GBAtemp Addict

    Member
    2,482
    1,513
    May 9, 2014
    Hervey Bay, Queensland
    Well copying the font1.c from hb menu got past that error with compiling, only to run into another one haha

    All fine until it gets here near the end...

     
  17. titegtnodI

    titegtnodI Advanced Member

    Newcomer
    82
    67
    Nov 25, 2014
    Canada

    Update libctru, gfxSetDoubleBuffering is in libctru\source\gfx.c.
     
  18. Xenon Hacks

    Xenon Hacks GBAtemp Guru

    Member
    7,041
    3,347
    Nov 13, 2014
    United States
    Yeah I get a cut in half black screen
     
  19. Shadowtrance

    Shadowtrance GBAtemp Addict

    Member
    2,482
    1,513
    May 9, 2014
    Hervey Bay, Queensland
    That seemed to have done the trick. :)

    Thought i was up to date, apparently not... haha
     

    Attached Files:

  20. DarkFlare69

    DarkFlare69 GBAtemp Psycho!

    Member
    4,625
    2,456
    Dec 8, 2014
    United States
    Ohio
    Where's the .smdh file? I don't like having homebrew applications that don't have a smdh file. I can make one for you if yoy want.