Commit 491d8d37 authored by fjtrujy's avatar fjtrujy
Browse files

Add PS2 platform

parent 4e4fccb0
......@@ -146,6 +146,17 @@ else ifeq ($(platform), sncps3)
STATIC_LINKING := 1
LIBS :=
# PS2
else ifeq ($(platform),ps2)
TARGET := $(TARGET_NAME)_libretro_$(platform).a
CC = ee-gcc$(EXE_EXT)
CXX = ee-g++$(EXE_EXT)
AR = ee-ar$(EXE_EXT)
FLAGS += -G0 -DPS2 -DABGR1555 -DHAVE_NO_LANGEXTRA
INCFLAGS_PLATFORM += -O3
STATIC_LINKING := 1
LIBS :=
# PSP
else ifeq ($(platform),psp1)
TARGET := $(TARGET_NAME)_libretro_$(platform).a
......
......@@ -23,6 +23,11 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
#include BLARGG_ENABLE_OPTIMIZER
#endif
#if defined(PS2)
#define __LONG_LONG_MAX__ 9223372036854775807LL
#define ULLONG_MAX (__LONG_LONG_MAX__ * 2ULL + 1)
#endif
Blip_Buffer::Blip_Buffer()
{
factor_ = (blip_u64)ULLONG_MAX;
......
......@@ -200,7 +200,11 @@ static void lynx_rotate()
switch (RETRO_PIX_DEPTH)
{
case 15: lynx->DisplaySetAttributes(lynx_rot, MIKIE_PIXEL_FORMAT_16BPP_555, RETRO_LYNX_WIDTH*2, lynx_display_callback, (ULONG)0); break;
#if defined(ABGR1555)
case 16: lynx->DisplaySetAttributes(lynx_rot, MIKIE_PIXEL_FORMAT_16BPP_BGR555, RETRO_LYNX_WIDTH*2, lynx_display_callback, (ULONG)0); break;
#else
case 16: lynx->DisplaySetAttributes(lynx_rot, MIKIE_PIXEL_FORMAT_16BPP_565, RETRO_LYNX_WIDTH*2, lynx_display_callback, (ULONG)0); break;
#endif
case 24: lynx->DisplaySetAttributes(lynx_rot, MIKIE_PIXEL_FORMAT_32BPP, RETRO_LYNX_WIDTH*4, lynx_display_callback, (ULONG)0); break;
default: lynx->DisplaySetAttributes(lynx_rot, MIKIE_PIXEL_FORMAT_32BPP, RETRO_LYNX_WIDTH*4, lynx_display_callback, (ULONG)0); break;
}
......
......@@ -872,6 +872,13 @@ void CMikie::DisplaySetAttributes(ULONG Rotate,ULONG Format,ULONG Pitch,UBYTE* (
mColourMap[Spot.Index]|=(Spot.Colours.Blue>>2)&0x03;
}
break;
case MIKIE_PIXEL_FORMAT_16BPP_BGR555:
for(Spot.Index=0;Spot.Index<4096;Spot.Index++) {
mColourMap[Spot.Index]=((Spot.Colours.Blue<<11)&0x7800) | (Spot.Colours.Blue<<7)&0x0400;
mColourMap[Spot.Index]|=((Spot.Colours.Green<<6)&0x03c0) | ((Spot.Colours.Green<<2)&0x0020);
mColourMap[Spot.Index]|=((Spot.Colours.Red<<1)&0x001e) | ((Spot.Colours.Red>>3)&0x0001);
}
break;
case MIKIE_PIXEL_FORMAT_16BPP_555:
for(Spot.Index=0;Spot.Index<4096;Spot.Index++) {
mColourMap[Spot.Index]=((Spot.Colours.Red<<11)&0x7800) | (Spot.Colours.Red<<7)&0x0400;
......@@ -987,7 +994,7 @@ ULONG CMikie::DisplayRenderLine(void)
bitmap_tmp+=sizeof(UBYTE);
}
}
} else if(mDisplayFormat==MIKIE_PIXEL_FORMAT_16BPP_555 || mDisplayFormat==MIKIE_PIXEL_FORMAT_16BPP_565) {
} else if(mDisplayFormat==MIKIE_PIXEL_FORMAT_16BPP_BGR555 || mDisplayFormat==MIKIE_PIXEL_FORMAT_16BPP_555 || mDisplayFormat==MIKIE_PIXEL_FORMAT_16BPP_565) {
for(loop=0;loop<SCREEN_WIDTH/2;loop++) {
source=mpRamPointer[mLynxAddr];
if(mDISPCTL_Flip) {
......@@ -1077,7 +1084,7 @@ ULONG CMikie::DisplayRenderLine(void)
}
}
mpDisplayCurrent-=sizeof(UBYTE);
} else if(mDisplayFormat==MIKIE_PIXEL_FORMAT_16BPP_555 || mDisplayFormat==MIKIE_PIXEL_FORMAT_16BPP_565) {
} else if(mDisplayFormat==MIKIE_PIXEL_FORMAT_16BPP_BGR555 || mDisplayFormat==MIKIE_PIXEL_FORMAT_16BPP_555 || mDisplayFormat==MIKIE_PIXEL_FORMAT_16BPP_565) {
for(loop=0;loop<SCREEN_WIDTH/2;loop++) {
source=mpRamPointer[mLynxAddr];
if(mDISPCTL_Flip) {
......@@ -1173,7 +1180,7 @@ ULONG CMikie::DisplayRenderLine(void)
}
}
mpDisplayCurrent+=sizeof(UBYTE);
} else if(mDisplayFormat==MIKIE_PIXEL_FORMAT_16BPP_555 || mDisplayFormat==MIKIE_PIXEL_FORMAT_16BPP_565) {
} else if(mDisplayFormat==MIKIE_PIXEL_FORMAT_16BPP_BGR555 || mDisplayFormat==MIKIE_PIXEL_FORMAT_16BPP_555 || mDisplayFormat==MIKIE_PIXEL_FORMAT_16BPP_565) {
for(loop=0;loop<SCREEN_WIDTH/2;loop++) {
source=mpRamPointer[mLynxAddr];
if(mDISPCTL_Flip) {
......@@ -1290,6 +1297,7 @@ ULONG CMikie::DisplayEndOfFrame(void)
case MIKIE_PIXEL_FORMAT_8BPP:
mpDisplayCurrent+=1*(HANDY_SCREEN_HEIGHT-1);
break;
case MIKIE_PIXEL_FORMAT_16BPP_BGR555:
case MIKIE_PIXEL_FORMAT_16BPP_555:
case MIKIE_PIXEL_FORMAT_16BPP_565:
mpDisplayCurrent+=2*(HANDY_SCREEN_HEIGHT-1);
......
......@@ -174,6 +174,7 @@ enum
enum
{
MIKIE_PIXEL_FORMAT_8BPP=0,
MIKIE_PIXEL_FORMAT_16BPP_BGR555,
MIKIE_PIXEL_FORMAT_16BPP_555,
MIKIE_PIXEL_FORMAT_16BPP_565,
MIKIE_PIXEL_FORMAT_24BPP,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment