Fun schematic rev-engineering Fire Shark;)

trm

Who loves you, and who do you love?
Feedback
2 (100%)
Credits
2,877CR
For my sins I've decided to reverse engineer the sprite handling section of a pretty cool game. Unfortunately it's got a sodding great custom attached so I can't use the normal methods for identifying which sprite RAM is duff.

So far I've used IDApro to disassemble the 68k code and identify the self test routines, mame debug to watch the code and modify it to recreate the fault in emulation, a 68k assembler to write my own boot code which uses the byte memory mapped custom register to talk to the sprite custom IC and stuff I'm sure I've blanked out! Because the sprite RAM is accessed via a memory mapped register I can't really use a Fluke without some super funky coding. To top it all off, when the self test code runs and detects the error it STOPs the 68k so the busses die and I can't even scope the RAMs :( So the current plan is to document this part of the circuit so I can figure out what to capture on my logic analyser and identify the data pathways to monitor the reads/writes and trigger on a difference.

There is very little fix info available for this popular game so even though I could take a slight shortcut - I've figured out 95% of talking to the video hardware, so I reckon I can write a new boot ROM which sets up the display, does consecutive reads/writes to sprite RAM through the register, prints to the screen the logical failing address and strobes the /CS line so I can ident the physical RAM - I figure it'll be useful for others if I finish making the schem for this part of the board.

I'll release my test boot ROM when it's done as well as as much of the schem as I need to draw. If anyone is interested in the processes I mention above I'll write this up as a full repair doc?

Below is the result of my first few hours efforts
smiley4.gif
. Anyone who can guess what it is before I upload the final version tomorrow is my hero and should tell me where they've seen it before!

http://i.imgur.com/P1LagQo.png - it's a few-k pixels wide.
 

trm

Who loves you, and who do you love?
Feedback
2 (100%)
Credits
2,877CR
BTW I know my schematic layout is a bit grody - lots of crossovers etc. I'm going to tidy it once complete as I have to keep adding ICs as I beep the others out and discover extra ICs are involved
smiley1.gif
 

trm

Who loves you, and who do you love?
Feedback
2 (100%)
Credits
2,877CR
Good work
smiley4.gif
. Was it FCU reference, ROM labels or something else that directed you?

