It is currently Thu Oct 19, 2017 4:51 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Earthworm Jim 2 [Solved]
PostPosted: Wed May 11, 2016 8:15 am 
Offline
User avatar

Joined: Mon Dec 29, 2014 1:46 pm
Posts: 709
Location: New York, NY
As you can see in the image below, Earthworm Jim 2 loads and runs in my emulator, but the background tiles look messed up. The sprites, the music and sound effects, and the game play seem to be working aside from the scrambled background.

Image

Since there is no wiki page on mapper UNL-H2288, I have been relying on the source code of other emulators for details. Earthworm Jim 2 executes perfectly in Nintendulator and FCEUX. Their mapper implementations are almost identical. However, Nintendulator includes this extra bit, likely related to the copy protection mechanism:

Code:
int   MAPINT   Read (int Bank, int Addr)
{
   if (Addr & 0x800)
      return (*EMU->OpenBus & 0xFE) | (((~Addr >> 8) | Addr) & 1);
   else   return -1;
}


Since FCEUX doesn't have the equivalent code, I assume it is not completely necessary.

Could the scrambled background tiles in my emulator be copy protection related? I followed the register remapping per the aforementioned sources; so, I am looking for other possibilities. I appreciate any input on this issue. Thanks.


Last edited by zeroone on Wed May 11, 2016 7:51 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Earthworm Jim 2
PostPosted: Wed May 11, 2016 10:53 am 
Offline

Joined: Mon Apr 01, 2013 11:17 pm
Posts: 437
zeroone wrote:
I followed the register remapping per the aforementioned sources; so, I am looking for other possibilities.

Are you sure the PRG mapping is working correctly? It looks like the game might be loading data from the wrong part of the ROM.


Top
 Profile  
 
 Post subject: Re: Earthworm Jim 2
PostPosted: Wed May 11, 2016 11:08 am 
Offline
Formerly Fx3
User avatar

Joined: Fri Nov 12, 2004 4:59 pm
Posts: 3064
Location: Brazil
If I have the correct one, it gives an error
Code:
Filename....: Earth Worm Jim 2 (Unl) [p1][!].nes
Format......: NES
Mapper......: 004 - TxROM (MMC3)
Data size...: 256K PRG ROM (16 x 16K banks)
             (PRG CRC $B9AA4EEB)
              256K CHR ROM (32 x 8K banks)

---------------------------
RockNES 5.21 32bit - May  9 2016, 23:15:18
---------------------------
ERROR:
unofficial opcode 02 trapped at PC 810B!
The emulator has stopped now.
---------------------------
OK   
---------------------------


Top
 Profile  
 
 Post subject: Re: Earthworm Jim 2
PostPosted: Wed May 11, 2016 5:44 pm 
Offline
User avatar

Joined: Mon Dec 29, 2014 1:46 pm
Posts: 709
Location: New York, NY
Joe wrote:
Are you sure the PRG mapping is working correctly? It looks like the game might be loading data from the wrong part of the ROM.


It's a bit difficult to believe that the game runs correctly except for the backgrounds if the PRG mapping were off. However, I agree that it appears that the wrong data is being transferred to the nametables. This either means that the source pointer to the data is wrong--possibly from bad bank mapping--or there is missing mapping required to write to the nametables. Unfortunately, there is nothing in the other emulator sources that suggest a missing component like that.

Does anyone have any logging comparison suggestions maybe?


Top
 Profile  
 
 Post subject: Re: Earthworm Jim 2
PostPosted: Wed May 11, 2016 6:22 pm 
Offline
User avatar

Joined: Mon Dec 29, 2014 1:46 pm
Posts: 709
Location: New York, NY
I just came across this:

http://blog.kevtris.org/blogfiles/EWJ2PROT.TXT

I'll study it to see if it reveals something.

Edit: I also noticed that this mapper has some similarity to mapper 182 in regards to the registers mapping.

Edit 2: I did a comparison of the dynamically generated code at $0740--$07FF and my emulator matches FCEUX. If it is a copy protection related issue, I would expect it to just not run.


Top
 Profile  
 
 Post subject: Re: Earthworm Jim 2
PostPosted: Wed May 11, 2016 7:51 pm 
Offline
User avatar

Joined: Mon Dec 29, 2014 1:46 pm
Posts: 709
Location: New York, NY
Problem solved!!!

It turns out that my mapper implementation is failing to set the nametable mirroring, a consequence of it being a UNIF mapper, a concept that I only recently introduced into my emulator.

On a side note, my emulator doesn't do anything special for open bus; it is mostly treated as 0 except in the case of the upper-bits of the controller values. Per the FCEUX code, it doesn't seem to play much of a roll here.


Top
 Profile  
 
PostPosted: Thu May 12, 2016 7:08 am 
Offline
User avatar

Joined: Mon Dec 29, 2014 1:46 pm
Posts: 709
Location: New York, NY
Zepper wrote:
If I have the correct one, it gives an error
Code:
Filename....: Earth Worm Jim 2 (Unl) [p1][!].nes
Format......: NES
Mapper......: 004 - TxROM (MMC3)
Data size...: 256K PRG ROM (16 x 16K banks)
             (PRG CRC $B9AA4EEB)
              256K CHR ROM (32 x 8K banks)

---------------------------
RockNES 5.21 32bit - May  9 2016, 23:15:18
---------------------------
ERROR:
unofficial opcode 02 trapped at PC 810B!
The emulator has stopped now.
---------------------------
OK   
---------------------------


I located the iNES ROM with that CRC. It's a mislabeled Earthworm Jim 3, not Earthworm Jim 2. It is a mapper 4 ROM that should work in most emulators.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: Google Adsense [Bot] and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group