1
0
mirror of https://github.com/mist-devel/mist-board.git synced 2026-01-27 20:27:12 +00:00

[BBC] Autoboot option

This commit is contained in:
Till Harbaum
2015-10-09 09:53:27 +02:00
parent ed63266bbd
commit b739fae4ec
3 changed files with 30 additions and 4 deletions

View File

@@ -50,10 +50,11 @@ parameter CONF_STR = {
"BBC;ROM;",
"O1,Scanlines,Off,On;",
"O2,ROM mapping,High,Low;",
"T3,Reset;"
"O3,Auto boot,Off,On;",
"T4,Reset;"
};
parameter CONF_STR_LEN = 8+20+24+9;
parameter CONF_STR_LEN = 8+20+24+20+9;
// generated clocks
wire clk_32m /* synthesis keep */ ;
@@ -270,14 +271,25 @@ wire rom_remap_reset = (rom_map_counter != 0);
// the bbc is being reset of the pll isn't stable, if the ram isn't ready,
// of the arm boots or if the user selects reset from the osd or of the user
// presses the "core" button or the io controller uploads a rom
wire reset_in = ~pll_ready || ~sdram_ready || status[0] || status[3] ||
wire reset_in = ~pll_ready || ~sdram_ready || status[0] || status[4] ||
buttons[1] || loader_active || rom_remap_reset;
// synchronize reset with memory state machine
reg reset;
always @(posedge mem_sync)
reset <= reset_in;
// the autoboot feature simply works by pressing shift for 2 seconds after
// the bbc has been reset
wire autoboot_shift = status[3] && (autoboot_counter != 0 );
reg [24:0] autoboot_counter;
always @(posedge clk_32m) begin
if(reset)
autoboot_counter <= 25'd32000000;
else if(autoboot_counter != 0)
autoboot_counter <= autoboot_counter - 25'd1;
end
bbc BBC(
.CLK32M_I ( clk_32m ),
@@ -303,6 +315,8 @@ bbc BBC(
.VID_ADR ( vid_adr ),
.VID_DI ( vid_data ),
.SHIFT ( autoboot_shift ),
.user_via_pb_out ( user_via_pb_out ),
.user_via_cb1_in ( user_via_cb1_in ),
.user_via_cb2_in ( user_via_cb2_in ),

View File

@@ -36,6 +36,9 @@ module bbc(
output [15:0] AUDIO_L,
output [15:0] AUDIO_R,
// externally pressed "shift" key for autoboot
input SHIFT,
// expose pins required for mmc
output [7:0] user_via_pb_out,
input user_via_cb1_in,
@@ -372,6 +375,7 @@ keyboard KEYB (
.ROW ( keyb_row ),
.KEYPRESS ( keyb_out ),
.INT ( keyb_int ),
.SHIFT ( SHIFT ),
.BREAK_OUT ( keyb_break ),
.DIP_SWITCH ( DIP_SWITCH )
);

View File

@@ -50,6 +50,8 @@ module keyboard (
input [2:0] ROW,
output KEYPRESS,
output INT,
// external SHIFT key
input SHIFT,
// BREAK key output - 1 when pressed
output reg BREAK_OUT,
// DIP switch inputs
@@ -67,6 +69,7 @@ reg [7:0] keys [0:15];
reg [3:0] col;
reg _release_;
reg extended;
reg ext_shift;
// Shortcut to current key column
@@ -144,6 +147,11 @@ always @(posedge CLOCK) begin
end else begin
// map external shift key onto left shift
ext_shift <= SHIFT;
if(SHIFT || ext_shift)
keys[0][0] <= SHIFT;
// Copy DIP switches through to row 0
keys[2][0] <= DIP_SWITCH[7];
keys[3][0] <= DIP_SWITCH[6];