aboutsummaryrefslogtreecommitdiff
path: root/src/ppusim/work.c
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2023-04-06 16:49:36 +0200
committerlonkaars <loek@pipeframe.xyz>2023-04-06 16:49:36 +0200
commit892424ba4d0c979e4351f7a866b6fe777783e4d2 (patch)
treed6688765834be74370038d8662703bd83b1acd40 /src/ppusim/work.c
parent4881723cf765fbd7bad2a1f08baf5897a7425401 (diff)
dma send done and working
Diffstat (limited to 'src/ppusim/work.c')
-rw-r--r--src/ppusim/work.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/ppusim/work.c b/src/ppusim/work.c
index 96d15aa..977b2c4 100644
--- a/src/ppusim/work.c
+++ b/src/ppusim/work.c
@@ -6,6 +6,8 @@
#include "ppusim/pixel.h"
#include "ppusim/sim.h"
#include "ppusim/work.h"
+#include "ppusim/mem.h"
+#include "ppu/internals.h"
pthread_t *g_hh_ppusim_threads;
unsigned g_hh_ppusim_core_count;
@@ -23,6 +25,10 @@ void *hh_ppusim_draw_thread(void *arg) {
}
void hh_ppusim_draw_frame(SDL_Renderer *renderer) {
+ hh_ppu_data_t *aux = &g_hh_ppusim_vram[HH_PPU_VRAM_AUX_OFFSET];
+ bool reset = HH_RESIZE(aux[1], 2, 2);
+ if (reset) memset(g_hh_ppusim_vram, 0x0000, 0xffff * sizeof(hh_ppu_data_t));
+
for (unsigned core = 0; core < g_hh_ppusim_core_count; core++) pthread_create(&g_hh_ppusim_threads[core], NULL, hh_ppusim_draw_thread, (void *)(unsigned long)core);
for (unsigned core = 0; core < g_hh_ppusim_core_count; core++) pthread_join(g_hh_ppusim_threads[core], NULL);