src/mess/tools/imgtool/modules/amiga.c
| r9733 | r9734 | |
| 301 | 301 | /* Convert amiga time to standard time */ |
| 302 | 302 | static time_t amiga_crack_time(amiga_date *date) |
| 303 | 303 | { |
| 304 | | static const int month_days[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; |
| 304 | int month_days[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; |
| 305 | 305 | int year = 1978, month = 1, year_days = 365; /* base date */ |
| 306 | 306 | int day = date->days; |
| 307 | 307 | struct tm t; |
| r9733 | r9734 | |
| 317 | 317 | } |
| 318 | 318 | |
| 319 | 319 | /* then the month */ |
| 320 | | if (is_leap(year)) |
| 321 | | month_days[1] = 29; |
| 322 | | |
| 323 | 320 | while(day >= month_days[month-1]) |
| 324 | 321 | { |
| 325 | 322 | day -= month_days[month-1]; |
| 323 | if (month == 2 && is_leap(year)) |
| 324 | day -= 1; |
| 326 | 325 | month++; |
| 327 | 326 | } |
| 328 | 327 | |
src/mess/tools/imgtool/modules/psion.c
| r9733 | r9734 | |
| 408 | 408 | { |
| 409 | 409 | psion_pack *pack = (psion_pack*)imgtool_image_extra_bytes(image); |
| 410 | 410 | static const UINT8 opk_magic[4] = {'O', 'P', 'K', 0x00}; |
| 411 | | static const UINT8 pack_head[8] = {0x40, 0x00, 0x59, 0x01, 0x01, 0x01, 0x00, 0x00}; |
| 411 | UINT8 pack_head[8] = {0x40, 0x00, 0x59, 0x01, 0x01, 0x01, 0x00, 0x00}; |
| 412 | 412 | UINT16 checksum; |
| 413 | 413 | |
| 414 | 414 | pack_head[0] |= (option_resolution_lookup_int(opts, 'R')) ? 0x00 : 0x02; |