<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.3dbrew.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Merry</id>
	<title>3dbrew - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://www.3dbrew.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Merry"/>
	<link rel="alternate" type="text/html" href="https://www.3dbrew.org/wiki/Special:Contributions/Merry"/>
	<updated>2026-04-04T14:02:14Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=ARM7_Registers&amp;diff=21512</id>
		<title>ARM7 Registers</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=ARM7_Registers&amp;diff=21512"/>
		<updated>2021-04-12T09:39:27Z</updated>

		<summary type="html">&lt;p&gt;Merry: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The 3DS utilizes an onboard ARM7 core to handle &amp;lt;code&amp;gt;TWL_FIRM&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;AGB_FIRM&amp;lt;/code&amp;gt;&#039;s ARM7 requirements. This is due to the fact that much of the hardware used by both ARM7 and ARM9 is (evidently) not physically hooked up to ARM11. Thus, ARM11 cannot simply emulate ARM7.&lt;br /&gt;
&lt;br /&gt;
ARM7 has the GBA BIOS implemented in hardware. The BIOS is completely identical to the original GBA BIOS. The system is booted silently by calling &amp;lt;code&amp;gt;SWI 0x1&amp;lt;/code&amp;gt; (a.k.a. &amp;lt;code&amp;gt;RegisterRamReset&amp;lt;/code&amp;gt;), followed by jumping to the code that does &amp;lt;code&amp;gt;SWI 0x0&amp;lt;/code&amp;gt; (a.k.a. &amp;lt;code&amp;gt;SoftReset&amp;lt;/code&amp;gt;) to finish booting. The boot splash is still in BIOS, however, and can be seen by calling or replacing one of the previous interrupts with &amp;lt;code&amp;gt;SWI 0x26&amp;lt;/code&amp;gt; (a.k.a. &amp;lt;code&amp;gt;HardReset&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
==Registers==&lt;br /&gt;
ARM9 interfaces with the ARM7 through the following registers:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type&lt;br /&gt;
! Address&lt;br /&gt;
! Name&lt;br /&gt;
! Size (bytes)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;u8&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;0x10018000&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;ARM7_CNT&amp;lt;/code&amp;gt;&lt;br /&gt;
| 1 &lt;br /&gt;
|-&lt;br /&gt;
| Code&lt;br /&gt;
| &amp;lt;code&amp;gt;0x10018080&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;ARM7_CODE&amp;lt;/code&amp;gt;&lt;br /&gt;
| 32&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;u16&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;0x10018100&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;ARM7_SAVE_MODE&amp;lt;/code&amp;gt;&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;u16&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;0x10018104&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;ARM7_SAVE_MEMORY_CNT&amp;lt;/code&amp;gt;&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;u16&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;0x10018108&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;ARM7_RTC_CNT&amp;lt;/code&amp;gt;&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;u32&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;0x10018110&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;ARM7_RTC_VAL_DATE&amp;lt;/code&amp;gt;&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;u32&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;0x10018114&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;ARM7_RTC_VAL_TIME&amp;lt;/code&amp;gt;&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;u32&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;0x10018118&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;ARM7_RTC_VAL_SETTINGS&amp;lt;/code&amp;gt;&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;u32&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;0x1001811C&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;ARM7_RTC_VAL_ADJUST&amp;lt;/code&amp;gt;&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;u32&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;0x10018120&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;ARM7_SAVE_FLASH_CHIP_ERASE_CYCLES&amp;lt;/code&amp;gt;&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;u32&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;0x10018124&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;ARM7_SAVE_FLASH_SECTOR_ERASE_CYCLES&amp;lt;/code&amp;gt;&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;u32&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;0x10018128&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;ARM7_SAVE_FLASH_PROGRAM_CYCLES&amp;lt;/code&amp;gt;&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;u32&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;0x1001812C&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;ARM7_SAVE_EEPROM_WRITE_CYCLES&amp;lt;/code&amp;gt;&lt;br /&gt;
| 4&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===ARM7_CNT===&lt;br /&gt;
This seems to control the mode of the ARM7. 1 = TWL, 2 = GBA.&lt;br /&gt;
&lt;br /&gt;
===ARM7_CODE===&lt;br /&gt;
This region is an arm7 bootrom overlay, over the vector table at address 0. Once the ARM7 is taken out of reset by &amp;lt;code&amp;gt;TwlProcess9&amp;lt;/code&amp;gt;, the reset vector will be jumped to, beginning execution. &amp;lt;code&amp;gt;TwlProcess9&amp;lt;/code&amp;gt; uses this to put ARM7 in a loop (TWL), and to set the &amp;lt;code&amp;gt;POSTFLG&amp;lt;/code&amp;gt; and branch to more copied code (GBA). Execution is started by writing &amp;lt;code&amp;gt;0x8001&amp;lt;/code&amp;gt; to [[PDN_Registers#LGY_MODE|LGY_MODE]] after setting the mode via &amp;lt;code&amp;gt;ARM7_CNT&amp;lt;/code&amp;gt;. Later, this overlay is disabled by the ARM7 via the &amp;quot;biosprot&amp;quot; register (0x04000308).&lt;br /&gt;
&lt;br /&gt;
Reading uninitialized data in this 32-byte region leads to both screens displaying solid green (exception), and the CPU locking up.&lt;br /&gt;
&lt;br /&gt;
===ARM7_SAVE_MODE===&lt;br /&gt;
This tells the save storage emulation hardware which device type to emulate (64k EEPROM, a 512k Flash chip model, and SRAM are all that have been used officially; several other 512k Flash chip models, two 1 Mbit Flash chip models and 4k EEPROM are also supported). This comes directly from the [[3DS_Virtual_Console#Footer|ROM footer]].&lt;br /&gt;
&lt;br /&gt;
===ARM7_SAVE_MEMORY_CNT===&lt;br /&gt;
This register controls whether the GBA save memory region located at &amp;lt;code&amp;gt;0x08080000&amp;lt;/code&amp;gt; is accessible to ARM9 or to the ARM7 (via the emulated save chip). When it&#039;s set to 0x0 ARM7 has access, while ARM9 has access when it&#039;s set to 0x1.&lt;br /&gt;
&lt;br /&gt;
===ARM7_RTC_CNT===&lt;br /&gt;
This register controls the emulated RTC hardware and access to some of its registers.&lt;br /&gt;
To set or read the data from ARM7_RTC_VAL_SETTINGS or ARM7_RTC_VAL_ADJUST, first &amp;lt;code&amp;gt;ARM7_RTC_CNT&amp;lt;/code&amp;gt;&#039;s bit 15 is waited on. Next &amp;lt;code&amp;gt;ARM7_RTC_CNT&amp;lt;/code&amp;gt; is set to zero. &lt;br /&gt;
&lt;br /&gt;
For a write: the two registers are written, a 1 is written to &amp;lt;code&amp;gt;ARM7_RTC_CNT&amp;lt;/code&amp;gt;, and it is waited on the same as before. Afterwards if bit 14 is not set in &amp;lt;code&amp;gt;ARM7_RTC_CNT&amp;lt;/code&amp;gt;, the value was set successfully. This also starts the emulated RTC.&lt;br /&gt;
&lt;br /&gt;
For a read: a 2 is written to &amp;lt;code&amp;gt;ARM7_RTC_CNT&amp;lt;/code&amp;gt;, it&#039;s waited on again. Afterwards, if bit 14 is not set, the aforementioned registers can be read. Presumably the hardware can be re-enabled by writing a zero to &amp;lt;code&amp;gt;ARM7_RTC_CNT&amp;lt;/code&amp;gt; at this point, but &amp;lt;code&amp;gt;AGB_FIRM&amp;lt;/code&amp;gt; does not.&lt;br /&gt;
&lt;br /&gt;
===ARM7_RTC_VAL_DATE / ARM7_RTC_VAL_TIME===&lt;br /&gt;
These registers are set to the current LgyP9 date+time before the other RTC-related registers are used.&lt;br /&gt;
They contain the following structure, set up on the stack then both u32 registers are written one after the other:&lt;br /&gt;
&lt;br /&gt;
 s8 year_since_2000_bcd;&lt;br /&gt;
 s8 month_bcd;&lt;br /&gt;
 s8 day_bcd;&lt;br /&gt;
 s8 day_of_week;&lt;br /&gt;
 s8 hour_bcd;&lt;br /&gt;
 s8 minute_bcd;&lt;br /&gt;
 s8 second_bcd;&lt;br /&gt;
&lt;br /&gt;
===ARM7_RTC_VAL_SETTINGS===&lt;br /&gt;
This register appears to contain the emulated RTC chip&#039;s configuration (accessible via the &amp;quot;control&amp;quot; register on real hardware), containing settings like 12/24-hour mode. Access is controlled by &amp;lt;code&amp;gt;ARM7_RTC_CNT&amp;lt;/code&amp;gt; (see above).&lt;br /&gt;
&lt;br /&gt;
===ARM7_RTC_VAL_ADJUST===&lt;br /&gt;
This register appears to contain the emulated RTC chip&#039;s time difference, relative to &amp;lt;code&amp;gt;ARM7_RTC_VAL_DATE&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;ARM7_RTC_VAL TIME&amp;lt;/code&amp;gt;, in seconds. Access is controlled by &amp;lt;code&amp;gt;ARM7_RTC_CNT&amp;lt;/code&amp;gt; (see above).&lt;br /&gt;
&lt;br /&gt;
===ARM7_SAVE_FLASH_CHIP_ERASE_CYCLES===&lt;br /&gt;
This register seems to configure the emulated Flash chip to take a specified amount of time to complete a chip erase operation (relative to the DS&#039; ARM7/bus speed). Two variations exist in officially released games, one meant for 512k Flash chips and one for 1 Mbit Flash chips. It is copied from from rom footer + &amp;lt;code&amp;gt;0x10&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===ARM7_SAVE_FLASH_SECTOR_ERASE_CYCLES===&lt;br /&gt;
This register seems to configure the emulated Flash chip to take a specified amount of time to complete a sector erase operation (relative to the DS&#039; ARM7/bus speed). Two variations exist in officially released games, one meant for 512k Flash chips and one for 1 Mbit Flash chips. It is copied from from rom footer + &amp;lt;code&amp;gt;0x14&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===ARM7_SAVE_FLASH_PROGRAM_CYCLES===&lt;br /&gt;
This register seems to configure the emulated Flash chip to take a specified amount of time to complete a program operation (relative to the DS&#039; ARM7/bus speed). Two variations exist in officially released games, one meant for 512k Flash chips and one for 1 Mbit Flash chips. It is copied from from rom footer + &amp;lt;code&amp;gt;0x18&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===ARM7_SAVE_EEPROM_WRITE_CYCLES===&lt;br /&gt;
This register seems to configure the emulated EEPROM chip to take a specified amount of time to complete a write operation (relative to the DS&#039; ARM7/bus speed). Two variations exist in officially released games, one meant for 64k EEPROM chips and one for 4k EEPROM chips. It is copied from from rom footer + &amp;lt;code&amp;gt;0x1C&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Memory map==&lt;br /&gt;
The virtual memory mapping for the ARM7 is the same as for the [[Memory_layout#TWL_FIRM_Userland_Memory|other core]]. However, it has additional internal memory mapped to it. Interestingly enough, much of this memory seems to lie within ARM9&#039;s own internal memory.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0x08060000&amp;lt;/code&amp;gt; → &amp;lt;code&amp;gt;0x03800000&amp;lt;/code&amp;gt;, ARM7 WRAM (64KiB)&lt;br /&gt;
* &amp;lt;code&amp;gt;0x080B0000&amp;lt;/code&amp;gt; → &amp;lt;code&amp;gt;0x03000000&amp;lt;/code&amp;gt;, GBA IWRAM (32KiB)&lt;br /&gt;
* &amp;lt;code&amp;gt;0x08080000&amp;lt;/code&amp;gt; → EEPROM/SRAM/Flash 512k/Flash 1Mbit (the 2 512k banks are contiguous in memory). Access is controlled by &amp;lt;code&amp;gt;ARM7_SAVE_MEMORY_CNT&amp;lt;/code&amp;gt; (see above). &amp;lt;code&amp;gt;0x080C0000&amp;lt;/code&amp;gt; holds a mirror which is used by LgyP9 on boot to read the SD savedata before the mode switch, the data is then copied.&lt;br /&gt;
* &amp;lt;code&amp;gt;0x01FFC000&amp;lt;/code&amp;gt; → &amp;lt;code&amp;gt;0x01000000&amp;lt;/code&amp;gt;, ARM9 ITCM under TWL (16KiB)&lt;/div&gt;</summary>
		<author><name>Merry</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=GPU/Shader_Instruction_Set&amp;diff=20524</id>
		<title>GPU/Shader Instruction Set</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=GPU/Shader_Instruction_Set&amp;diff=20524"/>
		<updated>2017-12-28T17:49:22Z</updated>

		<summary type="html">&lt;p&gt;Merry: clarified constant&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:GPU]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
A compiled shader binary is comprised of two parts : the main instruction sequence and the operand descriptor table. These are both sent to the GPU around the same time but using separate [[GPU/Internal_Registers|GPU Commands]]. Instructions (such as format 1 instruction) may reference operand descriptors. When such is the case, the operand descriptor ID is the offset, in words, of the descriptor within the table.&lt;br /&gt;
Both instructions and descriptors are coded in little endian.&lt;br /&gt;
Basic implementations of the following specification can be found at [https://github.com/smealum/aemstro] and [https://github.com/neobrain/nihstro].&lt;br /&gt;
The instruction set seems to have been heavily inspired by Microsoft&#039;s vs_3_0 [http://msdn.microsoft.com/en-us/library/windows/desktop/bb172938%28v=vs.85%29.aspx] and the Direct3D shader code [https://msdn.microsoft.com/en-us/library/windows/hardware/ff552891%28v=vs.85%29.aspx].&lt;br /&gt;
Please note that this page is being written as the instruction set is reverse engineered; as such it may very well contain mistakes.&lt;br /&gt;
&lt;br /&gt;
Debug information found in the code.bin of &amp;quot;Ironfall: Invasion&amp;quot; suggests that there may not be more than 512 instructions and 128 operand descriptors in a shader.&lt;br /&gt;
&lt;br /&gt;
== Nomenclature ==&lt;br /&gt;
&lt;br /&gt;
* opcode names with I appended to them are the same as their non-I version, except they use the inverted instruction format, giving 7 bits to SRC2 (and access to uniforms) and 5 bits to SRC1&lt;br /&gt;
&lt;br /&gt;
* opcode names with U appended to them are the same as their non-U version, except they are executed conditionally based on the value of a uniform boolean.&lt;br /&gt;
&lt;br /&gt;
* opcode names with C appended to them are the same as their non-C version, except they are executed conditionally based on a logical expression specified in the instruction.&lt;br /&gt;
&lt;br /&gt;
== Instruction formats ==&lt;br /&gt;
&lt;br /&gt;
Format 1 : (used for register operations)&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size (bits)&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
|  0x0&lt;br /&gt;
|  0x7&lt;br /&gt;
|  Operand descriptor ID (DESC)&lt;br /&gt;
|-&lt;br /&gt;
|  0x7&lt;br /&gt;
|  0x5&lt;br /&gt;
|  Source 2 register (SRC2)&lt;br /&gt;
|-&lt;br /&gt;
|  0xC&lt;br /&gt;
|  0x7&lt;br /&gt;
|  Source 1 register (SRC1)&lt;br /&gt;
|-&lt;br /&gt;
|  0x13&lt;br /&gt;
|  0x2&lt;br /&gt;
|  Address register index for SRC1 (IDX_1)&lt;br /&gt;
|-&lt;br /&gt;
|  0x15&lt;br /&gt;
|  0x5&lt;br /&gt;
|  Destination register (DST)&lt;br /&gt;
|-&lt;br /&gt;
|  0x1A&lt;br /&gt;
|  0x6&lt;br /&gt;
|  Opcode&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Format 1i : (used for register operations)&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size (bits)&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
|  0x0&lt;br /&gt;
|  0x7&lt;br /&gt;
|  Operand descriptor ID (DESC)&lt;br /&gt;
|-&lt;br /&gt;
|  0x7&lt;br /&gt;
|  0x7&lt;br /&gt;
|  Source 2 register (SRC2)&lt;br /&gt;
|-&lt;br /&gt;
|  0xE&lt;br /&gt;
|  0x5&lt;br /&gt;
|  Source 1 register (SRC1)&lt;br /&gt;
|-&lt;br /&gt;
|  0x13&lt;br /&gt;
|  0x2&lt;br /&gt;
|  Address register index for SRC2 (IDX_2)&lt;br /&gt;
|-&lt;br /&gt;
|  0x15&lt;br /&gt;
|  0x5&lt;br /&gt;
|  Destination register (DST)&lt;br /&gt;
|-&lt;br /&gt;
|  0x1A&lt;br /&gt;
|  0x6&lt;br /&gt;
|  Opcode&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Format 1u : (used for unary register operations)&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size (bits)&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
|  0x0&lt;br /&gt;
|  0x7&lt;br /&gt;
|  Operand descriptor ID (DESC)&lt;br /&gt;
|-&lt;br /&gt;
|  0xC&lt;br /&gt;
|  0x7&lt;br /&gt;
|  Source 1 register (SRC1)&lt;br /&gt;
|-&lt;br /&gt;
|  0x13&lt;br /&gt;
|  0x2&lt;br /&gt;
|   Address register index for SRC1 (IDX_1)&lt;br /&gt;
|-&lt;br /&gt;
|  0x15&lt;br /&gt;
|  0x5&lt;br /&gt;
|  Destination register (DST)&lt;br /&gt;
|-&lt;br /&gt;
|  0x1A&lt;br /&gt;
|  0x6&lt;br /&gt;
|  Opcode&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Format 1c : (used for comparison operations)&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size (bits)&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
|  0x0&lt;br /&gt;
|  0x7&lt;br /&gt;
|  Operand descriptor ID (DESC)&lt;br /&gt;
|-&lt;br /&gt;
|  0x7&lt;br /&gt;
|  0x5&lt;br /&gt;
|  Source 2 register (SRC2)&lt;br /&gt;
|-&lt;br /&gt;
|  0xC&lt;br /&gt;
|  0x7&lt;br /&gt;
|  Source 1 register (SRC1)&lt;br /&gt;
|-&lt;br /&gt;
|  0x13&lt;br /&gt;
|  0x2&lt;br /&gt;
|  Address register index for SRC1 (IDX_1)&lt;br /&gt;
|-&lt;br /&gt;
|  0x15&lt;br /&gt;
|  0x3&lt;br /&gt;
|  Comparison operator for Y (CMPY)&lt;br /&gt;
|-&lt;br /&gt;
|  0x18&lt;br /&gt;
|  0x3&lt;br /&gt;
|  Comparison operator for X (CMPX)&lt;br /&gt;
|-&lt;br /&gt;
|  0x1B&lt;br /&gt;
|  0x5&lt;br /&gt;
|  Opcode&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Format 2 : (used for flow control instructions)&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size (bits)&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
|  0x0&lt;br /&gt;
|  0x8&lt;br /&gt;
|  Number of instructions (NUM)&lt;br /&gt;
|-&lt;br /&gt;
|  0xA&lt;br /&gt;
|  0xC&lt;br /&gt;
|  Destination offset (in words) (DST)&lt;br /&gt;
|-&lt;br /&gt;
|  0x16&lt;br /&gt;
|  0x2&lt;br /&gt;
|  Condition boolean operator (CONDOP)&lt;br /&gt;
|-&lt;br /&gt;
|  0x18&lt;br /&gt;
|  0x1&lt;br /&gt;
|  Y reference bit (REFY)&lt;br /&gt;
|-&lt;br /&gt;
|  0x19&lt;br /&gt;
|  0x1&lt;br /&gt;
|  X reference bit (REFX)&lt;br /&gt;
|-&lt;br /&gt;
|  0x1A&lt;br /&gt;
|  0x6&lt;br /&gt;
|  Opcode&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Format 3 : (used for uniform-based conditional flow control instructions)&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size (bits)&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
|  0x0&lt;br /&gt;
|  0x8&lt;br /&gt;
|  Number of instructions ? (NUM)&lt;br /&gt;
|-&lt;br /&gt;
|  0xA&lt;br /&gt;
|  0xC&lt;br /&gt;
|  Destination offset (in words) (DST)&lt;br /&gt;
|-&lt;br /&gt;
|  0x16&lt;br /&gt;
|  0x4&lt;br /&gt;
|  Uniform ID (BOOL/INT)&lt;br /&gt;
|-&lt;br /&gt;
|  0x1A&lt;br /&gt;
|  0x6&lt;br /&gt;
|  Opcode&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Format 4 : (used for SETEMIT)&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size (bits)&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
|  0x16&lt;br /&gt;
|  0x1&lt;br /&gt;
|  Winding flag (FLAG_WINDING)&lt;br /&gt;
|-&lt;br /&gt;
|  0x17&lt;br /&gt;
|  0x1&lt;br /&gt;
|  Primitive emit flag (FLAG_PRIMEMIT)&lt;br /&gt;
|-&lt;br /&gt;
|  0x18&lt;br /&gt;
|  0x2&lt;br /&gt;
|  Vertex ID (VTXID)&lt;br /&gt;
|-&lt;br /&gt;
|  0x1A&lt;br /&gt;
|  0x6&lt;br /&gt;
|  Opcode&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Format 5 : (used for MAD)&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size (bits)&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
|  0x0&lt;br /&gt;
|  0x5&lt;br /&gt;
|  Operand descriptor ID (DESC)&lt;br /&gt;
|-&lt;br /&gt;
|  0x5&lt;br /&gt;
|  0x5&lt;br /&gt;
|  Source 3 register (SRC3)&lt;br /&gt;
|-&lt;br /&gt;
|  0xA&lt;br /&gt;
|  0x7&lt;br /&gt;
|  Source 2 register (SRC2)&lt;br /&gt;
|-&lt;br /&gt;
|  0x11&lt;br /&gt;
|  0x5&lt;br /&gt;
|  Source 1 register (SRC1)&lt;br /&gt;
|-&lt;br /&gt;
|  0x16&lt;br /&gt;
|  0x2&lt;br /&gt;
|  Address register index for SRC2 (IDX_2)&lt;br /&gt;
|-&lt;br /&gt;
|  0x18&lt;br /&gt;
|  0x5&lt;br /&gt;
|  Destination register (DST)&lt;br /&gt;
|-&lt;br /&gt;
|  0x1D&lt;br /&gt;
|  0x3&lt;br /&gt;
|  Opcode&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Format 5i : (used for MADI)&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size (bits)&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
|  0x0&lt;br /&gt;
|  0x5&lt;br /&gt;
|  Operand descriptor ID (DESC)&lt;br /&gt;
|-&lt;br /&gt;
|  0x5&lt;br /&gt;
|  0x7&lt;br /&gt;
|  Source 3 register (SRC3)&lt;br /&gt;
|-&lt;br /&gt;
|  0xC&lt;br /&gt;
|  0x5&lt;br /&gt;
|  Source 2 register (SRC2)&lt;br /&gt;
|-&lt;br /&gt;
|  0x11&lt;br /&gt;
|  0x5&lt;br /&gt;
|  Source 1 register (SRC1)&lt;br /&gt;
|-&lt;br /&gt;
|  0x16&lt;br /&gt;
|  0x2&lt;br /&gt;
|  Address register index for SRC3 (IDX_3)&lt;br /&gt;
|-&lt;br /&gt;
|  0x18&lt;br /&gt;
|  0x5&lt;br /&gt;
|  Destination register (DST)&lt;br /&gt;
|-&lt;br /&gt;
|  0x1D&lt;br /&gt;
|  0x3&lt;br /&gt;
|  Opcode&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Instructions ==&lt;br /&gt;
Unless noted otherwise, SRC1 and SRC2 refer to their respectively indexed float[4] registers (after swizzling). Similarly, DST refers to its indexed register modulo destination component masking, i.e. an expression like DST=SRC1 might actually just set DST.y to SRC1.y.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Opcode&lt;br /&gt;
!  Format&lt;br /&gt;
!  Name&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
|  0x00&lt;br /&gt;
|  1&lt;br /&gt;
|  ADD&lt;br /&gt;
|  Adds two vectors component by component; DST[i] = SRC1[i]+SRC2[i] for all i&lt;br /&gt;
|-&lt;br /&gt;
|  0x01&lt;br /&gt;
|  1&lt;br /&gt;
|  DP3&lt;br /&gt;
|  Computes dot product on 3-component vectors; DST = SRC1.SRC2&lt;br /&gt;
|-&lt;br /&gt;
|  0x02&lt;br /&gt;
|  1&lt;br /&gt;
|  DP4&lt;br /&gt;
|  Computes dot product on 4-component vectors; DST = SRC1.SRC2&lt;br /&gt;
|-&lt;br /&gt;
|  0x03&lt;br /&gt;
|  1&lt;br /&gt;
|  DPH&lt;br /&gt;
|  Computes dot product on a 3-component vector with 1.0 appended to it and a 4-component vector; DST = SRC1.SRC2 (with SRC1 homogenous)&lt;br /&gt;
|-&lt;br /&gt;
|  0x04&lt;br /&gt;
|  1&lt;br /&gt;
|  DST&lt;br /&gt;
|  Equivalent to Microsoft&#039;s [https://msdn.microsoft.com/en-us/library/windows/desktop/bb219790.aspx dst] instruction: DST = {1, SRC1[1]*SRC2[1], SRC1[2], SRC2[3]}&lt;br /&gt;
|-&lt;br /&gt;
|  0x05&lt;br /&gt;
|  1u&lt;br /&gt;
|  EX2&lt;br /&gt;
|  Computes SRC1&#039;s first component exponent with base 2; DST[i] = EXP2(SRC1[0]) for all i&lt;br /&gt;
|-&lt;br /&gt;
|  0x06&lt;br /&gt;
|  1u&lt;br /&gt;
|  LG2&lt;br /&gt;
|  Computes SRC1&#039;s first component logarithm with base 2; DST[i] = LOG2(SRC1[0]) for all i&lt;br /&gt;
|-&lt;br /&gt;
|  0x07&lt;br /&gt;
|  1u&lt;br /&gt;
|  LITP&lt;br /&gt;
|  Appears to be related to Microsoft&#039;s [https://msdn.microsoft.com/en-us/library/windows/desktop/bb174703.aspx lit] instruction; DST = clamp(SRC1, min={0, -127.9961, 0, 0}, max={inf, 127.9961, 0, inf}); n.b.: 127.9961 = 0x7FFF / 0x100&lt;br /&gt;
|-&lt;br /&gt;
|  0x08&lt;br /&gt;
|  1&lt;br /&gt;
|  MUL&lt;br /&gt;
|  Multiplies two vectors component by component; DST[i] = SRC1[i].SRC2[i] for all i&lt;br /&gt;
|-&lt;br /&gt;
|  0x09&lt;br /&gt;
|  1&lt;br /&gt;
|  SGE&lt;br /&gt;
|  Sets output if SRC1 is greater than or equal to SRC2; DST[i] = (SRC1[i] &amp;gt;= SRC2[i]) ? 1.0 : 0.0 for all i&lt;br /&gt;
|-&lt;br /&gt;
|  0x0A&lt;br /&gt;
|  1&lt;br /&gt;
|  SLT&lt;br /&gt;
|  Sets output if SRC1 is strictly less than SRC2; DST[i] = (SRC1[i] &amp;lt; SRC2[i]) ? 1.0 : 0.0 for all i&lt;br /&gt;
|-&lt;br /&gt;
|  0x0B&lt;br /&gt;
|  1u&lt;br /&gt;
|  FLR&lt;br /&gt;
|  Computes SRC1&#039;s floor component by component; DST[i] = FLOOR(SRC1[i]) for all i&lt;br /&gt;
|-&lt;br /&gt;
|  0x0C&lt;br /&gt;
|  1&lt;br /&gt;
|  MAX&lt;br /&gt;
|  Takes the max of two vectors, component by component; DST[i] = MAX(SRC1[i], SRC2[i]) for all i&lt;br /&gt;
|-&lt;br /&gt;
|  0x0D&lt;br /&gt;
|  1&lt;br /&gt;
|  MIN&lt;br /&gt;
|  Takes the min of two vectors, component by component; DST[i] = MIN(SRC1[i], SRC2[i]) for all i&lt;br /&gt;
|-&lt;br /&gt;
|  0x0E&lt;br /&gt;
|  1u&lt;br /&gt;
|  RCP&lt;br /&gt;
|  Computes the reciprocal of the vector&#039;s first component; DST[i] = 1/SRC1[0] for all i&lt;br /&gt;
|-&lt;br /&gt;
|  0x0F&lt;br /&gt;
|  1u&lt;br /&gt;
|  RSQ&lt;br /&gt;
|  Computes the reciprocal of the square root of the vector&#039;s first component; DST[i] = 1/sqrt(SRC1[0]) for all i&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| ?&lt;br /&gt;
| ???&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x11&lt;br /&gt;
| ?&lt;br /&gt;
| ???&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
|  0x12&lt;br /&gt;
|  1u&lt;br /&gt;
|  MOVA&lt;br /&gt;
|  Move to address register; Casts the float uniform given by SRC1 to an integer (truncating the fractional part) and assigns the result to (a0.x, a0.y, _, _), respecting the destination component mask.&lt;br /&gt;
|-&lt;br /&gt;
|  0x13&lt;br /&gt;
|  1u&lt;br /&gt;
|  MOV&lt;br /&gt;
|  Moves value from one register to another; DST = SRC1.&lt;br /&gt;
|-&lt;br /&gt;
|  0x14&lt;br /&gt;
|  ?&lt;br /&gt;
|  ???&lt;br /&gt;
|  ?&lt;br /&gt;
|-&lt;br /&gt;
|  0x15&lt;br /&gt;
|  ?&lt;br /&gt;
|  ???&lt;br /&gt;
|  ?&lt;br /&gt;
|-&lt;br /&gt;
|  0x16&lt;br /&gt;
|  ?&lt;br /&gt;
|  ???&lt;br /&gt;
|  ?&lt;br /&gt;
|-&lt;br /&gt;
|  0x17&lt;br /&gt;
|  ?&lt;br /&gt;
|  ???&lt;br /&gt;
|  ?&lt;br /&gt;
|-&lt;br /&gt;
|  0x18&lt;br /&gt;
|  1i&lt;br /&gt;
|  DPHI&lt;br /&gt;
|  Computes dot product on a 3-component vector with 1.0 appended to it and a 4-component vector; DST = SRC1.SRC2 (with SRC1 homogenous)&lt;br /&gt;
|-&lt;br /&gt;
|  0x19&lt;br /&gt;
|  1i&lt;br /&gt;
|  DSTI&lt;br /&gt;
|  DST with sources swapped.&lt;br /&gt;
|-&lt;br /&gt;
|  0x1A&lt;br /&gt;
|  1i&lt;br /&gt;
|  SGEI&lt;br /&gt;
|  Sets output if SRC1 is greater than or equal to SRC2; DST[i] = (SRC1[i] &amp;gt;= SRC2[i]) ? 1.0 : 0.0 for all i&lt;br /&gt;
|-&lt;br /&gt;
|  0x1B&lt;br /&gt;
|  1i&lt;br /&gt;
|  SLTI&lt;br /&gt;
|  Sets output if SRC1 is strictly less than SRC2; DST[i] = (SRC1[i] &amp;lt; SRC2[i]) ? 1.0 : 0.0 for all i&lt;br /&gt;
|-&lt;br /&gt;
|  0x1C&lt;br /&gt;
|  ?&lt;br /&gt;
|  ???&lt;br /&gt;
|  ?&lt;br /&gt;
|-&lt;br /&gt;
|  0x1D&lt;br /&gt;
|  ?&lt;br /&gt;
|  ???&lt;br /&gt;
|  ?&lt;br /&gt;
|-&lt;br /&gt;
|  0x1E&lt;br /&gt;
|  ?&lt;br /&gt;
|  ???&lt;br /&gt;
|  ?&lt;br /&gt;
|-&lt;br /&gt;
|  0x1F&lt;br /&gt;
|  ?&lt;br /&gt;
|  ???&lt;br /&gt;
|  ?&lt;br /&gt;
|-&lt;br /&gt;
|  0x20&lt;br /&gt;
|  0&lt;br /&gt;
|  BREAK&lt;br /&gt;
|  Breaks out of LOOP block; do not use while in nested IF/CALL block inside LOOP block.&lt;br /&gt;
|-&lt;br /&gt;
|  0x21&lt;br /&gt;
|  0&lt;br /&gt;
|  NOP&lt;br /&gt;
|  Does literally nothing.&lt;br /&gt;
|-&lt;br /&gt;
|  0x22&lt;br /&gt;
|  0&lt;br /&gt;
|  END&lt;br /&gt;
|  Signals the shader unit that processing for this vertex/primitive is done.&lt;br /&gt;
|-&lt;br /&gt;
|  0x23&lt;br /&gt;
|  2&lt;br /&gt;
|  BREAKC&lt;br /&gt;
|  If condition (see [[#Conditions|below]] for details) is true, then breaks out of LOOP block.&lt;br /&gt;
|-&lt;br /&gt;
|  0x24&lt;br /&gt;
|  2&lt;br /&gt;
|  CALL&lt;br /&gt;
|  Jumps to DST and executes instructions until it reaches DST+NUM instructions&lt;br /&gt;
|-&lt;br /&gt;
|  0x25&lt;br /&gt;
|  2&lt;br /&gt;
|  CALLC&lt;br /&gt;
|  If condition (see [[#Conditions|below]] for details) is true, then jumps to DST and executes instructions until it reaches DST+NUM instructions, else does nothing.&lt;br /&gt;
|-&lt;br /&gt;
|  0x26&lt;br /&gt;
|  3&lt;br /&gt;
|  CALLU&lt;br /&gt;
|  Jumps to DST and executes instructions until it reaches DST+NUM instructions if BOOL is true&lt;br /&gt;
|-&lt;br /&gt;
|  0x27&lt;br /&gt;
|  3&lt;br /&gt;
|  IFU&lt;br /&gt;
|  If condition BOOL is true, then executes instructions until DST, then jumps to DST+NUM; else, jumps to DST.&lt;br /&gt;
|-&lt;br /&gt;
|  0x28&lt;br /&gt;
|  2&lt;br /&gt;
|  IFC&lt;br /&gt;
|  If condition (see [[#Conditions|below]] for details) is true, then executes instructions until DST, then jumps to DST+NUM; else, jumps to DST&lt;br /&gt;
|-&lt;br /&gt;
|  0x29&lt;br /&gt;
|  3&lt;br /&gt;
|  LOOP&lt;br /&gt;
|  Loops over the code between itself and DST (inclusive), performing INT.x+1 iterations in total. First, aL is initialized to INT.y. After each iteration, aL is incremented by INT.z.&lt;br /&gt;
|-&lt;br /&gt;
|  0x2A&lt;br /&gt;
|  0 (no param)&lt;br /&gt;
|  EMIT&lt;br /&gt;
|  (geometry shader only) Emits a vertex (and primitive if FLAG_PRIMEMIT was set in the corresponding SETEMIT). SETEMIT must be called before this.&lt;br /&gt;
|-&lt;br /&gt;
|  0x2B&lt;br /&gt;
|  4&lt;br /&gt;
|  SETEMIT&lt;br /&gt;
|  (geometry shader only) Sets VTXID, FLAG_WINDING and FLAG_PRIMEMIT for the next EMIT instruction. VTXID is the ID of the vertex about to be emitted within the primitive, while FLAG_PRIMEMIT is zero if we are just emitting a single vertex and non-zero if are emitting a vertex and primitive simultaneously. FLAG_WINDING controls the output primitive&#039;s winding. Note that the output vertex buffer (which holds 4 vertices) is &#039;&#039;&#039;not&#039;&#039;&#039; cleared when the primitive is emitted, meaning that vertices from the previous primitive can be reused for the current one. (this is still a working hypothesis and unconfirmed)&lt;br /&gt;
|-&lt;br /&gt;
|  0x2C&lt;br /&gt;
|  2&lt;br /&gt;
|  JMPC&lt;br /&gt;
|  If condition (see [[#Conditions|below]] for details) is true, then jumps to DST, else does nothing.&lt;br /&gt;
|-&lt;br /&gt;
|  0x2D&lt;br /&gt;
|  3&lt;br /&gt;
|  JMPU&lt;br /&gt;
|  If condition BOOL is true, then jumps to DST, else does nothing. Having bit 0 of NUM = 1 will invert the test, jumping if BOOL is false instead.&lt;br /&gt;
|-&lt;br /&gt;
|  0x2E-0x2F&lt;br /&gt;
|  1c&lt;br /&gt;
|  CMP&lt;br /&gt;
|  Sets booleans cmp.x and cmp.y based on the operand&#039;s x and y components and the CMPX and CMPY comparison operators respectively. See [[#Comparison_operator|below]] for details about operators. It&#039;s unknown whether CMP respects the destination component mask or not.&lt;br /&gt;
|-&lt;br /&gt;
|  0x30-0x37&lt;br /&gt;
|  5i&lt;br /&gt;
|  MADI&lt;br /&gt;
|  Multiplies two vectors and adds a third one component by component; DST[i] = SRC3[i] + SRC2[i].SRC1[i] for all i; this is not an FMA, the intermediate result is rounded&lt;br /&gt;
|-&lt;br /&gt;
|  0x38-0x3F&lt;br /&gt;
|  5&lt;br /&gt;
|  MAD&lt;br /&gt;
|  Multiplies two vectors and adds a third one component by component; DST[i] = SRC3[i] + SRC2[i].SRC1[i] for all i; this is not an FMA, the intermediate result is rounded&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Operand descriptors ==&lt;br /&gt;
Sizes below are in bits, not bytes.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
|  0x0&lt;br /&gt;
|  0x4&lt;br /&gt;
|  Destination component mask. Bit 3 = x, 2 = y, 1 = z, 0 = w.&lt;br /&gt;
|-&lt;br /&gt;
|  0x4&lt;br /&gt;
|  0x1&lt;br /&gt;
|  Source 1 negation bit&lt;br /&gt;
|-&lt;br /&gt;
|  0x5&lt;br /&gt;
|  0x8&lt;br /&gt;
|  Source 1 component selector&lt;br /&gt;
|-&lt;br /&gt;
|  0xD&lt;br /&gt;
|  0x1&lt;br /&gt;
|  Source 2 negation bit&lt;br /&gt;
|-&lt;br /&gt;
|  0xE&lt;br /&gt;
|  0x8&lt;br /&gt;
|  Source 2 component selector&lt;br /&gt;
|-&lt;br /&gt;
|  0x16&lt;br /&gt;
|  0x1&lt;br /&gt;
|  Source 3 negation bit&lt;br /&gt;
|-&lt;br /&gt;
|  0x17&lt;br /&gt;
|  0x8&lt;br /&gt;
|  Source 3 component selector&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Component selector :&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
|  0x0&lt;br /&gt;
|  0x2&lt;br /&gt;
|  Component 3 value&lt;br /&gt;
|-&lt;br /&gt;
|  0x2&lt;br /&gt;
|  0x2&lt;br /&gt;
|  Component 2 value&lt;br /&gt;
|-&lt;br /&gt;
|  0x4&lt;br /&gt;
|  0x2&lt;br /&gt;
|  Component 1 value&lt;br /&gt;
|-&lt;br /&gt;
|  0x6&lt;br /&gt;
|  0x2&lt;br /&gt;
|  Component 0 value&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Component&lt;br /&gt;
|-&lt;br /&gt;
|  0x0&lt;br /&gt;
|  x&lt;br /&gt;
|-&lt;br /&gt;
|  0x1&lt;br /&gt;
|  y&lt;br /&gt;
|-&lt;br /&gt;
|  0x2&lt;br /&gt;
|  z&lt;br /&gt;
|-&lt;br /&gt;
|  0x3&lt;br /&gt;
|  w&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The component selector enables swizzling. For example, component selector 0x1B is equivalent to .xyzw, while 0x55 is equivalent to .yyyy.&lt;br /&gt;
&lt;br /&gt;
Depending on the current shader opcode, source components are disabled implicitly by setting the destination component mask. For example, ADD o0.xy, r0.xyzw, r1.xyzw will not make use of r0&#039;s or r1&#039;s z/w components, while DP4 o0.xy, r0.xyzw, r1.xyzw will use all input components regardless of the used destination component mask.&lt;br /&gt;
&lt;br /&gt;
== Relative addressing ==&lt;br /&gt;
&lt;br /&gt;
There are 3 address registers: a0.x, a0.y and aL (loop counter). For format 1 instructions, when IDX != 0, the value of the corresponding address register is added to SRC1&#039;s value. For example, if IDX = 2, a0.y = 3 and SRC1 = c8, then instead SRC1+a0.y = c11 will be used for the instruction. It is only possible to use address registers with vector uniform registers, attempting to use them with input attribute or temporary registers results in the address register being ignored (i.e. read as zero).&lt;br /&gt;
&lt;br /&gt;
a0.x and a0.y are set manually through the MOVA instruction by rounding a float value to integer precision. Hence, they may take negative values.&lt;br /&gt;
&lt;br /&gt;
aL can only be set indirectly by the LOOP instruction. It is still accessible and valid after exiting a LOOP block, though.&lt;br /&gt;
&lt;br /&gt;
== Comparison operator ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  CMPX/CMPY raw value&lt;br /&gt;
!  Operator name&lt;br /&gt;
!  Expression&lt;br /&gt;
|-&lt;br /&gt;
|  0x0&lt;br /&gt;
|  EQ&lt;br /&gt;
|  src1 == src2&lt;br /&gt;
|-&lt;br /&gt;
|  0x1&lt;br /&gt;
|  NE&lt;br /&gt;
|  src1 != src2&lt;br /&gt;
|-&lt;br /&gt;
|  0x2&lt;br /&gt;
|  LT&lt;br /&gt;
|  src1 &amp;lt; src2&lt;br /&gt;
|-&lt;br /&gt;
|  0x3&lt;br /&gt;
|  LE&lt;br /&gt;
|  src1 &amp;lt;= src2&lt;br /&gt;
|-&lt;br /&gt;
|  0x4&lt;br /&gt;
|  GT&lt;br /&gt;
|  src1 &amp;gt; src2&lt;br /&gt;
|-&lt;br /&gt;
|  0x5&lt;br /&gt;
|  GE&lt;br /&gt;
|  src1 &amp;gt;= src2&lt;br /&gt;
|-&lt;br /&gt;
|  0x6&lt;br /&gt;
|  ??&lt;br /&gt;
|  true ?&lt;br /&gt;
|-&lt;br /&gt;
|  0x7&lt;br /&gt;
|  ??&lt;br /&gt;
|  true ?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
6 and 7 seem to always return true.&lt;br /&gt;
&lt;br /&gt;
== Conditions ==&lt;br /&gt;
&lt;br /&gt;
A number of format 2 instructions are executed conditionally. These conditions are based on two boolean registers which can be set with CMP : cmp.x and cmp.y.&lt;br /&gt;
&lt;br /&gt;
Conditional instructions include 3 parameters : CONDOP, REFX and REFY. REFX and REFY are reference values which are tested for equality against cmp.x and cmp.y, respectively. CONDOP describes how the final truth value is constructed from the results of the two tests. There are four conditional expression formats :&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  CONDOP raw value&lt;br /&gt;
!  Expression&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
|  0x0&lt;br /&gt;
|  &amp;lt;nowiki&amp;gt;cmp.x == REFX || cmp.y == REFY&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|  OR&lt;br /&gt;
|-&lt;br /&gt;
|  0x1&lt;br /&gt;
|  &amp;lt;nowiki&amp;gt;cmp.x == REFX &amp;amp;&amp;amp; cmp.y == REFY&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|  AND&lt;br /&gt;
|-&lt;br /&gt;
|  0x2&lt;br /&gt;
|  cmp.x == REFX&lt;br /&gt;
|  X&lt;br /&gt;
|-&lt;br /&gt;
|  0x3&lt;br /&gt;
|  cmp.y == REFY&lt;br /&gt;
|  Y&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Registers ==&lt;br /&gt;
Input attribute registers (v0-v7?) store the per-vertex data given by the CPU and hence are read-only.&lt;br /&gt;
&lt;br /&gt;
Output attribute registers (o0-o6) hold the data to be passed to the later GPU stages and are write-only. Each of the output attribute register components is assigned a semantic by setting the corresponding [[GPU_Internal_Registers]].&lt;br /&gt;
&lt;br /&gt;
Uniform registers hold user-specified data which is constant throughout all processed vertices. There are 96 float[4] uniform registers (c0-c95), eight boolean registers (b0-b7), and four int[4] registers (i0-i3).&lt;br /&gt;
&lt;br /&gt;
Temporary registers (r0-r15) can be used for intermediate calculations and can both be read and written.&lt;br /&gt;
&lt;br /&gt;
Many shader instructions which take float arguments have only 5 bits available for the second argument. They may hence only refer to input attributes or temporary registers. In particular, it&#039;s not possible to pass two float[4] uniforms to these instructions.&lt;br /&gt;
&lt;br /&gt;
It appears that writing twice to the same output register can cause problems (e.g. GPU hangs).&lt;br /&gt;
&lt;br /&gt;
DST mapping :&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  DST raw value&lt;br /&gt;
!  Register name&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
|  0x0-0x6&lt;br /&gt;
|  o0-o6&lt;br /&gt;
|  Output registers.&lt;br /&gt;
|-&lt;br /&gt;
|  0x10-0x1F&lt;br /&gt;
|  r0-r15&lt;br /&gt;
|  Temporary registers.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
SRC mapping :&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  SRC1 raw value&lt;br /&gt;
!  Register name&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
|  0x0-0x7&lt;br /&gt;
|  v0-v7&lt;br /&gt;
|  Input attribute registers.&lt;br /&gt;
|-&lt;br /&gt;
|  0x10-0x1F&lt;br /&gt;
|  r0-r15&lt;br /&gt;
|  Temporary registers.&lt;br /&gt;
|-&lt;br /&gt;
|  0x20-0x7F&lt;br /&gt;
|  c0-c95&lt;br /&gt;
|  Vector uniform registers.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Floating-Point Behavior ==&lt;br /&gt;
&lt;br /&gt;
The PICA200 is not IEEE-compliant. It has positive and negative infinities and NaN, but does not seem to have negative 0. Input and output subnormals are flushed to +0. The internal floating point format seems to be the same as used in shader binaries: 1 sign bit, 7 exponent bits, 16 (explicit) mantissa bits. Several instructions also have behavior that differs from the IEEE functions. Here are the results from some tests done on hardware (s = largest subnormal, n = smallest positive normal):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Computation&lt;br /&gt;
!  Result&lt;br /&gt;
!  Notes&lt;br /&gt;
|-&lt;br /&gt;
|  inf * 0&lt;br /&gt;
|  0&lt;br /&gt;
|  Including inside MUL, MAD, DP4, etc.&lt;br /&gt;
|-&lt;br /&gt;
|  NaN * 0&lt;br /&gt;
|  NaN&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  +inf - +inf&lt;br /&gt;
|  NaN&lt;br /&gt;
|  Indicates +inf is real inf, not FLT_MAX&lt;br /&gt;
|-&lt;br /&gt;
|  rsq(rcp(-inf))&lt;br /&gt;
|  +inf&lt;br /&gt;
|  Indicates that there isn&#039;t -0.0.&lt;br /&gt;
&lt;br /&gt;
|- style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
|  rcp(-0)&lt;br /&gt;
|  +inf&lt;br /&gt;
|  no -0 so differs from IEEE where rcp(-0) = -inf &lt;br /&gt;
|-&lt;br /&gt;
|  rcp(0)&lt;br /&gt;
|  +inf&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  rcp(+inf)&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  rcp(NaN)&lt;br /&gt;
|  NaN&lt;br /&gt;
|  &lt;br /&gt;
&lt;br /&gt;
|- style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
|  rsq(-0)&lt;br /&gt;
|  +inf&lt;br /&gt;
|  no -0 so differs from IEEE where rsq(-0) = -inf &lt;br /&gt;
|-&lt;br /&gt;
|  rsq(-2)&lt;br /&gt;
|  NaN&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  rsq(+inf)&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  rsq(-inf)&lt;br /&gt;
|  NaN&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  rsq(NaN)&lt;br /&gt;
|  NaN&lt;br /&gt;
|  &lt;br /&gt;
&lt;br /&gt;
|- style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
|  max(0, +inf)&lt;br /&gt;
|  +inf&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  max(0, -inf)&lt;br /&gt;
|  -inf&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  max(0, NaN)&lt;br /&gt;
|  NaN&lt;br /&gt;
|  max violates IEEE but match GLSL spec&lt;br /&gt;
|-&lt;br /&gt;
|  max(NaN, 0)&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  max(-inf, +inf)&lt;br /&gt;
|  +inf&lt;br /&gt;
|  &lt;br /&gt;
&lt;br /&gt;
|- style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
|  min(0, +inf)&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  min(0, -inf)&lt;br /&gt;
|  -inf&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  min(0, NaN)&lt;br /&gt;
|  NaN&lt;br /&gt;
|  min violates IEEE but match GLSL spec&lt;br /&gt;
|-&lt;br /&gt;
|  min(NaN, 0)&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  min(-inf, +inf)&lt;br /&gt;
|  -inf&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|- style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
|  cmp(s, 0)&lt;br /&gt;
|  false&lt;br /&gt;
|  cmp does not flush input subnormals&lt;br /&gt;
|-&lt;br /&gt;
|  max(s, 0)&lt;br /&gt;
|  s&lt;br /&gt;
|  max does not flush input or output subnormals&lt;br /&gt;
|-&lt;br /&gt;
|  mul(s, 2)&lt;br /&gt;
|  0&lt;br /&gt;
|  input subnormals are flushed in arithmetic instructions&lt;br /&gt;
|-&lt;br /&gt;
|  mul(n, 0.5)&lt;br /&gt;
|  0&lt;br /&gt;
|  output subnormals are flushed in arithmetic instructions&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
1.0 can be multiplied 63 times by 0.5 until the result compares equal zero. This is consistent with a 7-bit exponent and output subnormal flushing.&lt;/div&gt;</summary>
		<author><name>Merry</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=DSP&amp;diff=20523</id>
		<title>DSP</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=DSP&amp;diff=20523"/>
		<updated>2017-12-28T17:46:03Z</updated>

		<summary type="html">&lt;p&gt;Merry: Redirected page to Category:DSP&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Category:DSP]]&lt;/div&gt;</summary>
		<author><name>Merry</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=Setting_up_Development_Environment&amp;diff=19792</id>
		<title>Setting up Development Environment</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=Setting_up_Development_Environment&amp;diff=19792"/>
		<updated>2017-04-01T16:20:46Z</updated>

		<summary type="html">&lt;p&gt;Merry: Correct shell syntax&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Setup =&lt;br /&gt;
* Install [http://devkitpro.org/ devkitARM]. If it&#039;s already installed, update it.&lt;br /&gt;
** On Windows, there&#039;s a [http://sourceforge.net/projects/devkitpro/files/Automated%20Installer/ graphical installer].&lt;br /&gt;
** On Unix-like platforms such as Linux/macOS, there&#039;s a [http://sourceforge.net/projects/devkitpro/files/Automated%20Installer/devkitARMupdate.pl/download Perl script]. Make sure you also select libctru and the 3ds examples when installing.&lt;br /&gt;
* Depending on the kind of homebrew you want to develop, you may be interested in installing and using additional libraries and tools which don&#039;t ship alongside devkitARM/libctru. A list of them can be found in [[Homebrew Libraries and Tools]].&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
devkitPro provides Win32-native precompiled versions of devkitARM which can be run directly on Windows.&lt;br /&gt;
* [http://sourceforge.net/projects/devkitpro/files/Automated%20Installer/ download the latest version of the graphical installer] from SourceForge and run it, following the instructions as you go.&lt;br /&gt;
* An Internet connection is required.&lt;br /&gt;
* You will want to make sure devkitARM is selected during the installation process to develop for the 3DS (and also the DS and GBA) - you can also install devkitPPC (for GameCube/Wii development) and devkitPSP (for PlayStation Portable development) if you wish.&lt;br /&gt;
* Once the installer has finished, launch MSYS from:&lt;br /&gt;
** Windows 7 and earlier: Start -&amp;gt; All Programs -&amp;gt; devkitPro -&amp;gt; MSYS&lt;br /&gt;
** Windows 8 and 8.1: Right click on the Start screen and select &#039;All Apps&#039;. You should find MSYS there.&lt;br /&gt;
** Windows 10 (pre-Anniversary Update): Start -&amp;gt; All Apps -&amp;gt; devkitPro -&amp;gt; MSYS&lt;br /&gt;
** Windows 10 (post-Anniversary Update): Start -&amp;gt; devkitPro -&amp;gt; MSYS&lt;br /&gt;
&lt;br /&gt;
Alternatively starting with Windows 10 Anniversary Update (Version 1607), the [https://msdn.microsoft.com/en-us/commandline/wsl/install_guide Windows Subsystem for Linux (WSL)] may also be used to run the Linux version of devkitARM. Unless you have some particular need for WSL it&#039;s recommended that you stick to a more standard environment. &lt;br /&gt;
&lt;br /&gt;
==Unix-like platforms==&lt;br /&gt;
Currently devkitPro provides precompiled versions of devkitARM for the following Unix-like platforms: Linux (x86/x64), macOS (universal binary). Note that Linux x64 binaries are usable under WSL.&lt;br /&gt;
&lt;br /&gt;
* First, you need to install curl so the installer can download the devkitARM packages, and you should also install Git - you&#039;ll need it to update libctru or share your code on GitHub, among many other things. If you are running Linux, you&#039;ll also need wget; it comes preinstalled on most distributions, but not all.&lt;br /&gt;
&lt;br /&gt;
* Find your way into a shell (eg. by opening a Terminal window), and follow the instructions for your OS:&lt;br /&gt;
** Debian/Ubuntu/Linux Mint/WSL: &amp;lt;code&amp;gt;sudo apt-get install git curl&amp;lt;/code&amp;gt;&lt;br /&gt;
** Fedora/CentOS/RHEL: &amp;lt;code&amp;gt;sudo yum install git curl&amp;lt;/code&amp;gt;&lt;br /&gt;
** openSUSE: &amp;lt;code&amp;gt;sudo zypper install git curl&amp;lt;/code&amp;gt;&lt;br /&gt;
** Arch Linux: &amp;lt;code&amp;gt;sudo pacman -S git curl wget&amp;lt;/code&amp;gt;&lt;br /&gt;
** macOS: Download Git from [http://git-scm.com/download/mac] and install it. Curl is included with the OS.&lt;br /&gt;
&lt;br /&gt;
* Next, we need to download, make executable and run the devkitARM updater (don&#039;t worry, the updater is also the installer.)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
curl -L https://raw.githubusercontent.com/devkitPro/installer/master/perl/devkitARMupdate.pl -o devkitARMupdate.pl&lt;br /&gt;
chmod +x ./devkitARMupdate.pl&lt;br /&gt;
sudo ./devkitARMupdate.pl /opt/devkitpro&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Finally, we need to tell your shell where to find the devkitARM binaries.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
echo &amp;quot;export DEVKITPRO=/opt/devkitpro&amp;quot; &amp;gt;&amp;gt; ~/.bashrc&lt;br /&gt;
echo &amp;quot;export DEVKITARM=/opt/devkitpro/devkitARM&amp;quot; &amp;gt;&amp;gt; ~/.bashrc&lt;br /&gt;
echo &amp;quot;export PATH=$PATH:/opt/devkitpro/devkitARM/bin&amp;quot; &amp;gt;&amp;gt; ~/.bashrc&lt;br /&gt;
source ~/.bashrc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Building the examples =&lt;br /&gt;
3DS examples are still being created; however, there are a growing number of examples available from the [https://github.com/devkitPro/3ds-examples devkitPro/3ds-examples GitHub repository].&lt;br /&gt;
There are now too many to list here in detail, so go ahead and browse them.&lt;br /&gt;
&lt;br /&gt;
* To download these, if you installed Git (as you will have if you followed the above instructions), simply type &amp;lt;code&amp;gt;git clone https://github.com/devkitPro/3ds-examples.git&amp;lt;/code&amp;gt; into your shell in the directory you wish to store the 3ds-examples folder in.&lt;br /&gt;
&lt;br /&gt;
These can be built from the command line.&lt;br /&gt;
&lt;br /&gt;
To start a new homebrew project from the &amp;lt;code&amp;gt;bash&amp;lt;/code&amp;gt; shell, simply type the following (replacing &amp;lt;code&amp;gt;&#039;&#039;&#039;~/projects/my3dsproject&#039;&#039;&#039;&amp;lt;/code&amp;gt; with the place you would like your project to be stored, with &amp;lt;code&amp;gt;~&amp;lt;/code&amp;gt; meaning your HOME directory):&lt;br /&gt;
 cp -r $DEVKITPRO/examples/3ds/templates/application &#039;&#039;&#039;~/projects/my3dsproject&#039;&#039;&#039;&lt;br /&gt;
 cd &#039;&#039;&#039;~/projects/my3dsproject&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The standard Makefile will use the folder as the name of the 3dsx that will be built. You can keep that behaviour or simply change the &amp;lt;code&amp;gt;TARGET := $(notdir $(CURDIR))&amp;lt;/code&amp;gt; line in the Makefile to explicitly name your project.&lt;br /&gt;
&lt;br /&gt;
To compile it, type &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; in the project directory.&lt;br /&gt;
&lt;br /&gt;
==Running your code==&lt;br /&gt;
To run it on your 3DS, start the Homebrew Launcher, press Y to open the network loader, then on your PC type: &amp;lt;code&amp;gt;$DEVKITARM/bin/3dslink  &#039;&#039;&#039;my3dsproject&#039;&#039;&#039;.3dsx&amp;lt;/code&amp;gt;, replacing &#039;&#039;&#039;my3dsproject&#039;&#039;&#039; with the name of the 3dsx file you want to run.)&lt;br /&gt;
&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If all goes well, you&#039;ll soon see your application running on your 3DS.&lt;br /&gt;
&lt;br /&gt;
==Building the examples on Linux with Netbeans==&lt;br /&gt;
* Go to File-&amp;gt;New Project...&lt;br /&gt;
* Select C/C++ Project with existing code&lt;br /&gt;
* Navigate to the examples directory and select the folder for the project you want to build; eg.    /home/vtsingaras/3ds/examples/app_launch&lt;br /&gt;
* Leave Configuration Mode to &#039;Automatic&#039; and click &#039;Finish&#039;.&lt;br /&gt;
* It will fail to build. Now edit Makefile and insert these two lines, adjusting for your devkitpro path, at the top:&lt;br /&gt;
&amp;lt;pre&amp;gt;export DEVKITPRO=/opt/devkitpro&lt;br /&gt;
export DEVKITARM=/opt/devkitpro/devkitARM&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Right-click the project and go to Properties-&amp;gt;Code Assistance and click C Compiler.&lt;br /&gt;
* In include directories enter &lt;br /&gt;
&amp;lt;pre&amp;gt;/opt/devkitpro/devkitARM/include;/opt/devkitpro/libctru/include&amp;lt;/pre&amp;gt;&lt;br /&gt;
adjusting again for your devkitPro path.&lt;br /&gt;
* Do the same for &#039;C++ Compiler&#039;.&lt;br /&gt;
* Go to &#039;Run&#039; and click &#039;Clean and Build Project&#039;.&lt;br /&gt;
* Now right-click on the project and select Code Assistance-&amp;gt;Reparse Project.&lt;br /&gt;
&lt;br /&gt;
Now you can use Netbeans&#039; code completion feature and build your project from the Run menu.&lt;br /&gt;
&lt;br /&gt;
= Building homebrew for distribution =&lt;br /&gt;
To build your homebrew, open a Bash shell as described above, browse to the folder of the homebrew you wish to compile, and run &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* This will build a .elf file and a .3dsx file (the homebrew executable itself).&lt;br /&gt;
** The Homebrew Launcher can only run homebrew in the 3DSX format.&lt;br /&gt;
&lt;br /&gt;
* To build a CIA file, you need to use makerom on it along with a RSF file describing the application:&lt;br /&gt;
  makerom -f cia -o [.cia file] -rsf [RSF file] -target t -exefslogo -elf [ELF file] -icon [icon file] -banner [banner file]&lt;br /&gt;
&lt;br /&gt;
= Troubleshooting =&lt;br /&gt;
&#039;&#039;&#039;I get the &amp;quot;Please set DEVKITARM in your environment.&amp;quot; error.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Use the following command before installing [http://askubuntu.com/questions/573070/problem-setting-up-environment-for-make-command-execution]:&lt;br /&gt;
 sudo chown $USER /opt/devkitpro/ -R&lt;br /&gt;
 echo &amp;quot;export DEVKITPRO=\&amp;quot;/opt/devkitpro/\&amp;quot;&amp;quot; &amp;gt;&amp;gt; ~/.profile&lt;br /&gt;
 echo &amp;quot;export DEVKITARM=\&amp;quot;\${DEVKITPRO}/devkitARM/\&amp;quot;&amp;quot; &amp;gt;&amp;gt; ~/.profile&lt;br /&gt;
 source ~/.profile&lt;br /&gt;
&lt;br /&gt;
For WSL users, you need to close the Bash shell, then reopen it for WSL to reload all of the variables from a clean state.&lt;/div&gt;</summary>
		<author><name>Merry</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=Setting_up_Development_Environment&amp;diff=19791</id>
		<title>Setting up Development Environment</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=Setting_up_Development_Environment&amp;diff=19791"/>
		<updated>2017-04-01T16:18:47Z</updated>

		<summary type="html">&lt;p&gt;Merry: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Setup =&lt;br /&gt;
* Install [http://devkitpro.org/ devkitARM]. If it&#039;s already installed, update it.&lt;br /&gt;
** On Windows, there&#039;s a [http://sourceforge.net/projects/devkitpro/files/Automated%20Installer/ graphical installer].&lt;br /&gt;
** On Unix-like platforms such as Linux/macOS, there&#039;s a [http://sourceforge.net/projects/devkitpro/files/Automated%20Installer/devkitARMupdate.pl/download Perl script]. Make sure you also select libctru and the 3ds examples when installing.&lt;br /&gt;
* Depending on the kind of homebrew you want to develop, you may be interested in installing and using additional libraries and tools which don&#039;t ship alongside devkitARM/libctru. A list of them can be found in [[Homebrew Libraries and Tools]].&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
devkitPro provides Win32-native precompiled versions of devkitARM which can be run directly on Windows.&lt;br /&gt;
* [http://sourceforge.net/projects/devkitpro/files/Automated%20Installer/ download the latest version of the graphical installer] from SourceForge and run it, following the instructions as you go.&lt;br /&gt;
* An Internet connection is required.&lt;br /&gt;
* You will want to make sure devkitARM is selected during the installation process to develop for the 3DS (and also the DS and GBA) - you can also install devkitPPC (for GameCube/Wii development) and devkitPSP (for PlayStation Portable development) if you wish.&lt;br /&gt;
* Once the installer has finished, launch MSYS from:&lt;br /&gt;
** Windows 7 and earlier: Start -&amp;gt; All Programs -&amp;gt; devkitPro -&amp;gt; MSYS&lt;br /&gt;
** Windows 8 and 8.1: Right click on the Start screen and select &#039;All Apps&#039;. You should find MSYS there.&lt;br /&gt;
** Windows 10 (pre-Anniversary Update): Start -&amp;gt; All Apps -&amp;gt; devkitPro -&amp;gt; MSYS&lt;br /&gt;
** Windows 10 (post-Anniversary Update): Start -&amp;gt; devkitPro -&amp;gt; MSYS&lt;br /&gt;
&lt;br /&gt;
Alternatively starting with Windows 10 Anniversary Update (Version 1607), the [https://msdn.microsoft.com/en-us/commandline/wsl/install_guide Windows Subsystem for Linux (WSL)] may also be used to run the Linux version of devkitARM. Unless you have some particular need for WSL it&#039;s recommended that you stick to a more standard environment. &lt;br /&gt;
&lt;br /&gt;
==Unix-like platforms==&lt;br /&gt;
Currently devkitPro provides precompiled versions of devkitARM for the following Unix-like platforms: Linux (x86/x64), macOS (universal binary). Note that Linux x64 binaries are usable under WSL.&lt;br /&gt;
&lt;br /&gt;
* First, you need to install curl so the installer can download the devkitARM packages, and you should also install Git - you&#039;ll need it to update libctru or share your code on GitHub, among many other things. If you are running Linux, you&#039;ll also need wget; it comes preinstalled on most distributions, but not all.&lt;br /&gt;
&lt;br /&gt;
* Find your way into a shell (eg. by opening a Terminal window), and follow the instructions for your OS:&lt;br /&gt;
** Debian/Ubuntu/Linux Mint/WSL: &amp;lt;code&amp;gt;sudo apt-get install git curl&amp;lt;/code&amp;gt;&lt;br /&gt;
** Fedora/CentOS/RHEL: &amp;lt;code&amp;gt;sudo yum install git curl&amp;lt;/code&amp;gt;&lt;br /&gt;
** openSUSE: &amp;lt;code&amp;gt;sudo zypper install git curl&amp;lt;/code&amp;gt;&lt;br /&gt;
** Arch Linux: &amp;lt;code&amp;gt;sudo pacman -S git curl wget&amp;lt;/code&amp;gt;&lt;br /&gt;
** macOS: Download Git from [http://git-scm.com/download/mac] and install it. Curl is included with the OS.&lt;br /&gt;
&lt;br /&gt;
* Next, we need to download, make executable and run the devkitARM updater (don&#039;t worry, the updater is also the installer.)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
curl -L https://raw.githubusercontent.com/devkitPro/installer/master/perl/devkitARMupdate.pl -o devkitARMupdate.pl&lt;br /&gt;
chmod +x ./devkitARMupdate.pl&lt;br /&gt;
sudo ./devkitARMupdate.pl /opt/devkitpro&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Finally, we need to tell your shell where to find the devkitARM binaries.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
echo &amp;quot;export DEVKITPRO=/opt/devkitpro&amp;quot; &amp;gt;&amp;gt; ~/.bashrc&lt;br /&gt;
echo &amp;quot;export DEVKITARM=/opt/devkitpro/devkitARM&amp;quot; &amp;gt;&amp;gt; ~/.bashrc&lt;br /&gt;
echo &amp;quot;export PATH=$PATH:/opt/devkitpro/devkitARM/bin&amp;quot; &amp;gt;&amp;gt; ~/.bashrc&lt;br /&gt;
source ~/.bashrc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Building the examples =&lt;br /&gt;
3DS examples are still being created; however, there are a growing number of examples available from the [https://github.com/devkitPro/3ds-examples devkitPro/3ds-examples GitHub repository].&lt;br /&gt;
There are now too many to list here in detail, so go ahead and browse them.&lt;br /&gt;
&lt;br /&gt;
* To download these, if you installed Git (as you will have if you followed the above instructions), simply type &amp;lt;code&amp;gt;git clone https://github.com/devkitPro/3ds-examples.git&amp;lt;/code&amp;gt; into your shell in the directory you wish to store the 3ds-examples folder in.&lt;br /&gt;
&lt;br /&gt;
These can be built from the command line.&lt;br /&gt;
&lt;br /&gt;
To start a new homebrew project from the &amp;lt;code&amp;gt;bash&amp;lt;/code&amp;gt; shell, simply type the following (replacing &amp;lt;code&amp;gt;&#039;&#039;&#039;~/projects/my3dsproject&#039;&#039;&#039;&amp;lt;/code&amp;gt; with the place you would like your project to be stored, with &amp;lt;code&amp;gt;~&amp;lt;/code&amp;gt; meaning your HOME directory):&lt;br /&gt;
 cp -r $DEVKITPRO/examples/3ds/templates/application &#039;&#039;&#039;~/projects/my3dsproject&#039;&#039;&#039;&lt;br /&gt;
 cd &#039;&#039;&#039;~/projects/my3dsproject&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The standard Makefile will use the folder as the name of the 3dsx that will be built. You can keep that behaviour or simply change the &amp;lt;code&amp;gt;TARGET := $(notdir $(CURDIR))&amp;lt;/code&amp;gt; line in the Makefile to explicitly name your project.&lt;br /&gt;
&lt;br /&gt;
To compile it, type &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; in the project directory.&lt;br /&gt;
&lt;br /&gt;
==Running your code==&lt;br /&gt;
To run it on your 3DS, start the Homebrew Launcher, press Y to open the network loader, then on your PC type: &amp;lt;code&amp;gt;$DEVKITARM/bin/3dslink  &#039;&#039;&#039;my3dsproject&#039;&#039;&#039;.3dsx&amp;lt;/code&amp;gt;, replacing &#039;&#039;&#039;my3dsproject&#039;&#039;&#039; with the name of the 3dsx file you want to run.)&lt;br /&gt;
&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If all goes well, you&#039;ll soon see your application running on your 3DS.&lt;br /&gt;
&lt;br /&gt;
==Building the examples on Linux with Netbeans==&lt;br /&gt;
* Go to File-&amp;gt;New Project...&lt;br /&gt;
* Select C/C++ Project with existing code&lt;br /&gt;
* Navigate to the examples directory and select the folder for the project you want to build; eg.    /home/vtsingaras/3ds/examples/app_launch&lt;br /&gt;
* Leave Configuration Mode to &#039;Automatic&#039; and click &#039;Finish&#039;.&lt;br /&gt;
* It will fail to build. Now edit Makefile and insert these two lines, adjusting for your devkitpro path, at the top:&lt;br /&gt;
&amp;lt;pre&amp;gt;export DEVKITPRO=/opt/devkitpro&lt;br /&gt;
export DEVKITARM=/opt/devkitpro/devkitARM&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Right-click the project and go to Properties-&amp;gt;Code Assistance and click C Compiler.&lt;br /&gt;
* In include directories enter &lt;br /&gt;
&amp;lt;pre&amp;gt;/opt/devkitpro/devkitARM/include;/opt/devkitpro/libctru/include&amp;lt;/pre&amp;gt;&lt;br /&gt;
adjusting again for your devkitPro path.&lt;br /&gt;
* Do the same for &#039;C++ Compiler&#039;.&lt;br /&gt;
* Go to &#039;Run&#039; and click &#039;Clean and Build Project&#039;.&lt;br /&gt;
* Now right-click on the project and select Code Assistance-&amp;gt;Reparse Project.&lt;br /&gt;
&lt;br /&gt;
Now you can use Netbeans&#039; code completion feature and build your project from the Run menu.&lt;br /&gt;
&lt;br /&gt;
= Building homebrew for distribution =&lt;br /&gt;
To build your homebrew, open a Bash shell as described above, browse to the folder of the homebrew you wish to compile, and run &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* This will build a .elf file and a .3dsx file (the homebrew executable itself).&lt;br /&gt;
** The Homebrew Launcher can only run homebrew in the 3DSX format.&lt;br /&gt;
&lt;br /&gt;
* To build a CIA file, you need to use makerom on it along with a RSF file describing the application:&lt;br /&gt;
  makerom -f cia -o [.cia file] -rsf [RSF file] -target t -exefslogo -elf [ELF file] -icon [icon file] -banner [banner file]&lt;br /&gt;
&lt;br /&gt;
= Troubleshooting =&lt;br /&gt;
&#039;&#039;&#039;I get the &amp;quot;Please set DEVKITARM in your environment.&amp;quot; error.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Use the following command before installing [http://askubuntu.com/questions/573070/problem-setting-up-environment-for-make-command-execution]:&lt;br /&gt;
 sudo chown $USER /opt/devkitpro/ -R&lt;br /&gt;
 echo &amp;quot;export DEVKITPRO=&amp;quot;/opt/devkitpro/&amp;quot; &amp;gt;&amp;gt; ~/.profile&lt;br /&gt;
 echo &amp;quot;export DEVKITARM=&amp;quot;${DEVKITPRO}/devkitARM/&amp;quot; &amp;gt;&amp;gt; ~/.profile&lt;br /&gt;
 source ~/.profile&lt;br /&gt;
&lt;br /&gt;
For WSL users, you need to close the Bash shell, then reopen it for WSL to reload all of the variables from a clean state.&lt;/div&gt;</summary>
		<author><name>Merry</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=DSP_Memory_Region&amp;diff=18013</id>
		<title>DSP Memory Region</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=DSP_Memory_Region&amp;diff=18013"/>
		<updated>2016-09-01T20:18:38Z</updated>

		<summary type="html">&lt;p&gt;Merry: I don&amp;#039;t own the page.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;Note that everything below may vary depending on the exact DSP firmware used and different variants have slightly different behaviours.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The DSP communicates with the application through two shared memory areas 0x8000 bytes long each (at 0x1FF50000 and 0x1FF70000 respectively). The DSP alternates between the use of these two areas (much like a double-buffer). Each area has 15 structures within it. The location of these structures can be obtained by [[DSP:ReadPipe|reading channel 2 of the DSP pipe]]. A list of structures in the order the DSP addresses are read from the pipe follows:&lt;br /&gt;
&lt;br /&gt;
1. Frame count&lt;br /&gt;
&lt;br /&gt;
2. Input configurations&lt;br /&gt;
&lt;br /&gt;
3. Input status&lt;br /&gt;
&lt;br /&gt;
4. Input ADPCM coefficients&lt;br /&gt;
&lt;br /&gt;
5. DSP configuration&lt;br /&gt;
&lt;br /&gt;
6. DSP status&lt;br /&gt;
&lt;br /&gt;
7. Output samples&lt;br /&gt;
&lt;br /&gt;
8. Intermediate mix samples&lt;br /&gt;
&lt;br /&gt;
9. Compressor table&lt;br /&gt;
&lt;br /&gt;
10. DSP debug statistics&lt;br /&gt;
&lt;br /&gt;
11. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
12. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
13. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
14. Surround sound biquad filter 1&lt;br /&gt;
&lt;br /&gt;
15. Surround sound biquad filter 2&lt;br /&gt;
&lt;br /&gt;
The DSP has 24 inputs, each of which are individually configurable. These 24 inputs each produce three sets of 4 audio channels (two left, two right). &lt;br /&gt;
&lt;br /&gt;
These four audio channels feed into three intermediate mixers. Two of these intermediate mixers are used for effects and aux.&lt;br /&gt;
&lt;br /&gt;
== Frame Count ==&lt;br /&gt;
&lt;br /&gt;
The frame count of the first region must be even and the frame count of the second region must be odd.&lt;br /&gt;
&lt;br /&gt;
The frame with the higher count is the &amp;quot;current region&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The DSP firmware only responds if the first frame count is 4.&lt;br /&gt;
&lt;br /&gt;
== Input Config ==&lt;br /&gt;
&lt;br /&gt;
A 192 byte long structure. There are 24 of them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u32&lt;br /&gt;
| Dirty flags&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| f32[3][2][2]&lt;br /&gt;
| Input Gain (Each input has 12 channels)&lt;br /&gt;
|-&lt;br /&gt;
| 52&lt;br /&gt;
| f32&lt;br /&gt;
| Rate multiplier (1.0x == native DSP rate)&lt;br /&gt;
|-&lt;br /&gt;
| 56&lt;br /&gt;
| u8&lt;br /&gt;
| Interpolation mode&lt;br /&gt;
|-&lt;br /&gt;
| 57&lt;br /&gt;
| u8&lt;br /&gt;
| Polyphase filter select&lt;br /&gt;
|-&lt;br /&gt;
| 58&lt;br /&gt;
| u16&lt;br /&gt;
| bit[0]: Simple Filter enabled, bit[1]: Biquadratic Filter enabled&lt;br /&gt;
|-&lt;br /&gt;
| 60&lt;br /&gt;
| SimpleFilter&lt;br /&gt;
| Simple Filter (One pole normalized recursive linear filter)&lt;br /&gt;
|-&lt;br /&gt;
| 64&lt;br /&gt;
| BiquadFilter&lt;br /&gt;
| Biquadratic Filter (Two poles two zeros normalized recursive linear filter)&lt;br /&gt;
|-&lt;br /&gt;
| 74&lt;br /&gt;
| u16&lt;br /&gt;
| Bitmap of which buffers in queue are dirty&lt;br /&gt;
|-&lt;br /&gt;
| 76&lt;br /&gt;
| Buffer[4]&lt;br /&gt;
| Buffer queue&lt;br /&gt;
|-&lt;br /&gt;
| 156&lt;br /&gt;
| u32&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| 160&lt;br /&gt;
| u16&lt;br /&gt;
| Is Active&lt;br /&gt;
|-&lt;br /&gt;
| 162&lt;br /&gt;
| u16 &lt;br /&gt;
| Sync Count&lt;br /&gt;
|-&lt;br /&gt;
| 164&lt;br /&gt;
| u32&lt;br /&gt;
| Play position&lt;br /&gt;
|-&lt;br /&gt;
| 168&lt;br /&gt;
| 4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 172&lt;br /&gt;
| u32&lt;br /&gt;
| Physical address of embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 176&lt;br /&gt;
| u32&lt;br /&gt;
| Number of samples in embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 180&lt;br /&gt;
| u16&lt;br /&gt;
| Format&lt;br /&gt;
|-&lt;br /&gt;
| 182&lt;br /&gt;
| AdpcmData&lt;br /&gt;
| ADPCM data associated with embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 188&lt;br /&gt;
| u16&lt;br /&gt;
| bit[0]: ADPCM updated?; bit[1]: Is looping?r&lt;br /&gt;
|-&lt;br /&gt;
| 190&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer Id of embedded buffer&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
There is a 2 sample delay in this preprocessing stage, likely due to the interpolation step.&lt;br /&gt;
&lt;br /&gt;
=== Format ===&lt;br /&gt;
&lt;br /&gt;
This is a u16.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Bits&lt;br /&gt;
| Desciption&lt;br /&gt;
|-&lt;br /&gt;
| 0-1&lt;br /&gt;
| Number of channels: 0,1,3 = mono; 2 = stereo&lt;br /&gt;
|-&lt;br /&gt;
| 2-3&lt;br /&gt;
| Buffer codec: [[BCWAV#Encoding|0:PCM8; 1:PCM16; 2:ADPCM]]&lt;br /&gt;
|-&lt;br /&gt;
| 5 &lt;br /&gt;
| Fade&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Buffer ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u32&lt;br /&gt;
| Physical Address&lt;br /&gt;
|-&lt;br /&gt;
| 4 &lt;br /&gt;
| u32&lt;br /&gt;
| Sample Count&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| AdpcmData&lt;br /&gt;
| ADPCM data&lt;br /&gt;
|-&lt;br /&gt;
| 14&lt;br /&gt;
| u8&lt;br /&gt;
| ADPCM data dirty?&lt;br /&gt;
|-&lt;br /&gt;
| 15&lt;br /&gt;
| u8&lt;br /&gt;
| Looping?&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer Id&lt;br /&gt;
|-&lt;br /&gt;
| 18&lt;br /&gt;
| u16&lt;br /&gt;
| -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Adpcm Data === &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u8&lt;br /&gt;
| ADPCM predictor/scale&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| u8&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| s16&lt;br /&gt;
| ADPCM y[n-1]&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| s16&lt;br /&gt;
| ADPCM y[n-2]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Simple Filter ===&lt;br /&gt;
&lt;br /&gt;
This is a standard single-pole filter. The fall-off is 6dB per octave as you would expect.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s1.15&lt;br /&gt;
| b0&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| s1.15&lt;br /&gt;
| a1 (negated)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Biquad Filter ===&lt;br /&gt;
&lt;br /&gt;
This is a [[wikipedia:Digital_biquad_filter|biquadratic filter]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s2.14&lt;br /&gt;
| a2 (negated)&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| s2.14&lt;br /&gt;
| a1 (negated)&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| s2.14&lt;br /&gt;
| b2&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| s2.14&lt;br /&gt;
| b1&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| s2.14&lt;br /&gt;
| b0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Input status ==&lt;br /&gt;
&lt;br /&gt;
Read only. This structure is set by the DSP. This structure is 12 bytes long and there are 24 of them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u8&lt;br /&gt;
| Input Enabled?&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| u8&lt;br /&gt;
| Dirty flag for buffer id, set to 1 when buffer (after the first) starts playing&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| u16&lt;br /&gt;
| Sync count&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| u32&lt;br /&gt;
| Position (number of samples) into current buffer playback&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer id of the buffer that&#039;s just started playing.&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| u16&lt;br /&gt;
| -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Input ADPCM coefficients ==&lt;br /&gt;
&lt;br /&gt;
This is a 32 byte long structure. There are 24 of them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s5.11[16]&lt;br /&gt;
| ADPCM coefficents&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== DSP configuration ==&lt;br /&gt;
&lt;br /&gt;
=== Delay Effect ===&lt;br /&gt;
&lt;br /&gt;
Delay with feedback.&lt;br /&gt;
&lt;br /&gt;
Length of delay is expressed in terms of number of audio frames (there are 160 samples per audio frame).&lt;br /&gt;
&lt;br /&gt;
Feedback arm only has a gain on it. Under the feedback arm is a single-pole filter with the delay.&lt;br /&gt;
&lt;br /&gt;
=== Reverb Effect ===&lt;br /&gt;
&lt;br /&gt;
Reverb consists of two comb filters and one all-pass filter in standard configuration.&lt;br /&gt;
&lt;br /&gt;
== DSP status ==&lt;br /&gt;
&lt;br /&gt;
Read only.&lt;br /&gt;
&lt;br /&gt;
== Output samples ==&lt;br /&gt;
&lt;br /&gt;
Read only. This structure is 640 bytes long. Output is stereo (the 3DS has two speakers).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s16[160]&lt;br /&gt;
| Left-channel Samples&lt;br /&gt;
|-&lt;br /&gt;
| 320&lt;br /&gt;
| s16[160]&lt;br /&gt;
| Right-channel Samples&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This structure has separate arrays for the left and right channels.&lt;br /&gt;
&lt;br /&gt;
== Intermediate mix samples ==&lt;br /&gt;
&lt;br /&gt;
Read/Write.&lt;br /&gt;
&lt;br /&gt;
PCM32. Also serves an aux function, allowing the ARM11 to apply custom effects to audio. Internal format of the DSP firmware is quadaphonic audio.&lt;br /&gt;
&lt;br /&gt;
This structure is 5120 bytes long.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| IntermediateSample[160]&lt;br /&gt;
| Samples&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In contrast to the final output samples, this structure has the left/right channels interleaved.&lt;br /&gt;
&lt;br /&gt;
=== Intermediate sample ===&lt;br /&gt;
&lt;br /&gt;
A quadraphonic sample.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s32&lt;br /&gt;
| Left Channel A&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| s32&lt;br /&gt;
| Right Channel A&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| s32&lt;br /&gt;
| Left Channel B&lt;br /&gt;
|-&lt;br /&gt;
| 12&lt;br /&gt;
| s32&lt;br /&gt;
| Right Channel B&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Compressor table ==&lt;br /&gt;
&lt;br /&gt;
A precomputed response curve lookup table for the compressor.&lt;br /&gt;
&lt;br /&gt;
[[Category:DSP]]&lt;/div&gt;</summary>
		<author><name>Merry</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=DSP_Memory_Region&amp;diff=17568</id>
		<title>DSP Memory Region</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=DSP_Memory_Region&amp;diff=17568"/>
		<updated>2016-06-23T11:30:03Z</updated>

		<summary type="html">&lt;p&gt;Merry: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Some of this is known to be incorrect. I&#039;ll correct this in a few months after a bit more RE work. [[User:Merry|Merry]] ([[User talk:Merry|talk]]) 21:10, 28 January 2016 (CET)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*Note that everything below will vary depending on the exact DSP firmware used and different variants have slightly different behaviours.*&lt;br /&gt;
&lt;br /&gt;
The DSP communicates with the application through two shared memory areas 0x8000 bytes long each (at 0x1FF50000 and 0x1FF70000 respectively). The DSP alternates between the use of these two areas (much like a double-buffer). Each area has 15 structures within it. The location of these structures can be obtained by [[DSP:ReadPipe|reading channel 2 of the DSP pipe]]. A list of structures in the order the DSP addresses are read from the pipe follows:&lt;br /&gt;
&lt;br /&gt;
1. Frame count&lt;br /&gt;
&lt;br /&gt;
2. Input configurations&lt;br /&gt;
&lt;br /&gt;
3. Input status&lt;br /&gt;
&lt;br /&gt;
4. Input ADPCM coefficients&lt;br /&gt;
&lt;br /&gt;
5. DSP configuration&lt;br /&gt;
&lt;br /&gt;
6. DSP status&lt;br /&gt;
&lt;br /&gt;
7. Output samples&lt;br /&gt;
&lt;br /&gt;
8. Intermediate mix samples&lt;br /&gt;
&lt;br /&gt;
9. Compressor table&lt;br /&gt;
&lt;br /&gt;
10. DSP debug statistics&lt;br /&gt;
&lt;br /&gt;
11. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
12. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
13. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
14. Surround sound biquad filter 1&lt;br /&gt;
&lt;br /&gt;
15. Surround sound biquad filter 2&lt;br /&gt;
&lt;br /&gt;
The DSP has 24 inputs, each of which are individually configurable. These 24 inputs each produce three sets of 4 audio channels (two left, two right). &lt;br /&gt;
&lt;br /&gt;
These four audio channels feed into three intermediate mixers. Two of these intermediate mixers are used for effects and aux.&lt;br /&gt;
&lt;br /&gt;
== Frame Count ==&lt;br /&gt;
&lt;br /&gt;
The frame count of the first region must be even and the frame count of the second region must be odd.&lt;br /&gt;
&lt;br /&gt;
The frame with the higher count is the &amp;quot;current region&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The DSP firmware only responds if the first frame count is 4.&lt;br /&gt;
&lt;br /&gt;
== Input Config ==&lt;br /&gt;
&lt;br /&gt;
A 192 byte long structure. There are 24 of them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u32&lt;br /&gt;
| Dirty flags&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| f32[3][2][2]&lt;br /&gt;
| Input Gain (Each input has 12 channels)&lt;br /&gt;
|-&lt;br /&gt;
| 52&lt;br /&gt;
| f32&lt;br /&gt;
| Rate multiplier (1.0x == native DSP rate)&lt;br /&gt;
|-&lt;br /&gt;
| 56&lt;br /&gt;
| u8&lt;br /&gt;
| Interpolation mode&lt;br /&gt;
|-&lt;br /&gt;
| 57&lt;br /&gt;
| u8&lt;br /&gt;
| Polyphase filter select&lt;br /&gt;
|-&lt;br /&gt;
| 58&lt;br /&gt;
| u16&lt;br /&gt;
| bit[0]: Simple Filter enabled, bit[1]: Biquadratic Filter enabled&lt;br /&gt;
|-&lt;br /&gt;
| 60&lt;br /&gt;
| SimpleFilter&lt;br /&gt;
| Simple Filter (One pole normalized recursive linear filter)&lt;br /&gt;
|-&lt;br /&gt;
| 64&lt;br /&gt;
| BiquadFilter&lt;br /&gt;
| Biquadratic Filter (Two poles two zeros normalized recursive linear filter)&lt;br /&gt;
|-&lt;br /&gt;
| 74&lt;br /&gt;
| u16&lt;br /&gt;
| Bitmap of which buffers in queue are dirty&lt;br /&gt;
|-&lt;br /&gt;
| 76&lt;br /&gt;
| Buffer[4]&lt;br /&gt;
| Buffer queue&lt;br /&gt;
|-&lt;br /&gt;
| 156&lt;br /&gt;
| u32&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| 160&lt;br /&gt;
| u16&lt;br /&gt;
| Is Active&lt;br /&gt;
|-&lt;br /&gt;
| 162&lt;br /&gt;
| u16 &lt;br /&gt;
| Sync Count&lt;br /&gt;
|-&lt;br /&gt;
| 164&lt;br /&gt;
| u32&lt;br /&gt;
| Play position&lt;br /&gt;
|-&lt;br /&gt;
| 168&lt;br /&gt;
| 4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 172&lt;br /&gt;
| u32&lt;br /&gt;
| Physical address of embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 176&lt;br /&gt;
| u32&lt;br /&gt;
| Number of samples in embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 180&lt;br /&gt;
| u16&lt;br /&gt;
| Format&lt;br /&gt;
|-&lt;br /&gt;
| 182&lt;br /&gt;
| AdpcmData&lt;br /&gt;
| ADPCM data associated with embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 188&lt;br /&gt;
| u16&lt;br /&gt;
| bit[0]: ADPCM updated?; bit[1]: Is looping?r&lt;br /&gt;
|-&lt;br /&gt;
| 190&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer Id of embedded buffer&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
There is a 2 sample delay in this preprocessing stage, likely due to the interpolation step.&lt;br /&gt;
&lt;br /&gt;
=== Format ===&lt;br /&gt;
&lt;br /&gt;
This is a u16.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Bits&lt;br /&gt;
| Desciption&lt;br /&gt;
|-&lt;br /&gt;
| 0-1&lt;br /&gt;
| Number of channels: 0,1,3 = mono; 2 = stereo&lt;br /&gt;
|-&lt;br /&gt;
| 2-3&lt;br /&gt;
| Buffer codec: [[BCWAV#Encoding|0:PCM8; 1:PCM16; 2:ADPCM]]&lt;br /&gt;
|-&lt;br /&gt;
| 5 &lt;br /&gt;
| Fade&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Buffer ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u32&lt;br /&gt;
| Physical Address&lt;br /&gt;
|-&lt;br /&gt;
| 4 &lt;br /&gt;
| u32&lt;br /&gt;
| Sample Count&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| AdpcmData&lt;br /&gt;
| ADPCM data&lt;br /&gt;
|-&lt;br /&gt;
| 14&lt;br /&gt;
| u8&lt;br /&gt;
| ADPCM data dirty?&lt;br /&gt;
|-&lt;br /&gt;
| 15&lt;br /&gt;
| u8&lt;br /&gt;
| Looping?&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer Id&lt;br /&gt;
|-&lt;br /&gt;
| 18&lt;br /&gt;
| u16&lt;br /&gt;
| -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Adpcm Data === &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u8&lt;br /&gt;
| ADPCM predictor/scale&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| u8&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| s16&lt;br /&gt;
| ADPCM y[n-1]&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| s16&lt;br /&gt;
| ADPCM y[n-2]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Simple Filter ===&lt;br /&gt;
&lt;br /&gt;
This is a standard single-pole filter. The fall-off is 6dB per octave as you would expect.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s1.15&lt;br /&gt;
| b0&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| s1.15&lt;br /&gt;
| a1 (negated)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Biquad Filter ===&lt;br /&gt;
&lt;br /&gt;
This is a [[wikipedia:Digital_biquad_filter|biquadratic filter]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s2.14&lt;br /&gt;
| a2 (negated)&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| s2.14&lt;br /&gt;
| a1 (negated)&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| s2.14&lt;br /&gt;
| b2&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| s2.14&lt;br /&gt;
| b1&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| s2.14&lt;br /&gt;
| b0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Input status ==&lt;br /&gt;
&lt;br /&gt;
Read only. This structure is set by the DSP. This structure is 12 bytes long and there are 24 of them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u8&lt;br /&gt;
| Input Enabled?&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| u8&lt;br /&gt;
| Dirty flag for buffer id, set to 1 when buffer (after the first) starts playing&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| u16&lt;br /&gt;
| Sync count&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| u32&lt;br /&gt;
| Position (number of samples) into current buffer playback&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer id of the buffer that&#039;s just started playing.&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| u16&lt;br /&gt;
| -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Input ADPCM coefficients ==&lt;br /&gt;
&lt;br /&gt;
This is a 32 byte long structure. There are 24 of them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s5.11[16]&lt;br /&gt;
| ADPCM coefficents&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== DSP configuration ==&lt;br /&gt;
&lt;br /&gt;
=== Delay Effect ===&lt;br /&gt;
&lt;br /&gt;
Delay with feedback.&lt;br /&gt;
&lt;br /&gt;
Length of delay is expressed in terms of number of audio frames (there are 160 samples per audio frame).&lt;br /&gt;
&lt;br /&gt;
Feedback arm only has a gain on it. Under the feedback arm is a single-pole filter with the delay.&lt;br /&gt;
&lt;br /&gt;
=== Reverb Effect ===&lt;br /&gt;
&lt;br /&gt;
Reverb consists of two comb filters and one all-pass filter in standard configuration.&lt;br /&gt;
&lt;br /&gt;
== DSP status ==&lt;br /&gt;
&lt;br /&gt;
Read only.&lt;br /&gt;
&lt;br /&gt;
== Output samples ==&lt;br /&gt;
&lt;br /&gt;
Read only. This structure is 640 bytes long. Output is stereo (the 3DS has two speakers).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s16[160]&lt;br /&gt;
| Left-channel Samples&lt;br /&gt;
|-&lt;br /&gt;
| 320&lt;br /&gt;
| s16[160]&lt;br /&gt;
| Right-channel Samples&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This structure has separate arrays for the left and right channels.&lt;br /&gt;
&lt;br /&gt;
== Intermediate mix samples ==&lt;br /&gt;
&lt;br /&gt;
Read/Write.&lt;br /&gt;
&lt;br /&gt;
PCM32. Also serves an aux function, allowing the ARM11 to apply custom effects to audio. Internal format of the DSP firmware is quadaphonic audio.&lt;br /&gt;
&lt;br /&gt;
This structure is 5120 bytes long.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| IntermediateSample[160]&lt;br /&gt;
| Samples&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In contrast to the final output samples, this structure has the left/right channels interleaved.&lt;br /&gt;
&lt;br /&gt;
=== Intermediate sample ===&lt;br /&gt;
&lt;br /&gt;
A quadraphonic sample.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s32&lt;br /&gt;
| Left Channel A&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| s32&lt;br /&gt;
| Right Channel A&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| s32&lt;br /&gt;
| Left Channel B&lt;br /&gt;
|-&lt;br /&gt;
| 12&lt;br /&gt;
| s32&lt;br /&gt;
| Right Channel B&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Compressor table ==&lt;br /&gt;
&lt;br /&gt;
A precomputed response curve lookup table for the compressor.&lt;/div&gt;</summary>
		<author><name>Merry</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=DSP_Memory_Region&amp;diff=17567</id>
		<title>DSP Memory Region</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=DSP_Memory_Region&amp;diff=17567"/>
		<updated>2016-06-23T11:24:07Z</updated>

		<summary type="html">&lt;p&gt;Merry: /* Intermediate mix samples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Some of this is known to be incorrect. I&#039;ll correct this in a few months after a bit more RE work. [[User:Merry|Merry]] ([[User talk:Merry|talk]]) 21:10, 28 January 2016 (CET)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*Note that everything below will vary depending on the exact DSP firmware used and different variants have slightly different behaviours.*&lt;br /&gt;
&lt;br /&gt;
The DSP communicates with the application through two shared memory areas 0x8000 bytes long each (at 0x1FF50000 and 0x1FF70000 respectively). The DSP alternates between the use of these two areas (much like a double-buffer). Each area has 15 structures within it. The location of these structures can be obtained by [[DSP:ReadPipe|reading channel 2 of the DSP pipe]]. A list of structures in the order the DSP addresses are read from the pipe follows:&lt;br /&gt;
&lt;br /&gt;
1. Frame count&lt;br /&gt;
&lt;br /&gt;
2. Input configurations&lt;br /&gt;
&lt;br /&gt;
3. Input status&lt;br /&gt;
&lt;br /&gt;
4. Input ADPCM coefficients&lt;br /&gt;
&lt;br /&gt;
5. DSP configuration&lt;br /&gt;
&lt;br /&gt;
6. DSP status&lt;br /&gt;
&lt;br /&gt;
7. Output samples&lt;br /&gt;
&lt;br /&gt;
8. Intermediate mix samples&lt;br /&gt;
&lt;br /&gt;
9. Compressor table&lt;br /&gt;
&lt;br /&gt;
10. DSP debug statistics&lt;br /&gt;
&lt;br /&gt;
11. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
12. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
13. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
14. Surround sound biquad filter 1&lt;br /&gt;
&lt;br /&gt;
15. Surround sound biquad filter 2&lt;br /&gt;
&lt;br /&gt;
The DSP has 24 inputs, each of which are individually configurable. These 24 inputs each produce three sets of 4 audio channels (two left, two right). &lt;br /&gt;
&lt;br /&gt;
These four audio channels feed into three intermediate mixers. Two of these intermediate mixers are used for effects and aux.&lt;br /&gt;
&lt;br /&gt;
== Frame Count ==&lt;br /&gt;
&lt;br /&gt;
The frame count of the first region must be even and the frame count of the second region must be odd.&lt;br /&gt;
&lt;br /&gt;
The frame with the higher count is the &amp;quot;current region&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The DSP firmware only responds if the first frame count is 4.&lt;br /&gt;
&lt;br /&gt;
== Input Config ==&lt;br /&gt;
&lt;br /&gt;
A 192 byte long structure. There are 24 of them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u32&lt;br /&gt;
| Dirty flags&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| f32[3][2][2]&lt;br /&gt;
| Input Gain (Each input has 12 channels)&lt;br /&gt;
|-&lt;br /&gt;
| 52&lt;br /&gt;
| f32&lt;br /&gt;
| Rate multiplier (1.0x == native DSP rate)&lt;br /&gt;
|-&lt;br /&gt;
| 56&lt;br /&gt;
| u8&lt;br /&gt;
| Interpolation mode&lt;br /&gt;
|-&lt;br /&gt;
| 57&lt;br /&gt;
| u8&lt;br /&gt;
| Polyphase filter select&lt;br /&gt;
|-&lt;br /&gt;
| 58&lt;br /&gt;
| u16&lt;br /&gt;
| bit[0]: Simple Filter enabled, bit[1]: Biquadratic Filter enabled&lt;br /&gt;
|-&lt;br /&gt;
| 60&lt;br /&gt;
| SimpleFilter&lt;br /&gt;
| Simple Filter (One pole normalized recursive linear filter)&lt;br /&gt;
|-&lt;br /&gt;
| 64&lt;br /&gt;
| BiquadFilter&lt;br /&gt;
| Biquadratic Filter (Two poles two zeros normalized recursive linear filter)&lt;br /&gt;
|-&lt;br /&gt;
| 74&lt;br /&gt;
| u16&lt;br /&gt;
| Bitmap of which buffers in queue are dirty&lt;br /&gt;
|-&lt;br /&gt;
| 76&lt;br /&gt;
| Buffer[4]&lt;br /&gt;
| Buffer queue&lt;br /&gt;
|-&lt;br /&gt;
| 156&lt;br /&gt;
| u32&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| 160&lt;br /&gt;
| u16&lt;br /&gt;
| Is Active&lt;br /&gt;
|-&lt;br /&gt;
| 162&lt;br /&gt;
| u16 &lt;br /&gt;
| Sync Count&lt;br /&gt;
|-&lt;br /&gt;
| 164&lt;br /&gt;
| u32&lt;br /&gt;
| Play position&lt;br /&gt;
|-&lt;br /&gt;
| 168&lt;br /&gt;
| 4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 172&lt;br /&gt;
| u32&lt;br /&gt;
| Physical address of embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 176&lt;br /&gt;
| u32&lt;br /&gt;
| Number of samples in embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 180&lt;br /&gt;
| u16&lt;br /&gt;
| Format&lt;br /&gt;
|-&lt;br /&gt;
| 182&lt;br /&gt;
| AdpcmData&lt;br /&gt;
| ADPCM data associated with embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 188&lt;br /&gt;
| u16&lt;br /&gt;
| bit[0]: ADPCM updated?; bit[1]: Is looping?r&lt;br /&gt;
|-&lt;br /&gt;
| 190&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer Id of embedded buffer&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
There is a 2 sample delay in this preprocessing stage, likely due to the interpolation step.&lt;br /&gt;
&lt;br /&gt;
=== Format ===&lt;br /&gt;
&lt;br /&gt;
This is a u16.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Bits&lt;br /&gt;
| Desciption&lt;br /&gt;
|-&lt;br /&gt;
| 0-1&lt;br /&gt;
| Number of channels: 0,1,3 = mono; 2 = stereo&lt;br /&gt;
|-&lt;br /&gt;
| 2-3&lt;br /&gt;
| Buffer codec: [[BCWAV#Encoding|0:PCM8; 1:PCM16; 2:ADPCM]]&lt;br /&gt;
|-&lt;br /&gt;
| 5 &lt;br /&gt;
| Fade&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Buffer ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u32&lt;br /&gt;
| Physical Address&lt;br /&gt;
|-&lt;br /&gt;
| 4 &lt;br /&gt;
| u32&lt;br /&gt;
| Sample Count&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| AdpcmData&lt;br /&gt;
| ADPCM data&lt;br /&gt;
|-&lt;br /&gt;
| 14&lt;br /&gt;
| u8&lt;br /&gt;
| ADPCM data dirty?&lt;br /&gt;
|-&lt;br /&gt;
| 15&lt;br /&gt;
| u8&lt;br /&gt;
| Looping?&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer Id&lt;br /&gt;
|-&lt;br /&gt;
| 18&lt;br /&gt;
| u16&lt;br /&gt;
| -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Adpcm Data === &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u8&lt;br /&gt;
| ADPCM predictor/scale&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| u8&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| s16&lt;br /&gt;
| ADPCM y[n-1]&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| s16&lt;br /&gt;
| ADPCM y[n-2]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Simple Filter ===&lt;br /&gt;
&lt;br /&gt;
This is a standard single-pole filter. The fall-off is 6dB per octave as you would expect.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s1.15&lt;br /&gt;
| b0&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| s1.15&lt;br /&gt;
| a1 (negated)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Biquad Filter ===&lt;br /&gt;
&lt;br /&gt;
This is a [[wikipedia:Digital_biquad_filter|biquadratic filter]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s2.14&lt;br /&gt;
| a2 (negated)&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| s2.14&lt;br /&gt;
| a1 (negated)&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| s2.14&lt;br /&gt;
| b2&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| s2.14&lt;br /&gt;
| b1&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| s2.14&lt;br /&gt;
| b0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Input status ==&lt;br /&gt;
&lt;br /&gt;
Read only. This structure is set by the DSP. This structure is 12 bytes long and there are 24 of them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u8&lt;br /&gt;
| Input Enabled?&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| u8&lt;br /&gt;
| Dirty flag for buffer id, set to 1 when buffer (after the first) starts playing&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| u16&lt;br /&gt;
| Sync count&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| u32&lt;br /&gt;
| Position (number of samples) into current buffer playback&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer id of the buffer that&#039;s just started playing.&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| u16&lt;br /&gt;
| -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Input ADPCM coefficients ==&lt;br /&gt;
&lt;br /&gt;
This is a 32 byte long structure. There are 24 of them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s5.11[16]&lt;br /&gt;
| ADPCM coefficents&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== DSP configuration ==&lt;br /&gt;
&lt;br /&gt;
=== Delay Effect ===&lt;br /&gt;
&lt;br /&gt;
Delay with feedback.&lt;br /&gt;
&lt;br /&gt;
Length of delay is expressed in terms of number of audio frames (there are 160 samples per audio frame).&lt;br /&gt;
&lt;br /&gt;
Feedback arm only has a gain on it. Under the feedback arm is a single-pole filter with the delay.&lt;br /&gt;
&lt;br /&gt;
=== Reverb Effect ===&lt;br /&gt;
&lt;br /&gt;
Reverb consists of two comb filters and one all-pass filter in standard configuration.&lt;br /&gt;
&lt;br /&gt;
== DSP status ==&lt;br /&gt;
&lt;br /&gt;
Read only.&lt;br /&gt;
&lt;br /&gt;
== Output samples ==&lt;br /&gt;
&lt;br /&gt;
Read only. This structure is 640 bytes long. Output is stereo (the 3DS has two speakers).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s16[160]&lt;br /&gt;
| Left-channel Samples&lt;br /&gt;
|-&lt;br /&gt;
| 320&lt;br /&gt;
| s16[160]&lt;br /&gt;
| Right-channel Samples&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Intermediate mix samples ==&lt;br /&gt;
&lt;br /&gt;
Read/Write.&lt;br /&gt;
&lt;br /&gt;
PCM32. Also serves an aux function, allowing the ARM11 to apply custom effects to audio. Internal format of the DSP firmware is quadaphonic audio.&lt;br /&gt;
&lt;br /&gt;
This structure is 5120 bytes long.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| IntermediateSample[160]&lt;br /&gt;
| Samples&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Yes, this has the dimensionality opposite to that of the output samples, that is not a mistake.&lt;br /&gt;
&lt;br /&gt;
=== Intermediate sample ===&lt;br /&gt;
&lt;br /&gt;
A quadraphonic sample.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s32&lt;br /&gt;
| Left Channel A&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| s32&lt;br /&gt;
| Right Channel A&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| s32&lt;br /&gt;
| Left Channel B&lt;br /&gt;
|-&lt;br /&gt;
| 12&lt;br /&gt;
| s32&lt;br /&gt;
| Right Channel B&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Compressor table ==&lt;br /&gt;
&lt;br /&gt;
A precomputed response curve lookup table for the compressor.&lt;/div&gt;</summary>
		<author><name>Merry</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=DSP_Memory_Region&amp;diff=17565</id>
		<title>DSP Memory Region</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=DSP_Memory_Region&amp;diff=17565"/>
		<updated>2016-06-23T11:21:47Z</updated>

		<summary type="html">&lt;p&gt;Merry: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Some of this is known to be incorrect. I&#039;ll correct this in a few months after a bit more RE work. [[User:Merry|Merry]] ([[User talk:Merry|talk]]) 21:10, 28 January 2016 (CET)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*Note that everything below will vary depending on the exact DSP firmware used and different variants have slightly different behaviours.*&lt;br /&gt;
&lt;br /&gt;
The DSP communicates with the application through two shared memory areas 0x8000 bytes long each (at 0x1FF50000 and 0x1FF70000 respectively). The DSP alternates between the use of these two areas (much like a double-buffer). Each area has 15 structures within it. The location of these structures can be obtained by [[DSP:ReadPipe|reading channel 2 of the DSP pipe]]. A list of structures in the order the DSP addresses are read from the pipe follows:&lt;br /&gt;
&lt;br /&gt;
1. Frame count&lt;br /&gt;
&lt;br /&gt;
2. Input configurations&lt;br /&gt;
&lt;br /&gt;
3. Input status&lt;br /&gt;
&lt;br /&gt;
4. Input ADPCM coefficients&lt;br /&gt;
&lt;br /&gt;
5. DSP configuration&lt;br /&gt;
&lt;br /&gt;
6. DSP status&lt;br /&gt;
&lt;br /&gt;
7. Output samples&lt;br /&gt;
&lt;br /&gt;
8. Intermediate mix samples&lt;br /&gt;
&lt;br /&gt;
9. Compressor table&lt;br /&gt;
&lt;br /&gt;
10. DSP debug statistics&lt;br /&gt;
&lt;br /&gt;
11. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
12. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
13. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
14. Surround sound biquad filter 1&lt;br /&gt;
&lt;br /&gt;
15. Surround sound biquad filter 2&lt;br /&gt;
&lt;br /&gt;
The DSP has 24 inputs, each of which are individually configurable. These 24 inputs each produce three sets of 4 audio channels (two left, two right). &lt;br /&gt;
&lt;br /&gt;
These four audio channels feed into three intermediate mixers. Two of these intermediate mixers are used for effects and aux.&lt;br /&gt;
&lt;br /&gt;
== Frame Count ==&lt;br /&gt;
&lt;br /&gt;
The frame count of the first region must be even and the frame count of the second region must be odd.&lt;br /&gt;
&lt;br /&gt;
The frame with the higher count is the &amp;quot;current region&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The DSP firmware only responds if the first frame count is 4.&lt;br /&gt;
&lt;br /&gt;
== Input Config ==&lt;br /&gt;
&lt;br /&gt;
A 192 byte long structure. There are 24 of them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u32&lt;br /&gt;
| Dirty flags&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| f32[3][2][2]&lt;br /&gt;
| Input Gain (Each input has 12 channels)&lt;br /&gt;
|-&lt;br /&gt;
| 52&lt;br /&gt;
| f32&lt;br /&gt;
| Rate multiplier (1.0x == native DSP rate)&lt;br /&gt;
|-&lt;br /&gt;
| 56&lt;br /&gt;
| u8&lt;br /&gt;
| Interpolation mode&lt;br /&gt;
|-&lt;br /&gt;
| 57&lt;br /&gt;
| u8&lt;br /&gt;
| Polyphase filter select&lt;br /&gt;
|-&lt;br /&gt;
| 58&lt;br /&gt;
| u16&lt;br /&gt;
| bit[0]: Simple Filter enabled, bit[1]: Biquadratic Filter enabled&lt;br /&gt;
|-&lt;br /&gt;
| 60&lt;br /&gt;
| SimpleFilter&lt;br /&gt;
| Simple Filter (One pole normalized recursive linear filter)&lt;br /&gt;
|-&lt;br /&gt;
| 64&lt;br /&gt;
| BiquadFilter&lt;br /&gt;
| Biquadratic Filter (Two poles two zeros normalized recursive linear filter)&lt;br /&gt;
|-&lt;br /&gt;
| 74&lt;br /&gt;
| u16&lt;br /&gt;
| Bitmap of which buffers in queue are dirty&lt;br /&gt;
|-&lt;br /&gt;
| 76&lt;br /&gt;
| Buffer[4]&lt;br /&gt;
| Buffer queue&lt;br /&gt;
|-&lt;br /&gt;
| 156&lt;br /&gt;
| u32&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| 160&lt;br /&gt;
| u16&lt;br /&gt;
| Is Active&lt;br /&gt;
|-&lt;br /&gt;
| 162&lt;br /&gt;
| u16 &lt;br /&gt;
| Sync Count&lt;br /&gt;
|-&lt;br /&gt;
| 164&lt;br /&gt;
| u32&lt;br /&gt;
| Play position&lt;br /&gt;
|-&lt;br /&gt;
| 168&lt;br /&gt;
| 4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 172&lt;br /&gt;
| u32&lt;br /&gt;
| Physical address of embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 176&lt;br /&gt;
| u32&lt;br /&gt;
| Number of samples in embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 180&lt;br /&gt;
| u16&lt;br /&gt;
| Format&lt;br /&gt;
|-&lt;br /&gt;
| 182&lt;br /&gt;
| AdpcmData&lt;br /&gt;
| ADPCM data associated with embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 188&lt;br /&gt;
| u16&lt;br /&gt;
| bit[0]: ADPCM updated?; bit[1]: Is looping?r&lt;br /&gt;
|-&lt;br /&gt;
| 190&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer Id of embedded buffer&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
There is a 2 sample delay in this preprocessing stage, likely due to the interpolation step.&lt;br /&gt;
&lt;br /&gt;
=== Format ===&lt;br /&gt;
&lt;br /&gt;
This is a u16.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Bits&lt;br /&gt;
| Desciption&lt;br /&gt;
|-&lt;br /&gt;
| 0-1&lt;br /&gt;
| Number of channels: 0,1,3 = mono; 2 = stereo&lt;br /&gt;
|-&lt;br /&gt;
| 2-3&lt;br /&gt;
| Buffer codec: [[BCWAV#Encoding|0:PCM8; 1:PCM16; 2:ADPCM]]&lt;br /&gt;
|-&lt;br /&gt;
| 5 &lt;br /&gt;
| Fade&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Buffer ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u32&lt;br /&gt;
| Physical Address&lt;br /&gt;
|-&lt;br /&gt;
| 4 &lt;br /&gt;
| u32&lt;br /&gt;
| Sample Count&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| AdpcmData&lt;br /&gt;
| ADPCM data&lt;br /&gt;
|-&lt;br /&gt;
| 14&lt;br /&gt;
| u8&lt;br /&gt;
| ADPCM data dirty?&lt;br /&gt;
|-&lt;br /&gt;
| 15&lt;br /&gt;
| u8&lt;br /&gt;
| Looping?&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer Id&lt;br /&gt;
|-&lt;br /&gt;
| 18&lt;br /&gt;
| u16&lt;br /&gt;
| -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Adpcm Data === &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u8&lt;br /&gt;
| ADPCM predictor/scale&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| u8&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| s16&lt;br /&gt;
| ADPCM y[n-1]&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| s16&lt;br /&gt;
| ADPCM y[n-2]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Simple Filter ===&lt;br /&gt;
&lt;br /&gt;
This is a standard single-pole filter. The fall-off is 6dB per octave as you would expect.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s1.15&lt;br /&gt;
| b0&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| s1.15&lt;br /&gt;
| a1 (negated)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Biquad Filter ===&lt;br /&gt;
&lt;br /&gt;
This is a [[wikipedia:Digital_biquad_filter|biquadratic filter]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s2.14&lt;br /&gt;
| a2 (negated)&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| s2.14&lt;br /&gt;
| a1 (negated)&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| s2.14&lt;br /&gt;
| b2&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| s2.14&lt;br /&gt;
| b1&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| s2.14&lt;br /&gt;
| b0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Input status ==&lt;br /&gt;
&lt;br /&gt;
Read only. This structure is set by the DSP. This structure is 12 bytes long and there are 24 of them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u8&lt;br /&gt;
| Input Enabled?&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| u8&lt;br /&gt;
| Dirty flag for buffer id, set to 1 when buffer (after the first) starts playing&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| u16&lt;br /&gt;
| Sync count&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| u32&lt;br /&gt;
| Position (number of samples) into current buffer playback&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer id of the buffer that&#039;s just started playing.&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| u16&lt;br /&gt;
| -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Input ADPCM coefficients ==&lt;br /&gt;
&lt;br /&gt;
This is a 32 byte long structure. There are 24 of them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s5.11[16]&lt;br /&gt;
| ADPCM coefficents&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== DSP configuration ==&lt;br /&gt;
&lt;br /&gt;
=== Delay Effect ===&lt;br /&gt;
&lt;br /&gt;
Delay with feedback.&lt;br /&gt;
&lt;br /&gt;
Length of delay is expressed in terms of number of audio frames (there are 160 samples per audio frame).&lt;br /&gt;
&lt;br /&gt;
Feedback arm only has a gain on it. Under the feedback arm is a single-pole filter with the delay.&lt;br /&gt;
&lt;br /&gt;
=== Reverb Effect ===&lt;br /&gt;
&lt;br /&gt;
Reverb consists of two comb filters and one all-pass filter in standard configuration.&lt;br /&gt;
&lt;br /&gt;
== DSP status ==&lt;br /&gt;
&lt;br /&gt;
Read only.&lt;br /&gt;
&lt;br /&gt;
== Output samples ==&lt;br /&gt;
&lt;br /&gt;
Read only. This structure is 640 bytes long. Output is stereo (the 3DS has two speakers).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s16[160]&lt;br /&gt;
| Left-channel Samples&lt;br /&gt;
|-&lt;br /&gt;
| 320&lt;br /&gt;
| s16[160]&lt;br /&gt;
| Right-channel Samples&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Intermediate mix samples ==&lt;br /&gt;
&lt;br /&gt;
Read/Write.&lt;br /&gt;
&lt;br /&gt;
PCM32. Also serves an aux function, allowing the ARM11 to apply custom effects to audio. Internal format of the DSP firmware is quadaphonic audio.&lt;br /&gt;
&lt;br /&gt;
This structure is 5120 bytes long.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| IntermediateSample[160]&lt;br /&gt;
| Samples. There are &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Yes, this has the dimensionality opposite to that of the output samples, that is not a mistake.&lt;br /&gt;
&lt;br /&gt;
=== Intermediate sample ===&lt;br /&gt;
&lt;br /&gt;
A quadraphonic sample.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s32&lt;br /&gt;
| Left Channel A&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| s32&lt;br /&gt;
| Right Channel A&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| s32&lt;br /&gt;
| Left Channel B&lt;br /&gt;
|-&lt;br /&gt;
| 12&lt;br /&gt;
| s32&lt;br /&gt;
| Right Channel B&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Compressor table ==&lt;br /&gt;
&lt;br /&gt;
A precomputed response curve lookup table for the compressor.&lt;/div&gt;</summary>
		<author><name>Merry</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=DSP_Memory_Region&amp;diff=17564</id>
		<title>DSP Memory Region</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=DSP_Memory_Region&amp;diff=17564"/>
		<updated>2016-06-23T11:15:42Z</updated>

		<summary type="html">&lt;p&gt;Merry: /* Output samples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Some of this is known to be incorrect. I&#039;ll correct this in a few months after a bit more RE work. [[User:Merry|Merry]] ([[User talk:Merry|talk]]) 21:10, 28 January 2016 (CET)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*Note that everything below will vary depending on the exact DSP firmware used and different variants have slightly different behaviours.*&lt;br /&gt;
&lt;br /&gt;
The DSP communicates with the application through two shared memory areas 0x8000 bytes long each (at 0x1FF50000 and 0x1FF70000 respectively). The DSP alternates between the use of these two areas (much like a double-buffer). Each area has 15 structures within it. The location of these structures can be obtained by [[DSP:ReadPipe|reading channel 2 of the DSP pipe]]. A list of structures in the order the DSP addresses are read from the pipe follows:&lt;br /&gt;
&lt;br /&gt;
1. Frame count&lt;br /&gt;
&lt;br /&gt;
2. Input configurations&lt;br /&gt;
&lt;br /&gt;
3. Input status&lt;br /&gt;
&lt;br /&gt;
4. Input ADPCM coefficients&lt;br /&gt;
&lt;br /&gt;
5. DSP configuration&lt;br /&gt;
&lt;br /&gt;
6. DSP status&lt;br /&gt;
&lt;br /&gt;
7. Output samples&lt;br /&gt;
&lt;br /&gt;
8. Intermediate mix samples&lt;br /&gt;
&lt;br /&gt;
9. Compressor table&lt;br /&gt;
&lt;br /&gt;
10. DSP debug statistics&lt;br /&gt;
&lt;br /&gt;
11. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
12. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
13. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
14. Surround sound biquad filter 1&lt;br /&gt;
&lt;br /&gt;
15. Surround sound biquad filter 2&lt;br /&gt;
&lt;br /&gt;
The DSP has 24 inputs, each of which are individually configurable. These 24 inputs each produce three sets of 4 audio channels (two left, two right). &lt;br /&gt;
&lt;br /&gt;
These four audio channels feed into three intermediate mixers. Two of these intermediate mixers are used for effects and aux.&lt;br /&gt;
&lt;br /&gt;
== Frame Count ==&lt;br /&gt;
&lt;br /&gt;
The frame count of the first region must be even and the frame count of the second region must be odd.&lt;br /&gt;
&lt;br /&gt;
The frame with the higher count is the &amp;quot;current region&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The DSP firmware only responds if the first frame count is 4.&lt;br /&gt;
&lt;br /&gt;
== Input Config ==&lt;br /&gt;
&lt;br /&gt;
A 192 byte long structure. There are 24 of them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u32&lt;br /&gt;
| Dirty flags&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| f32[3][2][2]&lt;br /&gt;
| Input Gain (Each input has 12 channels)&lt;br /&gt;
|-&lt;br /&gt;
| 52&lt;br /&gt;
| f32&lt;br /&gt;
| Rate multiplier (1.0x == native DSP rate)&lt;br /&gt;
|-&lt;br /&gt;
| 56&lt;br /&gt;
| u8&lt;br /&gt;
| Interpolation mode&lt;br /&gt;
|-&lt;br /&gt;
| 57&lt;br /&gt;
| u8&lt;br /&gt;
| Polyphase filter select&lt;br /&gt;
|-&lt;br /&gt;
| 58&lt;br /&gt;
| u16&lt;br /&gt;
| bit[0]: Simple Filter enabled, bit[1]: Biquadratic Filter enabled&lt;br /&gt;
|-&lt;br /&gt;
| 60&lt;br /&gt;
| SimpleFilter&lt;br /&gt;
| Simple Filter (One pole normalized recursive linear filter)&lt;br /&gt;
|-&lt;br /&gt;
| 64&lt;br /&gt;
| BiquadFilter&lt;br /&gt;
| Biquadratic Filter (Two poles two zeros normalized recursive linear filter)&lt;br /&gt;
|-&lt;br /&gt;
| 74&lt;br /&gt;
| u16&lt;br /&gt;
| Bitmap of which buffers in queue are dirty&lt;br /&gt;
|-&lt;br /&gt;
| 76&lt;br /&gt;
| Buffer[4]&lt;br /&gt;
| Buffer queue&lt;br /&gt;
|-&lt;br /&gt;
| 156&lt;br /&gt;
| u32&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| 160&lt;br /&gt;
| u16&lt;br /&gt;
| Is Active&lt;br /&gt;
|-&lt;br /&gt;
| 162&lt;br /&gt;
| u16 &lt;br /&gt;
| Sync Count&lt;br /&gt;
|-&lt;br /&gt;
| 164&lt;br /&gt;
| u32&lt;br /&gt;
| Play position&lt;br /&gt;
|-&lt;br /&gt;
| 168&lt;br /&gt;
| 4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 172&lt;br /&gt;
| u32&lt;br /&gt;
| Physical address of embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 176&lt;br /&gt;
| u32&lt;br /&gt;
| Number of samples in embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 180&lt;br /&gt;
| u16&lt;br /&gt;
| Format&lt;br /&gt;
|-&lt;br /&gt;
| 182&lt;br /&gt;
| AdpcmData&lt;br /&gt;
| ADPCM data associated with embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 188&lt;br /&gt;
| u16&lt;br /&gt;
| bit[0]: ADPCM updated?; bit[1]: Is looping?r&lt;br /&gt;
|-&lt;br /&gt;
| 190&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer Id of embedded buffer&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
There is a 2 sample delay in this preprocessing stage, likely due to the interpolation step.&lt;br /&gt;
&lt;br /&gt;
=== Format ===&lt;br /&gt;
&lt;br /&gt;
This is a u16.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Bits&lt;br /&gt;
| Desciption&lt;br /&gt;
|-&lt;br /&gt;
| 0-1&lt;br /&gt;
| Number of channels: 0,1,3 = mono; 2 = stereo&lt;br /&gt;
|-&lt;br /&gt;
| 2-3&lt;br /&gt;
| Buffer codec: [[BCWAV#Encoding|0:PCM8; 1:PCM16; 2:ADPCM]]&lt;br /&gt;
|-&lt;br /&gt;
| 5 &lt;br /&gt;
| Fade&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Buffer ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u32&lt;br /&gt;
| Physical Address&lt;br /&gt;
|-&lt;br /&gt;
| 4 &lt;br /&gt;
| u32&lt;br /&gt;
| Sample Count&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| AdpcmData&lt;br /&gt;
| ADPCM data&lt;br /&gt;
|-&lt;br /&gt;
| 14&lt;br /&gt;
| u8&lt;br /&gt;
| ADPCM data dirty?&lt;br /&gt;
|-&lt;br /&gt;
| 15&lt;br /&gt;
| u8&lt;br /&gt;
| Looping?&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer Id&lt;br /&gt;
|-&lt;br /&gt;
| 18&lt;br /&gt;
| u16&lt;br /&gt;
| -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Adpcm Data === &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u8&lt;br /&gt;
| ADPCM predictor/scale&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| u8&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| s16&lt;br /&gt;
| ADPCM y[n-1]&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| s16&lt;br /&gt;
| ADPCM y[n-2]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Simple Filter ===&lt;br /&gt;
&lt;br /&gt;
This is a standard single-pole filter. The fall-off is 6dB per octave as you would expect.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s1.15&lt;br /&gt;
| b0&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| s1.15&lt;br /&gt;
| a1 (negated)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Biquad Filter ===&lt;br /&gt;
&lt;br /&gt;
This is a [[wikipedia:Digital_biquad_filter|biquadratic filter]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s2.14&lt;br /&gt;
| a2 (negated)&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| s2.14&lt;br /&gt;
| a1 (negated)&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| s2.14&lt;br /&gt;
| b2&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| s2.14&lt;br /&gt;
| b1&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| s2.14&lt;br /&gt;
| b0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Input status ==&lt;br /&gt;
&lt;br /&gt;
Read only. This structure is set by the DSP. This structure is 12 bytes long and there are 24 of them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u8&lt;br /&gt;
| Input Enabled?&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| u8&lt;br /&gt;
| Dirty flag for buffer id, set to 1 when buffer (after the first) starts playing&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| u16&lt;br /&gt;
| Sync count&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| u32&lt;br /&gt;
| Position (number of samples) into current buffer playback&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer id of the buffer that&#039;s just started playing.&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| u16&lt;br /&gt;
| -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Input ADPCM coefficients ==&lt;br /&gt;
&lt;br /&gt;
This is a 32 byte long structure. There are 24 of them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s5.11[16]&lt;br /&gt;
| ADPCM coefficents&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== DSP configuration ==&lt;br /&gt;
&lt;br /&gt;
=== Delay Effect ===&lt;br /&gt;
&lt;br /&gt;
Delay with feedback.&lt;br /&gt;
&lt;br /&gt;
Length of delay is expressed in terms of number of audio frames (there are 160 samples per audio frame).&lt;br /&gt;
&lt;br /&gt;
Feedback arm only has a gain on it. Under the feedback arm is a single-pole filter with the delay.&lt;br /&gt;
&lt;br /&gt;
=== Reverb Effect ===&lt;br /&gt;
&lt;br /&gt;
Reverb consists of two comb filters and one all-pass filter in standard configuration.&lt;br /&gt;
&lt;br /&gt;
== DSP status ==&lt;br /&gt;
&lt;br /&gt;
Read only.&lt;br /&gt;
&lt;br /&gt;
== Output samples ==&lt;br /&gt;
&lt;br /&gt;
Read only. This structure is 640 bytes long.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s16[160][2]&lt;br /&gt;
| Samples (Stereo-output, 160 samples per channel)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Intermediate mix samples ==&lt;br /&gt;
&lt;br /&gt;
Read/Write.&lt;br /&gt;
&lt;br /&gt;
PCM32. Also serves an aux function, allowing the ARM11 to apply custom effects to audio.&lt;br /&gt;
&lt;br /&gt;
This structure is 5120 bytes long.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s32[2][4][160]&lt;br /&gt;
| Samples&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Compressor table ==&lt;br /&gt;
&lt;br /&gt;
A precomputed response curve lookup table for the compressor.&lt;/div&gt;</summary>
		<author><name>Merry</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=DSP_Memory_Region&amp;diff=17562</id>
		<title>DSP Memory Region</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=DSP_Memory_Region&amp;diff=17562"/>
		<updated>2016-06-23T11:09:38Z</updated>

		<summary type="html">&lt;p&gt;Merry: /* Output samples */  oops&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Some of this is known to be incorrect. I&#039;ll correct this in a few months after a bit more RE work. [[User:Merry|Merry]] ([[User talk:Merry|talk]]) 21:10, 28 January 2016 (CET)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*Note that everything below will vary depending on the exact DSP firmware used and different variants have slightly different behaviours.*&lt;br /&gt;
&lt;br /&gt;
The DSP communicates with the application through two shared memory areas 0x8000 bytes long each (at 0x1FF50000 and 0x1FF70000 respectively). The DSP alternates between the use of these two areas (much like a double-buffer). Each area has 15 structures within it. The location of these structures can be obtained by [[DSP:ReadPipe|reading channel 2 of the DSP pipe]]. A list of structures in the order the DSP addresses are read from the pipe follows:&lt;br /&gt;
&lt;br /&gt;
1. Frame count&lt;br /&gt;
&lt;br /&gt;
2. Input configurations&lt;br /&gt;
&lt;br /&gt;
3. Input status&lt;br /&gt;
&lt;br /&gt;
4. Input ADPCM coefficients&lt;br /&gt;
&lt;br /&gt;
5. DSP configuration&lt;br /&gt;
&lt;br /&gt;
6. DSP status&lt;br /&gt;
&lt;br /&gt;
7. Output samples&lt;br /&gt;
&lt;br /&gt;
8. Intermediate mix samples&lt;br /&gt;
&lt;br /&gt;
9. Compressor table&lt;br /&gt;
&lt;br /&gt;
10. DSP debug statistics&lt;br /&gt;
&lt;br /&gt;
11. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
12. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
13. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
14. Surround sound biquad filter 1&lt;br /&gt;
&lt;br /&gt;
15. Surround sound biquad filter 2&lt;br /&gt;
&lt;br /&gt;
The DSP has 24 inputs, each of which are individually configurable. These 24 inputs each produce three sets of 4 audio channels (two left, two right). &lt;br /&gt;
&lt;br /&gt;
These four audio channels feed into three intermediate mixers. Two of these intermediate mixers are used for effects and aux.&lt;br /&gt;
&lt;br /&gt;
== Frame Count ==&lt;br /&gt;
&lt;br /&gt;
The frame count of the first region must be even and the frame count of the second region must be odd.&lt;br /&gt;
&lt;br /&gt;
The frame with the higher count is the &amp;quot;current region&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The DSP firmware only responds if the first frame count is 4.&lt;br /&gt;
&lt;br /&gt;
== Input Config ==&lt;br /&gt;
&lt;br /&gt;
A 192 byte long structure. There are 24 of them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u32&lt;br /&gt;
| Dirty flags&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| f32[3][2][2]&lt;br /&gt;
| Input Gain (Each input has 12 channels)&lt;br /&gt;
|-&lt;br /&gt;
| 52&lt;br /&gt;
| f32&lt;br /&gt;
| Rate multiplier (1.0x == native DSP rate)&lt;br /&gt;
|-&lt;br /&gt;
| 56&lt;br /&gt;
| u8&lt;br /&gt;
| Interpolation mode&lt;br /&gt;
|-&lt;br /&gt;
| 57&lt;br /&gt;
| u8&lt;br /&gt;
| Polyphase filter select&lt;br /&gt;
|-&lt;br /&gt;
| 58&lt;br /&gt;
| u16&lt;br /&gt;
| bit[0]: Simple Filter enabled, bit[1]: Biquadratic Filter enabled&lt;br /&gt;
|-&lt;br /&gt;
| 60&lt;br /&gt;
| SimpleFilter&lt;br /&gt;
| Simple Filter (One pole normalized recursive linear filter)&lt;br /&gt;
|-&lt;br /&gt;
| 64&lt;br /&gt;
| BiquadFilter&lt;br /&gt;
| Biquadratic Filter (Two poles two zeros normalized recursive linear filter)&lt;br /&gt;
|-&lt;br /&gt;
| 74&lt;br /&gt;
| u16&lt;br /&gt;
| Bitmap of which buffers in queue are dirty&lt;br /&gt;
|-&lt;br /&gt;
| 76&lt;br /&gt;
| Buffer[4]&lt;br /&gt;
| Buffer queue&lt;br /&gt;
|-&lt;br /&gt;
| 156&lt;br /&gt;
| u32&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| 160&lt;br /&gt;
| u16&lt;br /&gt;
| Is Active&lt;br /&gt;
|-&lt;br /&gt;
| 162&lt;br /&gt;
| u16 &lt;br /&gt;
| Sync Count&lt;br /&gt;
|-&lt;br /&gt;
| 164&lt;br /&gt;
| u32&lt;br /&gt;
| Play position&lt;br /&gt;
|-&lt;br /&gt;
| 168&lt;br /&gt;
| 4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 172&lt;br /&gt;
| u32&lt;br /&gt;
| Physical address of embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 176&lt;br /&gt;
| u32&lt;br /&gt;
| Number of samples in embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 180&lt;br /&gt;
| u16&lt;br /&gt;
| Format&lt;br /&gt;
|-&lt;br /&gt;
| 182&lt;br /&gt;
| AdpcmData&lt;br /&gt;
| ADPCM data associated with embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 188&lt;br /&gt;
| u16&lt;br /&gt;
| bit[0]: ADPCM updated?; bit[1]: Is looping?r&lt;br /&gt;
|-&lt;br /&gt;
| 190&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer Id of embedded buffer&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
There is a 2 sample delay in this preprocessing stage, likely due to the interpolation step.&lt;br /&gt;
&lt;br /&gt;
=== Format ===&lt;br /&gt;
&lt;br /&gt;
This is a u16.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Bits&lt;br /&gt;
| Desciption&lt;br /&gt;
|-&lt;br /&gt;
| 0-1&lt;br /&gt;
| Number of channels: 0,1,3 = mono; 2 = stereo&lt;br /&gt;
|-&lt;br /&gt;
| 2-3&lt;br /&gt;
| Buffer codec: [[BCWAV#Encoding|0:PCM8; 1:PCM16; 2:ADPCM]]&lt;br /&gt;
|-&lt;br /&gt;
| 5 &lt;br /&gt;
| Fade&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Buffer ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u32&lt;br /&gt;
| Physical Address&lt;br /&gt;
|-&lt;br /&gt;
| 4 &lt;br /&gt;
| u32&lt;br /&gt;
| Sample Count&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| AdpcmData&lt;br /&gt;
| ADPCM data&lt;br /&gt;
|-&lt;br /&gt;
| 14&lt;br /&gt;
| u8&lt;br /&gt;
| ADPCM data dirty?&lt;br /&gt;
|-&lt;br /&gt;
| 15&lt;br /&gt;
| u8&lt;br /&gt;
| Looping?&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer Id&lt;br /&gt;
|-&lt;br /&gt;
| 18&lt;br /&gt;
| u16&lt;br /&gt;
| -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Adpcm Data === &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u8&lt;br /&gt;
| ADPCM predictor/scale&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| u8&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| s16&lt;br /&gt;
| ADPCM y[n-1]&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| s16&lt;br /&gt;
| ADPCM y[n-2]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Simple Filter ===&lt;br /&gt;
&lt;br /&gt;
This is a standard single-pole filter. The fall-off is 6dB per octave as you would expect.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s1.15&lt;br /&gt;
| b0&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| s1.15&lt;br /&gt;
| a1 (negated)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Biquad Filter ===&lt;br /&gt;
&lt;br /&gt;
This is a [[wikipedia:Digital_biquad_filter|biquadratic filter]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s2.14&lt;br /&gt;
| a2 (negated)&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| s2.14&lt;br /&gt;
| a1 (negated)&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| s2.14&lt;br /&gt;
| b2&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| s2.14&lt;br /&gt;
| b1&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| s2.14&lt;br /&gt;
| b0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Input status ==&lt;br /&gt;
&lt;br /&gt;
Read only. This structure is set by the DSP. This structure is 12 bytes long and there are 24 of them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u8&lt;br /&gt;
| Input Enabled?&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| u8&lt;br /&gt;
| Dirty flag for buffer id, set to 1 when buffer (after the first) starts playing&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| u16&lt;br /&gt;
| Sync count&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| u32&lt;br /&gt;
| Position (number of samples) into current buffer playback&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer id of the buffer that&#039;s just started playing.&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| u16&lt;br /&gt;
| -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Input ADPCM coefficients ==&lt;br /&gt;
&lt;br /&gt;
This is a 32 byte long structure. There are 24 of them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s5.11[16]&lt;br /&gt;
| ADPCM coefficents&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== DSP configuration ==&lt;br /&gt;
&lt;br /&gt;
=== Delay Effect ===&lt;br /&gt;
&lt;br /&gt;
Delay with feedback.&lt;br /&gt;
&lt;br /&gt;
Length of delay is expressed in terms of number of audio frames (there are 160 samples per audio frame).&lt;br /&gt;
&lt;br /&gt;
Feedback arm only has a gain on it. Under the feedback arm is a single-pole filter with the delay.&lt;br /&gt;
&lt;br /&gt;
=== Reverb Effect ===&lt;br /&gt;
&lt;br /&gt;
Reverb consists of two comb filters and one all-pass filter in standard configuration.&lt;br /&gt;
&lt;br /&gt;
== DSP status ==&lt;br /&gt;
&lt;br /&gt;
Read only.&lt;br /&gt;
&lt;br /&gt;
== Output samples ==&lt;br /&gt;
&lt;br /&gt;
Read only. This structure is 640 bytes long.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s16[160][2]&lt;br /&gt;
| Samples&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Intermediate mix samples ==&lt;br /&gt;
&lt;br /&gt;
Read/Write.&lt;br /&gt;
&lt;br /&gt;
PCM32. Also serves an aux function, allowing the ARM11 to apply custom effects to audio.&lt;br /&gt;
&lt;br /&gt;
This structure is 5120 bytes long.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s32[2][4][160]&lt;br /&gt;
| Samples&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Compressor table ==&lt;br /&gt;
&lt;br /&gt;
A precomputed response curve lookup table for the compressor.&lt;/div&gt;</summary>
		<author><name>Merry</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=DSP:GetSemaphoreEventHandle&amp;diff=17369</id>
		<title>DSP:GetSemaphoreEventHandle</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=DSP:GetSemaphoreEventHandle&amp;diff=17369"/>
		<updated>2016-05-12T07:23:56Z</updated>

		<summary type="html">&lt;p&gt;Merry: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Request=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Header code [0x00160000]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Response=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Header code&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Resultcode&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| n.a.?&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| EventHandle&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Semaphore==&lt;br /&gt;
&lt;br /&gt;
The ARM11 application signals this semaphore to indicate it has finished writing to the [[DSP Memory Region]] this audio frame.&lt;/div&gt;</summary>
		<author><name>Merry</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=DSP_Binary&amp;diff=16709</id>
		<title>DSP Binary</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=DSP_Binary&amp;diff=16709"/>
		<updated>2016-04-15T12:25:40Z</updated>

		<summary type="html">&lt;p&gt;Merry: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:File formats]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x100&lt;br /&gt;
| RSA Signature over bytes 0x100-0x300&lt;br /&gt;
|-&lt;br /&gt;
| 0x100&lt;br /&gt;
| 4&lt;br /&gt;
| Magic (&#039;DSP1&#039;)&lt;br /&gt;
|-&lt;br /&gt;
| 0x104&lt;br /&gt;
| 4&lt;br /&gt;
| DSP binary size&lt;br /&gt;
|-&lt;br /&gt;
| 0x108&lt;br /&gt;
| 2&lt;br /&gt;
| Memory layout (bits 0-7: Program ram, 8-15: Data ram). Each bit represents a memory region. The region is always 0x8000 bytes in size (the first region starts at 0x1FF00000; the next is a 0x1FF08000 and so on). The HW registers for DSP memory configuration are [[PDN_Registers#PDN_SHAREDWRAM_32K_DATA|PDN_SHAREDWRAM_32K_DATA]] and [[PDN_Registers#PDN_SHAREDWRAM_32K_CODE|PDN_SHAREDWRAM_32K_CODE]], located at physical address 0x10140000 (mapped to 0x1EC40000).&lt;br /&gt;
|-&lt;br /&gt;
| 0x10C&lt;br /&gt;
| 1&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
| 0x10D&lt;br /&gt;
| 1&lt;br /&gt;
| Special segment memory type (0=1=0x1FF00000(Program ram)+,2=0x1FF40000(Data ram)+)&lt;br /&gt;
|-&lt;br /&gt;
| 0x10E&lt;br /&gt;
| 1&lt;br /&gt;
| Num segments (must be 1-10)&lt;br /&gt;
|-&lt;br /&gt;
| 0x10F&lt;br /&gt;
| 1&lt;br /&gt;
| Flags (bit0=?, bit1=load special segment)&lt;br /&gt;
|-&lt;br /&gt;
| 0x110&lt;br /&gt;
| 4&lt;br /&gt;
| Special segment Start address in 16-bit words&lt;br /&gt;
|-&lt;br /&gt;
| 0x114&lt;br /&gt;
| 4&lt;br /&gt;
| Special segment size in bytes&lt;br /&gt;
|-&lt;br /&gt;
| 0x118&lt;br /&gt;
| 8&lt;br /&gt;
| Zero&lt;br /&gt;
|-&lt;br /&gt;
| 0x120&lt;br /&gt;
| 0x30*10&lt;br /&gt;
| Segment records&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If &amp;quot;special segment&amp;quot; flag is set, 0x214 bytes are read from [[CfgS:GetConfigInfoBlk8]] block 0x70000, and then copied to the special segment given. If the reading fails, zeroes are written in its place. The purpose of this segment is currently unknown. &lt;br /&gt;
&lt;br /&gt;
Each segment record:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 4&lt;br /&gt;
| Offset data&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| 4&lt;br /&gt;
| Start address in 16-bit words (must be &amp;lt; 0x20000 for type 0, &amp;lt; 0x10000 for type 1,2)&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| 4&lt;br /&gt;
| Size in bytes&lt;br /&gt;
|-&lt;br /&gt;
| 15&lt;br /&gt;
| 1&lt;br /&gt;
| Memory type (0=1=0x1FF00000 (Program ram)+,2=0x1FF40000 (Data ram)+)&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| 32&lt;br /&gt;
| SHA256 hash of segment&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The normal ending of this files is *.cdc&lt;/div&gt;</summary>
		<author><name>Merry</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=DSP_Binary&amp;diff=16708</id>
		<title>DSP Binary</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=DSP_Binary&amp;diff=16708"/>
		<updated>2016-04-15T12:25:12Z</updated>

		<summary type="html">&lt;p&gt;Merry: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:File formats]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x100&lt;br /&gt;
| RSA Signature over bytes 0x100-0x300&lt;br /&gt;
|-&lt;br /&gt;
| 0x100&lt;br /&gt;
| 4&lt;br /&gt;
| Magic (&#039;DSP1&#039;)&lt;br /&gt;
|-&lt;br /&gt;
| 0x104&lt;br /&gt;
| 4&lt;br /&gt;
| DSP binary size&lt;br /&gt;
|-&lt;br /&gt;
| 0x108&lt;br /&gt;
| 2&lt;br /&gt;
| Memory layout (bits 0-7: Program ram, 8-15: Data ram). Each bit represents a memory region. The region is always 0x8000 bytes in size (the first region starts at 0x1FF00000; the next is a 0x1FF08000 and so on). The HW registers for DSP memory configuration are [[http://www.3dbrew.org/wiki/PDN_Registers#PDN_SHAREDWRAM_32K_DATA|PDN_SHAREDWRAM_32K_DATA]] and [[http://www.3dbrew.org/wiki/PDN_Registers#PDN_SHAREDWRAM_32K_CODE|PDN_SHAREDWRAM_32K_CODE]], located at physical address 0x10140000 (mapped to 0x1EC40000).&lt;br /&gt;
|-&lt;br /&gt;
| 0x10C&lt;br /&gt;
| 1&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
| 0x10D&lt;br /&gt;
| 1&lt;br /&gt;
| Special segment memory type (0=1=0x1FF00000(Program ram)+,2=0x1FF40000(Data ram)+)&lt;br /&gt;
|-&lt;br /&gt;
| 0x10E&lt;br /&gt;
| 1&lt;br /&gt;
| Num segments (must be 1-10)&lt;br /&gt;
|-&lt;br /&gt;
| 0x10F&lt;br /&gt;
| 1&lt;br /&gt;
| Flags (bit0=?, bit1=load special segment)&lt;br /&gt;
|-&lt;br /&gt;
| 0x110&lt;br /&gt;
| 4&lt;br /&gt;
| Special segment Start address in 16-bit words&lt;br /&gt;
|-&lt;br /&gt;
| 0x114&lt;br /&gt;
| 4&lt;br /&gt;
| Special segment size in bytes&lt;br /&gt;
|-&lt;br /&gt;
| 0x118&lt;br /&gt;
| 8&lt;br /&gt;
| Zero&lt;br /&gt;
|-&lt;br /&gt;
| 0x120&lt;br /&gt;
| 0x30*10&lt;br /&gt;
| Segment records&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If &amp;quot;special segment&amp;quot; flag is set, 0x214 bytes are read from [[CfgS:GetConfigInfoBlk8]] block 0x70000, and then copied to the special segment given. If the reading fails, zeroes are written in its place. The purpose of this segment is currently unknown. &lt;br /&gt;
&lt;br /&gt;
Each segment record:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 4&lt;br /&gt;
| Offset data&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| 4&lt;br /&gt;
| Start address in 16-bit words (must be &amp;lt; 0x20000 for type 0, &amp;lt; 0x10000 for type 1,2)&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| 4&lt;br /&gt;
| Size in bytes&lt;br /&gt;
|-&lt;br /&gt;
| 15&lt;br /&gt;
| 1&lt;br /&gt;
| Memory type (0=1=0x1FF00000 (Program ram)+,2=0x1FF40000 (Data ram)+)&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| 32&lt;br /&gt;
| SHA256 hash of segment&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The normal ending of this files is *.cdc&lt;/div&gt;</summary>
		<author><name>Merry</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=DSP:SendDataIsEmpty&amp;diff=16707</id>
		<title>DSP:SendDataIsEmpty</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=DSP:SendDataIsEmpty&amp;diff=16707"/>
		<updated>2016-04-15T11:22:35Z</updated>

		<summary type="html">&lt;p&gt;Merry: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Request=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Header code [0x00040040]&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| [[DSP_Registers#DSP_CMDX|Register number]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Response=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Header code&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Result code&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Command Register Read Flag (0 = not empty, 1 = empty)&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Merry</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=DSP:SendData&amp;diff=16706</id>
		<title>DSP:SendData</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=DSP:SendData&amp;diff=16706"/>
		<updated>2016-04-15T11:21:55Z</updated>

		<summary type="html">&lt;p&gt;Merry: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Request=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Header code [0x00030080]&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| [[DSP_Registers#DSP_CMDX|Register number]]&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Value&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Response=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Header code&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Result code&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Merry</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=DSP:RecvData&amp;diff=16705</id>
		<title>DSP:RecvData</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=DSP:RecvData&amp;diff=16705"/>
		<updated>2016-04-15T11:21:21Z</updated>

		<summary type="html">&lt;p&gt;Merry: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Request=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Header code [0x00010040]&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| [[DSP_Registers#DSP_REPX|Register number]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Response=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Header code&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Result code&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| u16, Register value&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Merry</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=DSP:RecvDataIsReady&amp;diff=16704</id>
		<title>DSP:RecvDataIsReady</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=DSP:RecvDataIsReady&amp;diff=16704"/>
		<updated>2016-04-15T11:15:37Z</updated>

		<summary type="html">&lt;p&gt;Merry: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Request=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Header code [0x00020040]&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| [[DSP_Registers#DSP_REPX|Register number]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Response=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Header code&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Result code&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Reply Register Update Flag (0 = not ready, 1 = ready)&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Merry</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=DSP_Registers&amp;diff=16702</id>
		<title>DSP Registers</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=DSP_Registers&amp;diff=16702"/>
		<updated>2016-04-15T10:24:38Z</updated>

		<summary type="html">&lt;p&gt;Merry: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Registers=&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Old3DS&lt;br /&gt;
!  Name&lt;br /&gt;
!  Physical Address&lt;br /&gt;
!  Width&lt;br /&gt;
!  Used by&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[#DSP_PDATA|DSP_PDATA]]&lt;br /&gt;
| 0x10203000&lt;br /&gt;
| 2&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[#DSP_PADR|DSP_PADR]]&lt;br /&gt;
| 0x10203004&lt;br /&gt;
| 2&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[#DSP_PCFG|DSP_PCFG]]&lt;br /&gt;
| 0x10203008&lt;br /&gt;
| 2&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[#DSP_PSTS|DSP_PSTS]]&lt;br /&gt;
| 0x1020300C&lt;br /&gt;
| 2&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[#DSP_PSEM|DSP_PSEM]]&lt;br /&gt;
| 0x10203010&lt;br /&gt;
| 2&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[#DSP_PMASK|DSP_PMASK]]&lt;br /&gt;
| 0x10203014&lt;br /&gt;
| 2&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[#DSP_PCLEAR|DSP_PCLEAR]]&lt;br /&gt;
| 0x10203018&lt;br /&gt;
| 2&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[#DSP_SEM|DSP_SEM]]&lt;br /&gt;
| 0x1020301C&lt;br /&gt;
| 2&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[#DSP_CMD0|DSP_CMD0]]&lt;br /&gt;
| 0x10203020&lt;br /&gt;
| 2&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[#DSP_REP0|DSP_REP0]]&lt;br /&gt;
| 0x10203024&lt;br /&gt;
| 2&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[#DSP_CMD1|DSP_CMD1]]&lt;br /&gt;
| 0x10203028&lt;br /&gt;
| 2&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[#DSP_REP1|DSP_REP1]]&lt;br /&gt;
| 0x1020302C&lt;br /&gt;
| 2&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[#DSP_CMD2|DSP_CMD2]]&lt;br /&gt;
| 0x10203030&lt;br /&gt;
| 2&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[#DSP_REP2|DSP_REP2]]&lt;br /&gt;
| 0x10203034&lt;br /&gt;
| 2&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== DSP_PDATA ==&lt;br /&gt;
Data (one stage of the 16-stage Read FIFO).&lt;br /&gt;
&lt;br /&gt;
== DSP_PADR ==&lt;br /&gt;
Lower 16bit of Address in DSP Memory. Note: The upper 16bit of Address must be configued in the DMA register (inside of the DSP).&lt;br /&gt;
&lt;br /&gt;
== DSP_PCFG - DSP Configuration (R/W)   (16bit) ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Bits&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| DSP Reset (0=Release, 1=Reset)  ;should be held &amp;quot;1&amp;quot; for 8 DSP clks&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Address Auto-Increment (0=Off, 1=On)&lt;br /&gt;
|-&lt;br /&gt;
| 2-3   &lt;br /&gt;
| DSP Read Data Length (0=1 word, 1=8 words, 2=16 words, 3=Free-Run)&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| DSP Read Start Flag (mem transfer via Read FIFO) (1=Start)&lt;br /&gt;
|-&lt;br /&gt;
| 5  &lt;br /&gt;
| Interrupt Enable Read FIFO Full      (0=Off, 1=On)&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| Interrupt Enable Read FIFO Not-Empty (0=Off, 1=On)&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| Interrupt Enable Write FIFO Full     (0=Off, 1=On)&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| Interrupt Enable Write FIFO Empty    (0=Off, 1=On)&lt;br /&gt;
|-&lt;br /&gt;
| 9&lt;br /&gt;
| Interrupt Enable Reply Register 0    (0=Off, 1=On)&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| Interrupt Enable Reply Register 1    (0=Off, 1=On)&lt;br /&gt;
|-&lt;br /&gt;
| 11&lt;br /&gt;
| Interrupt Enable Reply Register 2    (0=Off, 1=On)&lt;br /&gt;
|-&lt;br /&gt;
| 12-15&lt;br /&gt;
| DSP Memory Transfer (0=Data Memory, 1=MMIO Register, 5=Program Memory)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== DSP_PSTS ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Bits&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Read Transfer Underway Flag  (0=No, 1=Yes/From DSP Memory)&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Write Transfer Underway Flag (0=No, 1=Yes/To DSP Memory)&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Peripheral Reset Flag (0=No/Ready, 1=Reset/Busy)&lt;br /&gt;
|-&lt;br /&gt;
| 3-4&lt;br /&gt;
| Unused&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| Read FIFO Full Flag      (0=No, 1=Yes)&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| Read FIFO Not-Empty Flag (0=No, 1=Yes) ;ARM11 may read DSP_PDATA&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| Write FIFO Full Flag     (0=No, 1=Yes)&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| Write FIFO Empty Flag    (0=No, 1=Yes)&lt;br /&gt;
|-&lt;br /&gt;
| 9&lt;br /&gt;
| Semaphore IRQ Flag (0=None, 1=IRQ)&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| Reply Register 0 Update Flag (0=Was Written by DSP, 1=No)&lt;br /&gt;
|-&lt;br /&gt;
| 11&lt;br /&gt;
| Reply Register 1 Update Flag (0=Was Written by DSP, 1=No)&lt;br /&gt;
|-&lt;br /&gt;
| 12&lt;br /&gt;
| Reply Register 2 Update Flag (0=Was Written by DSP, 1=No)&lt;br /&gt;
|-&lt;br /&gt;
| 13&lt;br /&gt;
| Command Register 0 Read Flag (0=Was Read by DSP, 1=No)&lt;br /&gt;
|-&lt;br /&gt;
| 14&lt;br /&gt;
| Command Register 1 Read Flag (0=Was Read by DSP, 1=No)&lt;br /&gt;
|-&lt;br /&gt;
| 15&lt;br /&gt;
| Command Register 2 Read Flag (0=Was Read by DSP, 1=No)&lt;br /&gt;
|}&lt;br /&gt;
Unknown if/when bit10-15 get reset... maybe after reading the status?&lt;br /&gt;
&lt;br /&gt;
== DSP_PSEM ==&lt;br /&gt;
DSP-to-ARM11 Semaphore 0..15 Flags (0=Off, 1=On). Reportedly these flags are sent in ARM11-to-DSP direction. Confusingly, the other DSP_Pxxx registers are for opposite direction?&lt;br /&gt;
&lt;br /&gt;
== DSP_PMASK ==&lt;br /&gt;
DSP-to-ARM11 Semaphore 0..15 Interrupt Disable (0=Enable, 1=Disable)&lt;br /&gt;
&lt;br /&gt;
== DSP_PCLEAR ==&lt;br /&gt;
DSP-to-ARM11 Semaphore 0..15 Clear (0=No Change, 1=Clear). Reportedly clears bits in DSP_PSEM. [that&#039;s probably nonsense, clearing bits in DSP_SEM would make more sense]&lt;br /&gt;
&lt;br /&gt;
== DSP_SEM ==&lt;br /&gt;
DSP-to-ARM11 Semaphore 0..15 Flags (0=Off, 1=On). Reportedly these flags are received in DSP-to-ARM11 direction.&lt;br /&gt;
&lt;br /&gt;
== DSP_CMDX ==&lt;br /&gt;
Command/Data to DSP.&lt;br /&gt;
&lt;br /&gt;
== DSP_REPX ==&lt;br /&gt;
Reply/Data from DSP.&lt;/div&gt;</summary>
		<author><name>Merry</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=DSP_Memory_Region&amp;diff=16253</id>
		<title>DSP Memory Region</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=DSP_Memory_Region&amp;diff=16253"/>
		<updated>2016-03-28T12:04:54Z</updated>

		<summary type="html">&lt;p&gt;Merry: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Some of this is known to be incorrect. I&#039;ll correct this in a few months after a bit more RE work. [[User:Merry|Merry]] ([[User talk:Merry|talk]]) 21:10, 28 January 2016 (CET)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*Note that everything below will vary depending on the exact DSP firmware used and different variants have slightly different behaviours.*&lt;br /&gt;
&lt;br /&gt;
The DSP communicates with the application through two shared memory areas 0x8000 bytes long each (at 0x1FF50000 and 0x1FF70000 respectively). The DSP alternates between the use of these two areas (much like a double-buffer). Each area has 15 structures within it. The location of these structures can be obtained by [[DSP:ReadPipe|reading channel 2 of the DSP pipe]]. A list of structures in the order the DSP addresses are read from the pipe follows:&lt;br /&gt;
&lt;br /&gt;
1. Frame count&lt;br /&gt;
&lt;br /&gt;
2. Input configurations&lt;br /&gt;
&lt;br /&gt;
3. Input status&lt;br /&gt;
&lt;br /&gt;
4. Input ADPCM coefficients&lt;br /&gt;
&lt;br /&gt;
5. DSP configuration&lt;br /&gt;
&lt;br /&gt;
6. DSP status&lt;br /&gt;
&lt;br /&gt;
7. Output samples&lt;br /&gt;
&lt;br /&gt;
8. Intermediate mix samples&lt;br /&gt;
&lt;br /&gt;
9. Compressor table&lt;br /&gt;
&lt;br /&gt;
10. DSP debug statistics&lt;br /&gt;
&lt;br /&gt;
11. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
12. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
13. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
14. Surround sound biquad filter 1&lt;br /&gt;
&lt;br /&gt;
15. Surround sound biquad filter 2&lt;br /&gt;
&lt;br /&gt;
The DSP has 24 inputs, each of which are individually configurable. These 24 inputs each produce three sets of 4 audio channels (two left, two right). &lt;br /&gt;
&lt;br /&gt;
These four audio channels feed into three intermediate mixers. Two of these intermediate mixers are used for effects and aux.&lt;br /&gt;
&lt;br /&gt;
== Frame Count ==&lt;br /&gt;
&lt;br /&gt;
The frame count of the first region must be even and the frame count of the second region must be odd.&lt;br /&gt;
&lt;br /&gt;
The frame with the higher count is the &amp;quot;current region&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The DSP firmware only responds if the first frame count is 4.&lt;br /&gt;
&lt;br /&gt;
== Input Config ==&lt;br /&gt;
&lt;br /&gt;
A 192 byte long structure. There are 24 of them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u32&lt;br /&gt;
| Dirty flags&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| f32[3][2][2]&lt;br /&gt;
| Input Gain (Each input has 12 channels)&lt;br /&gt;
|-&lt;br /&gt;
| 52&lt;br /&gt;
| f32&lt;br /&gt;
| Rate multiplier (1.0x == native DSP rate)&lt;br /&gt;
|-&lt;br /&gt;
| 56&lt;br /&gt;
| u8&lt;br /&gt;
| Interpolation mode&lt;br /&gt;
|-&lt;br /&gt;
| 57&lt;br /&gt;
| u8&lt;br /&gt;
| Polyphase filter select&lt;br /&gt;
|-&lt;br /&gt;
| 58&lt;br /&gt;
| u16&lt;br /&gt;
| bit[0]: Simple Filter enabled, bit[1]: Biquadratic Filter enabled&lt;br /&gt;
|-&lt;br /&gt;
| 60&lt;br /&gt;
| SimpleFilter&lt;br /&gt;
| Simple Filter (One pole normalized recursive linear filter)&lt;br /&gt;
|-&lt;br /&gt;
| 64&lt;br /&gt;
| BiquadFilter&lt;br /&gt;
| Biquadratic Filter (Two poles two zeros normalized recursive linear filter)&lt;br /&gt;
|-&lt;br /&gt;
| 74&lt;br /&gt;
| u16&lt;br /&gt;
| Bitmap of which buffers in queue are dirty&lt;br /&gt;
|-&lt;br /&gt;
| 76&lt;br /&gt;
| Buffer[4]&lt;br /&gt;
| Buffer queue&lt;br /&gt;
|-&lt;br /&gt;
| 156&lt;br /&gt;
| u32&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| 160&lt;br /&gt;
| u16&lt;br /&gt;
| Is Active&lt;br /&gt;
|-&lt;br /&gt;
| 162&lt;br /&gt;
| u16 &lt;br /&gt;
| Sync Count&lt;br /&gt;
|-&lt;br /&gt;
| 164&lt;br /&gt;
| u32&lt;br /&gt;
| Play position&lt;br /&gt;
|-&lt;br /&gt;
| 168&lt;br /&gt;
| 4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 172&lt;br /&gt;
| u32&lt;br /&gt;
| Physical address of embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 176&lt;br /&gt;
| u32&lt;br /&gt;
| Number of samples in embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 180&lt;br /&gt;
| u16&lt;br /&gt;
| Format&lt;br /&gt;
|-&lt;br /&gt;
| 182&lt;br /&gt;
| AdpcmData&lt;br /&gt;
| ADPCM data associated with embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 188&lt;br /&gt;
| u16&lt;br /&gt;
| bit[0]: ADPCM updated?; bit[1]: Is looping?r&lt;br /&gt;
|-&lt;br /&gt;
| 190&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer Id of embedded buffer&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
There is a 2 sample delay in this preprocessing stage, likely due to the interpolation step.&lt;br /&gt;
&lt;br /&gt;
=== Format ===&lt;br /&gt;
&lt;br /&gt;
This is a u16.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Bits&lt;br /&gt;
| Desciption&lt;br /&gt;
|-&lt;br /&gt;
| 0-1&lt;br /&gt;
| Number of channels: 0,1,3 = mono; 2 = stereo&lt;br /&gt;
|-&lt;br /&gt;
| 2-3&lt;br /&gt;
| Buffer codec: [[BCWAV#Encoding|0:PCM8; 1:PCM16; 2:ADPCM]]&lt;br /&gt;
|-&lt;br /&gt;
| 5 &lt;br /&gt;
| Fade&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Buffer ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u32&lt;br /&gt;
| Physical Address&lt;br /&gt;
|-&lt;br /&gt;
| 4 &lt;br /&gt;
| u32&lt;br /&gt;
| Sample Count&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| AdpcmData&lt;br /&gt;
| ADPCM data&lt;br /&gt;
|-&lt;br /&gt;
| 14&lt;br /&gt;
| u8&lt;br /&gt;
| ADPCM data dirty?&lt;br /&gt;
|-&lt;br /&gt;
| 15&lt;br /&gt;
| u8&lt;br /&gt;
| Looping?&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer Id&lt;br /&gt;
|-&lt;br /&gt;
| 18&lt;br /&gt;
| u16&lt;br /&gt;
| -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Adpcm Data === &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u8&lt;br /&gt;
| ADPCM predictor/scale&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| u8&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| s16&lt;br /&gt;
| ADPCM y[n-1]&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| s16&lt;br /&gt;
| ADPCM y[n-2]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Simple Filter ===&lt;br /&gt;
&lt;br /&gt;
This is a standard single-pole filter. The fall-off is 6dB per octave as you would expect.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s1.15&lt;br /&gt;
| b0&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| s1.15&lt;br /&gt;
| a1 (negated)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Biquad Filter ===&lt;br /&gt;
&lt;br /&gt;
This is a [[wikipedia:Digital_biquad_filter|biquadratic filter]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s2.14&lt;br /&gt;
| a2 (negated)&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| s2.14&lt;br /&gt;
| a1 (negated)&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| s2.14&lt;br /&gt;
| b2&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| s2.14&lt;br /&gt;
| b1&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| s2.14&lt;br /&gt;
| b0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Input status ==&lt;br /&gt;
&lt;br /&gt;
Read only. This structure is set by the DSP. This structure is 12 bytes long and there are 24 of them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u8&lt;br /&gt;
| Input Enabled?&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| u8&lt;br /&gt;
| Dirty flag for buffer id, set to 1 when buffer (after the first) starts playing&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| u16&lt;br /&gt;
| Sync count&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| u32&lt;br /&gt;
| Position (number of samples) into current buffer playback&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer id of the buffer that&#039;s just started playing.&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| u16&lt;br /&gt;
| -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Input ADPCM coefficients ==&lt;br /&gt;
&lt;br /&gt;
This is a 32 byte long structure. There are 24 of them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s5.11[16]&lt;br /&gt;
| ADPCM coefficents&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== DSP configuration ==&lt;br /&gt;
&lt;br /&gt;
=== Delay Effect ===&lt;br /&gt;
&lt;br /&gt;
Delay with feedback.&lt;br /&gt;
&lt;br /&gt;
Length of delay is expressed in terms of number of audio frames (there are 160 samples per audio frame).&lt;br /&gt;
&lt;br /&gt;
Feedback arm only has a gain on it. Under the feedback arm is a single-pole filter with the delay.&lt;br /&gt;
&lt;br /&gt;
=== Reverb Effect ===&lt;br /&gt;
&lt;br /&gt;
Reverb consists of two comb filters and one all-pass filter in standard configuration.&lt;br /&gt;
&lt;br /&gt;
== DSP status ==&lt;br /&gt;
&lt;br /&gt;
Read only.&lt;br /&gt;
&lt;br /&gt;
== Output samples ==&lt;br /&gt;
&lt;br /&gt;
Read only. This structure is 320 bytes long.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s16[160]&lt;br /&gt;
| Samples&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Intermediate mix samples ==&lt;br /&gt;
&lt;br /&gt;
Read/Write.&lt;br /&gt;
&lt;br /&gt;
PCM32. Also serves an aux function, allowing the ARM11 to apply custom effects to audio.&lt;br /&gt;
&lt;br /&gt;
This structure is 5120 bytes long.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s32[2][4][160]&lt;br /&gt;
| Samples&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Compressor table ==&lt;br /&gt;
&lt;br /&gt;
A precomputed response curve lookup table for the compressor.&lt;/div&gt;</summary>
		<author><name>Merry</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=DSP_Memory_Region&amp;diff=16216</id>
		<title>DSP Memory Region</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=DSP_Memory_Region&amp;diff=16216"/>
		<updated>2016-03-25T20:20:19Z</updated>

		<summary type="html">&lt;p&gt;Merry: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Some of this is known to be incorrect. I&#039;ll correct this in a few months after a bit more RE work. [[User:Merry|Merry]] ([[User talk:Merry|talk]]) 21:10, 28 January 2016 (CET)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*Note that everything below will vary depending on the exact DSP firmware used and different variants have slightly different behaviours.*&lt;br /&gt;
&lt;br /&gt;
The DSP communicates with the application through two shared memory areas 0x8000 bytes long each (at 0x1FF50000 and 0x1FF70000 respectively). The DSP alternates between the use of these two areas (much like a double-buffer). Each area has 15 structures within it. The location of these structures can be obtained by [[DSP:ReadPipe|reading channel 2 of the DSP pipe]]. A list of structures in the order the DSP addresses are read from the pipe follows:&lt;br /&gt;
&lt;br /&gt;
1. Frame count&lt;br /&gt;
&lt;br /&gt;
2. Input configurations&lt;br /&gt;
&lt;br /&gt;
3. Input status&lt;br /&gt;
&lt;br /&gt;
4. Input ADPCM coefficients&lt;br /&gt;
&lt;br /&gt;
5. DSP configuration&lt;br /&gt;
&lt;br /&gt;
6. DSP status&lt;br /&gt;
&lt;br /&gt;
7. Output samples&lt;br /&gt;
&lt;br /&gt;
8. Intermediate mix samples&lt;br /&gt;
&lt;br /&gt;
9. Compressor table&lt;br /&gt;
&lt;br /&gt;
10. DSP debug statistics&lt;br /&gt;
&lt;br /&gt;
11. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
12. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
13. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
14. Surround sound biquad filter 1&lt;br /&gt;
&lt;br /&gt;
15. Surround sound biquad filter 2&lt;br /&gt;
&lt;br /&gt;
The DSP has 24 inputs, each of which are individually configurable. These 24 inputs each produce three sets of 4 audio channels (two left, two right). &lt;br /&gt;
&lt;br /&gt;
These four audio channels feed into three intermediate mixers. Two of these intermediate mixers are used for effects and aux.&lt;br /&gt;
&lt;br /&gt;
== Frame Count ==&lt;br /&gt;
&lt;br /&gt;
The frame count of the first region must be even and the frame count of the second region must be odd.&lt;br /&gt;
&lt;br /&gt;
The frame with the higher count is the &amp;quot;current region&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The DSP firmware only responds if the first frame count is 4.&lt;br /&gt;
&lt;br /&gt;
== Input Config ==&lt;br /&gt;
&lt;br /&gt;
A 192 byte long structure. There are 24 of them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u32&lt;br /&gt;
| Dirty flags&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| f32[3][2][2]&lt;br /&gt;
| Input Gain (Each input has 12 channels)&lt;br /&gt;
|-&lt;br /&gt;
| 52&lt;br /&gt;
| f32&lt;br /&gt;
| Rate multiplier (1.0x == native DSP rate)&lt;br /&gt;
|-&lt;br /&gt;
| 56&lt;br /&gt;
| u8&lt;br /&gt;
| Interpolation mode&lt;br /&gt;
|-&lt;br /&gt;
| 57&lt;br /&gt;
| u8&lt;br /&gt;
| Polyphase filter select&lt;br /&gt;
|-&lt;br /&gt;
| 58&lt;br /&gt;
| u16&lt;br /&gt;
| bit[0]: Simple Filter enabled, bit[1]: Biquadratic Filter enabled&lt;br /&gt;
|-&lt;br /&gt;
| 60&lt;br /&gt;
| SimpleFilter&lt;br /&gt;
| Simple Filter (One pole normalized recursive linear filter)&lt;br /&gt;
|-&lt;br /&gt;
| 64&lt;br /&gt;
| BiquadFilter&lt;br /&gt;
| Biquadratic Filter (Two poles two zeros normalized recursive linear filter)&lt;br /&gt;
|-&lt;br /&gt;
| 74&lt;br /&gt;
| u16&lt;br /&gt;
| Bitmap of which buffers in queue are dirty&lt;br /&gt;
|-&lt;br /&gt;
| 76&lt;br /&gt;
| Buffer[4]&lt;br /&gt;
| Buffer queue&lt;br /&gt;
|-&lt;br /&gt;
| 156&lt;br /&gt;
| u32&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| 160&lt;br /&gt;
| u16&lt;br /&gt;
| Is Active&lt;br /&gt;
|-&lt;br /&gt;
| 162&lt;br /&gt;
| u16 &lt;br /&gt;
| Sync Count&lt;br /&gt;
|-&lt;br /&gt;
| 164&lt;br /&gt;
| u32&lt;br /&gt;
| Play position&lt;br /&gt;
|-&lt;br /&gt;
| 168&lt;br /&gt;
| 4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 172&lt;br /&gt;
| u32&lt;br /&gt;
| Physical address of embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 176&lt;br /&gt;
| u32&lt;br /&gt;
| Number of samples in embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 180&lt;br /&gt;
| u16&lt;br /&gt;
| Format&lt;br /&gt;
|-&lt;br /&gt;
| 182&lt;br /&gt;
| AdpcmData&lt;br /&gt;
| ADPCM data associated with embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 188&lt;br /&gt;
| u16&lt;br /&gt;
| bit[0]: ADPCM updated?; bit[1]: Is looping?r&lt;br /&gt;
|-&lt;br /&gt;
| 190&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer Id of embedded buffer&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Activating the simple filter, the biquadratic filter or both causes a 2 sample delay.&lt;br /&gt;
&lt;br /&gt;
=== Format ===&lt;br /&gt;
&lt;br /&gt;
This is a u16.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Bits&lt;br /&gt;
| Desciption&lt;br /&gt;
|-&lt;br /&gt;
| 0-1&lt;br /&gt;
| Number of channels: 0,1,3 = mono; 2 = stereo&lt;br /&gt;
|-&lt;br /&gt;
| 2-3&lt;br /&gt;
| Buffer codec: [[BCWAV#Encoding|0:PCM8; 1:PCM16; 2:ADPCM]]&lt;br /&gt;
|-&lt;br /&gt;
| 5 &lt;br /&gt;
| Fade&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Buffer ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u32&lt;br /&gt;
| Physical Address&lt;br /&gt;
|-&lt;br /&gt;
| 4 &lt;br /&gt;
| u32&lt;br /&gt;
| Sample Count&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| AdpcmData&lt;br /&gt;
| ADPCM data&lt;br /&gt;
|-&lt;br /&gt;
| 14&lt;br /&gt;
| u8&lt;br /&gt;
| ADPCM data dirty?&lt;br /&gt;
|-&lt;br /&gt;
| 15&lt;br /&gt;
| u8&lt;br /&gt;
| Looping?&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer Id&lt;br /&gt;
|-&lt;br /&gt;
| 18&lt;br /&gt;
| u16&lt;br /&gt;
| -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Adpcm Data === &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u8&lt;br /&gt;
| ADPCM predictor/scale&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| u8&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| s16&lt;br /&gt;
| ADPCM y[n-1]&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| s16&lt;br /&gt;
| ADPCM y[n-2]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Simple Filter ===&lt;br /&gt;
&lt;br /&gt;
This is a standard single-pole filter. The fall-off is 6dB per octave as you would expect.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s1.15&lt;br /&gt;
| b0&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| s1.15&lt;br /&gt;
| a1 (negated)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Biquad Filter ===&lt;br /&gt;
&lt;br /&gt;
This is a [[wikipedia:Digital_biquad_filter|biquadratic filter]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s2.14&lt;br /&gt;
| a2 (negated)&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| s2.14&lt;br /&gt;
| a1 (negated)&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| s2.14&lt;br /&gt;
| b2&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| s2.14&lt;br /&gt;
| b1&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| s2.14&lt;br /&gt;
| b0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Input status ==&lt;br /&gt;
&lt;br /&gt;
Read only. This structure is set by the DSP. This structure is 12 bytes long and there are 24 of them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u8&lt;br /&gt;
| Input Enabled?&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| u8&lt;br /&gt;
| Dirty flag for buffer id, set to 1 when buffer (after the first) starts playing&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| u16&lt;br /&gt;
| Sync count&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| u32&lt;br /&gt;
| Position (number of samples) into current buffer playback&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer id of the buffer that&#039;s just started playing.&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| u16&lt;br /&gt;
| -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Input ADPCM coefficients ==&lt;br /&gt;
&lt;br /&gt;
This is a 32 byte long structure. There are 24 of them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s5.11[16]&lt;br /&gt;
| ADPCM coefficents&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== DSP configuration ==&lt;br /&gt;
&lt;br /&gt;
=== Delay Effect ===&lt;br /&gt;
&lt;br /&gt;
Delay with feedback.&lt;br /&gt;
&lt;br /&gt;
Length of delay is expressed in terms of number of audio frames (there are 160 samples per audio frame).&lt;br /&gt;
&lt;br /&gt;
Feedback arm only has a gain on it. Under the feedback arm is a single-pole filter with the delay.&lt;br /&gt;
&lt;br /&gt;
=== Reverb Effect ===&lt;br /&gt;
&lt;br /&gt;
Reverb consists of two comb filters and one all-pass filter in standard configuration.&lt;br /&gt;
&lt;br /&gt;
== DSP status ==&lt;br /&gt;
&lt;br /&gt;
Read only.&lt;br /&gt;
&lt;br /&gt;
== Output samples ==&lt;br /&gt;
&lt;br /&gt;
Read only. This structure is 320 bytes long.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s16[160]&lt;br /&gt;
| Samples&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Intermediate mix samples ==&lt;br /&gt;
&lt;br /&gt;
Read/Write.&lt;br /&gt;
&lt;br /&gt;
PCM32. Also serves an aux function, allowing the ARM11 to apply custom effects to audio.&lt;br /&gt;
&lt;br /&gt;
This structure is 5120 bytes long.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s32[2][4][160]&lt;br /&gt;
| Samples&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Compressor table ==&lt;br /&gt;
&lt;br /&gt;
A precomputed response curve lookup table for the compressor.&lt;/div&gt;</summary>
		<author><name>Merry</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=DSP_Memory_Region&amp;diff=16176</id>
		<title>DSP Memory Region</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=DSP_Memory_Region&amp;diff=16176"/>
		<updated>2016-03-24T13:39:34Z</updated>

		<summary type="html">&lt;p&gt;Merry: /* Input Config */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Some of this is known to be incorrect. I&#039;ll correct this in a few months after a bit more RE work. [[User:Merry|Merry]] ([[User talk:Merry|talk]]) 21:10, 28 January 2016 (CET)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*Note that everything below will vary depending on the exact DSP firmware used and different variants have slightly different behaviours.*&lt;br /&gt;
&lt;br /&gt;
The DSP communicates with the application through two shared memory areas 0x8000 bytes long each (at 0x1FF50000 and 0x1FF70000 respectively). The DSP alternates between the use of these two areas (much like a double-buffer). Each area has 15 structures within it. The location of these structures can be obtained by [[DSP:ReadPipe|reading channel 2 of the DSP pipe]]. A list of structures in the order the DSP addresses are read from the pipe follows:&lt;br /&gt;
&lt;br /&gt;
1. Frame count&lt;br /&gt;
&lt;br /&gt;
2. Input configurations&lt;br /&gt;
&lt;br /&gt;
3. Input status&lt;br /&gt;
&lt;br /&gt;
4. Input ADPCM coefficients&lt;br /&gt;
&lt;br /&gt;
5. DSP configuration&lt;br /&gt;
&lt;br /&gt;
6. DSP status&lt;br /&gt;
&lt;br /&gt;
7. Output samples&lt;br /&gt;
&lt;br /&gt;
8. Intermediate mix samples&lt;br /&gt;
&lt;br /&gt;
9. Compressor table&lt;br /&gt;
&lt;br /&gt;
10. DSP debug statistics&lt;br /&gt;
&lt;br /&gt;
11. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
12. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
13. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
14. Surround sound biquad filter 1&lt;br /&gt;
&lt;br /&gt;
15. Surround sound biquad filter 2&lt;br /&gt;
&lt;br /&gt;
The DSP has 24 inputs, each of which are individually configurable. These 24 inputs each produce three sets of 4 audio channels (two left, two right). &lt;br /&gt;
&lt;br /&gt;
These four audio channels feed into three intermediate mixers. Two of these intermediate mixers are used for effects and aux.&lt;br /&gt;
&lt;br /&gt;
== Frame Count ==&lt;br /&gt;
&lt;br /&gt;
The frame count of the first region must be even and the frame count of the second region must be odd.&lt;br /&gt;
&lt;br /&gt;
The frame with the higher count is the &amp;quot;current region&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The DSP firmware only responds if the first frame count is 4.&lt;br /&gt;
&lt;br /&gt;
== Input Config ==&lt;br /&gt;
&lt;br /&gt;
A 192 byte long structure. There are 24 of them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u32&lt;br /&gt;
| Dirty flags&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| f32[3][2][2]&lt;br /&gt;
| Input Gain (Each input has 12 channels)&lt;br /&gt;
|-&lt;br /&gt;
| 52&lt;br /&gt;
| f32&lt;br /&gt;
| Rate multiplier (1.0x == native DSP rate)&lt;br /&gt;
|-&lt;br /&gt;
| 56&lt;br /&gt;
| u8&lt;br /&gt;
| Interpolation mode&lt;br /&gt;
|-&lt;br /&gt;
| 57&lt;br /&gt;
| u8&lt;br /&gt;
| Polyphase filter select&lt;br /&gt;
|-&lt;br /&gt;
| 58&lt;br /&gt;
| u16&lt;br /&gt;
| bit[0]: Simple Filter enabled, bit[1]: Biquadratic Filter enabled&lt;br /&gt;
|-&lt;br /&gt;
| 60&lt;br /&gt;
| SimpleFilter&lt;br /&gt;
| Simple Filter (One pole normalized recursive linear filter)&lt;br /&gt;
|-&lt;br /&gt;
| 64&lt;br /&gt;
| BiquadFilter&lt;br /&gt;
| Biquadratic Filter (Two poles two zeros normalized recursive linear filter)&lt;br /&gt;
|-&lt;br /&gt;
| 74&lt;br /&gt;
| u16&lt;br /&gt;
| Bitmap of which buffers in queue are dirty&lt;br /&gt;
|-&lt;br /&gt;
| 76&lt;br /&gt;
| Buffer[4]&lt;br /&gt;
| Buffer queue&lt;br /&gt;
|-&lt;br /&gt;
| 156&lt;br /&gt;
| u32&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| 160&lt;br /&gt;
| u16&lt;br /&gt;
| Is Active&lt;br /&gt;
|-&lt;br /&gt;
| 162&lt;br /&gt;
| u16 &lt;br /&gt;
| Sync Count&lt;br /&gt;
|-&lt;br /&gt;
| 164&lt;br /&gt;
| u32&lt;br /&gt;
| Play position&lt;br /&gt;
|-&lt;br /&gt;
| 168&lt;br /&gt;
| 4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 172&lt;br /&gt;
| u32&lt;br /&gt;
| Physical address of embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 176&lt;br /&gt;
| u32&lt;br /&gt;
| Number of samples in embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 180&lt;br /&gt;
| u16&lt;br /&gt;
| Format&lt;br /&gt;
|-&lt;br /&gt;
| 182&lt;br /&gt;
| AdpcmData&lt;br /&gt;
| ADPCM data associated with embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 188&lt;br /&gt;
| u16&lt;br /&gt;
| bit[0]: ADPCM updated?; bit[1]: Is looping?r&lt;br /&gt;
|-&lt;br /&gt;
| 190&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer Id of embedded buffer&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Format ===&lt;br /&gt;
&lt;br /&gt;
This is a u16.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Bits&lt;br /&gt;
| Desciption&lt;br /&gt;
|-&lt;br /&gt;
| 0-1&lt;br /&gt;
| Number of channels: 0,1,3 = mono; 2 = stereo&lt;br /&gt;
|-&lt;br /&gt;
| 2-3&lt;br /&gt;
| Buffer codec: [[BCWAV#Encoding|0:PCM8; 1:PCM16; 2:ADPCM]]&lt;br /&gt;
|-&lt;br /&gt;
| 5 &lt;br /&gt;
| Fade&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Buffer ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u32&lt;br /&gt;
| Physical Address&lt;br /&gt;
|-&lt;br /&gt;
| 4 &lt;br /&gt;
| u32&lt;br /&gt;
| Sample Count&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| AdpcmData&lt;br /&gt;
| ADPCM data&lt;br /&gt;
|-&lt;br /&gt;
| 14&lt;br /&gt;
| u8&lt;br /&gt;
| ADPCM data dirty?&lt;br /&gt;
|-&lt;br /&gt;
| 15&lt;br /&gt;
| u8&lt;br /&gt;
| Looping?&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer Id&lt;br /&gt;
|-&lt;br /&gt;
| 18&lt;br /&gt;
| u16&lt;br /&gt;
| -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Adpcm Data === &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u8&lt;br /&gt;
| ADPCM predictor/scale&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| u8&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| s16&lt;br /&gt;
| ADPCM y[n-1]&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| s16&lt;br /&gt;
| ADPCM y[n-2]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Simple Filter ===&lt;br /&gt;
&lt;br /&gt;
This is a standard single-pole filter. The fall-off is 6dB per octave as you would expect.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s1.15&lt;br /&gt;
| b0&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| s1.15&lt;br /&gt;
| a1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Input status ==&lt;br /&gt;
&lt;br /&gt;
Read only. This structure is set by the DSP. This structure is 12 bytes long and there are 24 of them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u8&lt;br /&gt;
| Input Enabled?&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| u8&lt;br /&gt;
| Dirty flag for buffer id, set to 1 when buffer (after the first) starts playing&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| u16&lt;br /&gt;
| Sync count&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| u32&lt;br /&gt;
| Position (number of samples) into current buffer playback&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer id of the buffer that&#039;s just started playing.&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| u16&lt;br /&gt;
| -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Input ADPCM coefficients ==&lt;br /&gt;
&lt;br /&gt;
This is a 32 byte long structure. There are 24 of them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s5.11[16]&lt;br /&gt;
| ADPCM coefficents&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== DSP configuration ==&lt;br /&gt;
&lt;br /&gt;
=== Delay Effect ===&lt;br /&gt;
&lt;br /&gt;
Delay with feedback.&lt;br /&gt;
&lt;br /&gt;
Length of delay is expressed in terms of number of audio frames (there are 160 samples per audio frame).&lt;br /&gt;
&lt;br /&gt;
Feedback arm only has a gain on it. Under the feedback arm is a single-pole filter with the delay.&lt;br /&gt;
&lt;br /&gt;
=== Reverb Effect ===&lt;br /&gt;
&lt;br /&gt;
Reverb consists of two comb filters and one all-pass filter in standard configuration.&lt;br /&gt;
&lt;br /&gt;
== DSP status ==&lt;br /&gt;
&lt;br /&gt;
Read only.&lt;br /&gt;
&lt;br /&gt;
== Output samples ==&lt;br /&gt;
&lt;br /&gt;
Read only. This structure is 320 bytes long.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s16[160]&lt;br /&gt;
| Samples&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Intermediate mix samples ==&lt;br /&gt;
&lt;br /&gt;
Read/Write.&lt;br /&gt;
&lt;br /&gt;
PCM32. Also serves an aux function, allowing the ARM11 to apply custom effects to audio.&lt;br /&gt;
&lt;br /&gt;
This structure is 5120 bytes long.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s32[2][4][160]&lt;br /&gt;
| Samples&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Compressor table ==&lt;br /&gt;
&lt;br /&gt;
A precomputed response curve lookup table for the compressor.&lt;/div&gt;</summary>
		<author><name>Merry</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=DSP_Memory_Region&amp;diff=16175</id>
		<title>DSP Memory Region</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=DSP_Memory_Region&amp;diff=16175"/>
		<updated>2016-03-24T13:34:57Z</updated>

		<summary type="html">&lt;p&gt;Merry: /* Frame Count */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Some of this is known to be incorrect. I&#039;ll correct this in a few months after a bit more RE work. [[User:Merry|Merry]] ([[User talk:Merry|talk]]) 21:10, 28 January 2016 (CET)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*Note that everything below will vary depending on the exact DSP firmware used and different variants have slightly different behaviours.*&lt;br /&gt;
&lt;br /&gt;
The DSP communicates with the application through two shared memory areas 0x8000 bytes long each (at 0x1FF50000 and 0x1FF70000 respectively). The DSP alternates between the use of these two areas (much like a double-buffer). Each area has 15 structures within it. The location of these structures can be obtained by [[DSP:ReadPipe|reading channel 2 of the DSP pipe]]. A list of structures in the order the DSP addresses are read from the pipe follows:&lt;br /&gt;
&lt;br /&gt;
1. Frame count&lt;br /&gt;
&lt;br /&gt;
2. Input configurations&lt;br /&gt;
&lt;br /&gt;
3. Input status&lt;br /&gt;
&lt;br /&gt;
4. Input ADPCM coefficients&lt;br /&gt;
&lt;br /&gt;
5. DSP configuration&lt;br /&gt;
&lt;br /&gt;
6. DSP status&lt;br /&gt;
&lt;br /&gt;
7. Output samples&lt;br /&gt;
&lt;br /&gt;
8. Intermediate mix samples&lt;br /&gt;
&lt;br /&gt;
9. Compressor table&lt;br /&gt;
&lt;br /&gt;
10. DSP debug statistics&lt;br /&gt;
&lt;br /&gt;
11. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
12. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
13. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
14. Surround sound biquad filter 1&lt;br /&gt;
&lt;br /&gt;
15. Surround sound biquad filter 2&lt;br /&gt;
&lt;br /&gt;
The DSP has 24 inputs, each of which are individually configurable. These 24 inputs each produce three sets of 4 audio channels (two left, two right). &lt;br /&gt;
&lt;br /&gt;
These four audio channels feed into three intermediate mixers. Two of these intermediate mixers are used for effects and aux.&lt;br /&gt;
&lt;br /&gt;
== Frame Count ==&lt;br /&gt;
&lt;br /&gt;
The frame count of the first region must be even and the frame count of the second region must be odd.&lt;br /&gt;
&lt;br /&gt;
The frame with the higher count is the &amp;quot;current region&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The DSP firmware only responds if the first frame count is 4.&lt;br /&gt;
&lt;br /&gt;
== Input Config ==&lt;br /&gt;
&lt;br /&gt;
A 192 byte long structure. There are 24 of them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u32&lt;br /&gt;
| Dirty flags&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| f32[3][2][2]&lt;br /&gt;
| Input Gain (Each input has 12 channels)&lt;br /&gt;
|-&lt;br /&gt;
| 52&lt;br /&gt;
| f32&lt;br /&gt;
| Rate multiplier (1.0x == native DSP rate)&lt;br /&gt;
|-&lt;br /&gt;
| 56&lt;br /&gt;
| u8&lt;br /&gt;
| Interpolation mode&lt;br /&gt;
|-&lt;br /&gt;
| 57&lt;br /&gt;
| u8&lt;br /&gt;
| Polyphase filter select&lt;br /&gt;
|-&lt;br /&gt;
| 58&lt;br /&gt;
| u16&lt;br /&gt;
| bit[0]: Simple Filter enabled, bit[1]: Biquadratic Filter enabled&lt;br /&gt;
|-&lt;br /&gt;
| 60&lt;br /&gt;
| SimpleFilter&lt;br /&gt;
| Simple Filter (One pole normalized recursive linear filter)&lt;br /&gt;
|-&lt;br /&gt;
| 64&lt;br /&gt;
| BiquadFilter&lt;br /&gt;
| Biquadratic Filter (Two poles two zeros normalized recursive linear filter)&lt;br /&gt;
|-&lt;br /&gt;
| 74&lt;br /&gt;
| u16&lt;br /&gt;
| Bitmap of which buffers in queue are dirty&lt;br /&gt;
|-&lt;br /&gt;
| 76&lt;br /&gt;
| Buffer[4]&lt;br /&gt;
| Buffer queue&lt;br /&gt;
|-&lt;br /&gt;
| 156&lt;br /&gt;
| u32&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| 160&lt;br /&gt;
| u16&lt;br /&gt;
| Is Active&lt;br /&gt;
|-&lt;br /&gt;
| 162&lt;br /&gt;
| u16 &lt;br /&gt;
| Sync Count&lt;br /&gt;
|-&lt;br /&gt;
| 164&lt;br /&gt;
| u32&lt;br /&gt;
| Play position&lt;br /&gt;
|-&lt;br /&gt;
| 168&lt;br /&gt;
| 4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 172&lt;br /&gt;
| u32&lt;br /&gt;
| Physical address of embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 176&lt;br /&gt;
| u32&lt;br /&gt;
| Number of samples in embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 180&lt;br /&gt;
| u16&lt;br /&gt;
| bits[0:1]: 1 = mono, 2 = stereo; bits[2:3]: buffer format, bits[5]: fade in&lt;br /&gt;
|-&lt;br /&gt;
| 182&lt;br /&gt;
| AdpcmData&lt;br /&gt;
| ADPCM data associated with embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 188&lt;br /&gt;
| u16&lt;br /&gt;
| bit[0]: ADPCM updated?; bit[1]: Is looping?r&lt;br /&gt;
|-&lt;br /&gt;
| 190&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer Id of embedded buffer&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Buffer ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u32&lt;br /&gt;
| Physical Address&lt;br /&gt;
|-&lt;br /&gt;
| 4 &lt;br /&gt;
| u32&lt;br /&gt;
| Sample Count&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| AdpcmData&lt;br /&gt;
| ADPCM data&lt;br /&gt;
|-&lt;br /&gt;
| 14&lt;br /&gt;
| u8&lt;br /&gt;
| ADPCM data dirty?&lt;br /&gt;
|-&lt;br /&gt;
| 15&lt;br /&gt;
| u8&lt;br /&gt;
| Looping?&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer Id&lt;br /&gt;
|-&lt;br /&gt;
| 18&lt;br /&gt;
| u16&lt;br /&gt;
| -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Adpcm Data === &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u8&lt;br /&gt;
| ADPCM predictor/scale&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| u8&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| s16&lt;br /&gt;
| ADPCM y[n-1]&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| s16&lt;br /&gt;
| ADPCM y[n-2]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Simple Filter ===&lt;br /&gt;
&lt;br /&gt;
This is a standard single-pole filter. The fall-off is 6dB per octave as you would expect.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s1.15&lt;br /&gt;
| b0&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| s1.15&lt;br /&gt;
| a1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Input status ==&lt;br /&gt;
&lt;br /&gt;
Read only. This structure is set by the DSP. This structure is 12 bytes long and there are 24 of them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u8&lt;br /&gt;
| Input Enabled?&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| u8&lt;br /&gt;
| Dirty flag for buffer id, set to 1 when buffer (after the first) starts playing&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| u16&lt;br /&gt;
| Sync count&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| u32&lt;br /&gt;
| Position (number of samples) into current buffer playback&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer id of the buffer that&#039;s just started playing.&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| u16&lt;br /&gt;
| -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Input ADPCM coefficients ==&lt;br /&gt;
&lt;br /&gt;
This is a 32 byte long structure. There are 24 of them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s5.11[16]&lt;br /&gt;
| ADPCM coefficents&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== DSP configuration ==&lt;br /&gt;
&lt;br /&gt;
=== Delay Effect ===&lt;br /&gt;
&lt;br /&gt;
Delay with feedback.&lt;br /&gt;
&lt;br /&gt;
Length of delay is expressed in terms of number of audio frames (there are 160 samples per audio frame).&lt;br /&gt;
&lt;br /&gt;
Feedback arm only has a gain on it. Under the feedback arm is a single-pole filter with the delay.&lt;br /&gt;
&lt;br /&gt;
=== Reverb Effect ===&lt;br /&gt;
&lt;br /&gt;
Reverb consists of two comb filters and one all-pass filter in standard configuration.&lt;br /&gt;
&lt;br /&gt;
== DSP status ==&lt;br /&gt;
&lt;br /&gt;
Read only.&lt;br /&gt;
&lt;br /&gt;
== Output samples ==&lt;br /&gt;
&lt;br /&gt;
Read only. This structure is 320 bytes long.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s16[160]&lt;br /&gt;
| Samples&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Intermediate mix samples ==&lt;br /&gt;
&lt;br /&gt;
Read/Write.&lt;br /&gt;
&lt;br /&gt;
PCM32. Also serves an aux function, allowing the ARM11 to apply custom effects to audio.&lt;br /&gt;
&lt;br /&gt;
This structure is 5120 bytes long.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s32[2][4][160]&lt;br /&gt;
| Samples&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Compressor table ==&lt;br /&gt;
&lt;br /&gt;
A precomputed response curve lookup table for the compressor.&lt;/div&gt;</summary>
		<author><name>Merry</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=DSP_Memory_Region&amp;diff=16174</id>
		<title>DSP Memory Region</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=DSP_Memory_Region&amp;diff=16174"/>
		<updated>2016-03-24T13:29:44Z</updated>

		<summary type="html">&lt;p&gt;Merry: clarify buffer ids&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Some of this is known to be incorrect. I&#039;ll correct this in a few months after a bit more RE work. [[User:Merry|Merry]] ([[User talk:Merry|talk]]) 21:10, 28 January 2016 (CET)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*Note that everything below will vary depending on the exact DSP firmware used and different variants have slightly different behaviours.*&lt;br /&gt;
&lt;br /&gt;
The DSP communicates with the application through two shared memory areas 0x8000 bytes long each (at 0x1FF50000 and 0x1FF70000 respectively). The DSP alternates between the use of these two areas (much like a double-buffer). Each area has 15 structures within it. The location of these structures can be obtained by [[DSP:ReadPipe|reading channel 2 of the DSP pipe]]. A list of structures in the order the DSP addresses are read from the pipe follows:&lt;br /&gt;
&lt;br /&gt;
1. Frame count&lt;br /&gt;
&lt;br /&gt;
2. Input configurations&lt;br /&gt;
&lt;br /&gt;
3. Input status&lt;br /&gt;
&lt;br /&gt;
4. Input ADPCM coefficients&lt;br /&gt;
&lt;br /&gt;
5. DSP configuration&lt;br /&gt;
&lt;br /&gt;
6. DSP status&lt;br /&gt;
&lt;br /&gt;
7. Output samples&lt;br /&gt;
&lt;br /&gt;
8. Intermediate mix samples&lt;br /&gt;
&lt;br /&gt;
9. Compressor table&lt;br /&gt;
&lt;br /&gt;
10. DSP debug statistics&lt;br /&gt;
&lt;br /&gt;
11. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
12. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
13. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
14. Surround sound biquad filter 1&lt;br /&gt;
&lt;br /&gt;
15. Surround sound biquad filter 2&lt;br /&gt;
&lt;br /&gt;
The DSP has 24 inputs, each of which are individually configurable. These 24 inputs each produce three sets of 4 audio channels (two left, two right). &lt;br /&gt;
&lt;br /&gt;
These four audio channels feed into three intermediate mixers. Two of these intermediate mixers are used for effects and aux.&lt;br /&gt;
&lt;br /&gt;
== Frame Count ==&lt;br /&gt;
&lt;br /&gt;
== Input Config ==&lt;br /&gt;
&lt;br /&gt;
A 192 byte long structure. There are 24 of them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u32&lt;br /&gt;
| Dirty flags&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| f32[3][2][2]&lt;br /&gt;
| Input Gain (Each input has 12 channels)&lt;br /&gt;
|-&lt;br /&gt;
| 52&lt;br /&gt;
| f32&lt;br /&gt;
| Rate multiplier (1.0x == native DSP rate)&lt;br /&gt;
|-&lt;br /&gt;
| 56&lt;br /&gt;
| u8&lt;br /&gt;
| Interpolation mode&lt;br /&gt;
|-&lt;br /&gt;
| 57&lt;br /&gt;
| u8&lt;br /&gt;
| Polyphase filter select&lt;br /&gt;
|-&lt;br /&gt;
| 58&lt;br /&gt;
| u16&lt;br /&gt;
| bit[0]: Simple Filter enabled, bit[1]: Biquadratic Filter enabled&lt;br /&gt;
|-&lt;br /&gt;
| 60&lt;br /&gt;
| SimpleFilter&lt;br /&gt;
| Simple Filter (One pole normalized recursive linear filter)&lt;br /&gt;
|-&lt;br /&gt;
| 64&lt;br /&gt;
| BiquadFilter&lt;br /&gt;
| Biquadratic Filter (Two poles two zeros normalized recursive linear filter)&lt;br /&gt;
|-&lt;br /&gt;
| 74&lt;br /&gt;
| u16&lt;br /&gt;
| Bitmap of which buffers in queue are dirty&lt;br /&gt;
|-&lt;br /&gt;
| 76&lt;br /&gt;
| Buffer[4]&lt;br /&gt;
| Buffer queue&lt;br /&gt;
|-&lt;br /&gt;
| 156&lt;br /&gt;
| u32&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| 160&lt;br /&gt;
| u16&lt;br /&gt;
| Is Active&lt;br /&gt;
|-&lt;br /&gt;
| 162&lt;br /&gt;
| u16 &lt;br /&gt;
| Sync Count&lt;br /&gt;
|-&lt;br /&gt;
| 164&lt;br /&gt;
| u32&lt;br /&gt;
| Play position&lt;br /&gt;
|-&lt;br /&gt;
| 168&lt;br /&gt;
| 4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 172&lt;br /&gt;
| u32&lt;br /&gt;
| Physical address of embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 176&lt;br /&gt;
| u32&lt;br /&gt;
| Number of samples in embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 180&lt;br /&gt;
| u16&lt;br /&gt;
| bits[0:1]: 1 = mono, 2 = stereo; bits[2:3]: buffer format, bits[5]: fade in&lt;br /&gt;
|-&lt;br /&gt;
| 182&lt;br /&gt;
| AdpcmData&lt;br /&gt;
| ADPCM data associated with embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 188&lt;br /&gt;
| u16&lt;br /&gt;
| bit[0]: ADPCM updated?; bit[1]: Is looping?r&lt;br /&gt;
|-&lt;br /&gt;
| 190&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer Id of embedded buffer&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Buffer ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u32&lt;br /&gt;
| Physical Address&lt;br /&gt;
|-&lt;br /&gt;
| 4 &lt;br /&gt;
| u32&lt;br /&gt;
| Sample Count&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| AdpcmData&lt;br /&gt;
| ADPCM data&lt;br /&gt;
|-&lt;br /&gt;
| 14&lt;br /&gt;
| u8&lt;br /&gt;
| ADPCM data dirty?&lt;br /&gt;
|-&lt;br /&gt;
| 15&lt;br /&gt;
| u8&lt;br /&gt;
| Looping?&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer Id&lt;br /&gt;
|-&lt;br /&gt;
| 18&lt;br /&gt;
| u16&lt;br /&gt;
| -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Adpcm Data === &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u8&lt;br /&gt;
| ADPCM predictor/scale&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| u8&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| s16&lt;br /&gt;
| ADPCM y[n-1]&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| s16&lt;br /&gt;
| ADPCM y[n-2]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Simple Filter ===&lt;br /&gt;
&lt;br /&gt;
This is a standard single-pole filter. The fall-off is 6dB per octave as you would expect.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s1.15&lt;br /&gt;
| b0&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| s1.15&lt;br /&gt;
| a1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Input status ==&lt;br /&gt;
&lt;br /&gt;
Read only. This structure is set by the DSP. This structure is 12 bytes long and there are 24 of them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u8&lt;br /&gt;
| Input Enabled?&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| u8&lt;br /&gt;
| Dirty flag for buffer id, set to 1 when buffer (after the first) starts playing&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| u16&lt;br /&gt;
| Sync count&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| u32&lt;br /&gt;
| Position (number of samples) into current buffer playback&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer id of the buffer that&#039;s just started playing.&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| u16&lt;br /&gt;
| -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Input ADPCM coefficients ==&lt;br /&gt;
&lt;br /&gt;
This is a 32 byte long structure. There are 24 of them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s5.11[16]&lt;br /&gt;
| ADPCM coefficents&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== DSP configuration ==&lt;br /&gt;
&lt;br /&gt;
=== Delay Effect ===&lt;br /&gt;
&lt;br /&gt;
Delay with feedback.&lt;br /&gt;
&lt;br /&gt;
Length of delay is expressed in terms of number of audio frames (there are 160 samples per audio frame).&lt;br /&gt;
&lt;br /&gt;
Feedback arm only has a gain on it. Under the feedback arm is a single-pole filter with the delay.&lt;br /&gt;
&lt;br /&gt;
=== Reverb Effect ===&lt;br /&gt;
&lt;br /&gt;
Reverb consists of two comb filters and one all-pass filter in standard configuration.&lt;br /&gt;
&lt;br /&gt;
== DSP status ==&lt;br /&gt;
&lt;br /&gt;
Read only.&lt;br /&gt;
&lt;br /&gt;
== Output samples ==&lt;br /&gt;
&lt;br /&gt;
Read only. This structure is 320 bytes long.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s16[160]&lt;br /&gt;
| Samples&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Intermediate mix samples ==&lt;br /&gt;
&lt;br /&gt;
Read/Write.&lt;br /&gt;
&lt;br /&gt;
PCM32. Also serves an aux function, allowing the ARM11 to apply custom effects to audio.&lt;br /&gt;
&lt;br /&gt;
This structure is 5120 bytes long.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s32[2][4][160]&lt;br /&gt;
| Samples&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Compressor table ==&lt;br /&gt;
&lt;br /&gt;
A precomputed response curve lookup table for the compressor.&lt;/div&gt;</summary>
		<author><name>Merry</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=DSP_Memory_Region&amp;diff=16010</id>
		<title>DSP Memory Region</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=DSP_Memory_Region&amp;diff=16010"/>
		<updated>2016-03-11T16:03:45Z</updated>

		<summary type="html">&lt;p&gt;Merry: /* Reverb Effect */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Some of this is known to be incorrect. I&#039;ll correct this in a few months after a bit more RE work. [[User:Merry|Merry]] ([[User talk:Merry|talk]]) 21:10, 28 January 2016 (CET)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*Note that everything below will vary depending on the exact DSP firmware used and different variants have slightly different behaviours.*&lt;br /&gt;
&lt;br /&gt;
The DSP communicates with the application through two shared memory areas 0x8000 bytes long each (at 0x1FF50000 and 0x1FF70000 respectively). The DSP alternates between the use of these two areas (much like a double-buffer). Each area has 15 structures within it. The location of these structures can be obtained by [[DSP:ReadPipe|reading channel 2 of the DSP pipe]]. A list of structures in the order the DSP addresses are read from the pipe follows:&lt;br /&gt;
&lt;br /&gt;
1. Frame count&lt;br /&gt;
&lt;br /&gt;
2. Input configurations&lt;br /&gt;
&lt;br /&gt;
3. Input status&lt;br /&gt;
&lt;br /&gt;
4. Input ADPCM coefficients&lt;br /&gt;
&lt;br /&gt;
5. DSP configuration&lt;br /&gt;
&lt;br /&gt;
6. DSP status&lt;br /&gt;
&lt;br /&gt;
7. Output samples&lt;br /&gt;
&lt;br /&gt;
8. Intermediate mix samples&lt;br /&gt;
&lt;br /&gt;
9. Compressor table&lt;br /&gt;
&lt;br /&gt;
10. DSP debug statistics&lt;br /&gt;
&lt;br /&gt;
11. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
12. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
13. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
14. Surround sound biquad filter 1&lt;br /&gt;
&lt;br /&gt;
15. Surround sound biquad filter 2&lt;br /&gt;
&lt;br /&gt;
The DSP has 24 inputs, each of which are individually configurable. These 24 inputs each produce three sets of 4 audio channels (two left, two right). &lt;br /&gt;
&lt;br /&gt;
These four audio channels feed into three intermediate mixers. Two of these intermediate mixers are used for effects and aux.&lt;br /&gt;
&lt;br /&gt;
== Frame Count ==&lt;br /&gt;
&lt;br /&gt;
== Input Config ==&lt;br /&gt;
&lt;br /&gt;
A 192 byte long structure. There are 24 of them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u32&lt;br /&gt;
| Dirty flags&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| f32[3][2][2]&lt;br /&gt;
| Input Gain (Each input has 12 channels)&lt;br /&gt;
|-&lt;br /&gt;
| 52&lt;br /&gt;
| f32&lt;br /&gt;
| Rate multiplier (1.0x == native DSP rate)&lt;br /&gt;
|-&lt;br /&gt;
| 56&lt;br /&gt;
| u8&lt;br /&gt;
| Interpolation mode&lt;br /&gt;
|-&lt;br /&gt;
| 57&lt;br /&gt;
| u8&lt;br /&gt;
| Polyphase filter select&lt;br /&gt;
|-&lt;br /&gt;
| 58&lt;br /&gt;
| u16&lt;br /&gt;
| bit[0]: Simple Filter enabled, bit[1]: Biquadratic Filter enabled&lt;br /&gt;
|-&lt;br /&gt;
| 60&lt;br /&gt;
| SimpleFilter&lt;br /&gt;
| Simple Filter (One pole normalized recursive linear filter)&lt;br /&gt;
|-&lt;br /&gt;
| 64&lt;br /&gt;
| BiquadFilter&lt;br /&gt;
| Biquadratic Filter (Two poles two zeros normalized recursive linear filter)&lt;br /&gt;
|-&lt;br /&gt;
| 74&lt;br /&gt;
| u16&lt;br /&gt;
| Bitmap of which buffers in queue are dirty&lt;br /&gt;
|-&lt;br /&gt;
| 76&lt;br /&gt;
| Buffer[4]&lt;br /&gt;
| Buffer queue&lt;br /&gt;
|-&lt;br /&gt;
| 156&lt;br /&gt;
| u32&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| 160&lt;br /&gt;
| u16&lt;br /&gt;
| Is Active&lt;br /&gt;
|-&lt;br /&gt;
| 162&lt;br /&gt;
| u16 &lt;br /&gt;
| Sync Count&lt;br /&gt;
|-&lt;br /&gt;
| 164&lt;br /&gt;
| u32&lt;br /&gt;
| Play position&lt;br /&gt;
|-&lt;br /&gt;
| 168&lt;br /&gt;
| 4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 172&lt;br /&gt;
| u32&lt;br /&gt;
| Physical address of embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 176&lt;br /&gt;
| u32&lt;br /&gt;
| Number of samples in embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 180&lt;br /&gt;
| u16&lt;br /&gt;
| bits[0:1]: 1 = mono, 2 = stereo; bits[2:3]: buffer format, bits[5]: fade in&lt;br /&gt;
|-&lt;br /&gt;
| 182&lt;br /&gt;
| AdpcmData&lt;br /&gt;
| ADPCM data associated with embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 188&lt;br /&gt;
| u16&lt;br /&gt;
| bit[0]: ADPCM updated?; bit[1]: Is looping?r&lt;br /&gt;
|-&lt;br /&gt;
| 190&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer Id of embedded buffer&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Buffer ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u32&lt;br /&gt;
| Physical Address&lt;br /&gt;
|-&lt;br /&gt;
| 4 &lt;br /&gt;
| u32&lt;br /&gt;
| Sample Count&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| AdpcmData&lt;br /&gt;
| ADPCM data&lt;br /&gt;
|-&lt;br /&gt;
| 14&lt;br /&gt;
| u8&lt;br /&gt;
| ADPCM data dirty?&lt;br /&gt;
|-&lt;br /&gt;
| 15&lt;br /&gt;
| u8&lt;br /&gt;
| Looping?&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer Id&lt;br /&gt;
|-&lt;br /&gt;
| 18&lt;br /&gt;
| u16&lt;br /&gt;
| -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Adpcm Data === &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u8&lt;br /&gt;
| ADPCM predictor/scale&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| u8&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| s16&lt;br /&gt;
| ADPCM y[n-1]&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| s16&lt;br /&gt;
| ADPCM y[n-2]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Simple Filter ===&lt;br /&gt;
&lt;br /&gt;
This is a standard single-pole filter. The fall-off is 6dB per octave as you would expect.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s1.15&lt;br /&gt;
| b0&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| s1.15&lt;br /&gt;
| a1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Input status ==&lt;br /&gt;
&lt;br /&gt;
Read only. This structure is set by the DSP. This structure is 12 bytes long and there are 24 of them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u8&lt;br /&gt;
| Input Enabled?&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| u8&lt;br /&gt;
| Dirty flag for previous buffer id.&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| u16&lt;br /&gt;
| Sync count&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| u32&lt;br /&gt;
| Position (number of samples) into current buffer playback&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer id of last buffer that was played&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| u16&lt;br /&gt;
| -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Input ADPCM coefficients ==&lt;br /&gt;
&lt;br /&gt;
This is a 32 byte long structure. There are 24 of them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s5.11[16]&lt;br /&gt;
| ADPCM coefficents&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== DSP configuration ==&lt;br /&gt;
&lt;br /&gt;
=== Delay Effect ===&lt;br /&gt;
&lt;br /&gt;
Delay with feedback.&lt;br /&gt;
&lt;br /&gt;
Length of delay is expressed in terms of number of audio frames (there are 160 samples per audio frame).&lt;br /&gt;
&lt;br /&gt;
Feedback arm only has a gain on it. Under the feedback arm is a single-pole filter with the delay.&lt;br /&gt;
&lt;br /&gt;
=== Reverb Effect ===&lt;br /&gt;
&lt;br /&gt;
Reverb consists of two comb filters and one all-pass filter in standard configuration.&lt;br /&gt;
&lt;br /&gt;
== DSP status ==&lt;br /&gt;
&lt;br /&gt;
Read only.&lt;br /&gt;
&lt;br /&gt;
== Output samples ==&lt;br /&gt;
&lt;br /&gt;
Read only. This structure is 320 bytes long.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s16[160]&lt;br /&gt;
| Samples&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Intermediate mix samples ==&lt;br /&gt;
&lt;br /&gt;
Read/Write.&lt;br /&gt;
&lt;br /&gt;
PCM32. Also serves an aux function, allowing the ARM11 to apply custom effects to audio.&lt;br /&gt;
&lt;br /&gt;
This structure is 5120 bytes long.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s32[2][4][160]&lt;br /&gt;
| Samples&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Compressor table ==&lt;br /&gt;
&lt;br /&gt;
A precomputed response curve lookup table for the compressor.&lt;/div&gt;</summary>
		<author><name>Merry</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=DSP:ReadPipe&amp;diff=16009</id>
		<title>DSP:ReadPipe</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=DSP:ReadPipe&amp;diff=16009"/>
		<updated>2016-03-11T15:55:15Z</updated>

		<summary type="html">&lt;p&gt;Merry: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Request=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Header code [0x000E00C0]&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Channel&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Peer&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| u16, Size&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
0x100 byte after the Request header&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| (Size &amp;lt;&amp;lt; 14) &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Buffer&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Response=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Header code&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Result code&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=See Also=&lt;br /&gt;
* [[DSP:ReadPipeIfPossible]]&lt;/div&gt;</summary>
		<author><name>Merry</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=DSP_Memory_Region&amp;diff=16008</id>
		<title>DSP Memory Region</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=DSP_Memory_Region&amp;diff=16008"/>
		<updated>2016-03-11T15:50:34Z</updated>

		<summary type="html">&lt;p&gt;Merry: Surround sound biquad filters&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Some of this is known to be incorrect. I&#039;ll correct this in a few months after a bit more RE work. [[User:Merry|Merry]] ([[User talk:Merry|talk]]) 21:10, 28 January 2016 (CET)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*Note that everything below will vary depending on the exact DSP firmware used and different variants have slightly different behaviours.*&lt;br /&gt;
&lt;br /&gt;
The DSP communicates with the application through two shared memory areas 0x8000 bytes long each (at 0x1FF50000 and 0x1FF70000 respectively). The DSP alternates between the use of these two areas (much like a double-buffer). Each area has 15 structures within it. The location of these structures can be obtained by [[DSP:ReadPipe|reading channel 2 of the DSP pipe]]. A list of structures in the order the DSP addresses are read from the pipe follows:&lt;br /&gt;
&lt;br /&gt;
1. Frame count&lt;br /&gt;
&lt;br /&gt;
2. Input configurations&lt;br /&gt;
&lt;br /&gt;
3. Input status&lt;br /&gt;
&lt;br /&gt;
4. Input ADPCM coefficients&lt;br /&gt;
&lt;br /&gt;
5. DSP configuration&lt;br /&gt;
&lt;br /&gt;
6. DSP status&lt;br /&gt;
&lt;br /&gt;
7. Output samples&lt;br /&gt;
&lt;br /&gt;
8. Intermediate mix samples&lt;br /&gt;
&lt;br /&gt;
9. Compressor table&lt;br /&gt;
&lt;br /&gt;
10. DSP debug statistics&lt;br /&gt;
&lt;br /&gt;
11. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
12. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
13. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
14. Surround sound biquad filter 1&lt;br /&gt;
&lt;br /&gt;
15. Surround sound biquad filter 2&lt;br /&gt;
&lt;br /&gt;
The DSP has 24 inputs, each of which are individually configurable. These 24 inputs each produce three sets of 4 audio channels (two left, two right). &lt;br /&gt;
&lt;br /&gt;
These four audio channels feed into three intermediate mixers. Two of these intermediate mixers are used for effects and aux.&lt;br /&gt;
&lt;br /&gt;
== Frame Count ==&lt;br /&gt;
&lt;br /&gt;
== Input Config ==&lt;br /&gt;
&lt;br /&gt;
A 192 byte long structure. There are 24 of them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u32&lt;br /&gt;
| Dirty flags&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| f32[3][2][2]&lt;br /&gt;
| Input Gain (Each input has 12 channels)&lt;br /&gt;
|-&lt;br /&gt;
| 52&lt;br /&gt;
| f32&lt;br /&gt;
| Rate multiplier (1.0x == native DSP rate)&lt;br /&gt;
|-&lt;br /&gt;
| 56&lt;br /&gt;
| u8&lt;br /&gt;
| Interpolation mode&lt;br /&gt;
|-&lt;br /&gt;
| 57&lt;br /&gt;
| u8&lt;br /&gt;
| Polyphase filter select&lt;br /&gt;
|-&lt;br /&gt;
| 58&lt;br /&gt;
| u16&lt;br /&gt;
| bit[0]: Simple Filter enabled, bit[1]: Biquadratic Filter enabled&lt;br /&gt;
|-&lt;br /&gt;
| 60&lt;br /&gt;
| SimpleFilter&lt;br /&gt;
| Simple Filter (One pole normalized recursive linear filter)&lt;br /&gt;
|-&lt;br /&gt;
| 64&lt;br /&gt;
| BiquadFilter&lt;br /&gt;
| Biquadratic Filter (Two poles two zeros normalized recursive linear filter)&lt;br /&gt;
|-&lt;br /&gt;
| 74&lt;br /&gt;
| u16&lt;br /&gt;
| Bitmap of which buffers in queue are dirty&lt;br /&gt;
|-&lt;br /&gt;
| 76&lt;br /&gt;
| Buffer[4]&lt;br /&gt;
| Buffer queue&lt;br /&gt;
|-&lt;br /&gt;
| 156&lt;br /&gt;
| u32&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| 160&lt;br /&gt;
| u16&lt;br /&gt;
| Is Active&lt;br /&gt;
|-&lt;br /&gt;
| 162&lt;br /&gt;
| u16 &lt;br /&gt;
| Sync Count&lt;br /&gt;
|-&lt;br /&gt;
| 164&lt;br /&gt;
| u32&lt;br /&gt;
| Play position&lt;br /&gt;
|-&lt;br /&gt;
| 168&lt;br /&gt;
| 4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 172&lt;br /&gt;
| u32&lt;br /&gt;
| Physical address of embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 176&lt;br /&gt;
| u32&lt;br /&gt;
| Number of samples in embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 180&lt;br /&gt;
| u16&lt;br /&gt;
| bits[0:1]: 1 = mono, 2 = stereo; bits[2:3]: buffer format, bits[5]: fade in&lt;br /&gt;
|-&lt;br /&gt;
| 182&lt;br /&gt;
| AdpcmData&lt;br /&gt;
| ADPCM data associated with embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 188&lt;br /&gt;
| u16&lt;br /&gt;
| bit[0]: ADPCM updated?; bit[1]: Is looping?r&lt;br /&gt;
|-&lt;br /&gt;
| 190&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer Id of embedded buffer&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Buffer ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u32&lt;br /&gt;
| Physical Address&lt;br /&gt;
|-&lt;br /&gt;
| 4 &lt;br /&gt;
| u32&lt;br /&gt;
| Sample Count&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| AdpcmData&lt;br /&gt;
| ADPCM data&lt;br /&gt;
|-&lt;br /&gt;
| 14&lt;br /&gt;
| u8&lt;br /&gt;
| ADPCM data dirty?&lt;br /&gt;
|-&lt;br /&gt;
| 15&lt;br /&gt;
| u8&lt;br /&gt;
| Looping?&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer Id&lt;br /&gt;
|-&lt;br /&gt;
| 18&lt;br /&gt;
| u16&lt;br /&gt;
| -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Adpcm Data === &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u8&lt;br /&gt;
| ADPCM predictor/scale&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| u8&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| s16&lt;br /&gt;
| ADPCM y[n-1]&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| s16&lt;br /&gt;
| ADPCM y[n-2]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Simple Filter ===&lt;br /&gt;
&lt;br /&gt;
This is a standard single-pole filter. The fall-off is 6dB per octave as you would expect.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s1.15&lt;br /&gt;
| b0&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| s1.15&lt;br /&gt;
| a1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Input status ==&lt;br /&gt;
&lt;br /&gt;
Read only. This structure is set by the DSP. This structure is 12 bytes long and there are 24 of them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u8&lt;br /&gt;
| Input Enabled?&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| u8&lt;br /&gt;
| Dirty flag for previous buffer id.&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| u16&lt;br /&gt;
| Sync count&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| u32&lt;br /&gt;
| Position (number of samples) into current buffer playback&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer id of last buffer that was played&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| u16&lt;br /&gt;
| -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Input ADPCM coefficients ==&lt;br /&gt;
&lt;br /&gt;
This is a 32 byte long structure. There are 24 of them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s5.11[16]&lt;br /&gt;
| ADPCM coefficents&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== DSP configuration ==&lt;br /&gt;
&lt;br /&gt;
=== Delay Effect ===&lt;br /&gt;
&lt;br /&gt;
Delay with feedback.&lt;br /&gt;
&lt;br /&gt;
Length of delay is expressed in terms of number of audio frames (there are 160 samples per audio frame).&lt;br /&gt;
&lt;br /&gt;
Feedback arm only has a gain on it. Under the feedback arm is a single-pole filter with the delay.&lt;br /&gt;
&lt;br /&gt;
=== Reverb Effect ===&lt;br /&gt;
&lt;br /&gt;
== DSP status ==&lt;br /&gt;
&lt;br /&gt;
Read only.&lt;br /&gt;
&lt;br /&gt;
== Output samples ==&lt;br /&gt;
&lt;br /&gt;
Read only. This structure is 320 bytes long.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s16[160]&lt;br /&gt;
| Samples&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Intermediate mix samples ==&lt;br /&gt;
&lt;br /&gt;
Read/Write.&lt;br /&gt;
&lt;br /&gt;
PCM32. Also serves an aux function, allowing the ARM11 to apply custom effects to audio.&lt;br /&gt;
&lt;br /&gt;
This structure is 5120 bytes long.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s32[2][4][160]&lt;br /&gt;
| Samples&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Compressor table ==&lt;br /&gt;
&lt;br /&gt;
A precomputed response curve lookup table for the compressor.&lt;/div&gt;</summary>
		<author><name>Merry</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=DSP:RegisterInterruptEvents&amp;diff=15989</id>
		<title>DSP:RegisterInterruptEvents</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=DSP:RegisterInterruptEvents&amp;diff=15989"/>
		<updated>2016-03-07T20:44:31Z</updated>

		<summary type="html">&lt;p&gt;Merry: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Request=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Header code [0x00150082]&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Interrupt&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Channel&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 0x0&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Event handle (0 = unregister the event that was previous registered)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Response=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Header code [0x00150040]&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Result code&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Description=&lt;br /&gt;
Application should unregister the event by setting handle to zero. If the session was closed before the event was unregistered, it will cause a handle leak in DSP process.&lt;br /&gt;
&lt;br /&gt;
DSP can hold up to 6 concurrent registrations. More than that will cause registration to fail.&lt;br /&gt;
&lt;br /&gt;
Interrupts with interupt=2 are related to [[DSP:WriteProcessPipe|pipes]]. The channel argument is the same as the pipe channel argument. The interrupt is signalled when data is available on the related pipe or when a related event occurs.&lt;/div&gt;</summary>
		<author><name>Merry</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=DSP:RegisterInterruptEvents&amp;diff=15988</id>
		<title>DSP:RegisterInterruptEvents</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=DSP:RegisterInterruptEvents&amp;diff=15988"/>
		<updated>2016-03-07T20:44:15Z</updated>

		<summary type="html">&lt;p&gt;Merry: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Request=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Header code [0x00150082]&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Interrupt&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Channel&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 0x0&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Event handle (0 = unregister the event that was previous registered)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Response=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Header code [0x00150040]&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Result code&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Description=&lt;br /&gt;
Application should unregister the event by setting handle to zero. If the session was closed before the event was unregistered, it will cause a handle leak in DSP process.&lt;br /&gt;
&lt;br /&gt;
DSP can hold up to 6 concurrent registrations. More than that will cause registration to fail.&lt;br /&gt;
&lt;br /&gt;
Interrupts with interupt=2 are related to [[DSP:WriteProcessPipe|pipes]]. The channel argument is the same as the pipe channel argument. The interrupt is signalled when data is available on a pipe or when a related event occurs.&lt;/div&gt;</summary>
		<author><name>Merry</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=DSP:WriteProcessPipe&amp;diff=15987</id>
		<title>DSP:WriteProcessPipe</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=DSP:WriteProcessPipe&amp;diff=15987"/>
		<updated>2016-03-07T20:42:47Z</updated>

		<summary type="html">&lt;p&gt;Merry: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Request=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Header code [0x000D0082]&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Channel&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Size&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| (Size &amp;lt;&amp;lt; 14) &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 0x402&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Buffer&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Response=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Header code&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Result code&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Usage Notes=&lt;br /&gt;
&lt;br /&gt;
One should call [[DSP:SetSemaphore]] with an argument of `0x4000`, then wait on the related [[DSP:RegisterInterruptEvents|interrupt event]].&lt;/div&gt;</summary>
		<author><name>Merry</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=DSP:WriteProcessPipe&amp;diff=15986</id>
		<title>DSP:WriteProcessPipe</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=DSP:WriteProcessPipe&amp;diff=15986"/>
		<updated>2016-03-07T20:42:14Z</updated>

		<summary type="html">&lt;p&gt;Merry: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Request=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Header code [0x000D0082]&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Channel&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Size&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| (Size &amp;lt;&amp;lt; 14) &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 0x402&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Buffer&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Response=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Header code&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Result code&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Usage Notes=&lt;br /&gt;
&lt;br /&gt;
One should call [[DSP:SetSemaphore]] with an argument of `0x4000`, then wait on the related [[interrupt event|DSP:RegisterInterruptEvents]].&lt;/div&gt;</summary>
		<author><name>Merry</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=DSP:ReadPipeIfPossible&amp;diff=15985</id>
		<title>DSP:ReadPipeIfPossible</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=DSP:ReadPipeIfPossible&amp;diff=15985"/>
		<updated>2016-03-07T20:39:49Z</updated>

		<summary type="html">&lt;p&gt;Merry: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Request=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Header code [0x001000c0]&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Channel (0 - 7 0:Debug from DSP 1:P-DMA 2:audio 3:binary 4-7: free ?)&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Peer (0 = from DSP, 1 = from ARM)&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| u16, Size&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
0x100 byte after the Request header&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| (Size &amp;lt;&amp;lt; 14) &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 0x2&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Buffer&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Response=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Header code&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Result code&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| u16, Actual read size&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Channels =&lt;br /&gt;
&lt;br /&gt;
== Channel 2 (Audio) ==&lt;br /&gt;
&lt;br /&gt;
Channel 2 returns the DSP DRAM addresses of structures located in the [[DSP Memory Region]]. [[DSP:ConvertProcessAddressFromDspDram]] can be used to convert these addresses into virtual memory addresses. The list of addresses and the length of the list vary depending on DSP firmware version.&lt;br /&gt;
&lt;br /&gt;
== Channel 3 (Binary) ==&lt;br /&gt;
&lt;br /&gt;
The purpose of channel 3 is unknown. The behaviour of this pipe varies depending on DSP firmware version. Observed behaviours include:&lt;br /&gt;
&lt;br /&gt;
* doing nothing.&lt;br /&gt;
* echoing what is returned to it.&lt;br /&gt;
* long strings of zeros.&lt;/div&gt;</summary>
		<author><name>Merry</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=DSP:LoadComponent&amp;diff=15977</id>
		<title>DSP:LoadComponent</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=DSP:LoadComponent&amp;diff=15977"/>
		<updated>2016-03-05T23:19:10Z</updated>

		<summary type="html">&lt;p&gt;Merry: Updated with the two translated response params.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Request=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Header code [0x001100C2]&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Size&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Program Mask (observed 0x00FF) (Program ram blocks the component should be loaded into)&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Data Mask (observed 0x00FF) (Data ram blocks the component should be loaded into)&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| (Size &amp;lt;&amp;lt; 4)  &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 0xA&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| Component Buffer&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Response=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Header code [0x00110082]&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Result code&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| u8, Component Loaded (0 = not loaded, 1 = loaded)&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| (Size &amp;lt;&amp;lt; 4)  &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 0xA&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Component Buffer&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Description=&lt;br /&gt;
This requires RSA-signed DSP firmware specified via the input buffer for this command, the firmware data is eventually written to DSPmem+0(0x1FF00000). This has been observed to call a subroutine which calls a string named &amp;quot;synthe&amp;quot;.&lt;/div&gt;</summary>
		<author><name>Merry</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=DSP_Memory_Region&amp;diff=15831</id>
		<title>DSP Memory Region</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=DSP_Memory_Region&amp;diff=15831"/>
		<updated>2016-02-19T20:07:40Z</updated>

		<summary type="html">&lt;p&gt;Merry: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Some of this is known to be incorrect. I&#039;ll correct this in a few months after a bit more RE work. [[User:Merry|Merry]] ([[User talk:Merry|talk]]) 21:10, 28 January 2016 (CET)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*Note that everything below will vary depending on the exact DSP firmware used and different variants have slightly different behaviours.*&lt;br /&gt;
&lt;br /&gt;
The DSP communicates with the application through two shared memory areas 0x8000 bytes long each (at 0x1FF50000 and 0x1FF70000 respectively). The DSP alternates between the use of these two areas (much like a double-buffer). Each area has 15 structures within it. The location of these structures can be obtained by [[DSP:ReadPipe|reading channel 2 of the DSP pipe]]. A list of structures in the order the DSP addresses are read from the pipe follows:&lt;br /&gt;
&lt;br /&gt;
1. Frame count&lt;br /&gt;
&lt;br /&gt;
2. Input configurations&lt;br /&gt;
&lt;br /&gt;
3. Input status&lt;br /&gt;
&lt;br /&gt;
4. Input ADPCM coefficients&lt;br /&gt;
&lt;br /&gt;
5. DSP configuration&lt;br /&gt;
&lt;br /&gt;
6. DSP status&lt;br /&gt;
&lt;br /&gt;
7. Output samples&lt;br /&gt;
&lt;br /&gt;
8. Intermediate mix samples&lt;br /&gt;
&lt;br /&gt;
9. Compressor table&lt;br /&gt;
&lt;br /&gt;
10. DSP debug statistics&lt;br /&gt;
&lt;br /&gt;
11. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
12. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
13. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
14. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
15. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
The DSP has 24 inputs, each of which are individually configurable. These 24 inputs each produce three sets of 4 audio channels (two left, two right). &lt;br /&gt;
&lt;br /&gt;
These four audio channels feed into three intermediate mixers. Two of these intermediate mixers are used for effects and aux.&lt;br /&gt;
&lt;br /&gt;
== Frame Count ==&lt;br /&gt;
&lt;br /&gt;
== Input Config ==&lt;br /&gt;
&lt;br /&gt;
A 192 byte long structure. There are 24 of them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u32&lt;br /&gt;
| Dirty flags&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| f32[3][2][2]&lt;br /&gt;
| Input Gain (Each input has 12 channels)&lt;br /&gt;
|-&lt;br /&gt;
| 52&lt;br /&gt;
| f32&lt;br /&gt;
| Rate multiplier (1.0x == native DSP rate)&lt;br /&gt;
|-&lt;br /&gt;
| 56&lt;br /&gt;
| u8&lt;br /&gt;
| Interpolation mode&lt;br /&gt;
|-&lt;br /&gt;
| 57&lt;br /&gt;
| u8&lt;br /&gt;
| Polyphase filter select&lt;br /&gt;
|-&lt;br /&gt;
| 58&lt;br /&gt;
| u16&lt;br /&gt;
| bit[0]: Simple Filter enabled, bit[1]: Biquadratic Filter enabled&lt;br /&gt;
|-&lt;br /&gt;
| 60&lt;br /&gt;
| SimpleFilter&lt;br /&gt;
| Simple Filter (One pole normalized recursive linear filter)&lt;br /&gt;
|-&lt;br /&gt;
| 64&lt;br /&gt;
| BiquadFilter&lt;br /&gt;
| Biquadratic Filter (Two poles two zeros normalized recursive linear filter)&lt;br /&gt;
|-&lt;br /&gt;
| 74&lt;br /&gt;
| u16&lt;br /&gt;
| Bitmap of which buffers in queue are dirty&lt;br /&gt;
|-&lt;br /&gt;
| 76&lt;br /&gt;
| Buffer[4]&lt;br /&gt;
| Buffer queue&lt;br /&gt;
|-&lt;br /&gt;
| 156&lt;br /&gt;
| u32&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| 160&lt;br /&gt;
| u16&lt;br /&gt;
| Is Active&lt;br /&gt;
|-&lt;br /&gt;
| 162&lt;br /&gt;
| u16 &lt;br /&gt;
| Sync Count&lt;br /&gt;
|-&lt;br /&gt;
| 164&lt;br /&gt;
| u32&lt;br /&gt;
| Play position&lt;br /&gt;
|-&lt;br /&gt;
| 168&lt;br /&gt;
| 4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 172&lt;br /&gt;
| u32&lt;br /&gt;
| Physical address of embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 176&lt;br /&gt;
| u32&lt;br /&gt;
| Number of samples in embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 180&lt;br /&gt;
| u16&lt;br /&gt;
| bits[0:1]: 1 = mono, 2 = stereo; bits[2:3]: buffer format, bits[5]: fade in&lt;br /&gt;
|-&lt;br /&gt;
| 182&lt;br /&gt;
| AdpcmData&lt;br /&gt;
| ADPCM data associated with embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 188&lt;br /&gt;
| u16&lt;br /&gt;
| bit[0]: ADPCM updated?; bit[1]: Is looping?r&lt;br /&gt;
|-&lt;br /&gt;
| 190&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer Id of embedded buffer&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Buffer ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u32&lt;br /&gt;
| Physical Address&lt;br /&gt;
|-&lt;br /&gt;
| 4 &lt;br /&gt;
| u32&lt;br /&gt;
| Sample Count&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| AdpcmData&lt;br /&gt;
| ADPCM data&lt;br /&gt;
|-&lt;br /&gt;
| 14&lt;br /&gt;
| u8&lt;br /&gt;
| ADPCM data dirty?&lt;br /&gt;
|-&lt;br /&gt;
| 15&lt;br /&gt;
| u8&lt;br /&gt;
| Looping?&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer Id&lt;br /&gt;
|-&lt;br /&gt;
| 18&lt;br /&gt;
| u16&lt;br /&gt;
| -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Adpcm Data === &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u8&lt;br /&gt;
| ADPCM predictor/scale&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| u8&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| s16&lt;br /&gt;
| ADPCM y[n-1]&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| s16&lt;br /&gt;
| ADPCM y[n-2]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Simple Filter ===&lt;br /&gt;
&lt;br /&gt;
This is a standard single-pole filter. The fall-off is 6dB per octave as you would expect.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s1.15&lt;br /&gt;
| b0&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| s1.15&lt;br /&gt;
| a1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Input status ==&lt;br /&gt;
&lt;br /&gt;
Read only. This structure is set by the DSP. This structure is 12 bytes long and there are 24 of them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u8&lt;br /&gt;
| Input Enabled?&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| u8&lt;br /&gt;
| Dirty flag for previous buffer id.&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| u16&lt;br /&gt;
| Sync count&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| u32&lt;br /&gt;
| Position (number of samples) into current buffer playback&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer id of last buffer that was played&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| u16&lt;br /&gt;
| -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Input ADPCM coefficients ==&lt;br /&gt;
&lt;br /&gt;
This is a 32 byte long structure. There are 24 of them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s5.11[16]&lt;br /&gt;
| ADPCM coefficents&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== DSP configuration ==&lt;br /&gt;
&lt;br /&gt;
=== Delay Effect ===&lt;br /&gt;
&lt;br /&gt;
Delay with feedback.&lt;br /&gt;
&lt;br /&gt;
Length of delay is expressed in terms of number of audio frames (there are 160 samples per audio frame).&lt;br /&gt;
&lt;br /&gt;
Feedback arm only has a gain on it. Under the feedback arm is a single-pole filter with the delay.&lt;br /&gt;
&lt;br /&gt;
=== Reverb Effect ===&lt;br /&gt;
&lt;br /&gt;
== DSP status ==&lt;br /&gt;
&lt;br /&gt;
Read only.&lt;br /&gt;
&lt;br /&gt;
== Output samples ==&lt;br /&gt;
&lt;br /&gt;
Read only. This structure is 320 bytes long.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s16[160]&lt;br /&gt;
| Samples&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Intermediate mix samples ==&lt;br /&gt;
&lt;br /&gt;
Read/Write.&lt;br /&gt;
&lt;br /&gt;
PCM32. Also serves an aux function, allowing the ARM11 to apply custom effects to audio.&lt;br /&gt;
&lt;br /&gt;
This structure is 5120 bytes long.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s32[2][4][160]&lt;br /&gt;
| Samples&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Compressor table ==&lt;br /&gt;
&lt;br /&gt;
A precomputed response curve lookup table for the compressor.&lt;/div&gt;</summary>
		<author><name>Merry</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=DSP_Memory_Region&amp;diff=15827</id>
		<title>DSP Memory Region</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=DSP_Memory_Region&amp;diff=15827"/>
		<updated>2016-02-18T21:42:29Z</updated>

		<summary type="html">&lt;p&gt;Merry: /* Input status */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Some of this is known to be incorrect. I&#039;ll correct this in a few months after a bit more RE work. [[User:Merry|Merry]] ([[User talk:Merry|talk]]) 21:10, 28 January 2016 (CET)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*Note that everything below will vary depending on the exact DSP firmware used and different variants have slightly different behaviours.*&lt;br /&gt;
&lt;br /&gt;
The DSP communicates with the application through two shared memory areas 0x8000 bytes long each (at 0x1FF50000 and 0x1FF70000 respectively). The DSP alternates between the use of these two areas (much like a double-buffer). Each area has 15 structures within it. The location of these structures can be obtained by [[DSP:ReadPipe|reading channel 2 of the DSP pipe]]. A list of structures in the order the DSP addresses are read from the pipe follows:&lt;br /&gt;
&lt;br /&gt;
1. Frame count&lt;br /&gt;
&lt;br /&gt;
2. Input configurations&lt;br /&gt;
&lt;br /&gt;
3. Input status&lt;br /&gt;
&lt;br /&gt;
4. Input ADPCM coefficients&lt;br /&gt;
&lt;br /&gt;
5. DSP configuration&lt;br /&gt;
&lt;br /&gt;
6. DSP status&lt;br /&gt;
&lt;br /&gt;
7. Output samples&lt;br /&gt;
&lt;br /&gt;
8. Intermediate mix samples&lt;br /&gt;
&lt;br /&gt;
9. Compressor table&lt;br /&gt;
&lt;br /&gt;
10. DSP debug statistics&lt;br /&gt;
&lt;br /&gt;
11. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
12. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
13. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
14. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
15. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
The DSP has 24 inputs, each of which are individually configurable. These 24 inputs each produce three sets of 4 audio channels (two left, two right). &lt;br /&gt;
&lt;br /&gt;
These four audio channels feed into three intermediate mixers. Two of these intermediate mixers are used for effects and aux.&lt;br /&gt;
&lt;br /&gt;
== Frame Count ==&lt;br /&gt;
&lt;br /&gt;
== Input Config ==&lt;br /&gt;
&lt;br /&gt;
A 192 byte long structure. There are 24 of them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u32&lt;br /&gt;
| Dirty flags&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| f32[3][2][2]&lt;br /&gt;
| Input Gain (Each input has 12 channels)&lt;br /&gt;
|-&lt;br /&gt;
| 52&lt;br /&gt;
| f32&lt;br /&gt;
| Rate multiplier (1.0x == native DSP rate)&lt;br /&gt;
|-&lt;br /&gt;
| 56&lt;br /&gt;
| u8&lt;br /&gt;
| Interpolation mode&lt;br /&gt;
|-&lt;br /&gt;
| 57&lt;br /&gt;
| u8&lt;br /&gt;
| Polyphase filter select&lt;br /&gt;
|-&lt;br /&gt;
| 58&lt;br /&gt;
| u16&lt;br /&gt;
| bit[0]: Simple Filter enabled, bit[1]: Biquadratic Filter enabled&lt;br /&gt;
|-&lt;br /&gt;
| 60&lt;br /&gt;
| SimpleFilter&lt;br /&gt;
| Simple Filter (One pole normalized recursive linear filter)&lt;br /&gt;
|-&lt;br /&gt;
| 64&lt;br /&gt;
| BiquadFilter&lt;br /&gt;
| Biquadratic Filter (Two poles two zeros normalized recursive linear filter)&lt;br /&gt;
|-&lt;br /&gt;
| 74&lt;br /&gt;
| u16&lt;br /&gt;
| Bitmap of which buffers in queue are dirty&lt;br /&gt;
|-&lt;br /&gt;
| 76&lt;br /&gt;
| Buffer[4]&lt;br /&gt;
| Buffer queue&lt;br /&gt;
|-&lt;br /&gt;
| 156&lt;br /&gt;
| u32&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| 160&lt;br /&gt;
| u16&lt;br /&gt;
| Is Active&lt;br /&gt;
|-&lt;br /&gt;
| 162&lt;br /&gt;
| u16 &lt;br /&gt;
| Sync Count&lt;br /&gt;
|-&lt;br /&gt;
| 164&lt;br /&gt;
| u32&lt;br /&gt;
| Play position&lt;br /&gt;
|-&lt;br /&gt;
| 168&lt;br /&gt;
| 4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 172&lt;br /&gt;
| u32&lt;br /&gt;
| Physical address of embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 176&lt;br /&gt;
| u32&lt;br /&gt;
| Number of samples in embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 180&lt;br /&gt;
| u16&lt;br /&gt;
| bits[0:1]: 1 = mono, 2 = stereo; bits[2:3]: buffer format, bits[5]: fade in&lt;br /&gt;
|-&lt;br /&gt;
| 182&lt;br /&gt;
| AdpcmData&lt;br /&gt;
| ADPCM data associated with embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 188&lt;br /&gt;
| u16&lt;br /&gt;
| bit[0]: ADPCM updated?; bit[1]: Is looping?r&lt;br /&gt;
|-&lt;br /&gt;
| 190&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer Id of embedded buffer&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Buffer ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u32&lt;br /&gt;
| Physical Address&lt;br /&gt;
|-&lt;br /&gt;
| 4 &lt;br /&gt;
| u32&lt;br /&gt;
| Sample Count&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| AdpcmData&lt;br /&gt;
| ADPCM data&lt;br /&gt;
|-&lt;br /&gt;
| 14&lt;br /&gt;
| u8&lt;br /&gt;
| ADPCM data dirty?&lt;br /&gt;
|-&lt;br /&gt;
| 15&lt;br /&gt;
| u8&lt;br /&gt;
| Looping?&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer Id&lt;br /&gt;
|-&lt;br /&gt;
| 18&lt;br /&gt;
| u16&lt;br /&gt;
| -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Adpcm Data === &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u8&lt;br /&gt;
| ADPCM predictor/scale&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| u8&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| s16&lt;br /&gt;
| ADPCM y[n-1]&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| s16&lt;br /&gt;
| ADPCM y[n-2]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Simple Filter ===&lt;br /&gt;
&lt;br /&gt;
This is a standard single-pole filter. The fall-off is 6dB per octave as you would expect.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s16&lt;br /&gt;
| b0&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| s16&lt;br /&gt;
| a1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Input status ==&lt;br /&gt;
&lt;br /&gt;
Read only. This structure is set by the DSP. This structure is 12 bytes long and there are 24 of them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u8&lt;br /&gt;
| Input Enabled?&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| u8&lt;br /&gt;
| Dirty flag for previous buffer id.&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| u16&lt;br /&gt;
| Sync count&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| u32&lt;br /&gt;
| Position (number of samples) into current buffer playback&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer id of last buffer that was played&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| u16&lt;br /&gt;
| -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Input ADPCM coefficients ==&lt;br /&gt;
&lt;br /&gt;
== DSP configuration ==&lt;br /&gt;
&lt;br /&gt;
=== Delay Effect ===&lt;br /&gt;
&lt;br /&gt;
Delay with feedback.&lt;br /&gt;
&lt;br /&gt;
Length of delay is expressed in terms of number of audio frames (there are 160 samples per audio frame).&lt;br /&gt;
&lt;br /&gt;
Feedback arm only has a gain on it. Under the feedback arm is a single-pole filter with the delay.&lt;br /&gt;
&lt;br /&gt;
=== Reverb Effect ===&lt;br /&gt;
&lt;br /&gt;
== DSP status ==&lt;br /&gt;
&lt;br /&gt;
Read only.&lt;br /&gt;
&lt;br /&gt;
== Output samples ==&lt;br /&gt;
&lt;br /&gt;
Read only.&lt;br /&gt;
&lt;br /&gt;
PCM16.&lt;br /&gt;
&lt;br /&gt;
== Intermediate mix samples ==&lt;br /&gt;
&lt;br /&gt;
Read/Write.&lt;br /&gt;
&lt;br /&gt;
PCM32. Also serves an aux function, allowing the ARM11 to apply custom effects to audio.&lt;br /&gt;
&lt;br /&gt;
== Compressor table ==&lt;br /&gt;
&lt;br /&gt;
A precomputed response curve lookup table for the compressor.&lt;/div&gt;</summary>
		<author><name>Merry</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=DSP_Memory_Region&amp;diff=15826</id>
		<title>DSP Memory Region</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=DSP_Memory_Region&amp;diff=15826"/>
		<updated>2016-02-18T21:41:42Z</updated>

		<summary type="html">&lt;p&gt;Merry: SourceStatus&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Some of this is known to be incorrect. I&#039;ll correct this in a few months after a bit more RE work. [[User:Merry|Merry]] ([[User talk:Merry|talk]]) 21:10, 28 January 2016 (CET)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*Note that everything below will vary depending on the exact DSP firmware used and different variants have slightly different behaviours.*&lt;br /&gt;
&lt;br /&gt;
The DSP communicates with the application through two shared memory areas 0x8000 bytes long each (at 0x1FF50000 and 0x1FF70000 respectively). The DSP alternates between the use of these two areas (much like a double-buffer). Each area has 15 structures within it. The location of these structures can be obtained by [[DSP:ReadPipe|reading channel 2 of the DSP pipe]]. A list of structures in the order the DSP addresses are read from the pipe follows:&lt;br /&gt;
&lt;br /&gt;
1. Frame count&lt;br /&gt;
&lt;br /&gt;
2. Input configurations&lt;br /&gt;
&lt;br /&gt;
3. Input status&lt;br /&gt;
&lt;br /&gt;
4. Input ADPCM coefficients&lt;br /&gt;
&lt;br /&gt;
5. DSP configuration&lt;br /&gt;
&lt;br /&gt;
6. DSP status&lt;br /&gt;
&lt;br /&gt;
7. Output samples&lt;br /&gt;
&lt;br /&gt;
8. Intermediate mix samples&lt;br /&gt;
&lt;br /&gt;
9. Compressor table&lt;br /&gt;
&lt;br /&gt;
10. DSP debug statistics&lt;br /&gt;
&lt;br /&gt;
11. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
12. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
13. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
14. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
15. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
The DSP has 24 inputs, each of which are individually configurable. These 24 inputs each produce three sets of 4 audio channels (two left, two right). &lt;br /&gt;
&lt;br /&gt;
These four audio channels feed into three intermediate mixers. Two of these intermediate mixers are used for effects and aux.&lt;br /&gt;
&lt;br /&gt;
== Frame Count ==&lt;br /&gt;
&lt;br /&gt;
== Input Config ==&lt;br /&gt;
&lt;br /&gt;
A 192 byte long structure. There are 24 of them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u32&lt;br /&gt;
| Dirty flags&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| f32[3][2][2]&lt;br /&gt;
| Input Gain (Each input has 12 channels)&lt;br /&gt;
|-&lt;br /&gt;
| 52&lt;br /&gt;
| f32&lt;br /&gt;
| Rate multiplier (1.0x == native DSP rate)&lt;br /&gt;
|-&lt;br /&gt;
| 56&lt;br /&gt;
| u8&lt;br /&gt;
| Interpolation mode&lt;br /&gt;
|-&lt;br /&gt;
| 57&lt;br /&gt;
| u8&lt;br /&gt;
| Polyphase filter select&lt;br /&gt;
|-&lt;br /&gt;
| 58&lt;br /&gt;
| u16&lt;br /&gt;
| bit[0]: Simple Filter enabled, bit[1]: Biquadratic Filter enabled&lt;br /&gt;
|-&lt;br /&gt;
| 60&lt;br /&gt;
| SimpleFilter&lt;br /&gt;
| Simple Filter (One pole normalized recursive linear filter)&lt;br /&gt;
|-&lt;br /&gt;
| 64&lt;br /&gt;
| BiquadFilter&lt;br /&gt;
| Biquadratic Filter (Two poles two zeros normalized recursive linear filter)&lt;br /&gt;
|-&lt;br /&gt;
| 74&lt;br /&gt;
| u16&lt;br /&gt;
| Bitmap of which buffers in queue are dirty&lt;br /&gt;
|-&lt;br /&gt;
| 76&lt;br /&gt;
| Buffer[4]&lt;br /&gt;
| Buffer queue&lt;br /&gt;
|-&lt;br /&gt;
| 156&lt;br /&gt;
| u32&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| 160&lt;br /&gt;
| u16&lt;br /&gt;
| Is Active&lt;br /&gt;
|-&lt;br /&gt;
| 162&lt;br /&gt;
| u16 &lt;br /&gt;
| Sync Count&lt;br /&gt;
|-&lt;br /&gt;
| 164&lt;br /&gt;
| u32&lt;br /&gt;
| Play position&lt;br /&gt;
|-&lt;br /&gt;
| 168&lt;br /&gt;
| 4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 172&lt;br /&gt;
| u32&lt;br /&gt;
| Physical address of embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 176&lt;br /&gt;
| u32&lt;br /&gt;
| Number of samples in embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 180&lt;br /&gt;
| u16&lt;br /&gt;
| bits[0:1]: 1 = mono, 2 = stereo; bits[2:3]: buffer format, bits[5]: fade in&lt;br /&gt;
|-&lt;br /&gt;
| 182&lt;br /&gt;
| AdpcmData&lt;br /&gt;
| ADPCM data associated with embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 188&lt;br /&gt;
| u16&lt;br /&gt;
| bit[0]: ADPCM updated?; bit[1]: Is looping?r&lt;br /&gt;
|-&lt;br /&gt;
| 190&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer Id of embedded buffer&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Buffer ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u32&lt;br /&gt;
| Physical Address&lt;br /&gt;
|-&lt;br /&gt;
| 4 &lt;br /&gt;
| u32&lt;br /&gt;
| Sample Count&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| AdpcmData&lt;br /&gt;
| ADPCM data&lt;br /&gt;
|-&lt;br /&gt;
| 14&lt;br /&gt;
| u8&lt;br /&gt;
| ADPCM data dirty?&lt;br /&gt;
|-&lt;br /&gt;
| 15&lt;br /&gt;
| u8&lt;br /&gt;
| Looping?&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer Id&lt;br /&gt;
|-&lt;br /&gt;
| 18&lt;br /&gt;
| u16&lt;br /&gt;
| -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Adpcm Data === &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u8&lt;br /&gt;
| ADPCM predictor/scale&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| u8&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| s16&lt;br /&gt;
| ADPCM y[n-1]&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| s16&lt;br /&gt;
| ADPCM y[n-2]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Simple Filter ===&lt;br /&gt;
&lt;br /&gt;
This is a standard single-pole filter. The fall-off is 6dB per octave as you would expect.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s16&lt;br /&gt;
| b0&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| s16&lt;br /&gt;
| a1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Input status ==&lt;br /&gt;
&lt;br /&gt;
Read only.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u8&lt;br /&gt;
| Input Enabled?&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| u8&lt;br /&gt;
| Dirty flag for previous buffer id.&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| u16&lt;br /&gt;
| Sync count&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| u32&lt;br /&gt;
| Position (number of samples) into current buffer playback&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer id of last buffer that was played&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| u16&lt;br /&gt;
| -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Input ADPCM coefficients ==&lt;br /&gt;
&lt;br /&gt;
== DSP configuration ==&lt;br /&gt;
&lt;br /&gt;
=== Delay Effect ===&lt;br /&gt;
&lt;br /&gt;
Delay with feedback.&lt;br /&gt;
&lt;br /&gt;
Length of delay is expressed in terms of number of audio frames (there are 160 samples per audio frame).&lt;br /&gt;
&lt;br /&gt;
Feedback arm only has a gain on it. Under the feedback arm is a single-pole filter with the delay.&lt;br /&gt;
&lt;br /&gt;
=== Reverb Effect ===&lt;br /&gt;
&lt;br /&gt;
== DSP status ==&lt;br /&gt;
&lt;br /&gt;
Read only.&lt;br /&gt;
&lt;br /&gt;
== Output samples ==&lt;br /&gt;
&lt;br /&gt;
Read only.&lt;br /&gt;
&lt;br /&gt;
PCM16.&lt;br /&gt;
&lt;br /&gt;
== Intermediate mix samples ==&lt;br /&gt;
&lt;br /&gt;
Read/Write.&lt;br /&gt;
&lt;br /&gt;
PCM32. Also serves an aux function, allowing the ARM11 to apply custom effects to audio.&lt;br /&gt;
&lt;br /&gt;
== Compressor table ==&lt;br /&gt;
&lt;br /&gt;
A precomputed response curve lookup table for the compressor.&lt;/div&gt;</summary>
		<author><name>Merry</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=DSP_Memory_Region&amp;diff=15804</id>
		<title>DSP Memory Region</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=DSP_Memory_Region&amp;diff=15804"/>
		<updated>2016-02-17T21:57:23Z</updated>

		<summary type="html">&lt;p&gt;Merry: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Some of this is known to be incorrect. I&#039;ll correct this in a few months after a bit more RE work. [[User:Merry|Merry]] ([[User talk:Merry|talk]]) 21:10, 28 January 2016 (CET)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*Note that everything below will vary depending on the exact DSP firmware used and different variants have slightly different behaviours.*&lt;br /&gt;
&lt;br /&gt;
The DSP communicates with the application through two shared memory areas 0x8000 bytes long each (at 0x1FF50000 and 0x1FF70000 respectively). The DSP alternates between the use of these two areas (much like a double-buffer). Each area has 15 structures within it. The location of these structures can be obtained by [[DSP:ReadPipe|reading channel 2 of the DSP pipe]]. A list of structures in the order the DSP addresses are read from the pipe follows:&lt;br /&gt;
&lt;br /&gt;
1. Frame count&lt;br /&gt;
&lt;br /&gt;
2. Input configurations&lt;br /&gt;
&lt;br /&gt;
3. Input status&lt;br /&gt;
&lt;br /&gt;
4. Input ADPCM coefficients&lt;br /&gt;
&lt;br /&gt;
5. DSP configuration&lt;br /&gt;
&lt;br /&gt;
6. DSP status&lt;br /&gt;
&lt;br /&gt;
7. Output samples&lt;br /&gt;
&lt;br /&gt;
8. Intermediate mix samples&lt;br /&gt;
&lt;br /&gt;
9. Compressor table&lt;br /&gt;
&lt;br /&gt;
10. DSP debug statistics&lt;br /&gt;
&lt;br /&gt;
11. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
12. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
13. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
14. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
15. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
The DSP has 24 inputs, each of which are individually configurable. These 24 inputs each produce three sets of 4 audio channels (two left, two right). &lt;br /&gt;
&lt;br /&gt;
These four audio channels feed into three intermediate mixers. Two of these intermediate mixers are used for effects and aux.&lt;br /&gt;
&lt;br /&gt;
== Frame Count ==&lt;br /&gt;
&lt;br /&gt;
== Input Config ==&lt;br /&gt;
&lt;br /&gt;
A 192 byte long structure. There are 24 of them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u32&lt;br /&gt;
| Dirty flags&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| f32[3][2][2]&lt;br /&gt;
| Input Gain (Each input has 12 channels)&lt;br /&gt;
|-&lt;br /&gt;
| 52&lt;br /&gt;
| f32&lt;br /&gt;
| Rate multiplier (1.0x == native DSP rate)&lt;br /&gt;
|-&lt;br /&gt;
| 56&lt;br /&gt;
| u8&lt;br /&gt;
| Interpolation mode&lt;br /&gt;
|-&lt;br /&gt;
| 57&lt;br /&gt;
| u8&lt;br /&gt;
| Polyphase filter select&lt;br /&gt;
|-&lt;br /&gt;
| 58&lt;br /&gt;
| u16&lt;br /&gt;
| bit[0]: Simple Filter enabled, bit[1]: Biquadratic Filter enabled&lt;br /&gt;
|-&lt;br /&gt;
| 60&lt;br /&gt;
| SimpleFilter&lt;br /&gt;
| Simple Filter (One pole normalized recursive linear filter)&lt;br /&gt;
|-&lt;br /&gt;
| 64&lt;br /&gt;
| BiquadFilter&lt;br /&gt;
| Biquadratic Filter (Two poles two zeros normalized recursive linear filter)&lt;br /&gt;
|-&lt;br /&gt;
| 74&lt;br /&gt;
| u16&lt;br /&gt;
| Bitmap of which buffers in queue are dirty&lt;br /&gt;
|-&lt;br /&gt;
| 76&lt;br /&gt;
| Buffer[4]&lt;br /&gt;
| Buffer queue&lt;br /&gt;
|-&lt;br /&gt;
| 156&lt;br /&gt;
| u32&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| 160&lt;br /&gt;
| u16&lt;br /&gt;
| Is Active&lt;br /&gt;
|-&lt;br /&gt;
| 162&lt;br /&gt;
| u16 &lt;br /&gt;
| Sync Count&lt;br /&gt;
|-&lt;br /&gt;
| 164&lt;br /&gt;
| u32&lt;br /&gt;
| Play position&lt;br /&gt;
|-&lt;br /&gt;
| 168&lt;br /&gt;
| 4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 172&lt;br /&gt;
| u32&lt;br /&gt;
| Physical address of embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 176&lt;br /&gt;
| u32&lt;br /&gt;
| Number of samples in embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 180&lt;br /&gt;
| u16&lt;br /&gt;
| bits[0:1]: 1 = mono, 2 = stereo; bits[2:3]: buffer format, bits[5]: fade in&lt;br /&gt;
|-&lt;br /&gt;
| 182&lt;br /&gt;
| AdpcmData&lt;br /&gt;
| ADPCM data associated with embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 188&lt;br /&gt;
| u16&lt;br /&gt;
| bit[0]: ADPCM updated?; bit[1]: Is looping?r&lt;br /&gt;
|-&lt;br /&gt;
| 190&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer Id of embedded buffer&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Buffer ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u32&lt;br /&gt;
| Physical Address&lt;br /&gt;
|-&lt;br /&gt;
| 4 &lt;br /&gt;
| u32&lt;br /&gt;
| Sample Count&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| AdpcmData&lt;br /&gt;
| ADPCM data&lt;br /&gt;
|-&lt;br /&gt;
| 14&lt;br /&gt;
| u8&lt;br /&gt;
| ADPCM data dirty?&lt;br /&gt;
|-&lt;br /&gt;
| 15&lt;br /&gt;
| u8&lt;br /&gt;
| Looping?&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer Id&lt;br /&gt;
|-&lt;br /&gt;
| 18&lt;br /&gt;
| u16&lt;br /&gt;
| -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Adpcm Data === &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u8&lt;br /&gt;
| ADPCM predictor/scale&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| u8&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| s16&lt;br /&gt;
| ADPCM y[n-1]&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| s16&lt;br /&gt;
| ADPCM y[n-2]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Simple Filter ===&lt;br /&gt;
&lt;br /&gt;
This is a standard single-pole filter. The fall-off is 6dB per octave as you would expect.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s16&lt;br /&gt;
| b0&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| s16&lt;br /&gt;
| a1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Input status ==&lt;br /&gt;
&lt;br /&gt;
Read only.&lt;br /&gt;
&lt;br /&gt;
== Input ADPCM coefficients ==&lt;br /&gt;
&lt;br /&gt;
== DSP configuration ==&lt;br /&gt;
&lt;br /&gt;
=== Delay Effect ===&lt;br /&gt;
&lt;br /&gt;
Delay with feedback.&lt;br /&gt;
&lt;br /&gt;
Length of delay is expressed in terms of number of audio frames (there are 160 samples per audio frame).&lt;br /&gt;
&lt;br /&gt;
Feedback arm only has a gain on it. Under the feedback arm is a single-pole filter with the delay.&lt;br /&gt;
&lt;br /&gt;
=== Reverb Effect ===&lt;br /&gt;
&lt;br /&gt;
== DSP status ==&lt;br /&gt;
&lt;br /&gt;
Read only.&lt;br /&gt;
&lt;br /&gt;
== Output samples ==&lt;br /&gt;
&lt;br /&gt;
Read only.&lt;br /&gt;
&lt;br /&gt;
PCM16.&lt;br /&gt;
&lt;br /&gt;
== Intermediate mix samples ==&lt;br /&gt;
&lt;br /&gt;
Read/Write.&lt;br /&gt;
&lt;br /&gt;
PCM32. Also serves an aux function, allowing the ARM11 to apply custom effects to audio.&lt;br /&gt;
&lt;br /&gt;
== Compressor table ==&lt;br /&gt;
&lt;br /&gt;
A precomputed response curve lookup table for the compressor.&lt;/div&gt;</summary>
		<author><name>Merry</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=DSP_Memory_Region&amp;diff=15803</id>
		<title>DSP Memory Region</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=DSP_Memory_Region&amp;diff=15803"/>
		<updated>2016-02-17T20:23:37Z</updated>

		<summary type="html">&lt;p&gt;Merry: /* Simple Filter */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Some of this is known to be incorrect. I&#039;ll correct this in a few months after a bit more RE work. [[User:Merry|Merry]] ([[User talk:Merry|talk]]) 21:10, 28 January 2016 (CET)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*Note that everything below will vary depending on the exact DSP firmware used and different variants have slightly different behaviours.*&lt;br /&gt;
&lt;br /&gt;
The DSP communicates with the application through two shared memory areas 0x8000 bytes long each (at 0x1FF50000 and 0x1FF70000 respectively). The DSP alternates between the use of these two areas (much like a double-buffer). Each area has 15 structures within it. The location of these structures can be obtained by [[DSP:ReadPipe|reading channel 2 of the DSP pipe]]. A list of structures in the order the DSP addresses are read from the pipe follows:&lt;br /&gt;
&lt;br /&gt;
1. Frame count&lt;br /&gt;
&lt;br /&gt;
2. Input configurations&lt;br /&gt;
&lt;br /&gt;
3. Input status&lt;br /&gt;
&lt;br /&gt;
4. Input ADPCM coefficients&lt;br /&gt;
&lt;br /&gt;
5. DSP configuration&lt;br /&gt;
&lt;br /&gt;
6. DSP status&lt;br /&gt;
&lt;br /&gt;
7. Output samples&lt;br /&gt;
&lt;br /&gt;
8. Intermediate mix samples&lt;br /&gt;
&lt;br /&gt;
9. Compressor table&lt;br /&gt;
&lt;br /&gt;
10. DSP debug statistics&lt;br /&gt;
&lt;br /&gt;
11. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
12. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
13. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
14. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
15. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
The DSP has 24 inputs, each of which are individually configurable. These 24 inputs each produce three sets of 4 audio channels (two left, two right). &lt;br /&gt;
&lt;br /&gt;
These four audio channels feed into three intermediate mixers. Two of these intermediate mixers are used for effects and aux.&lt;br /&gt;
&lt;br /&gt;
== Frame Count ==&lt;br /&gt;
&lt;br /&gt;
== Input Config ==&lt;br /&gt;
&lt;br /&gt;
A 192 byte long structure. There are 24 of them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u32&lt;br /&gt;
| Dirty flags&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| f32[3][2][2]&lt;br /&gt;
| Input Gain (Each input has 12 channels)&lt;br /&gt;
|-&lt;br /&gt;
| 52&lt;br /&gt;
| f32&lt;br /&gt;
| Rate multiplier (1.0x == native DSP rate)&lt;br /&gt;
|-&lt;br /&gt;
| 56&lt;br /&gt;
| u8&lt;br /&gt;
| Interpolation mode&lt;br /&gt;
|-&lt;br /&gt;
| 57&lt;br /&gt;
| u8&lt;br /&gt;
| Polyphase filter select&lt;br /&gt;
|-&lt;br /&gt;
| 58&lt;br /&gt;
| u16&lt;br /&gt;
| bit[0]: Simple Filter enabled, bit[1]: Biquadratic Filter enabled&lt;br /&gt;
|-&lt;br /&gt;
| 60&lt;br /&gt;
| SimpleFilter&lt;br /&gt;
| Simple Filter (One pole normalized recursive linear filter)&lt;br /&gt;
|-&lt;br /&gt;
| 64&lt;br /&gt;
| BiquadFilter&lt;br /&gt;
| Biquadratic Filter (Two poles two zeros normalized recursive linear filter)&lt;br /&gt;
|-&lt;br /&gt;
| 74&lt;br /&gt;
| u16&lt;br /&gt;
| Bitmap of which buffers in queue are dirty&lt;br /&gt;
|-&lt;br /&gt;
| 76&lt;br /&gt;
| Buffer[4]&lt;br /&gt;
| Buffer queue&lt;br /&gt;
|-&lt;br /&gt;
| 156&lt;br /&gt;
| u32&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| 160&lt;br /&gt;
| u16&lt;br /&gt;
| Is Active&lt;br /&gt;
|-&lt;br /&gt;
| 162&lt;br /&gt;
| u16 &lt;br /&gt;
| Sync Count&lt;br /&gt;
|-&lt;br /&gt;
| 164&lt;br /&gt;
| u32&lt;br /&gt;
| Play position&lt;br /&gt;
|-&lt;br /&gt;
| 168&lt;br /&gt;
| 4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 172&lt;br /&gt;
| u32&lt;br /&gt;
| Physical address of embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 176&lt;br /&gt;
| u32&lt;br /&gt;
| Number of samples in embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 180&lt;br /&gt;
| u16&lt;br /&gt;
| bits[0:1]: 1 = mono, 2 = stereo; bits[2:3]: buffer format, bits[5]: fade in&lt;br /&gt;
|-&lt;br /&gt;
| 182&lt;br /&gt;
| AdpcmData&lt;br /&gt;
| ADPCM data associated with embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 188&lt;br /&gt;
| u16&lt;br /&gt;
| bit[0]: ADPCM updated?; bit[1]: Is looping?r&lt;br /&gt;
|-&lt;br /&gt;
| 190&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer Id of embedded buffer&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Buffer ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u32&lt;br /&gt;
| Physical Address&lt;br /&gt;
|-&lt;br /&gt;
| 4 &lt;br /&gt;
| u32&lt;br /&gt;
| Sample Count&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| AdpcmData&lt;br /&gt;
| ADPCM data&lt;br /&gt;
|-&lt;br /&gt;
| 14&lt;br /&gt;
| u8&lt;br /&gt;
| ADPCM data dirty?&lt;br /&gt;
|-&lt;br /&gt;
| 15&lt;br /&gt;
| u8&lt;br /&gt;
| Looping?&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer Id&lt;br /&gt;
|-&lt;br /&gt;
| 18&lt;br /&gt;
| u16&lt;br /&gt;
| -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Adpcm Data === &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u8&lt;br /&gt;
| ADPCM predictor/scale&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| u8&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| s16&lt;br /&gt;
| ADPCM y[n-1]&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| s16&lt;br /&gt;
| ADPCM y[n-2]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Simple Filter ===&lt;br /&gt;
&lt;br /&gt;
This is a standard single-pole filter. The fall-off is 6dB per octave as you would expect.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s16&lt;br /&gt;
| b0&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| s16&lt;br /&gt;
| a1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Input status ==&lt;br /&gt;
&lt;br /&gt;
Read only.&lt;br /&gt;
&lt;br /&gt;
== Input ADPCM coefficients ==&lt;br /&gt;
&lt;br /&gt;
== DSP configuration ==&lt;br /&gt;
&lt;br /&gt;
=== Delay Effect ===&lt;br /&gt;
&lt;br /&gt;
Delay with feedback.&lt;br /&gt;
&lt;br /&gt;
Length of delay is a multiple of audio frames. There are 160 samples per audioframe.&lt;br /&gt;
&lt;br /&gt;
Feedback arm only has a gain on it. Under the feedback arm is a single-pole filter with the delay.&lt;br /&gt;
&lt;br /&gt;
=== Reverb Effect ===&lt;br /&gt;
&lt;br /&gt;
== DSP status ==&lt;br /&gt;
&lt;br /&gt;
Read only.&lt;br /&gt;
&lt;br /&gt;
== Output samples ==&lt;br /&gt;
&lt;br /&gt;
Read only.&lt;br /&gt;
&lt;br /&gt;
PCM16.&lt;br /&gt;
&lt;br /&gt;
== Intermediate mix samples ==&lt;br /&gt;
&lt;br /&gt;
Read/Write.&lt;br /&gt;
&lt;br /&gt;
PCM32. Also serves an aux function, allowing the ARM11 to apply custom effects to audio.&lt;br /&gt;
&lt;br /&gt;
== Compressor table ==&lt;br /&gt;
&lt;br /&gt;
A precomputed response curve lookup table for the compressor.&lt;/div&gt;</summary>
		<author><name>Merry</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=DSP_Memory_Region&amp;diff=15802</id>
		<title>DSP Memory Region</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=DSP_Memory_Region&amp;diff=15802"/>
		<updated>2016-02-17T20:16:31Z</updated>

		<summary type="html">&lt;p&gt;Merry: /* Input Config */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Some of this is known to be incorrect. I&#039;ll correct this in a few months after a bit more RE work. [[User:Merry|Merry]] ([[User talk:Merry|talk]]) 21:10, 28 January 2016 (CET)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*Note that everything below will vary depending on the exact DSP firmware used and different variants have slightly different behaviours.*&lt;br /&gt;
&lt;br /&gt;
The DSP communicates with the application through two shared memory areas 0x8000 bytes long each (at 0x1FF50000 and 0x1FF70000 respectively). The DSP alternates between the use of these two areas (much like a double-buffer). Each area has 15 structures within it. The location of these structures can be obtained by [[DSP:ReadPipe|reading channel 2 of the DSP pipe]]. A list of structures in the order the DSP addresses are read from the pipe follows:&lt;br /&gt;
&lt;br /&gt;
1. Frame count&lt;br /&gt;
&lt;br /&gt;
2. Input configurations&lt;br /&gt;
&lt;br /&gt;
3. Input status&lt;br /&gt;
&lt;br /&gt;
4. Input ADPCM coefficients&lt;br /&gt;
&lt;br /&gt;
5. DSP configuration&lt;br /&gt;
&lt;br /&gt;
6. DSP status&lt;br /&gt;
&lt;br /&gt;
7. Output samples&lt;br /&gt;
&lt;br /&gt;
8. Intermediate mix samples&lt;br /&gt;
&lt;br /&gt;
9. Compressor table&lt;br /&gt;
&lt;br /&gt;
10. DSP debug statistics&lt;br /&gt;
&lt;br /&gt;
11. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
12. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
13. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
14. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
15. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
The DSP has 24 inputs, each of which are individually configurable. These 24 inputs each produce three sets of 4 audio channels (two left, two right). &lt;br /&gt;
&lt;br /&gt;
These four audio channels feed into three intermediate mixers. Two of these intermediate mixers are used for effects and aux.&lt;br /&gt;
&lt;br /&gt;
== Frame Count ==&lt;br /&gt;
&lt;br /&gt;
== Input Config ==&lt;br /&gt;
&lt;br /&gt;
A 192 byte long structure. There are 24 of them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u32&lt;br /&gt;
| Dirty flags&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| f32[3][2][2]&lt;br /&gt;
| Input Gain (Each input has 12 channels)&lt;br /&gt;
|-&lt;br /&gt;
| 52&lt;br /&gt;
| f32&lt;br /&gt;
| Rate multiplier (1.0x == native DSP rate)&lt;br /&gt;
|-&lt;br /&gt;
| 56&lt;br /&gt;
| u8&lt;br /&gt;
| Interpolation mode&lt;br /&gt;
|-&lt;br /&gt;
| 57&lt;br /&gt;
| u8&lt;br /&gt;
| Polyphase filter select&lt;br /&gt;
|-&lt;br /&gt;
| 58&lt;br /&gt;
| u16&lt;br /&gt;
| bit[0]: Simple Filter enabled, bit[1]: Biquadratic Filter enabled&lt;br /&gt;
|-&lt;br /&gt;
| 60&lt;br /&gt;
| SimpleFilter&lt;br /&gt;
| Simple Filter (One pole normalized recursive linear filter)&lt;br /&gt;
|-&lt;br /&gt;
| 64&lt;br /&gt;
| BiquadFilter&lt;br /&gt;
| Biquadratic Filter (Two poles two zeros normalized recursive linear filter)&lt;br /&gt;
|-&lt;br /&gt;
| 74&lt;br /&gt;
| u16&lt;br /&gt;
| Bitmap of which buffers in queue are dirty&lt;br /&gt;
|-&lt;br /&gt;
| 76&lt;br /&gt;
| Buffer[4]&lt;br /&gt;
| Buffer queue&lt;br /&gt;
|-&lt;br /&gt;
| 156&lt;br /&gt;
| u32&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| 160&lt;br /&gt;
| u16&lt;br /&gt;
| Is Active&lt;br /&gt;
|-&lt;br /&gt;
| 162&lt;br /&gt;
| u16 &lt;br /&gt;
| Sync Count&lt;br /&gt;
|-&lt;br /&gt;
| 164&lt;br /&gt;
| u32&lt;br /&gt;
| Play position&lt;br /&gt;
|-&lt;br /&gt;
| 168&lt;br /&gt;
| 4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 172&lt;br /&gt;
| u32&lt;br /&gt;
| Physical address of embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 176&lt;br /&gt;
| u32&lt;br /&gt;
| Number of samples in embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 180&lt;br /&gt;
| u16&lt;br /&gt;
| bits[0:1]: 1 = mono, 2 = stereo; bits[2:3]: buffer format, bits[5]: fade in&lt;br /&gt;
|-&lt;br /&gt;
| 182&lt;br /&gt;
| AdpcmData&lt;br /&gt;
| ADPCM data associated with embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 188&lt;br /&gt;
| u16&lt;br /&gt;
| bit[0]: ADPCM updated?; bit[1]: Is looping?r&lt;br /&gt;
|-&lt;br /&gt;
| 190&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer Id of embedded buffer&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Buffer ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u32&lt;br /&gt;
| Physical Address&lt;br /&gt;
|-&lt;br /&gt;
| 4 &lt;br /&gt;
| u32&lt;br /&gt;
| Sample Count&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| AdpcmData&lt;br /&gt;
| ADPCM data&lt;br /&gt;
|-&lt;br /&gt;
| 14&lt;br /&gt;
| u8&lt;br /&gt;
| ADPCM data dirty?&lt;br /&gt;
|-&lt;br /&gt;
| 15&lt;br /&gt;
| u8&lt;br /&gt;
| Looping?&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer Id&lt;br /&gt;
|-&lt;br /&gt;
| 18&lt;br /&gt;
| u16&lt;br /&gt;
| -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Adpcm Data === &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u8&lt;br /&gt;
| ADPCM predictor/scale&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| u8&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| s16&lt;br /&gt;
| ADPCM y[n-1]&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| s16&lt;br /&gt;
| ADPCM y[n-2]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Simple Filter ===&lt;br /&gt;
&lt;br /&gt;
This is a standard single-pole filter. The fall-off is 6dB per octave as you would expect.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s16&lt;br /&gt;
| b0&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s16&lt;br /&gt;
| a1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Input status ==&lt;br /&gt;
&lt;br /&gt;
Read only.&lt;br /&gt;
&lt;br /&gt;
== Input ADPCM coefficients ==&lt;br /&gt;
&lt;br /&gt;
== DSP configuration ==&lt;br /&gt;
&lt;br /&gt;
=== Delay Effect ===&lt;br /&gt;
&lt;br /&gt;
Delay with feedback.&lt;br /&gt;
&lt;br /&gt;
Length of delay is a multiple of audio frames. There are 160 samples per audioframe.&lt;br /&gt;
&lt;br /&gt;
Feedback arm only has a gain on it. Under the feedback arm is a single-pole filter with the delay.&lt;br /&gt;
&lt;br /&gt;
=== Reverb Effect ===&lt;br /&gt;
&lt;br /&gt;
== DSP status ==&lt;br /&gt;
&lt;br /&gt;
Read only.&lt;br /&gt;
&lt;br /&gt;
== Output samples ==&lt;br /&gt;
&lt;br /&gt;
Read only.&lt;br /&gt;
&lt;br /&gt;
PCM16.&lt;br /&gt;
&lt;br /&gt;
== Intermediate mix samples ==&lt;br /&gt;
&lt;br /&gt;
Read/Write.&lt;br /&gt;
&lt;br /&gt;
PCM32. Also serves an aux function, allowing the ARM11 to apply custom effects to audio.&lt;br /&gt;
&lt;br /&gt;
== Compressor table ==&lt;br /&gt;
&lt;br /&gt;
A precomputed response curve lookup table for the compressor.&lt;/div&gt;</summary>
		<author><name>Merry</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=DSP_Memory_Region&amp;diff=15801</id>
		<title>DSP Memory Region</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=DSP_Memory_Region&amp;diff=15801"/>
		<updated>2016-02-17T19:56:32Z</updated>

		<summary type="html">&lt;p&gt;Merry: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Some of this is known to be incorrect. I&#039;ll correct this in a few months after a bit more RE work. [[User:Merry|Merry]] ([[User talk:Merry|talk]]) 21:10, 28 January 2016 (CET)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*Note that everything below will vary depending on the exact DSP firmware used and different variants have slightly different behaviours.*&lt;br /&gt;
&lt;br /&gt;
The DSP communicates with the application through two shared memory areas 0x8000 bytes long each (at 0x1FF50000 and 0x1FF70000 respectively). The DSP alternates between the use of these two areas (much like a double-buffer). Each area has 15 structures within it. The location of these structures can be obtained by [[DSP:ReadPipe|reading channel 2 of the DSP pipe]]. A list of structures in the order the DSP addresses are read from the pipe follows:&lt;br /&gt;
&lt;br /&gt;
1. Frame count&lt;br /&gt;
&lt;br /&gt;
2. Input configurations&lt;br /&gt;
&lt;br /&gt;
3. Input status&lt;br /&gt;
&lt;br /&gt;
4. Input ADPCM coefficients&lt;br /&gt;
&lt;br /&gt;
5. DSP configuration&lt;br /&gt;
&lt;br /&gt;
6. DSP status&lt;br /&gt;
&lt;br /&gt;
7. Output samples&lt;br /&gt;
&lt;br /&gt;
8. Intermediate mix samples&lt;br /&gt;
&lt;br /&gt;
9. Compressor table&lt;br /&gt;
&lt;br /&gt;
10. DSP debug statistics&lt;br /&gt;
&lt;br /&gt;
11. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
12. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
13. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
14. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
15. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
The DSP has 24 inputs, each of which are individually configurable. These 24 inputs each produce three sets of 4 audio channels (two left, two right). &lt;br /&gt;
&lt;br /&gt;
These four audio channels feed into three intermediate mixers. Two of these intermediate mixers are used for effects and aux.&lt;br /&gt;
&lt;br /&gt;
== Frame Count ==&lt;br /&gt;
&lt;br /&gt;
== Input Config ==&lt;br /&gt;
&lt;br /&gt;
A 192 byte long structure. There are 24 of them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u32&lt;br /&gt;
| Dirty flags&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| 70 bytes&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
| 74&lt;br /&gt;
| u16&lt;br /&gt;
| Bitmap of which buffers in queue are dirty&lt;br /&gt;
|-&lt;br /&gt;
| 76&lt;br /&gt;
| Buffer[4]&lt;br /&gt;
| Buffer queue&lt;br /&gt;
|-&lt;br /&gt;
| 156&lt;br /&gt;
| u32&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| 160&lt;br /&gt;
| u16&lt;br /&gt;
| Is Active&lt;br /&gt;
|-&lt;br /&gt;
| 162&lt;br /&gt;
| u16 &lt;br /&gt;
| Sync Count&lt;br /&gt;
|-&lt;br /&gt;
| 164&lt;br /&gt;
| 8&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
| 172&lt;br /&gt;
| u32&lt;br /&gt;
| Physical address of current buffer&lt;br /&gt;
|-&lt;br /&gt;
| 176&lt;br /&gt;
| u32&lt;br /&gt;
| Number of samples in current buffer&lt;br /&gt;
|-&lt;br /&gt;
| 180&lt;br /&gt;
| u16&lt;br /&gt;
| bits[0:1]: 1 = mono, 2 = stereo; bits[2:3]: buffer format, bits[5]: fade in&lt;br /&gt;
|-&lt;br /&gt;
| 182&lt;br /&gt;
| u16&lt;br /&gt;
| ADPCM predictor/scale&lt;br /&gt;
|-&lt;br /&gt;
| 184&lt;br /&gt;
| s16&lt;br /&gt;
| ADPCM y[n-1]&lt;br /&gt;
|-&lt;br /&gt;
| 186&lt;br /&gt;
| s16&lt;br /&gt;
| ADPCM y[n-2]&lt;br /&gt;
|-&lt;br /&gt;
| 188&lt;br /&gt;
| u16&lt;br /&gt;
| bit[0]: ADPCM updated?; bit[1]: Is looping?&lt;br /&gt;
|-&lt;br /&gt;
| 190&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer Id of this current buffer&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Buffer ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u32&lt;br /&gt;
| Physical Address&lt;br /&gt;
|-&lt;br /&gt;
| 4 &lt;br /&gt;
| u32&lt;br /&gt;
| Sample Count&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| u16&lt;br /&gt;
| 4 bits: ADPCM Predictor, 4 bits: ADPCM Scale&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| s16&lt;br /&gt;
| ADPCM y[n-1]&lt;br /&gt;
|-&lt;br /&gt;
| 11&lt;br /&gt;
| s16&lt;br /&gt;
| ADPCM y[n-2]&lt;br /&gt;
|-&lt;br /&gt;
| 14&lt;br /&gt;
| u8&lt;br /&gt;
| ADPCM dirty?&lt;br /&gt;
|-&lt;br /&gt;
| 15&lt;br /&gt;
| u8&lt;br /&gt;
| Looping?&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer Id&lt;br /&gt;
|-&lt;br /&gt;
| 18&lt;br /&gt;
| u16&lt;br /&gt;
| -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Simple Filter ===&lt;br /&gt;
&lt;br /&gt;
This is a standard single-pole filter. The fall-off is 6dB per octave as you would expect.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s16&lt;br /&gt;
| b0&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s16&lt;br /&gt;
| a1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Input status ==&lt;br /&gt;
&lt;br /&gt;
Read only.&lt;br /&gt;
&lt;br /&gt;
== Input ADPCM coefficients ==&lt;br /&gt;
&lt;br /&gt;
== DSP configuration ==&lt;br /&gt;
&lt;br /&gt;
=== Delay Effect ===&lt;br /&gt;
&lt;br /&gt;
Delay with feedback.&lt;br /&gt;
&lt;br /&gt;
Length of delay is a multiple of audio frames. There are 160 samples per audioframe.&lt;br /&gt;
&lt;br /&gt;
Feedback arm only has a gain on it. Under the feedback arm is a single-pole filter with the delay.&lt;br /&gt;
&lt;br /&gt;
=== Reverb Effect ===&lt;br /&gt;
&lt;br /&gt;
== DSP status ==&lt;br /&gt;
&lt;br /&gt;
Read only.&lt;br /&gt;
&lt;br /&gt;
== Output samples ==&lt;br /&gt;
&lt;br /&gt;
Read only.&lt;br /&gt;
&lt;br /&gt;
PCM16.&lt;br /&gt;
&lt;br /&gt;
== Intermediate mix samples ==&lt;br /&gt;
&lt;br /&gt;
Read/Write.&lt;br /&gt;
&lt;br /&gt;
PCM32. Also serves an aux function, allowing the ARM11 to apply custom effects to audio.&lt;br /&gt;
&lt;br /&gt;
== Compressor table ==&lt;br /&gt;
&lt;br /&gt;
A precomputed response curve lookup table for the compressor.&lt;/div&gt;</summary>
		<author><name>Merry</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=DSP_Memory_Region&amp;diff=15795</id>
		<title>DSP Memory Region</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=DSP_Memory_Region&amp;diff=15795"/>
		<updated>2016-02-17T09:12:05Z</updated>

		<summary type="html">&lt;p&gt;Merry: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Some of this is known to be incorrect. I&#039;ll correct this in a few months after a bit more RE work. [[User:Merry|Merry]] ([[User talk:Merry|talk]]) 21:10, 28 January 2016 (CET)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*Note that everything below will vary depending on the exact DSP firmware used and different variants have slightly different behaviours.*&lt;br /&gt;
&lt;br /&gt;
The DSP communicates with the application through two shared memory areas 0x8000 bytes long each (at 0x1FF50000 and 0x1FF70000 respectively). The DSP alternates between the use of these two areas (much like a double-buffer). Each area has 15 structures within it. The location of these structures can be obtained by [[DSP:ReadPipe|reading channel 2 of the DSP pipe]]. A list of structures in the order the DSP addresses are read from the pipe follows:&lt;br /&gt;
&lt;br /&gt;
1. Frame count&lt;br /&gt;
&lt;br /&gt;
2. Input configurations&lt;br /&gt;
&lt;br /&gt;
3. Input status&lt;br /&gt;
&lt;br /&gt;
4. Input ADPCM coefficients&lt;br /&gt;
&lt;br /&gt;
5. DSP configuration&lt;br /&gt;
&lt;br /&gt;
6. DSP status&lt;br /&gt;
&lt;br /&gt;
7. Output samples&lt;br /&gt;
&lt;br /&gt;
8. Intermediate mix samples&lt;br /&gt;
&lt;br /&gt;
9. Compressor table&lt;br /&gt;
&lt;br /&gt;
10. DSP debug statistics&lt;br /&gt;
&lt;br /&gt;
11. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
12. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
13. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
14. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
15. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
The DSP has 24 inputs, each of which are individually configurable. These 24 inputs each produce three sets of 4 audio channels (two left, two right). &lt;br /&gt;
&lt;br /&gt;
These four audio channels feed into three intermediate mixers. Two of these intermediate mixers are used for effects and aux.&lt;br /&gt;
&lt;br /&gt;
== Channel Config ==&lt;br /&gt;
&lt;br /&gt;
A 192 byte long structure. There are 24 of them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u32&lt;br /&gt;
| Dirty flags&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| 70 bytes&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
| 74&lt;br /&gt;
| u16&lt;br /&gt;
| Bitmap of which buffers in queue are dirty&lt;br /&gt;
|-&lt;br /&gt;
| 76&lt;br /&gt;
| Buffer[4]&lt;br /&gt;
| Buffer queue&lt;br /&gt;
|-&lt;br /&gt;
| 156&lt;br /&gt;
| u32&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| 160&lt;br /&gt;
| u16&lt;br /&gt;
| Is Active&lt;br /&gt;
|-&lt;br /&gt;
| 162&lt;br /&gt;
| u16 &lt;br /&gt;
| Sync Count&lt;br /&gt;
|-&lt;br /&gt;
| 164&lt;br /&gt;
| 8&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
| 172&lt;br /&gt;
| u32&lt;br /&gt;
| Physical address of current buffer&lt;br /&gt;
|-&lt;br /&gt;
| 176&lt;br /&gt;
| u32&lt;br /&gt;
| Number of samples in current buffer&lt;br /&gt;
|-&lt;br /&gt;
| 180&lt;br /&gt;
| u16&lt;br /&gt;
| bits[0:1]: 1 = mono, 2 = stereo; bits[2:3]: buffer format&lt;br /&gt;
|-&lt;br /&gt;
| 182&lt;br /&gt;
| u16&lt;br /&gt;
| ADPCM predictor&lt;br /&gt;
|-&lt;br /&gt;
| 184&lt;br /&gt;
| s16&lt;br /&gt;
| ADPCM yn1&lt;br /&gt;
|-&lt;br /&gt;
| 186&lt;br /&gt;
| s16&lt;br /&gt;
| ADPCM yn2&lt;br /&gt;
|-&lt;br /&gt;
| 188&lt;br /&gt;
| u16&lt;br /&gt;
| bit[0]: Has ADPCM data?; bit[1]: Is looping?&lt;br /&gt;
|-&lt;br /&gt;
| 190&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer Id of this current buffer&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Buffer ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u32&lt;br /&gt;
| Physical Address&lt;br /&gt;
|-&lt;br /&gt;
| 4 &lt;br /&gt;
| u32&lt;br /&gt;
| Sample Count&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| u16&lt;br /&gt;
| ADPCM P/S&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| s16[2]&lt;br /&gt;
| ADPCM yn[1,2]&lt;br /&gt;
|-&lt;br /&gt;
| 14&lt;br /&gt;
| u8&lt;br /&gt;
| Has ADPCM?&lt;br /&gt;
|-&lt;br /&gt;
| 15&lt;br /&gt;
| u8&lt;br /&gt;
| Looping?&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer Id&lt;br /&gt;
|-&lt;br /&gt;
| 18&lt;br /&gt;
| u16&lt;br /&gt;
| -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Simple Filter Configuration ===&lt;br /&gt;
&lt;br /&gt;
This is a standard single-pole filter. The fall-off is 6dB per octave as you would expect.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s16&lt;br /&gt;
| b0&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s16&lt;br /&gt;
| a1&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Merry</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=DSP_Memory_Region&amp;diff=15791</id>
		<title>DSP Memory Region</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=DSP_Memory_Region&amp;diff=15791"/>
		<updated>2016-02-16T22:08:05Z</updated>

		<summary type="html">&lt;p&gt;Merry: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Some of this is known to be incorrect. I&#039;ll correct this in a few months after a bit more RE work. [[User:Merry|Merry]] ([[User talk:Merry|talk]]) 21:10, 28 January 2016 (CET)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*Note that everything below will vary depending on the exact DSP firmware used and different variants have slightly different behaviours.*&lt;br /&gt;
&lt;br /&gt;
The DSP communicates with the application through two shared memory areas 0x8000 bytes long each (at 0x1FF50000 and 0x1FF70000 respectively). The DSP alternates between the use of these two areas (much like a double-buffer). Each area has 15 structures within it. The location of these structures can be obtained by [[DSP:ReadPipe|reading channel 2 of the DSP pipe]]. A list of structures in the order the DSP addresses are read from the pipe follows:&lt;br /&gt;
&lt;br /&gt;
1. Frame count&lt;br /&gt;
&lt;br /&gt;
2. Input configurations&lt;br /&gt;
&lt;br /&gt;
3. Input status&lt;br /&gt;
&lt;br /&gt;
4. Input ADPCM coefficients&lt;br /&gt;
&lt;br /&gt;
5. DSP configuration&lt;br /&gt;
&lt;br /&gt;
6. DSP status&lt;br /&gt;
&lt;br /&gt;
7. Output samples&lt;br /&gt;
&lt;br /&gt;
8. Intermediate mix samples&lt;br /&gt;
&lt;br /&gt;
9. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
10. DSP debug statistics&lt;br /&gt;
&lt;br /&gt;
11. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
12. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
13. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
14. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
15. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
The DSP has 24 inputs, each of which are individually configurable. These 24 inputs each produce three sets of 4 audio channels (two left, two right). &lt;br /&gt;
&lt;br /&gt;
These four audio channels feed into three intermediate mixers. Two of these intermediate mixers are used for effects and aux.&lt;br /&gt;
&lt;br /&gt;
== Channel Config ==&lt;br /&gt;
&lt;br /&gt;
A 192 byte long structure. There are 24 of them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u32&lt;br /&gt;
| Dirty flags&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| 70 bytes&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
| 74&lt;br /&gt;
| u16&lt;br /&gt;
| Bitmap of which buffers in queue are dirty&lt;br /&gt;
|-&lt;br /&gt;
| 76&lt;br /&gt;
| Buffer[4]&lt;br /&gt;
| Buffer queue&lt;br /&gt;
|-&lt;br /&gt;
| 156&lt;br /&gt;
| u32&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| 160&lt;br /&gt;
| u16&lt;br /&gt;
| Is Active&lt;br /&gt;
|-&lt;br /&gt;
| 162&lt;br /&gt;
| u16 &lt;br /&gt;
| Sync Count&lt;br /&gt;
|-&lt;br /&gt;
| 164&lt;br /&gt;
| 8&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
| 172&lt;br /&gt;
| u32&lt;br /&gt;
| Physical address of current buffer&lt;br /&gt;
|-&lt;br /&gt;
| 176&lt;br /&gt;
| u32&lt;br /&gt;
| Number of samples in current buffer&lt;br /&gt;
|-&lt;br /&gt;
| 180&lt;br /&gt;
| u16&lt;br /&gt;
| bits[0:1]: 1 = mono, 2 = stereo; bits[2:3]: buffer format&lt;br /&gt;
|-&lt;br /&gt;
| 182&lt;br /&gt;
| u16&lt;br /&gt;
| ADPCM predictor&lt;br /&gt;
|-&lt;br /&gt;
| 184&lt;br /&gt;
| s16&lt;br /&gt;
| ADPCM yn1&lt;br /&gt;
|-&lt;br /&gt;
| 186&lt;br /&gt;
| s16&lt;br /&gt;
| ADPCM yn2&lt;br /&gt;
|-&lt;br /&gt;
| 188&lt;br /&gt;
| u16&lt;br /&gt;
| bit[0]: Has ADPCM data?; bit[1]: Is looping?&lt;br /&gt;
|-&lt;br /&gt;
| 190&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer Id of this current buffer&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Buffer ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u32&lt;br /&gt;
| Physical Address&lt;br /&gt;
|-&lt;br /&gt;
| 4 &lt;br /&gt;
| u32&lt;br /&gt;
| Sample Count&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| u16&lt;br /&gt;
| ADPCM P/S&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| s16[2]&lt;br /&gt;
| ADPCM yn[1,2]&lt;br /&gt;
|-&lt;br /&gt;
| 14&lt;br /&gt;
| u8&lt;br /&gt;
| Has ADPCM?&lt;br /&gt;
|-&lt;br /&gt;
| 15&lt;br /&gt;
| u8&lt;br /&gt;
| Looping?&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer Id&lt;br /&gt;
|-&lt;br /&gt;
| 18&lt;br /&gt;
| u16&lt;br /&gt;
| -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Simple Filter Configuration ===&lt;br /&gt;
&lt;br /&gt;
This is a standard single-pole filter. The fall-off is 6dB per octave as you would expect.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s16&lt;br /&gt;
| b0&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s16&lt;br /&gt;
| a1&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Merry</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=DSP_Memory_Region&amp;diff=15790</id>
		<title>DSP Memory Region</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=DSP_Memory_Region&amp;diff=15790"/>
		<updated>2016-02-16T22:07:17Z</updated>

		<summary type="html">&lt;p&gt;Merry: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Some of this is known to be incorrect. I&#039;ll correct this in a few months after a bit more RE work. [[User:Merry|Merry]] ([[User talk:Merry|talk]]) 21:10, 28 January 2016 (CET)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*Note that everything below will vary depending on the exact DSP firmware used and different variants have slightly different behaviours.*&lt;br /&gt;
&lt;br /&gt;
The DSP communicates with the application through two shared memory areas 0x8000 bytes long each (at 0x1FF50000 and 0x1FF70000 respectively). The DSP alternates between the use of these two areas (much like a double-buffer). Each area has 15 structures within it. The location of these structures can be obtained by [[DSP:ReadPipe|reading channel 2 of the DSP pipe]]. A list of structures in the order the DSP addresses are read from the pipe follows:&lt;br /&gt;
&lt;br /&gt;
1. Frame count&lt;br /&gt;
2. Input configurations&lt;br /&gt;
3. Input status&lt;br /&gt;
4. Input ADPCM coefficients&lt;br /&gt;
5. DSP configuration&lt;br /&gt;
6. DSP status&lt;br /&gt;
7. Output samples&lt;br /&gt;
8. Intermediate mix samples&lt;br /&gt;
9. Unknown Coefficients&lt;br /&gt;
10. DSP debug statistics&lt;br /&gt;
11. Unknown Coefficients&lt;br /&gt;
12. Unknown Coefficients&lt;br /&gt;
13. Unknown Coefficients&lt;br /&gt;
14. Unknown Coefficients&lt;br /&gt;
15. Unknown Coefficients&lt;br /&gt;
&lt;br /&gt;
The DSP has 24 inputs, each of which are individually configurable. These 24 inputs each produce three sets of 4 audio channels (two left, two right). &lt;br /&gt;
&lt;br /&gt;
These four audio channels feed into three intermediate mixers. Two of these intermediate mixers are used for effects and aux.&lt;br /&gt;
&lt;br /&gt;
== Channel Config ==&lt;br /&gt;
&lt;br /&gt;
A 192 byte long structure. There are 24 of them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u32&lt;br /&gt;
| Dirty flags&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| 70 bytes&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
| 74&lt;br /&gt;
| u16&lt;br /&gt;
| Bitmap of which buffers in queue are dirty&lt;br /&gt;
|-&lt;br /&gt;
| 76&lt;br /&gt;
| Buffer[4]&lt;br /&gt;
| Buffer queue&lt;br /&gt;
|-&lt;br /&gt;
| 156&lt;br /&gt;
| u32&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| 160&lt;br /&gt;
| u16&lt;br /&gt;
| Is Active&lt;br /&gt;
|-&lt;br /&gt;
| 162&lt;br /&gt;
| u16 &lt;br /&gt;
| Sync Count&lt;br /&gt;
|-&lt;br /&gt;
| 164&lt;br /&gt;
| 8&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
| 172&lt;br /&gt;
| u32&lt;br /&gt;
| Physical address of current buffer&lt;br /&gt;
|-&lt;br /&gt;
| 176&lt;br /&gt;
| u32&lt;br /&gt;
| Number of samples in current buffer&lt;br /&gt;
|-&lt;br /&gt;
| 180&lt;br /&gt;
| u16&lt;br /&gt;
| bits[0:1]: 1 = mono, 2 = stereo; bits[2:3]: buffer format&lt;br /&gt;
|-&lt;br /&gt;
| 182&lt;br /&gt;
| u16&lt;br /&gt;
| ADPCM predictor&lt;br /&gt;
|-&lt;br /&gt;
| 184&lt;br /&gt;
| s16&lt;br /&gt;
| ADPCM yn1&lt;br /&gt;
|-&lt;br /&gt;
| 186&lt;br /&gt;
| s16&lt;br /&gt;
| ADPCM yn2&lt;br /&gt;
|-&lt;br /&gt;
| 188&lt;br /&gt;
| u16&lt;br /&gt;
| bit[0]: Has ADPCM data?; bit[1]: Is looping?&lt;br /&gt;
|-&lt;br /&gt;
| 190&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer Id of this current buffer&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Buffer ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u32&lt;br /&gt;
| Physical Address&lt;br /&gt;
|-&lt;br /&gt;
| 4 &lt;br /&gt;
| u32&lt;br /&gt;
| Sample Count&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| u16&lt;br /&gt;
| ADPCM P/S&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| s16[2]&lt;br /&gt;
| ADPCM yn[1,2]&lt;br /&gt;
|-&lt;br /&gt;
| 14&lt;br /&gt;
| u8&lt;br /&gt;
| Has ADPCM?&lt;br /&gt;
|-&lt;br /&gt;
| 15&lt;br /&gt;
| u8&lt;br /&gt;
| Looping?&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer Id&lt;br /&gt;
|-&lt;br /&gt;
| 18&lt;br /&gt;
| u16&lt;br /&gt;
| -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Simple Filter Configuration ===&lt;br /&gt;
&lt;br /&gt;
This is a standard single-pole filter. The fall-off is 6dB per octave as you would expect.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s16&lt;br /&gt;
| b0&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| s16&lt;br /&gt;
| a1&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Merry</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=Services_API&amp;diff=15789</id>
		<title>Services API</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=Services_API&amp;diff=15789"/>
		<updated>2016-02-16T18:54:20Z</updated>

		<summary type="html">&lt;p&gt;Merry: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Nintendo provides application developers with an API, which communicate with certain services. Services, in this sense, are [[Title_list#00040130_-_System_Modules|system processes running in the background]] which wait for incoming requests. When a process wants to communicate with a service, it first needs to get a handle to the named service, and then it can communicate with the service via interprocess communication. Each service has a name up to 8 characters, for example &amp;quot;nim:u&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Handles for services are retrieved from the [[Services|service manager port]], &amp;quot;srv:&amp;quot;. Services are an abstraction of ports, they operate the same way except regular ports can have their handles retrieved directly from a SVC.&lt;br /&gt;
&lt;br /&gt;
For a description of how commands and arguments are passed to services, see [[IPC Command Structure]].&lt;br /&gt;
&lt;br /&gt;
List of services (grouped by the process which provides them):&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Old3ds&lt;br /&gt;
!  Services&lt;br /&gt;
!  Service names&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;200&amp;quot; |  Notes&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[Filesystem services‎]]&lt;br /&gt;
| fs:USER, fs:LDR, fs:REG&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[Process Services‎]]&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[PXI Services‎]]&lt;br /&gt;
| PxiFS0, PxiFS1, PxiFSB, PxiFSR, PxiPM, pxi:am9, pxi:dev, pxi:mc, pxi:ps9&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[Application Manager Services]]&lt;br /&gt;
| am:app, am:net, am:u, am:sys, am:pipe&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[Process Manager Services]]&lt;br /&gt;
| pm:app, pm:dbg&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[NIM Services]]&lt;br /&gt;
| nim:aoc, nim:ndm, nim:s, nim:u&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[Config Services]]&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[NS|NS and APT Services]]&lt;br /&gt;
| ns:s, ns:p, ns:c, APT:A, APT:S, APT:U&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[RO Services]]&lt;br /&gt;
| ldr:ro&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[NDM Services]]&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[CSND Services]]&lt;br /&gt;
| csnd:SND&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[Camera Services]]&lt;br /&gt;
| cam:u, y2r:u, cam:s, cam:c, cam:q (New3DS only)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[Codec Services]]&lt;br /&gt;
| cdc:HID, cdc:MIC, cdc:CSN, cdc:DSP, cdc:LGY, cdc:CHK&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[DLP Services]]&lt;br /&gt;
| dlp:CLNT, dlp:FKCL, dlp:SRVR&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[DSP Services]]&lt;br /&gt;
| dsp::DSP&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[GSP Services]]&lt;br /&gt;
| gsp::Lcd, gsp::Gpu&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[BOSS Services]]&lt;br /&gt;
| boss:U&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[CECD Services]]&lt;br /&gt;
| cecd:u, cecd:s&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[IR Services]]&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[I2C Services]]&lt;br /&gt;
| i2c::MCU, i2c::CAM, i2c::LCD, i2c::DEB, i2c::HID, i2c::IR, i2c::EEP&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[GPIO Services]]&lt;br /&gt;
| gpio:CDC, gpio:MCU, gpio:HID, gpio:NWM, gpio:IR&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[HID Services]]&lt;br /&gt;
| hid:NFC, hid:QTM, hid:SPVR, hid:USER &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[PTM Services]]&lt;br /&gt;
| ptm:gets, ptm:play, ptm:s, ptm:sets, ptm:sysm, ptm:u&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[NWM Services]]&lt;br /&gt;
| nwm::UDS&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[HTTP Services]]&lt;br /&gt;
| http:C&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[SSL Services]]&lt;br /&gt;
| ssl:C&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[Socket Services]]&lt;br /&gt;
| soc:P, soc:U&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[AC Services]]&lt;br /&gt;
| ac:i, ac:u&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[Friend Services]]&lt;br /&gt;
| frd:a, frd:u&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[News Services]]&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[PDN Services]]&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[SPI Services]]&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[Loader Services]]&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[MCU Services]]&lt;br /&gt;
| mcu::CAM, mcu::GPU, mcu::HID, mcu::RTC, mcu::SND, mcu::NWM, mcu::HWC, mcu::PLS, mcu::CDC&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[MIC Services]]&lt;br /&gt;
| mic:u&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: green&amp;quot; | Yes&lt;br /&gt;
| [[ACT Services]]&lt;br /&gt;
| act:a, act:u&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| [[NFC Services]]&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| [[MVD Services]]&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: red&amp;quot; | No&lt;br /&gt;
| [[QTM Services]]&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
List of PXI services:&lt;br /&gt;
* [[Filesystem services PXI]]&lt;br /&gt;
* [[Process Services PXI]]&lt;br /&gt;
* [[Application Manager Services PXI]]&lt;br /&gt;
* [[Process Manager Services PXI]]&lt;br /&gt;
* [[Development Services PXI]]&lt;br /&gt;
* [[Gamecard Services PXI]]&lt;br /&gt;
* [[Legacy FIRM PXI]] (TWL_FIRM/AGB_FIRM)&lt;br /&gt;
&lt;br /&gt;
List of ports:&lt;br /&gt;
* [[ErrDisp]]&lt;br /&gt;
* [[Services]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
See [[Error codes]].&lt;/div&gt;</summary>
		<author><name>Merry</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=DSP_Memory_Region&amp;diff=15788</id>
		<title>DSP Memory Region</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=DSP_Memory_Region&amp;diff=15788"/>
		<updated>2016-02-16T14:47:02Z</updated>

		<summary type="html">&lt;p&gt;Merry: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Some of this is known to be incorrect. I&#039;ll correct this in a few months after a bit more RE work. [[User:Merry|Merry]] ([[User talk:Merry|talk]]) 21:10, 28 January 2016 (CET)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The DSP communicates with userland through memory locations 0x1ff40000-0x1ff77fff. Within this region are two areas of structures that are exact duplicates of each other. The DSP alternates between the use of these two areas (much like a double-buffer). Each area has 15 structures within it. The location of these structures can be obtained by [[DSP:ReadPipe|reading channel 2 of the DSP pipe]].&lt;br /&gt;
&lt;br /&gt;
The mixer has 24 channels, each of which are individually configurable.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Structure Number&lt;br /&gt;
| DSP memory address&lt;br /&gt;
| Size&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| 0x8400&lt;br /&gt;
| 0x20&lt;br /&gt;
| Status (?)&lt;br /&gt;
|-&lt;br /&gt;
| 9&lt;br /&gt;
| 0x8410&lt;br /&gt;
| 0x260&lt;br /&gt;
| Debug (?)&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| 0x8540&lt;br /&gt;
| 0x280&lt;br /&gt;
| Loopback Samples (PCM16)&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 0x8680&lt;br /&gt;
| 0x120&lt;br /&gt;
| Channel Status (x24)&lt;br /&gt;
|-&lt;br /&gt;
| 8 &lt;br /&gt;
| 0x9710&lt;br /&gt;
| 0x1A40&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| 0x9430&lt;br /&gt;
| 0xC4&lt;br /&gt;
| Main Configuration&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| 0x9492&lt;br /&gt;
| 0x1400&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0x9e92&lt;br /&gt;
| 0x1200&lt;br /&gt;
| Channel Config (x24)&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 0x9430&lt;br /&gt;
| 0x300&lt;br /&gt;
| GC-ADPCM Coefficients (x24)&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| 0xa912&lt;br /&gt;
| 0x200&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 11&lt;br /&gt;
| 0xaa12&lt;br /&gt;
| 0x180&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 12&lt;br /&gt;
| 0xaad2&lt;br /&gt;
| 0x300&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 13&lt;br /&gt;
| 0xac52&lt;br /&gt;
| 0x14&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 14&lt;br /&gt;
| 0xac5c&lt;br /&gt;
| 0x2476&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 0xbfff&lt;br /&gt;
| 0x2&lt;br /&gt;
| Frame Counter&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Channel Config ==&lt;br /&gt;
&lt;br /&gt;
A 192 byte long structure. There are 24 of them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u32&lt;br /&gt;
| Dirty flags&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| 70 bytes&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
| 74&lt;br /&gt;
| u16&lt;br /&gt;
| Bitmap of which buffers in queue are dirty&lt;br /&gt;
|-&lt;br /&gt;
| 76&lt;br /&gt;
| Buffer[4]&lt;br /&gt;
| Buffer queue&lt;br /&gt;
|-&lt;br /&gt;
| 156&lt;br /&gt;
| u32&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| 160&lt;br /&gt;
| u16&lt;br /&gt;
| Is Active&lt;br /&gt;
|-&lt;br /&gt;
| 162&lt;br /&gt;
| u16 &lt;br /&gt;
| Sync Count&lt;br /&gt;
|-&lt;br /&gt;
| 164&lt;br /&gt;
| 8&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
| 172&lt;br /&gt;
| u32&lt;br /&gt;
| Physical address of current buffer&lt;br /&gt;
|-&lt;br /&gt;
| 176&lt;br /&gt;
| u32&lt;br /&gt;
| Number of samples in current buffer&lt;br /&gt;
|-&lt;br /&gt;
| 180&lt;br /&gt;
| u16&lt;br /&gt;
| bits[0:1]: 1 = mono, 2 = stereo; bits[2:3]: buffer format&lt;br /&gt;
|-&lt;br /&gt;
| 182&lt;br /&gt;
| u16&lt;br /&gt;
| ADPCM predictor&lt;br /&gt;
|-&lt;br /&gt;
| 184&lt;br /&gt;
| s16&lt;br /&gt;
| ADPCM yn1&lt;br /&gt;
|-&lt;br /&gt;
| 186&lt;br /&gt;
| s16&lt;br /&gt;
| ADPCM yn2&lt;br /&gt;
|-&lt;br /&gt;
| 188&lt;br /&gt;
| u16&lt;br /&gt;
| bit[0]: Has ADPCM data?; bit[1]: Is looping?&lt;br /&gt;
|-&lt;br /&gt;
| 190&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer Id of this current buffer&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Buffer ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u32&lt;br /&gt;
| Physical Address&lt;br /&gt;
|-&lt;br /&gt;
| 4 &lt;br /&gt;
| u32&lt;br /&gt;
| Sample Count&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| u16&lt;br /&gt;
| ADPCM P/S&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| s16[2]&lt;br /&gt;
| ADPCM yn[1,2]&lt;br /&gt;
|-&lt;br /&gt;
| 14&lt;br /&gt;
| u8&lt;br /&gt;
| Has ADPCM?&lt;br /&gt;
|-&lt;br /&gt;
| 15&lt;br /&gt;
| u8&lt;br /&gt;
| Looping?&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer Id&lt;br /&gt;
|-&lt;br /&gt;
| 18&lt;br /&gt;
| u16&lt;br /&gt;
| -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Dirty Bits ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Bit&lt;br /&gt;
| What Changed&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| ADPCM Coefficients&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| Embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 13&lt;br /&gt;
| Is Active&lt;br /&gt;
|-&lt;br /&gt;
| 18&lt;br /&gt;
| Interpolation Type&lt;br /&gt;
|-&lt;br /&gt;
| 19&lt;br /&gt;
| Rate&lt;br /&gt;
|-&lt;br /&gt;
| 20&lt;br /&gt;
| Buffer Queue&lt;br /&gt;
|-&lt;br /&gt;
| 22&lt;br /&gt;
| Embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 23&lt;br /&gt;
| IRR Filter Type&lt;br /&gt;
|-&lt;br /&gt;
| 25&lt;br /&gt;
| Sync Count&lt;br /&gt;
|-&lt;br /&gt;
| 26-28&lt;br /&gt;
| Mix&lt;br /&gt;
|-&lt;br /&gt;
| 30&lt;br /&gt;
| First time init&lt;br /&gt;
|-&lt;br /&gt;
| 31&lt;br /&gt;
| Embedded Buffer&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Merry</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=DSP_Memory_Region&amp;diff=15678</id>
		<title>DSP Memory Region</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=DSP_Memory_Region&amp;diff=15678"/>
		<updated>2016-01-28T19:10:17Z</updated>

		<summary type="html">&lt;p&gt;Merry: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Some of this is known to be incorrect. I&#039;ll correct this in a few months after a bit more RE work. [[User:Merry|Merry]] ([[User talk:Merry|talk]]) 21:10, 28 January 2016 (CET)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The DSP communicates with userland through memory locations 0x1ff40000-0x1ff77fff. Within this region are two areas of structures that are exact duplicates of each other. The DSP alternates between the use of these two areas (much like a double-buffer). Each area has 15 structures within it. The location of these structures can be obtained by reading pipe 2.&lt;br /&gt;
&lt;br /&gt;
The mixer has 24 channels, each of which are individually configurable.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Structure Number&lt;br /&gt;
| DSP memory address&lt;br /&gt;
| Size&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| 0x8400&lt;br /&gt;
| 0x20&lt;br /&gt;
| Status (?)&lt;br /&gt;
|-&lt;br /&gt;
| 9&lt;br /&gt;
| 0x8410&lt;br /&gt;
| 0x260&lt;br /&gt;
| Debug (?)&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| 0x8540&lt;br /&gt;
| 0x280&lt;br /&gt;
| Loopback Samples (PCM16)&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 0x8680&lt;br /&gt;
| 0x120&lt;br /&gt;
| Channel Status (x24)&lt;br /&gt;
|-&lt;br /&gt;
| 8 &lt;br /&gt;
| 0x9710&lt;br /&gt;
| 0x1A40&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| 0x9430&lt;br /&gt;
| 0xC4&lt;br /&gt;
| Main Configuration&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| 0x9492&lt;br /&gt;
| 0x1400&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0x9e92&lt;br /&gt;
| 0x1200&lt;br /&gt;
| Channel Config (x24)&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 0x9430&lt;br /&gt;
| 0x300&lt;br /&gt;
| GC-ADPCM Coefficients (x24)&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| 0xa912&lt;br /&gt;
| 0x200&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 11&lt;br /&gt;
| 0xaa12&lt;br /&gt;
| 0x180&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 12&lt;br /&gt;
| 0xaad2&lt;br /&gt;
| 0x300&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 13&lt;br /&gt;
| 0xac52&lt;br /&gt;
| 0x14&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 14&lt;br /&gt;
| 0xac5c&lt;br /&gt;
| 0x2476&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 0xbfff&lt;br /&gt;
| 0x2&lt;br /&gt;
| Frame Counter&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Channel Config ==&lt;br /&gt;
&lt;br /&gt;
A 192 byte long structure. There are 24 of them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u32&lt;br /&gt;
| Dirty flags&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| 70 bytes&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
| 74&lt;br /&gt;
| u16&lt;br /&gt;
| Bitmap of which buffers in queue are dirty&lt;br /&gt;
|-&lt;br /&gt;
| 76&lt;br /&gt;
| Buffer[4]&lt;br /&gt;
| Buffer queue&lt;br /&gt;
|-&lt;br /&gt;
| 156&lt;br /&gt;
| u32&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| 160&lt;br /&gt;
| u16&lt;br /&gt;
| Is Active&lt;br /&gt;
|-&lt;br /&gt;
| 162&lt;br /&gt;
| u16 &lt;br /&gt;
| Sync Count&lt;br /&gt;
|-&lt;br /&gt;
| 164&lt;br /&gt;
| 8&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
| 172&lt;br /&gt;
| u32&lt;br /&gt;
| Physical address of current buffer&lt;br /&gt;
|-&lt;br /&gt;
| 176&lt;br /&gt;
| u32&lt;br /&gt;
| Number of samples in current buffer&lt;br /&gt;
|-&lt;br /&gt;
| 180&lt;br /&gt;
| u16&lt;br /&gt;
| bits[0:1]: 1 = mono, 2 = stereo; bits[2:3]: buffer format&lt;br /&gt;
|-&lt;br /&gt;
| 182&lt;br /&gt;
| u16&lt;br /&gt;
| ADPCM predictor&lt;br /&gt;
|-&lt;br /&gt;
| 184&lt;br /&gt;
| s16&lt;br /&gt;
| ADPCM yn1&lt;br /&gt;
|-&lt;br /&gt;
| 186&lt;br /&gt;
| s16&lt;br /&gt;
| ADPCM yn2&lt;br /&gt;
|-&lt;br /&gt;
| 188&lt;br /&gt;
| u16&lt;br /&gt;
| bit[0]: Has ADPCM data?; bit[1]: Is looping?&lt;br /&gt;
|-&lt;br /&gt;
| 190&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer Id of this current buffer&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Buffer ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u32&lt;br /&gt;
| Physical Address&lt;br /&gt;
|-&lt;br /&gt;
| 4 &lt;br /&gt;
| u32&lt;br /&gt;
| Sample Count&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| u16&lt;br /&gt;
| ADPCM P/S&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| s16[2]&lt;br /&gt;
| ADPCM yn[1,2]&lt;br /&gt;
|-&lt;br /&gt;
| 14&lt;br /&gt;
| u8&lt;br /&gt;
| Has ADPCM?&lt;br /&gt;
|-&lt;br /&gt;
| 15&lt;br /&gt;
| u8&lt;br /&gt;
| Looping?&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer Id&lt;br /&gt;
|-&lt;br /&gt;
| 18&lt;br /&gt;
| u16&lt;br /&gt;
| -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Dirty Bits ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Bit&lt;br /&gt;
| What Changed&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| ADPCM Coefficients&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| Embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 13&lt;br /&gt;
| Is Active&lt;br /&gt;
|-&lt;br /&gt;
| 18&lt;br /&gt;
| Interpolation Type&lt;br /&gt;
|-&lt;br /&gt;
| 19&lt;br /&gt;
| Rate&lt;br /&gt;
|-&lt;br /&gt;
| 20&lt;br /&gt;
| Buffer Queue&lt;br /&gt;
|-&lt;br /&gt;
| 22&lt;br /&gt;
| Embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 23&lt;br /&gt;
| IRR Filter Type&lt;br /&gt;
|-&lt;br /&gt;
| 25&lt;br /&gt;
| Sync Count&lt;br /&gt;
|-&lt;br /&gt;
| 26-28&lt;br /&gt;
| Mix&lt;br /&gt;
|-&lt;br /&gt;
| 30&lt;br /&gt;
| First time init&lt;br /&gt;
|-&lt;br /&gt;
| 31&lt;br /&gt;
| Embedded Buffer&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Merry</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=DSP_Memory_Region&amp;diff=15596</id>
		<title>DSP Memory Region</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=DSP_Memory_Region&amp;diff=15596"/>
		<updated>2016-01-23T20:54:18Z</updated>

		<summary type="html">&lt;p&gt;Merry: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The DSP communicates with userland through memory locations 0x1ff40000-0x1ff77fff. Within this region are two areas of structures that are exact duplicates of each other. The DSP alternates between the use of these two areas (much like a double-buffer). Each area has 15 structures within it. The location of these structures can be obtained by reading pipe 2.&lt;br /&gt;
&lt;br /&gt;
The mixer has 24 channels, each of which are individually configurable.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Structure Number&lt;br /&gt;
| DSP memory address&lt;br /&gt;
| Size&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| 0x8400&lt;br /&gt;
| 0x20&lt;br /&gt;
| Status (?)&lt;br /&gt;
|-&lt;br /&gt;
| 9&lt;br /&gt;
| 0x8410&lt;br /&gt;
| 0x260&lt;br /&gt;
| Debug (?)&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| 0x8540&lt;br /&gt;
| 0x280&lt;br /&gt;
| Loopback Samples (PCM16)&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 0x8680&lt;br /&gt;
| 0x120&lt;br /&gt;
| Channel Status (x24)&lt;br /&gt;
|-&lt;br /&gt;
| 8 &lt;br /&gt;
| 0x9710&lt;br /&gt;
| 0x1A40&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| 0x9430&lt;br /&gt;
| 0xC4&lt;br /&gt;
| Main Configuration&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| 0x9492&lt;br /&gt;
| 0x1400&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0x9e92&lt;br /&gt;
| 0x1200&lt;br /&gt;
| Channel Config (x24)&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 0x9430&lt;br /&gt;
| 0x300&lt;br /&gt;
| GC-ADPCM Coefficients (x24)&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| 0xa912&lt;br /&gt;
| 0x200&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 11&lt;br /&gt;
| 0xaa12&lt;br /&gt;
| 0x180&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 12&lt;br /&gt;
| 0xaad2&lt;br /&gt;
| 0x300&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 13&lt;br /&gt;
| 0xac52&lt;br /&gt;
| 0x14&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 14&lt;br /&gt;
| 0xac5c&lt;br /&gt;
| 0x2476&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 0xbfff&lt;br /&gt;
| 0x2&lt;br /&gt;
| Frame Counter&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Channel Config ==&lt;br /&gt;
&lt;br /&gt;
A 192 byte long structure. There are 24 of them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u32&lt;br /&gt;
| Dirty flags&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| 70 bytes&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
| 74&lt;br /&gt;
| u16&lt;br /&gt;
| Bitmap of which buffers in queue are dirty&lt;br /&gt;
|-&lt;br /&gt;
| 76&lt;br /&gt;
| Buffer[4]&lt;br /&gt;
| Buffer queue&lt;br /&gt;
|-&lt;br /&gt;
| 156&lt;br /&gt;
| u32&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| 160&lt;br /&gt;
| u16&lt;br /&gt;
| Is Active&lt;br /&gt;
|-&lt;br /&gt;
| 162&lt;br /&gt;
| u16 &lt;br /&gt;
| Sync Count&lt;br /&gt;
|-&lt;br /&gt;
| 164&lt;br /&gt;
| 8&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
| 172&lt;br /&gt;
| u32&lt;br /&gt;
| Physical address of current buffer&lt;br /&gt;
|-&lt;br /&gt;
| 176&lt;br /&gt;
| u32&lt;br /&gt;
| Number of samples in current buffer&lt;br /&gt;
|-&lt;br /&gt;
| 180&lt;br /&gt;
| u16&lt;br /&gt;
| bits[0:1]: 1 = mono, 2 = stereo; bits[2:3]: buffer format&lt;br /&gt;
|-&lt;br /&gt;
| 182&lt;br /&gt;
| u16&lt;br /&gt;
| ADPCM predictor&lt;br /&gt;
|-&lt;br /&gt;
| 184&lt;br /&gt;
| s16&lt;br /&gt;
| ADPCM yn1&lt;br /&gt;
|-&lt;br /&gt;
| 186&lt;br /&gt;
| s16&lt;br /&gt;
| ADPCM yn2&lt;br /&gt;
|-&lt;br /&gt;
| 188&lt;br /&gt;
| u16&lt;br /&gt;
| bit[0]: Has ADPCM data?; bit[1]: Is looping?&lt;br /&gt;
|-&lt;br /&gt;
| 190&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer Id of this current buffer&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Buffer ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u32&lt;br /&gt;
| Physical Address&lt;br /&gt;
|-&lt;br /&gt;
| 4 &lt;br /&gt;
| u32&lt;br /&gt;
| Sample Count&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| u16&lt;br /&gt;
| ADPCM P/S&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| s16[2]&lt;br /&gt;
| ADPCM yn[1,2]&lt;br /&gt;
|-&lt;br /&gt;
| 14&lt;br /&gt;
| u8&lt;br /&gt;
| Has ADPCM?&lt;br /&gt;
|-&lt;br /&gt;
| 15&lt;br /&gt;
| u8&lt;br /&gt;
| Looping?&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer Id&lt;br /&gt;
|-&lt;br /&gt;
| 18&lt;br /&gt;
| u16&lt;br /&gt;
| -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Dirty Bits ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Bit&lt;br /&gt;
| What Changed&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| ADPCM Coefficients&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| Embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 13&lt;br /&gt;
| Is Active&lt;br /&gt;
|-&lt;br /&gt;
| 18&lt;br /&gt;
| Interpolation Type&lt;br /&gt;
|-&lt;br /&gt;
| 19&lt;br /&gt;
| Rate&lt;br /&gt;
|-&lt;br /&gt;
| 20&lt;br /&gt;
| Buffer Queue&lt;br /&gt;
|-&lt;br /&gt;
| 22&lt;br /&gt;
| Embedded buffer&lt;br /&gt;
|-&lt;br /&gt;
| 23&lt;br /&gt;
| IRR Filter Type&lt;br /&gt;
|-&lt;br /&gt;
| 25&lt;br /&gt;
| Sync Count&lt;br /&gt;
|-&lt;br /&gt;
| 26-28&lt;br /&gt;
| Mix&lt;br /&gt;
|-&lt;br /&gt;
| 30&lt;br /&gt;
| First time init&lt;br /&gt;
|-&lt;br /&gt;
| 31&lt;br /&gt;
| Embedded Buffer&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Merry</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=DSP_Memory_Region&amp;diff=15593</id>
		<title>DSP Memory Region</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=DSP_Memory_Region&amp;diff=15593"/>
		<updated>2016-01-23T15:58:28Z</updated>

		<summary type="html">&lt;p&gt;Merry: Added Channel Context&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The DSP communicates with userland through memory locations 0x1ff40000-0x1ff77fff. Within this region are two areas of structures that are exact duplicates of each other. The DSP alternates between the use of these two areas (much like a double-buffer). Each area has 15 structures within it. The location of these structures can be obtained by reading pipe 2.&lt;br /&gt;
&lt;br /&gt;
The mixer has 24 channels, each of which are individually configurable.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Structure Number&lt;br /&gt;
| DSP memory address&lt;br /&gt;
| Size&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| 0x8400&lt;br /&gt;
| 0x20&lt;br /&gt;
| Status (?)&lt;br /&gt;
|-&lt;br /&gt;
| 9&lt;br /&gt;
| 0x8410&lt;br /&gt;
| 0x260&lt;br /&gt;
| Debug (?)&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| 0x8540&lt;br /&gt;
| 0x280&lt;br /&gt;
| Loopback Samples (PCM16)&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 0x8680&lt;br /&gt;
| 0x120&lt;br /&gt;
| Channel Status (x24)&lt;br /&gt;
|-&lt;br /&gt;
| 8 &lt;br /&gt;
| 0x9710&lt;br /&gt;
| 0x1A40&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| 0x9430&lt;br /&gt;
| 0xC4&lt;br /&gt;
| Main Configuration&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| 0x9492&lt;br /&gt;
| 0x1400&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0x9e92&lt;br /&gt;
| 0x1200&lt;br /&gt;
| Channel Config (x24)&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 0x9430&lt;br /&gt;
| 0x300&lt;br /&gt;
| GC-ADPCM Coefficients (x24)&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| 0xa912&lt;br /&gt;
| 0x200&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 11&lt;br /&gt;
| 0xaa12&lt;br /&gt;
| 0x180&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 12&lt;br /&gt;
| 0xaad2&lt;br /&gt;
| 0x300&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 13&lt;br /&gt;
| 0xac52&lt;br /&gt;
| 0x14&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 14&lt;br /&gt;
| 0xac5c&lt;br /&gt;
| 0x2476&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 0xbfff&lt;br /&gt;
| 0x2&lt;br /&gt;
| Frame Counter&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Channel Config ==&lt;br /&gt;
&lt;br /&gt;
A 192 byte long structure. There are 24 of them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u32&lt;br /&gt;
| Dirty flags&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| 70 bytes&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
| 74&lt;br /&gt;
| u16&lt;br /&gt;
| Bitmap of which buffers in queue are valid&lt;br /&gt;
|-&lt;br /&gt;
| 76&lt;br /&gt;
| Buffer[4]&lt;br /&gt;
| Buffer queue&lt;br /&gt;
|-&lt;br /&gt;
| 156&lt;br /&gt;
| u32&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| 160&lt;br /&gt;
| u16&lt;br /&gt;
| Is Active&lt;br /&gt;
|-&lt;br /&gt;
| 162&lt;br /&gt;
| u16 &lt;br /&gt;
| Config Serial Number (Userland)&lt;br /&gt;
|-&lt;br /&gt;
| 164&lt;br /&gt;
| 8&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
| 172&lt;br /&gt;
| u32&lt;br /&gt;
| Physical address of current buffer&lt;br /&gt;
|-&lt;br /&gt;
| 176&lt;br /&gt;
| u32&lt;br /&gt;
| Number of samples in current buffer&lt;br /&gt;
|-&lt;br /&gt;
| 180&lt;br /&gt;
| u16&lt;br /&gt;
| bits[0:1]: 1 = mono, 2 = stereo; bits[2:3]: buffer format&lt;br /&gt;
|-&lt;br /&gt;
| 182&lt;br /&gt;
| u16&lt;br /&gt;
| ADPCM predictor&lt;br /&gt;
|-&lt;br /&gt;
| 184&lt;br /&gt;
| s16&lt;br /&gt;
| ADPCM yn1&lt;br /&gt;
|-&lt;br /&gt;
| 186&lt;br /&gt;
| s16&lt;br /&gt;
| ADPCM yn2&lt;br /&gt;
|-&lt;br /&gt;
| 188&lt;br /&gt;
| u16&lt;br /&gt;
| bit[0]: Has ADPCM data?; bit[1]: Is looping?&lt;br /&gt;
|-&lt;br /&gt;
| 190&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer Id of this current buffer&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Buffer ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Offset&lt;br /&gt;
| Type&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u32&lt;br /&gt;
| Physical Address&lt;br /&gt;
|-&lt;br /&gt;
| 4 &lt;br /&gt;
| u32&lt;br /&gt;
| Sample Count&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| u16&lt;br /&gt;
| ADPCM P/S&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| s16[2]&lt;br /&gt;
| ADPCM yn[1,2]&lt;br /&gt;
|-&lt;br /&gt;
| 14&lt;br /&gt;
| u8&lt;br /&gt;
| Has ADPCM?&lt;br /&gt;
|-&lt;br /&gt;
| 15&lt;br /&gt;
| u8&lt;br /&gt;
| Looping?&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| u16&lt;br /&gt;
| Buffer Id&lt;br /&gt;
|-&lt;br /&gt;
| 18&lt;br /&gt;
| u16&lt;br /&gt;
| -&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Merry</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=DSP_Memory_Region&amp;diff=15582</id>
		<title>DSP Memory Region</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=DSP_Memory_Region&amp;diff=15582"/>
		<updated>2016-01-22T20:13:07Z</updated>

		<summary type="html">&lt;p&gt;Merry: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The DSP communicates with userland through memory locations 0x1ff40000-0x1ff77fff. Within this region are two areas of structures that are exact duplicates of each other. The DSP alternates between the use of these two areas (much like a double-buffer). Each area has 15 structures within it. The location of these structures can be obtained by reading pipe 2.&lt;br /&gt;
&lt;br /&gt;
The mixer has 24 channels, each of which are individually configurable.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Structure Number&lt;br /&gt;
| DSP memory address&lt;br /&gt;
| Size&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| 0x8400&lt;br /&gt;
| 0x20&lt;br /&gt;
| Status (?)&lt;br /&gt;
|-&lt;br /&gt;
| 9&lt;br /&gt;
| 0x8410&lt;br /&gt;
| 0x260&lt;br /&gt;
| Debug (?)&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| 0x8540&lt;br /&gt;
| 0x280&lt;br /&gt;
| Loopback Samples (PCM16)&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 0x8680&lt;br /&gt;
| 0x120&lt;br /&gt;
| Channel Status (x24)&lt;br /&gt;
|-&lt;br /&gt;
| 8 &lt;br /&gt;
| 0x9710&lt;br /&gt;
| 0x1A40&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| 0x9430&lt;br /&gt;
| 0xC4&lt;br /&gt;
| Main Configuration&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| 0x9492&lt;br /&gt;
| 0x1400&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0x9e92&lt;br /&gt;
| 0x1200&lt;br /&gt;
| Channel Config (x24)&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 0x9430&lt;br /&gt;
| 0x300&lt;br /&gt;
| GC-ADPCM Coefficients (x24)&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| 0xa912&lt;br /&gt;
| 0x200&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 11&lt;br /&gt;
| 0xaa12&lt;br /&gt;
| 0x180&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 12&lt;br /&gt;
| 0xaad2&lt;br /&gt;
| 0x300&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 13&lt;br /&gt;
| 0xac52&lt;br /&gt;
| 0x14&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 14&lt;br /&gt;
| 0xac5c&lt;br /&gt;
| 0x2476&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 0xbfff&lt;br /&gt;
| 0x2&lt;br /&gt;
| Frame Counter&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Merry</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=DSP_Memory_Region&amp;diff=15581</id>
		<title>DSP Memory Region</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=DSP_Memory_Region&amp;diff=15581"/>
		<updated>2016-01-22T20:12:09Z</updated>

		<summary type="html">&lt;p&gt;Merry: Basic Area Table&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The DSP communicates with userland through memory locations 0x1ff40000-0x1ff77fff. Within this region are two areas of structures that are exact duplicates of each other. The DSP alternates between the use of these two areas (much like a double-buffer). Each area has 15 structures within it. The location of these structures can be obtained by reading pipe 2.&lt;br /&gt;
&lt;br /&gt;
The mixer has 24 channels, each of which are individually configurable.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Structure Number&lt;br /&gt;
| DSP memory address&lt;br /&gt;
| Size&lt;br /&gt;
| Description&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| 0x8400&lt;br /&gt;
| 0x20&lt;br /&gt;
| Status (?)&lt;br /&gt;
|-&lt;br /&gt;
| 9&lt;br /&gt;
| 0x8410&lt;br /&gt;
| 0x260&lt;br /&gt;
| Debug (?)&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| 0x8540&lt;br /&gt;
| 0x280&lt;br /&gt;
| Loopback Samples (PCM16)&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 0x8680&lt;br /&gt;
| 0x120&lt;br /&gt;
| Channel Status (x24)&lt;br /&gt;
|-&lt;br /&gt;
| 8 &lt;br /&gt;
| 0x9710&lt;br /&gt;
| 0x1A40&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| 0x9430&lt;br /&gt;
| 0xC4&lt;br /&gt;
| Main Configuration&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| 0x9492&lt;br /&gt;
| 0x1400&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0x9e92&lt;br /&gt;
| 0x1200&lt;br /&gt;
| Channel Config (x24)&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 0x9430&lt;br /&gt;
| 0x300&lt;br /&gt;
| GC-ADPCM Coefficients (x24)|-&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| 0xa912&lt;br /&gt;
| 0x200&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 11&lt;br /&gt;
| 0xaa12&lt;br /&gt;
| 0x180&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 12&lt;br /&gt;
| 0xaad2&lt;br /&gt;
| 0x300&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 13&lt;br /&gt;
| 0xac52&lt;br /&gt;
| 0x14&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| 14&lt;br /&gt;
| 0xac5c&lt;br /&gt;
| 0x2476&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 0xbfff&lt;br /&gt;
| 0x2&lt;br /&gt;
| Frame Counter&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Merry</name></author>
	</entry>
</feed>