Shinsenden fan translation opening freeze

User avatar
Sarge
Posts: 45
Joined: Tue Jan 12, 2021 5:26 am
Has thanked: 3 times
Been thanked: 5 times

Shinsenden fan translation opening freeze

Unread post by Sarge »

So, I had a question about Shinsenden. I've tried it out on an EverDrive N8, and it always freezes at the intro sequence text box. I was curious as to what the MiSTer did, and it turns out it has the same behavior. So that has me wondering: is it the translation hack itself? Is it the mapper implementation on the EDN8 and MiSTer? I will note that the game does work in Mesen. It's not a high priority for me, but was just curious if anyone had thoughts on it, or if someone has tried the game via a reproduction cart.
Image
MostroW
Posts: 344
Joined: Tue Aug 18, 2020 3:32 pm
Has thanked: 150 times
Been thanked: 57 times

Re: Shinsenden fan translation opening freeze

Unread post by MostroW »

I've had a look, and it also locks up on the MiSTer.
I manually patched the rom and what i've noticed that the file increased from 512kb to 513kb which leads me to believe that the patch adds things outside of addressable memory space maybe?

If a core author / rom expert could shed light on it to verify my claim, but that's what it looks like to me.
The moment the character walks unto the screen and a dialog should appear it freezes up, that's probably the point where it violates an addressing rule i think.
Thing is that no visual corruption appears to be there and the music keeps playing normally.
dshadoff
Core Developer
Posts: 547
Joined: Sun May 24, 2020 9:30 pm
Has thanked: 20 times
Been thanked: 145 times

Re: Shinsenden fan translation opening freeze

Unread post by dshadoff »

A significant number of hacks and translations, particularly for NES, don’t actually run on real hardware. They are developed on emulators which have certain gaps in their operation, and the authors don’t end up knowing the reason they don't work on real hardware (because they werenkt aware of the difference between their development emulator and real hardware).

With the proliferation of various clones, the situation gets even worse.

If this doesn't work on real hardware, don’t expect it to work on MiSTer... after all, MiSTer is trying to be as close as possible to real hardware.
chimaera
Posts: 92
Joined: Sat Aug 01, 2020 10:53 am
Has thanked: 13 times
Been thanked: 17 times

Re: Shinsenden fan translation opening freeze

Unread post by chimaera »

I checked the size of the translated ROM and it seems correct (513K) = HEX 8000F including header 16 bytes (7FFFF without).
I tried the ROM on my Analogue NT Mini Noir and it also freezes at the first intro dialogue box.

My guess would be that the translation relies on specific emulator behaviour, and thus doesn't work on real hardware.

EDIT: checking the NESDev forums, it seems that the bug has been known since 2009 according to a forum post with no replies.
https://forums.nesdev.com/viewtopic.php ... den#p51504
User avatar
Sarge
Posts: 45
Joined: Tue Jan 12, 2021 5:26 am
Has thanked: 3 times
Been thanked: 5 times

Re: Shinsenden fan translation opening freeze

Unread post by Sarge »

Okay, good deal. Wonder what Mesen does differently? I thought it was supposed to be very accurate, but I guess not quite THAT accurate.
Image
User avatar
aberu
Core Developer
Posts: 1192
Joined: Tue Jun 09, 2020 8:34 pm
Location: Longmont, CO
Has thanked: 247 times
Been thanked: 411 times
Contact:

Re: Shinsenden fan translation opening freeze

Unread post by aberu »

I'll test this out when I get home... A significant number of the pre-patched ROMs, especially in the everdrive packs that you can find, of this kind were inappropriately applied patches often applied with scripts automatically, not using the methods mentioned in the readme and often not applied to the correct ROM. I've successfully played this one and I even submitted the issue for it because the Everdrive pack was incorrect:

https://github.com/SmokeMonsterPacks/Ev ... issues/336

Specifically with this one, I had the same issue and the patch in the database is incorrect. My advice is to not trust pre-patched ROMs, don't assume they are correct on the face of it.

TL;DR = Get a SHA-1 706CF5478659F3CAAE163D8F500BB796D950CCD8 Japanese shinsenden rom and apply the patch yourself --> http://www.romhacking.net/translations/1420/ - and this will surely fix the problem.
birdybro~
User avatar
Sarge
Posts: 45
Joined: Tue Jan 12, 2021 5:26 am
Has thanked: 3 times
Been thanked: 5 times

Re: Shinsenden fan translation opening freeze

