News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: Snes emulators (Canoe, Snes9x) -- game problems and fixes  (Read 261400 times)

sluffy

  • Hero Member
  • *****
  • Posts: 642
    • View Profile
Re: Canoe official snes emulator -- problems and fixes
« Reply #140 on: February 23, 2018, 10:43:35 pm »
Canoe seems to get confused with crate sprites off the left side of screen (-1,-10,-15) and treats it as right side (+255, +246, +241). They're just 16x16 sprite tiles, so strange it does this. I thought other games have some large sprites that go offscreen (left side) just fine...

I remember someone running some tests for me with Uniracers because it has that same dumb problem, and results conflict with Nosferatu.

That's very unusual gremlin we're chasing around.


update1:
Speed Racer USA tester
https://www.sendspace.com/file/xxqok5

Should safely cover blinking horizon line.



Guess I'll throw in Bust-a-Move video wishlist. Not sure what Canoe is animating wrongly.

And would like to see Tiny Toons: Wacky Sports in action (original rom) for both mini-games. Offset-per-tile can be really annoying if it's the case.

Put both on backburner and move on to Daffy.
« Last Edit: February 23, 2018, 11:30:05 pm by sluffy »

pimpinelephant

  • Full Member
  • ***
  • Posts: 182
    • View Profile
Re: Canoe official snes emulator -- problems and fixes
« Reply #141 on: February 24, 2018, 08:30:03 am »
I did some more testing with Front Mission - Gun Hazard and Kirby's Dream Land 3. I think I've figured out "the what" in regards to the SRAM issues, although I have no clue on "the why".

Front Mission - Gun Hazard

For this game, I did quite a bit of testing, trying all kinds of different methods and comparing them with other games. I'm fairly confident that what's occurring here is that the SRAM file is being "reset" every time the game boots up. What I mean by this is that the SRAM file, doesn't matter what it contains, will always be changed into a "fresh" (empty saves) SRAM file. Every method that I've attempted always ended up with this same result, no matter what.

I believe that the game is in-fact loading the SRAM, the issue is that the SRAM is always an empty SRAM. It should be noted that this SRAM revert/wipe/whatever-you-want-to-call-it always occurs on game boot-up. This means that when you play the game, save to SRAM, and then shut down the game, that SRAM file is still your recently created save file up until you boot the game up again, at which point it will become an empty SRAM again.

Most games on Canoe follow a fairly simple protocol when it comes to SRAM files. The SRAM file will have its SHA-1 hash value calculated, appended onto the end of the SRAM file, and an accompanying hash file will be created containing the aforementioned SHA-1 hash value. The process Canoe executes in order to load an SRAM file, or at least the process that I personally believe Canoe executes, is by calculating the SHA-1 value of the SRAM file (which it appends to the end) and then comparing the SHA-1 that it just appended to the value contained within the hash file. If the resulting SHA-1 value of the SRAM file does not match the SHA-1 value contained within the hash file, Canoe will wipe that SRAM into a new and empty SRAM file.

For most games, as long as you include correct, and matching, SHA-1 values to the SRAM and hash files, Canoe will load the SRAM with no issues. I say most because there are a few exceptions, particularly Super Mario RPG and Yoshi's Island. Both of these games' SRAM files contain a hash value that does not match the calculated SHA-1 value of the SRAM file. It is currently unknown how exactly Canoe is calculating these particular hash values, and due to this, it is currently impossible to import your own SRAM files for these particular games.

I am in no way saying that this is what is causing the SRAM issue with Front Mission - Gun Hazard though! Canoe automatically calculates the SHA-1 value and appends it to the end of the SRAM as well as within the hash file, which means they are more than likely the correct values. Having said that, I'm willing to bet that the comparison check for the hash values occurs on game boot-up. I only wanted to mention all of this because I felt that it was important to note, due to similar symptoms.

Anyways, apologies for the tangent! I'm quite confident in saying that Gun Hazard actually loads the SRAM as it normally should. The issue is just that the SRAM file is an empty SRAM, which makes it appear as if the SRAM is not loading. The only question is "the why" aspect of it. What occurs during boot-up that causes the SRAM to clear and become an empty SRAM?

TLDR:

