mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-10-27 00:29:39 -04:00
SekStepM68k restored, pad read issues with D&D fixed
git-svn-id: file:///home/notaz/opt/svn/PicoDrive@543 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
parent
9cd8914e02
commit
5f9a0d1630
5 changed files with 24 additions and 2 deletions
|
|
@ -105,7 +105,7 @@ PICO_INTERNAL_ASM void PicoMemReset(void)
|
||||||
int PadRead(int i)
|
int PadRead(int i)
|
||||||
{
|
{
|
||||||
int pad,value,data_reg;
|
int pad,value,data_reg;
|
||||||
pad=~PicoPad[i]; // Get inverse of pad MXYZ SACB RLDU
|
pad=~PicoPadInt[i]; // Get inverse of pad MXYZ SACB RLDU
|
||||||
data_reg=Pico.ioports[i+1];
|
data_reg=Pico.ioports[i+1];
|
||||||
|
|
||||||
// orr the bits, which are set as output
|
// orr the bits, which are set as output
|
||||||
|
|
@ -465,7 +465,7 @@ void PicoWrite16(u32 a,u16 d)
|
||||||
|
|
||||||
static void PicoWrite32(u32 a,u32 d)
|
static void PicoWrite32(u32 a,u32 d)
|
||||||
{
|
{
|
||||||
elprintf(EL_IO, "w32: %06x, %08x", a&0xffffff, d);
|
elprintf(EL_IO, "w32: %06x, %08x @%06x", a&0xffffff, d, SekPc);
|
||||||
#ifdef EMU_CORE_DEBUG
|
#ifdef EMU_CORE_DEBUG
|
||||||
lastwrite_cyc_d[lwp_cyc++&15] = d;
|
lastwrite_cyc_d[lwp_cyc++&15] = d;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ int PicoOpt = 0;
|
||||||
int PicoSkipFrame = 0; // skip rendering frame?
|
int PicoSkipFrame = 0; // skip rendering frame?
|
||||||
int emustatus = 0; // rapid_ym2612, multi_ym_updates
|
int emustatus = 0; // rapid_ym2612, multi_ym_updates
|
||||||
int PicoPad[2]; // Joypads, format is SACB RLDU
|
int PicoPad[2]; // Joypads, format is SACB RLDU
|
||||||
|
int PicoPadInt[2]; // internal copy
|
||||||
int PicoAHW = 0; // active addon hardware: scd_active, 32x_active, svp_active, pico_active
|
int PicoAHW = 0; // active addon hardware: scd_active, 32x_active, svp_active, pico_active
|
||||||
int PicoRegionOverride = 0; // override the region detection 0: Auto, 1: Japan NTSC, 2: Japan PAL, 4: US, 8: Europe
|
int PicoRegionOverride = 0; // override the region detection 0: Auto, 1: Japan NTSC, 2: Japan PAL, 4: US, 8: Europe
|
||||||
int PicoAutoRgnOrder = 0;
|
int PicoAutoRgnOrder = 0;
|
||||||
|
|
@ -31,6 +32,7 @@ void PicoInit(void)
|
||||||
// Blank space for state:
|
// Blank space for state:
|
||||||
memset(&Pico,0,sizeof(Pico));
|
memset(&Pico,0,sizeof(Pico));
|
||||||
memset(&PicoPad,0,sizeof(PicoPad));
|
memset(&PicoPad,0,sizeof(PicoPad));
|
||||||
|
memset(&PicoPadInt,0,sizeof(PicoPadInt));
|
||||||
|
|
||||||
// Init CPUs:
|
// Init CPUs:
|
||||||
SekInit();
|
SekInit();
|
||||||
|
|
@ -145,6 +147,7 @@ int PicoReset(void)
|
||||||
|
|
||||||
PicoMemReset();
|
PicoMemReset();
|
||||||
SekReset();
|
SekReset();
|
||||||
|
memset(&PicoPadInt,0,sizeof(PicoPadInt));
|
||||||
// s68k doesn't have the TAS quirk, so we just globally set normal TAS handler in MCD mode (used by Batman games).
|
// s68k doesn't have the TAS quirk, so we just globally set normal TAS handler in MCD mode (used by Batman games).
|
||||||
SekSetRealTAS(PicoAHW & PAHW_MCD);
|
SekSetRealTAS(PicoAHW & PAHW_MCD);
|
||||||
SekCycleCntT=0;
|
SekCycleCntT=0;
|
||||||
|
|
|
||||||
|
|
@ -161,6 +161,7 @@ static int PicoFrameHints(void)
|
||||||
pv->lwrite_cnt=0;
|
pv->lwrite_cnt=0;
|
||||||
Pico.video.status|=0x200;
|
Pico.video.status|=0x200;
|
||||||
|
|
||||||
|
memcpy(PicoPadInt, PicoPad, sizeof(PicoPadInt));
|
||||||
PAD_DELAY
|
PAD_DELAY
|
||||||
#ifdef PICO_CD
|
#ifdef PICO_CD
|
||||||
check_cd_dma();
|
check_cd_dma();
|
||||||
|
|
|
||||||
|
|
@ -435,6 +435,7 @@ PICO_INTERNAL unsigned int ym2612_read_local_68k(void);
|
||||||
// Pico.c
|
// Pico.c
|
||||||
extern struct Pico Pico;
|
extern struct Pico Pico;
|
||||||
extern struct PicoSRAM SRam;
|
extern struct PicoSRAM SRam;
|
||||||
|
extern int PicoPadInt[2];
|
||||||
extern int emustatus;
|
extern int emustatus;
|
||||||
extern void (*PicoResetHook)(void);
|
extern void (*PicoResetHook)(void);
|
||||||
extern void (*PicoLineHook)(void);
|
extern void (*PicoLineHook)(void);
|
||||||
|
|
@ -463,6 +464,7 @@ PICO_INTERNAL void SekInit(void);
|
||||||
PICO_INTERNAL int SekReset(void);
|
PICO_INTERNAL int SekReset(void);
|
||||||
PICO_INTERNAL void SekState(int *data);
|
PICO_INTERNAL void SekState(int *data);
|
||||||
PICO_INTERNAL void SekSetRealTAS(int use_real);
|
PICO_INTERNAL void SekSetRealTAS(int use_real);
|
||||||
|
void SekStepM68k(void);
|
||||||
void SekInitIdleDet(void);
|
void SekInitIdleDet(void);
|
||||||
void SekFinishIdleDet(void);
|
void SekFinishIdleDet(void);
|
||||||
|
|
||||||
|
|
|
||||||
16
Pico/Sek.c
16
Pico/Sek.c
|
|
@ -163,6 +163,21 @@ PICO_INTERNAL int SekReset(void)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SekStepM68k(void)
|
||||||
|
{
|
||||||
|
SekCycleAim=SekCycleCnt+1;
|
||||||
|
#if defined(EMU_CORE_DEBUG)
|
||||||
|
SekCycleCnt+=CM_compareRun(1, 0);
|
||||||
|
#elif defined(EMU_C68K)
|
||||||
|
PicoCpuCM68k.cycles=1;
|
||||||
|
CycloneRun(&PicoCpuCM68k);
|
||||||
|
SekCycleCnt+=1-PicoCpuCM68k.cycles;
|
||||||
|
#elif defined(EMU_M68K)
|
||||||
|
SekCycleCnt+=m68k_execute(1);
|
||||||
|
#elif defined(EMU_F68K)
|
||||||
|
SekCycleCnt+=fm68k_emulate(1, 0);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
PICO_INTERNAL void SekSetRealTAS(int use_real)
|
PICO_INTERNAL void SekSetRealTAS(int use_real)
|
||||||
{
|
{
|
||||||
|
|
@ -174,6 +189,7 @@ PICO_INTERNAL void SekSetRealTAS(int use_real)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* idle loop detection, not to be used in CD mode */
|
/* idle loop detection, not to be used in CD mode */
|
||||||
#ifdef EMU_C68K
|
#ifdef EMU_C68K
|
||||||
#include "cpu/Cyclone/tools/idle.h"
|
#include "cpu/Cyclone/tools/idle.h"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue