#                                     #
# FinalFight (Japan) driver           #
#                                     #

#                      #
# The name of the game #
#                      #
[general]

GAMENAME    " Final Fight (Japan) " 
DIRECTORY   FFIGHTJ
PARENT      FFIGHT
CPSTYPE     CPS1
DATE		1989

#                 #
# The memory map  #
#                 #
[programRegions]

0x000000  0x0FFFFF  MAINROM
0xff0000  0xfFFFFF  MAINRAM

[dataReadByteRegions]

0x000000  0x0FFFFF  MAINROM
0x800000  0x800001  INPUTPORT2
0x800010  0x800011  INPUTPORT2
0x800018  0x80001f  INPUTPORT1
0x800100  0x8001ff  VIDEOPORTS
0x914000  0x915fff  PALETTERAM 
0x900000  0x920000  VIDEORAM
0xf1c006  0xf1c007  EEPROM
0xff0000  0xfFFFFF  MAINRAM
0x860000  0x8603ff  EXTRARAM  1
0x915800  0x930000  EXTRARAM  2

[dataReadWordRegions]

0x000000  0x0FFFFF  MAINROM
0x800000  0x800001  INPUTPORT2
0x800010  0x800011  INPUTPORT2
0x800018  0x80001f  INPUTPORT1
0x800100  0x8001ff  VIDEOPORTS
0x914000  0x915fff  PALETTERAM 
0x900000  0x920000  VIDEORAM
0xf1c006  0xf1c007  EEPROM
0xff0000  0xfFFFFF  MAINRAM
0x860000  0x8603ff  EXTRARAM  1
0x915800  0x930000  EXTRARAM  2

[dataWriteByteRegions]

0x800100  0x8001ff  VIDEOPORTS
0x914000  0x915fff  PALETTERAM 
0x900000  0x920000  VIDEORAM
0xf1c006  0xf1c007  EEPROM
0xff0000  0xfFFFFF  MAINRAM
0x860000  0x8603ff  EXTRARAM 1
0x915800  0x930000  EXTRARAM 2

[dataWriteWordRegions]

0x800100  0x8001ff  VIDEOPORTS
0x914000  0x915fff  PALETTERAM 
0x900000  0x920000  VIDEORAM
0xf1c006  0xf1c007  EEPROM
0xff0000  0xfFFFFF  MAINRAM
0x860000  0x8603ff  EXTRARAM 1
0x915800  0x930000  EXTRARAM 2

#                                         #
# Protection                              #
#                                         #
[protection]

PORT    0x60
VALUE   0x0004

#                      #
# Graphics information #
#                      #
[graphics]

# the total size of the graphics roms #
TOTAL 0x200000
USEALTERNATEPIXELFORMAT

# Path                     Size    Where  #
LOADROMEVENODD ff24.bin ff17.bin 0x20000 0x000000
LOADROMEVENODD ff25.bin ff18.bin 0x20000 0x040000
LOADROMEVENODD ff09.bin ff01.bin 0x20000 0x080000
LOADROMEVENODD ff10.bin ff02.bin 0x20000 0x0c0000
LOADROMEVENODD ff38.bin ff32.bin 0x20000 0x100000
LOADROMEVENODD ff39.bin ff33.bin 0x20000 0x140000
LOADROMEVENODD ff13.bin ff05.bin 0x20000 0x180000
LOADROMEVENODD ff14.bin ff06.bin 0x20000 0x1c0000

#               Number of tiles Base addr   Decode info #
DECODECHARS     0x0800          0x044000    0x100000
DECODESPRITES   0x2200          0x000000    0x100000 0x080000
DECODESCROLL2   0x1000          0x060000    0x100000 0x080000
DECODESCROLL3   0x0280          0x04c000    0x100000 0x080000 


#                     #
# program information #
#                     #
[program]
ROMSIZE 0x100000

# Type of load path 1                    path 2                       Size    where #
LOADROMEVENODD FF30-36.BIN FF35-42.BIN        0x20000 0x00000
LOADROMEVENODD FF31-37.BIN FF43.BIN        0x20000 0x40000
LOADROM16SWAP  FF32-32m.bin             0x80000 0x80000


#                        #
# The game configuration #
#                        #
[configuration]

LAYERCONTROL    0x6e                # Layer control port                     #
SCROLL1BASECODE 0x0400              # scroll1 tile base                      #
SCROLL1CODEMASK 0x1000              # scroll1 tile mask(=number of tiles)    #
SCROLL2BASECODE 0x2000              # scroll2 tile base                      #
SCROLL2CODEMASK 0x1000              # scroll2 tile mask(=number of tiles)    #
SCROLL3BASECODE 0x0180              # scroll3 tile base                      #
SCROLL3CODEMASK 0x0400              # scroll3 tile mask(=number of tiles)    #
PRIORITYMASKS   0x66 0x70 0x68 0x72 # the ports where to read the priorities #
LAYERENABLE 0x02 0x0c 0x0c 0x00
FORCESCROLLPRIORITY 0xff            # Hack to fix some priority problems btw #
                                    # scroll2 and 3. The folowing values are #
                                    # valid:                                 #
                                    # 0xff: no hack                          #
                                    # 0x01: scroll3 first. Scroll2 after.    #
                                    # 0x00: scroll2 first  Scroll3 after.    #
FORCESCROLL2ON 0                    # 0=no 1=yes #

[z80]
TOTAL 0x10000
LOAD8 ff09-09.bin 0x10000 0x000000 # main rom and banks #

[samples]
TOTAL 0x40000
LOAD8 ff18-18.bin  0x20000 0x00000
LOAD8 ff19-19.bin  0x20000 0x20000


[End]
[verifyRoms]
ff24.bin	0xa1ab607a
ff17.bin	0x2dc18cf4
ff25.bin	0x6e8181ea
ff18.bin	0xb19ede59
ff09.bin	0x5b116d0d
ff01.bin	0x815b1797
ff10.bin	0x624a924a
ff02.bin	0x5d91f694
ff38.bin	0x6535a57f
ff32.bin	0xc8bc4a57
ff39.bin	0x9416b477
ff33.bin	0x7369fa07
ff13.bin	0x8721a7da
ff05.bin	0xd0fcd4b5
ff14.bin	0x0a2e9101
ff06.bin	0x1c18f042
FF30-36.BIN	0xf9a5ce83
FF35-42.BIN	0x65f11215
FF31-37.BIN	0xe1033784
FF43.BIN	0xb6dee1c3
FF32-32m.bin	0xc747696e
[End]
