diff --git a/cores/gameboy/gb_mist.v b/cores/gameboy/gb_mist.v index ed0736e..e8eda65 100644 --- a/cores/gameboy/gb_mist.v +++ b/cores/gameboy/gb_mist.v @@ -70,17 +70,18 @@ wire [7:0] joystick_1; parameter CONF_STR = { "GAMEBOY;;", "F,GBCGB ,Load;", + "O4,Mode,Auto,Color;", "O1,LCD color,white,yellow;", "O2,Boot,Normal,Fast;", "T3,Reset" }; -parameter CONF_STR_LEN = 9+14+26+20+8; +parameter CONF_STR_LEN = 9+14+19+26+20+8; // the status register is controlled by the on screen display (OSD) wire [7:0] status; wire [1:0] buttons; -wire isGBC = dio_index[7:6] == 0; +wire isGBC = (dio_index[7:6] == 0) || status[4]; // include user_io module for arm controller communication user_io #(.STRLEN(CONF_STR_LEN)) user_io ( diff --git a/cores/gameboy/lcd.v b/cores/gameboy/lcd.v index d2d8958..9cc671b 100644 --- a/cores/gameboy/lcd.v +++ b/cores/gameboy/lcd.v @@ -44,22 +44,21 @@ always @(posedge clk) begin shift_reg[shift_reg_wptr] <= data; shift_reg_wptr <= {p_toggle, shift_reg_wptr[7:0] + 1'd1}; end + end - last_mode_in <= mode; - - // reset write pointer at end of hsync phase - if((mode != 2'b00) && (last_mode_in == 2'b00)) begin - shift_reg_wptr <= 0; - p_toggle <= !p_toggle; - end + last_mode_in <= mode; + // reset write pointer at end of hsync phase + if((mode != 2'b00) && (last_mode_in == 2'b00)) begin + shift_reg_wptr <= {!p_toggle, 8'd0}; + p_toggle <= !p_toggle; end end // parameter H = 160; // width of visible area -parameter HFP = 24; // unused time before hsync +parameter HFP = 18; // unused time before hsync parameter HS = 20; // width of hsync -parameter HBP = 24; // unused time after hsync +parameter HBP = 30; // unused time after hsync // total = 228 parameter V = 576; // height of visible area @@ -131,7 +130,7 @@ always@(posedge clk) begin shift_reg_rptr <= {!p_toggle, shift_reg_rptr[7:0] + 1'd1}; end else begin blank <= 1'b1; - shift_reg_rptr <= 0; + shift_reg_rptr <= {!p_toggle, 8'd0}; end end end