Hacking NDSSFC/CATSFC revival

What sort of additional hotkeys do you want?


  • Total voters
    98

Deleted member 319809

MAH BOI/GURL
OP
Member
Joined
Dec 22, 2012
Messages
900
Trophies
0
XP
461
Country
Canada
^This. The emulator really needs an overhaul or at least some improvement in the audio department...if possible. Is it based off of 1.51 or 1.43?
1.43. I tried transplanting various things in isolation from 1.52 into NDSSFC-1.06-based-on-Snes9x-1.43 and failed for various reasons each time.

Here's some background.

After I tried transplanting source/tile.cpp, source/gfx.cpp, source/ppu.cpp and the new files they depended on, then adding the variables needed by 1.52 in the various "graphics state" data structures, I found that I could still compile it, but the frames per second dropped 2x! That was clearly unacceptable.

There's way too much C++ in the brand new source/apu/ folder, and the DS2 SDK's C-or-C++-but-not-too-much-++-please compiler complained of missing internal functions from the C++ Standard Library, even if I removed -nostdlib in the Makefile to include it. Things that are quite essential, such as __cxa_atexit (exception handling at-exit code), __cxa_guard_acquire, __cxa_guard_release (for atomic locks), __preinit_array_start, __preinit_array_end, __init_array_start, __init_array_end, __fini_array_start, __fini_array_end (for initialisation of .data sections containing preallocated data, like lookup tables (?)), operator new, operator delete, operator new[], operator delete[] (for memory allocation, quite essential those four) and finally 'main' (!), though that one was easier to work around...

Code:
int main(int argc, char** argv) {
  ds2_main();
  return 0;
}

