diff --git a/Frameworks/lazyusf/lazyusf/audio.c b/Frameworks/lazyusf/lazyusf/audio.c index c2d9bc842..6f2164edb 100644 --- a/Frameworks/lazyusf/lazyusf/audio.c +++ b/Frameworks/lazyusf/lazyusf/audio.c @@ -15,7 +15,7 @@ void AddBuffer(usf_state_t *state, unsigned char *buf, unsigned int length) { do_max = length >> 2; if ( do_max > state->sample_buffer_count ) - do_max = state->sample_buffer_count; + do_max = (unsigned int) state->sample_buffer_count; for (i = 0; i < do_max; ++i) { diff --git a/Frameworks/lazyusf/lazyusf/cpu.c b/Frameworks/lazyusf/lazyusf/cpu.c index 516bfd34a..1d7ee9345 100644 --- a/Frameworks/lazyusf/lazyusf/cpu.c +++ b/Frameworks/lazyusf/lazyusf/cpu.c @@ -441,7 +441,7 @@ void StartEmulationFromSave ( usf_state_t * state, void * savestate ) { memset(state->IMEM, 0, 0x1000); memset(state->TLB_Map, 0, 0x100000 * sizeof(uintptr_t) + 0x10000); - memset(state->CPU_Action,0,sizeof(state->CPU_Action)); + memset(state->CPU_Action,0,sizeof(*state->CPU_Action)); state->WrittenToRom = 0; InitilizeTLB(state); diff --git a/Frameworks/lazyusf/lazyusf/interpreter_ops.c b/Frameworks/lazyusf/lazyusf/interpreter_ops.c index 2c76ee1f7..8effbb762 100644 --- a/Frameworks/lazyusf/lazyusf/interpreter_ops.c +++ b/Frameworks/lazyusf/lazyusf/interpreter_ops.c @@ -32,9 +32,9 @@ #include "usf.h" #ifdef _MSC_VER -#define INLINE __inline +#define INLINE __forceinline #else -#define INLINE __attribute__((forceinline)) +#define INLINE __attribute__((always_inline)) #endif #include "usf_internal.h" @@ -503,8 +503,7 @@ void r4300i_LL (usf_state_t * state) { state->LLAddr = Address; ll = state->LLAddr; TranslateVaddr(state, &ll); - state->LLAddr = ll; - + state->LLAddr = (uint32_t) ll; } void r4300i_LWC1 (usf_state_t * state) { diff --git a/Frameworks/lazyusf/lazyusf/memory.c b/Frameworks/lazyusf/lazyusf/memory.c index 72256324f..0c41338ab 100644 --- a/Frameworks/lazyusf/lazyusf/memory.c +++ b/Frameworks/lazyusf/lazyusf/memory.c @@ -73,7 +73,7 @@ void large_free(void * p, size_t size) #endif int32_t Allocate_Memory ( void * state ) { - uint32_t i = 0; + //uint32_t i = 0; //RdramSize = 0x800000; // Allocate the N64MEM and TLB_Map so that they are in each others 4GB range @@ -387,7 +387,7 @@ uint32_t r4300i_LW_VAddr ( usf_state_t * state, uint32_t VAddr, uint32_t * Value if((address - (uintptr_t)state->RDRAM) > state->RdramSize) { address = address - (uintptr_t)state->RDRAM; - return r4300i_LW_NonMemory(state, address, Value); + return r4300i_LW_NonMemory(state, (uint32_t) address, Value); } *Value = *(uint32_t *)address; return 1; @@ -770,7 +770,7 @@ uint32_t r4300i_SW_VAddr ( usf_state_t * state, uint32_t VAddr, uint32_t Value ) if((address - (uintptr_t)state->RDRAM) > state->RdramSize) { address = address - (uintptr_t)state->RDRAM; - return r4300i_SW_NonMemory(state, address, Value); + return r4300i_SW_NonMemory(state, (uint32_t) address, Value); } *(uint32_t *)address = Value; return 1; diff --git a/Frameworks/lazyusf/lazyusf/registers.c b/Frameworks/lazyusf/lazyusf/registers.c index 870542cd7..8f7db882c 100644 --- a/Frameworks/lazyusf/lazyusf/registers.c +++ b/Frameworks/lazyusf/lazyusf/registers.c @@ -51,7 +51,7 @@ void SetupRegisters(usf_state_t * state, N64_REGISTERS * n64_Registers) { state->RegPI = n64_Registers->PI; state->RegRI = n64_Registers->RI; state->RegSI = n64_Registers->SI; - state->PIF_Ram = n64_Registers->PIF_Ram; + state->PIF_Ram = (uint8_t *) n64_Registers->PIF_Ram; } void ChangeMiIntrMask (usf_state_t * state) { diff --git a/Frameworks/lazyusf/lazyusf/rsp/rsp.h b/Frameworks/lazyusf/lazyusf/rsp/rsp.h index 1b3f8d835..61ae902fb 100644 --- a/Frameworks/lazyusf/lazyusf/rsp/rsp.h +++ b/Frameworks/lazyusf/lazyusf/rsp/rsp.h @@ -19,7 +19,7 @@ #define NOINLINE __declspec(noinline) #define ALIGNED _declspec(align(16)) #else -#define INLINE __attribute__((forceinline)) +#define INLINE __attribute__((always_inline)) #define NOINLINE __attribute__((noinline)) #define ALIGNED __attribute__((aligned(16))) #endif @@ -37,7 +37,10 @@ typedef unsigned char byte; +#ifndef RCPREG_DEFINED +#define RCPREG_DEFINED typedef uint32_t RCPREG; +#endif NOINLINE void message(const char* body, int priority) { diff --git a/Frameworks/lazyusf/lazyusf/rsp/vu/shuffle.h b/Frameworks/lazyusf/lazyusf/rsp/vu/shuffle.h index 3f424bd7a..0898133fb 100644 --- a/Frameworks/lazyusf/lazyusf/rsp/vu/shuffle.h +++ b/Frameworks/lazyusf/lazyusf/rsp/vu/shuffle.h @@ -137,7 +137,7 @@ static const int simm[16] = { static __m128i shuffle_none(__m128i xmm) {/* - const int order = simm[0x0]; + // const int order = simm[0x0]; xmm = _mm_shufflehi_epi16(xmm, order); xmm = _mm_shufflelo_epi16(xmm, order);*/ @@ -145,7 +145,7 @@ static __m128i shuffle_none(__m128i xmm) } static __m128i shuffle_0q(__m128i xmm) { - const int order = simm[0x2]; + //const int order = simm[0x2]; xmm = _mm_shufflehi_epi16(xmm, SHUFFLE(00, 00, 02, 02)); xmm = _mm_shufflelo_epi16(xmm, SHUFFLE(00, 00, 02, 02)); @@ -153,7 +153,7 @@ static __m128i shuffle_0q(__m128i xmm) } static __m128i shuffle_1q(__m128i xmm) { - const int order = simm[0x3]; + //const int order = simm[0x3]; xmm = _mm_shufflehi_epi16(xmm, SHUFFLE(01, 01, 03, 03)); xmm = _mm_shufflelo_epi16(xmm, SHUFFLE(01, 01, 03, 03)); @@ -161,7 +161,7 @@ static __m128i shuffle_1q(__m128i xmm) } static __m128i shuffle_0h(__m128i xmm) { - const int order = simm[0x4]; + //const int order = simm[0x4]; xmm = _mm_shufflehi_epi16(xmm, SHUFFLE(00, 00, 00, 00)); xmm = _mm_shufflelo_epi16(xmm, SHUFFLE(00, 00, 00, 00)); @@ -169,7 +169,7 @@ static __m128i shuffle_0h(__m128i xmm) } static __m128i shuffle_1h(__m128i xmm) { - const int order = simm[0x5]; + //const int order = simm[0x5]; xmm = _mm_shufflehi_epi16(xmm, SHUFFLE(01, 01, 01, 01)); xmm = _mm_shufflelo_epi16(xmm, SHUFFLE(01, 01, 01, 01)); @@ -177,7 +177,7 @@ static __m128i shuffle_1h(__m128i xmm) } static __m128i shuffle_2h(__m128i xmm) { - const int order = simm[0x6]; + //const int order = simm[0x6]; xmm = _mm_shufflehi_epi16(xmm, SHUFFLE(02, 02, 02, 02)); xmm = _mm_shufflelo_epi16(xmm, SHUFFLE(02, 02, 02, 02)); @@ -185,7 +185,7 @@ static __m128i shuffle_2h(__m128i xmm) } static __m128i shuffle_3h(__m128i xmm) { - const int order = simm[0x7]; + //const int order = simm[0x7]; xmm = _mm_shufflehi_epi16(xmm, SHUFFLE(03, 03, 03, 03)); xmm = _mm_shufflelo_epi16(xmm, SHUFFLE(03, 03, 03, 03)); @@ -193,7 +193,7 @@ static __m128i shuffle_3h(__m128i xmm) } static __m128i shuffle_0w(__m128i xmm) { - const int order = simm[0x8]; + //const int order = simm[0x8]; xmm = _mm_shufflelo_epi16(xmm, SHUFFLE(00, 00, 00, 00)); xmm = _mm_unpacklo_epi16(xmm, xmm); @@ -201,7 +201,7 @@ static __m128i shuffle_0w(__m128i xmm) } static __m128i shuffle_1w(__m128i xmm) { - const int order = simm[0x9]; + //const int order = simm[0x9]; xmm = _mm_shufflelo_epi16(xmm, SHUFFLE(01, 01, 01, 01)); xmm = _mm_unpacklo_epi16(xmm, xmm); @@ -209,7 +209,7 @@ static __m128i shuffle_1w(__m128i xmm) } static __m128i shuffle_2w(__m128i xmm) { - const int order = simm[0xA]; + //const int order = simm[0xA]; xmm = _mm_shufflelo_epi16(xmm, SHUFFLE(02, 02, 02, 02)); xmm = _mm_unpacklo_epi16(xmm, xmm); @@ -217,7 +217,7 @@ static __m128i shuffle_2w(__m128i xmm) } static __m128i shuffle_3w(__m128i xmm) { - const int order = simm[0xB]; + //const int order = simm[0xB]; xmm = _mm_shufflelo_epi16(xmm, SHUFFLE(03, 03, 03, 03)); xmm = _mm_unpacklo_epi16(xmm, xmm); @@ -225,7 +225,7 @@ static __m128i shuffle_3w(__m128i xmm) } static __m128i shuffle_4w(__m128i xmm) { - const int order = simm[0xC]; + //const int order = simm[0xC]; xmm = _mm_shufflehi_epi16(xmm, SHUFFLE(04, 04, 04, 04)); xmm = _mm_unpackhi_epi16(xmm, xmm); @@ -233,7 +233,7 @@ static __m128i shuffle_4w(__m128i xmm) } static __m128i shuffle_5w(__m128i xmm) { - const int order = simm[0xD]; + //const int order = simm[0xD]; xmm = _mm_shufflehi_epi16(xmm, SHUFFLE(05, 05, 05, 05)); xmm = _mm_unpackhi_epi16(xmm, xmm); @@ -241,7 +241,7 @@ static __m128i shuffle_5w(__m128i xmm) } static __m128i shuffle_6w(__m128i xmm) { - const int order = simm[0xE]; + //const int order = simm[0xE]; xmm = _mm_shufflehi_epi16(xmm, SHUFFLE(06, 06, 06, 06)); xmm = _mm_unpackhi_epi16(xmm, xmm); @@ -249,7 +249,7 @@ static __m128i shuffle_6w(__m128i xmm) } static __m128i shuffle_7w(__m128i xmm) { - const int order = simm[0xF]; + //const int order = simm[0xF]; xmm = _mm_shufflehi_epi16(xmm, SHUFFLE(07, 07, 07, 07)); xmm = _mm_unpackhi_epi16(xmm, xmm); diff --git a/Frameworks/lazyusf/lazyusf/usf_internal.h b/Frameworks/lazyusf/lazyusf/usf_internal.h index 8ddb8fd75..b2b8f214d 100644 --- a/Frameworks/lazyusf/lazyusf/usf_internal.h +++ b/Frameworks/lazyusf/lazyusf/usf_internal.h @@ -6,7 +6,10 @@ struct usf_state_helper size_t offset_to_structure; }; +#ifndef RCPREG_DEFINED +#define RCPREG_DEFINED typedef uint32_t RCPREG; +#endif struct usf_state {