Unread post by Sarge »

Alright, I'll give it a go. Maybe it's my Japanese ROM that's the issue - I've done the patching myself and still run into problems.

EDIT: Nope, re-downloaded ROM, checked SHA-1 (matches the one you posted), patched via Lunar IPS. Doesn't work on either the EDN8 or MiSTer.
Image
User avatar
aberu
Core Developer
Posts: 1192
Joined: Tue Jun 09, 2020 8:34 pm
Location: Longmont, CO
Has thanked: 247 times
Been thanked: 411 times
Contact:

Re: Shinsenden fan translation opening freeze

Unread post by aberu »

Okay, I've tested it out a little bit. This patch is fundamentally changing the game in key ways. The patch switched the game from horizontal mirroring to vertical mirroring (https://wiki.nesdev.com/w/index.php/Mirroring). The patch also doubles the program size from 256kb to 512kb. They both are still using the same mapper of course, but I'm willing to bet this ROM has problems in many emulators, and then works fine in others, might have problems on some NES, might not. It' shard to tell. Interesting though, this does happen sometimes. Fun looking at it. I tested multiple tools to see if I could clean it or reorganize the chunks, that never works but figured I'd just see what it does. Obviously it didn't go well :P

EDIT:
Trying out some of Aishsha's other translations, just in case their technique might give someone a clue, and I'll try and contact them for a clue:

Columbus - Ougon no Yoake: Seems to work fine. (256kb translation rom same as original rom)
Esper Bouken Tai: Doesn't load. (Also a 512kb translation rom, and the original is 256kb)
Ge Ge Ge no Kitarou 2 - Youkai Gundan no Chousen: Works fine (256kb translation rom same as original rom)
Jajamaru Gekimaden - Maboroshi no Kinmajou: Works fine (256kb translation rom same as original rom)
Jajamaru Ninpou Chou: Doesn't load. (also resized, from 256kb to 384kb)
The Magic Candle: Seems to run just fine (also resized, from 384kb to 640kb)
Minelvaton Saga: Seems to work just fine (also resized, from 256kb to 384kb)
Ninja Jajamaru-kun: Works fine.
Ninja-kun - Ashura no Shou: Works fine.
Ninja-kun - Majou no Bouken: Works fine.
Silva Saga: Works fine.

So out of all their NES translations, only 3 don't work on the MiSTer NES core, not too shabby. 2 of them were upgrades from 256kb to 512kb in terms of rom size for the patch. That might be a coincidence, but they are both the only ROMs that are 512kb in size after being patched from Aishsha as well, so there might be something to their method that could be accounted for.

The mappers used are all supported and the original unpatched games all worked.

Anyways, that was kinda fun at least testing it out and making the list. I'll link this to aishsha if I can get ahold of them and see what they think.
birdybro~
User avatar
Sarge
Posts: 45
Joined: Tue Jan 12, 2021 5:26 am
Has thanked: 3 times
Been thanked: 5 times

Re: Shinsenden fan translation opening freeze

Unread post by Sarge »

Cool! I appreciate you taking a look at it, and I'm glad I'm not just going crazy over here. :)
Image
chimaera
Posts: 92
Joined: Sat Aug 01, 2020 10:53 am
Has thanked: 13 times
Been thanked: 17 times

Re: Shinsenden fan translation opening freeze

Unread post by chimaera »

The game is a MMC1 game with a 512k PRG ROM which should mean that the PCB is a SOROM, SUROM or SXROM. Those boards used the upper CHR Select bit on the mmc1 to select Adressline 18 om the PRG ROM (which allows access to the other half of the PRG ROM).

It could potentially be an issue with the ines header if it isnt configured correctly.
paulbnl
Core Developer
Posts: 216
Joined: Sun May 24, 2020 8:48 pm
Has thanked: 49 times
Been thanked: 285 times

Re: Shinsenden fan translation opening freeze

Unread post by paulbnl »

I think I found the issue with this game. When it switches to the second 256KB PRG bank it only sets the CHR bank 0 upper bit and not the bit on CHR bank 1. This will make it switch to the first 256KB PRG bank whenever the PPU address is $1000-$1FFF. (A12 high)

It looks like Mesen ignores the PPU address.
User avatar
aberu
Core Developer
Posts: 1192
Joined: Tue Jun 09, 2020 8:34 pm
Location: Longmont, CO
Has thanked: 247 times
Been thanked: 411 times
Contact:

Re: Shinsenden fan translation opening freeze

