aboutsummaryrefslogtreecommitdiffstats
path: root/display.v
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2004-10-01 05:34:14 +0000
committerH. Peter Anvin <hpa@zytor.com>2004-10-01 05:34:14 +0000
commitc3134988839901de48cff32ad3316988a05ad2b2 (patch)
tree846789cce0a81dd52c4b9b41de0326e221aa7d60 /display.v
parentf36a04a4dd6e6cf1a477c866d02786d93f7a69c3 (diff)
downloadabc80-c3134988839901de48cff32ad3316988a05ad2b2.tar.gz
abc80-c3134988839901de48cff32ad3316988a05ad2b2.tar.xz
abc80-c3134988839901de48cff32ad3316988a05ad2b2.zip
Support double height textCVS: ----------------------------------------------------------------------
Diffstat (limited to 'display.v')
-rw-r--r--display.v38
1 files changed, 29 insertions, 9 deletions
diff --git a/display.v b/display.v
index 6dca8a7..381a13c 100644
--- a/display.v
+++ b/display.v
@@ -80,6 +80,7 @@ module display (
reg [9:0] x; // Horizontal pixel count
reg [8:0] y; // Vertical pixel count
wire [10:0] a80; // Character row assuming 80 columns
+ wire [10:0] a80u; // Character row assuming 80 columns (up 1 line)
reg [5:0] scan_counter; // Counter of total scans (for flashing et al)
reg [7:0] pixrow; // One character worth of pixels
reg [2:0] fg; // Foreground RGB
@@ -89,28 +90,37 @@ module display (
reg isgsep; // Separated graphics?
reg isgrel; // Hold graphics?
reg isdble; // Double height?
+ reg wasdble; // Double height (previous row)
reg isflsh; // Flashing?
reg ishide; // Hidden
reg [7:0] thischar; // Character code currently processing
- wire [3:0] xmiddle; // Used in address calculation
- wire [3:0] ymiddle; // Used in address calculation
wire xvideo; // Non-blanked in the x direction
wire yvideo; // Non-blanked in the y direction
// Address mapping for 80 characters; for 40 characters
// we shift this left by 1
assign a80[3:0] = x[6:3];
- assign xmiddle = { 1'b0, x[9:7] };
- assign ymiddle = { y[8:7], y[8:7] };
+ wire [3:0] xmiddle = { 1'b0, x[9:7] };
+ wire [3:0] ymiddle = { y[8:7] , y[8:7] };
assign a80[7:4] = xmiddle+ymiddle;
assign a80[10:8] = y[6:4];
+ // Address mapping for 80 characters minus one line
+ wire [4:0] ylu = y[8:4] - 1;
+ assign a80u[3:0] = x[6:3];
+ wire [3:0] yumiddle = { ylu[4:3] , ylu[4:3] };
+ assign a80u[7:4] = xmiddle+yumiddle;
+ assign a80u[10:8] = ylu[2:0];
+
// Final address mapping
- assign a = width ? a80[10:0] : { 1'b1, a80[10:1] };
+ // Note: We read the current char between pixels 0 and 1,
+ // and the char above between pixels 2 and 3; hence the use of x[1].
+ wire [10:0] amap = x[1] ? a80u : a80;
+ assign a = width ? amap[10:0] : { 1'b1, amap[10:1] };
// Character generator address mapping
assign ga[10:4] = thischar[6:0];
- assign ga[3:0] = y[3:0];
+ assign ga[3:0] = wasdble ? { 1'b1, y[3:1] } : isdble ? { 0'b0, y[3:1] } : y[3:0];
// Video enable signal
assign xvideo = ( x < x_blank );
@@ -160,11 +170,20 @@ module display (
if ( width | ~x[3] )
begin
case ( x[2:0] )
- 3'b011:
+ 3'b001:
begin
// Load and process character
thischar <= d;
end
+
+ 3'b011:
+ begin
+ if ( (y[8:4] != 0) && (d[6:1] == 6'b000110) )
+ wasdble <= d[0];
+
+ if ( wasdble )
+ thischar <= d;
+ end
3'b111:
begin
@@ -192,12 +211,12 @@ module display (
isgsep <= 1'b0;
5'b11010:
isgsep <= 1'b1;
- 5'b11100:
+ 5'b11100: // BLBG
begin
bg <= 3'b000;
fg <= bg;
end
- 5'b11101:
+ 5'b11101: // NWBG
begin
bg <= fg;
fg <= 3'b000;
@@ -296,6 +315,7 @@ module display (
isflsh <= 0; // Not flashing
isgsep <= 0; // Not separated
isdble <= 0; // Not double
+ wasdble <= 0; // Not double
isgrel <= 1; // Release graphics
ishide <= 0; // Not hidden
pixrow <= 8'b0; // Read-ahead spot is blank