From 7f7395f6a9429eb771fdc52742ee4d44ea0734ba Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Wed, 20 Jun 2018 20:36:40 -0400 Subject: add stub gpu_draw() method, enable writing to vram --- ops.yaml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'ops.yaml') diff --git a/ops.yaml b/ops.yaml index 158b6df..0b6a42e 100644 --- a/ops.yaml +++ b/ops.yaml @@ -8319,8 +8319,8 @@ templates: case 0x8000: case 0x9000: // vram (8k) - // FIXME: can we write directly to vram? - // return ctx->mmu.vram[addr & 0x1FFF]; + // (FIXME: can we write directly to vram?) + ctx->mmu.vram[addr & 0x1FFF] = val; break; case 0xA000: case 0xB000: @@ -9383,6 +9383,14 @@ templates: } } + static void + gpu_draw( + gb_t * const ctx + ) { + UNUSED(ctx); + // TODO + } + static void gpu_step( gb_t * const ctx, @@ -9412,13 +9420,12 @@ templates: break; case GPU_MODE_HBLANK: if (ctx->gpu.clock > 204) { - // clear clock, increment line + // clear clock, draw line, increment line ctx->gpu.clock = 0; + gpu_draw(ctx); gpu_set_line(ctx, ctx->gpu.line + 1); if (ctx->gpu.line < 143) { - // TODO: process scanline - // set mode gpu_set_mode(ctx, GPU_MODE_OAM); } else { @@ -9437,7 +9444,6 @@ templates: ctx->gpu.clock = 0; gpu_set_line(ctx, ctx->gpu.line + 1); - if (ctx->gpu.line > 153) { // reset clock, reset line, set mode ctx->gpu.clock = 0; -- cgit v1.2.3