# CLIO: interrupts, timers, watchdog, expansion bus interface, and its DSP CLIO ("MN7A02IUDB" in MAME's device list) is the I/O chip: the display path (display.md), the interrupt controller, timers and watchdog ('641 V: "timers 608, an interrupt controller 610, and a watchdog timer 612"), the expansion-bus (XBUS) interface (xbus-cdrom.md), the audio DSP (dspp.md) with its DMA FIFOs, and a local DMA arbiter that sends one request at a time to MADAM. Keys as in memory-map.md. Register addresses are wiki-only (tier 3) unless marked. ## Interrupts - Every source goes to the ARM60's **nFIQ** (wiki: 0x040 "Triggers ARM's FIQ"; MAME's trace spends 8% of a BIOS window in fiq32). Whether anything drives nIRQ is U20. - Registers: 0x040 read pending / write sets (software trigger), 0x044 write clears pending, 0x048 read enables / write sets, 0x04C write clears enables; a second word at 0x060-0x06C. - Bits of the first word: 0 VINT0, 1 VINT1, 2 EXINT (XBUS), 3-10 timers 15, 13, 11, 9, 7, 5, 3, 1, 11 audio timer, 12-15 DSP->RAM DMA 0-3, 16-28 RAM->DSP DMA 0-12, 29 XBUS DMA done, 30 unknown (watchdog?), 31 "see the second word". Second word: 2 FMV module, 4-7 FMV DMA, 8 DMA controller. Priority is software's (higher bit first). - DOC side: Portfolio registers its graphics handler as a "FIRQ" on INT_V1 (VINT1), priority 250, and swaps the even/odd VDLs there ('876 code). An interrupt makes the cel engine pause ('641 VI.F). - VINT0/VINT1 line registers 0x008/0x00C: the wiki's FreeDO-derived reading ("line to trigger") and its 3DOessence reading ("even/odd fields only") disagree (C9). - MADAM's player-bus DMA end reaches CLIO as a CCODE information code ('641 III.D); which interrupt bit it raises is U21. ## Timers (wiki opera_clio; DOC only that "timers" exist) 16 16-bit timers at 0x100-0x17F (count, reload per timer); control nibbles set at 0x200 (timers 0-7) / 0x208 (8-15), cleared at 0x204 / 0x20C; nibble bits: 0 enable/decrement, 1 reload at underflow (else stop at 0xFFFF), 2 cascade from the previous timer, 3 "flabcode" (unknown). Only odd timers interrupt. 0x220 "possibly the tick rate": the FZ-10 BIOS writes 0x150 (336) and starts timer 14 with 61 and timer 15 cascaded (wiki, from the firmware). The timer clock and prescaler are undocumented (U22). MAME's run reads 0x100/0x110 4,309 times and 0x108 8,618 times in 600 frames: the OS's time base. ## Watchdog, counters, random numbers - A hardware watchdog exists ('641); register, timeout and action are U23. The wiki notes games writing 0x0B to 0x02C every field ("MAME suggests it is a watchdog", second-hand). - 0x030 HCNT (wiki, after MAME), 0x034 VCNT: line in bits 10:0, field in bit 11 (bit layout DOC '876 `hardware.h`; address wiki). MAME's run reads 0x034 1,074,043 times in 600 frames (polling loops). - A hardware random number source exists (DOC: `ReadHardwareRandomNumber()` is a kernel SWI "that uses the hardware", '876; the VDL's RANDOMEN uses one); the wiki places a 16-bit PRNG at 0x17F0 and seeds at 0x038/0x03C. - 0x028 reset reason; 0x410/0x414 "first/second DIPIR" (active, happened before reset, device number) (wiki). ## The expansion bus interface ('641 V.C) The CPU writes an expansion-bus address to one register, then reads or writes data at a second; two DMA groups (burst 4) move blocks; EXINT and "XBUS DMA done" interrupt. Register addresses are U24 (wiki: DMA at MADAM 0x540/0x544). Protocol in xbus-cdrom.md. ## The DSP: apply the CPU rule The DSP (the "DSPP") is a programmable processor with its own 16-bit instruction set, a 20-bit datapath, a multiplier, a barrel shifter, flags, branches with a delay slot, a subroutine level, and user-loaded relocatable programs. By the chip rule a CPU gets its own core repository. It also has a second consumer: MAME runs the same `dspp` device (`src/devices/cpu/dspp/`, filed under CPUs, with a disassembler and a recompiler) in the 3DO M2 (`konami/3dom2.cpp`, the Konami M2 arcade boards); MAME's file names and placement are facts read from its tree listing, not its source. dspp.md has the programmer's model; the handoff brief proposes `dspp-python` (open decision 2). ## Unknowns and contradictions (this page) U20 nIRQ use; U21 player-bus DMA interrupt bit; U22 timer clock and prescaler, "flabcode"; U23 the watchdog; U24 XBUS register addresses. C9 VINT line registers.