Changeset ebc8f69 in buchla-emu
- Timestamp:
- 07/20/2017 08:18:39 PM (7 years ago)
- Branches:
- master
- Children:
- 4c71d39
- Parents:
- 2147e53
- Location:
- emu
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
emu/all.h
r2147e53 rebc8f69 21 21 #include <stdio.h> 22 22 #include <unistd.h> 23 24 #include <xmmintrin.h> 23 25 24 26 #include <m68k.h> -
emu/cpu.c
r2147e53 rebc8f69 26 26 bool cpu_verbose = false; 27 27 28 #define CYCLES 70 28 #define CPU_FREQ 7000000 29 #define PER_SEC 100000 29 30 30 31 #define APP_START 0x10000 … … 450 451 m68k_pulse_reset(); 451 452 453 uint64_t freq = SDL_GetPerformanceFrequency(); 454 uint64_t quan = freq / PER_SEC; 455 inf("freq %" PRIu64 " quan %" PRIu64, freq, quan); 456 452 457 bool run = true; 453 458 454 459 while (run) { 455 m68k_execute(CYCLES); 460 uint64_t until = SDL_GetPerformanceCounter() + quan; 461 462 m68k_execute(CPU_FREQ / PER_SEC); 456 463 hw_exec(); 457 464 … … 461 468 if (ev.type == SDL_QUIT) { 462 469 run = false; 463 break;464 470 } 465 471 } 472 473 while (SDL_GetPerformanceCounter() < until) { 474 _mm_pause(); 475 } 466 476 } 467 477 -
emu/sdl.c
r2147e53 rebc8f69 28 28 void sdl_init(void) 29 29 { 30 if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_EVENTS ) < 0) {30 if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_EVENTS | SDL_INIT_TIMER) < 0) { 31 31 fprintf(stderr, "SDL_Init() failed: %s\n", SDL_GetError()); 32 32 exit(1);
Note:
See TracChangeset
for help on using the changeset viewer.