Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Graphical corruption/flickering when riding a dragon in Secret of Mana (USA) #170

Closed
jjohnson652 opened this issue Mar 31, 2021 · 12 comments · Fixed by #171
Closed

Graphical corruption/flickering when riding a dragon in Secret of Mana (USA) #170

jjohnson652 opened this issue Mar 31, 2021 · 12 comments · Fixed by #171
Labels
bug Something isn't working compatibility Issues with emulating particular games help wanted Extra attention is needed

Comments

@jjohnson652
Copy link

jjohnson652 commented Mar 31, 2021

Observed in byuu v115.
The "flat world map" in Secret of Mana fails to load. Observed with two different copies of the ROM. Savestate attached to assist with debugging.

Steps:
(1) Summon Flammie using the Flammie/Wind Drum. (Not necessary in savestate - already summoned.)
(2) Press Start to access spherical world map.
(3) Press R. This is supposed to (very slowly) load a flat version of the world map, as seen at 8:44 of this video: https://www.youtube.com/watch?v=cF-V7q2LZMs. However, it fails to load (black screen and soft lock).

Savestate link: https://1drv.ms/u/s!AjRQX6iM6vWG3DYWZI5hW80n0gZy?e=XHsvdg

@Screwtapello
Copy link
Contributor

Thank you for taking the time to report an issue! Unfortunately the "byuu" user-interface is now part of ares, not higan, and ares no longer supports v115 save-states. Can you provide an in-game save?

@jjohnson652
Copy link
Author

Sorry about that! I thought I recalled byuu was a fork of higan, not ares. Nevertheless this only matters if it still occurs in the latest version. I wouldn't be surprised if the same error occurs in higan; might be worth testing. The function that calls the map seems unusual and I don't recall an entire large Mode 7 map drawn in similar fashion in any other game.

Anyway, here is an in-game save you can use: https://1drv.ms/u/s!AjRQX6iM6vWG3Dfz7lDP6_ZDj9ba?e=Y96Wly

@Screwtapello
Copy link
Contributor

Yes, byuu was a fork of higan, but then it forked even further to become ares. Thanks for the in-game save, I'll try it out.

@jjohnson652
Copy link
Author

jjohnson652 commented Apr 1, 2021

Aha! Glad to know I was not completely off-base there. Thanks.

Full disclosure: This save file was created in "Secret of Mana Relocalized", which is supposed to be identical to the commercial Secret of Mana except for an improved translation and font. The save loads fine in the commercial version, and the same soft lock is observed there with this save. I mention this in case that could be a factor.

@Screwtapello
Copy link
Contributor

OK, for future reference, after loading the given save file in the latest higan nightly:

  • walk south out of the building
  • hit X to open up the ring menu
  • hit Up to switch from switch-weapons mode to switch-items mode
  • hit Right a couple of times to select the yellow Flammie Drum (looks like a pellet-drum or a lollipop)
  • hit A to summon Flammie and be whisked into the air

The background flickers heavily to black here:
image image

  • Hold B to increase altitude, and eventually the game stops flickering black, and starts flickering to... heavily zoomed-out Mode 7?

image

  • hit Start to view the world map as a sphere:

image

  • hit R to switch to a rectangular projection:

image

So, the rectangular world-map works properly in higan, but it seems there's other issues here that need looking into.

@Screwtapello Screwtapello added bug Something isn't working compatibility Issues with emulating particular games help wanted Extra attention is needed labels Apr 1, 2021
@Screwtapello Screwtapello changed the title Super Famicon: Secret of Mana map issue Graphical corruption/flickering when riding a dragon in Secret of Mana (USA) Apr 1, 2021
@Screwtapello
Copy link
Contributor

For the record, it seems the game works flawlessly in the latest bsnes nightly, in both "fast" and "accurate" modes. Where higan has full-screen flickering, bsnes shows a flickering shadow of the dragon on the ground (maybe a sprite?).

@Screwtapello
Copy link
Contributor

I did manage to reproduce the behaviour you originally described in ares, so I've filed an issue over there too.

@jjohnson652
Copy link
Author

Very interesting...I didn’t expect the higan results at all. If necessary, I have the cart on an SNES hooked up to my machine and can check on points such as the flickering shadow. (Hopefully the save game battery hasn’t died so there’s a game available for a quick check!)

Thanks for this.

@Screwtapello
Copy link
Contributor

