URL
https://opencores.org/ocsvn/a-z80/a-z80/trunk
Subversion Repositories a-z80
Compare Revisions
- This comparison shows the changes necessary to convert path
/a-z80/trunk/host/zxspectrum_de1
- from Rev 11 to Rev 13
- ↔ Reverse comparison
Rev 11 → Rev 13
/rom/combined.rom
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/ula/ula.sv
147,7 → 147,7
ula_data = 8'hFF; |
// Regular IO at every odd address: line-in and keyboard |
if (A[0]==0) begin |
ula_data = { 1'b0, pcm_inl[14] | pcm_inr[14], 1'b0, key_row[4:0] }; |
ula_data = { 1'b1, pcm_inl[14] | pcm_inr[14], 1'b1, key_row[4:0] }; |
end |
end |
|
/ula/zx_kbd.sv
54,9 → 54,9
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
// |
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
reg [4:0] keys [0:7]; // 8 rows of 5 bits each |
reg [4:0] keys [0:7]; // 8 rows of 5 bits each: contains 0 for a pressed key at a specific location, 1 otherwise |
|
reg released; // Tracks "released" scan code (F0) |
reg released; // Tracks "released" scan code (F0): contains 0 when a key is pressed, 1 otherwise |
reg extended; // Tracks "extended" scan code (E0) |
reg shifted; // Tracks local "shifted" state |
|
91,9 → 91,9
keys[7] <= '1; |
end else |
if (scan_code_ready) begin |
if (scan_code==8'hE0) |
if (scan_code==8'hE0) // Extended code prefix byte |
extended <= 1; |
else if (scan_code==8'hF0) |
else if (scan_code==8'hF0) // Break code prefix byte |
released <= 1; |
else begin |
// Cancel release/extended flags for the next clock |
123,7 → 123,6
end |
else begin |
// For each PS/2 scan-code, set the ZX keyboard matrix state |
// 'released' contains 0 when a key is pressed; 1 otherwise |
case (scan_code) |
8'h12: shifted <= !released; // Local SHIFT key (left) |
8'h59: shifted <= !released; // Local SHIFT key (right) |
185,76 → 184,43
keys[0][0] <= released; // CAPS SHIFT |
keys[7][0] <= released; // SPACE |
end |
// With shifted keys, we need to make inactive (set to 1) other corresponding key |
// Otherwise, it will stay active if the shift was released first |
8'h4E: begin // - or (shifted) _ |
if (!shifted) begin |
keys[7][1] <= released; // SYMBOL SHIFT (Red) |
keys[6][3] <= released; // J |
keys[7][1] <= released; // SYMBOL SHIFT (Red) |
keys[4][0] <= shifted ? released : 1; // 0 |
keys[6][3] <= shifted ? 1 : released; // J |
end |
else begin |
keys[7][1] <= released; // SYMBOL SHIFT (Red) |
keys[4][0] <= released; // 0 |
end |
end |
8'h55: begin // = or (shifted) + |
if (!shifted) begin |
keys[7][1] <= released; // SYMBOL SHIFT (Red) |
keys[6][1] <= released; // L |
keys[7][1] <= released; // SYMBOL SHIFT (Red) |
keys[6][2] <= shifted ? released : 1; // K |
keys[6][1] <= shifted ? 1 : released; // L |
end |
else begin |
keys[7][1] <= released; // SYMBOL SHIFT (Red) |
keys[6][2] <= released; // K |
end |
end |
8'h52: begin // ' or (shifted) " |
if (!shifted) begin |
keys[7][1] <= released; // SYMBOL SHIFT (Red) |
keys[4][3] <= released; // 7 |
keys[7][1] <= released; // SYMBOL SHIFT (Red) |
keys[5][0] <= shifted ? released : 1; // P |
keys[4][3] <= shifted ? 1 : released; // 7 |
end |
else begin |
keys[7][1] <= released; // SYMBOL SHIFT (Red) |
keys[5][0] <= released; // P |
end |
end |
8'h4C: begin // ; or (shifted) : |
if (!shifted) begin |
keys[7][1] <= released; // SYMBOL SHIFT (Red) |
keys[5][1] <= released; // O |
keys[7][1] <= released; // SYMBOL SHIFT (Red) |
keys[0][1] <= shifted ? released : 1; // Z |
keys[5][1] <= shifted ? 1 : released; // O |
end |
else begin |
keys[7][1] <= released; // SYMBOL SHIFT (Red) |
keys[0][1] <= released; // Z |
end |
end |
8'h41: begin // , or (shifted) < |
if (!shifted) begin |
keys[7][1] <= released; // SYMBOL SHIFT (Red) |
keys[7][3] <= released; // N |
keys[7][1] <= released; // SYMBOL SHIFT (Red) |
keys[2][3] <= shifted ? released : 1; // R |
keys[7][3] <= shifted ? 1 : released; // N |
end |
else begin |
keys[7][1] <= released; // SYMBOL SHIFT (Red) |
keys[2][3] <= released; // R |
end |
end |
8'h49: begin // . or (shifted) > |
if (!shifted) begin |
keys[7][1] <= released; // SYMBOL SHIFT (Red) |
keys[7][2] <= released; // M |
keys[7][1] <= released; // SYMBOL SHIFT (Red) |
keys[2][4] <= shifted ? released : 1; // T |
keys[7][2] <= shifted ? 1 : released; // M |
end |
else begin |
keys[7][1] <= released; // SYMBOL SHIFT (Red) |
keys[2][4] <= released; // T |
end |
end |
8'h4A: begin // / or (shifted) ? |
if (!shifted) begin |
keys[7][1] <= released; // SYMBOL SHIFT (Red) |
keys[0][4] <= released; // V |
keys[7][1] <= released; // SYMBOL SHIFT (Red) |
keys[0][3] <= shifted ? released : 1; // C |
keys[0][4] <= shifted ? 1 : released; // V |
end |
else begin |
keys[7][1] <= released; // SYMBOL SHIFT (Red) |
keys[0][3] <= released; // C |
end |
end |
endcase |
end |
end |