aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2003-10-16 02:26:59 +0000
committerH. Peter Anvin <hpa@zytor.com>2003-10-16 02:26:59 +0000
commite8eef30aec8181d0eb1913cf53c94edcdf3d55d6 (patch)
treefac3d20c0091eb525f8f3c7559bf34130e451ef8
parentda45be199d89e7b6b0034bcf3b62a0dfa829a0a8 (diff)
downloadabc80-e8eef30aec8181d0eb1913cf53c94edcdf3d55d6.tar.gz
abc80-e8eef30aec8181d0eb1913cf53c94edcdf3d55d6.tar.xz
abc80-e8eef30aec8181d0eb1913cf53c94edcdf3d55d6.zip
Use 7-seg LED to simulate the sound generator
-rw-r--r--CHANGES7
-rw-r--r--README5
-rw-r--r--abc80.v52
3 files changed, 47 insertions, 17 deletions
diff --git a/CHANGES b/CHANGES
new file mode 100644
index 0000000..ae2adb5
--- /dev/null
+++ b/CHANGES
@@ -0,0 +1,7 @@
+Changes in release 3:
+---------------------
+
+* 80-column mode now properly supported, including switching the BASIC
+ ROM.
+
+* The 7-segment LED is used as a substitute for the sound generator.
diff --git a/README b/README
index 8a78ff6..0560daf 100644
--- a/README
+++ b/README
@@ -35,8 +35,9 @@ To read the current memory maps:
in maps,(132)
-=> Eventually this will also support the out (7),map used by
- Mikrodatorn's 64K expansion.
+The MMU also supports "out (7),map" for compatibility with
+Mikrodatorn's 64K expansion. This sets all the maps to the same
+value.
The top 4 bits of the physical page indicate memory device; the rest
is address; see data/mmuinit.pl for which memory devices exist.
diff --git a/abc80.v b/abc80.v
index adb6cd4..b9c2b6a 100644
--- a/abc80.v
+++ b/abc80.v
@@ -233,6 +233,10 @@ module abc80 (
// for I/O devices to snoop the bus.
wire cpu_reti_n; // RETI# from CPU
+ // ABC-bus decoded strobes
+ reg [7:0] abc_out_n;
+ reg [7:0] abc_in_n;
+
// ------------------------------------------------------------------------
// Keyboard controller
// ------------------------------------------------------------------------
@@ -542,6 +546,11 @@ module abc80 (
mmu_map_sel <= cpu_do[5:0];
endcase // case( cpu_a[2:0] )
end // if ( mmu_sel & ~cpu_wr_n )
+ else if ( ~abc_out_n[7] )
+ begin
+ // For compatibility with Mikrodatorn's 64K hack
+ mmu_map_sel <= { cpu_do[1:0], cpu_do[1:0], cpu_do[1:0] };
+ end
else if ( mmu_sel & ~cpu_rd_n )
begin
case ( cpu_a[2:0] )
@@ -631,9 +640,7 @@ module abc80 (
// ------------------------------------------------------------------------
// ABC-bus
// ------------------------------------------------------------------------
-
- reg [7:0] abc_out_n;
- reg [7:0] abc_in_n;
+
wire abc_sel;
always @(*)
@@ -671,7 +678,7 @@ module abc80 (
wire [7:0] abc_cf_di;
wire cf_select;
wire [8:0] cf_debug;
-
+
cfcontroller cfcontroller (
.reset_n ( reset_n ),
.clk ( cpu_clk ),
@@ -700,7 +707,12 @@ module abc80 (
.debug ( cf_debug )
);
- assign led[0] = cf_select; // Closest thing we get to a disk LED
+ // The terminology gets a bit funny there. abc_do means data from
+ // the ABC-bus to the main CPU.
+ wire [7:0] abc_do = abc_cf_di;
+
+ // Closest thing we get to a disk LED
+ assign led[0] = cf_select;
// Video width control INP 4 = 80, INP 3 = 40
always @(negedge reset_n or posedge cpu_clk)
@@ -713,23 +725,33 @@ module abc80 (
else if ( ~abc_in_n[4] )
video_width <= 1;
end
-
- // The terminology gets a bit funny there. abc_do means data from
- // the ABC-bus to the main CPU.
- wire [7:0] abc_do = abc_cf_di;
- // Debugging...
- hexled hexled0 (
- .value( cf_debug[3:0] ),
+ // Sound generator (not actually implemented, but flash the 7seg LEDs
+ reg [7:0] sound;
+ always @(negedge reset_n or posedge cpu_clk)
+ begin
+ if ( ~reset_n )
+ sound <= 0;
+ else
+ if ( ~abc_out_n[6] )
+ sound <= cpu_do;
+ end
+
+ hexledx hexled0 (
+ .value( sound[3:0] ),
+ .blank( ~sound[0] ),
+ .minus( 0 ),
.s7 ( s7_0[6:0] )
);
- hexled hexled1 (
- .value( cf_debug[7:4] ),
+ hexledx hexled1 (
+ .value( sound[7:4] ),
+ .blank( ~sound[0] ),
+ .minus( 0 ),
.s7 ( s7_1[6:0] )
);
assign s7_0[7] = 1'b1;
- assign s7_1[7] = ~cf_debug[8];
+ assign s7_1[7] = 1'b1;
// ------------------------------------------------------------------------
// I/O address decoding