Skip to content

Commit c784693

Browse files
committed
Merge branch 'master' into libretro
2 parents ee07de2 + 9cbce41 commit c784693

File tree

7 files changed

+26
-49
lines changed

7 files changed

+26
-49
lines changed

Makefile

+6-2
Original file line numberDiff line numberDiff line change
@@ -475,8 +475,12 @@ target_: $(TARGET)
475475

476476
$(TARGET): $(OBJS)
477477
ifeq ($(PARTIAL_LINKING), 1)
478-
$(LD) -o $(basename $(TARGET))1.o -r --gc-sections $(addprefix -u , $(shell cat frontend/libretro-extern)) $^
479-
$(OBJCOPY) --keep-global-symbols=frontend/libretro-extern $(basename $(TARGET))1.o $(basename $(TARGET)).o
478+
$(LD) -o $(basename $(TARGET))1.o -r --gc-sections \
479+
$(addprefix -u ,$(shell cat frontend/libretro-extern)) \
480+
$(addprefix -u ,$(EXTRA_EXTERN_SYMS)) $^
481+
$(OBJCOPY) --keep-global-symbols=frontend/libretro-extern \
482+
$(addprefix -G ,$(EXTRA_EXTERN_SYMS)) \
483+
$(basename $(TARGET))1.o $(basename $(TARGET)).o
480484
$(AR) rcs $@ $(basename $(TARGET)).o
481485
else ifeq ($(STATIC_LINKING), 1)
482486
$(AR) rcs $@ $^

Makefile.libretro

+5-3
Original file line numberDiff line numberDiff line change
@@ -330,8 +330,9 @@ else ifeq ($(platform), vita)
330330
CFLAGS += -DVITA
331331
CFLAGS += -mcpu=cortex-a9 -mtune=cortex-a9 -mfpu=neon -marm
332332
CFLAGS += -fsingle-precision-constant -mword-relocations -fno-unwind-tables
333-
CFLAGS += -fno-asynchronous-unwind-tables -ftree-vectorize -funroll-loops
334-
CFLAGS += -fno-optimize-sibling-calls
333+
CFLAGS += -fno-asynchronous-unwind-tables -ftree-vectorize
334+
#CFLAGS += -funroll-loops # ~280K bloat
335+
#CFLAGS += -fno-optimize-sibling-calls # debug?
335336
CFLAGS += -I$(VITASDK)/include -Ifrontend/vita
336337
CFLAGS += -DNO_DYLIB
337338
CFLAGS_LAST += -O3
@@ -344,9 +345,10 @@ else ifeq ($(platform), vita)
344345
DYNAREC = ari64
345346
ARCH = arm
346347
PARTIAL_LINKING = 1
347-
NO_PTHREAD=1
348+
NO_MMAP := 1
348349
NO_POSIX_MEMALIGN := 1
349350
HAVE_PHYSICAL_CDROM = 0
351+
EXTRA_EXTERN_SYMS += _newlib_vm_size_user
350352

351353
# CTR(3DS)
352354
else ifeq ($(platform), ctr)

frontend/libretro.c

+1-34
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,6 @@ static psx_map_t custom_psx_maps[] = {
573573

574574
static int init_vita_mmap()
575575
{
576-
int n;
577576
void *tmpaddr;
578577
addr = malloc(64 * 1024 * 1024);
579578
if (addr == NULL)
@@ -587,6 +586,7 @@ static int init_vita_mmap()
587586
custom_psx_maps[5].buffer = tmpaddr + 0x2000000;
588587
memset(tmpaddr, 0, 0x2210000);
589588
#if 0
589+
int n;
590590
for(n = 0; n < 5; n++){
591591
sceClibPrintf("addr reserved %x\n",custom_psx_maps[n].buffer);
592592
}
@@ -2457,31 +2457,6 @@ static void update_variables(bool in_flight)
24572457
}
24582458
#endif
24592459

2460-
#if 0 // currently disabled, see USE_READ_THREAD in libpcsxcore/cdriso.c
2461-
if (P_HAVE_PTHREAD) {
2462-
var.value = NULL;
2463-
var.key = "pcsx_rearmed_async_cd";
2464-
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
2465-
{
2466-
if (strcmp(var.value, "async") == 0)
2467-
{
2468-
Config.AsyncCD = 1;
2469-
Config.CHD_Precache = 0;
2470-
}
2471-
else if (strcmp(var.value, "sync") == 0)
2472-
{
2473-
Config.AsyncCD = 0;
2474-
Config.CHD_Precache = 0;
2475-
}
2476-
else if (strcmp(var.value, "precache") == 0)
2477-
{
2478-
Config.AsyncCD = 0;
2479-
Config.CHD_Precache = 1;
2480-
}
2481-
}
2482-
}
2483-
#endif
2484-
24852460
var.value = NULL;
24862461
var.key = "pcsx_rearmed_noxadecoding";
24872462
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
@@ -3703,14 +3678,6 @@ void retro_deinit(void)
37033678
update_audio_latency = false;
37043679
}
37053680

