GBC: missing toggle after rebase

This commit is contained in:
Bruno Duarte Gouveia
2018-12-27 20:40:47 +00:00
parent ba70cdfc01
commit 8e355fd295
2 changed files with 7 additions and 4 deletions

View File

@@ -133,7 +133,7 @@ localparam CONF_STR1 = {
"GAMEBOY;;",
"-;",
"FS,GBCGB,Load ROM;",
"OB,System,Gameboy;", //Stub to disambiguate loading hybrid .gbc games in original gb mode
"OB,System,Gameboy,Gameboy Color;",
"-;",
"OC,Inverted color,No,Yes;",
"O1,Palette,Grayscale,Custom;"
@@ -502,6 +502,7 @@ wire speed;
gb gb (
.reset ( reset ),
.clk ( clk_cpu ), // the whole gameboy runs on 4mhnz
.clk2x ( clk_cpu2x ), // ~8MHz in dualspeed mode (GBC)
.fast_boot ( status[2] ),
.joystick ( joystick ),
@@ -576,6 +577,7 @@ assign VGA_VS = video_vs;
wire ce_cpu2x = ce_pix;
wire clk_cpu = clk_sys & ce_cpu;
wire clk_cpu2x = clk_sys & ce_pix;
reg ce_pix, ce_cpu;
always @(negedge clk_sys) begin

7
gb.v
View File

@@ -532,13 +532,14 @@ end
// ------------------------ internal boot rom -------------------------
// --------------------------------------------------------------------
// writing 01 to $ff50 disables the internal rom
// writing 01(GB) or 11(GBC) to $ff50 disables the internal rom
reg boot_rom_enabled;
always @(posedge clk) begin
if(reset)
boot_rom_enabled <= 1'b1;
else if((cpu_addr == 16'hff50) && !cpu_wr_n && cpu_do[0])
boot_rom_enabled <= 1'b0;
else if((cpu_addr == 16'hff50) && !cpu_wr_n)
if ((isGBC && cpu_do[7:0]==8'h11) || (!isGBC && cpu_do[0]))
boot_rom_enabled <= 1'b0;
end
// combine boot rom data with cartridge data