#                                     #
# Knights of the Round (World) driver #
#                                     #

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

GAMENAME    " Knights Of The Round (Japan) "     
DIRECTORY   KNIGHTSJ
PARENT	    KNIGHTS
CPSTYPE     CPS1
DATE		1991

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

0x000000  0x1FFFFF  MAINROM
0xff0000  0xfFFFFF  MAINRAM

[dataReadByteRegions]

0x000000  0x1FFFFF  MAINROM
0x800000  0x800001  INPUTPORT2
0x800010  0x800011  INPUTPORT2
0x800018  0x80001f  INPUTPORT1
0x800100  0x8001ff  VIDEOPORTS
0x90c000  0x90dfff  PALETTERAM 
0x900000  0x92ffff  VIDEORAM 
0xf1c006  0xf1c007  EEPROM
0xff0000  0xfFFFFF  MAINRAM
0x860000  0x8603ff  EXTRARAM  1
0x915800  0x930000  EXTRARAM  2
0xf18000  0xf19fff  QSOUND1
0xf1e000  0xf1ffff  QSOUND2

[dataReadWordRegions]

0x000000  0x1FFFFF  MAINROM
0x800000  0x800001  INPUTPORT2
0x800010  0x800011  INPUTPORT2
0x800018  0x80001f  INPUTPORT1
0x800100  0x8001ff  VIDEOPORTS
0x90c000  0x90dfff  PALETTERAM 
0x900000  0x92ffff  VIDEORAM 
0xf1c006  0xf1c007  EEPROM
0xff0000  0xfFFFFF  MAINRAM
0x860000  0x8603ff  EXTRARAM  1
0x915800  0x930000  EXTRARAM  2
0xf18000  0xf19fff  QSOUND1
0xf1e000  0xf1ffff  QSOUND2

[dataWriteByteRegions]

0x800100  0x8001ff  VIDEOPORTS
0x90c000  0x90dfff  PALETTERAM 
0x900000  0x92ffff  VIDEORAM 
0xf1c006  0xf1c007  EEPROM
0xff0000  0xfFFFFF  MAINRAM
0x860000  0x8603ff  EXTRARAM 1
0x915800  0x930000  EXTRARAM 2
0xf18000  0xf19fff  QSOUND1
0xf1e000  0xf1ffff  QSOUND2

[dataWriteWordRegions]

0x800100  0x8001ff  VIDEOPORTS
0x90c000  0x90dfff  PALETTERAM 
0x900000  0x92ffff  VIDEORAM 
0xf1c006  0xf1c007  EEPROM
0xff0000  0xfFFFFF  MAINRAM
0x860000  0x8603ff  EXTRARAM 1
0x915800  0x930000  EXTRARAM 2
0xf18000  0xf19fff  QSOUND1
0xf1e000  0xf1ffff  QSOUND2

#                                         #
# Protection                              #
#                                         #
[protection]

# If port(PORT) is read, returns (VALUE) #
PORT    0xff
VALUE   0xffff
MULTIPLY 0x46 0x44 0x42 0x40


#                      #
# Graphics information #
#                      #
[graphics]

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

# Path                     Size    Where  #
LOAD8 kr_gfx2.rom 0x80000 0x000000
LOAD8 kr_gfx6.rom 0x80000 0x080000
LOAD8 kr_gfx1.rom 0x80000 0x100000
LOAD8 kr_gfx5.rom 0x80000 0x180000
LOAD8 kr_gfx4.rom 0x80000 0x200000
LOAD8 kr_gfx8.rom 0x80000 0x280000
LOAD8 kr_gfx3.rom 0x80000 0x300000
LOAD8 kr_gfx7.rom 0x80000 0x380000

#               Number of tiles Base addr   Decode info #
DECODECHARS     0x2000          0x080000    0x200000
DECODESPRITES   0x8000          0x000000    0x200000 0x100000
DECODESCROLL2   0x4000          0x080000    0x200000 0x100000
DECODESCROLL3   0x0800          0x0c0000    0x200000 0x100000 


#                     #
# program information #
#                     #
[program]

ROMSIZE 0x100000

# Type of load path 1                    path 2                       Size    where #
LOADROMEVENODD krj30.bin krj37.bin    	 0x20000 0x00000
LOADROMEVENODD krj31.bin krj38.bin    	 0x20000 0x40000
LOADROM16SWAP  kr_22.rom                 0x80000 0x080000



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

LAYERCONTROL    0x68                # Layer control port                     #
SCROLL1BASECODE 0x0000              # scroll1 tile base                      #
SCROLL1CODEMASK 0x2000              # scroll1 tile mask(=number of tiles)    #
SCROLL2BASECODE 0x0000              # scroll2 tile base                      #
SCROLL2CODEMASK 0x4000              # scroll2 tile mask(=number of tiles)    #
SCROLL3BASECODE 0x0000              # scroll3 tile base                      #
SCROLL3CODEMASK 0x0800              # scroll3 tile mask(=number of tiles)    #
PRIORITYMASKS   0x66 0x64 0x62 0x60 # the ports where to read the priorities #
LAYERENABLE 0x20 0x10 0x02 0x00
FORCESCROLLPRIORITY 0x01            # 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 1                    # 0=no 1=yes #
[z80]
TOTAL 0x10000
LOAD8 kr_09.ROM 0x10000 0x000000 # main rom and banks #

[samples]
TOTAL 0x40000
LOAD8 kr_18.ROM  0x20000 0x00000
LOAD8 kr_19.ROM  0x20000 0x20000


[End]

[verifyRoms]
kr_gfx2.rom	0xf095be2d
kr_gfx6.rom	0x0200bc3d
kr_gfx1.rom	0x9e36c1a4
kr_gfx5.rom	0x1f4298d2
kr_gfx4.rom	0x179dfd96
kr_gfx8.rom	0x0bb2b4e7
kr_gfx3.rom	0xc5832cae
kr_gfx7.rom	0x37fa8751
krj30.bin	0xad3d1a8e
krj37.bin	0xe694a491
krj31.bin	0x85596094
krj38.bin	0x9198bf8f
kr_22.rom	0xd0b671a9
[End]
