Attaching NES and GB roms to emulator core

Discussion in 'NDS - Emulation and Homebrew' started by T.Kuranari, Sep 14, 2011.

Sep 14, 2011
  1. T.Kuranari
    OP

    Member T.Kuranari GBAtemp Regular

    Joined:
    Aug 30, 2011
    Messages:
    150
    Country:
    Japan
    Hi, I want to ask if someone can make a tool which enables a person to attach an NES and a GB/GBC rom to the core of nesDS and lameboy. For reference, perhaps the old SNES emulator SnezziDS is still remembered by some people. Basically with this SNES roms can be converted to NDS files and that's exactly what I want to do with NES and GB/GBC roms.

    1) *.nes + nesDS core (pc tool) ---> *.nds (nes rom embedded)
    2) *.gb + lameboy core (pc tool) ---> *.nds (gb rom embedded)

    Now why the hell do I want that when I simply can choose a rom from the emulator gui?

    Simply because I don't randomly play hundreds of pirated roms, but only a few favourites of mine. Oh, and I like NDS icons in the flash cart guis, especially when you can freely change them [​IMG]

    Thanks.
     


  2. Luigi2012SM64DS

    Banned Luigi2012SM64DS G-old member

    Joined:
    Aug 27, 2011
    Messages:
    2,060
    Location:
    Minecrapt
    Country:
    Canada
    it is possable in nesds but note that this version of nesds is VERY old
    http://sites.google.com/site/danthemanms/n...?attredirects=0
     
  3. T.Kuranari
    OP

    Member T.Kuranari GBAtemp Regular

    Joined:
    Aug 30, 2011
    Messages:
    150
    Country:
    Japan
    Oh, didn't know there is version for nes games available. Hm.. it seems that saving is just work in progress and the overall compatibility and performance is worse than nesDS. Perhaps huiminghao can help me out here [​IMG]
     
  4. avenir

    Member avenir GBAtemp Fan

    Joined:
    Dec 8, 2010
    Messages:
    375
    Country:
    United States
    I can't understand you. Embedding rom file isn't good at all.
    - Use nesDS menu
    or
    - Put nesDS as /moonshl2/extlink/nes.nesDS.nds then select nes in moonshell2
     
  5. T.Kuranari
    OP

    Member T.Kuranari GBAtemp Regular

    Joined:
    Aug 30, 2011
    Messages:
    150
    Country:
    Japan
    I don't mind if you don't understand me [​IMG] No, the point of all of this is not to use nesDS menu. Telling me in this thread I should use nesDS menu shows that you missed the point here. Moonshell is not an option. Thanks for your reply though [​IMG]
     
  6. avenir

    Member avenir GBAtemp Fan

    Joined:
    Dec 8, 2010
    Messages:
    375
    Country:
    United States
    anyway nesDS now has special memory layout, so embedding isn't possible.
    if you cannot accept one of my two options, just use that old version.
     
  7. T.Kuranari
    OP

    Member T.Kuranari GBAtemp Regular

    Joined:
    Aug 30, 2011
    Messages:
    150
    Country:
    Japan
    It's not that I can't accept your two options, it's just that they have absolutely nothing to do with what I want to achieve here, so I can't really consider them to be options [​IMG] It's kinda the same as if a person asks if someone is willing to build him a boat because he wants to travel via the sea route from place A to place B without using his car and then gets the answer, "use your car".
     
  8. Mbmax

    Member Mbmax Homebrew addicted

    Joined:
    Nov 7, 2006
    Messages:
    2,272
    Country:
    Antarctica
    The extlink option is exactly what you need, have you ever tried it ?
    When you copy nes.nesDS.nds into /moonshl2/extlink/ folder every .nes files are launchable directly from moonshell.
    The extlink launch nesDS and run directly the .nes.
     
  9. jurassicplayer

    Member jurassicplayer Completionist Themer

    Joined:
    Mar 7, 2009
    Messages:
    4,280
    Location:
    Pantsuland
    Country:
    United States
    Right, you are talking to one of those people with skill that is there and he just told you that there is a special memory layout in the newer versions of nesDS.
     
  10. T.Kuranari
    OP

    Member T.Kuranari GBAtemp Regular

    Joined:
    Aug 30, 2011
    Messages:
    150
    Country:
    Japan
    This is not exactly what I want. I am not using Moonshell very often and don't want to depend on it. What I want is a way to make a rom and an emulator in one executable, kinda like Nintendos Virtual Console titles with own icons. That's it [​IMG]

    You don't quite get it. With source code freely available everything is possible if it's allowed by the hardware. Meaning if the memory layout doesn't allow it, then just modify the memory layout so that it becomes possible [​IMG]
     
  11. Mbmax

    Member Mbmax Homebrew addicted

    Joined:
    Nov 7, 2006
    Messages:
    2,272
    Country:
    Antarctica
    Hehe. you seems to think it's as simple as write words in a thread to code something.
    Then, here you go ! Grab the source code and don't hesitate to rewrite everything. [​IMG]
     
  12. T.Kuranari
    OP

    Member T.Kuranari GBAtemp Regular

    Joined:
    Aug 30, 2011
    Messages:
    150
    Country:
    Japan
    If I could do this myself, this thread would not exist in the first place. The point of this thread is looking for someone who wants to make it happen and not to argue about whether or not it's possible, how hard it is to achieve or point out alternatives like using extlink/Moonshell [​IMG]
     
  13. T.Kuranari
    OP

    Member T.Kuranari GBAtemp Regular

    Joined:
    Aug 30, 2011
    Messages:
    150
    Country:
    Japan
    Now here comes the fun part. I replaced the nesDS.bin from the old nesDS package with the new nesDS.nds, renamed it to nes.bin and successfully embedded it to a nds file using ndstool. The rom doesn't work with emulators, but it works with flash carts [​IMG] So how could that happen when the memory layout doesn't allow this [​IMG]?

    Now all that is left is a bit fine tuning. I can't access any emulator settings when a rom is launched, so a version with either support for settings or a tool that lets you predefine the settings on the pc and embedd them into the executable would be awesome.

    And finally a version for lameboy would be much appreciated [​IMG]

    Edit: Actually I can access the settings, the only thing that doesn't work is saving, perhaps due to a missing nesDS.ini file or just because the rom is embedded. Will investigate.
     
  14. huiminghao

    Member huiminghao GBAtemp Regular

    Joined:
    Mar 6, 2011
    Messages:
    175
    Country:
    China
    Now, the nesDS does NOT support that. Some older nesDS(EX) versions could, but ONLY ONE rom can be attached and that is for developing/debugging nesDS. If you want to do that, you should follow this:
    1. get the source from sourceforge.net
    2. edit ./arm9/Makefile,
    there is a line: CFLAGS += $(INCLUDE) -DARM9 #-DROM_EMBEDED
    delete the char '#'
    3. make a folder under arm9/source/, named 'nes'
    4. copy the nes rom to the 'nes' dir
    5. edit memory.s
    some code like this:
    romebd_s:
    .incbin "fm.nes"
    change the fm.nes to your own nes game.

    6. use devkitARM to re-compile the whole project.

    NOTE: I am not sure if it works well with the newer nesDS.
    I dont have time to make such a tool, now....
     
  15. T.Kuranari
    OP

    Member T.Kuranari GBAtemp Regular

    Joined:
    Aug 30, 2011
    Messages:
    150
    Country:
    Japan
    Wow, thank you huiminghao for your reply and instruction, will test this asap [​IMG]


    One more thing, actually I tried the newest nesDS with ndstool and the nesDS.exe from the package linked here and it indeed works. I tested it with several roms and they really work [​IMG]
     
  16. T.Kuranari
    OP

    Member T.Kuranari GBAtemp Regular

    Joined:
    Aug 30, 2011
    Messages:
    150
    Country:
    Japan
    First off I need to clear something up. In this package there are 7 files that let you embedd a rom to a nds file.

    1) arm7.bin
    2) arm9.bin
    3) nesDS.bin
    4) nesDS.exe
    5) ndstool.exe
    6) icon.bmp
    7) make_nds.bat

    I thought that the emulator core is the nesDS.bin which happens to be a renamed nesDS.nds file. I tested if newer versions of nesDS are compatible by replacing the nesDS.bin with the lastest nesDS from sourceforge and run the make_nds.bat with Super Mario Bros as rom file. To my surprise it worked and I got a fully working nds file. Now how can that be?

    I discovered later that the nesDS.bin actually does nothing. I deleted it and ran again the make_nds.bat. Result: I got the same working nds file. The actual emulator core is not the nesDS.bin, but the nesDS.exe. So all the time when I thought I built a working nds rom with latest nesDS the truth is I always built it with the same old nesDS version.


    Now as far as huiminghao instructions go, it cleary shows that embedding a rom file to latest nesDS is NOT "impossible due to a incompatible memory layout", but it's actually quite easy and works well [​IMG] So I was right all the time. All that it takes is modifying 2 lines in the source code. Big thanks huiminghao, I new that you could help [​IMG]

    The embedded rom files works exactly as if they were launched from the nesDS emu, but only lacks support for saving. Perhaps there is a workaround for this? [​IMG]
     
  17. DanTheManMS

    Member DanTheManMS aka Ricochet Otter

    Joined:
    Jun 2, 2007
    Messages:
    4,325
    Location:
    Georgia
    Country:
    United States
    Wow. I barely even remember making that "nesDS_snesDS_slot1_usage" package. Yeah, that was made back when DLDI was in its infancy. I'm actually rather flattered that someone saved that link for several years.

    There is one way to "fake" a filesystem for modern programs using DLDI, but it's similarly ancient, and I'm pretty sure it's read-only, so you can't save your progress using either in-game saving or a savestate. The process is outlined at http://www.pocketheaven.com/ph/wiki/index....GBA_flash_carts

    I believe there was a write-capable driver at some point (called FCSR2) but I know practically nothing about it other than the name.

    EDIT: So apparently the DCEmu links are no longer valid. Give me a second, and I'll try to remember what was in those .zip files and re-upload them somewhere.

    EDIT 2: They should be here, I think. http://www.zumodrive.com/share/euiGODg2ZD

    Dwedit's "Add_to_disk_image.exe" is a better version of BFI which is called in the build.bat batch file, but I forgot the exact syntax for it. If BFI works for you, then go for it. If not, try add_to_disk_image.

    EDIT 3: This wiki page might help. They copy-pasted my tutorial above but added some notes regarding FCSR2. http://dev-scene.com/NDS/FCSR_Tutorial

    EDIT 4: This thread has instructions on the add_to_disk_image syntax and how to replace BFI.exe with it - http://www.pocketheaven.com/ph/boards/view...&highlight=
     
  18. DanTheManMS

    Member DanTheManMS aka Ricochet Otter

    Joined:
    Jun 2, 2007
    Messages:
    4,325
    Location:
    Georgia
    Country:
    United States
    Random note: this thread alone is a huge example of the importance of self-documenting. My memory of FCSR is flaky as hell, and I'm glad I wrote things down back when I actually knew such things.

    EDIT: Case in point, Pogoshell, from the GBA era. If Kuwanger ( http://kuwanger.net/gba/pogoshell/ ) didn't document his Pogoshell improvements, they could have easily been forgotten. I know nobody here really cares about Pogoshell, but the fact that the documentation exists means a lot.
     
  19. T.Kuranari
    OP

    Member T.Kuranari GBAtemp Regular

    Joined:
    Aug 30, 2011
    Messages:
    150
    Country:
    Japan
    First off thank you very much for your kind help, I really appreciate it [​IMG] Now I tried both the add_to_disk_image method described here and the method described here but I got the same error message in my command line window saying that "300000 cannot be syntactically processed at this point ". I have no clue what that means but trying to change 300000 in the bat file to another number doesn't work either and when I manually execute the add_to_disk_image.exe on the nds file it crashes [​IMG]

    Will look into pogoshell shortly. Thanks again [​IMG]
     
  20. DanTheManMS

    Member DanTheManMS aka Ricochet Otter

    Joined:
    Jun 2, 2007
    Messages:
    4,325
    Location:
    Georgia
    Country:
    United States
    Pogoshell won't help you at all here. I just mentioned it as a random side comment.

    I've never heard of that error before. Maybe it's an issue with Windows Vista/7? *shrugs*
     

Share This Page