On 1Chip consoles the carrier is generated inside the S-CPUN. So there is no problem at all as MCLK_o is feeded into clock input of the S-CPUN anyway.
On 3Chip consoles it might be a problem. Is there anything which kind of artefacts one can look for?
At the moment code looks like that:
Spoiler
Code: Select all
module snes_mult_func(
[...]
input ColorCarrierPAL_i,
output ColorCarrier_o
);
[...]
wire MCLK_EXT_pre;
snes_dejitter dejitter_u(
.MCLK_XTAL_i(MCLK_EXT_i),
.MCLK_EXT_i(MCLK_EXT_i),
.MCLK_SEL_i(DEJITTER_BYPASS),
.CSYNC_i(CSYNC_i),
.GCLK_o(MCLK_EXT_pre),
.CSYNC_o(CSYNC_o)
);
reg ColorCarrierNTSC;
reg [1:0] div_cnt;
always @(posedge MCLK_EXT_pre) begin
if (div_cnt[1]) begin
div_cnt <= 2'b00;
ColorCarrierNTSC <= ~ColorCarrierNTSC;
end else begin
div_cnt <= div_cnt + 1'b1;
end
end
assign MCLK_EXT_o = MCLK_EXT_pre;
assign ColorCarrier_o = PALMODE ? ColorCarrierPAL_i : ColorCarrierNTSC;
endmodule