split generic ARM code from gp2x
authornotaz <notasas@gmail.com>
Sat, 15 Sep 2012 18:26:57 +0000 (21:26 +0300)
committernotaz <notasas@gmail.com>
Sat, 15 Sep 2012 18:26:57 +0000 (21:26 +0300)
drivers/arm/asmutils.h [moved from drivers/gp2x/asmutils.h with 78% similarity]
drivers/arm/asmutils.s [moved from drivers/gp2x/asmutils.s with 96% similarity]
drivers/gp2x/gp2x-video.c
drivers/gp2x/menu.c
drivers/gp2x/minimal.c
fce.c
ppu098.c

similarity index 78%
rename from drivers/gp2x/asmutils.h
rename to drivers/arm/asmutils.h
index 090684e..cb1a36b 100644 (file)
@@ -5,5 +5,5 @@ void block_andor(void *src, size_t n, int andpat, int orpat);
 void memset32(int *dest, int c, int count);\r
 void spend_cycles(int c); // utility\r
 void soft_scale(void *dst, unsigned short *pal, int line_offs, int lines);\r
 void memset32(int *dest, int c, int count);\r
 void spend_cycles(int c); // utility\r
 void soft_scale(void *dst, unsigned short *pal, int line_offs, int lines);\r
-void convert2RGB555(unsigned short *dst, unsigned char *src, unsigned short *pal, int count);\r
+void do_clut(void *dst, const void *src, unsigned short *pal, int pixels);\r
 \r
 \r
similarity index 96%
rename from drivers/gp2x/asmutils.s
rename to drivers/arm/asmutils.s
index 9df1b2c..1eb1bfa 100644 (file)
@@ -216,18 +216,18 @@ soft_scale_loop_line:
     bx      lr
 
 
     bx      lr
 
 
-@ void convert2RGB555(unsigned short *dst, unsigned char *src, unsigned short *pal, int count);
+@ void do_clut(unsigned short *dst, unsigned char *src, unsigned short *pal, int pixels);
 
 
-.global convert2RGB555
+.global do_clut
 
 
-convert2RGB555:
+do_clut:
     stmfd   sp!,{r4-r8,lr}
     mov     lr, #0xff
     mov     lr, lr, lsl #1
 
     mov     r3, r3, lsr #3
 
     stmfd   sp!,{r4-r8,lr}
     mov     lr, #0xff
     mov     lr, lr, lsl #1
 
     mov     r3, r3, lsr #3
 
-convert2RGB555_loop:
+do_clut_loop:
     ldmia   r1!,{r4,r5}
 
     and     r6, lr, r4, lsl #1
     ldmia   r1!,{r4,r5}
 
     and     r6, lr, r4, lsl #1
@@ -254,7 +254,7 @@ convert2RGB555_loop:
 
     stmia   r0!,{r6,r7,r8,r12}
     subs    r3, r3, #1
 
     stmia   r0!,{r6,r7,r8,r12}
     subs    r3, r3, #1
-    bne     convert2RGB555_loop
+    bne     do_clut_loop
 
     ldmfd   sp!,{r4-r8,lr}
     bx      lr
 
     ldmfd   sp!,{r4-r8,lr}
     bx      lr
index c8b094c..312c83a 100644 (file)
@@ -25,7 +25,7 @@
 #include "../common/settings.h"
 #include "minimal.h"
 #include "../libpicofe/fonts.h"
 #include "../common/settings.h"
 #include "minimal.h"
 #include "../libpicofe/fonts.h"
-#include "asmutils.h"
+#include "../arm/asmutils.h"
 
 static char fps_str[32];
 static int framesEmulated, framesRendered;
 
 static char fps_str[32];
 static int framesEmulated, framesRendered;
index fa1fa97..e0fb738 100644 (file)
@@ -10,7 +10,7 @@
 \r
 #include "minimal.h"\r
 #include "usbjoy.h"\r
 \r
 #include "minimal.h"\r
 #include "usbjoy.h"\r
-#include "asmutils.h"\r
+#include "../arm/asmutils.h"\r
 #include "menu.h"\r
 #include "../common/main.h"\r
 #include "../libpicofe/fonts.h"\r
 #include "menu.h"\r
 #include "../common/main.h"\r
 #include "../libpicofe/fonts.h"\r
index 34f5ea7..ce64dee 100644 (file)
@@ -33,7 +33,7 @@
 \r
 #include "minimal.h"\r
 #include "usbjoy.h"\r
 \r
 #include "minimal.h"\r
 #include "usbjoy.h"\r
-#include "asmutils.h"\r
+#include "../arm/asmutils.h"\r
 \r
 volatile unsigned short *gp2x_memregs;\r
 //static\r
 \r
 volatile unsigned short *gp2x_memregs;\r
 //static\r
diff --git a/fce.c b/fce.c
index 098d3b9..e83085e 100644 (file)
--- a/fce.c
+++ b/fce.c
@@ -56,8 +56,8 @@
 
 #include        "dprintf.h"
 
 
 #include        "dprintf.h"
 
-#ifdef GP2X
-#include       "drivers/gp2x/asmutils.h"
+#ifdef __arm__
+#include       "drivers/arm/asmutils.h"
 #endif
 
 #define Pal     (PALRAM)
 #endif
 
 #define Pal     (PALRAM)
@@ -660,7 +660,7 @@ static void LineUpdate(uint8 *target)
 
 static void LineUpdateEnd(uint8 *target)
 {
 
 static void LineUpdateEnd(uint8 *target)
 {
-#ifdef GP2X
+#ifdef __arm__
  if(ScreenON || SpriteON)  // Yes, very el-cheapo.
  {
   if(PPU[1]&0x01)
  if(ScreenON || SpriteON)  // Yes, very el-cheapo.
  {
   if(PPU[1]&0x01)
index fe0e5c2..65bdafc 100644 (file)
--- a/ppu098.c
+++ b/ppu098.c
@@ -34,8 +34,8 @@
 #include  "video.h"
 #include  "input.h"
 
 #include  "video.h"
 #include  "input.h"
 
-#ifdef GP2X
-#include       "drivers/gp2x/asmutils.h"
+#ifdef __arm__
+#include       "drivers/arm/asmutils.h"
 #endif
 
 #define Pal     (PALRAM)
 #endif
 
 #define Pal     (PALRAM)
@@ -699,7 +699,7 @@ static void Fixit1(void)
 void MMC5_hb(int);     /* Ugh ugh ugh. */
 static void DoLine(void)
 {
 void MMC5_hb(int);     /* Ugh ugh ugh. */
 static void DoLine(void)
 {
-#ifndef GP2X
+#ifndef __arm__
  int x;
 #endif
  uint8 *target=XBuf+scanline*320+32;
  int x;
 #endif
  uint8 *target=XBuf+scanline*320+32;
@@ -720,7 +720,7 @@ static void DoLine(void)
  if(SpriteON)
   CopySprites098(target);
 
  if(SpriteON)
   CopySprites098(target);
 
-#ifdef GP2X
+#ifdef __arm__
  if(ScreenON || SpriteON)  // Yes, very el-cheapo.
  {
   if(PPU[1]&0x01)
  if(ScreenON || SpriteON)  // Yes, very el-cheapo.
  {
   if(PPU[1]&0x01)