From 9c444892ad458233a7f355088d208fd28bc328f2 Mon Sep 17 00:00:00 2001 From: Gyorgy Szombathelyi Date: Thu, 19 Sep 2019 21:15:14 +0200 Subject: [PATCH 1/3] [C16] Fix videocounter latching condition Fixes Pets Rescue title screen --- cores/c16/ted.v | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cores/c16/ted.v b/cores/c16/ted.v index 86aecf3..f6e9f32 100644 --- a/cores/c16/ted.v +++ b/cores/c16/ted.v @@ -741,7 +741,7 @@ always @(posedge clk) begin if(hpos_392 & videoline==EOS) // clear videocounter reload register at last line videocounter_reload<=0; - else if(VertSubCount==6 && latch_charposition && VertSubActive) // Latch videocounter position at 6th line of a character row + else if(VertSubCount==6 && latch_charposition && enabledisplay) // Latch videocounter position at 6th line of a character row videocounter_reload<=videocounter; end From a446f48412455e5aed6321d3c653df514e557d91 Mon Sep 17 00:00:00 2001 From: Gyorgy Szombathelyi Date: Fri, 20 Sep 2019 21:53:34 +0200 Subject: [PATCH 2/3] [C16] Fix HSP scrolling in Alpharay --- cores/c16/ted.v | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cores/c16/ted.v b/cores/c16/ted.v index f6e9f32..b3e0139 100644 --- a/cores/c16/ted.v +++ b/cores/c16/ted.v @@ -741,6 +741,8 @@ always @(posedge clk) begin if(hpos_392 & videoline==EOS) // clear videocounter reload register at last line videocounter_reload<=0; + else if(inc_videocounter && hcounter_next == 9'd432 && tick8) // if the videocounter running when it's reloaded, that affects the reload value (HSP in Alpharay) + videocounter_reload<=videocounter+1'd1; else if(VertSubCount==6 && latch_charposition && enabledisplay) // Latch videocounter position at 6th line of a character row videocounter_reload<=videocounter; end From 41fc98a704b9323b4c1047e69f6c44a0558479a4 Mon Sep 17 00:00:00 2001 From: Gyorgy Szombathelyi Date: Fri, 20 Sep 2019 23:20:17 +0200 Subject: [PATCH 3/3] [C16] Fix charpos reload latching (Alpharay bottom line) --- cores/c16/ted.v | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cores/c16/ted.v b/cores/c16/ted.v index b3e0139..3c4de92 100644 --- a/cores/c16/ted.v +++ b/cores/c16/ted.v @@ -634,7 +634,7 @@ always @(posedge clk) // DMA and Charpos latch delay trick always @(posedge clk) begin - if(latch_charposition) + if(hpos_392) begin if(VertSubCount==6) CharPosLatch<=1; // CharPosLatch signal activates in line 6 and signals that videocounter (DMA counter) has been latched. It is used in line 7 for character position latch. @@ -651,7 +651,7 @@ always @(posedge clk) // Character Position Reload register $FF1A/$FF1B CharPosReload[7:0]<=data_in; else if(hpos_392 & videoline==EOS) // clear character position reload at last line CharPosReload<=0; - else if(CharPosLatch & latch_charposition & VertSubActive) // latch character position at 7th line of a character row if videocunter was latched in previous 6th row + else if(CharPosLatch & latch_charposition & enabledisplay) // latch character position at 7th line of a character row if videocunter was latched in previous 6th row CharPosReload<=CharPosition; end