The ever-helpful @jbo-85 pointed out on Discord that this is fallout from commit 44cbb88, an attempt at porting bsnes-emu/bsnes@4f7a269 to higan. I guess Secret of Mana gets added to the list of games that do goofy things when auto joypad polling isn't quite right. I guess I need to sit down and figure out how to port those changes properly.

@jjohnson652
Copy link
Author

How interesting! I never would have guessed the two would be related. In a way I'm not surprised, though; Secret of Mana is notoriously glitchy (particularly on wrong palettes or sprites, and other display issues), in part because it originally was designed for the cancelled SNES-CD and had to be chopped up on short notice when that project fell through. Its finickyness may prove a good test case for issues like this.

@near-san
Copy link
Contributor

near-san commented Apr 2, 2021

This is a little more complicated than that. It works correctly on ares with the accuracy PPU, but with the scanline PPU the image is nearly (but not quite) pitch black. After the flat map finishes rendering the game is usable without locking. The parameters to the directColor() function were backwards in the scanline renderer. It should be like this:

mosaicColor = ppu.dac.directColor(mosaicPalette, paletteNumber);

Screenshot_2021-04-02_00-45-27

Something I noticed in my testing was that if I made $4212.d0 always return 1, the game deadlocks and shows a garbled sky like in your second bugged screenshot, Screwtape.

I'll try to investigate what's going on with higan as well.

@fuel-pcbox
Copy link
Contributor

The ever-helpful @jbo-85 pointed out on Discord that this is fallout from commit 44cbb88, an attempt at porting bsnes-emu/bsnes@4f7a269 to higan. I guess Secret of Mana gets added to the list of games that do goofy things when auto joypad polling isn't quite right. I guess I need to sit down and figure out how to port those changes properly.

That is... REALLY strange as I basically just used the exact same code as bsnes...

Screwtapello added a commit to Screwtapello/higan that referenced this issue Apr 4, 2021
In commit e422ddc, Jonas Quinn updated higan's implementation of the auto-
joypad-poll mode. Those fixes were ported to bsnes in commit 39c37ec, but a
problem was found with the game "SpellCraft - Aspects of Valor", fixed in bsnes
in commit 22066b9. That fix was back-ported to higan in commit 9cd4b04, but
that change caused a regression in "Secret of Mana" (issue higan-emu#170).

This commit (helpfully provided by Jonas Quinn once again) re-ports the bsnes
changes back to higan, and the problems should be solved once and for all.

Fixes higan-emu#170.
Screwtapello added a commit to Screwtapello/higan that referenced this issue Apr 4, 2021
In commit e422ddc, Jonas Quinn updated higan's implementation of the auto-
joypad-poll mode. Those fixes were ported to bsnes in commit 39c37ec, but a
problem was found with the game "SpellCraft - Aspects of Valor", fixed in bsnes
in commit 4f7a269. That fix was back-ported to higan in commit 9cd4b04, but
that change caused a regression in "Secret of Mana" (issue higan-emu#170).

This commit (helpfully provided by Jonas Quinn once again) re-ports the bsnes
changes back to higan, and the problems should be solved once and for all.

Fixes higan-emu#170.
Screwtapello added a commit to Screwtapello/higan that referenced this issue Apr 4, 2021
In commit e422ddc, Jonas Quinn updated higan's implementation of the auto-
joypad-poll mode. Those fixes were ported to bsnes in commit 39c37ec, but a
problem was found with the game "SpellCraft - Aspects of Valor", fixed in bsnes
in commit 4f7a269. That fix was back-ported to higan in commit 44cbb88, but
that change caused a regression in "Secret of Mana" (issue higan-emu#170).

This commit (helpfully provided by Jonas Quinn once again) re-ports the bsnes
changes back to higan, and the problems should be solved once and for all.

Fixes higan-emu#170.
Screwtapello added a commit that referenced this issue Apr 4, 2021
In commit e422ddc, Jonas Quinn updated higan's implementation of the auto-
joypad-poll mode. Those fixes were ported to bsnes in commit 39c37ec, but a
problem was found with the game "SpellCraft - Aspects of Valor", fixed in bsnes
in commit 4f7a269. That fix was back-ported to higan in commit 44cbb88, but
that change caused a regression in "Secret of Mana" (issue #170).

This commit (helpfully provided by Jonas Quinn once again) re-ports the bsnes
changes back to higan, and the problems should be solved once and for all.

Fixes #170.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working compatibility Issues with emulating particular games help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants