Skip to content

Commit

Permalink
rom_data_pending should be just 1 bit flag (not 7)
Browse files Browse the repository at this point in the history
  • Loading branch information
rejunity committed Nov 10, 2024
1 parent 64da04a commit 5421620
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/tt_um_rejunity_atari2600.v
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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] ||
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 5421620

Please sign in to comment.