bsnes icon indicating copy to clipboard operation
bsnes copied to clipboard

Super Mario World - 9th Annual Level Design Collaboration (SA-1) Hack

Open Michael-Prince-Sharpe opened this issue 5 years ago • 19 comments

I realise that hacks don't usually count but this hack runs on the real hardware on SD2SNES with no issues. In the latest bsnes and higan upon opening the hack it just presents a black screen and you only hear the sound of a coin being collected (which is the intro sound for SMWC presents screen) then nothing. The hack is found here https://www.smwcentral.net/?p=section&a=details&id=14812

Michael-Prince-Sharpe avatar Apr 03 '20 16:04 Michael-Prince-Sharpe

If it works on the SD2SNES, I would highly suspect the issue is that you're not initializing something properly. The SD2SNES initializes a lot of things for you in order to launch the menu firmware, so it's not the same as a cold boot. If you have somebody who can burn the game onto a repro cart and that also works fine on real hardware, then that would be a different story.

qwertymodo avatar Apr 03 '20 21:04 qwertymodo

Just discovered It works in higan v106 but then breaks in v107.

Michael-Prince-Sharpe avatar Apr 04 '20 14:04 Michael-Prince-Sharpe

I can narrow it down further it works in higan v106.06 but not higan 106.18. It also works in bsnes v106r44.

Michael-Prince-Sharpe avatar Apr 05 '20 20:04 Michael-Prince-Sharpe

Thanks. That sounds more like the SA-1 timing changes then. I've been looking into bisecting the issue, but unfortunately that version is older than the available CI builds, so I'm having to build them all individually.

qwertymodo avatar Apr 05 '20 21:04 qwertymodo

Thanks qwertymodo, here are the different bsnes and higan builds that I used if that's of any help? bsnes and higan revisions.zip

Michael-Prince-Sharpe avatar Apr 06 '20 12:04 Michael-Prince-Sharpe

Thanks, but I don't need the ones you tested. I need to go through the rest of the ones you didn't in order to narrow down exactly which commit broke things. Then we'll know more about exactly what happened.

qwertymodo avatar Apr 06 '20 17:04 qwertymodo

If it helps narrow it down even further for bsnes itself, it worked in bsnes v106r44 and it doesn't in bsnes v107.

Michael-Prince-Sharpe avatar Apr 06 '20 23:04 Michael-Prince-Sharpe

commit: c2d0ed4ca8e24c560188805a5e4d02eaddc4316e Update to v106r62 release.

byuu says:

Changelog:

  - sfc/cx4: added missing instructions [info from Overload]
  - sfc/cx4: added instruction cache emulation [info from ikari]
  - sfc/sa1: don't let CPU access SA1-only I/O registers, and vice versa
  - sfc/sa1: fixed IRQs that were broken from the recent WIP
  - sfc/sa1: significantly improved bus conflict emulation
      - all tests match hardware now, other than HDMA ROM↔ROM, which
        is 0.5 - 0.8% too fast
  - sfc/cpu: fixed a bug with DMA→CPU alignment timing
  - sfc/cpu: removed the DMA pipe; performs writes on the same cycles as
    reads [info from nocash]
  - sfc/memory: fix a crashing bug due to not clearing Memory size field
    [hex_usr]
  - bsnes/gb: use .rtc for real-time clock file extensions on the Game
    Boy [hex_usr]
  - ruby/cgl: compilation fix [Sintendo]

Now let's see if I can accept being off by ~0.65% on one of twelve SA1
timing tests for the time being and prioritize much more important
things or not.

jbo-85 avatar Apr 07 '20 20:04 jbo-85

This is the test rom he used: https://github.com/VitorVilela7/SnesSpeedTest

Looks like SA1 timing is pretty much hardware behaviour since bsnes 106r62. SD2SNES on the other hand...

Version: 1.8.0 + RedGuy SA-1 v06 -- picture by terminator2k2 !

Max833 avatar Apr 08 '20 10:04 Max833

It works if you put

  //(SNV) S-CPU NMI vector
  case 0x220c: { mmio.snv = (mmio.snv & 0xff00) | data; return; }
  case 0x220d: { mmio.snv = (data << 8) | (mmio.snv & 0xff); return; }

  //(SIV) S-CPU IRQ vector
  case 0x220e: { mmio.siv = (mmio.siv & 0xff00) | data; return; }
  case 0x220f: { mmio.siv = (data << 8) | (mmio.siv & 0xff); return; }

inside SA1::writeIOCPU, but that is definitely not hardware accurate. It seems like sd2snes allows writing to those registers from the SNES side? That should make real hardware crash (see: https://github.com/VitorVilela7/SA1-Pack/releases v1.25)

jbo-85 avatar Apr 09 '20 00:04 jbo-85

If I get a chance, I'll throw the SMW ROM onto one of my spare SA-1 boards and see what happens on real hardware.

qwertymodo avatar Apr 09 '20 07:04 qwertymodo

Thanks for looking into this guys.

Michael-Prince-Sharpe avatar Apr 09 '20 15:04 Michael-Prince-Sharpe

Thanks for looking into this guys.

can you also let the creator of the Mesen-S emulator know about the problem, sharknnth?

the SMW VLDC9 game also does not work on Mesen-S as well as on recent versions of bsnes while it works just fine with snes9x 1.60.

i'm waiting to see if this may get resolved in a future bsnes/higan release

epman100 avatar Jun 14 '20 03:06 epman100

I looked into this a few months ago: http://forums.nesdev.com/viewtopic.php?f=12&t=18658&start=270#p247130

byuu confirmed that the current behavior of bsnes/higan/mesen-s as far as restricting which registers can be accessed by which CPU is supposed to be correct: http://forums.nesdev.com/viewtopic.php?f=12&t=18658&start=285#p247384

So unless someone tests on a SA-1 board and determines that the romhack works on hardware, it sounds like the problem is the romhack itself.

SourMesen avatar Jun 15 '20 20:06 SourMesen

then how come VLDC9 works perfectly in the latest version of the snes9x emulator without any problems, SourMesen?

epman100 avatar Jun 25 '20 00:06 epman100

That's not a good comparison. SNES9x isn't that accurate. That's why we have to investigate the exact behaviour on hardware.

Max833 avatar Jun 25 '20 09:06 Max833

I was curious to test this on real hardware as well. Unfortunately it's larger than the M27C322 that my SA-1 dev cart takes. I tried flashing it anyway, in truncated form, and I got a black screen. Is there any other way I can help test it?

s3phir0th115 avatar Aug 13 '20 04:08 s3phir0th115

Could the previous behavior be enabled in compatibility settings? VLDC8 is also broken.

DiskPoppy avatar Sep 14 '21 11:09 DiskPoppy

While compatibility options to make VLDC run wouldn’t be a bad idea, future versions of Snes9x and/or SD2SNES may also break them if they’re broken on real hardware. As always, the ROMs themselves should probably be fixed for maximum compatibility.

jchv avatar Sep 16 '21 12:09 jchv