Unread post by aberu »

chimaera wrote: Wed Jan 13, 2021 4:37 am The game is a MMC1 game with a 512k PRG ROM which should mean that the PCB is a SOROM, SUROM or SXROM. Those boards used the upper CHR Select bit on the mmc1 to select Adressline 18 om the PRG ROM (which allows access to the other half of the PRG ROM).

It could potentially be an issue with the ines header if it isnt configured correctly.
Correction, the original Shinsenden is a 256k PRG / 0k CHR ROM using MMC1 w/ horizontal mirroring.

The translation changes it to a 512k PRG / 0k CHR ROM still using MMC1 w/ vertical mirroring.
2WkIvESQE9.png
2WkIvESQE9.png (160.95 KiB) Viewed 7294 times
Just got a message back from aishsha. None of these 3 that I tested which don't work have been tested on original hardware to their knowledge. If someone with a romcart and original hardware could test on original hardware that would be helpful.

In esper all text was in code, aishsha said it was kind of a mess. In jaja and it's much more recent, has a few people involved, multiple revisions, etc... maybe the newer revision either fixes or breaks something, might be worth looking into. And shinsenden they said it most likely won't work on original hardware, and if it doesn't work on original hardware, generally it won't get implemented in a MiSTer core (not always though).
birdybro~
chimaera
Posts: 92
Joined: Sat Aug 01, 2020 10:53 am
Has thanked: 13 times
Been thanked: 17 times

Re: Shinsenden fan translation opening freeze

Unread post by chimaera »

I was refering to the hacked ROM ofc.

Anyways, MMC1 doesnt care about the INES mirroring bit.
The original Shinsenden ROM is actually also Vertical Mirroring, atleast at bootup.
At MMC1 initialization, the game sets mirroring to vertical, PRG fixed bank at $C000 + 16kb Switch bank at $8000 and CHR bank mode to 2 seperate 4kb banks by writing bits 1 1110 to $9FFF.

After further investigation of PCBs, i found that the Original Shinsenden game is a SNROM board (same as Zelda) which uses the upper CHR bank line select as an additional chip enable for the PRG RAM.
The PCB that would match the translated Shinsenden ROM the closest would probably be an SUROM board that uses the upper CHR bank line select as a 256kb bank selector, which actually also switches the fixed bank.

I dont know how the MiSTer NES core handles the differences between these two boards in the mapper to select the proper one (probably by ROM size?), but it definitely seems like Mesen (supposedly the most accurate emulator out there) handles it differently since the translation works there.
Could also be that the translators screwed up the mapper calls somewhere (which could potentially be fixed relatively easy) which Mesen coulde be more forgiving about, or they just rely on emulator behavior that isnt true to real hardware (which needs to be hacked and corrected, not easy).
paulbnl
Core Developer
Posts: 216
Joined: Sun May 24, 2020 8:48 pm
Has thanked: 49 times
Been thanked: 285 times

Re: Shinsenden fan translation opening freeze

Unread post by paulbnl »

Try this fix. Apply on the translated rom.
Attachments
Shinsenden (J) - English - fix.zip
(753 Bytes) Downloaded 247 times
chimaera
Posts: 92
Joined: Sat Aug 01, 2020 10:53 am
Has thanked: 13 times
Been thanked: 17 times

Re: Shinsenden fan translation opening freeze

Unread post by chimaera »

paulbnl wrote: Thu Jan 14, 2021 3:45 pm Try this fix. Apply on the translated rom.
So it was crappy mapper calls then.

Can confirm that the translation of Shinden now works both on MiSTer and NT Mini Noir with this patch, great work paulbnl!
User avatar
aberu
Core Developer
Posts: 1192
Joined: Tue Jun 09, 2020 8:34 pm
Location: Longmont, CO
Has thanked: 247 times
Been thanked: 411 times
Contact:

Re: Shinsenden fan translation opening freeze

Unread post by aberu »

paulbnl wrote: Thu Jan 14, 2021 3:45 pm Try this fix. Apply on the translated rom.
Great job! I'll let aishsha know so maybe the translation can get updated on romhacking.net with credits to you.
birdybro~
User avatar
Sarge
Posts: 45
Joined: Tue Jan 12, 2021 5:26 am
Has thanked: 3 times
Been thanked: 5 times

Re: Shinsenden fan translation opening freeze

Unread post by Sarge »

Haven't tested on MiSTer yet, but works great on the EDN8. Great job, paulbnl!
Image
Post Reply