If one of you guys can get the new 1.52 APU code to a state that can even just compile as C++-but-not-too-much-++-please, without necessarily testing it (that means ShadauxCat can try this even if s/he doesn't have a DSTWO, just the SDK, hint hint :P), I would much appreciate it.
 

Deleted member 319809

MAH BOI/GURL
OP
Member
Joined
Dec 22, 2012
Messages
900
Trophies
0
XP
461
Country
Canada
Meaning the ds itself can also process now instead of just being used as a screen and controller and having all processing done on the dstwo?
I don't think so. I haven't seen a function to submit ARM7 or ARM9 code to the NDS; ds2_getrawInput does the communication for the controller, touch and lid; ds2_getAudiobuff and ds2_updateAudio handles the audio; and you can't get the NDS processor's hardware niceties like the vblank interrupt and hardware sprites/3D/rotation/etc.
 

the_randomizer

The Temp's official fox whisperer
Member
Joined
Apr 29, 2011
Messages
31,284
Trophies
2
Age
38
Location
Dr. Wahwee's castle
XP
18,967
Country
United States
1.43. I tried transplanting various things in isolation from 1.52 into NDSSFC-1.06-based-on-Snes9x-1.43 and failed for various reasons each time.

Here's some background.

After I tried transplanting source/tile.cpp, source/gfx.cpp, source/ppu.cpp and the new files they depended on, then adding the variables needed by 1.52 in the various "graphics state" data structures, I found that I could still compile it, but the frames per second dropped 2x! That was clearly unacceptable.

There's way too much C++ in the brand new source/apu/ folder, and the DS2 SDK's C-or-C++-but-not-too-much-++-please compiler complained of missing internal functions from the C++ Standard Library, even if I removed -nostdlib in the Makefile to include it. Things that are quite essential, such as __cxa_atexit (exception handling at-exit code), __cxa_guard_acquire, __cxa_guard_release (for atomic locks), __preinit_array_start, __preinit_array_end, __init_array_start, __init_array_end, __fini_array_start, __fini_array_end (for initialisation of .data sections containing preallocated data, like lookup tables (?)), operator new, operator delete, operator new[], operator delete[] (for memory allocation, quite essential those four) and finally 'main' (!), though that one was easier to work around...

Code:
int main(int argc, char** argv) {
  ds2_main();
  return 0;
}

If one of you guys can get the new 1.52 APU code to a state that can even just compile as C++-but-not-too-much-++-please, without necessarily testing it (that means ShadauxCat can try this even if s/he doesn't have a DSTWO, just the SDK, hint hint :P), I would much appreciate it.

Makes sense, but I wish I knew more about programming in C/C++ otherwise I'd give it a whirl. As for the Snes9x 1.52 APU/S-SMP code, that would be awesome if/when that gets implemented. The major issue I've seen with portable console emulators is the lack of decent audio emulation on both DS and PSP. Hopefully, that trend can end. Good luck!
 

Deleted member 319809

MAH BOI/GURL
OP
Member
Joined
Dec 22, 2012
Messages
900
Trophies
0
XP
461
Country
Canada
Makes sense, but I wish I knew more about programming in C/C++ otherwise I'd give it a whirl. As for the Snes9x 1.52 APU/S-SMP code, that would be awesome if/when that gets implemented. The major issue I've seen with portable console emulators is the lack of decent audio emulation on both DS and PSP. Hopefully, that trend can end. Good luck!
I had never programmed in C/C++ before this thread. Snes9x is one big codebase, and I learned by example.
 

nl255

Well-Known Member
Member
Joined
Apr 9, 2004
Messages
2,999
Trophies
1
XP
2,760
Country
I don't think so. I haven't seen a function to submit ARM7 or ARM9 code to the NDS; ds2_getrawInput does the communication for the controller, touch and lid; ds2_getAudiobuff and ds2_updateAudio handles the audio; and you can't get the NDS processor's hardware niceties like the vblank interrupt and hardware sprites/3D/rotation/etc.

Are you using the original SDK or Pate's modified version? Remember that while Pate's modified version supports sending code to the NDS it has absolutely no support for doing sound on the DSTwo. You might want to get in touch with him as I am sure he would love to hear from another DSTwo developer.
 

Deleted member 319809

MAH BOI/GURL
OP
Member
Joined
Dec 22, 2012
Messages
900
Trophies
0
XP
461
Country
Canada
Are you using the original SDK or Pate's modified version? Remember that while Pate's modified version supports sending code to the NDS it has absolutely no support for doing sound on the DSTwo. You might want to get in touch with him as I am sure he would love to hear from another DSTwo developer.
I wasn't aware there was an "original version" to speak of, so it is indeed the original I'm using.
 

nl255

Well-Known Member
Member
Joined
Apr 9, 2004
Messages
2,999
Trophies
1
XP
2,760
Country
I wasn't aware there was an "original version" to speak of, so it is indeed the original I'm using.

Yes, he hacked the SDK to allow more transfer between the NDS and DSTwo side as well as make it more efficient. However, he also removed the sound support from it as the idea is that you implement the sound code on the NDS side rather than DSTwo side.
 

Deleted member 319809

MAH BOI/GURL
OP
Member
Joined
Dec 22, 2012
Messages
900
Trophies
0
XP
461
Country
Canada
Yes, he hacked the SDK to allow more transfer between the NDS and DSTwo side as well as make it more efficient. However, he also removed the sound support from it as the idea is that you implement the sound code on the NDS side rather than DSTwo side.
Oh boy. Reimplementing the sound on the ARM7. :sad: It can only be done if, for 1 second, the 1.02 million instructions/sec of the APU and the audio rendering can fit in the ARM7's 32 33 million instructions/sec, and currently an APU instruction runs in 10-25 MIPS instructions (10-25 MHz). Can it be done?

Perhaps more importantly:
* Is it easy for any user to get Pate's SDK modifications and libnds/libdevkitARM to compile the ARM7'd CATSFC? I don't want to release stuff that essentially gets closed down and uncompilable, bogged down by unsatisfiable dependencies.
* Would it be possible to transplant 1.52's sound code there, with all the C++ intact (and under the instruction limit detailed above)?
* Is there a limit to how much code can be submitted to the ARM7?

Here's his site, which has his contact info.
http://dsx86.patrickaalto.com/
(He doesn't bite.)

http://dsx86.patrickaalto.com/DSblog2012a.html
That's the blog archive time section that has some info on how he modified the SDK.
I looked, and there seem to be only timing charts and a high-level overview of what was changed, no code etc. Thanks for the link, though! :)
 

nl255

Well-Known Member
Member
Joined
Apr 9, 2004
Messages
2,999
Trophies
1
XP
2,760
Country
Oh boy. Reimplementing the sound on the ARM7. :sad: It can only be done if, for 1 second, the 1.02 million instructions/sec of the APU and the audio rendering can fit in the ARM7's 32 33 million instructions/sec, and currently an APU instruction runs in 10-25 MIPS instructions (10-25 MHz). Can it be done?

Perhaps more importantly:
* Is it easy for any user to get Pate's SDK modifications and libnds/libdevkitARM to compile the ARM7'd CATSFC? I don't want to release stuff that essentially gets closed down and uncompilable, bogged down by unsatisfiable dependencies.
* Would it be possible to transplant 1.52's sound code there, with all the C++ intact (and under the instruction limit detailed above)?
* Is there a limit to how much code can be submitted to the ARM7?


I looked, and there seem to be only timing charts and a high-level overview of what was changed, no code etc. Thanks for the link, though! :)

Check his download page which has an updated ds2_firmware with source that lets you customize the DSTwo/NDS communication.
 

Deleted member 319809

MAH BOI/GURL
OP
Member
Joined
Dec 22, 2012
Messages
900
Trophies
0
XP
461
Country
Canada
A little progress update:

Secret of Mana's sprite-in-Mode5 menu is fixed!
mana-menu-sprite-20130105.png


But, as of commit 3cd20e203f3b0af8c32921f86547a126d74b34eb, which fixed Secret of Mana's background (and messed up the sprite), Donkey Kong Country's start screen has a Rareware icon that gets split up by black...
dkc-rareware-20130105.png


Given that the Rareware icon goes to the next scanline AND gets split by exactly 4 pixels, I must be mishandling an on-screen X coordinate, but I tried to mess with everything to no avail.
 

Deleted member 319809

MAH BOI/GURL
OP
Member
Joined
Dec 22, 2012
Messages
900
Trophies
0
XP
461
Country
Canada
I wonder if the 1.52 APU code will ever be implemented....
I wonder if you will ever stop wondering about that...

I post a progress update and you jump to another topic; it will be done when it will be done, and right now that's not on my plate at all. There's way too much C++ in the code, which needs to be converted to C if it goes to the MIPS side because of the crappy SDK. If I were to port that on the ARM7 side without any experience with Patrick's SDK modifications or planning, I'd end up with a huge hack or wasted effort. And I hate those.

Given the quality of MoonShell's .spc file playing (which is very low) and the fact that MoonShell's control latency goes to 200-300ms when I play Super Bomberman 5 tracks, I'd say ARM7 doesn't have enough juice to emulate the SPC700 as used by a game, let alone emulating a .spc music snapshot. A game uses the SPC700 with I/O, synchronisation and sound effect overlays selected at run-time.

So that leaves the MIPS side, which is already rather crowded by emulating CPUs and rendering graphics.
 
  • Like
Reactions: Sicklyboy

Killermech

Cookie Monster
Member
Joined
Mar 5, 2004
Messages
1,809
Trophies
0
Website
Visit site
XP
274
Country
Just when I thought I would never see any update to this. Many thanks for all the hard work and this getting revived again is getting me really excited.
I just read the entire thread and didn't see (surprisingly) any mention about SMario RPG of how it would perform with the new improvements. I remember the last CATSFC actually managed to run it and it was playable to some extent. So I'm mainly curious if anyone has tried it and if they've seen any improvements. Or if Nebuleon has any specific plans for it to possibly improve it further, if possible that is.

Again, thanks for picking up this project again Nebuleon :)
 

