diff options
author | Paul Duncan <pabs@pablotron.org> | 2018-06-25 23:27:57 -0400 |
---|---|---|
committer | Paul Duncan <pabs@pablotron.org> | 2018-06-25 23:27:57 -0400 |
commit | 986ba80832c3d355352fa3c936199f388f682a46 (patch) | |
tree | 31c84889f69de601840d1d8315c8f6b8254ac966 | |
parent | eedfbeae69b7f18237aa9d159d297ce717d629ab (diff) | |
download | gb-c-986ba80832c3d355352fa3c936199f388f682a46.tar.bz2 gb-c-986ba80832c3d355352fa3c936199f388f682a46.zip |
init gpu, put clock update before instruction
-rw-r--r-- | gb.h | 2 | ||||
-rwxr-xr-x | gen.rb | 4 | ||||
-rw-r--r-- | ops.yaml | 4 |
3 files changed, 7 insertions, 3 deletions
@@ -51,7 +51,7 @@ struct gb_t_ { // FIXME: combine these? uint8_t ram[0x2000]; // working ram (8k) - uint8_t eram[65536]; // external ram (banked, up to 64k) + uint8_t eram[0x10000]; // external ram (banked, up to 64k) uint8_t vram[0x2000]; // vram (8k) uint8_t oam[0xA0]; // oam (160 bytes) uint8_t zram[0x7F]; // zram (128 bytes) @@ -57,17 +57,17 @@ DATA['ops'].each do |set_id, ops| [ "case 0x%s: /* op: \"%s\", cat: \"%s\" */", + " %s", # time_expr " %s", # action_expr " %s", # pc_expr - " %s", # time_expr " break;" ].join("\n") % [ hex, op['id'], op['cat'], + time_expr, op['code'] || 'cpu_set_state(ctx, old_pc, GB_CPU_STATE_NOT_IMPLEMENTED);', pc_expr, - time_expr, ] end }.join("\n") @@ -10601,4 +10601,8 @@ templates: // init gpu gpu_set_mode(ctx, GPU_MODE_OAM); gpu_set_line(ctx, 0); + ctx->gpu.lcdc = 0x91; + ctx->gpu.bgp = 0xFC; + ctx->gpu.obp0 = 0xFF; + ctx->gpu.obp1 = 0xFF; } |