Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
  • 2 commits
  • 1 file changed
  • 0 commit comments
  • 1 contributor
Showing with 12 additions and 50 deletions.
  1. +12 −50 src-0.2.97.27/src/burn/drv/cps3/cps3run.cpp
View
62 src-0.2.97.27/src/burn/drv/cps3/cps3run.cpp
@@ -20,10 +20,6 @@ Port to FBA by OopsWare
#include "cps3.h"
#include "sh2.h"
-#ifdef __LIBRETRO_OPTIMIZATIONS__
-#include "burn_libretro_opts.h"
-#endif
-
#define BE_GFX 1
//#define FAST_BOOT 1
#define SPEED_HACK 1 // Default should be 1, if not FPS would drop.
@@ -51,11 +47,8 @@ static UINT8 *RamC000_D;
static UINT16 *EEPROM;
-#ifndef __LIBRETRO_OPTIMIZATIONS__
UINT16 *Cps3CurPal;
-#endif
-
-static UINT32 *RamScreen;
+static UINT16 *RamScreen;
UINT8 cps3_reset = 0;
UINT8 cps3_palette_change = 0;
@@ -517,10 +510,8 @@ static INT32 MemIndex()
RamEnd = Next;
-#ifndef __LIBRETRO_OPTIMIZATIONS__
Cps3CurPal = (UINT16 *) Next; Next += 0x020001 * sizeof(UINT16); // iq_132 - layer disable
-#endif
- RamScreen = (UINT32 *) Next; Next += (512 * 2) * (224 * 2 + 32) * sizeof(UINT32);
+ RamScreen = (UINT16 *) Next; Next += (512 * 2) * (224 * 2 + 32) * sizeof(UINT16);
MemEnd = Next;
return 0;
@@ -711,28 +702,18 @@ void __fastcall cps3WriteWord(UINT32 addr, UINT16 data)
UINT32 b = (coldata & 0x7C00) >> 10;
if (paldma_fade!=0) {
INT32 fade;
- fade = (paldma_fade & 0x3f000000)>>24;
- r = (r*fade)>>5;
- if (r>0x1f) r = 0x1f;
- fade = (paldma_fade & 0x003f0000)>>16;
- g = (g*fade)>>5;
- if (g>0x1f) g = 0x1f;
- fade = (paldma_fade & 0x0000003f)>> 0;
- b = (b*fade)>>5;
- if (b>0x1f) b = 0x1f;
+ fade = (paldma_fade & 0x3f000000)>>24; r = (r*fade)>>5; if (r>0x1f) r = 0x1f;
+ fade = (paldma_fade & 0x003f0000)>>16; g = (g*fade)>>5; if (g>0x1f) g = 0x1f;
+ fade = (paldma_fade & 0x0000003f)>> 0; b = (b*fade)>>5; if (b>0x1f) b = 0x1f;
coldata = (r << 0) | (g << 5) | (b << 10);
}
-#ifdef __LIBRETRO_OPTIMIZATIONS__
- RamPal[(paldma_dest + i)] = LIBRETRO_COLOR_15BPP_BGR(coldata);
-#else
r = r << 3;
g = g << 3;
b = b << 3;
RamPal[(paldma_dest + i)] = coldata;
Cps3CurPal[(paldma_dest + i) ] = BurnHighCol(r, g, b, 0);
-#endif
}
Sh2SetIRQLine(10, SH2_IRQSTATUS_AUTO);
}
@@ -996,7 +977,6 @@ void __fastcall cps3VidWriteWord(UINT32 addr, UINT16 data)
RamPal[palindex] = data;
#endif
-#ifndef __LIBRETRO_OPTIMIZATIONS__
INT32 r = (data & 0x001F) << 3; // Red
INT32 g = (data & 0x03E0) >> 2; // Green
INT32 b = (data & 0x7C00) >> 7; // Blue
@@ -1006,7 +986,7 @@ void __fastcall cps3VidWriteWord(UINT32 addr, UINT16 data)
b |= b >> 5;
Cps3CurPal[palindex] = BurnHighCol(r, g, b, 0);
-#endif
+
}
#ifndef __LIBRETRO_OPTIMIZATIONS__
else
@@ -1302,11 +1282,7 @@ INT32 cps3Init()
cps3SndSetRoute(BURN_SND_CPS3SND_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT);
cps3SndSetRoute(BURN_SND_CPS3SND_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT);
-#ifdef __LIBRETRO_OPTIMIZATIONS__
- pBurnDrvPalette = (UINT32*)RamPal;
-#else
pBurnDrvPalette = (UINT32*)Cps3CurPal;
-#endif
Cps3Reset();
return 0;
@@ -1329,11 +1305,7 @@ static void cps3_drawgfxzoom_0(UINT32 code, UINT32 pal, INT32 flipx, INT32 flipy
if ((x > (cps3_gfx_width - 8)) || (y > (cps3_gfx_height - 8))) return;
UINT16 * dst = (UINT16 *) pBurnDraw;
UINT8 * src = (UINT8 *)RamSS;
-#ifdef __LIBRETRO_OPTIMIZATIONS__
- UINT16 * color = RamPal + (pal << 4);
-#else
UINT16 * color = Cps3CurPal + (pal << 4);
-#endif
dst += (y * cps3_gfx_width + x);
src += code * 64;
@@ -1442,7 +1414,7 @@ static void cps3_drawgfxzoom_0(UINT32 code, UINT32 pal, INT32 flipx, INT32 flipy
static void cps3_drawgfxzoom_1(UINT32 code, UINT32 pal, INT32 flipx, INT32 flipy, INT32 x, INT32 y, INT32 drawline)
{
- UINT32 * dst = RamScreen;
+ UINT16 * dst = RamScreen;
UINT8 * src = (UINT8 *) RamCRam;
dst += (drawline * 1024 + x);
@@ -1666,7 +1638,7 @@ static void cps3_drawgfxzoom_2(UINT32 code, UINT32 pal, INT32 flipx, INT32 flipy
case 0:
for( INT32 y=sy; y<ey; y++ ) {
UINT8 * source = source_base + (y_index>>16) * 16;
- UINT32 * dest = RamScreen + y * 512 * 2;
+ UINT16 * dest = RamScreen + y * 512 * 2;
INT32 x_index = x_index_base;
for(INT32 x=sx; x<ex; x++ ) {
#if BE_GFX
@@ -1683,7 +1655,7 @@ static void cps3_drawgfxzoom_2(UINT32 code, UINT32 pal, INT32 flipx, INT32 flipy
case 6:
for( INT32 y=sy; y<ey; y++ ) {
UINT8 * source = source_base + (y_index>>16) * 16;
- UINT32 * dest = RamScreen + y * 512 * 2;
+ UINT16 * dest = RamScreen + y * 512 * 2;
INT32 x_index = x_index_base;
for(INT32 x=sx; x<ex; x++ ) {
#if BE_GFX
@@ -1700,7 +1672,7 @@ static void cps3_drawgfxzoom_2(UINT32 code, UINT32 pal, INT32 flipx, INT32 flipy
case 8:
for( INT32 y=sy; y<ey; y++ ) {
UINT8 * source = source_base + (y_index>>16) * 16;
- UINT32 * dest = RamScreen + y * 512 * 2;
+ UINT16 * dest = RamScreen + y * 512 * 2;
INT32 x_index = x_index_base;
for(INT32 x=sx; x<ex; x++ ) {
#if BE_GFX
@@ -1814,16 +1786,14 @@ static void DrvDraw()
if (nBurnLayer & 1)
{
- UINT32 * pscr = RamScreen;
+ UINT16 * pscr = RamScreen;
INT32 clrsz = (cps3_gfx_max_x + 1) * sizeof(INT32);
for(INT32 yy = 0; yy<=cps3_gfx_max_y; yy++, pscr += 512*2)
memset(pscr, 0, clrsz);
}
else
{
-#ifndef __LIBRETRO_OPTIMIZATIONS__
Cps3CurPal[0x20000] = BurnHighCol(0xff, 0x00, 0xff, 0);
-#endif
INT32 i;
for (i = 0; i < 1024 * 448; i++) {
@@ -2003,18 +1973,14 @@ static void DrvDraw()
{
UINT32 srcx, srcy = 0;
- UINT32 * srcbitmap;
+ UINT16 * srcbitmap;
UINT16 * dstbitmap = (UINT16 * )pBurnDraw;
for (INT32 rendery=0; rendery<224; rendery++) {
srcbitmap = RamScreen + (srcy >> 16) * 1024;
srcx=0;
for (INT32 renderx=0; renderx<cps3_gfx_width; renderx++, dstbitmap ++) {
-#ifdef __LIBRETRO_OPTIMIZATIONS__
- *dstbitmap = RamPal[ srcbitmap[srcx>>16] ];
-#else
*dstbitmap = Cps3CurPal[ srcbitmap[srcx>>16] ];
-#endif
srcx += fsz;
}
srcy += fsz;
@@ -2050,7 +2016,6 @@ INT32 cps3Frame()
if (cps3_reset)
Cps3Reset();
-#ifndef __LIBRETRO_OPTIMIZATIONS__
if (cps3_palette_change) {
for(INT32 i=0;i<0x0020000;i++) {
#ifdef LSB_FIRST
@@ -2068,7 +2033,6 @@ INT32 cps3Frame()
}
cps3_palette_change = 0;
}
-#endif
if (WideScreenFrameDelay == GetCurrentFrame()) {
BurnDrvGetVisibleSize(&cps3_gfx_width, &cps3_gfx_height);
@@ -2213,10 +2177,8 @@ INT32 cps3Scan(INT32 nAction, INT32 *pnMin)
if (nAction & ACB_WRITE) {
-#ifndef __LIBRETRO_OPTIMIZATIONS__
// rebuild current palette
cps3_palette_change = 1;
-#endif
// remap RamCRam
Sh2MapMemory(((UINT8 *)RamCRam) + (cram_bank << 20), 0x04100000, 0x041fffff, SH2_RAM);

No commit comments for this range

Something went wrong with that request. Please try again.