- Gun Hazard actually does load SRAM properly.
- SRAM gets wiped during boot-up of the game, which gives the impression that the SRAM isn't loading.
- The question is why is this occurring.
- Does the game do/check for something during boot up?
- Is this an incorrect hash value situation? (Unlikely due to Canoe calculating the hash value itself)

Kirby's Dream Land 3

Alright, I did a bunch of testing on this game in order to figure out exactly what the issue is with the SRAM, as well as the difference in-game between Preset IDs 10A2 and 10A4.

First, I'll talk about Kirby 3 with Preset ID 10A2. The SRAM is not enabled with this preset ID, period. For all games that have SRAM, the SRAM file is created upon game boot-up. I booted up Kirby 3, started a new file, and played a couple of stages. I then used FTP to navigate into the Saves directory, and sure enough, there were zero files present in Kirby 3's folder (similar to Super Castlevania IV's folder, Street Fighter II Turbo's folder, etc.).

Interesting to note though, I imported my own Kirby 3 SRAM/hash files into the aforementioned Saves directory, and then booted up Kirby 3. The game loaded the SRAM and I was able to load my save file, but since SRAM is not enabled with this preset ID, the game never wrote/saved to the SRAM file. Just something interesting and kind of funny to note.

Next, I'll talk about Kirby 3 with Preset ID 10A4. I have been able to trigger the game saving to SRAM with 100% reproduction, at least for the small sample size that I tested. The issue with Kirby 3 is that there is no manual "Save" option. Saves are done automatically, and it's the game that controls when to save. For some reason, Kirby 3's "Save to SRAM" mechanism doesn't trigger when it's supposed to, which is after the completion of each stage (I'm assuming, I don't play too much Kirby 3). It should be noted that I have not tested Kirby 3 with other Preset IDs.

Now for the testing methods that I employed. I tested using two separate methods for trying to trigger the SRAM save. The first method was the standard method. I completed a stage, and then after the completion of said stage, I would press the Reset switch on the Classic to return to the main menu, and then I would restart Kirby 3. I tested this method ten times, and in all ten of those times, the SRAM did not save. In five of those instances, I pressed the Reset switch after beginning the next stage to see if that made any difference. The goal was to try and trigger the "Save to SRAM" mechanism.

The second testing method that I attempted included one extra step. After completing a stage, I would soft-reset the game with the "L-Trigger + R-Trigger + Select + Start" button combination. After soft-resetting the game, I would press the Reset switch, and then restart Kirby 3. I tested this method twenty times, and in all twenty of those times, the SRAM saved correctly! I completed 15 stages on my Save Slot 1 file, and then began a new file on Save Slot 2, completing 5 stages on that save file. It should be noted that restarting Kirby 3 can occur very soon after soft-resetting (I was restarting Kirby 3 even before the Nintendo logo fully appeared).

I also used both these testing methods on Kirby 3 with Preset ID 10A2. I attempted both methods ten times each, but the results were what was expected. All twenty times, the SRAM did not save.

It would appear that soft-resetting causes the SRAM save mechanism to trigger. I'm not exactly sure what aspect of soft-resetting is causing it to fire though. I'm also not too sure why Kirby 3's SRAM save does not trigger when it's, I'm assuming, supposed to.

TLDR:

- Preset ID "10A2" disables the SRAM entirely.
- Preset ID "10A4" enables SRAM, but the SRAM save mechanism must be triggered.
- Soft-resetting the game triggered the SRAM save 100% of the time (20 times out of 20).
- The question is why the SRAM save does not trigger when it's supposed to (I'm assuming after the completion of a stage).
- What is it about soft-resetting that triggers the SRAM save?

Quote
Canoe seems to get confused with crate sprites off the left side of screen (-1,-10,-15) and treats it as right side (+255, +246, +241). They're just 16x16 sprite tiles, so strange it does this. I thought other games have some large sprites that go offscreen (left side) just fine...

I remember someone running some tests for me with Uniracers because it has that same dumb problem, and results conflict with Nosferatu.

That's very unusual gremlin we're chasing around.

Yeah, the vast majority of games don't seem to run into this issue. And with the huge abundance of platformers for the system, I wonder what makes these games so different.

What are the conflicting results with Uniracers and Nosferatu? I thought the "leaving left side of screen and appearing on right side" bug was most likely too much of a hassle to fix. I think I remember it still being in Uniracers because of that.

