diff options
author | Paul Duncan <pabs@pablotron.org> | 2018-06-27 23:21:22 -0400 |
---|---|---|
committer | Paul Duncan <pabs@pablotron.org> | 2018-06-27 23:21:22 -0400 |
commit | 5362a91b05721940441365c5cf84218e4bdb7549 (patch) | |
tree | 8f891f8976c5d7f24c4dafa1ec55c69c525a363f /ops.yaml | |
parent | fa0db0d91035b8ff66bd40608ecf8c835b74799b (diff) | |
download | gb-c-master.tar.bz2 gb-c-master.zip |
Diffstat (limited to 'ops.yaml')
-rw-r--r-- | ops.yaml | 29 |
1 files changed, 9 insertions, 20 deletions
@@ -9044,6 +9044,10 @@ templates: // oam memory (160 bytes): ctx->mmu.oam[addr - 0xFE00] = val; + if (ctx->config && ctx->config->on_oam_wb) { + ctx->config->on_oam_wb(ctx, addr, val); + } + // invalidate oam cache ctx->gpu.oam_dirty = true; } @@ -9092,6 +9096,8 @@ templates: ctx->mmu.ram[addr & 0x1FFF] = val; break; } + + break; default: // never reached break; @@ -9108,27 +9114,10 @@ templates: ctx->config->on_mmu_wb(ctx, addr, val); } - switch (addr & 0xF000) { - case 0x0000: - case 0x1000: - case 0x2000: - case 0x3000: - case 0x4000: - case 0x5000: - case 0x6000: - case 0x7000: - rom_wb(ctx, addr, val); - break; - case 0x8000: - case 0x9000: - case 0xA000: - case 0xB000: - case 0xC000: - case 0xD000: - case 0xE000: - case 0xF000: + if (addr & 0xF000) { ram_wb(ctx, addr, val); - break; + } else { + rom_wb(ctx, addr, val); } } |