Updates about nesDS...

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

Mar 12, 2011

Updates about nesDS... by huiminghao at 4:35 AM (176,523 Views / 11 Likes) 1,363 replies

  1. Seoulhunter

    Newcomer Seoulhunter Newbie

    Joined:
    Feb 8, 2015
    Messages:
    2
    Country:
    Korea, South
    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

    Member gothicall Blah blah blah!

    Joined:
    Apr 29, 2010
    Messages:
    210
    Country:
    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

    Member Coto GBAtemp Addict

    Joined:
    Jun 4, 2010
    Messages:
    2,324
    Country:
    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

    Member Flame Me > You

    Joined:
    Jul 15, 2008
    Messages:
    3,712
    Country:

    thanks for that.
     
  5. Xalyy

    Member Xalyy GBAtemp Regular

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

    Newcomer madzak Member

    Joined:
    Sep 15, 2008
    Messages:
    20
    Country:
    Vietnam
    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

    Member Coto GBAtemp Addict

    Joined:
    Jun 4, 2010
    Messages:
    2,324
    Country:
    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

    Member cvskid GBAtemp Addict

    Joined:
    Apr 13, 2014
    Messages:
    2,091
    Country:
    United States
    Don't see where to download a .nds file of it.
     
  9. Coto

    Member Coto GBAtemp Addict

    Joined:
    Jun 4, 2010
    Messages:
    2,324
    Country:
    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

    Member Shadow#1 Wii & 3DS Softmod Expert

    Joined:
    Nov 21, 2005
    Messages:
    3,555
    Country:
    United States
    U compile it

    Sent from my LG-D851 using Tapatalk
     
  11. suzsuzuki

    Member suzsuzuki GBAtemp Regular

    Joined:
    Aug 25, 2016
    Messages:
    114
    Country:
    Brazil
  12. orochi115

    Member orochi115 GBAtemp Regular

    Joined:
    Jun 8, 2013
    Messages:
    148
    Country:
    China
    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

    Member Coto GBAtemp Addict

    Joined:
    Jun 4, 2010
    Messages:
    2,324
    Country:
    Chile
    yeah i never replaced the 1.3b string, but good to know its working for you as well!
     
    suzsuzuki likes this.
  14. puszcza

    Newcomer puszcza Advanced Member

    Joined:
    Feb 10, 2015
    Messages:
    54
    Country:
    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

    Member Coto GBAtemp Addict

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

    Member Coto GBAtemp Addict

    Joined:
    Jun 4, 2010
    Messages:
    2,324
    Country:
    Chile
    Last edited by Coto, Feb 4, 2017
  17. FlexingTiger

    Newcomer FlexingTiger Member

    Joined:
    Jan 25, 2017
    Messages:
    32
    Country:
    United States
    @Coto ,I use devkitARM_r46 and get link error: section .bss is not within region ewram
     
  18. Coto

    Member Coto GBAtemp Addict

    Joined:
    Jun 4, 2010
    Messages:
    2,324
    Country:
    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

    Newcomer FlexingTiger Member

    Joined:
    Jan 25, 2017
    Messages:
    32
    Country:
    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

    Member Mr Objection GBAtemp Fan

    Joined:
    Jul 10, 2016
    Messages:
    313
    Country:
    Argentina
    Can someone give the last compiled version of the emu?
     

Share This Page