src/osd/sdl/input.c
| r1247 | r1248 | |
| 247 | 247 | KTT_ENTRY0( STOP, PERIOD, 0xbe, '.', "STOP" ), |
| 248 | 248 | KTT_ENTRY0( SLASH, SLASH, 0xbf, '/', "SLASH" ), |
| 249 | 249 | KTT_ENTRY2( RSHIFT, RSHIFT ), |
| 250 | | KTT_ENTRY0( ASTERISK, KP_MULTIPLY, '*', '*', "ASTERISK" ), |
| 250 | KTT_ENTRY0( ASTERISK, KP_MULTIPLY, '*', '*', "ASTERIX" ), |
| 251 | 251 | KTT_ENTRY2( LALT, LALT ), |
| 252 | 252 | KTT_ENTRY0( SPACE, SPACE, ' ', ' ', "SPACE" ), |
| 253 | 253 | KTT_ENTRY2( CAPSLOCK, CAPSLOCK ), |
src/osd/sdl/drawsdl.c
| r1247 | r1248 | |
| 1494 | 1494 | } |
| 1495 | 1495 | |
| 1496 | 1496 | static void texture_compute_size_subroutine(sdl_info *sdl, texture_info *texture, UINT32 flags, |
| 1497 | | int width, int height, |
| 1497 | UINT32 width, UINT32 height, |
| 1498 | 1498 | int* p_width, int* p_height, int* p_width_create, int* p_height_create) |
| 1499 | 1499 | { |
| 1500 | | int width_create = width; |
| 1501 | | int height_create= height; |
| 1500 | int width_create; |
| 1501 | int height_create; |
| 1502 | 1502 | |
| 1503 | | width_create = get_valid_pow2_value (width, texture->texpow2); |
| 1504 | | height_create = get_valid_pow2_value (height, texture->texpow2); |
| 1503 | if ( texture->texpow2 ) |
| 1504 | { |
| 1505 | width_create = gl_round_to_pow2 (width); |
| 1506 | height_create = gl_round_to_pow2 (height); |
| 1507 | } else if ( texture->type==TEXTURE_TYPE_SHADER ) |
| 1508 | { |
| 1509 | /** |
| 1510 | * at least use a multiple of 8 for shader .. just in case |
| 1511 | */ |
| 1512 | width_create = ( width & ~0x07 ) + ( (width & 0x07)? 8 : 0 ) ; |
| 1513 | height_create = ( height & ~0x07 ) + ( (height & 0x07)? 8 : 0 ) ; |
| 1514 | } else { |
| 1515 | width_create = width ; |
| 1516 | height_create = height ; |
| 1517 | } |
| 1505 | 1518 | |
| 1506 | 1519 | // don't prescale above max texture size |
| 1507 | 1520 | while (texture->xprescale > 1 && width_create * texture->xprescale > sdl->texture_max_width) |
| r1247 | r1248 | |
| 1739 | 1752 | lut_texture_width = sqrt((double)(texture->lut_table_width)); |
| 1740 | 1753 | lut_texture_width = get_valid_pow2_value (lut_texture_width, 1); |
| 1741 | 1754 | |
| 1742 | | if ( lut_texture_width*lut_texture_width < texture->lut_table_width ) |
| 1755 | texture->lut_table_height = texture->lut_table_width / lut_texture_width; |
| 1756 | |
| 1757 | if ( lut_texture_width*texture->lut_table_height < texture->lut_table_width ) |
| 1743 | 1758 | { |
| 1744 | | texture->lut_table_height = 1; |
| 1745 | | } else { |
| 1746 | | texture->lut_table_height = 0; |
| 1759 | texture->lut_table_height += 1; |
| 1747 | 1760 | } |
| 1748 | 1761 | |
| 1749 | | texture->lut_table_height += texture->lut_table_width / lut_texture_width; |
| 1750 | 1762 | texture->lut_table_width = lut_texture_width; |
| 1751 | 1763 | |
| 1752 | 1764 | /** |
| r1247 | r1248 | |
| 1966 | 1978 | texture->texProperties[SDL_TEXFORMAT_TYPE], |
| 1967 | 1979 | &_width, &_height, 1) ) |
| 1968 | 1980 | { |
| 1969 | | mame_printf_error("cannot create lut table texture, req: %dx%d, avail: %dx%d - bail out\n", |
| 1970 | | lut_table_width_pow2, lut_table_height_pow2, (int)_width, (int)_height); |
| 1981 | mame_printf_error("cannot create bitmap texture, req: %dx%d, avail: %dx%d - bail out\n", |
| 1982 | texture->rawwidth_create, texture->rawheight_create, (int)_width, (int)_height); |
| 1971 | 1983 | return -1; |
| 1972 | 1984 | } |
| 1973 | 1985 | |
src/osd/sdl/sdlsync.c
| r1247 | r1248 | |
| 351 | 351 | { |
| 352 | 352 | struct timespec ts; |
| 353 | 353 | struct timeval tp; |
| 354 | | osd_ticks_t t; |
| 355 | | osd_ticks_t msec = timeout * 1000 / osd_ticks_per_second(); |
| 356 | | |
| 354 | UINT64 t; |
| 355 | UINT64 msec = timeout * 1000 / osd_ticks_per_second(); |
| 356 | UINT64 nsec; |
| 357 | |
| 357 | 358 | gettimeofday(&tp, NULL); |
| 358 | 359 | |
| 359 | 360 | ts.tv_sec = tp.tv_sec; |
| 360 | | ts.tv_nsec = tp.tv_usec * 1000 + (msec * 1000000); |
| 361 | | t = ts.tv_nsec / 1000000000; |
| 362 | | ts.tv_nsec = t % 1000000000; |
| 361 | nsec = (UINT64) tp.tv_usec * (UINT64) 1000 + (msec * (UINT64) 1000000); |
| 362 | t = nsec / (UINT64) 1000000000; |
| 363 | ts.tv_nsec = t % (UINT64) 1000000000; |
| 363 | 364 | ts.tv_sec += t; |
| 364 | 365 | |
| 365 | 366 | if (!event->signalled) |
| r1247 | r1248 | |
| 379 | 380 | if (ret == 0) |
| 380 | 381 | break; |
| 381 | 382 | if ( ret != EINTR) |
| 382 | | printf("Error %d while waiting for pthread_cond_timedwait\n", ret); |
| 383 | { |
| 384 | printf("Error %d while waiting for pthread_cond_timedwait: %d - %s\n", ret, (int) t, strerror(ret)); |
| 385 | } |
| 386 | |
| 383 | 387 | } while (TRUE); |
| 384 | 388 | } |
| 385 | 389 | } |