From: notaz Date: Sat, 15 Sep 2012 18:26:57 +0000 (+0300) Subject: split generic ARM code from gp2x X-Git-Tag: r1~8 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c8c88d89f9bb0df71360b3b68327300f686a1c20;p=fceu.git split generic ARM code from gp2x --- diff --git a/drivers/gp2x/asmutils.h b/drivers/arm/asmutils.h similarity index 78% rename from drivers/gp2x/asmutils.h rename to drivers/arm/asmutils.h index 090684e..cb1a36b 100644 --- a/drivers/gp2x/asmutils.h +++ b/drivers/arm/asmutils.h @@ -5,5 +5,5 @@ void block_andor(void *src, size_t n, int andpat, int orpat); void memset32(int *dest, int c, int count); void spend_cycles(int c); // utility void soft_scale(void *dst, unsigned short *pal, int line_offs, int lines); -void convert2RGB555(unsigned short *dst, unsigned char *src, unsigned short *pal, int count); +void do_clut(void *dst, const void *src, unsigned short *pal, int pixels); diff --git a/drivers/gp2x/asmutils.s b/drivers/arm/asmutils.s similarity index 96% rename from drivers/gp2x/asmutils.s rename to drivers/arm/asmutils.s index 9df1b2c..1eb1bfa 100644 --- a/drivers/gp2x/asmutils.s +++ b/drivers/arm/asmutils.s @@ -216,18 +216,18 @@ soft_scale_loop_line: 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 -convert2RGB555_loop: +do_clut_loop: 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 - bne convert2RGB555_loop + bne do_clut_loop ldmfd sp!,{r4-r8,lr} bx lr diff --git a/drivers/gp2x/gp2x-video.c b/drivers/gp2x/gp2x-video.c index c8b094c..312c83a 100644 --- a/drivers/gp2x/gp2x-video.c +++ b/drivers/gp2x/gp2x-video.c @@ -25,7 +25,7 @@ #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; diff --git a/drivers/gp2x/menu.c b/drivers/gp2x/menu.c index fa1fa97..e0fb738 100644 --- a/drivers/gp2x/menu.c +++ b/drivers/gp2x/menu.c @@ -10,7 +10,7 @@ #include "minimal.h" #include "usbjoy.h" -#include "asmutils.h" +#include "../arm/asmutils.h" #include "menu.h" #include "../common/main.h" #include "../libpicofe/fonts.h" diff --git a/drivers/gp2x/minimal.c b/drivers/gp2x/minimal.c index 34f5ea7..ce64dee 100644 --- a/drivers/gp2x/minimal.c +++ b/drivers/gp2x/minimal.c @@ -33,7 +33,7 @@ #include "minimal.h" #include "usbjoy.h" -#include "asmutils.h" +#include "../arm/asmutils.h" volatile unsigned short *gp2x_memregs; //static diff --git a/fce.c b/fce.c index 098d3b9..e83085e 100644 --- a/fce.c +++ b/fce.c @@ -56,8 +56,8 @@ #include "dprintf.h" -#ifdef GP2X -#include "drivers/gp2x/asmutils.h" +#ifdef __arm__ +#include "drivers/arm/asmutils.h" #endif #define Pal (PALRAM) @@ -660,7 +660,7 @@ static void LineUpdate(uint8 *target) static void LineUpdateEnd(uint8 *target) { -#ifdef GP2X +#ifdef __arm__ if(ScreenON || SpriteON) // Yes, very el-cheapo. { if(PPU[1]&0x01) diff --git a/ppu098.c b/ppu098.c index fe0e5c2..65bdafc 100644 --- a/ppu098.c +++ b/ppu098.c @@ -34,8 +34,8 @@ #include "video.h" #include "input.h" -#ifdef GP2X -#include "drivers/gp2x/asmutils.h" +#ifdef __arm__ +#include "drivers/arm/asmutils.h" #endif #define Pal (PALRAM) @@ -699,7 +699,7 @@ static void Fixit1(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; @@ -720,7 +720,7 @@ static void DoLine(void) if(SpriteON) CopySprites098(target); -#ifdef GP2X +#ifdef __arm__ if(ScreenON || SpriteON) // Yes, very el-cheapo. { if(PPU[1]&0x01)