diff --git a/AUTHORS.h b/AUTHORS.h index a7f3298fb4..a94c292b12 100644 --- a/AUTHORS.h +++ b/AUTHORS.h @@ -94,6 +94,7 @@ FIX94 Flame Sage (chris062689) flyinghead Francisco José García García (frangarcj) +Francisco Javier Trujillo Mata (fjtrujy) GameDragon2k Garrett Brown (garbear) gblues diff --git a/Makefile.ps2 b/Makefile.ps2 index cbd9a5c556..90c51cff3e 100644 --- a/Makefile.ps2 +++ b/Makefile.ps2 @@ -1,18 +1,19 @@ BUILD_PRX = 0 -DEBUG = 1 +DEBUG = 0 HAVE_KERNEL_PRX = 0 HAVE_LOGGER = 0 -HAVE_FILE_LOGGER = 0 +HAVE_FILE_LOGGER = 1 HAVE_THREADS = 0 BIG_STACK = 0 WHOLE_ARCHIVE_LINK = 0 -PS2_IP = 192.168.1.150 +PS2_IP = 192.168.2.150 #Configuration for IRX EE_BIN2O = bin2o IRX_DIR = $(PS2SDK)/iop/irx TARGET = retroarchps2.elf +TARGET_RELEASE = retroarchps2-release.elf ifeq ($(DEBUG), 1) OPTIMIZE_LV := -O0 -g @@ -26,7 +27,7 @@ ifeq ($(WHOLE_ARCHIVE_LINK), 1) WHOLE_END := -Wl,--no-whole-archive endif -INCDIR = -I$(PS2SDK)/ports/include -I$(PS2DEV)/gsKit/include -I$(PS2SDK)/iop/include -I$(PS2SDK)/ee/include -I$(PS2SDK)/common/include +INCDIR = -I$(PS2DEV)/gsKit/include -I$(PS2SDK)/ports/include INCDIR += -Ips2 -Ips2/include -Ilibretro-common/include INCDIR += -Ideps -Ideps/stb -Ideps/libz -Ideps/7zip -Ideps/pthreads -Ideps/pthreads/platform/ps2 -Ideps/pthreads/platform/helper GPVAL = -G0 @@ -34,13 +35,12 @@ CFLAGS = $(OPTIMIZE_LV) -ffast-math -fsingle-precision-constant ASFLAGS = $(CFLAGS) RARCH_DEFINES += -DPS2 -DUSE_IOP_CTYPE_MACRO -D_MIPS_ARCH_R5900 -DHAVE_ZLIB -DHAVE_RPNG -DHAVE_RJPEG -DWANT_ZLIB -RARCH_DEFINES += -DHAVE_GRIFFIN=1 -DRARCH_INTERNAL -DRARCH_CONSOLE -DHAVE_MENU -DHAVE_RGUI -DHAVE_FILTERS_BUILTIN -DHAVE_7ZIP -DHAVE_CC_RESAMPLER +RARCH_DEFINES += -DHAVE_GRIFFIN=1 -DRARCH_INTERNAL -DRARCH_CONSOLE -DHAVE_MENU -DHAVE_RGUI -DHAVE_FILTERS_BUILTIN -DHAVE_IMAGEVIEWER -DHAVE_7ZIP -DHAVE_CC_RESAMPLER LIBDIR = -LDFLAGS = -L$(PS2SDK)/ports/lib -L$(PS2DEV)/gsKit/lib -L$(PS2SDK)/ee/lib -L. -#LIBS = $(WHOLE_START) -lretro_ps2 $(WHOLE_END) -lstdc++ -lm -lz -lgskit -ldmakit -lpng -laudsrv -lpad -lcdvd -lmad -lfileXio -lpatches +LDFLAGS = -L$(PS2SDK)/ports/lib -L$(PS2DEV)/gsKit/lib -L$(PS2SDK)/ee/lib -L. -s LIBS += $(WHOLE_START) -lretro_ps2 $(WHOLE_END) -LIBS += -lm -lg -lz -ldebug -lfileXio -laudsrv -lpatches -lpoweroff -ldma -lgskit -ldmakit -lpad -lsdl +LIBS += -lgskit -ldmakit -lpad -lmc -lhdd -lsdl -lc -lfileXio -lpatches -lpoweroff -ldebug -lc #IRX modules # IRX modules - modules have to be in IRX_DIR @@ -95,6 +95,9 @@ run: debug: clean prepare all run +release: clean all + ps2-packer $(EE_BIN) $(TARGET_RELEASE) + #Specific file name and output per IRX Module $(EE_IRX_OBJ): $(EE_BIN2O) $(EE_GPVAL) $(IRX_DIR)/$(@:.o=.irx) $@ $(@:.o=_irx) @@ -102,4 +105,11 @@ $(EE_IRX_OBJ): #Include preferences include $(PS2SDK)/samples/Makefile.pref include $(PS2SDK)/samples/Makefile.eeglobal + + +$(EE_BIN): $(EE_OBJS) $(PS2SDK)/ee/startup/crt0.o + $(EE_CXX) $(EE_NO_CRT) -T$(PS2SDK)/ee/startup/linkfile $(EE_CXXFLAGS) \ + -o $(EE_BIN) $(PS2SDK)/ee/startup/crt0.o $(CRTI_OBJ) $(CRTBEGIN_OBJ) $(EE_OBJS) $(CRTEND_OBJ) $(CRTN_OBJ) $(EE_LDFLAGS) $(EE_LIBS) + + \ No newline at end of file diff --git a/audio/drivers/nullaudio.c b/audio/drivers/nullaudio.c index 39be26d4d0..c7dffc6f7e 100644 --- a/audio/drivers/nullaudio.c +++ b/audio/drivers/nullaudio.c @@ -21,7 +21,7 @@ static void *null_audio_init(const char *device, unsigned rate, unsigned latency unsigned block_frames, unsigned *new_rate) { - RARCH_ERR("Using the null audio driver. RetroArch will be silent."); + RARCH_ERR("Using the null audio driver. RetroArch will be silent.\n"); (void)device; (void)rate; diff --git a/frontend/drivers/platform_ps2.c b/frontend/drivers/platform_ps2.c index 93d389d889..ca7411bb45 100644 --- a/frontend/drivers/platform_ps2.c +++ b/frontend/drivers/platform_ps2.c @@ -1,6 +1,5 @@ /* RetroArch - A frontend for libretro. - * Copyright (C) 2010-2014 - Hans-Kristian Arntzen - * Copyright (C) 2011-2017 - Daniel De Matteis + * Copyright (C) 2010-2018 - Francisco Javier Trujillo Mata - fjtrujy * * RetroArch is free software: you can redistribute it and/or modify it under the terms * of the GNU General Public License as published by the Free Software Found- @@ -166,13 +165,6 @@ static const char *getMountParams(const char *command, char *BlockDevice) { static void create_path_names(void) { -#ifndef IS_SALAMANDER -#if defined(HAVE_LOGGER) - -#elif defined(HAVE_FILE_LOGGER) - retro_main_log_file_init("ux0:/temp/retroarch-log.txt"); // It really depend from where we are executing this -#endif -#endif fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CORE], g_defaults.dirs[DEFAULT_DIR_PORT], "CORES", sizeof(g_defaults.dirs[DEFAULT_DIR_CORE])); @@ -232,7 +224,6 @@ static void frontend_ps2_get_environment_settings(int *argc, char *argv[], const char *mountPoint; int bootDeviceID; - //TODO: I DONT KNOW YET, WHY IT CRASHES IF UNCOMENT THIS PART getcwd(cwd, sizeof(cwd)); bootDeviceID=getBootDeviceID(cwd); //Mount the HDD partition, if required. @@ -332,6 +323,14 @@ static void frontend_ps2_init(void *data) audsrv_init(); SDL_Init(SDL_INIT_TIMER); + + +retro_sleep(100); + +#if defined(HAVE_FILE_LOGGER) + retro_main_log_file_init("retroarch.log"); + verbosity_enable(); +#endif } static void frontend_ps2_deinit(void *data) @@ -467,7 +466,7 @@ static int frontend_ps2_parse_drive_list(void *data, bool load_content) enum_idx, FILE_TYPE_DIRECTORY, 0, 0); menu_entries_append_enum(list, - "host:/", + "host:", msg_hash_to_str(MENU_ENUM_LABEL_FILE_DETECT_CORE_LIST_PUSH_DIR), enum_idx, FILE_TYPE_DIRECTORY, 0, 0); diff --git a/gfx/drivers/ps2_gfx.c b/gfx/drivers/ps2_gfx.c index cb921bbc68..39a9053793 100644 --- a/gfx/drivers/ps2_gfx.c +++ b/gfx/drivers/ps2_gfx.c @@ -1,5 +1,5 @@ /* RetroArch - A frontend for libretro. - * Copyright (C) 2018 - Francisco Javier Trujillo Mata + * Copyright (C) 2018 - Francisco Javier Trujillo Mata - fjtrujy * * RetroArch is free software: you can redistribute it and/or modify it under the terms * of the GNU General Public License as published by the Free Software Found- @@ -18,7 +18,6 @@ #include "../../driver.h" #include "../../verbosity.h" -#include #include #include #include @@ -46,7 +45,7 @@ static GSGLOBAL *init_GSGlobal(void) { GSGLOBAL *gsGlobal = gsKit_init_global(); gsGlobal->PSM = GS_PSM_CT16; - gsGlobal->PSMZ = GS_PSMZ_16S; + gsGlobal->PSMZ = GS_PSMZ_16; gsGlobal->DoubleBuffering = GS_SETTING_OFF; gsGlobal->ZBuffering = GS_SETTING_OFF; gsGlobal->PrimAlphaEnable = GS_SETTING_OFF; @@ -66,10 +65,7 @@ static GSGLOBAL *init_GSGlobal(void) { } static GSTEXTURE * prepare_new_texture(void) { - GSTEXTURE *texture = malloc(sizeof *texture); - texture->Width = 0; - texture->Height = 0; - texture->Mem = NULL; + GSTEXTURE *texture = calloc(1, sizeof(*texture)); return texture; } @@ -102,7 +98,7 @@ static void color_correction16(uint16_t *buffer, uint32_t dimensions) uint16_t x16; for (i = 0; i < dimensions; i++) { x16 = buffer[i]; - buffer[i] = (x16 & 0x8000) | ((x16 << 10) & 0x7C00) | (x16 & 0x3E0) | ((x16 >> 10) & 0x1F); + buffer[i] = (x16 & 0x8000) | ((x16 << 10) & 0x7C00) | ((x16 >> 1) & 0x3E0) | ((x16 >> 11) & 0x1F); } } diff --git a/input/drivers/ps2_input.c b/input/drivers/ps2_input.c index 6942c700f9..733bd75b04 100644 --- a/input/drivers/ps2_input.c +++ b/input/drivers/ps2_input.c @@ -1,6 +1,5 @@ /* RetroArch - A frontend for libretro. - * Copyright (C) 2010-2014 - Hans-Kristian Arntzen - * Copyright (C) 2011-2017 - Daniel De Matteis + * Copyright (C) 2011-2018 - Francisco Javier Trujillo Mata - fjtrujy * * RetroArch is free software: you can redistribute it and/or modify it under the terms * of the GNU General Public License as published by the Free Software Found- diff --git a/input/drivers_joypad/ps2_joypad.c b/input/drivers_joypad/ps2_joypad.c index 969c075ebe..35d05cf3e9 100644 --- a/input/drivers_joypad/ps2_joypad.c +++ b/input/drivers_joypad/ps2_joypad.c @@ -1,7 +1,5 @@ /* RetroArch - A frontend for libretro. - * Copyright (C) 2010-2014 - Hans-Kristian Arntzen - * Copyright (C) 2011-2017 - Daniel De Matteis - * Copyright (C) 2013-2014 - CatalystG + * Copyright (C) 2011-2018 - Francisco Javier Trujillo Mata - fjtrujy * * RetroArch is free software: you can redistribute it and/or modify it under the terms * of the GNU General Public License as published by the Free Software Found- diff --git a/input/drivers_joypad/ps2_joypad_copy.c b/input/drivers_joypad/ps2_joypad_copy.c deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/libretro-common/file/config_file.c b/libretro-common/file/config_file.c index 846fa2c6fc..fcf95de2e9 100644 --- a/libretro-common/file/config_file.c +++ b/libretro-common/file/config_file.c @@ -986,8 +986,10 @@ bool config_file_write(config_file_t *conf, const char *path) return false; /* TODO: this is only useful for a few platforms, find which and add ifdef */ +#if !defined(PS2) buf = calloc(1, 0x4000); setvbuf(file, (char*)buf, _IOFBF, 0x4000); +#endif config_file_dump(conf, file); diff --git a/libretro-common/vfs/vfs_implementation.c b/libretro-common/vfs/vfs_implementation.c index 0213c06091..4721e7259e 100644 --- a/libretro-common/vfs/vfs_implementation.c +++ b/libretro-common/vfs/vfs_implementation.c @@ -294,8 +294,10 @@ libretro_vfs_implementation_file *retro_vfs_file_open_impl(const char *path, uns */ /* TODO: this is only useful for a few platforms, find which and add ifdef */ stream->fp = fp; +#if !defined(PS2) stream->buf = (char*)calloc(1, 0x4000); setvbuf(stream->fp, stream->buf, _IOFBF, 0x4000); +#endif } else { diff --git a/ps2/compat_ctype.c b/ps2/compat_ctype.c index 0c5dba835d..4dbd400cea 100644 --- a/ps2/compat_ctype.c +++ b/ps2/compat_ctype.c @@ -1,3 +1,17 @@ +/* RetroArch - A frontend for libretro. + * Copyright (C) 2010-2018 - Francisco Javier Trujillo Mata - fjtrujy + * + * RetroArch is free software: you can redistribute it and/or modify it under the terms + * of the GNU General Public License as published by the Free Software Found- + * ation, either version 3 of the License, or (at your option) any later version. + * + * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * * You should have received a copy of the GNU General Public License along with RetroArch. + * If not, see . + */ + #include #include #include @@ -425,3 +439,8 @@ int link(const char *oldpath, const char *newpath) { return fileXioSymlink(oldpath, newpath); } + +int unlink(const char *path) +{ + return fileXioRemove(path); +} diff --git a/ps2/include/compat_ctype.h b/ps2/include/compat_ctype.h index 1d80025c28..cd1b96f543 100644 --- a/ps2/include/compat_ctype.h +++ b/ps2/include/compat_ctype.h @@ -1,3 +1,17 @@ +/* RetroArch - A frontend for libretro. + * Copyright (C) 2010-2018 - Francisco Javier Trujillo Mata - fjtrujy + * + * RetroArch is free software: you can redistribute it and/or modify it under the terms + * of the GNU General Public License as published by the Free Software Found- + * ation, either version 3 of the License, or (at your option) any later version. + * + * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * * You should have received a copy of the GNU General Public License along with RetroArch. + * If not, see . + */ + #ifndef COMPAT_CTYPE_H #define COMPAT_CTYPE_H @@ -6,5 +20,6 @@ char *strtok_r(char *str, const char *delim, char **saveptr); unsigned long long strtoull(const char * __restrict nptr, char ** __restrict endptr, int base); int link(const char *oldpath, const char *newpath); +int unlink(const char *path); #endif diff --git a/ps2/include/inttypes.h b/ps2/include/inttypes.h index 3049fbdbba..8b37fcc33e 100644 --- a/ps2/include/inttypes.h +++ b/ps2/include/inttypes.h @@ -1,3 +1,17 @@ +/* RetroArch - A frontend for libretro. + * Copyright (C) 2010-2018 - Francisco Javier Trujillo Mata - fjtrujy + * + * RetroArch is free software: you can redistribute it and/or modify it under the terms + * of the GNU General Public License as published by the Free Software Found- + * ation, either version 3 of the License, or (at your option) any later version. + * + * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * * You should have received a copy of the GNU General Public License along with RetroArch. + * If not, see . + */ + #ifndef INTTYPES_H #define INTTYPES_H diff --git a/ps2/include/math.h b/ps2/include/math.h index bf0071edb1..fa0672624f 100644 --- a/ps2/include/math.h +++ b/ps2/include/math.h @@ -1,3 +1,17 @@ +/* RetroArch - A frontend for libretro. + * Copyright (C) 2010-2018 - Francisco Javier Trujillo Mata - fjtrujy + * + * RetroArch is free software: you can redistribute it and/or modify it under the terms + * of the GNU General Public License as published by the Free Software Found- + * ation, either version 3 of the License, or (at your option) any later version. + * + * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * * You should have received a copy of the GNU General Public License along with RetroArch. + * If not, see . + */ + #ifndef MATH_H #define MATH_H diff --git a/ps2/include/pte_types.h b/ps2/include/pte_types.h index 7e81156684..4da1ebac65 100644 --- a/ps2/include/pte_types.h +++ b/ps2/include/pte_types.h @@ -1,4 +1,16 @@ -/* pte_types.h */ +/* RetroArch - A frontend for libretro. + * Copyright (C) 2010-2018 - Francisco Javier Trujillo Mata - fjtrujy + * + * RetroArch is free software: you can redistribute it and/or modify it under the terms + * of the GNU General Public License as published by the Free Software Found- + * ation, either version 3 of the License, or (at your option) any later version. + * + * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * * You should have received a copy of the GNU General Public License along with RetroArch. + * If not, see . + */ #ifndef PTE_TYPES_H #define PTE_TYPES_H diff --git a/ps2/include/stdint.h b/ps2/include/stdint.h index 813efd21f8..e9f805b7d3 100644 --- a/ps2/include/stdint.h +++ b/ps2/include/stdint.h @@ -1,3 +1,17 @@ +/* RetroArch - A frontend for libretro. + * Copyright (C) 2010-2018 - Francisco Javier Trujillo Mata - fjtrujy + * + * RetroArch is free software: you can redistribute it and/or modify it under the terms + * of the GNU General Public License as published by the Free Software Found- + * ation, either version 3 of the License, or (at your option) any later version. + * + * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * * You should have received a copy of the GNU General Public License along with RetroArch. + * If not, see . + */ + #ifndef STDINT_H #define STDINT_H diff --git a/verbosity.c b/verbosity.c index 42a79f4977..9db900e8e4 100644 --- a/verbosity.c +++ b/verbosity.c @@ -118,9 +118,11 @@ void retro_main_log_file_init(const char *path) log_file_fp = (FILE*)fopen_utf8(path, "wb"); log_file_initialized = true; +#if !defined(PS2) /* TODO: this is only useful for a few platforms, find which and add ifdef */ log_file_buf = calloc(1, 0x4000); setvbuf(log_file_fp, (char*)log_file_buf, _IOFBF, 0x4000); +#endif } void retro_main_log_file_deinit(void)