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

wonst719 at users.sourceforge.net wonst719 at users.sourceforge.net
Fri Apr 7 03:39:03 CEST 2006


Revision: 21663
Author:   wonst719
Date:     2006-04-07 03:38:06 -0700 (Fri, 07 Apr 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=21663&view=rev

Log Message:
-----------
Disable i/o cache which is incomplete and can cause serious problem with SMC.
Fix compile by overriding typenames.
Cleanup and fix ASM functions. Some of them didn't return properly to C code when called...
Cleanup Makefile again.

Modified Paths:
--------------
    scummvm/trunk/backends/gp32/Makefile
    scummvm/trunk/backends/gp32/gp32_launcher.cpp
    scummvm/trunk/backends/gp32/gp32_main.cpp
    scummvm/trunk/backends/gp32/gp32std.cpp
    scummvm/trunk/backends/gp32/gp32std_sound.cpp
    scummvm/trunk/backends/gp32/gp_asmlib.s
Modified: scummvm/trunk/backends/gp32/Makefile
===================================================================
--- scummvm/trunk/backends/gp32/Makefile	2006-04-07 09:37:44 UTC (rev 21662)
+++ scummvm/trunk/backends/gp32/Makefile	2006-04-07 10:38:06 UTC (rev 21663)
@@ -21,7 +21,20 @@
 # Default compilation parameters. Normally don't edit these           #
 #######################################################################
 
-CXXFLAGS:= -g -O
+CFLAGS =	-marm -march=armv4t -mtune=arm920 -mapcs \
+			-finline-functions \
+			-fshort-enums \
+			-mstructure-size-boundary=32 \
+			-mno-thumb-interwork \
+			-I$(GPSDK)/include \
+			-g \
+			-O2 \
+			-fomit-frame-pointer
+#			-ffast-math \
+#			-fshort-double
+
+CPPFLAGS:= $(CFLAGS)
+CXXFLAGS:= $(CFLAGS)
 DEFINES :=
 LDFLAGS :=
 INCLUDES:= -I. -Icommon
@@ -34,51 +47,55 @@
 CXXFLAGS+= -Wno-long-long -Wno-multichar -Wno-unknown-pragmas -Wno-reorder
 CXXFLAGS+= -Wwrite-strings -fcheck-new -Wctor-dtor-privacy -Wnon-virtual-dtor
 
+# 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
+
 # GPSDK (SDK, Includes and Startup Files) base dir
-GPSDK			=	/usr/compat/gp32/share/sdk
+GPSDK		=	/usr/compat/gp32/share/sdk
 
-GPMAD_DIR		= gpmad
-GPTREMOR_DIR	= gptremor
+LDSPECS		=	-specs=gp32_gpsdk.specs
 
+LDFLAGS 	= 	$(STRIP_DEBUG) -Wl,-Map,$(MAPFILE) $(LDSPECS) -Wl,--no-warn-mismatch
+
+LIBS		+=	-L$(GPSDK)/lib \
+				-lgpmem -lgpos -lgpstdio -lgpstdlib -lgpsound -lgpgraphic -lgpfont \
+				-lm -lc -lgcc
+
+INCLUDES	+=	-Ibackends/gp32 -Iengines -I$(GPSDK)/include
+
+MODULES		+=	backends/gp32
+
 # Outputs
 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
-
 # Plugins hack
 srcdir		= ./
 
-CFLAGS		=	-marm -march=armv4t -mtune=arm920 -mapcs \
-	       		-finline-functions \
-	       		-fshort-enums \
-	       		-mstructure-size-boundary=32 \
-	       		-mno-thumb-interwork \
-				-I$(GPSDK)/include \
-				-g \
-	       		-O2 \
-	       		-fomit-frame-pointer
-#	       		-ffast-math \
-#	       		-fshort-double \
-#				-Wno-multichar \
-
-CPPFLAGS	=	$(CFLAGS)
-
 DEFINES 	= 	-D__GP32__
 DEFINES		+=	-DNONSTANDARD_PORT
 
+# Disable new themes. GP32 has LOW memory!
+DEFINES		+=	-DDISABLE_FANCY_THEMES
+
 # Support libtremor.
-#DEFINES		+=	-DUSE_VORBIS -DUSE_TREMOR
-#LIBS		+=	-lgptremor
+#DEFINES		+=	-DUSE_VORBIS -DUSE_TREMOR -DGP32_SDK
+#INCLUDES	+=	-Ibackends/gp32/gptremor
+#LIBS		+=	-Lbackends/gp32/gptremor -lgptremor
 
 # Support libmad.
 #DEFINES		+=	-DUSE_MAD
-#LIBS		+=	-lgpmad
+#INCLUDES	+=	-Ibackends/gp32/gpmad
+#LIBS		+=	-Lbackends/gp32/gpmad -lgpmad
 
+# Support libminilzo.
+#DEFINES		+=	-DUSE_MINILZO
+#INCLUDES	+=	-Ibackends/gp32/minilzo
+#LIBS		+=	-Lbackends/gp32/minilzo -lminilzo
+
 # Support for 8:3 save files names (The GP32 uses FAT12/16 (no vFAT) for the file system).
 DEFINES		+=	-DSHORT_SAVENAMES
 
@@ -89,20 +106,8 @@
 #	-	NOT fully implemented yet.
 #DEFINES		+=	-DUSE_GP32_FMOPL
 
-LDSPECS		=	-specs=gp32_gpsdk.specs
 
-LDFLAGS 	= 	$(STRIP_DEBUG) \
-				-Wl,-Map,$(MAPFILE) \
-				$(LDSPECS) -Wl,--no-warn-mismatch
 
-LIBS		+=	-L$(GPSDK)/lib \
-				-lgpmem -lgpos -lgpstdio -lgpstdlib -lgpsound -lgpgraphic -lgpfont \
-				-lm -lc -lgcc
-
-INCLUDES	+=	-Ibackends/gp32 -Iengines -I$(GPSDK)/include
-
-MODULES		+=	backends/gp32
-
 #GP32 Debug - Remove from Release builds
 #	This builds in the GP32 GDB USB Stub. Don't use it unless you know what your doing.
 #	You also need to remove ANY optemisation from the compiler flags.
@@ -130,9 +135,6 @@
 			backends/gp32/gp32_osys.o \
 			backends/gp32/gp-fs.o
 
-#install: all
-					#$(EXECUTE_TOOL) $(BIN)
-
 $(FXE): $(BIN)
 					$(FXETOOL) -f -a "The ScummVM Team" -t "ScummVM for the GP32" $< $@
 #					$(FXETOOL) -f -a "The ScummVM Team" -t "ScummVM for the GP32" -b scummvm.bmp $< $@
@@ -151,13 +153,19 @@
 DISABLE_HQ_SCALERS = 1
 
 #DISABLE_SCUMM = 1
-#DISABLE_SCUMM_7_8 = 1
+
+# We can play The Dig with GP32 -- without any movies/musics/voices. But who would do that?
+DISABLE_SCUMM_7_8 = 1
 DISABLE_HE = 1
-#DISABLE_SIMON = 1
-#DISABLE_SKY = 1
-#DISABLE_QUEEN = 1
-#DISABLE_GOB = 1
 
+# ???
+DISABLE_SIMON = 1
+DISABLE_SKY = 1
+DISABLE_QUEEN = 1
+DISABLE_GOB = 1
+DISABLE_LURE = 1
+DISABLE_CINE = 1
+
 # In-development engines below.
 # Disable for ALL release builds.
 DISABLE_SAGA = 1

Modified: scummvm/trunk/backends/gp32/gp32_launcher.cpp
===================================================================
--- scummvm/trunk/backends/gp32/gp32_launcher.cpp	2006-04-07 09:37:44 UTC (rev 21662)
+++ scummvm/trunk/backends/gp32/gp32_launcher.cpp	2006-04-07 10:38:06 UTC (rev 21663)
@@ -68,7 +68,7 @@
 		currentSetting[0] = 2;
 		currentSetting[1] = 5;
 		currentSetting[2] = 1;
-		currentSetting[3] = 0;
+		currentSetting[3] = 1;
 		writeConfigVars();
 	} else {
 		if (!file.open("scummvm.cfg", Common::File::kFileReadMode, "gp:\\gpetc\\")) {

Modified: scummvm/trunk/backends/gp32/gp32_main.cpp
===================================================================
--- scummvm/trunk/backends/gp32/gp32_main.cpp	2006-04-07 09:37:44 UTC (rev 21662)
+++ scummvm/trunk/backends/gp32/gp32_main.cpp	2006-04-07 10:38:06 UTC (rev 21663)
@@ -65,16 +65,15 @@
 	gp_setCpuSpeed(g_vars.cpuSpeed);
 
 	// FOR DEBUG PURPOSE!
-	int argc = 2;
+	int argc = 1;
 	//char *argv[] = { "scummvm", "-enull", "-pgp:\\game\\dott\\", "tentacle" };
-	char *argv[] = { "scummvm", "-enull", "-d3" };
+	char *argv[] = { "scummvm", "-d9" };
 
-	//scummvm_main(argc, argv);
-
 	g_system = new OSystem_GP32_create();
 	assert(g_system);
 
 	// Invoke the actual ScummVM main entry point:
+	//int res = scummvm_main(argc, argv);
 	int res = scummvm_main(1, NULL);
 	g_system->quit();	// TODO: Consider removing / replacing this!
 	return res;

Modified: scummvm/trunk/backends/gp32/gp32std.cpp
===================================================================
--- scummvm/trunk/backends/gp32/gp32std.cpp	2006-04-07 09:37:44 UTC (rev 21662)
+++ scummvm/trunk/backends/gp32/gp32std.cpp	2006-04-07 10:38:06 UTC (rev 21663)
@@ -25,6 +25,7 @@
 
 #include "stdafx.h"
 #include "common/scummsys.h"
+//#include "graphics/scaler.h"
 #include "common/system.h"
 #include "backends/intern.h"
 
@@ -37,6 +38,8 @@
 FILE *gp_stdout = NULL;
 FILE *gp_stdin = NULL;
 
+//#define USE_CACHE
+
 #define DEBUG_MAX 4
 char debline[DEBUG_MAX][256];
 static int debnext = 0;
@@ -63,6 +66,8 @@
 	debnext++;
 	if (debnext == DEBUG_MAX)
 		debnext = 0;
+		
+	gp_delay(600);
 }
 
 //////////////////
@@ -190,10 +195,12 @@
 	}
 */
 
