From c37397234534e9888dfeed9b1728c46646c33b58 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Fri, 10 Mar 2023 13:16:16 +0100 Subject: `clang-format` --- src/ppusim/sim.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/ppusim/sim.c') diff --git a/src/ppusim/sim.c b/src/ppusim/sim.c index 2816b31..449b78d 100644 --- a/src/ppusim/sim.c +++ b/src/ppusim/sim.c @@ -1,6 +1,6 @@ -#include -#include #include +#include +#include #include "main.h" #include "ppu/ppu.h" @@ -8,16 +8,17 @@ #include "ppusim/sim.h" #include "ppusim/work.h" -SDL_Window *g_hh_window = NULL; +SDL_Window *g_hh_window = NULL; SDL_Renderer *g_hh_renderer = NULL; void hh_ppu_init() { SDL_Init(SDL_INIT_VIDEO | SDL_INIT_EVENTS); - g_hh_window = SDL_CreateWindow("ppusim", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, HH_PPU_SCREEN_WIDTH * HH_PPUSIM_UPSCALE_FACTOR, HH_PPU_SCREEN_HEIGHT * HH_PPUSIM_UPSCALE_FACTOR, SDL_WINDOW_SHOWN); + g_hh_window = SDL_CreateWindow("ppusim", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, HH_PPU_SCREEN_WIDTH * HH_PPUSIM_UPSCALE_FACTOR, + HH_PPU_SCREEN_HEIGHT * HH_PPUSIM_UPSCALE_FACTOR, SDL_WINDOW_SHOWN); g_hh_renderer = SDL_CreateRenderer(g_hh_window, -1, SDL_RENDERER_ACCELERATED); g_hh_ppusim_core_count = SDL_GetCPUCount(); - g_hh_ppusim_threads = malloc(sizeof(pthread_t) * g_hh_ppusim_core_count); + g_hh_ppusim_threads = malloc(sizeof(pthread_t) * g_hh_ppusim_core_count); g_hh_ppusim_vram = malloc(sizeof(hh_ppu_data_t) * 0xffff); memset(g_hh_ppusim_vram, 0x0000, 0xffff); @@ -36,8 +37,9 @@ void hh_loop() { SDL_Event e; while (g_hh_run) { uint32_t start = SDL_GetTicks(); - while (SDL_PollEvent(&e)) if (e.type == SDL_QUIT) exit(0); - + while (SDL_PollEvent(&e)) + if (e.type == SDL_QUIT) exit(0); + hh_ppu_vblank_interrupt(); SDL_RenderClear(g_hh_renderer); -- cgit v1.2.3