#                                     #
# FinalFight (USA 900112) driver      #
#                                     #
# Driver by Tuor                      #
# tuor@wanadoo.fr                     #
#                                     #

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

GAMENAME    " Final Fight (USA) "
DIRECTORY   FFIGHTU
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]

# If port(PORT) is read, returns (VALUE) #
PORT    0x60
VALUE   0x04

#                      #
# Graphics information #
#                      #
[graphics]

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

# Path                     Size    Where  #
LOAD8 ff01-01m.bin 0x80000 0x000000
LOAD8 ff05-05m.bin 0x80000 0x080000
LOAD8 ff03-03m.bin 0x80000 0x100000
LOAD8 ff07-07m.bin 0x80000 0x180000

#               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 36 42    0x20000 0x00000
LOADROMEVENODD 37 43    0x20000 0x40000
LOADROM16SWAP  FF32-32M.bin                             0x80000 0x80000


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

LAYERCONTROL    0x66                # 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   0x68 0x6a 0x6c 0x6e # the ports where to read the priorities #
LAYERENABLE 	0x02 0x04 0x08 0x30
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]
ff01-01m.bin	0x0b605e44
ff05-05m.bin	0x9c284108
ff03-03m.bin	0x52291cd2
ff07-07m.bin	0xa7584dfb
36	0xe2a48af9
42	0xf4bb480e
37	0xc371c667
43	0x2f5771f9
FF32-32M.bin	0xc747696e
[End]
