Aligned memory support driver for VS1010D dlx loader

Designing hardware and software for systems that use the VS1010 MP3 Audio DSP Microcontroller.
Post Reply
User avatar
Panu
VSDSP Expert
Posts: 2829
Joined: Tue 2010-06-22 13:43

Aligned memory support driver for VS1010D dlx loader

Post by Panu »

Dear Signal Processing Enthusiasts,

Here is a small driver that implements aligned memory support for the VS1010D library loader. It's useful especially for signal processing applications.

To use the driver, place the ALIGN.DLX file to your SYS folder and add ALIGN to the beginning of your config.txt.

-Panu

PS. For those interested, here's the source code. It shows the syntax for making a simple driver, which stays resident in memory after exit. It only works in VS1010D, does not work in VS1010C.

Code: Select all

#include <lowlevels.h>
u_int16 GetMemoryAlign(u_int16 page, u_int16 address, u_int16 sizeWords, u_int16 align) {
	if (align) {
		u_int16 alignMinus1 = align - 1;
		heap[page] = (heap[page] + alignMinus1) & ~alignMinus1;
	}
	return GetMemory(page, address, sizeWords, align);
}
ioresult main (char *params) {
	u_int16 *thisLib = loadedLib[loadedLibs-1];
	thisLib[1] = 0xfffe; //Do not release memory at program exit
	SetJmpiHookFunction(GetMem, GetMemoryAlign);
	return S_OK;
}
Attachments
align.dlx
Aligned memory loader driver, VS1010 VSOS executable
(602 Bytes) Downloaded 322 times
arch-align-2019-06-07-11-45-RC1.zip
Aligned memory loader driver, VSIDE Solution with source code
(20.06 KiB) Downloaded 310 times
Post Reply