3706-
#ifdef VITA
3707-
#include <psp2/kernel/threadmgr.h>
3708-
int usleep(unsigned long us)
3709-
{
3710-
sceKernelDelayThread(us);
3711-
}
3712-
#endif
3713-
37143681
void SysPrintf(const char *fmt, ...)
37153682
{
37163683
va_list list;

frontend/vita/sys/mman.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
#define MMAN_H
33

44
#include <stdlib.h>
5-
#include <stdio.h>
6-
#include <psp2/kernel/sysmem.h>
5+
//#include <psp2/kernel/sysmem.h>
76

87
#ifdef __cplusplus
98
extern "C" {
@@ -17,6 +16,7 @@ extern "C" {
1716

1817
#define MAP_FAILED ((void *)-1)
1918

19+
#if 0 // not used
2020
static inline void* mmap(void *addr, size_t len, int prot, int flags, int fd, off_t offset)
2121
{
2222
(void)prot;
@@ -62,6 +62,7 @@ static inline int munmap(void *addr, size_t len)
6262
return sceKernelFreeMemBlock(uid);
6363

6464
}
65+
#endif
6566

6667
#ifdef __cplusplus
6768
};

libpcsxcore/database.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -145,14 +145,16 @@ cycle_multiplier_overrides[] =
145145
/* Syphon Filter - reportedly hangs under unknown conditions */
146146
{ 169, { "SCUS94240" } },
147147
/* Psychic Detective - some weird race condition in the game's cdrom code */
148-
{ 222, { "SLUS00165", "SLUS00166", "SLUS00167" } },
149-
{ 222, { "SLES00070", "SLES10070", "SLES20070" } },
148+
{ 200, { "SLUS00165", "SLUS00166", "SLUS00167" } },
149+
{ 200, { "SLES00070", "SLES10070", "SLES20070" } },
150150
/* Vib-Ribbon - cd timing issues (PAL+ari64drc only?) */
151151
{ 200, { "SCES02873" } },
152152
/* Zero Divide - sometimes too fast */
153153
{ 200, { "SLUS00183", "SLES00159", "SLPS00083", "SLPM80008" } },
154154
/* Eagle One: Harrier Attack - hangs (but not in standalone build?) */
155155
{ 153, { "SLUS00943" } },
156+
/* Sol Divide: FMV timing */
157+
{ 200, { "SLUS01519", "SCPS45260", "SLPS01463" } },
156158
};
157159

158160
/* Function for automatic patching according to GameID. */

libpcsxcore/mdec.c

+6-4
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,12 @@
3434
*/
3535

3636
/*
37-
* >= 10 for Galerians
37+
* >= 14 for Sol Divide
3838
* <= 18 for "Disney's Treasure Planet"
39+
* Psychic Detective may break on *any* change
3940
*/
40-
#define MDEC_BIAS 10
41+
#define MDEC_BIAS 14
42+
#define MDEC_DELAY 1024
4143

4244
#define DSIZE 8
4345
#define DSIZE2 (DSIZE * DSIZE)
@@ -654,9 +656,9 @@ void psxDma1(u32 adr, u32 bcr, u32 chcr) {
654656
log_unhandled("mdec: bork\n");
655657

656658
/* define the power of mdec */
657-
set_event(PSXINT_MDECOUTDMA, words * MDEC_BIAS);
659+
set_event(PSXINT_MDECOUTDMA, words * MDEC_BIAS + MDEC_DELAY);
658660
/* some CPU stalling */
659-
psxRegs.cycle += words;
661+
psxRegs.cycle += words * MDEC_BIAS / 4;
660662
}
661663

662664
void mdec1Interrupt() {

libpcsxcore/new_dynarec/new_dynarec.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -6322,12 +6322,11 @@ void new_dynarec_init(void)
63226322
#ifdef VITA
63236323
sceBlock = getVMBlock(); //sceKernelAllocMemBlockForVM("code", sizeof(*ndrc));
63246324
if (sceBlock <= 0)
6325-
SysPrintf("sceKernelAllocMemBlockForVM failed: %x\n", sceBlock);
6325+
SysPrintf("getVMBlock failed: %x\n", sceBlock);
63266326
int ret = sceKernelGetMemBlockBase(sceBlock, (void **)&ndrc);
63276327
if (ret < 0)
63286328
SysPrintf("sceKernelGetMemBlockBase failed: %x\n", ret);
63296329
sceKernelOpenVMDomain();
6330-
sceClibPrintf("translation_cache = 0x%08lx\n ", (long)ndrc->translation_cache);
63316330
#elif defined(_MSC_VER)
63326331
ndrc = VirtualAlloc(NULL, sizeof(*ndrc), MEM_COMMIT | MEM_RESERVE,
63336332
PAGE_EXECUTE_READWRITE);

0 commit comments

Comments
 (0)