src/mess/drivers/genesis.c
| r2532 | r2533 | |
| 740 | 740 | // only looks for == in the compare for LSB systems |
| 741 | 741 | static int allendianmemcmp(const void *s1, const void *s2, size_t n) |
| 742 | 742 | { |
| 743 | | unsigned char *realbuf; |
| 743 | const unsigned char *realbuf; |
| 744 | 744 | |
| 745 | 745 | #ifdef LSB_FIRST |
| 746 | | unsigned char flippedbuf[64]; |
| 747 | | unsigned int i; |
| 746 | unsigned char flippedbuf[64]; |
| 747 | unsigned int i; |
| 748 | |
| 749 | if ((n & 1) || (n > 63)) return -1 ; // don't want odd sized buffers or too large a compare |
| 750 | for (i = 0; i < n; i++) flippedbuf[i] = *((char *)s2 + (i ^ 1)); |
| 751 | realbuf = flippedbuf; |
| 748 | 752 | |
| 749 | | if ((n & 1) || (n > 63)) return -1 ; // don't want odd sized buffers or too large a compare |
| 750 | | for (i = 0; i < n; i++) flippedbuf[i] = *((char *)s2 + (i ^ 1)); |
| 751 | | realbuf = flippedbuf; |
| 752 | | |
| 753 | 753 | #else |
| 754 | | |
| 755 | | realbuf = s2; |
| 756 | | |
| 754 | |
| 755 | realbuf = s2; |
| 756 | |
| 757 | 757 | #endif |
| 758 | | return memcmp(s1,realbuf,n); |
| 758 | return memcmp(s1,realbuf,n); |
| 759 | 759 | } |
| 760 | 760 | |
| 761 | 761 | void setup_megadriv_custom_mappers(running_machine *machine) |