+#ifdef USE_CACHE
 	if (stream->cachePos) {
 		GpFileWrite(stream->handle, (char *)stream->cacheData, stream->cachePos); // flush cache
 		stream->cachePos = 0;
 	}
+#endif
 
 	ERR_CODE err = GpFileClose(stream->handle);
 	free(stream);
@@ -233,6 +240,7 @@
 		return 0;
 	}
 
+#ifdef USE_CACHE
 	if (stream->cachePos + len < FCACHE_SIZE) {
 		memcpy(stream->cacheData + stream->cachePos, ptr, len);
 		stream->cachePos += len;
@@ -242,12 +250,15 @@
 			stream->cachePos = 0;
 		}
 
+#endif
 		ERR_CODE err = GpFileWrite(stream->handle, ptr, len);
 		if (!err)
 			return n;
 		else
 			return -err;
+#ifdef USE_CACHE
 	}
+#endif
 	return 0;
 }
 
@@ -605,7 +616,7 @@
 }
 
 void NP(const char *fmt, ...) {
-	return;
+//	return;
 	char s[256];
 	va_list marker;
 
@@ -618,7 +629,7 @@
 }
 
 void LP(const char *fmt, ...) {
-	return;
+//	return;
 	char s[256];
 	va_list marker;
 
@@ -631,7 +642,7 @@
 }
 
 void SP(const char *fmt, ...) {
-	return;
+//	return;
 	char s[256];
 	va_list marker;
 
@@ -644,7 +655,7 @@
 }
 
 void BP(const char *fmt, ...) {
-	return;
+//	return;
 	char s[256];
 	va_list marker;
 

Modified: scummvm/trunk/backends/gp32/gp32std_sound.cpp
===================================================================
--- scummvm/trunk/backends/gp32/gp32std_sound.cpp	2006-04-07 09:37:44 UTC (rev 21662)
+++ scummvm/trunk/backends/gp32/gp32std_sound.cpp	2006-04-07 10:38:06 UTC (rev 21663)
@@ -153,8 +153,8 @@
 		tmpBuf[i] = 0x8000;
 
 	// Frequency of the timer interrupt which polls the playing position
-	//soundBuf.pollfreq = 4 * (2 * soundBuf.freq) / soundBuf.samples;
-	soundBuf.pollfreq = (2 * soundBuf.freq) / soundBuf.samples;
+	// FIXME: This frequency should not be multiplied by 4.
+	soundBuf.pollfreq = 4 * (2 * soundBuf.freq) / soundBuf.samples;
 
 	// Set timer interrupt
 	if (GpTimerOptSet(GP32_TIMER_AUDIO_IDX, soundBuf.pollfreq, 0, soundTimer) == GPOS_ERR_ALREADY_USED) {

Modified: scummvm/trunk/backends/gp32/gp_asmlib.s
===================================================================
--- scummvm/trunk/backends/gp32/gp_asmlib.s	2006-04-07 09:37:44 UTC (rev 21662)
+++ scummvm/trunk/backends/gp32/gp_asmlib.s	2006-04-07 10:38:06 UTC (rev 21663)
@@ -20,36 +20,38 @@
 
 mmu_change:
 	stmdb   r13!, {r0-r12,lr}
-	swi             #0x02
+	swi     #0x02
 	ldmia   r13!, {r0-r12,lr}
-	bx              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
+	stmdb   r13!, {r0,lr}
+	mrs     r0, CPSR
+	bic     r0, r0, #0x80
+	msr     CPSR, r0
+	ldmia   r13!, {r0,pc}
+	bx      lr
 
 gp_disableIRQ:
-	STMDB    r13!,{r0,lr}
-	MRS      r0,CPSR
-	ORR      r0,r0,#0xc0
-	MSR      CPSR,r0
-	LDMIA    r13!,{r0,pc}
-	@MOV      pc,lr
+	stmdb   r13!, {r0,lr}
+	MRS     r0, CPSR
+	ORR     r0, r0, #0xc0
+	MSR     CPSR, r0
+	ldmia   r13!, {r0,pc}
+	bx      lr
 
 gp_installSWIIRQ:
-	STMDB    r13!,{r14}
-	SWI      0x9
-	LDMIA    r13!,{pc}
+	stmdb   r13!, {r14}
+	swi     0x9
+	ldmia   r13!, {pc}
+	bx      lr
 
 gp_removeSWIIRQ:
-	STMDB    r13!,{r14}
-	SWI      0xa
-	LDMIA    r13!,{pc}
+	stmdb   r13!, {r14}
+	swi     0xa
+	ldmia   r13!, {pc}
+	bx      lr
 
 
 @ ******** ASMFastSolidBlit(unsigned char *src4, unsigned char *dst4, int nbx, int nby, int height2, int trans, int coul) ********


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