diff options
author | Jens Arnold <amiconn@rockbox.org> | 2006-11-21 20:06:06 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2006-11-21 20:06:06 +0000 |
commit | 210fb6ac44c579c9a19839f613ec351ca45e925e (patch) | |
tree | 459776200806a088d4f91b6788258a3d1b0d96a4 | |
parent | 4a82f81f79ddb921328cd88fde8579fbd11b89e8 (diff) | |
download | rockbox-210fb6ac44c579c9a19839f613ec351ca45e925e.tar.gz rockbox-210fb6ac44c579c9a19839f613ec351ca45e925e.zip |
Fix sh2d to work properly on non-32bit hosts.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11565 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | tools/sh2d.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/sh2d.c b/tools/sh2d.c index aee69d324e..cb78df840e 100644 --- a/tools/sh2d.c +++ b/tools/sh2d.c | |||
@@ -8,6 +8,7 @@ | |||
8 | */ | 8 | */ |
9 | 9 | ||
10 | 10 | ||
11 | #include <stdint.h> | ||
11 | #include <stdio.h> | 12 | #include <stdio.h> |
12 | #include <stdlib.h> | 13 | #include <stdlib.h> |
13 | #include <string.h> | 14 | #include <string.h> |
@@ -441,7 +442,7 @@ void SH2Disasm(unsigned v_addr, unsigned char *p_addr, int mode, char *m_addr) | |||
441 | } | 442 | } |
442 | else /* .L */ | 443 | else /* .L */ |
443 | { | 444 | { |
444 | unsigned char *b_addr = (unsigned char *)((int)p_addr & 0xfffffffc); | 445 | unsigned char *b_addr = (unsigned char *)((intptr_t)p_addr & ~3); |
445 | int dat = (unsigned int) (*(imm + b_addr) << 24) | (*(imm + b_addr + 1) << 16) | 446 | int dat = (unsigned int) (*(imm + b_addr) << 24) | (*(imm + b_addr + 1) << 16) |
446 | | (*(imm + b_addr + 2) << 8) | *(imm + b_addr + 3) ; | 447 | | (*(imm + b_addr + 2) << 8) | *(imm + b_addr + 3) ; |
447 | /* SH-1 register name lookup */ | 448 | /* SH-1 register name lookup */ |