And wow! So many patches already! Sluffy, you're like Oprah, "You get a patch! And you get a patch! Everybody gets a patch!!!" Seriously, especially with the amount of requests that you get, you're amazing!
« Last Edit: February 24, 2018, 08:39:36 am by pimpinelephant »

Robin64

  • Full Member
  • ***
  • Posts: 146
    • View Profile
Re: Canoe official snes emulator -- problems and fixes
« Reply #142 on: February 24, 2018, 11:16:38 am »
Here's a video for Bust-a-Move. Round 6 is probably the easiest place to see what's going on. Note how as the bubble get pushed further down the screen, their animations do not, and are increasingly further apart from the bubble as the round goes on.

https://www.youtube.com/watch?v=JDEPfw2VaZc

sluffy

  • Hero Member
  • *****
  • Posts: 642
    • View Profile
Re: Canoe official snes emulator -- problems and fixes
« Reply #143 on: February 24, 2018, 11:39:28 am »
Speed Racer was changing several ppu registers. So waited until after h-blank to send all.


Daffy Duck is disabling nmi @ 224. Canoe maybe doesn't refire when 225 goes on again. So tester:
https://www.sendspace.com/file/aa0x5x


Nosferatu is pushing sprites earlier than I thought to right side, given small size. Uniracers = 64x64 sprites and showed some funky prefs on when to switch over and ignore (1)xx.


Have to view BaM later today. Have another idea for Wacky Sports but later also.

etiel

  • Jr. Member
  • **
  • Posts: 73
    • View Profile
Re: Canoe official snes emulator -- problems and fixes
« Reply #144 on: February 24, 2018, 02:08:18 pm »
Quote
Daffy Duck is disabling nmi @ 224. Canoe maybe doesn't refire when 225 goes on again. So tester:
https://www.sendspace.com/file/aa0x5x

Tested, did not fix the flickering.

Robin64

  • Full Member
  • ***
  • Posts: 146
    • View Profile
Re: Canoe official snes emulator -- problems and fixes
« Reply #145 on: February 24, 2018, 03:47:18 pm »
Tested, did not fix the flickering.

Just came to post this, so consider it a second confirmation.

Speed Racer and Marvel Superheroes also working.
« Last Edit: February 24, 2018, 03:56:41 pm by Robin64 »

sluffy

  • Hero Member
  • *****
  • Posts: 642
    • View Profile
Re: Canoe official snes emulator -- problems and fixes
« Reply #146 on: February 24, 2018, 07:29:32 pm »
Studied Tetris Attack (Mode 2 - OPT) and this should work for Wacky Sports (same). Use offset 0, then add x-y table.
https://www.sendspace.com/file/ypmu1i


Bust-a-Move: is there official preset id? Or Puzzle Bobble? Game uses mode 4 opt. Normally playfield should shake a lot when ceiling is ready to lower. Because Canoe is not doing OPT math, there's no shaking. Especially as it reaches bottom. Instead, we get those phantom bubbles (which are correct position actually) because screen is not scrolling upward.

Just don't know if Canoe left out Mode 4 OPT or it's not looking at right spot again.


Daffy Duck: would like to verify Canoe is not pulling something shady with irq flag.
https://www.sendspace.com/file/tkddtd


Uniracers: shifty test here too. Want to know if oam subscreen is playing tricks.
https://www.sendspace.com/file/jorvm1


Dragon Ball Z: Super Saiya Densetsu (Rev 1 - no header!)
https://www.sendspace.com/file/e0mxyy

Moves bg3 text slightly upward 8px to at least be visible.


Street Racer: changes sprite size mode from 8x8 + 16x16 ==> 16x16 + 32x32. No funny tricks. Canoe likely doesn't care and keeps 16x16 at line 0. So only top half of racer is shown. Given simple nature of this one screen, might try hacking around it.
« Last Edit: February 24, 2018, 08:33:27 pm by sluffy »

FormerTree

  • Jr. Member
  • **
  • Posts: 24
    • View Profile
Re: Canoe official snes emulator -- problems and fixes
« Reply #147 on: February 24, 2018, 09:05:28 pm »
Studied Tetris Attack (Mode 2 - OPT) and this should work for Wacky Sports (same). Use offset 0, then add x-y table.
https://www.sendspace.com/file/ypmu1i

Tested Tiny Toon Adventures - Wacky Sports Challenge... both weightlifting and woodcutting, and everything is working perfectly. Thanks again! Wow!

