diff --git a/.gitignore b/.gitignore index 5ab29cab..ebef41e8 100644 --- a/.gitignore +++ b/.gitignore @@ -4,14 +4,13 @@ *.lib *.pdb *.manifest -*.dll.map +*.map *.exp *.dylib *.so +*.a tags cscope.out -PicoDrive.map -*.map config.mak config.log cpu/musashi/m68kmake @@ -31,4 +30,3 @@ PicoDrive.opk pico_int_offs.h amalgamate textfilter -*.a diff --git a/.gitmodules b/.gitmodules index 12c315ca..b778188f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,6 @@ [submodule "platform/libpicofe"] path = platform/libpicofe - url = https://github.com/irixxxx/libpicofe.git + url = https://github.com/notaz/libpicofe.git [submodule "cpu/cyclone"] path = cpu/cyclone url = https://github.com/notaz/cyclone68000.git diff --git a/Makefile b/Makefile index 8d71b4e0..641006ec 100644 --- a/Makefile +++ b/Makefile @@ -244,9 +244,9 @@ clean: $(RM) -r .opk_data $(TARGET): $(OBJS) - + ifeq ($(STATIC_LINKING), 1) - $(AR) rcs $@ $(OBJS) + $(AR) rcs $@ $^ else $(LD) $(LINKOUT)$@ $^ $(LDFLAGS) $(LDLIBS) endif diff --git a/Makefile.libretro b/Makefile.libretro index e6e61fa6..8b68b80a 100644 --- a/Makefile.libretro +++ b/Makefile.libretro @@ -184,7 +184,7 @@ else ifeq ($(platform), psl1ght) STATIC_LINKING = 1 NO_MMAP = 1 DONT_COMPILE_IN_ZLIB = 1 - + # PSP else ifeq ($(platform), psp1) TARGET := $(TARGET_NAME)_libretro_$(platform).a @@ -274,7 +274,7 @@ else ifeq ($(platform), wii) CC = $(DEVKITPPC)/bin/powerpc-eabi-gcc$(EXE_EXT) AR = $(DEVKITPPC)/bin/powerpc-eabi-ar$(EXE_EXT) CFLAGS += -DGEKKO -DHW_RVL -mrvl -mcpu=750 -meabi -mhard-float -DBLARGG_BIG_ENDIAN=1 -D__ppc__ - + # Nintendo Wii U else ifeq ($(platform), wiiu) TARGET := $(TARGET_NAME)_libretro_$(platform).a @@ -458,7 +458,7 @@ else ifneq (,$(findstring windows_msvc2017,$(platform))) LIBM := USE_LIBRETRO_VFS = 1 NO_ALIGN_FUNCTIONS = 1 - + CFLAGS += -DHAVE_VSNPRINTF CFLAGS += $(MSVC2017CompileFlags) CXXFLAGS += $(MSVC2017CompileFlags) diff --git a/cpu/sh2/compiler.c b/cpu/sh2/compiler.c index cdc7972a..84653e10 100644 --- a/cpu/sh2/compiler.c +++ b/cpu/sh2/compiler.c @@ -811,7 +811,7 @@ static void dr_block_link(struct block_entry *be, struct block_link *bl, int emi // via blx: @jump near jumpcc to blx; @blx far jump emith_jump_patch(jump, bl->blx, &jump); emith_jump_at(bl->blx, be->tcache_ptr); - host_instructions_updated(bl->blx, bl->blx + emith_jump_at_size(), + host_instructions_updated(bl->blx, (char *)bl->blx + emith_jump_at_size(), ((uintptr_t)bl->blx & 0x1f) + emith_jump_at_size()-1 > 0x1f); } } else { @@ -849,7 +849,7 @@ static void dr_block_unlink(struct block_link *bl, int emit_jump) // via blx: @jump near jumpcc to blx; @blx load target_pc, far jump emith_jump_patch(bl->jump, bl->blx, &jump); memcpy(bl->blx, bl->jdisp, emith_jump_at_size()); - host_instructions_updated(bl->blx, bl->blx + emith_jump_at_size(), 1); + host_instructions_updated(bl->blx, (char *)bl->blx + emith_jump_at_size(), 1); } else { printf("unknown BL type %d\n", bl->type); exit(1); diff --git a/pico/32x/memory.c b/pico/32x/memory.c index 7046cb42..2e9f590e 100644 --- a/pico/32x/memory.c +++ b/pico/32x/memory.c @@ -1950,7 +1950,7 @@ void *p32x_sh2_get_mem_ptr(u32 a, u32 *mask, SH2 *sh2) int p32x_sh2_memcpy(u32 dst, u32 src, int count, int size, SH2 *sh2) { u32 mask; - void *ps, *pd; + u8 *ps, *pd; int len, i; // check if src and dst points to memory (rom/sdram/dram/da) @@ -1958,11 +1958,7 @@ int p32x_sh2_memcpy(u32 dst, u32 src, int count, int size, SH2 *sh2) return 0; if ((ps = p32x_sh2_get_mem_ptr(src, &mask, sh2)) == (void *)-1) return 0; -#if _MSC_VER - (char*)ps += src & mask; -#else ps += src & mask; -#endif len = count * size; // DRAM in byte access is always in overwrite mode @@ -1972,17 +1968,13 @@ int p32x_sh2_memcpy(u32 dst, u32 src, int count, int size, SH2 *sh2) // align dst to halfword if (dst & 1) { p32x_sh2_write8(dst, *(u8 *)((uptr)ps ^ 1), sh2); -#if _MSC_VER - ((char*)ps)++, dst++, len --; -#else ps++, dst++, len --; -#endif } // copy data if ((uptr)ps & 1) { // unaligned, use halfword copy mode to reduce memory bandwidth - u16 *sp = (u16 *)((char*)ps - 1); + u16 *sp = (u16 *)(ps - 1); u16 dl, dh = *sp++; for (i = 0; i < (len & ~1); i += 2, dst += 2, sp++) { dl = dh, dh = *sp; diff --git a/pico/draw.c b/pico/draw.c index c3a6e23e..1aab2bcb 100644 --- a/pico/draw.c +++ b/pico/draw.c @@ -1587,7 +1587,7 @@ void PicoDoHighPal555(int sh, int line, struct PicoEState *est) for (i = 0; i < 0x40 / 2; i++) { t = spal[i]; #ifdef USE_BGR555 - t = ((t & 0x000e000e)<< 1) | ((t & 0x00e000e0)<<3) | ((t & 0x0e000e00)<<4); + t = ((t & 0x0e000e00)<< 3) | ((t & 0x00e000e0)<<2) | ((t & 0x000e000e)<<1); #else t = ((t & 0x000e000e)<<12) | ((t & 0x00e000e0)<<3) | ((t & 0x0e000e00)>>7); #endif @@ -2005,7 +2005,7 @@ void PicoDrawSetOutBufMD(void *dest, int increment) if (dest != NULL) { DrawLineDestBase = dest; DrawLineDestIncrement = increment; - Pico.est.DrawLineDest = (char*)DrawLineDestBase + Pico.est.DrawScanline * increment; + Pico.est.DrawLineDest = (char *)DrawLineDestBase + Pico.est.DrawScanline * increment; } else { DrawLineDestBase = DefOutBuff; diff --git a/platform/libpicofe b/platform/libpicofe index e2279855..e0bf7946 160000 --- a/platform/libpicofe +++ b/platform/libpicofe @@ -1 +1 @@ -Subproject commit e22798555286824a802017d3a5849d893fc2912f +Subproject commit e0bf794693c1c2384ef704e687df448168cd5170 diff --git a/platform/psp/emu.c b/platform/psp/emu.c index 39f65d69..e138ce8e 100644 --- a/platform/psp/emu.c +++ b/platform/psp/emu.c @@ -232,7 +232,7 @@ static void do_pal_update(int allow_sh, int allow_as) localPal[0xe0] = 0; localPal[0xf0] = 0x001f; } - else if (allow_as) + else if (allow_as && (Pico.est.rendstatus & PDRAW_SPR_LO_ON_HI)) { do_pal_convert(localPal, Pico.est.SonicPal, currentConfig.gamma, currentConfig.gamma2); memcpy((int *)dpal+0x40/2, (void *)localPal, 0x40*2);