Hacking NDSSFC/CATSFC revival

What sort of additional hotkeys do you want?


  • Total voters
    98

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
If you're asking in the context of this thread, which is about a DSTWO MIPS processor plugin, the answer is a definite no :P

But recent Desmume versions can emulate filesystems for an R4 card. Go to Slot 1 emulation options and select your R4 filesystem folder.

Ah, makes sense, I wanted to test the emulator, but I don't have the DSTWO card, but I was just curious is all. Thanks for the info! Didn't know the emulator could load an "R4".
 

Deleted member 319809

MAH BOI/GURL
OP
Member
Joined
Dec 22, 2012
Messages
900
Trophies
0
XP
461
Country
Canada
Crap. 1.16 is a dud. It can crash, but doesn't always do so, if you reload or save a saved state and you loaded the game from a point in a saved state OR if you load a new game and go into the menu. Interrupts may be triggering while a saved state or a ROM is being loaded, and trying to execute garbage code in the APU. :\

EDIT: Alright, 1.17 seems to fix this so far. I've been loading and saving states a lot and no crashes have occurred.
 

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
And much improvement since the last version I tried has been noted!

Samus no longer skips shots if I press too briefly in Super Metroid, I can walljump repeatedly now, etc. The opening level's fight with Ridley is still laggy as all hell, but as I stated palette writes seem to be killers on emulation anyways (and it's doing it both to the level, and Ridley's sprite collection). Not like you need to win against him anyways though.

Glad for frameskip smoothing as well, makes laggy games only visually laggy and more playable.
 

Deleted member 319809

MAH BOI/GURL
OP
Member
Joined
Dec 22, 2012
Messages
900
Trophies
0
XP
461
Country
Canada
Replying inline in bold:
And much improvement since the last version I tried has been noted!
Neb: Yay! I see you're freshly back, so I will leave you some time to test the rest, such as cheats :) But that's good to hear.

Samus no longer skips shots if I press too briefly in Super Metroid, I can walljump repeatedly now, etc. The opening level's fight with Ridley is still laggy as all hell, but as I stated palette writes seem to be killers on emulation anyways (and it's doing it both to the level, and Ridley's sprite collection). Not like you need to win against him anyways though.
Neb: I didn't think palette writes were that bad, looking at the code. Pixel drawing routines referenced GFX.ScreenColors[] at all times, and if they changed, they were not cached. When tiles change, they get cached, though.

Glad for frameskip smoothing as well, makes laggy games only visually laggy and more playable.
Neb: I'm also glad about that! :D
How's the audio? Still note-length-jumpy? Crackling? etc.

Also, I don't know if you remember, because it was over a year ago, but you posted an issue on GitHub about freezing in cheat selection. Since I don't know what the bug really is, can you please test that and look on GitHub to comment on some issues?

I know that you haven't been around for most or all of my improvements, so I appreciate being told what the most visible (or audible) improvements are. Thanks.
 

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
Well I was reading this thread even though I didn't have access to my stuff, partially so I wouldn't have to do too much mental catchup, and partially because this is interesting.

In Super Metroid the opening fight is like, <5FPS laggy. I'm only concerned about this because it's not the only time something like this shows up, there's palette effects and junk in later areas, and you fight this boss a second time, etc. I can record a quick video on this if you want, though I suppose you'd need to play the ROM to test fixes anyways.

I actually never noticed any audio issues, I'm not a stickler for perfect audio when it comes to older games so I didn't play close enough attention to notice them... and the only time I fire up the DSTwo emulators are for testing, since I've got a PSP.

As for cheats, files from the mightymo database loaded in (even ones with pages upon pages of codes) and both PAR and GG codes enable and disable fine, so I closed the issue on Github as it's been fixed

