1
0
mirror of https://github.com/libretro/RetroArch synced 2024-07-03 00:38:44 +00:00

[PS2] Improve Compilation (#13359)

* Allow parallel compilation in PS2

* Allow to compile with griffin or common compilation in PS2

* Enable dummy core to be used in other platforms

* Use threads in YML config

* Add the compilation to PS2 in GitHub Actions
This commit is contained in:
Francisco Javier Trujillo Mata 2021-12-15 19:01:56 +01:00 committed by GitHub
parent 688c652673
commit 1cd0938cc3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 274 additions and 195 deletions

38
.github/workflows/PS2.yml vendored Normal file
View File

@ -0,0 +1,38 @@
name: CI PS2
on:
push:
pull_request:
repository_dispatch:
types: [run_build]
jobs:
build:
runs-on: ubuntu-latest
container:
image: git.libretro.com:5050/libretro-infrastructure/libretro-build-ps2:latest
options: --user root
steps:
- uses: actions/checkout@v2
- name: Compile Salamander
run: |
make -f Makefile.ps2.salamander -j$(getconf _NPROCESSORS_ONLN) clean
make -f Makefile.ps2.salamander -j$(getconf _NPROCESSORS_ONLN) release
- name: Compile RA
run: |
make -f Makefile.ps2 -j$(getconf _NPROCESSORS_ONLN) clean
make -f Makefile.ps2 -j$(getconf _NPROCESSORS_ONLN) HAVE_STATIC_DUMMY=1 release
- name: Get short SHA
id: slug
run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"
- uses: actions/upload-artifact@v2
with:
name: RA-PS2-dummy-${{ steps.slug.outputs.sha8 }}
path: |
raboot.elf
retroarchps2.elf

3
.gitignore vendored
View File

@ -198,8 +198,7 @@ retroarch_switch.nro
retroarch_switch.nso
# PS2
ps2/irx/*.c
*.irx
*_irx.c
# Wayland
gfx/common/wayland/idle-inhibit-unstable-v1.c

View File

@ -688,6 +688,8 @@ build-static-retroarch-dummy-vita:
build-static-retroarch-ps2:
image: $CI_SERVER_HOST:5050/libretro-infrastructure/libretro-build-ps2:latest
stage: prepare-for-static-cores
before_script:
- export NUMPROC=$(($(nproc)/3))
artifacts:
paths:
- retroarch-precompiled/
@ -698,8 +700,7 @@ build-static-retroarch-ps2:
- build-static-retroarch-dummy-ps2
script:
# Allow failure since we don't have a core
# PS2 makefile for now doesn't allow -jX so this is why is hardcoded to -j1
- "make -f Makefile.ps2 -j1 ||:"
- "make -f Makefile.ps2 -j$NUMPROC ||:"
- "mkdir .retroarch-precompiled"
- "cp -r ./* .retroarch-precompiled/"
- "mv .retroarch-precompiled/ retroarch-precompiled/"
@ -708,8 +709,7 @@ build-static-retroarch-dummy-ps2:
image: $CI_SERVER_HOST:5050/libretro-infrastructure/libretro-build-ps2:latest
stage: build
before_script:
# PS2 doesn't allow to use -jX for now
- export NUMPROC=1
- export NUMPROC=$(($(nproc)/3))
artifacts:
paths:
- raboot.elf

View File

@ -198,6 +198,10 @@ ifeq ($(TARGET), retroarch_3ds)
OBJ += frontend/drivers/platform_ctr.o
endif
ifeq ($(TARGET), retroarch_ps2)
OBJ += frontend/drivers/platform_ps2.o
endif
# Git Version
GIT_VERSION_CACHEDIR = $(if $(OBJDIR),$(OBJDIR),$(CURDIR))
GIT_VERSION_CACHEFILE = $(GIT_VERSION_CACHEDIR)/git-version.cache
@ -378,6 +382,10 @@ DEFINES += -DHAVE_VIDEO_FILTER
OBJ += gfx/video_filter.o
endif
ifeq ($(HAVE_WINDOW_OFFSET), 1)
DEFINES += -DHAVE_WINDOW_OFFSET
endif
OBJ += $(LIBRETRO_COMM_DIR)/audio/resampler/audio_resampler.o
ifeq ($(HAVE_DSP_FILTER), 1)
@ -823,6 +831,10 @@ ifeq ($(TARGET), retroarch_3ds)
OBJ += gfx/drivers_font/ctr_font.o
endif
ifeq ($(TARGET), retroarch_ps2)
OBJ += gfx/drivers_font/ps2_font.o
endif
ifeq ($(HAVE_LIBNX), 1)
OBJ += gfx/drivers_font/switch_font.o
endif
@ -1169,6 +1181,13 @@ ifeq ($(TARGET), retroarch_3ds)
input/drivers_joypad/ctr_joypad.o
endif
ifeq ($(TARGET), retroarch_ps2)
OBJ += gfx/drivers/ps2_gfx.o \
input/drivers/ps2_input.o \
input/drivers_joypad/ps2_joypad.o \
audio/drivers/ps2_audio.o
endif
ifeq ($(TARGET), retroarch_orbis)
OBJ += input/drivers/ps4_input.o \
input/drivers_joypad/ps4_joypad.o \

View File

@ -1197,6 +1197,10 @@ ifeq ($(HAVE_FILTERS_BUILTIN), 1)
CFLAGS += -DHAVE_FILTERS_BUILTIN
endif
ifeq ($(HAVE_WINDOW_OFFSET), 1)
CFLAGS += -DHAVE_WINDOW_OFFSET
endif
ifeq ($(HAVE_THREADS), 1)
CFLAGS += -DHAVE_THREADS

View File

@ -1,61 +1,33 @@
TARGET := retroarch_ps2
TARGET_RELEASE = retroarchps2.elf
BUILD_FOR_PCSX2 = 0
DEBUG = 0
SCREEN_DEBUG = 0
GRIFFIN_BUILD = 0
HAVE_THREADS = 0
MUTE_WARNINGS = 1
WHOLE_ARCHIVE_LINK = 0
HAVE_STATIC_DUMMY ?= 0
PS2_IP = 192.168.1.10
TARGET = retroarchps2-debug.elf
TARGET_RELEASE = retroarchps2.elf
# Compile the IRXs first
IRX_DIR = ps2/irx
ifeq ($(DEBUG), 1)
OPTIMIZE_LV := -O0 -g
RARCH_DEFINES += -DDEBUG
DEFINES += -DDEBUG
else
OPTIMIZE_LV := -O3
LDFLAGS := -s
# LDFLAGS := -s
endif
ifeq ($(MUTE_WARNINGS), 1)
DISABLE_WARNINGS := -Wno-unused -Wno-format -Wno-format-truncation
endif
INCDIR = -I$(PS2DEV)/gsKit/include -I$(PS2SDK)/ports/include
INCDIR += -Ips2/include -Ilibretro-common/include -Ideps -Ideps/stb -Ideps/7zip
CFLAGS = $(OPTIMIZE_LV) $(DISABLE_WARNINGS) -ffast-math -fsingle-precision-constant
ASFLAGS = $(CFLAGS)
RARCH_DEFINES += -DPS2 \
-DHAVE_GRIFFIN=1 \
-DRARCH_INTERNAL \
-DHAVE_SCREENSHOTS \
-DHAVE_REWIND \
-DRARCH_CONSOLE \
-DHAVE_MENU \
-DHAVE_CONFIGFILE \
-DHAVE_PATCH \
-DHAVE_CHEATS \
-DHAVE_ZLIB \
-DHAVE_NO_BUILTINZLIB \
-DHAVE_RPNG \
-DHAVE_RJPEG \
-DHAVE_FILTERS_BUILTIN \
-DHAVE_7ZIP \
-D_7ZIP_ST \
-DHAVE_CC_RESAMPLER \
-DHAVE_AUDIOMIXER \
-DHAVE_WINDOW_OFFSET \
-DHAVE_VIDEO_FILTER \
-DHAVE_RGUI \
-DHAVE_DSP_FILTER \
-DHAVE_CORE_INFO_CACHE
LDFLAGS += -L$(PS2DEV)/gsKit/lib -L$(PS2SDK)/ports/lib -L.
# Lib cdvd is needed to get proper time
LIBS += -lretro_ps2 -lpatches -lgskit -ldmakit -laudsrv -lmtap -lpadx -lz -lcdvd -lelf-loader -lfileXio -lpoweroff
ifeq ($(HAVE_STATIC_DUMMY),1)
DEFINES += -DHAVE_STATIC_DUMMY
else
LIBS += -lretro_ps2
endif
ifeq ($(SCREEN_DEBUG), 1)
LIBS += -ldebug
@ -66,25 +38,73 @@ ifeq ($(BUILD_FOR_PCSX2), 1)
RARCH_DEFINES += -DBUILD_FOR_PCSX2
endif
ifeq ($(HAVE_THREADS), 1)
RARCH_DEFINES += -DHAVE_THREADS
DEFINES += -DRARCH_INTERNAL -DRARCH_CONSOLE
ifeq ($(GRIFFIN_BUILD), 1)
OBJ += griffin/griffin.o
DEFINES += -DHAVE_GRIFFIN=1 -DHAVE_SCREENSHOTS -DHAVE_REWIND -DHAVE_MENU -DHAVE_CONFIGFILE -DHAVE_PATCH -DHAVE_CHEATS
DEFINES += -DHAVE_ZLIB -DHAVE_NO_BUILTINZLIB -DHAVE_RPNG -DHAVE_RJPEG -DHAVE_FILTERS_BUILTIN -DHAVE_7ZIP -D_7ZIP_ST -DHAVE_CC_RESAMPLER -DHAVE_AUDIOMIXER
DEFINES += -DHAVE_VIDEO_FILTER -DHAVE_RGUI -DHAVE_WINDOW_OFFSET
DEFINES += -DHAVE_DSP_FILTER
else
HAVE_CC_RESAMPLER = 1
HAVE_MENU_COMMON = 1
HAVE_RPNG = 1
HAVE_RJPEG = 1
HAVE_RBMP = 1
HAVE_MENU = 1
HAVE_CONFIGFILE = 1
HAVE_PATCH = 1
HAVE_CHEATS = 1
HAVE_RGUI = 1
HAVE_ZLIB = 1
HAVE_NO_BUILTINZLIB = 1
HAVE_7ZIP = 1
HAVE_SCREENSHOTS = 1
HAVE_REWIND = 1
HAVE_AUDIOMIXER = 1
HAVE_RWAV = 1
HAVE_DSP_FILTER = 1
HAVE_VIDEO_FILTER = 1
HAVE_FILTERS_BUILTIN = 1
HAVE_WINDOW_OFFSET = 1
include Makefile.common
CFLAGS += $(DEF_FLAGS)
BLACKLIST :=
OBJ := $(filter-out $(BLACKLIST),$(OBJ))
INCDIRS += $(INCLUDE_DIRS)
endif
CFLAGS += $(RARCH_DEFINES)
ifeq ($(strip $(PS2SDK)),)
$(error "Please set PS2SDK in your environment. export PS2SDK=<path to>ps2sdk")
endif
# All the IRX objects
EE_OBJS += $(IRX_DIR)/sio2man_irx.o $ $(IRX_DIR)/iomanX_irx.o $(IRX_DIR)/fileXio_irx.o
EE_OBJS += $(IRX_DIR)/mcman_irx.o $(IRX_DIR)/mcserv_irx.o
EE_OBJS += $(IRX_DIR)/usbd_irx.o $(IRX_DIR)/bdm_irx.o $(IRX_DIR)/bdmfs_vfat_irx.o $(IRX_DIR)/usbmass_bd_irx.o
EE_OBJS += $(IRX_DIR)/libsd_irx.o $(IRX_DIR)/audsrv_irx.o
EE_OBJS += $(IRX_DIR)/cdfs_irx.o
EE_OBJS += $(IRX_DIR)/ps2dev9_irx.o $(IRX_DIR)/ps2atad_irx.o $(IRX_DIR)/ps2hdd_irx.o $(IRX_DIR)/ps2fs_irx.o $(IRX_DIR)/poweroff_irx.o
EE_OBJS += $(IRX_DIR)/mtapman_irx.o $(IRX_DIR)/padman_irx.o
INCDIR = -I$(PS2DEV)/gsKit/include -I$(PS2SDK)/ports/include
INCDIR += -Ips2/include -Ilibretro-common/include -Ideps -Ideps/stb -Ideps/7zip
LDFLAGS += -L$(PS2DEV)/gsKit/lib -L$(PS2SDK)/ports/lib -L.
# Lib cdvd is needed to get proper time
LIBS += -lpatches -lgskit -ldmakit -laudsrv -lmtap -lpadx -lz -lcdvd -lelf-loader -lfileXio -lpoweroff
CFLAGS = $(OPTIMIZE_LV) $(DISABLE_WARNINGS) $(DEFINES) -DPS2 -ffast-math -fsingle-precision-constant
ASFLAGS = $(CFLAGS)
# IRX libs
IRX_FILES += sio2man.irx iomanX.irx fileXio.irx
IRX_FILES += mcman.irx mcserv.irx
IRX_FILES += usbd.irx bdm.irx bdmfs_vfat.irx usbmass_bd.irx
IRX_FILES += libsd.irx audsrv.irx
IRX_FILES += cdfs.irx
IRX_FILES += ps2dev9.irx ps2atad.irx ps2hdd.irx ps2fs.irx poweroff.irx
IRX_FILES += mtapman.irx padman.irx
EE_OBJS += $(IRX_FILES:.irx=_irx.o)
# Missing objecst on the PS2SDK
EE_OBJS += ps2/compat_files/ps2_devices.o
EE_OBJS += griffin/griffin.o
EE_OBJS += $(OBJ)
EE_CFLAGS = $(CFLAGS)
EE_CXXFLAGS = $(CFLAGS)
@ -92,18 +112,14 @@ EE_LDFLAGS = $(LDFLAGS)
EE_LIBS = $(LIBS)
EE_ASFLAGS = $(ASFLAGS)
EE_INCS = $(INCDIR)
EE_BIN = $(TARGET)
EE_BIN = $(TARGET).elf
EE_GPVAL = $(GPVAL)
all: irxdir $(EE_BIN)
irxdir:
$(MAKE) -C $(IRX_DIR)
all: $(EE_BIN)
clean:
rm -f $(EE_BIN) $(EE_OBJS)
$(MAKE) -C $(IRX_DIR) clean
prepare:
ps2client -h $(PS2_IP) reset
@ -117,10 +133,12 @@ sim:
debug: clean all run
package:
release: all
ps2-packer $(EE_BIN) $(TARGET_RELEASE)
release: clean all package
# IRX files
%_irx.c:
$(PS2SDK)/bin/bin2c $(PS2SDK)/iop/irx/$*.irx $@ $*_irx
#Include preferences
include $(PS2SDK)/samples/Makefile.pref

View File

@ -7,9 +7,6 @@ PS2_IP = 192.168.1.150
TARGET = raboot-debug.elf
TARGET_RELEASE = raboot.elf
# Compile the IRXs first
IRX_DIR = ps2/irx
ifeq ($(DEBUG), 1)
OPTIMIZE_LV := -O0 -g
RARCH_DEFINES += -DDEBUG
@ -19,7 +16,7 @@ else
endif
ifeq ($(MUTE_WARNINGS), 1)
DISABLE_WARNINGS := -Wno-sign-compare -Wno-unused -Wno-parentheses
DISABLE_WARNINGS := -Wno-unused -Wno-format -Wno-format-truncation
endif
INCDIR = -Ilibretro-common/include
@ -63,14 +60,15 @@ EE_OBJS = frontend/frontend_salamander.o \
libretro-common/hash/lrc_hash.o \
libretro-common/time/rtime.o \
verbosity.o \
ps2/compat_files/ps2_devices.o
ps2/compat_files/ps2_devices.o
# Needed IRX objects
EE_OBJS += $(IRX_DIR)/sio2man_irx.o $ $(IRX_DIR)/iomanX_irx.o $(IRX_DIR)/fileXio_irx.o
EE_OBJS += $(IRX_DIR)/mcman_irx.o $(IRX_DIR)/mcserv_irx.o
EE_OBJS += $(IRX_DIR)/usbd_irx.o $(IRX_DIR)/bdm_irx.o $(IRX_DIR)/bdmfs_vfat_irx.o $(IRX_DIR)/usbmass_bd_irx.o
EE_OBJS += $(IRX_DIR)/cdfs_irx.o
EE_OBJS += $(IRX_DIR)/ps2dev9_irx.o $(IRX_DIR)/ps2atad_irx.o $(IRX_DIR)/ps2hdd_irx.o $(IRX_DIR)/ps2fs_irx.o $(IRX_DIR)/poweroff_irx.o
# IRX libs
IRX_FILES += sio2man.irx iomanX.irx fileXio.irx
IRX_FILES += mcman.irx mcserv.irx
IRX_FILES += usbd.irx bdm.irx bdmfs_vfat.irx usbmass_bd.irx
IRX_FILES += cdfs.irx
IRX_FILES += ps2dev9.irx ps2atad.irx ps2hdd.irx ps2fs.irx poweroff.irx
EE_OBJS += $(IRX_FILES:.irx=_irx.o)
EE_CFLAGS = $(CFLAGS)
EE_CXXFLAGS = $(CFLAGS)
@ -81,24 +79,22 @@ EE_INCS = $(INCDIR)
EE_BIN = $(TARGET)
EE_GPVAL = $(GPVAL)
all: irxdir $(EE_BIN)
irxdir:
$(MAKE) -C $(IRX_DIR)
all: $(EE_BIN)
clean:
rm -f $(EE_BIN) $(EE_OBJS)
$(MAKE) -C $(IRX_DIR) clean
debug: clean all run
run:
ps2client -h $(PS2_IP) execee host:$(EE_BIN)
package:
release: all
ps2-packer $(EE_BIN) $(TARGET_RELEASE)
release: clean all package
# IRX files
%_irx.c:
$(PS2SDK)/bin/bin2c $(PS2SDK)/iop/irx/$*.irx $@ $*_irx
#Include preferences
include $(PS2SDK)/samples/Makefile.pref

View File

@ -34,7 +34,7 @@ static uint16_t *dummy_frame_buf;
static uint16_t frame_buf_width;
static uint16_t frame_buf_height;
#if defined(HAVE_LIBNX) && defined(HAVE_STATIC_DUMMY)
#if defined(HAVE_STATIC_DUMMY)
void retro_init(void) { libretro_dummy_retro_init(); }
void retro_deinit(void) { libretro_dummy_retro_deinit(); }
unsigned retro_api_version(void) { return libretro_dummy_retro_api_version(); }

View File

@ -26,6 +26,9 @@
#include <loadfile.h>
#include <elf-loader.h>
#include <libpwroff.h>
#include <audsrv.h>
#include <libmtap.h>
#include <libpad.h>
#define NEWLIB_PORT_AWARE
#include <fileXio_rpc.h>
@ -36,6 +39,13 @@
#include <debug.h>
#endif
#ifndef IS_SALAMANDER
#include "../../retroarch.h"
#ifdef HAVE_MENU
#include "../../menu/menu_driver.h"
#endif
#endif
#include <file/file_path.h>
#include <string/stdstring.h>
@ -144,23 +154,23 @@ static int hddCheck(void)
return ret;
}
static void load_hdd_modules()
static void load_hdd_modules()
{
pfsModuleLoaded = 0;
int ret;
char hddarg[] = "-o" "\0" "4" "\0" "-n" "\0" "20";
ret = SifExecModuleBuffer(&ps2dev9_irx, size_ps2dev9_irx, 0, NULL, NULL);
ret = SifExecModuleBuffer(&ps2atad_irx, size_ps2atad_irx, 0, NULL, NULL);
if (ret < 0)
if (ret < 0)
{
RARCH_WARN("HDD: No HardDisk Drive detected.\n");
return;
}
ret = SifExecModuleBuffer(&ps2hdd_irx, size_ps2hdd_irx, sizeof(hddarg), hddarg, NULL);
if (ret < 0)
if (ret < 0)
{
RARCH_WARN("HDD: No HardDisk Drive detected.\n");
return;
@ -182,7 +192,7 @@ static void load_hdd_modules()
pfsModuleLoaded = 1;
}
static void load_modules()
static void load_modules()
{
/* I/O Files */
SifExecModuleBuffer(&iomanX_irx, size_iomanX_irx, 0, NULL, NULL);
@ -232,9 +242,9 @@ static int mount_hdd_partition() {
{
shouldMount = 1;
strlcpy(mountPath, cwd, sizeof(mountPath));
}
}
#if !defined(IS_SALAMANDER) && defined(DEBUG)
else
else
{
// Even if we're booting from USB, try to mount default partition
strcpy(mountPath, DEFAULT_PARTITION);
@ -245,22 +255,22 @@ static int mount_hdd_partition() {
if (!shouldMount)
return 0;
if (getMountInfo(mountPath, mountString, mountPoint, newCWD) != 1)
if (getMountInfo(mountPath, mountString, mountPoint, newCWD) != 1)
{
RARCH_WARN("Partition info not readed\n");
return 0;
}
if (fileXioMount(mountString, mountPoint, FIO_MT_RDWR) < 0)
}
if (fileXioMount(mountString, mountPoint, FIO_MT_RDWR) < 0)
{
RARCH_WARN("Error mount mounting partition %s, %s\n", mountString, mountPoint);
return 0;
}
}
if (bootDeviceID == BOOT_DEVICE_HDD || bootDeviceID == BOOT_DEVICE_HDD0)
{
// If we're booting from HDD, we must update the cwd variable and add : to the mount point
sprintf(cwd, "%s", newCWD);
strncpy(cwd, newCWD, sizeof(cwd));
strcat(mountPoint, ":");
} else {
// we MUST put mountPoint as empty to avoid wrong results with LoadELFFromFileWithPartition
@ -270,9 +280,9 @@ static int mount_hdd_partition() {
return 1;
}
static void prepare_for_exit(void)
static void prepare_for_exit(void)
{
if (hddMounted)
if (hddMounted)
{
fileXioUmount(mountString);
fileXioDevctl(mountString, PDIOC_CLOSEALL, NULL, 0, NULL, 0);
@ -292,7 +302,6 @@ static void poweroffHandler(void *arg)
static void frontend_ps2_get_env(int *argc, char *argv[],
void *args, void *params_data)
{
int i;
create_path_names();
#ifndef IS_SALAMANDER
@ -489,7 +498,7 @@ static int frontend_ps2_parse_drive_list(void *data, bool load_content)
msg_hash_to_str(MENU_ENUM_LABEL_FILE_DETECT_CORE_LIST_PUSH_DIR),
enum_idx,
FILE_TYPE_DIRECTORY, 0, 0);
if (hddMounted)
if (hddMounted)
{
sprintf(hdd, "%s/", mountString);
menu_entries_append_enum(list,

52
gfx/common/ps2_common.h Normal file
View File

@ -0,0 +1,52 @@
#ifndef PS2_COMMON_H__
#define PS2_COMMON_H__
#include <stdint.h>
#include <stdbool.h>
#include <gsKit.h>
#include <gsInline.h>
#include "../video_defines.h"
#include "../../libretro-common/include/libretro_gskit_ps2.h"
typedef struct ps2_video
{
/* I need to create this additional field
* to be used in the font driver*/
bool clearVRAM_font;
bool menuVisible;
bool vsync;
int vsync_callback_id;
bool force_aspect;
int8_t vmode;
int video_window_offset_x;
int video_window_offset_y;
int PSM;
int tex_filter;
int menu_filter;
video_viewport_t vp;
/* Palette in the cores */
struct retro_hw_render_interface_gskit_ps2 iface;
GSGLOBAL *gsGlobal;
GSTEXTURE *menuTexture;
GSTEXTURE *coreTexture;
/* Last scaling state, for detecting changes */
int iTextureWidth;
int iTextureHeight;
float fDAR;
bool bScaleInteger;
struct retro_hw_ps2_insets padding;
/* Current scaling calculation result */
int iDisplayWidth;
int iDisplayHeight;
} ps2_video_t;
#endif

View File

@ -22,6 +22,8 @@
#include "../../verbosity.h"
#include "../../libretro-common/include/libretro_gskit_ps2.h"
#include "../gfx_display.h"
#include "../common/ps2_common.h"
/* Generic tint color */
#define GS_TEXT GS_SETREG_RGBA(0x80, 0x80, 0x80, 0x80)
@ -59,45 +61,6 @@ static struct rm_mode rm_mode_table[NUM_RM_VMODES] = {
{GS_MODE_DTV_576P, 704, 576, 2, GS_NONINTERLACED, GS_FRAME, 12, 11, "DTV576P@50Hz"},
};
typedef struct ps2_video
{
/* I need to create this additional field
* to be used in the font driver*/
bool clearVRAM_font;
bool menuVisible;
bool vsync;
int vsync_callback_id;
bool force_aspect;
int8_t vmode;
int video_window_offset_x;
int video_window_offset_y;
int PSM;
int tex_filter;
int menu_filter;
video_viewport_t vp;
/* Palette in the cores */
struct retro_hw_render_interface_gskit_ps2 iface;
GSGLOBAL *gsGlobal;
GSTEXTURE *menuTexture;
GSTEXTURE *coreTexture;
/* Last scaling state, for detecting changes */
int iTextureWidth;
int iTextureHeight;
float fDAR;
bool bScaleInteger;
struct retro_hw_ps2_insets padding;
/* Current scaling calculation result */
int iDisplayWidth;
int iDisplayHeight;
} ps2_video_t;
static int vsync_sema_id;
/* PRIVATE METHODS */

View File

@ -15,13 +15,20 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <malloc.h>
#include <gsKit.h>
#include <dmaKit.h>
#include <gsToolkit.h>
#include <encodings/utf.h>
#include "../common/ps2_common.h"
#include "../font_driver.h"
#include "../../configuration.h"
#include "../../verbosity.h"
typedef struct
{
GSTEXTURE *texture;
@ -35,7 +42,6 @@ static void* ps2_font_init_font(void* data, const char* font_path,
const struct font_atlas* atlas = NULL;
uint32_t j;
ps2_font_t* font = (ps2_font_t*)calloc(1, sizeof(*font));
ps2_video_t* ps2 = (ps2_video_t*)data;
if (!font)
return NULL;
@ -146,7 +152,7 @@ static void ps2_font_render_line(
if (!ps2)
return;
/* Enable Alpha for font */
gsKit_set_primalpha(ps2->gsGlobal, GS_SETREG_ALPHA(0, 1, 0, 1, 0), 0);
ps2->gsGlobal->PrimAlphaEnable = GS_SETTING_ON;

View File

@ -16,8 +16,10 @@
#include <stdint.h>
#include <stddef.h>
#include <boolean.h>
#include <kernel.h>
#include "../../config.def.h"
#include "../../tasks/tasks_internal.h"
#include "../input_driver.h"

View File

@ -15,73 +15,73 @@
#ifndef PS2_IRX_VARIABLES_H
#define PS2_IRX_VARIABLES_H
extern unsigned char sio2man_irx;
extern unsigned char sio2man_irx[] __attribute__((aligned(16)));
extern unsigned int size_sio2man_irx;
extern unsigned char mcman_irx;
extern unsigned char mcman_irx[] __attribute__((aligned(16)));
extern unsigned int size_mcman_irx;
extern unsigned char mcserv_irx;
extern unsigned char mcserv_irx[] __attribute__((aligned(16)));
extern unsigned int size_mcserv_irx;
extern unsigned char mtapman_irx;
extern unsigned char mtapman_irx[] __attribute__((aligned(16)));
extern unsigned int size_mtapman_irx;
extern unsigned char padman_irx;
extern unsigned char padman_irx[] __attribute__((aligned(16)));
extern unsigned int size_padman_irx;
extern unsigned char iomanX_irx;
extern unsigned char iomanX_irx[] __attribute__((aligned(16)));
extern unsigned int size_iomanX_irx;
extern unsigned char fileXio_irx;
extern unsigned char fileXio_irx[] __attribute__((aligned(16)));
extern unsigned int size_fileXio_irx;
extern unsigned char ps2dev9_irx;
extern unsigned char ps2dev9_irx[] __attribute__((aligned(16)));
extern unsigned int size_ps2dev9_irx;
extern unsigned char ps2atad_irx;
extern unsigned char ps2atad_irx[] __attribute__((aligned(16)));
extern unsigned int size_ps2atad_irx;
extern unsigned char ps2hdd_irx;
extern unsigned char ps2hdd_irx[] __attribute__((aligned(16)));
extern unsigned int size_ps2hdd_irx;
extern unsigned char ps2fs_irx;
extern unsigned char ps2fs_irx[] __attribute__((aligned(16)));
extern unsigned int size_ps2fs_irx;
extern unsigned char usbd_irx;
extern unsigned char usbd_irx[] __attribute__((aligned(16)));
extern unsigned int size_usbd_irx;
extern unsigned char bdm_irx;
extern unsigned char bdm_irx[] __attribute__((aligned(16)));
extern unsigned int size_bdm_irx;
extern unsigned char bdmfs_vfat_irx;
extern unsigned char bdmfs_vfat_irx[] __attribute__((aligned(16)));
extern unsigned int size_bdmfs_vfat_irx;
extern unsigned char usbmass_bd_irx;
extern unsigned char usbmass_bd_irx[] __attribute__((aligned(16)));
extern unsigned int size_usbmass_bd_irx;
extern unsigned char cdfs_irx;
extern unsigned char cdfs_irx[] __attribute__((aligned(16)));
extern unsigned int size_cdfs_irx;
extern unsigned char libsd_irx;
extern unsigned char libsd_irx[] __attribute__((aligned(16)));
extern unsigned int size_libsd_irx;
extern unsigned char audsrv_irx;
extern unsigned char audsrv_irx[] __attribute__((aligned(16)));
extern unsigned int size_audsrv_irx;
extern unsigned char ps2dev9_irx;
extern unsigned char ps2dev9_irx[] __attribute__((aligned(16)));
extern unsigned int size_ps2dev9_irx;
extern unsigned char ps2atad_irx;
extern unsigned char ps2atad_irx[] __attribute__((aligned(16)));
extern unsigned int size_ps2atad_irx;
extern unsigned char ps2hdd_irx;
extern unsigned char ps2hdd_irx[] __attribute__((aligned(16)));
extern unsigned int size_ps2hdd_irx;
extern unsigned char ps2fs_irx;
extern unsigned char ps2fs_irx[] __attribute__((aligned(16)));
extern unsigned int size_ps2fs_irx;
extern unsigned char poweroff_irx;
extern unsigned char poweroff_irx[] __attribute__((aligned(16)));
extern unsigned int size_poweroff_irx;
#endif /* PS2_IRX_VARIABLES_H */

View File

@ -1,27 +0,0 @@
#Configuration for IRX
EE_BIN2C = bin2c
IRX_DIR = $(PS2SDK)/iop/irx
#IRX modules
# IRX modules - modules have to be in IRX_DIR
IRX_FILES += mtapman.irx padman.irx poweroff.irx
IRX_FILES += iomanX.irx fileXio.irx sio2man.irx mcman.irx mcserv.irx
IRX_FILES += usbd.irx bdm.irx bdmfs_vfat.irx usbmass_bd.irx
IRX_FILES += ps2dev9.irx ps2atad.irx ps2hdd.irx ps2fs.irx
IRX_FILES += libsd.irx audsrv.irx cdfs.irx
IRX_C_FILES = $(IRX_FILES:.irx=_irx.c)
all: irxs
# Specific file name and output per IRX Module
%.irx:
$(EE_BIN2C) $(IRX_DIR)/$@ $(@:.irx=_irx.c) $(@:.irx=_irx)
irxs: $(IRX_FILES)
clean:
rm -f $(IRX_C_FILES)
#Include preferences
include $(PS2SDK)/samples/Makefile.pref
include $(PS2SDK)/samples/Makefile.eeglobal