Deleted member 319809

MAH BOI/GURL
OP
Member
Joined
Dec 22, 2012
Messages
900
Trophies
0
XP
461
Country
Canada
Just when I thought I would never see any update to this. Many thanks for all the hard work and this getting revived again is getting me really excited.
I just read the entire thread and didn't see (surprisingly) any mention about SMario RPG of how it would perform with the new improvements. I remember the last CATSFC actually managed to run it and it was playable to some extent. So I'm mainly curious if anyone has tried it and if they've seen any improvements. Or if Nebuleon has any specific plans for it to possibly improve it further, if possible that is.

Again, thanks for picking up this project again Nebuleon :)
You're welcome - and I am too, because I can use the fruits of my labour :)

For Super Mario RPG, I have no specific update planned. (I don't own the game.) It, along with Yoshi's Island and possibly Kirby Super Star (it runs with the same FPS as Yoshi's Island, so I'm assuming), use(s) a chip that's clocked 3 times higher than the regular chip in the SNES. If Yoshi's Island ends up playable, then Super Mario RPG probably also will. But apart from opcode patching, nothing will really help those games.

technical term alert

Opcode patching: Patching of loops with a "stop the image here" opcode. These loops can be found either automatically using loop analysis or manually using a disassembler or similar.

Loop analysis: Looking at the target and source of emulated jump instructions while they're running in the emulator itself. If the CPU state at two runs of the same jump are identical AND the loop didn't access memory, then the jump can become a WAIT instead. It's a speedhack I tried, but unfortunately failed so hard at that half of my games wouldn't go past the title screen after a "Deleted jump that ran 257 times" message. Most loops aren't ideal like these two, though, so it's not very effective:
Code:
005661: JMP $5661
Code:
005661: WAI
005662: BRA -3 ;to $5661

Manual analysis: This is the method used by SNES Advance, and SNES Advance provides more support for finding these loops to be patched than NDSSFC ever will, sadly. But if someone has found -- or finds -- a wait-for-vertical-blank loop in Yoshi's Island and Super Mario RPG, via SNES Advance, I can try to implement that using their .dat file. Since I failed so hard at loop analysis, I may just implement those as has been requested.
 

Rydian

Resident Furvert™
Member
Joined
Feb 4, 2010
Messages
27,880
Trophies
0
Age
36
Location
Cave Entrance, Watching Cyan Write Letters
Website
rydian.net
XP
9,111
Country
United States
The snesadvance.dat file I've got is dated Sept 27th, 2010, but Idunno' if that's when it was last transferred via FTP or something. Either way I didn't notice any difference on the PSP with speedhacks disabled, SMRPG still ran 60FPS, so I don't know if it'll be helpful or not since I don't know how to look into it anyways... but it does seem to have entries for it, since the emulator reports finding them for this game when it starts loading and speedhacks are enabled.
http://filetrip.net/oldies-downloads/snes/download-speed-hack-01-f31372.html
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • LeoTCK @ LeoTCK:
    SUPPORT LOCAL PRODUCTS, MAKE REVOLUTION
  • LeoTCK @ LeoTCK:
    THEY KEEP REMOVING LOCAL SHIt AND REPLACING WItH INFERIOR CHINESE CRAP
  • LeoTCK @ LeoTCK:
    THATS WHY MY PARTNER CANT GET A GOOTWEAR HIS SIZE ANYMORE
  • LeoTCK @ LeoTCK:
    HE HAS BIG FOOT AND BIG DUCK
  • LeoTCK @ LeoTCK:
    d*ck i mean*
  • LeoTCK @ LeoTCK:
    lol
  • Veho @ Veho:
    Mkay.
  • Veho @ Veho:
    I just ordered another package from China just to spite you.
  • SylverReZ @ SylverReZ:
    Communism lol
  • SylverReZ @ SylverReZ:
    OUR products
  • The Real Jdbye @ The Real Jdbye:
    @LeoTCK actually good quality products are dying out because they can't compete with dropshipped chinese crap
    +2
  • BakerMan @ BakerMan:
    @LeoTCK is your partner the sascrotch or smth?
  • Xdqwerty @ Xdqwerty:
    Good morning
  • Xdqwerty @ Xdqwerty:
    Out of nowhere I got several scars on my forearm and part of my arm and it really itches.
  • AdRoz78 @ AdRoz78:
    Hey, I bought a modchip today and it says "New 2040plus" in the top left corner. Is this a legit chip or was I scammed?
  • Veho @ Veho:
    @AdRoz78 start a thread and post a photo of the chip.
    +2
  • Xdqwerty @ Xdqwerty:
    Yawn
  • S @ salazarcosplay:
    and good morning everyone
    +1
  • K3Nv2 @ K3Nv2:
    @BakerMan, his partner is Luke
  • Sicklyboy @ Sicklyboy:
    Sup nerds
    +1
  • Flame @ Flame:
    oh hi, Sickly
  • K3Nv2 @ K3Nv2:
    Oh hi flame
    K3Nv2 @ K3Nv2: Oh hi flame