The biggest improvements are the input handling (it doesn't seem to skip any presses), how frameskip lets laggy games run at a normal speed, and the cheat support no longer being buggy and half-assed. I could probably have spotted more improvements, but I rarely use this thing.
 

Deleted member 319809

MAH BOI/GURL
OP
Member
Joined
Dec 22, 2012
Messages
900
Trophies
0
XP
461
Country
Canada
[...] In Super Metroid the opening fight is like, <5FPS laggy. I'm only concerned about this because it's not the only time something like this shows up, there's palette effects and junk in later areas, and you fight this boss a second time, etc. I can record a quick video on this if you want, though I suppose you'd need to play the ROM to test fixes anyways.
Yes please, that would be quite helpful. It would tell me what graphical effects are used in the laggy parts, so I can try to optimise them. I've already reduced the amount of memory reads and writes in sprite handling, so maybe I can try my hand at those things too. I don't guarantee much though, because every processor has its limits.

Thanks for your testing on the cheats!
 

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


As I said in the video, it's add/sub modes, not palette writes (my bad).

Here's the saves for the game, the first state is the start of the first level (where I start in the video), and the second is inside the main area (where the video ends).
http://www.mediafire.com/?6z1od217vd0184r
 

Deleted member 319809

MAH BOI/GURL
OP
Member
Joined
Dec 22, 2012
Messages
900
Trophies
0
XP
461
Country
Canada
It looks like that sequence could be mode 7 as well, because the boss flies away and it's rotated. In any case, thanks for the posting, and I'll try to do something.
 

Deleted member 319809

MAH BOI/GURL
OP
Member
Joined
Dec 22, 2012
Messages
900
Trophies
0
XP
461
Country
Canada
As I said in the video, it's add/sub modes, not palette writes (my bad).

Here's the saves for the game, the first state is the start of the first level (where I start in the video), and the second is inside the main area (where the video ends).
http://www.mediafire.com/?6z1od217vd0184r
(I downloaded the ROM for the purpose of researching this bug, and will delete it soon.)

To get to the source of the slowdown, I first need to isolate it. So I ran a build of CATSFC with ADD and SUB background rendering disabled. It's pretty much exclusively ADD/SUB in that battle...
metroid-ridley.png

Samus, Samus's bullets, the floor, the boss and its fire, everything. Even the emergency escape sequence thingy and the timer are ADD/SUB. However, the boss, when hit, becomes visibly white, so I can see it flash at higher FPS. Rydian, you're right :)
 

Deleted member 319809

MAH BOI/GURL
OP
Member
Joined
Dec 22, 2012
Messages
900
Trophies
0
XP
461
Country
Canada
Examining the video frame by frame in VLC, I see that the worst FPS in that sequence, when you say "You can't even see yourself", is 6. But elsewhere it's 9 to 11.

After trying some speed hacks with the ADD mode, like not carrying out the addition proper if either of the colors is black, I unfortunately can't do much better than a worst case of 6 FPS. Maybe 7. And if I add in an option to disable complex rendering, you run the risk of the entire screen becoming black because of the assumptions that can be made in the ADD mode (such as the fact that black is essentially transparent).

You can see what I attempted to do in commit 736484548ea021452415a1711aab10e04b521451. "if (C1 == 0) return C2; if (C2 == 0) return C1; else return <entire calculation here>;" is the speed hack for black-pixel ADDs.

edit: This is weird; even after the sequence ends, the rain background AND the non-rain background you said were playable in the video end up disappearing in my no-ADD build... so they're ADD too! It must be something else. Maybe large sprites?
 

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
Super Metroid does use the whole "move a background layer around so the player thinks it's a big sprite" trick a few times. In the intro section where your ship flies down to the planet after the intro boss fight, the ship appears to be on it's own layer that's moved around to give the appearance of flying... Kraid, one of the bosses later in the game, is also a big background layer (with a few sprites here and there for his moving mouth and such). I'm not sure if the first boss is that or not though.

Anyways the PSP emulator I use is how I test which special features/modes cause slowdown or not, as it's a port of SNES9x as well and has a hacks menu that allows you to see how many rendering passes are being done and stuff. If you've got a PSP that might be helpful just to see what causes which slowdowns.
http://filetrip.net/f27535-SnesPSP-Tyl-0-4-2-mecm.html
 

DanTheManMS

aka Ricochet Otter
Member
Joined
Jun 2, 2007
Messages
4,453
Trophies
1
Age
34
Location
Georgia
XP
752
Country
United States
Oh hey, just saw this thread. I figured I should chime in a bit about the speedhacks. Yes, the method SNES Advance uses involves replacing one of those "looping" JMP instructions with a JMP instruction to the end of the loop. Or at least that's how I think it works; I was never all that good with assembly. The technotes at the SNES Advance site explains it a bit more thoroughly, going into detail about which nibble indicates which value and such.

As for the actual patches I made for SA-1 games, only Super Mario RPG could I find useful speedhacks for. The ones I found for Yoshi's Island and Kirby Super Star should have worked in theory, but didn't in practice. Same with Star Fox.

And yes, anything involving the EA opcode is a patch specifically for the soundless SNES Advance emulator that can safely be ignored.

I made a demonstration years ago for SNES Advance / Snezziboy, showcasing the potential speed difference. Of course this emulator is much more powerful so it only chokes on the more powerful games, which seem to be unhackable at least with the method used by that emulator.



Best of luck to ya dude, I'm always happy to see more SNES emulation projects pop up.
 

Deleted member 319809

MAH BOI/GURL
OP
Member
Joined
Dec 22, 2012
Messages
900
Trophies
0
XP
461
Country
Canada
Oh hey, just saw this thread. I figured I should chime in a bit about the speedhacks. Yes, the method SNES Advance uses involves replacing one of those "looping" JMP instructions with a JMP instruction to the end of the loop. Or at least that's how I think it works; I was never all that good with assembly. The technotes at the SNES Advance site explains it a bit more thoroughly, going into detail about which nibble indicates which value and such.

