summaryrefslogtreecommitdiff
path: root/apps/codecs/libgme/rom_data.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs/libgme/rom_data.c')
-rw-r--r--apps/codecs/libgme/rom_data.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/codecs/libgme/rom_data.c b/apps/codecs/libgme/rom_data.c
index 5fe3115130..9c36a99d2d 100644
--- a/apps/codecs/libgme/rom_data.c
+++ b/apps/codecs/libgme/rom_data.c
@@ -21,7 +21,7 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
21blargg_err_t Rom_load( struct Rom_Data* this, const void* data, long size, 21blargg_err_t Rom_load( struct Rom_Data* this, const void* data, long size,
22 int header_size, void* header_out, int fill ) 22 int header_size, void* header_out, int fill )
23{ 23{
24 long file_offset = this->pad_size; 24 int file_offset = this->pad_size;
25 25
26 this->rom_addr = 0; 26 this->rom_addr = 0;
27 this->mask = 0; 27 this->mask = 0;
@@ -43,11 +43,11 @@ blargg_err_t Rom_load( struct Rom_Data* this, const void* data, long size,
43 return 0; 43 return 0;
44} 44}
45 45
46void Rom_set_addr( struct Rom_Data* this, long addr ) 46void Rom_set_addr( struct Rom_Data* this, int addr )
47{ 47{
48 this->rom_addr = addr - this->bank_size - pad_extra; 48 this->rom_addr = addr - this->bank_size - pad_extra;
49 49
50 long rounded = (addr + this->file_size + this->bank_size - 1) / this->bank_size * this->bank_size; 50 int rounded = (addr + this->file_size + this->bank_size - 1) / this->bank_size * this->bank_size;
51 if ( rounded <= 0 ) 51 if ( rounded <= 0 )
52 { 52 {
53 rounded = 0; 53 rounded = 0;
@@ -55,7 +55,7 @@ void Rom_set_addr( struct Rom_Data* this, long addr )
55 else 55 else
56 { 56 {
57 int shift = 0; 57 int shift = 0;
58 unsigned long max_addr = (unsigned long) (rounded - 1); 58 unsigned int max_addr = (unsigned int) (rounded - 1);
59 while ( max_addr >> shift ) 59 while ( max_addr >> shift )
60 shift++; 60 shift++;
61 this->mask = (1L << shift) - 1; 61 this->mask = (1L << shift) - 1;