formats index
	*** CRT - CaRTridge Files (from the CCS64 emulator)

** Document revision 1.0

  Cartridge files were introduced in the CCS64  emulator,  written  by  Per
Hakan Sundell, and use the ".CRT" file extension. This format  was  created
to handle the non-standard ROM cartridges that exist, such as Action Replay
and the Power cartridge.

  Typically, normal game cartridges loaded into one of two specified memory
ranges ($8000 or $E000), but newer utility cartridges were less  intrusive,
hiding themselves until called upon. Because of this "stealthing" method, a
special cartridge format was necessary,  to  let  the  emulator  where  the
cartridge should reside, as well as any special hardware features it uses.

  Here is a dump of a cartridge  supplied  with  the  CCS  emulator,  which
contains the CCS Machine Language Monitor...

      00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F        ASCII
      -----------------------------------------------   ----------------
0000: 43 36 34 20 43 41 52 54 52 49 44 47 45 20 20 20   C64úCARTRIDGEúúú
0010: 00 00 00 20 01 00 00 00 00 01 00 00 00 00 00 00   úúúúúúúúúúúúúúúú
0020: 43 43 53 4D 4F 4E 00 00 00 00 00 00 00 00 00 00   CCSMONúúúúúúúúúú
0030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   úúúúúúúúúúúúúúúú
0040: 43 48 49 50 00 00 20 10 00 00 00 00 80 00 20 00   CHIPúúúúúúúú€úúú

  Bytes:$0000-000F - 16-byte cartridge signature "C64 CARTRIDGE   "
         0010-0013 - File header  length  ($00000020,  in  high/low  format
                     starting at offset $0000
         0014-0015 - Cartridge version (high/low, presently $0100)
         0016-0017 - Cartridge hardware type ($0000)
                       0 - Normal cartridge
                       1 - Action Replay
                       2 - KCS Power Cartridge
              0018 - Cartridge port EXROM line active
                      0 - inactive
                      1 - active
              0019 - Cartridge port GAME line active
                      0 - inactive
                      1 - active
         001A-001F - Reserved for future use
         0020-003F - 32-byte cartridge name "CCSMON" (null terminated)
         0040-xxxx - Cartridge contents (called CHIP PACKETS, as there  can
                     be more than one per CRT file)

  Folling is the contents of the above HEX dump, from  position  $0040  on.
Note I have re-adjusted the starting address to be $0000, since we are  now
looking at a file contained in the .CRT file, and all size  references  are
from where it starts.

      00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F        ASCII
      -----------------------------------------------   ----------------
0000: 43 48 49 50 00 00 20 10 00 00 00 00 80 00 20 00   CHIPúúúúúúúú€úúú
0010: 00 94 63 94 C3 C2 CD 38 30 00 01 02 03 04 11 06   ú”c”ÃÂÍ80úúúúúúú
0020: 07 08 09 0C 0D 0E 0F 12 13 14 15 17 18 23 24 2A   úúúúúúúúúúúúú#$*
0030: 3B 3A 25 27 2D 2B 2C 05 00 10 FF FF 10 8B B6 91   ;:%'-+,úúúúúú‹¶‘
0040: B2 87 DE 8B A5 93 DC 82 64 83 2E 91 82 85 B8 88   ²‡Þ‹¥“Ü‚dƒ.‘‚…¸ˆ

  Bytes:$0000-0003 - Contained ROM image signature "CHIP" (note  there  can
                     be more than one image in a .CRT file)
         0004-0007 - Total packet length ($00002010,  ROM  image  size  and
                     header combined)
         0008-0009 - Chip type
                      0 - ROM
                      1 - RAM, no ROM data
         000A-000B - Bank location (0 - normal cartridge)
         000C-000D - Load address range (high/low format)
         000E-000F - ROM image size (high/low format)
         0010-xxxx - ROM data

ÿ