diff --git a/src/tt_um_rejunity_atari2600.v b/src/tt_um_rejunity_atari2600.v index 3252595..68801c7 100644 --- a/src/tt_um_rejunity_atari2600.v +++ b/src/tt_um_rejunity_atari2600.v @@ -374,7 +374,7 @@ module tt_um_rejunity_atari2600 ( reg spi_restart; // wire [23:0] spi_address = {4'b0001, rom_config[7:0], address_bus[11:0]}; // iceprog -o1024k wire [23:0] spi_address = {rom_config[7:5], 1'b1, rom_config[3:0], 4'b0000, address_bus[11:0]}; // iceprog -o1024k - wire need_new_rom_data = valid_rom_address_on_bus && (rom_data_pending == 0) && !rom_addr_in_cache; + wire need_new_rom_data = valid_rom_address_on_bus && !rom_data_pending && !rom_addr_in_cache; wire spi_start_read = !spi_busy && (need_new_rom_data || spi_restart); wire spi_stop_read = spi_busy && need_new_rom_data; // wire spi_stop_read = spi_data_ready; @@ -414,7 +414,7 @@ module tt_um_rejunity_atari2600 ( .busy(spi_busy) ); - reg [7:0] rom_data_pending; + reg rom_data_pending; reg [11:0] rom_last_read_addr; reg [11:0] rom_next_addr_in_queue; wire rom_addr_in_cache = (rom_last_read_addr == address_bus[11:0] || @@ -446,7 +446,7 @@ module tt_um_rejunity_atari2600 ( // 65..70% within ±4 bytes // 8..9% within +4 bytes end - wire wait_for_memory = rom_cycle && (rom_data_pending > 0); + wire wait_for_memory = rom_cycle && rom_data_pending; `else wire wait_for_memory = 0; `endif