Carnivore2 Technical Description (English)
Carnivore2 Technical Description (English)
This is the detailed technical description and documentation for the multi-functional Carnivore2 cartridge that was created by
RBSC.
The location of the Boot Menu, directory and BIOSes in the FlashROM chip is described below. There are logical and physical
blocks and they have different numbering.
The FlashROM chip that is used in Carnivore2 has 8 logical blocks in the first physical 64 KB block and then go the rest of 64
KB physical blocks. In the logical blocks there are Boot Menu and directory. The next few blocks are allocated for the BIOSes
of the embedded devices.
1/16
8 KB blocks
The first 8 logical 8 KB blocks are grouped into the first physical block that is addressed by the AddrFr register. Logical blocks
0, 1, 6 and 7 contain the Boot Menu's code and data. Blocks 2 and 3 contain directory entries. Then go 2 blocks that are
reserved for future use.
Block
Address range Description
number
after power on (AddrFR=#00, R1Mult=“10000101” B1AdrD = #4000) is visible in
000000h–001FFFh 0 subslot 0 at address #4000–#5FFF and contains the first 8 KB of boot menu (ROM
“AB” header + start addresses)
after power on is visible in subslot 0 at addresses #6000-#7FFF (bits 2–0 of R1Mult =
002000h–003FFFh 1 “101” are the size of the shown block (16 KB)) and contain the second 8 KB of boot
menu
004000h–005FFFh 2 directory entries
006000h–007FFFh 3 directory entries
008000h–009FFFh 4 not used
00A000h–00BFFFh 5 not used
00C000h–00DFFFh 6 used for the data of the Boot Menu
00E000h–00FFFFh 7 used for the data of the Boot Menu
64 KB blocks
After the first 8 logical 8 KB blocks that form the first physical block, there go the physical 64 KB blocks of the FlashROM.
Physical block
Address range Logical block number Description
number
010000h–01FFFFh 8 1, AddrFR=#01 contain the IDE BIOS
020000h–02FFFFh 9 2, AddrFR=#02 contain the IDE BIOS
030000h–03FFFFh 10 3, AddrFR=#03 contains FMPAC BIOS
040000h–04FFFFh 11 4, AddrFR=#03
050000h–05FFFFh 12 5, AddrFR=#03
Data blocks — these blocks are used for saving
… … …
the ROM images (games, etc.)
… … …
7F0000h–7FFFFFh 134 127, AddrFR=#7F
FlashROM chip
Block layout:
#00000 8K
#02000 8K
#04000 8K
#06000 8K
#08000 8K
#0A000 8K
#0C000 8K
#0E000 8K
2/16
#10000 64K x 127
Commands:
AUTOSELECT #90
WRITE #A0
CHIP_ERASE #10
BLOCK_ERASE #30
RESET #F0
Block 0 is reserved for the directory and the boot menu: BOOTCMFC.BIN
Blocks 1–2 are reserved for the IDE BIOS: BIDECMFC.BIN
Block 3 is reserved for the FMPAC BIOS: FMPCCMFC.BIN
The OPLL emulation (FMPAC) that is supported by the cartridge is mapped to ports #7C–7D.
The FMPAC SRAM is emulated by using the 8 KB of the upper area of the 1st megabyte of RAM (shadow RAM) that is not
shared with the memory mapper. The physical address of the 8 KB area for SRAM in the shadow RAM is 0FE000h–0FFFFFh.
NOTE: The settings of SRAM will be lost after powering down unless the cartridge has the backup battery installed.
To enable 8 KB of SRAM at address 4000h–5FFFh, set 4Dh to 5FFEh and 69h to 5FFFh.
This EEPROM is used to store additional configuration settings. Using the EEPROM prevents the important configuration
settings from being lost after power goes down. The location of the settings in the EEPROM and their description can be found
i the table blow.
Address Description
01 FMPAC and SCC volume, 3 bits per value, max volume is 8, first 2 bits are used as flags
02 50 or 60 Hz VDP frequency flag, bit 1 from this byte is used — if this bit is zero then 60 Hz is used
PSG and clicker enable/disable flags and volumes, 3 bits per volume, max volume is 8, first 2 bits are used as
03
enable/disable flags
04 Entry sorting (0=disabled)
05 Fade in/out effects (0=disabled)
06 Keyboard/joystick speed (this is an increment for default value)
3/16
Address Description
07
Menu font palette
08
09
Menu background palette
0A
0B
Help font palette
0C
0D
Help background palette
0E
0F
Volume font palette
10
11
Volume background palette
12
13
PSG/PPI font palette
14
15
PSG/PPI background palette
16
17 Custom settings in use flag (must be #42)
18 Double reset on “cold boot” (1=enabled)
19 FMPAC mono (1=enabled)
1A Last used entry
1B Music playback status
1C Autostart entry number
1D Help scroller status
1E Dual-PSG status
1F Autostart delay
20 Slot 3 usage flag
21 User-configurable ID and control port number
Writing to EEPROM is done via the configuration register CardMDR+#23. The commands for EEPROM are saved into this register
in a sequence that is described in the chip's datasheet. Only write–enable, read and write commands are used.
Configuration registers
The configuration registers are located at addresses #0F80 or #4F80 or #8F80 or #CF80h. Their visibility and location is
controlled by the main control register's first byte — at address #4F80. The main control register is called CardMDR. After
power on, the registers are located at address #4F80. All registers are write–only except the pseudo–register for
sending/receiving the data when accessing the FlashROM and the register for the configuration EEPROM, as well as 3 bytes of
the firmware version - FPGA_ver.
4/16
Register number, name Bit number Value Description
04 DatM0 pseudo–register for sending/receiving data from/to FlashROM
register controlling the number of FlashROM's 64 KB block for ROM emulation
05 AddrFR
The default value of this register is 00h
06 R1Mask
07 R1Addr
08 R1Reg Configuration registers for bank 1
09 R1Mult
0A B1MaskR
0C R2Mask
0D R2Addr
0E R2Reg
Configuration registers for bank 2
0F R2Mult
10 B2MaskR
11 B2AdrD
12 R3Mask
13 R3Addr
14 R3Reg
Configuration registers for bank 3
15 R3Mult
16 B3MaskR
17 B3AdrD
18 R4Mask
19 R4Addr
Configuration registers for bank 4
1A R4Reg
1B R4Mult
1C B4MaskR similar to B1MaskR
1D B4AdrD similar to B1AdrD
1E Mconf Expanded slot configuration register
1F CMDRCpy copy of the CardMDR+#00 register (to be used with LDIR command)
FlashROM chip's configuration
20 ConfFl
The default value of this register is — 010b
0 8 bit bus
2
1 16 bit bus
1 Reset/protect flag
1 enable 12V for boosted writing into FlashROM
0
0 зdisable 12V for boosted writing into FlashROM
Non-standard Register
21 NSReg
The default value of this register is #00, please don't change it!
volume level register
22 SndLVL
The default value of this register is 1Bh (00011011b)
10 = FMPAC mono,
7, 6
00 = FMPAC stereo
5, 4, 3 FMPAC audio level (0–7)
2, 1, 0 SCC/SCC+ audio level (0–7)
23 CfgEEPR register for controlling additional configuration EEPROM (93C46)
5/16
Register number, name Bit number Value Description
7, 6, 5, 4 not used
3 EECS signal Chip Select EEPROM
2 EECK signal CLK (sync)
1 EEDI signal Data Input (data sent to EEPROM)
0 EEDO signal Data Output (data received from EEPROM); read–only
PSG control register
24 PSGCtrl
The default value of this register is 1Bh (00011011b)
7 enable/disable PSG
6 enable/disable PPI Clicker
5, 4, 3 PSG audio level (0–7)
2, 1, 0 PPI Clicker audio level (0–7)
25 reserved for future use
26 reserved for future use
27 reserved for future use
activation flag for interceptor code on system restart or read from #4000
0
1 enabled
interceptor code's location
1 0 boot menu in FlashROM
1 first shadow RAM block
28 SLM_cfg per–device subslot assignment (master slot)
7
FMPAC subslot number
6
5
RAM (Mapper MMM) subslot number
4
3
IDE (CF) subslot number
2
1
FlashROM/SCC subslot number
0
29 SCART_cfg slave slot control register
1 slave slot enabled
7
0 slave slot disabled
1 slave slot's location assigned by user
6
0 slave slot assigned as subslot of master slot
1 slave slot expanded (if not used as a subslot of master slot)
5 slave slot non–expanded (if not used as a subslot of master
0
slot)
1 master slot's location is assigned by user
4
0 master slot located at the physical slot
1
3 not used
0
allow slot select register for emulated slot (used only for slots 1
1
and 2)
2
disable slot select register for emulated slot (real slot's register
0
will be used)
6/16
Register number, name Bit number Value Description
2A SCART_SLT slot/subslot configuration on power–on
00 = mini ROM up to 32 KB without mapper
01 = K4 mapper
7, 6
10 = K5 mapper without SCC
11 = K5 mapper + SCC
5, 4 master slot number
3, 2 expanded slave slot number
1, 0 slave slot number
2B SCART_StBl slave slot's 64 KB block assignment in FlashROM
2C, 2D, 2E FPGA_ver FPGA firmware version (3 ASCII bytes)
2F MROM_offs = mini ROM offset in 64 KB block (in 8 KB steps)
30 PSGAlt PSG port configuration
1 reserved
1 alternative ports: #10-#11
0
0 default ports: #A0-#A1
35 PFXN User-configurable I/O port number for ID and control
1. RnMask
2. RnAddr
3. RnReg
4. RnMult
5. BnMaskR
6. BnAdrD
RnMask
Bitmask for bank's register address. This value is normally mirrored into several addresses, for example for Konami 5
cartridges those addresses for the first bank are 5000h–57FFh. Here we use only the high byte's address — F8h (11111000b).
RnAddr
High byte of the bank's address register (example: 50h for address 5000h)
RnReg
7/16
RnMult
BnMaskR
Bitmask for bank's addressing mode into the FlashROM. This is the ROM's emulated size and the number of pages. For
example for a 128 KB ROM we will need 16 pages of 8 KB, so we set the 0Fh (00001111b) mask.
BnAdrD
High byte of the bank's address (example: 40h for address 4000h).
CardMDR
00 CardMDR — main cartridge's configuration register
8/16
Bit number Value Description
1 delayed configuration
3
0 configuration is changed immediately after updating the registers
0 delayed configuration is enabled after CPU executes at address 0000h
2 configuration is enabled after reading from address 4000h
1
The delayed configuration works only for AddrFR and bank control registers
source for BIOS of embedded devices
0 BIOS data (boot menu, IDE controller, FMPAC) is read from FlashROM chip
1
BIOS data (boot menu, IDE controller, FMPAC) is read from RAM
1
Warning! The data must be copied into DAM before setting this bit!
configuration registers visibility control
all configuration registers are visible at addresses 0F80h/4F80h/8F80h/CF80h depending on the
0
0 values of bits 5 and 6
configuration registers are not visible, 1 byte of data from the corresponding block in the FlashROM
1
is available at those addresses
Mconf
1E Mconf — expanded slot configuration register
There are 253 user–controlled directory entries available in the cartridge. The first directory entry can't be edited or deleted
because it sets the default cartridge's configuration — all enabled. The directory is 8 KB in size and is located in the 2 and 3
logical blocks of the FlashROM chip at addresses 004000h–005FFFh (block 2) and 006000h–007FFFh (block 3). The physical
block number (controlled by the AddrFr register) is zero.
Each directory entry occupies 40h (64 bytes) and has the following format:
9/16
Register number Name Bit number Value/description
#23 R1Mask
#24 R1Addr
#25 R1Reg
Configuration registers for bank 1
#26 R1Mult
#27 B1MaskR
#28 B1AdrD
#29 R2Mask
#2A R2Addr
#2B R2Reg
Configuration registers for bank 2
#2C R2Mult
#2D B2MaskR
#2E B2AdrD
#2F R3Mask
#30 R3Addr
#31 R3Reg
Configuration registers for bank 3
#32 R3Mult
#33 B3MaskR
#34 B3AdrD
#35 R4Mask
#36 R4Addr
#37 R4Reg
Configuration registers for bank 4
#38 R4Mult
#39 B4MaskR
#3A B4AdrD
#3B Mconf expanded slot configuration register
#3C CardMDR main configuration register
#3D PosSiz size and position in 64 KB block for mini ROMs
#3E RstRun reset and start options
#3F Resrv Reserved
PosSiz
PosSiz — size and position in 64 KB block for mini ROMs
10/16
Bit number Value/description
offset of mini ROM in 64 KB block
based on ROM's size:
8 KB 16 KB 32 KB
000b 0 KB 0 KB 0 KB
001b 8 KB 16 KB 32 KB
6,
010b 16 KB 32 KB
5,
4 011b 24 KB 48 KB
100b 32 KB
101b 40 KB
110b 48 KB
111b 56 KB
RstRun
RstRun — reset and start options
Mappers
The cartridge supports a few common mappers and the linear mode that allows first 64 KB of the MiniROM to be visible in the
address space. The physical addresses allocated for the mappers' operation lie in the range of 100000h–1FFFFFh. This means
that only the second megabyte of RAM is used.
11/16
M mini ROM (8, 16, 32, 48 and 64 KB ROM without mapper)
C configuration entry
U unknown mapper
ASCII8
The cartridge supports the ASCII8 mapper.
ASCII16
The cartridge supports the ASCII16 mapper.
Konami4
The cartridge supports the Konami4 mapper.
Konami5
The cartridge supports the Konami5 (SCC) mapper.
12/16
MiniROM
The cartridge supports MiniROM (ROM images up to 49 KB) without mapper.
Linear 64 KB mode
The cartridge supports the linear 64 KB mode, when the first 64 KB of the ROM are visible in the address space.
#0000–#3FFF bank 1
#4000–#7FFF bank 2
#8000–#BFFF bank 3
#C000–#FFFF bank 4
Below you can find the default values for several configuration registers.
13/16
Address (byte) Description
#01 R1Mask
#02 R1Addr
#03 R1Reg
Configuration registers for bank 1
#04 R1Mult
#05 B1MaskR
#06 B1AdrD
#07 R2Mask
#08 R2Addr
#09 R2Reg
Configuration registers for bank 2
#0A R2Mult
#0B B2MaskR
#0C B2AdrD
#0D R3Mask
#0E R3Addr
#0F R3Reg
Configuration registers for bank 3
#10 R3Mult
#11 B3MaskR
#12 B3AdrD
#13 R4Mask
#14 R4Addr
#15 R4Reg
Configuration registers for bank 4
#16 R4Mult
#17 B4MaskR
#18 B4AdrD
#19 Mconf
#1A CardMDR
#1B PosSiz
#1C RstRun
#1D Not used, always FF
Carnivore2 can be detected and controlled via its own configurable port #F0-F2. The following I/O operations are possible:
14/16
Write “M” to port, the cartridge will set the default configuration (all devices enabled)
Links
15/16
https://sysadminmosaic.ru/en/msx/carnivore2/specification
2024-02-27 08:53
16/16