Homebrew Updates about nesDS...

Seoulhunter

New Member
Newbie
Joined
Feb 8, 2015
Messages
2
Trophies
0
Age
40
XP
52
Country
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!
 

gothicall

Blah blah blah!
Member
Joined
Apr 29, 2010
Messages
233
Trophies
1
XP
687
Country
Colombia
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!

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.
 

Coto

-
Member
Joined
Jun 4, 2010
Messages
2,979
Trophies
2
XP
2,565
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,
  • Like
Reactions: nxwing and cvskid

Flame

Me > You
Global Moderator
Joined
Jul 15, 2008
Messages
7,288
Trophies
3
XP
18,798
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:
http://www.mediafire.com/download/a0wfhyl7454ik2w/nesds13a_25102015_fixed_gurumeditation.zip


thanks for that.
 

Xalyy

Well-Known Member
Member
Joined
Nov 20, 2015
Messages
260
Trophies
0
Age
34
XP
137
Country
Romania
I tried to use the rewind function but its somewhy not working on the latest version, does anyone have a solution? :(
 

madzak

Member
Newcomer
Joined
Sep 15, 2008
Messages
20
Trophies
0
XP
179
Country
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)
 

Coto

-
Member
Joined
Jun 4, 2010
Messages
2,979
Trophies
2
XP
2,565
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://bitbucket.org/Coto88/nesds/branch/master
if any of the authors would want the source posted somewhere else, i take down these sources!
 
Last edited by Coto,

cvskid

Well-Known Member
Member
Joined
Apr 13, 2014
Messages
2,808
Trophies
2
XP
3,391
Country
United States
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 nesds13b release:

https://github.com/cotodevel/NesDS

if any of the authors would want the source posted somewhere else, i take down these sources!
Don't see where to download a .nds file of it.
 

Coto

-
Member
Joined
Jun 4, 2010
Messages
2,979
Trophies
2
XP
2,565
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.
 

orochi115

Well-Known Member
Member
Joined
Jun 8, 2013
Messages
157
Trophies
0
Age
44
XP
222
Country
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.
 

puszcza

Well-Known Member
Newcomer
Joined
Feb 10, 2015
Messages
56
Trophies
0
Age
32
XP
183
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.
 

FlexingTiger

Well-Known Member
Newcomer
Joined
Jan 25, 2017
Messages
54
Trophies
0
XP
195
Country
United States

Coto

-
Member
Joined
Jun 4, 2010
Messages
2,979
Trophies
2
XP
2,565
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.
 

FlexingTiger

Well-Known Member
Newcomer
Joined
Jan 25, 2017
Messages
54
Trophies
0
XP
195
Country
United States
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.
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.
 
  • Like
Reactions: Coto

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Psionic Roshambo @ Psionic Roshambo: https://www.youtube.com/watch?v=pkYA4rALqEE