The board has a rather annoying fault: during boot up the POST reports "object ram error" and then the 68k halts leading to the lack of activity I mention. There are 16+ RAMs on the board; a mix of 6116 and 6164. There are a pair for CPU workspace, a pair for palette RAM and a bunch for sprites (including 4 2x8s I've not mentioned - I think these are high speed display line buffers).

The MAME debug hours showed that A0 is loaded with the base address of the FCU custom chip's video register, a word write sets the tile XY value and a long word write using a +2-byte offset address sets the colour and tile to be shown (tile 0 is the number 0 and follows through the alphabet). In MAME I'm able to write my own text to the screen via this mechanism.

I've also found the object ram self test which writes the well-known 0xAAAAAAAA and 0x55555555 patterns whilst incrementing the object RAM address. These values are then read back and compared. If any don't match the check exits, bra's to a text printer that says 'obj ram error' and then halts.

I don't fancy shotgunning the object ram because that's inelegant, but because all addresses and data are passed via the register window I can't do a RAM SHORY via the Fluke, assuming I remove the 68000 and fit a socket. I could in theory poke the start address via the fluke and then write code to poke the 0x55 and 0xAA values, read them back and see either how far in the bad cell is, or which RAM doesn't get address selected ok. But I want to modify the board as little as possible so I have been thinking about writing a ROM to do this, but I'd need to steal a bit more display setup code from my disassembly.

I can't look for an active /CS or /OE as these are all handled by the FCU custom which goes almost select when the 68k halts. Plus once the 68k code stops the object area pretty much dies.

The addresses to pull data from the EPROMs to the obj ram are controlled by the LS163s via the custom (my current guess as I've not beeped it all yet) so I also need to validate them and a few latches. But the custom shuts down when the 68k isn't feeding it - the RAMs could be fine!

My plan of action is to map out the address and tile ROM so I can figure from mame and the hw what's meant to happen. If I strike out there I'll go back to writing my own POST which checks each byte and halts on the failure. Either bouncing the /CS or /OE and hopefully displaying the number of bytes in. My 68k is a bit rusty though
smiley36.gif
.

More effort to be expended tomorrow and a full write-up including code & disassembly if anyone is interested. I'm going to beat this!

Anyway, good spot Martin!
 

trm

Who loves you, and who do you love?
Feedback
2 (100%)
Credits
2,877CR
One other issue - the bloody thing checksums the ROM [1]?and weirdly I've not yet been able to successfully patch this out. Assuming I can, I'll be able to modify the late stage POST code to include a modified RAM test.

I've done so much work on the disassembly, and found so many other people with dead Sharks that I think it's worth making a full informative test ROM. Plus, the challenge exists because it's there and it's not gonna beat me!

As I mentioned to Gudd earlier, I'm so close to the hardware that I'm tempted to code a PACShark to contrast with Macro's
smiley36.gif
 

grobda

"Look at the size of that thing!"
vacBacker
Feedback
7 (100%)
Credits
1,061CR
trm said:
As I mentioned to Gudd earlier, I'm so close to the hardware that I'm tempted to code a PACShark to contrast with Macro's
smiley36.gif

fireshark90 would be a tad more lucrative ;D

top work, way beyond my ken. assembler makes me sleepy
 

Alpha1

Do the Shake and 'VAC
Staff member
vacBacker
Feedback
95 (99%)
Credits
5,653CR
trm said:
Good work
smiley4.gif
. Was it FCU reference, ROM labels or something else that directed you?

Anyway, good spot Martin!

hehe - if you zoom in on the png file, you can clearly read TOAPLAN FIRE SHARK under the smudging
smiley2.gif
 

simonden

Active member
vacBacker
Feedback
20 (100%)
Credits
1,042CR
The 6264 in the schematic looks like it is for the Cypress CY6264 which appears to have slightly differing pinout to other 6264 Static RAM (or is that my eyes)simonden2013-06-11 18:10:08
 

trm

Who loves you, and who do you love?
Feedback
2 (100%)
Credits
2,877CR
Cheers for the positive comments chaps. I'm pretty sure my contact lenses have fused rock solid over the last 48 hours. Now it's been pointed out I can see the blurring pixellate effect was pretty sh*t really :)

simonden - I'm using the RAM & ROM mainly as place-holders at the mo until I've beeped out the full address & data circuit as I'm certain the ROMs are incorrectly pinned but I'd not thought about the SRAM potentially being weird too.

EDIT: Yeah, I picked a weird 6264 datasheet to create the schematic part from! Thanks simonden!

I've had too much RedBull to carry on soldering up Bubble Bobble boots safely so I think I'll get another few hours of mapping in. I'm guessing that the cascaded counters ripple the ROM address which pushes data out into RAM so varying sprites can be displayed without much CPU intervention. A nice plan, and hopefully something which will help when I get to monitor the data.

trm2013-06-11 19:41:41
 

Muerto

Administrator
Feedback
2 (100%)
Credits
157CR
Havent got a clue what youre talking about, but really cool to read about - I guess if it wasent arcade related I wouldent give a damn!

Keep up the excellent work!!!
 

cmonkey

Active member
vacBacker
Feedback
4 (100%)
Credits
1,659CR
Fireshark ROM checksum routine is at $007408. It's called twice (once from $007036 and then again from $007042) for the two code eproms. There are a variety of ways to patch it, the quickest is to change the byte at offset $00388a in 09.bin from $67 to $60. This changes a conditional branch (beq $7122) to an unconditional branch (bra $7122). This will allow the game to carry on past the 'ROM ERROR x' message. I haven't tested further than that to see if there are any side effects further on in the game due to possible other checks.

Another way to bypass it would be to change the two 'bne' instructions at $007038 and $007044 to NOPs. This would involve change 4 bytes in total in both 09.bin and 10.bin (2 in each rom)

cmonkey2013-06-11 21:04:46
 
  • Like
Reactions: trm

Alpha1

Do the Shake and 'VAC
Staff member
vacBacker
Feedback
95 (99%)
Credits
5,653CR
cmonkey said:
Fireshark ROM checksum routine is at $007408.  It's called twice (once from $007036 and then again from $007042) for the two code eproms.  There are a variety of ways to patch it, the quickest is to change the byte at offset $00388a in 09.bin from $67 to $60.  This changes a conditional branch (beq $7122) to an unconditional branch (bra $7122).  This will allow the game to carry on past the 'ROM ERROR x' message.  I haven't tested further than that to see if there are any side effects further on in the game due to possible other checks.

Another way to bypass it would be to change the two 'bne' instructions at $007038 and $007044 to NOPs.  This would involve change 4 bytes in total in both 09.bin and 10.bin (2 in each rom)

You = clever!
 
Top