diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 88fac68..5d187ad 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -78,6 +78,7 @@ file, then select the appropriate command from the Apple menu. * Correct rendering issues with desktop volume icons. (#117) * Prevent occasional rectangle drawn on desktop after window close. (#120) * Empty directories can be copied/moved. (#121) +* Ctrl+Reset quits cleanly back to ProDOS (except buggy emulators). (#141) * Desk Accessories: * Date: Read-only on systems with a clock. On systems without a clock, date is saved for next session. (#30, #39) * Calculator: don't mis-paint when moved offscreen and other fixes. (#33, #34) diff --git a/desktop/desktop_main.s b/desktop/desktop_main.s index 88288e7..63e80ef 100644 --- a/desktop/desktop_main.s +++ b/desktop/desktop_main.s @@ -2139,6 +2139,12 @@ eject_flag: str_quit_code: PASCAL_STRING "Quit.tmp" +reset_handler: + ;; Restore DeskTop Main expected state... + sta ALTZPON + lda LCBANK1 + lda LCBANK1 + start: MLI_RELAY_CALL OPEN, open_params bne fail @@ -2158,6 +2164,7 @@ fail: jsr ShowAlert .endproc cmd_quit := cmd_quit_impl::start + reset_handler := cmd_quit_impl::reset_handler ;;; ============================================================ ;;; Exit DHR, restore device list, reformat /RAM. @@ -15422,6 +15429,19 @@ str_preview_txt: start: +;;; ============================================================ +;;; Set the reset vector to cold start +.scope hook_reset_vector + + ;; Main hook + lda #desktop_main::reset_handler + sta RESETVEC+1 + eor #$A5 + sta RESETVEC+2 + +.endscope ;;; ============================================================ ;;; Detect Machine Type diff --git a/inc/apple2.inc b/inc/apple2.inc index e52e439..a38d394 100644 --- a/inc/apple2.inc +++ b/inc/apple2.inc @@ -45,6 +45,7 @@ HR3_OFF := $C0B6 ;;; Monitor INIT := $FB2F +SETPWRC := $FB6F VERSION := $FBB3 BELL1 := $FBDD VTAB := $FC22 @@ -52,6 +53,7 @@ VTABZ := $FC24 HOME := $FC58 PRBYTE := $FDDA COUT := $FDED +MOVE := $FE2C SETKBD := $FE89 SETVID := $FE93 MONZ := $FF69 @@ -181,6 +183,7 @@ DESTINATIONHI := $43 ;;; Other Locations XFERSTARTLO := $03ED XFERSTARTHI := $03EE +RESETVEC := $03F2 ;;; ============================================================