Skip to content

Commit

Permalink
Merge remote-tracking branch 'irixxxx/master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
irixxxx committed Dec 31, 2024
2 parents 09d3cb6 + 071a9e5 commit bb4b7bc
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Makefile.libretro
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ SHARED ?= -shared
LDFLAGS += $(SHARED) $(fpic)

ifeq ($(ARCH),)
ARCH = $(shell $(CC) -dumpmachine | awk -F '-' '{print $$1}')
ARCH = $(shell $(CC) $(CFLAGS) -dumpmachine | awk -F '-' '{print $$1}')
endif
PLATFORM = libretro
NO_CONFIG_MAK = yes
Expand Down
3 changes: 2 additions & 1 deletion pico/32x/32x.c
Original file line number Diff line number Diff line change
Expand Up @@ -658,10 +658,11 @@ void Pico32xStateLoaded(int is_early)

void Pico32xPrepare(void)
{
// fallback in case it was missing in saved config
if (msh2.mult_m68k_to_sh2 == 0 || msh2.mult_sh2_to_m68k == 0)
Pico32xSetClocks(PICO_MSH2_HZ, 0);
if (ssh2.mult_m68k_to_sh2 == 0 || ssh2.mult_sh2_to_m68k == 0)
Pico32xSetClocks(0, PICO_MSH2_HZ);
Pico32xSetClocks(0, PICO_SSH2_HZ);

sh2_execute_prepare(&msh2, PicoIn.opt & POPT_EN_DRC);
sh2_execute_prepare(&ssh2, PicoIn.opt & POPT_EN_DRC);
Expand Down
8 changes: 5 additions & 3 deletions pico/32x/sh2soc.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,11 @@ void p32x_timers_recalc(void)
sh2s[i].state |= SH2_TIMER_RUN;
tmp = PREG8(sh2s[i].peri_regs, 0x80) & 7;
// Sclk cycles per timer tick
cycles = 2;
if (tmp)
cycles = 0x20 << tmp;
else
cycles = 2;
cycles <<= tmp + 4;
if (tmp >= 6)
cycles <<= 1;
timer_tick_cycles[i] = cycles;
timer_tick_factor[i] = (1ULL << 32) / cycles;
timer_cycles[i] = 0;
Expand All @@ -235,6 +236,7 @@ NOINLINE void p32x_timer_do(SH2 *sh2, unsigned int m68k_slice)
if (cnt >= 0x100) {
int level = PREG8(pregs, 0xe3) >> 4;
int vector = PREG8(pregs, 0xe4) & 0x7f;
PREG8(pregs, 0x80) |= 0x80; // WOVF
elprintf(EL_32XP, "%csh2 WDT irq (%d, %d)",
i ? 's' : 'm', level, vector);
sh2_internal_irq(sh2, level, vector);
Expand Down
4 changes: 2 additions & 2 deletions platform/common/menu_pico.c
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,8 @@ static int mh_opt_sh2cycles(int id, int keys)
else if (*khz > 0x7fffffff / 1000)
*khz = 0x7fffffff / 1000;

Pico32xSetClocks(currentConfig.msh2_khz * 1000, currentConfig.ssh2_khz * 1000);

return 0;
}

Expand Down Expand Up @@ -573,8 +575,6 @@ static int menu_loop_32x_options(int id, int keys)
me_enable(e_menu_32x_options, MA_32XOPT_RENDERER, 0);
me_loop_d(e_menu_32x_options, &sel, menu_draw_prep, NULL);

Pico32xSetClocks(currentConfig.msh2_khz * 1000, currentConfig.msh2_khz * 1000);

return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion platform/common/version.h
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#define VERSION "2.01" REVISION
#define VERSION "2.02" REVISION

0 comments on commit bb4b7bc

Please sign in to comment.