Hook reset to cleanly quit DeskTop back to ProDOS. Resolves #141

* Fails on Virtual II and KEGS/GSPort/GSPlus, as they fail to
  disable aux memory on reset
* Will fail within Disk Copy overlay
This commit is contained in:
Joshua Bell 2019-03-27 19:26:46 -07:00
parent 6abca47257
commit 05b1c02fe9
3 changed files with 24 additions and 0 deletions

View File

@ -78,6 +78,7 @@ file, then select the appropriate command from the Apple menu.
* Correct rendering issues with desktop volume icons. (#117) * Correct rendering issues with desktop volume icons. (#117)
* Prevent occasional rectangle drawn on desktop after window close. (#120) * Prevent occasional rectangle drawn on desktop after window close. (#120)
* Empty directories can be copied/moved. (#121) * Empty directories can be copied/moved. (#121)
* Ctrl+Reset quits cleanly back to ProDOS (except buggy emulators). (#141)
* Desk Accessories: * Desk Accessories:
* Date: Read-only on systems with a clock. On systems without a clock, date is saved for next session. (#30, #39) * 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) * Calculator: don't mis-paint when moved offscreen and other fixes. (#33, #34)

View File

@ -2139,6 +2139,12 @@ eject_flag:
str_quit_code: PASCAL_STRING "Quit.tmp" str_quit_code: PASCAL_STRING "Quit.tmp"
reset_handler:
;; Restore DeskTop Main expected state...
sta ALTZPON
lda LCBANK1
lda LCBANK1
start: start:
MLI_RELAY_CALL OPEN, open_params MLI_RELAY_CALL OPEN, open_params
bne fail bne fail
@ -2158,6 +2164,7 @@ fail: jsr ShowAlert
.endproc .endproc
cmd_quit := cmd_quit_impl::start cmd_quit := cmd_quit_impl::start
reset_handler := cmd_quit_impl::reset_handler
;;; ============================================================ ;;; ============================================================
;;; Exit DHR, restore device list, reformat /RAM. ;;; Exit DHR, restore device list, reformat /RAM.
@ -15422,6 +15429,19 @@ str_preview_txt:
start: start:
;;; ============================================================
;;; Set the reset vector to cold start
.scope hook_reset_vector
;; Main hook
lda #<desktop_main::reset_handler
sta RESETVEC
lda #>desktop_main::reset_handler
sta RESETVEC+1
eor #$A5
sta RESETVEC+2
.endscope
;;; ============================================================ ;;; ============================================================
;;; Detect Machine Type ;;; Detect Machine Type

View File

@ -45,6 +45,7 @@ HR3_OFF := $C0B6
;;; Monitor ;;; Monitor
INIT := $FB2F INIT := $FB2F
SETPWRC := $FB6F
VERSION := $FBB3 VERSION := $FBB3
BELL1 := $FBDD BELL1 := $FBDD
VTAB := $FC22 VTAB := $FC22
@ -52,6 +53,7 @@ VTABZ := $FC24
HOME := $FC58 HOME := $FC58
PRBYTE := $FDDA PRBYTE := $FDDA
COUT := $FDED COUT := $FDED
MOVE := $FE2C
SETKBD := $FE89 SETKBD := $FE89
SETVID := $FE93 SETVID := $FE93
MONZ := $FF69 MONZ := $FF69
@ -181,6 +183,7 @@ DESTINATIONHI := $43
;;; Other Locations ;;; Other Locations
XFERSTARTLO := $03ED XFERSTARTLO := $03ED
XFERSTARTHI := $03EE XFERSTARTHI := $03EE
RESETVEC := $03F2
;;; ============================================================ ;;; ============================================================