Skip to content

Commit

Permalink
Add hotkeys
Browse files Browse the repository at this point in the history
F9 - Tape start/stop
F10 - Reset
RShift+F10 - Reset with cart unload
F11 - Restore
  • Loading branch information
gyurco committed May 26, 2019
1 parent 42f1f64 commit 1cd1bd1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,12 @@ so you have to figure out what a particular game requires.
The built-in ROMs can be overridden via placing a vic20.rom file to the root of the SD Card.
The file format is: 1541 (16k) + Kernal PAL (8k) + Kernal NTSC (8k) + Basic (8k) + Char (4k).

## Hotkeys:

- F9 - Tape start/stop
- F10 - Reset
- RShift + F10 - Reset with cart unload
- F11 - Restore

### Download pre-built binaries:
Go to [releases](https://github.com/gyurco/VIC20_MiST/releases).
4 changes: 0 additions & 4 deletions keyboard.v
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ module keyboard
output [7:0] row_out,
input [7:0] row_in,
output [7:0] col_out,
output reg restore_key,

output reg [11:1] Fn = 0,
output reg [2:0] mod = 0
Expand Down Expand Up @@ -80,9 +79,7 @@ assign col_out = ({8{row_in[0]}} & {~keys[7][0], ~keys[6][0], ~keys[5][0], ~keys
({8{row_in[6]}} & {~keys[7][6], ~keys[6][6], ~keys[5][6], ~keys[4][6], ~keys[3][6], ~keys[2][6], ~keys[1][6], ~keys[0][6]}) |
({8{row_in[7]}} & {~keys[7][7], ~keys[6][7], ~keys[5][7], ~keys[4][7], ~keys[3][7], ~keys[2][7], ~keys[1][7], ~keys[0][7]});

wire shift = mod[0];
always @(posedge clk_sys) begin
reg auto_en;
reg old_reset = 0, old_sw;

old_sw <= mod[2] & mod[0];
Expand Down Expand Up @@ -128,7 +125,6 @@ always @(posedge clk_sys) begin
endcase

case(kcode)
8'h7d : restore_key <= release_btn; //RESTORE (PG_UP)

8'h16 : keys[0][0] <= release_btn; // 1
8'h26 : keys[0][1] <= release_btn; // 3
Expand Down
14 changes: 8 additions & 6 deletions vic20.sv
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,9 @@ always @(posedge clk_sys) begin
clk_ref <= !sys_count;
sys_count <= sys_count + 1'd1;

reset <= st_reset | st_cart_unload | buttons[1] | force_reset | ~pll_locked;
reset <= st_reset | st_cart_unload | buttons[1] | force_reset | fn_keys[10] | ~pll_locked;
cart_unload <= 0;
if (st_cart_unload | buttons[1]) cart_unload <= 1;
if (st_cart_unload | buttons[1] | (fn_keys[10] & mod_keys[0])) cart_unload <= 1;
c1541_reset <= reset;
end

Expand Down Expand Up @@ -322,7 +322,8 @@ wire [7:0] col_in;
wire [7:0] row_out;
wire [7:0] row_in;
wire [7:0] col_out;
wire restore_key;
wire [11:1] fn_keys;
wire [2:0] mod_keys;

keyboard keyboard
(
Expand All @@ -334,7 +335,8 @@ keyboard keyboard
.row_out(row_out),
.row_in(row_in),
.col_out(col_out),
.restore_key(restore_key)
.Fn(fn_keys),
.mod(mod_keys)
);

wire [7:0] vic20_joy = joystick_0 | joystick_1;
Expand Down Expand Up @@ -365,7 +367,7 @@ vic20 VIC20
.I_COL_OUT(col_out),
.O_COL_IN(col_in),
.I_ROW_OUT(row_out),
.I_RESTORE_OUT(restore_key),
.I_RESTORE_OUT(fn_keys[11]),

.I_CART_EN(|st_8k_rom), // at $A000(8k)
.I_CART_RO(st_8k_rom != 2'd2),
Expand Down Expand Up @@ -584,7 +586,7 @@ c1530 c1530
.cass_write(cass_write),
.cass_motor(cass_motor),
.cass_sense(cass_sense),
.osd_play_stop_toggle(st_tap_play_btn),
.osd_play_stop_toggle(st_tap_play_btn | fn_keys[9]),
.ear_input(uart_rxD2)
);
////////////////// AUDIO //////////////////
Expand Down

0 comments on commit 1cd1bd1

Please sign in to comment.