diff options
author | Michael Pavone <pavone@retrodev.com> | 2016-12-09 09:48:48 -0800 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2016-12-09 09:48:48 -0800 |
commit | 818a3ef482b96c0a963bb515291944346586f106 (patch) | |
tree | a13839316062ed0986e1b0b8317c6df3e74d7610 /util.c | |
parent | aaca957565a13e9f2c6ab5ae085d7c8fb6c0fa85 (diff) |
WIP split of ROM loading/argument parsing from Genesis emulation code. Compiles and doesn't crash, but nothing works. Still a few too many globals as well.
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -57,6 +57,15 @@ char * alloc_concat_m(int num_parts, char const ** parts) return ret; } +void byteswap_rom(int filesize, uint16_t *cart) +{ + for(uint16_t *cur = cart; cur - cart < filesize/2; ++cur) + { + *cur = (*cur >> 8) | (*cur << 8); + } +} + + long file_size(FILE * f) { fseek(f, 0, SEEK_END); |