ekeeke / Genesis-Plus-GX

An enhanced port of Genesis Plus - accurate & portable Sega 8/16 bit emulator
Other
673 stars 193 forks source link

Black screen in QuackShot Starring Donald Duck (Russian translation) #492

Closed lab313ru closed 1 year ago

lab313ru commented 1 year ago

Hi,

I recompiled the game and it shows black screen while in other emulators it's ok and just works. Link to download:

edit: link removed

lab313ru commented 1 year ago

Hmm, it looks like you're checking the game ID, and doing something, that crashes the game.

lab313ru commented 1 year ago

Here is it: https://github.com/ekeeke/Genesis-Plus-GX/blob/master/core/cart_hw/md_cart.c#L380

ekeeke commented 1 year ago

Yes, it is probably related to this.

This game is 512KB but REV01 uses a weird address mapping which makes the game using a larger address space (1.25MB). So depending if you dump the ROM directly from the Mask ROM or from the cartridge connector, you get different ROM dumps.

Most emulators do not support the 512KB REV01 ROM dump (which is therefore wrongly labelled as a bad dump in goodgen) as they do not emulate the unusual address mapping and only supports the 1.25MB REV01 ROM files where the mirroring is already replicated (or the 512KB REV00 ROM file which uses linear address mapping).

This emulator however supports both ROM dumps and use the size of the ROM file when it detects REV01 header to determine which mapping to use.

Since this issue applies to an hacked version of this game, it looks like your modification breaks that detection and makes the emulator pick the wrong mapper. So you most likely altered the ROM header or modified the original ROM size.

ekeeke commented 1 year ago

Looking a bit more into this, I cannot tell which ROM version was used as a base for this translation. Can you give more details about it ?

lab313ru commented 1 year ago

I used REV01 JUE [!] rom as the base. It was fully disassembled and recompiled, so its size is different.

ekeeke commented 1 year ago

You mean you disassembled the linear 1.25MB ROM dump, hacked it and recompiled it into a linear 512KB ROM dump ?

lab313ru commented 1 year ago

Exactly.

lab313ru commented 1 year ago

Linearity of that 1.25 rom is not full: there is that problem with one pin, which makes a big hole between 0xC0000 and 0x100000.

ekeeke commented 1 year ago

Yes, this is what is explained in source code linked above (address pin VA18 is disconnected and pin VA20 is used instead, which creates some unusual ROM mapping).

I guess the best solution is to improve detection of the original REV01 ROM dump (512KB) by adding verification of the ROM checksum

lab313ru commented 1 year ago

Yeah, for example you can just check the checksum field.

lab313ru commented 1 year ago

But anyway I don't understand, why you need that original rom check at all. Every emulator just runs the original rom as usual and this doesn't reauire any mappings.

ekeeke commented 1 year ago

because there is a 512KB ROM dump (labelled as [b1] in goodgen) which is the original ROM dump and does not work in any emulator (besides this one) and I feel it should be supported (like any ROM dumps from cartridges that use unusual ROM mapping)

what you call the original ROM (the 1.25MB ROM file that is labelled as verified dump in goodgen and no-intro) is actually not a straight ROM dump but a dump of the memory space seen as seen by the console (I also suspect it is a hacked ROM as it is filled with 0x00 in range 0x40000-0xFFFFF where it should be the mirror of 0x00000-0x3FFFF)

lab313ru commented 1 year ago

There is also a1 version which is the same, but that gap is mirrored as you described it.

ekeeke commented 1 year ago

Indeed, this one is labelled as (Rev A) (Alt) in no-intro and corresponds to what you get if you dump the ROM using a Retrode-like dumper while the 512KB one (labelled as (REV01) [b2] in goodgen) is labelled as (Rev A) in no-intro and corresponds to original ROM chip dump (using an EEPROM reader).

Also, the 1.25MB ROM with gaps filled with 0x00 (labelled as (REV01) [!] in goodgen) is actually labeled (Rev A) (Alt)[b] in no-intro because it is an hacked ROM (cf https://datomatic.no-intro.org/index.php?page=show_record&s=32&n=1060)

So, in short, goodgen labels are wrong and should not be trusted.

Anyway, I improved detection of the original ROM dump in https://github.com/ekeeke/Genesis-Plus-GX/commit/ef922735ffd2c50c473054134c69d2ed6153f148