Mercurial > repos > blastem
comparison util.c @ 1305:5ceb316c479a
Allow games to be specified in ROM DB via sha1 instead of product ID. Added a new ROM DB memory map device type fixed for emulating simple fixed value copy protection registers. Used those two features to support Ya Se Chuan Shuo via a ROM DB entry.
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Wed, 29 Mar 2017 00:29:44 -0700 |
parents | 96ad1b9bbb3a |
children | e2bd03ed3190 |
comparison
equal
deleted
inserted
replaced
1304:5b90d7669eee | 1305:5ceb316c479a |
---|---|
185 if (!*text) { | 185 if (!*text) { |
186 return text; | 186 return text; |
187 } | 187 } |
188 *text = 0; | 188 *text = 0; |
189 return text+1; | 189 return text+1; |
190 } | |
191 | |
192 void bin_to_hex(uint8_t *output, uint8_t *input, uint64_t size) | |
193 { | |
194 while (size) | |
195 { | |
196 uint8_t digit = *input >> 4; | |
197 digit += digit > 9 ? 'a' - 0xa : '0'; | |
198 *(output++) = digit; | |
199 digit = *(input++) & 0xF; | |
200 digit += digit > 9 ? 'a' - 0xa : '0'; | |
201 *(output++) = digit; | |
202 size--; | |
203 } | |
204 *(output++) = 0; | |
190 } | 205 } |
191 | 206 |
192 char is_path_sep(char c) | 207 char is_path_sep(char c) |
193 { | 208 { |
194 #ifdef _WIN32 | 209 #ifdef _WIN32 |