Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/src-0.2.97.13/cpu/sh2/sh2.cpp b/src-0.2.97.13/cpu/sh2/sh2.cpp
- index 3ddb08f..32008eb 100644
- --- a/src-0.2.97.13/cpu/sh2/sh2.cpp
- +++ b/src-0.2.97.13/cpu/sh2/sh2.cpp
- @@ -30,6 +30,7 @@
- *****************************************************************************/
- #include <stdio.h>
- +#include <stdint.h>
- #include <stdlib.h>
- #include <string.h>
- @@ -253,7 +254,7 @@ int Sh2MapMemory(unsigned char* pMemory, unsigned int nStart, unsigned int nEnd,
- return 0;
- }
- -int Sh2MapHandler(unsigned int nHandler, unsigned int nStart, unsigned int nEnd, int nType)
- +int Sh2MapHandler(uintptr_t nHandler, unsigned int nStart, unsigned int nEnd, int nType)
- {
- unsigned char** pMemMap = pSh2Ext->MemMap + (nStart >> SH2_SHIFT);
- int need_mirror = (nStart < 0x08000000) ? 1 : 0;
- @@ -521,11 +522,11 @@ INLINE UINT8 RB(UINT32 A)
- unsigned char * pr;
- pr = pSh2Ext->MemMap[ A >> SH2_SHIFT ];
- - if ( (unsigned int)pr >= SH2_MAXHANDLER ) {
- + if ( (uintptr_t)pr >= SH2_MAXHANDLER ) {
- A ^= 3;
- return pr[A & SH2_PAGEM];
- }
- - return pSh2Ext->ReadByte[(unsigned int)pr](A);
- + return pSh2Ext->ReadByte[(uintptr_t)pr](A);
- }
- INLINE UINT16 RW(UINT32 A)
- @@ -537,12 +538,12 @@ INLINE UINT16 RW(UINT32 A)
- unsigned char * pr;
- pr = pSh2Ext->MemMap[ A >> SH2_SHIFT ];
- - if ( (unsigned int)pr >= SH2_MAXHANDLER ) {
- + if ( (uintptr_t)pr >= SH2_MAXHANDLER ) {
- A ^= 2;
- //return (pr[A & SH2_PAGEM] << 8) | pr[(A & SH2_PAGEM) + 1];
- return *((unsigned short *)(pr + (A & SH2_PAGEM)));
- }
- - return pSh2Ext->ReadWord[(unsigned int)pr](A);
- + return pSh2Ext->ReadWord[(uintptr_t)pr](A);
- }
- INLINE UINT16 OPRW(UINT32 A)
- @@ -550,7 +551,7 @@ INLINE UINT16 OPRW(UINT32 A)
- unsigned char * pr;
- pr = pSh2Ext->MemMap[ (A >> SH2_SHIFT) + SH2_WADD * 2 ];
- - if ( (unsigned int)pr >= SH2_MAXHANDLER ) {
- + if ( (uintptr_t)pr >= SH2_MAXHANDLER ) {
- A ^= 2;
- return *((unsigned short *)(pr + (A & SH2_PAGEM)));
- }
- @@ -567,11 +568,11 @@ INLINE UINT32 RL(UINT32 A)
- unsigned char * pr;
- pr = pSh2Ext->MemMap[ A >> SH2_SHIFT ];
- - if ( (unsigned int)pr >= SH2_MAXHANDLER ) {
- + if ( (uintptr_t)pr >= SH2_MAXHANDLER ) {
- //return (pr[(A & SH2_PAGEM) + 0] << 24) | (pr[(A & SH2_PAGEM) + 1] << 16) | (pr[(A & SH2_PAGEM) + 2] << 8) | (pr[(A & SH2_PAGEM) + 3] << 0);
- return *((unsigned int *)(pr + (A & SH2_PAGEM)));
- }
- - return pSh2Ext->ReadLong[(unsigned int)pr](A);
- + return pSh2Ext->ReadLong[(uintptr_t)pr](A);
- }
- INLINE void WB(UINT32 A, UINT8 V)
- @@ -583,12 +584,12 @@ INLINE void WB(UINT32 A, UINT8 V)
- unsigned char* pr;
- pr = pSh2Ext->MemMap[(A >> SH2_SHIFT) + SH2_WADD];
- - if ((unsigned int)pr >= SH2_MAXHANDLER) {
- + if ((uintptr_t)pr >= SH2_MAXHANDLER) {
- A ^= 3;
- pr[A & SH2_PAGEM] = (unsigned char)V;
- return;
- }
- - pSh2Ext->WriteByte[(unsigned int)pr](A, V);
- + pSh2Ext->WriteByte[(uintptr_t)pr](A, V);
- }
- INLINE void WW(UINT32 A, UINT16 V)
- @@ -600,12 +601,12 @@ INLINE void WW(UINT32 A, UINT16 V)
- unsigned char * pr;
- pr = pSh2Ext->MemMap[(A >> SH2_SHIFT) + SH2_WADD];
- - if ((unsigned int)pr >= SH2_MAXHANDLER) {
- + if ((uintptr_t)pr >= SH2_MAXHANDLER) {
- A ^= 2;
- *((unsigned short *)(pr + (A & SH2_PAGEM))) = (unsigned short)V;
- return;
- }
- - pSh2Ext->WriteWord[(unsigned int)pr](A, V);
- + pSh2Ext->WriteWord[(uintptr_t)pr](A, V);
- }
- INLINE void WL(UINT32 A, UINT32 V)
- @@ -616,11 +617,11 @@ INLINE void WL(UINT32 A, UINT32 V)
- program_write_dword_32be(A & AM,V); */
- unsigned char * pr;
- pr = pSh2Ext->MemMap[(A >> SH2_SHIFT) + SH2_WADD];
- - if ((unsigned int)pr >= SH2_MAXHANDLER) {
- + if ((uintptr_t)pr >= SH2_MAXHANDLER) {
- *((unsigned int *)(pr + (A & SH2_PAGEM))) = (unsigned int)V;
- return;
- }
- - pSh2Ext->WriteLong[(unsigned int)pr](A, V);
- + pSh2Ext->WriteLong[(uintptr_t)pr](A, V);
- }
- INLINE void sh2_exception(/*const char *message,*/ int irqline)
- diff --git a/src-0.2.97.13/cpu/sh2/sh2.h b/src-0.2.97.13/cpu/sh2/sh2.h
- index 07ef9b9..01c704a 100644
- --- a/src-0.2.97.13/cpu/sh2/sh2.h
- +++ b/src-0.2.97.13/cpu/sh2/sh2.h
- @@ -26,7 +26,7 @@ void Sh2Reset(unsigned int pc, unsigned r15);
- int Sh2Run(int cycles);
- int Sh2MapMemory(unsigned char* pMemory, unsigned int nStart, unsigned int nEnd, int nType);
- -int Sh2MapHandler(unsigned int nHandler, unsigned int nStart, unsigned int nEnd, int nType);
- +int Sh2MapHandler(uintptr_t nHandler, unsigned int nStart, unsigned int nEnd, int nType);
- int Sh2SetReadByteHandler(int i, pSh2ReadByteHandler pHandler);
- int Sh2SetWriteByteHandler(int i, pSh2WriteByteHandler pHandler);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement