Mercurial > repos > blastem
diff util.c @ 1103:22e87b739ad6
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.
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Fri, 09 Dec 2016 09:48:48 -0800 |
parents | 266dc3f31f35 |
children | 160e3f597cec |
line wrap: on
line diff
--- a/util.c Mon Nov 28 22:45:46 2016 -0800 +++ b/util.c Fri Dec 09 09:48:48 2016 -0800 @@ -57,6 +57,15 @@ 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);