| |
TWW
Registered: Jul 2009 Posts: 545 |
.crt File Format clarifications
Hiho
Been trying to read up on the whole cartridge .crt file format depicted in codebase.
Have a couple of things I wish to clarify:
#1: Under CHIP contents, the following is stated:
0008-0009 - Chip type
0 - ROM
1 - RAM, no ROM data
2 - Flash ROM
Does this goes into memory as little or big endian? Can't find any examples of other than type $0000 (not that it would matter anyway but for sake of good order).
#2: Is there any "rule" for which RAM bank is visible first upon bootup?
#3: For the Ocean Type #1 Cartridge, is the following statement correct:
Size1 - 128Kb (16 banks of 8Kb each, all mapped to $8000)
Size2 - 256Kb (32 banks of 8Kb each, lower 16 banks are mapped to $8000 and the upper 16 banks are mapped to $a000)
Size3 - 512Kb (64 banks of 8Kb each, all mapped to $8000)
#4a: If it is, how is it determined where the cartridge banks it's memory (i.e., is it the CHIP header which determines if a memory bank goes to $8000 or $a000 or is something else)?
#4b: How is it really working then?
#5: Under Ocean Type 1 the following is said regarding bank switching: "Bank switching is done by writing to $DE00. The lower six bits give the bank number (ranging from 0-63). Bit 8 in this selection word is always set.". Shouldn't it be "selection byte is always set."?
#6: The Bank Numbering scheme on Ocean Loader #1, how does it look for the different cartridge types (128, 256 & 512kB)?
Cheers! |
|
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
look here and here ... (please complain on the bugtracker if something is missing or unclear or even incorrect :))
#1: big endian like all other... however, dont expect it to do anything useful when it is 1 or 2. for ocean cart it should be 0 :)
#2: i dont understand the question... the behaviour of the cartridge depends on the respective hardware type. ocean carts start with bank 0, see here (generally i recommend looking at the respective source file in vice when looking for info on how a cartridge works, they all contain a description of the hardware now)
#3: not exactly correct - see the comment at the top here :o)
#4a see #2 :) the loading address in the chip header is a somewhat strange leftover from the early days, and must match fixed values that are typical for the respective type of cartridge. (similar to the GAME/EXROM setting in the crt header)
#4b see above :=) the whole crt format is somewhat badly defined, many things depend on the actual cartridge hardware (crt id)
#5: yeah bad wording. it should be byte/register/whatever (and bit7 =D)
#6: banks are almost always banked linear in crt files (there are exceptions, unfortunately) |
| |
TWW
Registered: Jul 2009 Posts: 545 |
Thanx for the info Gpz.
Based on the linked VICE source code and your comments, I believe I have understood how the cartridge image files are interpeted by the emulator.
As you said, type and then crossreferenced sith size to determine the actual configuration of the cartridge.
Also explains why you need to pad the cartridge to exact size to make it work. |
| |
TheRyk
Registered: Mar 2009 Posts: 2246 |
Also be aware that you sometimes have to manipulate the header as a quick and dirty way to make EasyFlash believe non-Ocean type CRT such as RGCD stuff were Ocean ;) |
| |
Count Zero
Registered: Jan 2003 Posts: 1932 |
For me building a ROM bin file and running that with the switches for vice usually works best. Finally pass the bin to cartconv and all is fine. |