@Badwolf I am trying to setup your register but I really don't get Verilog. Its driving me nuts!
I mean I have..
Code: Select all
wire selected_patch_test = (A[29:2] == 28'h00200000) && (AS30 == 1'b0); // 8MB long word aligned
//wire selected_patch_test = 1'b0; // ok
always @(posedge CLK7M) begin
if (BUSEN_IRQ == 1'b1) begin
data[7:0] <= { D[7:6], 1'b0, D[4:0] }; // IRQ logic modifies incoming D
end
else if (selected_patch_test == 1'b1) begin
data[7:0] <= 8'b10101010; // hardcoded value from patch address read
end
end
assign D[7:0] = BUSEN_IRQ ? 8'bzzzzzzzz : data[7:0];
IRQ part (lets just assume that works fine for now :lol: )
The code seems straightforward.. but as soon as I decode the address, the STE won't even try to boot up!!
I was trying to multiplex assign D[7:0] = BUSEN_IRQ ? 8'bzzzzzzzz : data[7:0]; before and gave up. DTACK issued OK but all I got back was random numbers.. which you would think I would just get back FF really anyway!
I did have it at the 80MB and 90MB mark, but not sure STOS is happy there, so moved it to the 8MB mark as nothing should be there.. but something still isn't happy.....
EDIT:
This seems a lot happier ( as in the STE boots now! )
Code: Select all
wire selected_patch_test = (A[29:2] == 28'h00200000) & ~AS30 & DTACK;
Tried this and it just locked up after the Atari logo ! :roll:
Code: Select all
reg SWAP_ON;
always @(posedge CLK7M) begin
if (BUSEN_IRQ == 1'b1) begin
data[7:0] <= { D[7:6], 1'b0, D[4:0] }; // IRQ logic modifies incoming D
SWAP_ON <= 1'b1;
end
else if (selected_patch_test == 1'b1) begin
data[7:0] <= 8'b10101010; // hardcoded value from patch address read
SWAP_ON <= 1'b1;
end
else begin
SWAP_ON <= 1'b0;
end
end
// Drive the bus only when SWAP_ON is high
assign D[7:0] = SWAP_ON ? data[7:0] : 8'bzzzzzzzz;
I'm really starting to hate Verilog! :pullhair: :headbang:
And the AI's as they hell bent on swapping things around when they shouldn't be doing!!!
EDIT
Even more fancy..
Code: Select all
always @(posedge CLK7M or negedge RESET) begin
if (!RESET) begin
SWAP_ON <= 1'b0;
data[7:0] <= 8'h00;
end else if (AS30 == 1'b1) begin
// Bus inactive → release SWAP_ON
SWAP_ON <= 1'b0;
end else if (BUSEN_IRQ == 1'b1) begin
data[7:0] <= { D[7:6], 1'b0, D[4:0] }; // IRQ format
SWAP_ON <= 1'b1;
end else if (selected_patch_test == 1'b1) begin
data[7:0] <= 8'b10101010; // test pattern
SWAP_ON <= 1'b1;
end else begin
SWAP_ON <= 1'b0;
end
end
:comp:
EDIT:
Well one problem is I forgot to rename the BUS_EN variable :roll:
My first read comes back as 255 and all second ones 127.. wait a few seconds and 255 again ! I mean the value is supposed to be 170!
Think I got SWAP_ON values backwards as well ... maybe I should just goto bed :)