# SCU: buses, DMA, interrupts, timers, and its DSP Sources: the SCU User's Manual, third version (ST-097-R5, cited SCU) and the SCU Final Specifications: Precautions (ST-210, 1994-10-16, cited SCUF), which **overrides** the manual in 36 numbered items. Read SCUF first: it deletes registers (DMA status, forced stop), forbids uses (SCU-DMA to Work RAM-L, writes to the A-bus by DMA, DMA reads from VDP2), and changes DMA start rules. StrikerX3's SCU DMA test adds a few results captured on a real console (validation.md). ## The hub (DOC: SCU 1.1, OVW 3.2) The SCU sits between the CPU bus (the SH-2 pair, Work RAMs, ROM, SMPC), the A-bus (cartridge, CD block) and the B-bus (VDP1, VDP2, SCSP). It converts bus widths and timings (A-bus wait and burst settings in ASR0/ASR1, refresh in AREF; DOC: SCU 3.6), arbitrates, and lets the CPU work in Work RAM-H while a DMA runs between the A- and B-bus. SCUF No. 08 says the CPU must not touch the A- or B-bus during an A<->B DMA; SCUF No. 12 says CPU writes to the A/B-bus delay a DMA start. What happens if software does it anyway is not documented (U9). ## DMA (DOC: SCU 2.1, 3.2; SCUF) - Three levels (0, 1, 2) plus the DSP's own DMA command; direct and indirect (table) modes; start by register or by one of eight factors (V-blank in/out, H-blank in, the two timers, sound request, sprite draw end, or the register write; SCU 3.2 and SCUF No. 21's changed start method with the separate enable bit). - Address update and stride rules depend on the bus (SCUF Nos. 16-19); no more than two channels run with guaranteed priority (SCUF No. 20); level 2 may not start during level 1 (SCUF No. 35). - Hardware results (DOC/TEST ROM: StrikerX3 saturn-tests `scu-dma/README.md`, "results from hardware tests taken from an earlier version of the test app"): same-bus transfers are ignored, all three levels behave alike, and B-bus <-> Work RAM transfers with +0/+4 strides give the byte patterns its table lists. - Cycle costs per transfer are not in any Sega document (U10). ## Interrupt controller (DOC: SCU 2.2, table 2.1) Sixteen internal factors on bits 0-13 and sixteen A-bus external interrupts on bits 16-31, each with a fixed vector and level: V-blank in 40h level F, V-blank out 41h E, H-blank in 42h D, timer 0 43h C, timer 1 44h B, DSP end 45h A, sound request 46h 9, system manager (SMPC) 47h 8, pad 48h 8, level 2/1/0 DMA end 49h-4Bh (levels 6, 6, 5), DMA illegal 4Ch 3, sprite draw end 4Dh 2, A-bus 50h-5Fh (levels 7, 4, 1). The SCU drives the master SH-2's IRL lines and supplies the vector. Which interrupts reach the **slave** SH-2, and how, is not in the SCU manual or the Dual CPU guide (DUAL 4.4 says the boot ROM enables only the slave's FRT input-capture interrupt) (U11). Writing the status register IST is prohibited (SCUF No. 07). ## Timers (DOC: SCU 3.4; SCUF Nos. 30-31) Timer 0 counts H-blank-in signals, is cleared at the end of V-blank, and interrupts when it equals T0C. Timer 1 reloads T1S at each H-blank-in and counts down "by 7 MHz" (the dot clock), interrupting at 0, every line or only on the line timer 0 matched (T1MD; SCU 3.4). CMH measured T1S's usable range: 1-426 at 320 mode, 1-454 at 352 mode. Both are tied to VDP2's timing, so they are a channel from the video domain into the CPU domain. ## The SCU DSP (DOC: SCU 2.3, ch. 4; DSPASM) - A fixed-point DSP for matrix and coordinate work: program RAM 256 x 32 bits, data RAM 4 banks x 64 x 32 bits, a 32 x 32 -> 48-bit multiply (DOC: OVW table 3.2), an ALU on the 48-bit accumulator, the A/P/X/Y/RX/RA0/WA0 registers, conditional jumps, LOOP and END/ENDI, and a DMA command between its data RAM and the buses (SCU ch. 4: block map, command list, operand rules). - It runs at half the CPU clock (DOC: OVW 3.2 "operating frequency"; MAME shows 14.31 MHz: OBSERVED). - The CPU loads it through the program control port (stop it with bits 16-17 clear, set the address, stream longwords; SCU 2.3) and the data RAM ports; SCUF No. 26 and No. 36 add rules for starting and for reading the control port. - One instruction issues several parallel operations (ALU, X-bus, Y-bus, D1-bus moves); the manual's command list gives the encodings. Overflow and carry corner cases are what the MiSTer and Ymir developers asked Celeriyacon to test on hardware (news reports, sources.md): they are not settled by the manual (U12). - It is a programmable processor with its own instruction stream, so the chip rule makes it a CPU core candidate; see [cpu-cores.md](cpu-cores.md) and open decision 4. ## What the board owns The SCU (bus, DMA, interrupts, timers) stays in the board: Saturn and ST-V only. The DSP is the open question (cpu-cores.md).