Example Screenshot:


For anyone keeping track, I applied patch "wacky_sports_usa.ips" to clean US rom (CRC32 0xAFE72FF0), resulting patched ROM is CRC32 0xF96DDB49 and I can confirm the two sports with visual corruption now work properly. See my previous posts in thread for what they looked like before.

Uniracers: shifty test here too. Want to know if oam subscreen is playing tricks.
https://www.sendspace.com/file/jorvm1

This one still not working. Screenshot from 1P. The dark shading is because I pressed pause to take the screenshot - same as before, when the enemy bike gets off screen it wraps around and sort of floats in the middle.

« Last Edit: February 24, 2018, 09:25:33 pm by FormerTree »

sluffy

  • Hero Member
  • *****
  • Posts: 642
    • View Profile
Re: Canoe official snes emulator -- problems and fixes
« Reply #148 on: February 24, 2018, 09:36:09 pm »
Wraps around. Gad. Going to have to compare Uniracers, Nosferatu against lots other games. Look for other strange ppu settings.
== Both had unusual OAM subscreen drawing flag.


Thanks all for verifying everything to-date. That's 3 extra down on the sheet. And lots more mysterious quirks to uncover.



update:
Super Play Action Football (USA)
https://www.sendspace.com/file/0hl589

Reads 16-bit $2800 for dma size. AE 00 [28]. OpenBus says $2828. Hard-code and menus should pass.


Super Battleship (USA)
https://www.sendspace.com/file/3dj2sc

DMA from 0C:CE56 + 7FFF ==> 2118. Wraps around. Reads from PPU (invalid). Send 31AA bytes to reach bank end. Should clear up screen.


American Tail (USA)
https://www.sendspace.com/file/pjgcsm

Guess-- turns on irq @ 261. Fires too early @ 0. Crash. Give timing break.


Rock 'n Roll (USA)
https://www.sendspace.com/file/mmdczz

Game fails to reset cgram dma register. 7E:2200 + 10000 = disaster? 7E:2000+200 = normal.
« Last Edit: February 25, 2018, 11:39:53 am by sluffy »

Robin64

  • Full Member
  • ***
  • Posts: 146
    • View Profile
Re: Canoe official snes emulator -- problems and fixes
« Reply #149 on: February 25, 2018, 04:06:03 pm »
First test for Rock 'n Roll Racing is promising, still a couple of screen with errors though.

https://www.youtube.com/watch?v=1qcvuqzzFbU

etiel

  • Jr. Member
  • **
  • Posts: 73
    • View Profile
Re: Canoe official snes emulator -- problems and fixes
« Reply #150 on: February 25, 2018, 06:06:07 pm »
Quote
Daffy Duck: would like to verify Canoe is not pulling something shady with irq flag.
https://www.sendspace.com/file/tkddtd

The second Daffy Duck tester does not fix the problem.

Quote
American Tail (USA)
https://www.sendspace.com/file/pjgcsm

Guess-- turns on irq @ 261. Fires too early @ 0. Crash. Give timing break.

American Tail crashes immediately with a C7 error.

sluffy

  • Hero Member
  • *****
  • Posts: 642
    • View Profile
Re: Canoe official snes emulator -- problems and fixes
« Reply #151 on: February 25, 2018, 06:57:59 pm »
Should cover all Rock n' Roll dma 0-size cgram screens
https://www.sendspace.com/file/q0ccrs

Canoe is not dma bank wrapping. Probably mvn,mvp no-wrap also for performance reasons.



Spider-Man is strange. Not uploading menu tiles to vram; recycles Spidey's old animation frames.
(from looking at bugshot)

Dream Land 3. Writes to sram a lot all over game stage, map. Going to check sa-1 registers for any funnyness. Right after finishing a stage and returning to map, game correctly saves in emus.

reyvgm

  • Hero Member
  • *****
  • Posts: 1162
    • View Profile
Re: Canoe official snes emulator -- problems and fixes
« Reply #152 on: February 25, 2018, 07:43:12 pm »
Kirby 3 saves by just selecting a new save slot too. You don't really need to pass a stage to force the game to save.
« Last Edit: February 26, 2018, 03:30:48 am by reyvgm »

sluffy

  • Hero Member
  • *****
  • Posts: 642
    • View Profile
