Mercurial > repos > blastem
comparison blastem.c @ 158:a2ab895d9708
Fix predec address mode when used as source
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Sat, 05 Jan 2013 00:53:50 -0800 |
parents | 42c031184e8a |
children | 97aa449706c2 |
comparison
equal
deleted
inserted
replaced
157:301470eb870b | 158:a2ab895d9708 |
---|---|
32 if (!f) { | 32 if (!f) { |
33 return 0; | 33 return 0; |
34 } | 34 } |
35 fseek(f, 0, SEEK_END); | 35 fseek(f, 0, SEEK_END); |
36 long filesize = ftell(f); | 36 long filesize = ftell(f); |
37 if (filesize/2 > CARTRIDGE_WORDS) { | |
38 //carts bigger than 4MB not currently supported | |
39 filesize = CARTRIDGE_WORDS*2; | |
40 } | |
37 fseek(f, 0, SEEK_SET); | 41 fseek(f, 0, SEEK_SET); |
38 fread(cart, 2, MIN(filesize/2, CARTRIDGE_WORDS), f); | 42 fread(cart, 2, MIN(filesize/2, CARTRIDGE_WORDS), f); |
39 fclose(f); | 43 fclose(f); |
40 for(unsigned short * cur = cart; cur - cart < (filesize/2); ++cur) | 44 for(unsigned short * cur = cart; cur - cart < (filesize/2); ++cur) |
41 { | 45 { |