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,969
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
3,000
Trophies
2
XP
2,796
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
3,000
Trophies
2
XP
2,796
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
3,000
Trophies
2
XP
2,796
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
  • TwoSpikedHands @ TwoSpikedHands:
    Do I restart now using what i've learned on the EU version since it's a better overall experience? or do I continue with the US version since that is what ive been using, and if someone decides to play my hack, it would most likely be that version?
  • Sicklyboy @ Sicklyboy:
    @TwoSpikedHands, I'll preface this with the fact that I know nothing about the game, but, I think it depends on what your goals are. Are you trying to make a definitive version of the game? You may want to refocus your efforts on the EU version then. Or, are you trying to make a better US version? In which case, the only way to make a better US version is to keep on plugging away at that one ;)
  • Sicklyboy @ Sicklyboy:
    I'm not familiar with the technicalities of the differences between the two versions, but I'm wondering if at least some of those differences are things that you could port over to the US version in your patch without having to include copyrighted assets from the EU version
  • TwoSpikedHands @ TwoSpikedHands:
    @Sicklyboy I am wanting to fully change the game and bend it to my will lol. I would like to eventually have the ability to add more characters, enemies, even have a completely different story if i wanted. I already have the ability to change the tilemaps in the US version, so I can basically make my own map and warp to it in game - so I'm pretty far into it!
  • TwoSpikedHands @ TwoSpikedHands:
    I really would like to make a hack that I would enjoy playing, and maybe other people would too. swapping to the EU version would also mean my US friends could not legally play it
  • TwoSpikedHands @ TwoSpikedHands:
    I am definitely considering porting over some of the EU features without using the actual ROM itself, tbh that would probably be the best way to go about it... but i'm sad that the voice acting is so.... not good on the US version. May not be a way around that though
  • TwoSpikedHands @ TwoSpikedHands:
    I appreciate the insight!
  • The Real Jdbye @ The Real Jdbye:
    @TwoSpikedHands just switch, all the knowledge you learned still applies and most of the code and assets should be the same anyway
  • The Real Jdbye @ The Real Jdbye:
    and realistically they wouldn't

    be able to play it legally anyway since they need a ROM and they probably don't have the means to dump it themselves
  • The Real Jdbye @ The Real Jdbye:
    why the shit does the shitbox randomly insert newlines in my messages
  • Veho @ Veho:
    It does that when I edit a post.
  • Veho @ Veho:
    It inserts a newline in a random spot.
  • The Real Jdbye @ The Real Jdbye:
    never had that i don't think
  • Karma177 @ Karma177:
    do y'all think having an sd card that has a write speed of 700kb/s is a bad idea?
    trying to restore emunand rn but it's taking ages... (also when I finished the first time hekate decided to delete all my fucking files :wacko:)
  • The Real Jdbye @ The Real Jdbye:
    @Karma177 that sd card is 100% faulty so yes, its a bad idea
  • The Real Jdbye @ The Real Jdbye:
    even the slowest non-sdhc sd cards are a few MB/s
  • Karma177 @ Karma177:
    @The Real Jdbye it hasn't given me any error trying to write things on it so I don't really think it's faulty (pasted 40/50gb+ folders and no write errors)
  • DinohScene @ DinohScene:
    run h2testw on it
    +1
  • DinohScene @ DinohScene:
    when SD cards/microSD write speeds drop below a meg a sec, they're usually on the verge of dying
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    Samsung SD format can sometimes fix them too
  • Purple_Heart @ Purple_Heart:
    yes looks like an faulty sd
  • Purple_Heart @ Purple_Heart:
    @Psionic Roshambo i may try that with my dead sd cards
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    It's always worth a shot
  • TwoSpikedHands @ TwoSpikedHands:
    @The Real Jdbye, I considered that, but i'll have to wait until i can get the eu version in the mail lol
    TwoSpikedHands @ TwoSpikedHands: @The Real Jdbye, I considered that, but i'll have to wait until i can get the eu version in the...