diff options
author | John Willis | 2007-06-26 08:50:11 +0000 |
---|---|---|
committer | John Willis | 2007-06-26 08:50:11 +0000 |
commit | 11fccdbff242ec238d9ccd86525bfa5a41be01bc (patch) | |
tree | 000f978497697b56311fd2602bcb4ed64fde3a96 /backends/platform/gp2x/gp2x-hw.cpp | |
parent | cf0eb563adb10454b1a4c9b0d7c387526b348b30 (diff) | |
download | scummvm-rg350-11fccdbff242ec238d9ccd86525bfa5a41be01bc.tar.gz scummvm-rg350-11fccdbff242ec238d9ccd86525bfa5a41be01bc.tar.bz2 scummvm-rg350-11fccdbff242ec238d9ccd86525bfa5a41be01bc.zip |
Cleanup of the GP2X port to fix compile issues (and the odd warning).
svn-id: r27728
Diffstat (limited to 'backends/platform/gp2x/gp2x-hw.cpp')
-rw-r--r-- | backends/platform/gp2x/gp2x-hw.cpp | 49 |
1 files changed, 30 insertions, 19 deletions
diff --git a/backends/platform/gp2x/gp2x-hw.cpp b/backends/platform/gp2x/gp2x-hw.cpp index d1b6f80a1e..d322aa5d08 100644 --- a/backends/platform/gp2x/gp2x-hw.cpp +++ b/backends/platform/gp2x/gp2x-hw.cpp @@ -33,17 +33,20 @@ #include "gp2x-common.h" #include "gp2x-hw.h" +#include "gp2x-mem.h" -// Linux includes to let us goof about with the system. +// Linux includes to let us goof about with the system in a 'standard' way. +#include <fcntl.h> +#include <pthread.h> +#include <signal.h> +#include <stdlib.h> +#include <stdio.h> +#include <string.h> #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; +#include <sys/time.h> +#include <unistd.h> /* system registers */ static struct @@ -67,19 +70,27 @@ void GP2X_device_init() { void GP2X_device_deinit() { // Close devices - if (gp2x_dev[0]) close(gp2x_dev[0]); - if (gp2x_dev[1]) close(gp2x_dev[1]); - if (gp2x_dev[2]) close(gp2x_dev[2]); - - MEM_REG[0x91c>>1]=system_reg.SYSCSETREG; - MEM_REG[0x910>>1]=system_reg.FPLLVSETREG; - MEM_REG[0x3B40>>1]=system_reg.DUALINT920; - MEM_REG[0x3B42>>1]=system_reg.DUALINT940; - MEM_REG[0x3B48>>1]=system_reg.DUALCTRL940; - MEM_REG[0x904>>1]=system_reg.SYSCLKENREG; - MEM_REG[0x924>>1]=dispclockdiv; -} + { + int i; + for(i=0;i<8;i++) + { + if(gp2x_dev[i]) + { + close(gp2x_dev[i]); + } + } + } + + MEM_REG[0x91c>>1] = system_reg.SYSCSETREG; + MEM_REG[0x910>>1] = system_reg.FPLLVSETREG; + MEM_REG[0x3B40>>1] = system_reg.DUALINT920; + MEM_REG[0x3B42>>1] = system_reg.DUALINT940; + MEM_REG[0x3B48>>1] = system_reg.DUALCTRL940; + MEM_REG[0x904>>1] = system_reg.SYSCLKENREG; + MEM_REG[0x924>>1] = dispclockdiv; + unpatchMMU(); +} // Vairous mixer level fudges. // TODO: Clean up and merge quick hacks. |