aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorWon Star2006-03-23 03:02:04 +0000
committerWon Star2006-03-23 03:02:04 +0000
commit85661bca032adc646f9d6b82517d54b987767298 (patch)
tree3328648359025e1e2cd4f2178c064e01bfe365ef /backends
parentaad9a340bec73420bce59f87938e2b65147377ab (diff)
downloadscummvm-rg350-85661bca032adc646f9d6b82517d54b987767298.tar.gz
scummvm-rg350-85661bca032adc646f9d6b82517d54b987767298.tar.bz2
scummvm-rg350-85661bca032adc646f9d6b82517d54b987767298.zip
Update port.
* NO SOUND support. * New asm functions. * Prepare for MP3 / OGG svn-id: r21409
Diffstat (limited to 'backends')
-rw-r--r--backends/gp32/Makefile67
-rw-r--r--backends/gp32/gp32_launcher.cpp16
-rw-r--r--backends/gp32/gp32_osys.cpp13
-rw-r--r--backends/gp32/gp32_osys.h1
-rw-r--r--backends/gp32/gp32std.cpp1
-rw-r--r--backends/gp32/gp_asmlib.s45
6 files changed, 81 insertions, 62 deletions
diff --git a/backends/gp32/Makefile b/backends/gp32/Makefile
index 5d9895c09c..6048523e4e 100644
--- a/backends/gp32/Makefile
+++ b/backends/gp32/Makefile
@@ -37,29 +37,24 @@ CXXFLAGS+= -Wwrite-strings -fcheck-new -Wctor-dtor-privacy -Wnon-virtual-dtor
# 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 @@ CFLAGS = -marm -march=armv4t -mtune=arm920 -mapcs \
-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 @@ DEFINES += -DOUTPUT_UNSIGNED_AUDIO
# 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 @@ $(FXE): $(BIN)
$(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_HQ_SCALERS = 1
#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_SWORD2 = 1
# Disable for ALL release builds.
DISABLE_SAGA = 1
DISABLE_KYRA = 1
-DISABLE_GOB = 1
#######################################################################
# Misc stuff - you should normally never have to edit this #
diff --git a/backends/gp32/gp32_launcher.cpp b/backends/gp32/gp32_launcher.cpp
index 97e330f815..ef553f4e34 100644
--- a/backends/gp32/gp32_launcher.cpp
+++ b/backends/gp32/gp32_launcher.cpp
@@ -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 @@ void configMenu() {
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 @@ void configMenu() {
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();
diff --git a/backends/gp32/gp32_osys.cpp b/backends/gp32/gp32_osys.cpp
index 0f1f196183..d2e239361f 100644
--- a/backends/gp32/gp32_osys.cpp
+++ b/backends/gp32/gp32_osys.cpp
@@ -652,12 +652,18 @@ bool OSystem_GP32::setSoundCallback(SoundProc proc, void *param) {
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 @@ bool OSystem_GP32::setSoundCallback(SoundProc proc, void *param) {
void OSystem_GP32::clearSoundCallback() {
NP("OSys::clearSoundCallback()");
- gp_soundBufStop();
+ if (_samplesPerSec != 0)
+ gp_soundBufStop();
}
int OSystem_GP32::getOutputSampleRate() const {
diff --git a/backends/gp32/gp32_osys.h b/backends/gp32/gp32_osys.h
index 0f30366bff..2f1eeaf566 100644
--- a/backends/gp32/gp32_osys.h
+++ b/backends/gp32/gp32_osys.h
@@ -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"
diff --git a/backends/gp32/gp32std.cpp b/backends/gp32/gp32std.cpp
index ce4f129c2e..5ce9ddd4c4 100644
--- a/backends/gp32/gp32std.cpp
+++ b/backends/gp32/gp32std.cpp
@@ -25,7 +25,6 @@
#include "stdafx.h"
#include "common/scummsys.h"
-#include "common/scaler.h"
#include "common/system.h"
#include "backends/intern.h"
diff --git a/backends/gp32/gp_asmlib.s b/backends/gp32/gp_asmlib.s
index f00f39a573..7c3b03c168 100644
--- a/backends/gp32/gp_asmlib.s
+++ b/backends/gp32/gp_asmlib.s
@@ -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,11 +19,38 @@ cpu_speed:
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) ********