Changeset 6e313dd in buchla-emu for emu


Ignore:
Timestamp:
08/01/2017 11:11:47 PM (7 years ago)
Author:
Thomas Lopatic <thomas@…>
Branches:
master
Children:
08471db
Parents:
bdd5a63
Message:

Be friendlier to Valgrind.

Location:
emu
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • emu/cpu.c

    rbdd5a63 r6e313dd  
    656656{
    657657        inf("entering CPU loop");
     658        int32_t count = 0;
    658659
    659660        while (SDL_AtomicGet(&run) != 0) {
     
    677678                }
    678679
     680                if ((++count & 0x1ff) == 0) {
     681                        SDL_Delay(0);
     682                }
     683
    679684                while (SDL_GetPerformanceCounter() < until) {
    680                         _mm_pause();
     685                        for (int32_t i = 0; i < 100; ++i) {
     686                                _mm_pause();
     687                        }
    681688                }
    682689        }
  • emu/sdl.c

    rbdd5a63 r6e313dd  
    2323#define ver2(...) _ver(sdl_verbose, 1, __VA_ARGS__)
    2424#define ver3(...) _ver(sdl_verbose, 2, __VA_ARGS__)
     25
     26typedef void (*sdl_func_t)(void);
     27
     28static sdl_func_t sdl_funcs[] = {
     29        ser_sdl
     30};
    2531
    2632void sdl_init(void)
     
    6167
    6268        while (SDL_AtomicGet(&run) != 0) {
    63                 ser_sdl();
     69                for (int32_t i = 0; i < ARRAY_COUNT(sdl_funcs); ++i) {
     70                        sdl_funcs[i]();
     71                }
    6472
    6573                SDL_Event ev;
Note: See TracChangeset for help on using the changeset viewer.