As for the actual patches I made for SA-1 games, only Super Mario RPG could I find useful speedhacks for. The ones I found for Yoshi's Island and Kirby Super Star should have worked in theory, but didn't in practice. Same with Star Fox.
The technotes at the SNES Advance site don't explain it at all for opcode <42> beyond "the high nibble controls the branch type" - [EDIT: argh, I had the .txt version!] but they do state how the <DB> opcode works: bit 7 is BNE (clear) or BEQ (set, 0x80, 128), the rest is two's complement, -64..+63. I took the code for opcode <42> from Snes9x-TYL / Snes9x-Euphoria which someone else linked me to in this thread. Basically, each opcode forces the CPU to advance to the next event (HBlank, VBlank, an APU timer, etc.), then performs its branch. That saves a certain number of CPU instructions until the end of the frame, and all HBlanks and VBlanks are run correctly.

Your findings for Yoshi's Island coincide with mine, unfortunately. I took the 42/DB patch from snesadvance.dat for that game and it didn't do anything.

I know about the <EA> opcode hacks because of this post: http://gbatemp.net/threads/ndssfc-catsfc-revival-maybe-new-version-1-08.339600/page-3#post-4500832 :D
 

DanTheManMS

aka Ricochet Otter
Member
Joined
Jun 2, 2007
Messages
4,453
Trophies
1
Age
34
Location
Georgia
XP
752
Country
United States
See my slightly edited post for the video demo I made. And yes, I read all 7 pages of the thread before replying and I was just confirming that that post about the EA opcodes was still correct.
 

Deleted member 319809

MAH BOI/GURL
OP
Member
Joined
Dec 22, 2012
Messages
900
Trophies
0
XP
461
Country
Canada
Super Metroid does use the whole "move a background layer around so the player thinks it's a big sprite" trick a few times. In the intro section where your ship flies down to the planet after the intro boss fight, the ship appears to be on it's own layer that's moved around to give the appearance of flying... Kraid, one of the bosses later in the game, is also a big background layer (with a few sprites here and there for his moving mouth and such). I'm not sure if the first boss is that or not though.

Anyways the PSP emulator I use is how I test which special features/modes cause slowdown or not, as it's a port of SNES9x as well and has a hacks menu that allows you to see how many rendering passes are being done and stuff. If you've got a PSP that might be helpful just to see what causes which slowdowns.
http://filetrip.net/f27535-SnesPSP-Tyl-0-4-2-mecm.html
Ah, so it's a new layer... Darn! And well it looks like the emergency escape sequence thingy is Mode 7 because it rotates. I'm not that great with matrices, so I shall assume it's already well optimised and can't be helped further.

That link looks very helpful, but unfortunately I don't own a PSP.
 

Deleted member 319809

MAH BOI/GURL
OP
Member
Joined
Dec 22, 2012
Messages
900
Trophies
0
XP
461
Country
Canada
Alright. 1.17 still has the crash with audio. I just let the Yoshi's Island score-presentation music run for a few minutes, heard a glitch (a short KRRSSSHH sound), then touched the lower screen and voilà, it had crashed.

It's taking so long to generate sound samples (but not emulate the APU, bizarrely) that two interrupts had stacked - that is, one was running while a second interrupted the first.

Disabling the sound actually makes the Super Metroid sequence run much better! So I'll need to put out at least one new version. Watch out for 1.18, Rydian!
 

Normmatt

Former AKAIO Programmer
Member
Joined
Dec 14, 2004
Messages
2,161
Trophies
1
Age
33
Website
normmatt.com
XP
2,238
Country
New Zealand
Alright. 1.17 still has the crash with audio. I just let the Yoshi's Island score-presentation music run for a few minutes, heard a glitch (a short KRRSSSHH sound), then touched the lower screen and voilà, it had crashed.

It's taking so long to generate sound samples (but not emulate the APU, bizarrely) that two interrupts had stacked - that is, one was running while a second interrupted the first.

Disabling the sound actually makes the Super Metroid sequence run much better! So I'll need to put out at least one new version. Watch out for 1.18, Rydian!
Have you tried using the mips asm from that psp port I posted earlier for the sound mixing it might help speed it up.
 

Deleted member 319809

MAH BOI/GURL
OP
Member
Joined
Dec 22, 2012
Messages
900
Trophies
0
XP
461
Country
Canada
Have you tried using the mips asm from that psp port I posted earlier for the sound mixing it might help speed it up.
I have not tried. I don't know which chip is in the Supercard, so I don't know what sort of instructions I can issue to it. I'll look at it if I can't get the sound to stop lagging the auto frame skipper using 'gcc -O3' alone.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    Xdqwerty @ Xdqwerty: https://youtu.be/8wi6dnzLcZ0?si=5zWGTK0CMXO3DJcb +2