[Scummvm-cvs-logs] SF.net SVN: scummvm: [21409] scummvm/trunk/backends/gp32

wonst719 at users.sourceforge.net wonst719 at users.sourceforge.net
Wed Mar 22 19:03:02 CET 2006


Revision: 21409
Author:   wonst719
Date:     2006-03-22 19:02:04 -0800 (Wed, 22 Mar 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=21409&view=rev

Log Message:
-----------
Update port.
* NO SOUND support.
* New asm functions.
* Prepare for MP3 / OGG

Modified Paths:
--------------
    scummvm/trunk/backends/gp32/Makefile
    scummvm/trunk/backends/gp32/gp32_launcher.cpp
    scummvm/trunk/backends/gp32/gp32_osys.cpp
    scummvm/trunk/backends/gp32/gp32_osys.h
    scummvm/trunk/backends/gp32/gp32std.cpp
    scummvm/trunk/backends/gp32/gp_asmlib.s
Modified: scummvm/trunk/backends/gp32/Makefile
===================================================================
--- scummvm/trunk/backends/gp32/Makefile	2006-03-23 02:48:53 UTC (rev 21408)
+++ scummvm/trunk/backends/gp32/Makefile	2006-03-23 03:02:04 UTC (rev 21409)
@@ -37,29 +37,24 @@
 # GPSDK (SDK, Includes and Startup Files) base dir
 GPSDK			=	/usr/compat/gp32/share/sdk
 
+GPMAD_DIR		= gpmad
+GPTREMOR_DIR	= gptremor
+
 # Outputs
-EXEEXT			=	.elf
-MAPFILE			=	scummvm.map
-BIN			=	scummvm.gxb
-FXE			=	scummvm.fxe
+EXEEXT		= .elf
+MAPFILE		= scummvm.map
+BIN			= scummvm.gxb
+FXE			= scummvm.fxe
 
 # Stripped Build? (Smaller ELF, Minimal debug symbol information).
 # You MUST comment this out with a # if you wish to debug your code.
-# STRIP_DEBUG		=	-Wl,--strip-debug
+STRIP_DEBUG	= -Wl,--strip-debug
 
 # Plugins hack
-srcdir			=	./
+srcdir		= ./
 
 # GP32 Direct Execute Tool (i.e. pclink -e on Windows, gplink run on Linux)
 EXECUTE_TOOL	=	pclink -e
-#
-#	       		-ffast-math \
-#	       		-fshort-double \
-#
-#
-#
-
-				#-Wno-multichar \
 				# Remove the below from the above flags for Debug.
 CFLAGS		=	-marm -march=armv4t -mtune=arm920 -mapcs \
 	       		-finline-functions \
@@ -70,17 +65,22 @@
 				-g \
 	       		-O2 \
 	       		-fomit-frame-pointer
+#	       		-ffast-math \
+#	       		-fshort-double \
+#				-Wno-multichar \
 
 CPPFLAGS	=	$(CFLAGS)
 
 DEFINES 	= 	-D__GP32__
 DEFINES		+=	-DNONSTANDARD_PORT
 
-# Support Vorbis Tremor Patches.
-#DEFINES	+=	-DVORBIS_TREMOR
+# Support libtremor.
+DEFINES		+=	-DUSE_VORBIS -DUSE_TREMOR
+LIBS		+=	-lgptremor
 
-# Support LIBMAD Patches.
-#DEFINES	+=	-DGP32_MADMP3
+# Support libmad.
+DEFINES		+=	-DUSE_MAD
+LIBS		+=	-lgpmad
 
 # Support for 8:3 save files names (The GP32 uses FAT12/16 (no vFAT) for the file system).
 DEFINES		+=	-DSHORT_SAVENAMES
@@ -90,7 +90,7 @@
 
 # Support for the GP32 (fmOPL derived) MIDI engine.
 #	-	NOT fully implemented yet.
-DEFINES		+=	-DUSE_GP32_FMOPL
+#DEFINES		+=	-DUSE_GP32_FMOPL
 
 LDSPECS		=	-specs=gp32_gpsdk.specs
 
@@ -143,27 +143,6 @@
 $(BIN): scummvm$(EXEEXT)
 					$(OBJCOPY) -O binary $< $@
 
-#######################################################################
-# Compile options - you can modify these to tweak ScummVM compilation #
-#######################################################################
-
-# Uncomment this to activate the MAD lib for compressed sound files
-# DEFINES += -DUSE_MAD
-# LIBS    += -lmad
-
-# Uncomment this to activate the Ogg Vorbis lib for compressed sound files
-# You MUST use Tremor for Ogg Vorbis support on the GP32 port.
-# DEFINES += -DUSE_VORBIS
-# LIBS    += -lvorbisfile -lvorbis
-
-# Uncomment this to activate the ALSA lib for midi
-# DEFINES += -DUSE_ALSA
-# LIBS    += -lasound
-
-# Uncomment this to cause warnings to be treated as errors
-# CXXFLAGS+= -Werror
-
-# Uncomment this to use GCC 3.x specific dependency tracking (recommended)
 HAVE_GCC3 = 1
 
 #######################################################################
@@ -176,9 +155,10 @@
 #DISABLE_SCUMM = 1
 #DISABLE_SCUMM_7_8 = 1
 DISABLE_HE = 1
-DISABLE_SIMON = 1
-DISABLE_SKY = 1
-DISABLE_QUEEN = 1
+#DISABLE_SIMON = 1
+#DISABLE_SKY = 1
+#DISABLE_QUEEN = 1
+#DISABLE_GOB = 1
 
 
 # The engines below are not supported on the GP32 port so there is
@@ -190,7 +170,6 @@
 # Disable for ALL release builds.
 DISABLE_SAGA = 1
 DISABLE_KYRA = 1
-DISABLE_GOB = 1
 
 #######################################################################
 # Misc stuff - you should normally never have to edit this            #

Modified: scummvm/trunk/backends/gp32/gp32_launcher.cpp
===================================================================
--- scummvm/trunk/backends/gp32/gp32_launcher.cpp	2006-03-23 02:48:53 UTC (rev 21408)
+++ scummvm/trunk/backends/gp32/gp32_launcher.cpp	2006-03-23 03:02:04 UTC (rev 21409)
@@ -39,10 +39,10 @@
 uint16 cpuSpeedTable[15] = {40, 66, 100, 120, 133, 144, 156, 160, 166, 172, 176, 180, 188, 192, 200};
 uint16 gammaTable[16] = {5000, 6000, 7000, 8000, 9000, 10000, 11000, 12000, 13000, 14000, 15000, 16000, 17000, 18000, 19000, 20000};
 char *oplTable[3] = {"LOW", "MEDIUM", "HIGH"};
-uint16 sampleTable[3] = {11025, 22050, 44100};
+uint16 sampleTable[4] = {0, 11025, 22050, 44100};
 
 uint8 maxTable[5] = {15, 16, 3, 3, 2};
-uint8 currentSetting[5] = {2, 5, 1, 0, 0};
+uint8 currentSetting[5] = {2, 5, 1, 1, 0};
 
 void writeConfigVars() {
 	Common::File file;
@@ -107,9 +107,9 @@
 
 		gp_textOut(frameBuffer2, 100, 210, "OK         CANCEL", 0);
 
-		if (currentSelect == 4)
-			gp_textOut(frameBuffer2, 80, 210, "@", 0);
-		else
+		if (currentSelect == 4) {
+			gp_textOut(frameBuffer2, 80 + currentSetting[4] * 100, 210, "@", 0);
+		} else
 			gp_textOut(frameBuffer2, 20, (currentSelect + 1) * 40, "@", 0);
 
 		sprintf(text, "%d MHz", cpuSpeedTable[currentSetting[0]]);
@@ -117,7 +117,11 @@
 		sprintf(text, "%.2f", (float)gammaTable[currentSetting[1]] / 10000);
 		gp_textOut(frameBuffer2, 220, 80, text, 0);
 		gp_textOut(frameBuffer2, 220, 120, oplTable[currentSetting[2]], 0);
-		sprintf(text, "%d Hz", sampleTable[currentSetting[3]]);
+		if (sampleTable[currentSetting[3]] == 0) {
+			strcpy(text, "NO SOUND");
+		} else {
+			sprintf(text, "%d Hz", sampleTable[currentSetting[3]]);
+		}
 		gp_textOut(frameBuffer2, 220, 160, text, 0);
 
 		gp_flipScreen();

Modified: scummvm/trunk/backends/gp32/gp32_osys.cpp
===================================================================
--- scummvm/trunk/backends/gp32/gp32_osys.cpp	2006-03-23 02:48:53 UTC (rev 21408)
+++ scummvm/trunk/backends/gp32/gp32_osys.cpp	2006-03-23 03:02:04 UTC (rev 21409)
@@ -652,12 +652,18 @@
 
 	ConfMan.set("FM_medium_quality", (g_vars.fmQuality == FM_QUALITY_MED));
 	ConfMan.set("FM_high_quality", (g_vars.fmQuality == FM_QUALITY_HI));
-	//ConfMan.set("sample_rate", (int)g_vars.sampleRate);
+	//ConfMan.set("output_rate", (int)g_vars.sampleRate);
 
 	if (ConfMan.hasKey("output_rate"))
 		_samplesPerSec = ConfMan.getInt("output_rate");
+		
+	_samplesPerSec = (int)g_vars.sampleRate; //hack
+	
+	if (_samplesPerSec == 0) {
+		return false;
+	}
 
-	if (_samplesPerSec <= 0)
+	if (_samplesPerSec < 0)
 		_samplesPerSec = SAMPLES_PER_SEC;
 
 	// Originally, we always used 2048 samples. This loop will produce the
@@ -697,7 +703,8 @@
 
 void OSystem_GP32::clearSoundCallback() {
 	NP("OSys::clearSoundCallback()");
-	gp_soundBufStop();
+	if (_samplesPerSec != 0)
+		gp_soundBufStop();
 }
 
 int OSystem_GP32::getOutputSampleRate() const {

Modified: scummvm/trunk/backends/gp32/gp32_osys.h
===================================================================
--- scummvm/trunk/backends/gp32/gp32_osys.h	2006-03-23 02:48:53 UTC (rev 21408)
+++ scummvm/trunk/backends/gp32/gp32_osys.h	2006-03-23 03:02:04 UTC (rev 21409)
@@ -29,7 +29,6 @@
 //Standard ScummVM includes.
 #include "common/stdafx.h"
 #include "common/scummsys.h"
-#include "common/scaler.h"
 #include "common/system.h"
 #include "backends/intern.h"
 

Modified: scummvm/trunk/backends/gp32/gp32std.cpp
===================================================================
--- scummvm/trunk/backends/gp32/gp32std.cpp	2006-03-23 02:48:53 UTC (rev 21408)
+++ scummvm/trunk/backends/gp32/gp32std.cpp	2006-03-23 03:02:04 UTC (rev 21409)
@@ -25,7 +25,6 @@
 
 #include "stdafx.h"
 #include "common/scummsys.h"
-#include "common/scaler.h"
 #include "common/system.h"
 #include "backends/intern.h"
 

Modified: scummvm/trunk/backends/gp32/gp_asmlib.s
===================================================================
--- scummvm/trunk/backends/gp32/gp_asmlib.s	2006-03-23 02:48:53 UTC (rev 21408)
+++ scummvm/trunk/backends/gp32/gp_asmlib.s	2006-03-23 03:02:04 UTC (rev 21409)
@@ -1,8 +1,12 @@
 	.ALIGN
 @	.ARM
 
-	.GLOBAL		cpu_speed
-	.GLOBAL		mmu_change
+	.GLOBAL cpu_speed
+	.GLOBAL mmu_change
+	.GLOBAL gp_enableIRQ
+	.GLOBAL gp_disableIRQ
+	.GLOBAL gp_installSWIIRQ
+	.GLOBAL gp_removeSWIIRQ
 
 cpu_speed:
 	stmdb	r13!, {r0-r12,lr}
@@ -15,12 +19,39 @@
 	nop
 
 mmu_change:
-        stmdb   r13!, {r0-r12,lr}
-        swi             #0x02
-        ldmia   r13!, {r0-r12,lr}
-        bx              lr
-        nop
+	stmdb   r13!, {r0-r12,lr}
+	swi             #0x02
+	ldmia   r13!, {r0-r12,lr}
+	bx              lr
+	nop
 
+gp_enableIRQ:
+	STMDB    r13!,{r0,lr}
+	MRS      r0,CPSR
+	BIC      r0,r0,#0x80
+	MSR      CPSR,r0
+	LDMIA    r13!,{r0,pc}
+	@MOV      pc,lr
+
+gp_disableIRQ:
+	STMDB    r13!,{r0,lr}
+	MRS      r0,CPSR
+	ORR      r0,r0,#0xc0
+	MSR      CPSR,r0
+	LDMIA    r13!,{r0,pc}
+	@MOV      pc,lr
+
+gp_installSWIIRQ:
+	STMDB    r13!,{r14}
+	SWI      0x9
+	LDMIA    r13!,{pc}
+
+gp_removeSWIIRQ:
+	STMDB    r13!,{r14}
+	SWI      0xa
+	LDMIA    r13!,{pc}
+
+
 @ ******** ASMFastSolidBlit(unsigned char *src4, unsigned char *dst4, int nbx, int nby, int height2, int trans, int coul) ********
 
 	.ALIGN


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