[Scummvm-cvs-logs] SF.net SVN: scummvm: [26395] scummvm/trunk/sound/fmopl.cpp

agent-q at users.sourceforge.net agent-q at users.sourceforge.net
Fri Apr 6 20:35:35 CEST 2007


Revision: 26395
          http://scummvm.svn.sourceforge.net/scummvm/?rev=26395&view=rev
Author:   agent-q
Date:     2007-04-06 11:35:35 -0700 (Fri, 06 Apr 2007)

Log Message:
-----------
Changes to CPU local ram allocation for DS port

Modified Paths:
--------------
    scummvm/trunk/sound/fmopl.cpp

Modified: scummvm/trunk/sound/fmopl.cpp
===================================================================
--- scummvm/trunk/sound/fmopl.cpp	2007-04-06 18:34:53 UTC (rev 26394)
+++ scummvm/trunk/sound/fmopl.cpp	2007-04-06 18:35:35 UTC (rev 26395)
@@ -62,7 +62,8 @@
 /* sinwave entries */
 /* used static memory = SIN_ENT * 4 (byte) */
 #ifdef __DS__
-#define SIN_ENT 1024
+#include "dsmain.h"
+#define SIN_ENT 256
 #else
 #define SIN_ENT 2048
 #endif
@@ -638,14 +639,17 @@
 		ENV_CURVE = (int *)calloc(2 * 4096 + 1, sizeof(int));
 #endif
 
+#ifdef __DS__
+	DS::fastRamReset();
+
+	TL_TABLE = (int *) DS::fastRamAlloc(TL_MAX * 2 * sizeof(int *));
+	SIN_TABLE = (int **) DS::fastRamAlloc(SIN_ENT * 4 * sizeof(int *));
+#else
+
 	/* allocate dynamic tables */
 	if((TL_TABLE = (int *)malloc(TL_MAX * 2 * sizeof(int))) == NULL)
 		return 0;
 
-#ifdef __DS__
-	// On the DS, use fast RAM for the sine table, since it thrashes the cache otherwise
-	SIN_TABLE = ((int **) (0x37F8000));
-#else
 	if((SIN_TABLE = (int **)malloc(SIN_ENT * 4 * sizeof(int *))) == NULL) {
 		free(TL_TABLE);
 		return 0;
@@ -657,6 +661,7 @@
 		free(SIN_TABLE);
 		return 0;
 	}
+
 	if((VIB_TABLE = (int *)malloc(VIB_ENT * 2 * sizeof(int))) == NULL) {
 		free(TL_TABLE);
 		free(SIN_TABLE);
@@ -996,6 +1001,7 @@
 	uint8 rythm = OPL->rythm & 0x20;
 	OPL_CH *CH, *R_CH;
 
+
 	if((void *)OPL != cur_chip) {
 		cur_chip = (void *)OPL;
 		/* channel pointers */


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list