Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add ctrl-N/cmd-N generates NMI/RESTORE key #152

Merged
merged 1 commit into from
Aug 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ Functions while running
* `Ctrl` + `M` will toggle mouse capture mode.
* `Ctrl` + `P` will write a screenshot in PNG format to disk.
* `Ctrl` + `R` will reset the computer.
* `Ctrl` + `N` will send an NMI to the computer (like RESTORE key).
* `Ctrl` + `S` will save a system dump configurable with `-dump`) to disk.
* `Ctrl` + `V` will paste the clipboard by injecting key presses.
* `Ctrl` + `=` and `Ctrl` + `+` will toggle warp mode.
Expand All @@ -190,6 +191,7 @@ Functions while running
* `⇧⌘M` will toggle mouse capture mode.
* `⌘P` will write a screenshot in PNG format to disk.
* `⌘R` will reset the computer.
* `⌘N` will send an NMI to the computer (like RESTORE key).
* `⌘S` will save a system dump (configurable with `-dump`) to disk.
* `⌘V` will paste the clipboard by injecting key presses.
* `⌘=` and `⇧⌘+` will toggle warp mode.
Expand Down
1 change: 1 addition & 0 deletions src/glue.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ extern bool enable_midline;

extern void machine_dump(const char* reason);
extern void machine_reset();
extern void machine_nmi();
extern void machine_paste(char *text);
extern void machine_toggle_warp();
extern void init_audio();
Expand Down
6 changes: 6 additions & 0 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,12 @@ machine_reset()
reset6502();
}

void
machine_nmi()
{
nmi6502();
}

void
machine_paste(char *s)
{
Expand Down
3 changes: 3 additions & 0 deletions src/video.c
Original file line number Diff line number Diff line change
Expand Up @@ -1360,6 +1360,9 @@ video_update()
} else if (event.key.keysym.sym == SDLK_r) {
machine_reset();
consumed = true;
} else if (event.key.keysym.sym == SDLK_n) {
machine_nmi();
consumed = true;
} else if (event.key.keysym.sym == SDLK_v) {
machine_paste(SDL_GetClipboardText());
consumed = true;
Expand Down