X-Git-Url: http://git.joshuawise.com/fpgaboy.git/blobdiff_plain/97649fedb7865d889dab2e20139bc887d871ed00..56b8785247e66884bbdca93bda23fa700e840a35:/GBZ80Core.v diff --git a/GBZ80Core.v b/GBZ80Core.v index cb80cb8..968cd26 100644 --- a/GBZ80Core.v +++ b/GBZ80Core.v @@ -70,18 +70,18 @@ module GBZ80Core( assign busdata = buswr ? buswdata : 8'bzzzzzzzz; initial begin - registers[ 0] = 0; - registers[ 1] = 0; - registers[ 2] = 0; - registers[ 3] = 0; - registers[ 4] = 0; - registers[ 5] = 0; - registers[ 6] = 0; - registers[ 7] = 0; - registers[ 8] = 0; - registers[ 9] = 0; - registers[10] = 0; - registers[11] = 0; + registers[ 0] <= 0; + registers[ 1] <= 0; + registers[ 2] <= 0; + registers[ 3] <= 0; + registers[ 4] <= 0; + registers[ 5] <= 0; + registers[ 6] <= 0; + registers[ 7] <= 0; + registers[ 8] <= 0; + registers[ 9] <= 0; + registers[10] <= 0; + registers[11] <= 0; end always @(posedge clk) @@ -364,12 +364,12 @@ module GBZ80Core( `INSN_PUSH_reg: begin /* PUSH is 16 cycles! */ case (cycle) 0: begin - {registers[`REG_SPH],registers[`REG_SPL]} = + {registers[`REG_SPH],registers[`REG_SPL]} <= {registers[`REG_SPH],registers[`REG_SPL]} - 1; cycle <= 1; end 1: begin - {registers[`REG_SPH],registers[`REG_SPL]} = + {registers[`REG_SPH],registers[`REG_SPL]} <= {registers[`REG_SPH],registers[`REG_SPL]} - 1; cycle <= 2; end @@ -381,7 +381,7 @@ module GBZ80Core( case (cycle) 0: begin cycle <= 1; - {registers[`REG_SPH],registers[`REG_SPL]} = + {registers[`REG_SPH],registers[`REG_SPL]} <= {registers[`REG_SPH],registers[`REG_SPL]} + 1; end 1: begin @@ -391,7 +391,7 @@ module GBZ80Core( `INSN_stack_DE: registers[`REG_E] <= rdata; `INSN_stack_HL: registers[`REG_L] <= rdata; endcase - {registers[`REG_SPH],registers[`REG_SPL]} = + {registers[`REG_SPH],registers[`REG_SPL]} <= {registers[`REG_SPH],registers[`REG_SPL]} + 1; cycle <= 2; end