Re: Canoe official snes emulator -- problems and fixes
« Reply #153 on: February 25, 2018, 10:59:23 pm »
Thanks for fail trying. Have to keep searching for clues.


Question about Eye of the Beholder: screenshot shows "mouse" cursor is only 8x8 size. Is it also 8x8 size at character generation screen?

Also if you let the intro play, when the party appears before the king, does that show (in)correctly?

Very weird because Canoe is not showing 16x16, even if instructed to.

Robin64

  • Full Member
  • ***
  • Posts: 146
    • View Profile
Re: Canoe official snes emulator -- problems and fixes
« Reply #154 on: February 26, 2018, 02:59:17 am »
Second test for RnR Racing, the results and purchase screens work!

https://www.youtube.com/watch?v=v5-OPXSyYwA

reyvgm

  • Hero Member
  • *****
  • Posts: 1162
    • View Profile
Re: Canoe official snes emulator -- problems and fixes
« Reply #155 on: February 26, 2018, 03:39:26 am »
Sluffy, now that Rock'n Roll Racing has been fixed, can you take a look at RPM Racing too? It's by the same company, and both games are very similar.

The game runs in high resolution, so I don't know if that is what's causing the issues though,

sluffy

  • Hero Member
  • *****
  • Posts: 642
    • View Profile
Re: Canoe official snes emulator -- problems and fixes
« Reply #156 on: February 26, 2018, 07:56:10 am »
I'll check it next.

Does C7 error mean Canoe can't boot game -- memmap? company id? name? misc?

Robin64

  • Full Member
  • ***
  • Posts: 146
    • View Profile
Re: Canoe official snes emulator -- problems and fixes
« Reply #157 on: February 26, 2018, 09:35:54 am »
C7 means the game won't boot but it can be for a multitude of reasons. It could be a bad version of the ROM, it could be an incorrect Preset ID set for the game, it could have been a transfer error.. It's not very specific. It just means "Something is wrong, I can't boot this".

Zimgief

  • Jr. Member
  • **
  • Posts: 45
    • View Profile
Re: Canoe official snes emulator -- problems and fixes
« Reply #158 on: February 26, 2018, 10:57:26 am »
Yeah, and for Dragon Ball Z Hyper Dimension, it's a C7 error as well. For information, I tried the japanese game unpatched, with different SA-1 preset IDs (Super Mario RPG, Kirby Ultra Star, Marvelous) (with different sram file size, but I suppose it's not important as I don't even think this game saves anything) and none worked.

I thought of something: Digital Foundry documented a built-in game that was not correctly emulated on the Snes Mini : Yoshi's Island. The bug in question is in the distoring background here that disappears sporadically: https://www.youtube.com/watch?v=1W05gnyiGzQ
Nothing really important, but that would be impressive if you made it work when Canoe developpers couldn't. x)

FormerTree

  • Jr. Member
  • **
  • Posts: 24
    • View Profile
Re: Canoe official snes emulator -- problems and fixes
« Reply #159 on: February 26, 2018, 11:43:17 am »
I don't own any of the remaining games so I can't test, but I thought it might help to quickly summarize which games have been tested and which haven't:

Confirmed Fixed: Aliens 3, Cacoma Knight, Speedy Gonzales, Beavis and Butthead, Super Off Road, Dragon Ball Z Super Butoden 2, F-1 Grand Prix, SOS Sink or Swim, Mario's Time Machine, Hunt for Red October, Tom and Jerry, Super Ninja Boy, Illusion of Gaia, Mighty Morphin Power Rangers Fighting Edition, Star Trek Deep Space Nine, Krusty's Super Fun House, Final Fantasy Mystic Quest, Marvel Super Heroes USA, Tiny Toon Adventures Wacky Sports Challenge, Speed Racer USA, Rock n Roll Racing

Patches tested, but didn't work (didn't fix problem) according to tester: Uniracers (I posted that the enemy sprite wrap thing still happens)), Ys 3 (Robin64 reports did not work on Feb 18th), Daffy Duck (etiel reports 2nd patch does not fix), An American Tail (etiel reports immediate crash), Cool World (Robin64 had followup video with error still present)

No feedback to sluffy's last post with patch: WWF Wrestlemania The Arcade Game, Super Play Action Football, Super Battleship

I think that's everything where at least one patch tester has been posted.
« Last Edit: February 26, 2018, 11:48:19 am by FormerTree »