MTX Registers

MTX Registers

These registers are responsible for controlling how framebuffer data can be DMA’d from the DS GPU, and also for configuring the upscaling matrix.

Registers #

The physical address can be calculated by subtracting 0xEB00000 from the virtual address.

Control #

VAddressNameWidth
0x1EC1x000MTX_CNT4
0x1EC1x004MTX_SIZE4
0x1EC1x008MTX_ACK4
0x1EC1x00CMTX_IE4
0x1EC1x020???4

Matrix unit #

There are two matrix units, one at +0x200 for vertical (Y) scaling, and the other one at +0x300 for horizontal (X) scaling.

VAddressNameWidthDescription
0x1EC1xn00KRN_WIDTH4Kernel width - 1 is written here, 1 <= width <= 8

This decides how many pixels are written each batch.

0x1EC1xn04KRN_PATTERN_BITS4If the corresponding bit for the current batch iteration index is set then a new pixel is read.

The amount of set bits determine how many pixels are read each batch. Any bit indexes past KRN_WIDTH are ignored.

This value is 8 bits, but it has to be written with a 32bit write.

0x1EC1xn40KRN_MTX0xC0int kerneldata[6][8]; - matrix data is written here, height is always 6

Descriptions #

MTX_CNT #

Bit(s)Description
0Enable bit
1Enable vertical matrix
2Enable horizontal matrix
4???
5???
8-9Input pixel mode? 0 = 4byte color, 1 = 3byte color, 2 = 2byte color, 3 = 2byte color
10-11Output framebuffer rotation: 0 = normal, 1 = 90° CW (right), 2 = 180° CW (upside down, not mirrored), 3 = 270° CW (left)
12Output tiling for use with the GPU. When set, the output width and height must be a multiple of 8.
15Start bit (setting this will eventually raise MTX interrupt 0)
16Data still available flag (?)

MTX_SIZE #

Bit(s)Description
0-8Output framebuffer width - 1 is written here, 1 <= width <= 512
16-25Output framebuffer height - 1 is written here, 1 <= height <= 512

MTX_ACK #

Reading this register will return pending interrupts. Writing this register will acknowledge pending interrupts where the bits are set.

Bit(s)Description
0FIFO ready (signal to start DMA)
1FIFO overrun(?) (occurs if DMA is too slow)
2FIFO underrun(?) (occurs on VBlank)

MTX_IE #

Interrupt Enable for the above interrupts.