summaryrefslogtreecommitdiff
path: root/ops.yaml
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2018-06-20 20:36:40 -0400
committerPaul Duncan <pabs@pablotron.org>2018-06-20 20:36:40 -0400
commit7f7395f6a9429eb771fdc52742ee4d44ea0734ba (patch)
treeae1a2c7f86bf2f50e9fc4a962bf2439eebf0dd3d /ops.yaml
parent2ce21e092161fcc41fa51b365aeb4dd071d7e949 (diff)
downloadgb-c-7f7395f6a9429eb771fdc52742ee4d44ea0734ba.tar.bz2
gb-c-7f7395f6a9429eb771fdc52742ee4d44ea0734ba.zip
add stub gpu_draw() method, enable writing to vram
Diffstat (limited to 'ops.yaml')
-rw-r--r--ops.yaml18
1 files changed, 12 insertions, 6 deletions
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:
@@ -9384,6 +9384,14 @@ templates:
}
static void
+ gpu_draw(
+ gb_t * const ctx
+ ) {
+ UNUSED(ctx);
+ // TODO
+ }
+
+ static void
gpu_step(
gb_t * const ctx,
const uint16_t clock
@@ -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;