#include "psxcounters.h"
#include "psxbios.h"
-#ifdef ICACHE_EMULATION
enum {
R3000ACPU_NOTIFY_CACHE_ISOLATED = 0,
R3000ACPU_NOTIFY_CACHE_UNISOLATED = 1,
R3000ACPU_NOTIFY_DMA3_EXE_LOAD = 2
};
-extern uint32_t *Read_ICache(uint32_t pc);
-#endif
typedef struct {
int (*Init)();
void (*Execute)(); /* executes up to a break */
void (*ExecuteBlock)(); /* executes up to a jump */
void (*Clear)(u32 Addr, u32 Size);
-#ifdef ICACHE_EMULATION
void (*Notify)(int note, void *data);
-#endif
+ void (*ApplyConfig)();
void (*Shutdown)();
} R3000Acpu;
extern R3000Acpu psxRec;
typedef union {
-#if defined(__BIGENDIAN__)
+#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
struct { u8 h3, h2, h, l; } b;
struct { s8 h3, h2, h, l; } sb;
struct { u16 h, l; } w;
PSXINT_NEWDRC_CHECK,
PSXINT_RCNT,
PSXINT_CDRLID,
- PSXINT_CDRPLAY,
+ PSXINT_CDRPLAY_OLD, /* unused */
PSXINT_SPU_UPDATE,
PSXINT_COUNT
};
u32 cycle;
u32 interrupt;
struct { u32 sCycle, cycle; } intCycle[32];
+ u32 gteBusyCycle;
+ u32 muldivBusyCycle;
+ // warning: changing anything in psxRegisters requires update of all
+ // asm in libpcsxcore/new_dynarec/, but this member can be replaced
+ u32 reserved[2];
} psxRegisters;
extern psxRegisters psxRegs;
void new_dyna_after_save(void);
void new_dyna_freeze(void *f, int mode);
-#define new_dyna_set_event(e, c) { \
- s32 c_ = c; \
- u32 abs_ = psxRegs.cycle + c_; \
- s32 odi_ = next_interupt - psxRegs.cycle; \
+#define new_dyna_set_event_abs(e, abs) { \
+ u32 abs_ = abs; \
+ s32 di_ = next_interupt - abs_; \
event_cycles[e] = abs_; \
- if (c_ < odi_) { \
- /*printf("%u: next_interupt %d -> %d (%u)\n", psxRegs.cycle, odi_, c_, abs_);*/ \
+ if (di_ > 0) { \
+ /*printf("%u: next_interupt %u -> %u\n", psxRegs.cycle, next_interupt, abs_);*/ \
next_interupt = abs_; \
} \
}
-#if defined(__BIGENDIAN__)
+#define new_dyna_set_event(e, c) \
+ new_dyna_set_event_abs(e, psxRegs.cycle + (c))
+
+#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
#define _i32(x) *(s32 *)&x
#define _u32(x) x