Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Libretro
snes9x2002
Commits
56aa9b3c
Unverified
Commit
56aa9b3c
authored
Feb 06, 2021
by
Libretro-Admin
Committed by
GitHub
Feb 06, 2021
Browse files
Merge pull request #44 from fjtrujy/ps2-support
Add Ps2 support and solve BGR555 issues
parents
ff6a6e6e
b144a9f9
Pipeline
#14206
passed with stages
in 10 minutes and 56 seconds
Changes
5
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
56aa9b3c
...
...
@@ -50,6 +50,10 @@ include:
# PlayStation Vita
-
project
:
'
libretro-infrastructure/ci-templates'
file
:
'
/vita-static.yml'
# PlayStation PS2
-
project
:
'
libretro-infrastructure/ci-templates'
file
:
'
/ps2-static.yml'
# Nintendo 3DS
-
project
:
'
libretro-infrastructure/ci-templates'
...
...
@@ -157,6 +161,12 @@ libretro-build-vita:
-
.libretro-vita-static-retroarch-master
-
.core-defs
# PlayStation 2
libretro-build-ps2
:
extends
:
-
.libretro-ps2-static-retroarch-master
-
.core-defs
# Nintendo 3DS
libretro-build-ctr
:
extends
:
...
...
Makefile
View file @
56aa9b3c
...
...
@@ -170,6 +170,16 @@ else ifeq ($(platform), classic_armv7_a7)
endif
#######################################
else
ifeq
($(platform), ps2)
TARGET
:=
$(TARGET_NAME)
_libretro_
$(platform)
.a
CC
=
mips64r5900el-ps2-elf-gcc
$(EXE_EXT)
CXX
=
mips64r5900el-ps2-elf-g++
$(EXE_EXT)
AR
=
mips64r5900el-ps2-elf-ar
$(EXE_EXT)
STATIC_LINKING
=
1
LOAD_FROM_MEMORY_TEST
=
0
CFLAGS
+=
-DPS2
-G0
-DFRAME_SKIP
-fomit-frame-pointer
-ffast-math
STATIC_LINKING
:=
1
else
ifeq
($(platform), psp1)
TARGET
:=
$(TARGET_NAME)
_libretro_
$(platform)
.a
CC
=
psp-gcc
$(EXE_EXT)
...
...
@@ -335,7 +345,7 @@ LIBRETRO_DIR := ./libretro
ifeq
($(DEBUG), 1)
DEFINES
+=
-O0
-g
else
DEFINES
+=
-O
2
-DNDEBUG
=
1
DEFINES
+=
-O
3
-DNDEBUG
=
1
endif
LDFLAGS
+=
$(LIBM)
...
...
src/gfx.h
View file @
56aa9b3c
...
...
@@ -224,7 +224,7 @@ static INLINE uint16_t COLOR_ADD(uint16_t C1, uint16_t C2)
{
const
int
RED_MASK
=
0x1F
<<
RED_SHIFT_BITS
;
const
int
GREEN_MASK
=
0x1F
<<
GREEN_SHIFT_BITS
;
const
int
BLUE_MASK
=
0x1F
;
const
int
BLUE_MASK
=
0x1F
<<
BLUE_SHIFT_BITS
;
int
rb
=
(
C1
&
(
RED_MASK
|
BLUE_MASK
))
+
(
C2
&
(
RED_MASK
|
BLUE_MASK
));
int
rbcarry
=
rb
&
((
0x20
<<
RED_SHIFT_BITS
)
|
(
0x20
<<
0
));
...
...
src/pixform.h
View file @
56aa9b3c
...
...
@@ -88,6 +88,7 @@ extern uint32 HIGH_BITS_SHIFTED_TWO_MASK;
#define MAX_BLUE_RGB565 31
#define RED_SHIFT_BITS_RGB565 11
#define GREEN_SHIFT_BITS_RGB565 6
#define BLUE_SHIFT_BITS_RGB565 0
#define RED_LOW_BIT_MASK_RGB565 0x0800
#define GREEN_LOW_BIT_MASK_RGB565 0x0020
#define BLUE_LOW_BIT_MASK_RGB565 0x0001
...
...
@@ -99,6 +100,29 @@ extern uint32 HIGH_BITS_SHIFTED_TWO_MASK;
#define THIRD_COLOR_MASK_RGB565 0x001F
#define ALPHA_BITS_MASK_RGB565 0x0000
// BGR555 format
#define BUILD_PIXEL_BGR555(R,G,B) (((int) (B) << 10) | ((int) (G) << 5) | (int) (R))
#define BUILD_PIXEL2_BGR555(R,G,B) (((int) (B) << 10) | ((int) (G) << 5) | (int) (R))
#define DECOMPOSE_PIXEL_BGR555(PIX,R,G,B) {(B) = (PIX) >> 10; (G) = ((PIX) >> 5) & 0x1f; (R) = (PIX) & 0x1f; }
#define SPARE_RGB_BIT_MASK_BGR555 (1 << 5)
#define MAX_RED_BGR555 31
#define MAX_GREEN_BGR555 31
#define MAX_BLUE_BGR555 31
#define RED_SHIFT_BITS_BGR555 0
#define GREEN_SHIFT_BITS_BGR555 5
#define BLUE_SHIFT_BITS_BGR555 10
#define RED_LOW_BIT_MASK_BGR555 0x0001
#define GREEN_LOW_BIT_MASK_BGR555 0x0020
#define BLUE_LOW_BIT_MASK_BGR555 0x0400
#define RED_HI_BIT_MASK_BGR555 0x0010
#define GREEN_HI_BIT_MASK_BGR555 0x0200
#define BLUE_HI_BIT_MASK_BGR555 0x4000
#define FIRST_COLOR_MASK_BGR555 0x7C00
#define SECOND_COLOR_MASK_BGR555 0x03E0
#define THIRD_COLOR_MASK_BGR555 0x001F
#define ALPHA_BITS_MASK_BGR555 0x0000
// RGB555 format
#define BUILD_PIXEL_RGB555(R,G,B) (((int) (R) << 10) | ((int) (G) << 5) | (int) (B))
#define BUILD_PIXEL2_RGB555(R,G,B) (((int) (R) << 10) | ((int) (G) << 5) | (int) (B))
...
...
@@ -110,6 +134,7 @@ extern uint32 HIGH_BITS_SHIFTED_TWO_MASK;
#define MAX_BLUE_RGB555 31
#define RED_SHIFT_BITS_RGB555 10
#define GREEN_SHIFT_BITS_RGB555 5
#define BLUE_SHIFT_BITS_RGB555 0
#define RED_LOW_BIT_MASK_RGB555 0x0400
#define GREEN_LOW_BIT_MASK_RGB555 0x0020
#define BLUE_LOW_BIT_MASK_RGB555 0x0001
...
...
@@ -139,6 +164,7 @@ extern uint32 HIGH_BITS_SHIFTED_TWO_MASK;
#define MAX_GREEN_D(F) CONCAT(MAX_GREEN_,F)
#define RED_SHIFT_BITS_D(F) CONCAT(RED_SHIFT_BITS_, F)
#define GREEN_SHIFT_BITS_D(F) CONCAT(GREEN_SHIFT_BITS_, F)
#define BLUE_SHIFT_BITS_D(F) CONCAT(BLUE_SHIFT_BITS_, F)
#define RED_LOW_BIT_MASK_D(F) CONCAT(RED_LOW_BIT_MASK_,F)
#define BLUE_LOW_BIT_MASK_D(F) CONCAT(BLUE_LOW_BIT_MASK_,F)
#define GREEN_LOW_BIT_MASK_D(F) CONCAT(GREEN_LOW_BIT_MASK_,F)
...
...
@@ -155,6 +181,7 @@ extern uint32 HIGH_BITS_SHIFTED_TWO_MASK;
#define MAX_GREEN MAX_GREEN_D(PIXEL_FORMAT)
#define RED_SHIFT_BITS RED_SHIFT_BITS_D(PIXEL_FORMAT)
#define GREEN_SHIFT_BITS GREEN_SHIFT_BITS_D(PIXEL_FORMAT)
#define BLUE_SHIFT_BITS BLUE_SHIFT_BITS_D(PIXEL_FORMAT)
#define RED_LOW_BIT_MASK RED_LOW_BIT_MASK_D(PIXEL_FORMAT)
#define BLUE_LOW_BIT_MASK BLUE_LOW_BIT_MASK_D(PIXEL_FORMAT)
#define GREEN_LOW_BIT_MASK GREEN_LOW_BIT_MASK_D(PIXEL_FORMAT)
...
...
src/port.h
View file @
56aa9b3c
...
...
@@ -110,7 +110,11 @@ typedef short int16_32;
#define VAR_CYCLES
//#define SPC700_SHUTDOWN
#define FASTCALL
#if defined(PS2)
#define PIXEL_FORMAT BGR555
#else
#define PIXEL_FORMAT RGB565
#endif
#define CPU_SHUTDOWN
#define PACKING __attribute__ ((packed))
#define ALIGN_BY_ONE __attribute__ ((aligned (1), packed))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment