diff options
author | John Willis | 2006-10-25 19:51:47 +0000 |
---|---|---|
committer | John Willis | 2006-10-25 19:51:47 +0000 |
commit | 77f9f9c6cfc0834492b6e2afd428e87cdff35349 (patch) | |
tree | 9e9a3eb28ef59be196d7c3bc418e320988ae168f /backends/platform/gp2x/gp2x-hw.cpp | |
parent | aada1329a8119715c12455790f8c093c5e67fc39 (diff) | |
download | scummvm-rg350-77f9f9c6cfc0834492b6e2afd428e87cdff35349.tar.gz scummvm-rg350-77f9f9c6cfc0834492b6e2afd428e87cdff35349.tar.bz2 scummvm-rg350-77f9f9c6cfc0834492b6e2afd428e87cdff35349.zip |
Update GP2X port to support Fingolfin's ongoing implementation of the Modular Backends ideas :). Also add a few updates from my local tree (Batt level checking and STDOUT/STDERR file mapping code stolen from the Symbian backend (thanks)).
svn-id: r24507
Diffstat (limited to 'backends/platform/gp2x/gp2x-hw.cpp')
-rw-r--r-- | backends/platform/gp2x/gp2x-hw.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/backends/platform/gp2x/gp2x-hw.cpp b/backends/platform/gp2x/gp2x-hw.cpp index e967b6df62..9f573c86e0 100644 --- a/backends/platform/gp2x/gp2x-hw.cpp +++ b/backends/platform/gp2x/gp2x-hw.cpp @@ -37,6 +37,9 @@ #include <sys/mman.h> #include <sys/ioctl.h> #include <sys/soundcard.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> static unsigned long gp2x_dev[8]={0,0,0,0,0,0,0,0};//, gp2x_ticks_per_second; static volatile unsigned short *gp2x_memregs; @@ -138,6 +141,15 @@ void GP2X_setCpuspeed(unsigned int mhz) set_920_Div(0); } +int GP2X_getBattLevel() { + int devbatt; + unsigned short currentval=0; + devbatt = open("/dev/batt", O_RDONLY); + read (devbatt, ¤tval, 2); + close (devbatt); + return (currentval); +} + void set_display_clock_div(unsigned div) { div=((div & 63) | 64)<<8; |