Don't forget to disable/enable write lock to banks when loading ROM from file. Handle unsupported file sizes a bit better. Free the buffer.