Updates about nesDS...

Discussion in 'NDS - Emulation and Homebrew' started by huiminghao, Mar 12, 2011.

  1. Seoulhunter

    Seoulhunter Newbie

    Newcomer
    2
    0
    Feb 8, 2015
    Just signed up to say thanks a lot to Huiminghao, as well as many users here providing such good info like Nitendo.
    I'm looking forward to any updates in the future. I know coding this kind of project is such hard work and I am in awe that Hui can do it single handedly.
    Appreciate it! Amazing emulator! Will be hoping for any updates, and if not, it's almost perfect anyway!
     


  2. gothicall

    gothicall Blah blah blah!

    Member
    213
    31
    Apr 29, 2010
    Colombia
    I will ask him for it, but he's having busy days and doesn't have time to code. I even ask him to help with the 3DS scene, but refuses because of his low time.
     
  3. Coto

    Coto GBAtemp Addict

    Member
    2,353
    403
    Jun 4, 2010
    Chile
    i got the latest nesds to compile. (it didnt because stricmp and strnicmp arent ANSI standard from what google fu says), and it was deprecated (nuked) from GCC last year. So instead using GCC strcasecmp and strncasecmp did the trick

    After that trying small games booted fine, booting kirby adventure I got a GURU MEDITATION ERROR!

    After reverse engineering a bit I found the PC load/store exception (data prefetch abort) happened at:

    rompatch.c

    Original:
    Code:
    void romcorrect(char *s)
    {
       unsigned char *rom = (unsigned char *)s;
       int prgsize = rom[4] * 16 * 1024;
       int chrsize = rom[5] * 8 * 1024;
       int crcall = romcrc(rom + 16, prgsize + chrsize);
       int crc = romcrc(rom + 16, prgsize);
       int i = 0;
       for(i = 0; i < sizeof(romdb); i += 3) {
         if(romdb[i] == crcall || romdb[i + 1] == crc) {
           unsigned int tmp = romdb[i + 2];
           int oldmapper = (rom[6] >> 4) | (rom[7] & 0xf0);
           int newmapper = ((tmp & 0xff) >> 4) | ((tmp >> 8) & 0xf0);
           if(oldmapper == newmapper) {
             rom[6] = tmp & 0xff;
             rom[7] = (tmp >> 8) & 0xff;
             __emuflags &= ~PALTIMING;
             if(! (tmp & (1 << 16)))
               __emuflags |= PALTIMING;
           }
           break;
         }
       }
    }
    
    

    Fixed:
    Code:
    void romcorrect(char *s)
    {
    /* fixes an out of bounds exception on romdb buffer */
       unsigned char *rom = (unsigned char *)s;
       int prgsize = rom[4] * 16 * 1024;
       int chrsize = rom[5] * 8 * 1024;
       int crcall = romcrc(rom + 16, prgsize + chrsize);
       int crc = romcrc(rom + 16, prgsize);
       int i = 0;
      
       for(i = 0; i < sizeof(romdb); i += 3) {  
         if((i + 2) <= sizeof(romdb)){                      // fix
           if(romdb[i] == crcall || romdb[i + 1] == crc) {
             unsigned int tmp = romdb[i + 2];
             int oldmapper = (rom[6] >> 4) | (rom[7] & 0xf0);
             int newmapper = ((tmp & 0xff) >> 4) | ((tmp >> 8) & 0xf0);
             if(oldmapper == newmapper) {
               rom[6] = tmp & 0xff;      
               rom[7] = (tmp >> 8) & 0xff;  
               __emuflags &= ~PALTIMING;    
               if(! (tmp & (1 << 16)))    
                 __emuflags |= PALTIMING;
             }
             break;
           }
         }
       }
    }
    
    Now NIFI is not connecting between a DS Lite and a O3DS XL , but if I try an older build it will connect just fine. So I guess it's got to do with devkitpro stuff. (just a guess)!

    download: check newer post
     
    Last edited by Coto, May 3, 2016
    nxwing and cvskid like this.
  4. Flame

    Flame Me > You

    Member
    3,872
    5,039
    Jul 15, 2008

    thanks for that.
     
  5. Xalyy

    Xalyy GBAtemp Regular

    Member
    260
    52
    Nov 20, 2015
    Romania
    I tried to use the rewind function but its somewhy not working on the latest version, does anyone have a solution? :(
     
  6. madzak

    madzak Member

    Newcomer
    20
    1
    Sep 15, 2008
    How to auto fire? I keep clicking on it nothing goes on -increase decrease ba swap lock-?! i did them all nothing worked (Game>input)
     
  7. Coto

    Coto GBAtemp Addict

    Member
    2,353
    403
    Jun 4, 2010
    Chile
    All right:

    I recompiled nesds latest (with the fixes from some posts I made above), against various DSWIFI sources:

    0.3.16 = NesDS NiFi broken, WIFI Client DHCP Mode (youtubeDS as tester) works fine
    0.3.15 = NesDS NiFi broken, WIFI Client DHCP Mode (youtubeDS as tester) works fine
    0.3.13 = NesDS NiFi is working again!, WIFI Client DHCP Mode (youtubeDS as tester app) works fine

    Nifi was tested between a o3DS (non XL) and two DS (one lite and one Japanese Phat)

    So here is the latest nesds where multiplayer works once again, with proper DSWIFI 0.3.13 sources. Also libfat sources are included. So the only critical libraries needed to compile NesDS is libnds. This will allow the emulator to preserve its original features over time (and devkitarm changes)

    so I'd call this a nesds13c release:

    https://github.com/cotodevel/NesDS

    if any of the authors would want the source posted somewhere else, i take down these sources!
     
    Last edited by Coto, May 3, 2016
    zfreeman, cvskid and VinsCool like this.
  8. cvskid

    cvskid GBAtemp Addict

    Member
    2,226
    821
    Apr 13, 2014
    United States
    Don't see where to download a .nds file of it.
     
  9. Coto

    Coto GBAtemp Addict

    Member
    2,353
    403
    Jun 4, 2010
    Chile
    I dont really add precompiled binaries, reason: some devkitpro setup on Windows7 adjust the executable or sections in a way that differs greatly from, for example, windows XP or linux ones (where both end up with the same executable attributes like size or debugging symbols embedded). This causes to compile homebrew for just some people, becoming unmaintainable.

    But you can download devkitpro (devkitarm), copy the sources inside msys/home/ then open mingw (for windows XP or below) and type make, then enter.

    Windows 7 has make embedded, so you just install devkitpro (devkitarm selected), then open a console commandline, go to the above directory, where the sources are, then type make, then enter.
     
  10. Shadow#1

    Shadow#1 Wii & 3DS Softmod Expert

    Member
    3,848
    1,035
    Nov 21, 2005
    United States
    U compile it

    Sent from my LG-D851 using Tapatalk
     
  11. suzsuzuki

    suzsuzuki GBAtemp Regular

    Member
    259
    108
    Aug 25, 2016
    Brazil
  12. orochi115

    orochi115 GBAtemp Regular

    Member
    150
    50
    Jun 8, 2013
    Switzerland
    Amazingly, there's no such good NES emulator on 3DS yet.
    Retroarch QuickNES has low compatibility. While Retroarch FCEUmm and Nestopia are very slow especially on old3DS.
    Still, it's not easy to port NesDS. The display part needs rewrite, I guess.
     
  13. Coto

    Coto GBAtemp Addict

    Member
    2,353
    403
    Jun 4, 2010
    Chile
    yeah i never replaced the 1.3b string, but good to know its working for you as well!
     
    suzsuzuki likes this.
  14. puszcza

    puszcza Advanced Member

    Newcomer
    54
    0
    Feb 10, 2015
    Poland
    Do only I have problem with using touchscreen in this app?
    When I touch one option, it mostly doesnt select any option or option on right to it. I tried with finger and stylus.
    Touch screen works fine with other apps and games.
    I`ve got r4isdhc dual core.
     
  15. Coto

    Coto GBAtemp Addict

    Member
    2,353
    403
    Jun 4, 2010
    Chile
    Tested across several (3)DSes, no touchscreen problems at all. It's either your touchscreen that may be busted / uncalibrated
     
  16. Coto

    Coto GBAtemp Addict

    Member
    2,353
    403
    Jun 4, 2010
    Chile
    Last edited by Coto, Feb 4, 2017
  17. FlexingTiger

    FlexingTiger Member

    Newcomer
    34
    7
    Jan 25, 2017
    United States
    @Coto ,I use devkitARM_r46 and get link error: section .bss is not within region ewram
     
  18. Coto

    Coto GBAtemp Addict

    Member
    2,353
    403
    Jun 4, 2010
    Chile
    for now, I advise to stick to devkitpro r44 for compiling nds stuff, I will be looking for alternative toolchains. I have wasted 2 weeks finding out/testing r46 breaks default NDS system support (since linker and libs use the 3DS-DS map) for DS projects. Years ago something similar happened, and just for supporting devkitpro I re-wrote several parts of DS homebrew so it could work under updated devkitpro. Took some weeks to update everything.


    I have barely time to maintain/implement stuff, and that time will be spent in coding features, NOT toolchain issues. Thanks!

    btw: most devkitpro maintainers have been really helpful, so thanks for all your hard work.
     
  19. FlexingTiger

    FlexingTiger Member

    Newcomer
    34
    7
    Jan 25, 2017
    United States
    Thanks for your reply.
    I solved the problem by replacing devkitARM_r46-win32 & libnds-1.6.2.tar.bz2 with devkitARM_r45-win32 & libnds-1.5.12.
     
    Coto likes this.
  20. Mr Objection

    Mr Objection GBAtemp Fan

    Member
    320
    148
    Jul 10, 2016
    Argentina
    Can someone give the last compiled version of the emu?