restart then increment progress bar while writing out final copy from RAM disk

This commit is contained in:
4am 2017-11-08 13:18:34 -05:00
parent b311927145
commit 12530f8f6f
5 changed files with 44 additions and 28 deletions

View File

@ -689,11 +689,10 @@ WriteRAMToDisk
jsr SetMark
jsr SwapProDOS
;prevent track write from calling RAM again
jsr RestartProgress ; restart progress bar
lda #FALSE
sta gUsingRAMDisk
sta gUsingRAMDisk ; prevent track write from calling RAM again
- lda #0
sta mliparam+2
sta mliparam+4
@ -704,12 +703,14 @@ WriteRAMToDisk
lda gRAMDiskRef
jsr ReadFile
jsr SwapProDOS
jsr IncProgress
jsr WriteTrackMLI
inc gTrack
lda gTrack
cmp #$23
bne -
jsr IncProgress
lda #TRUE
sta gUsingRAMDisk

View File

@ -596,19 +596,7 @@ FatalNoSlot6
jsr WaitForKey
jmp CleanExit
ResetProgress
lda #$82 ; reset progress indicator
sta progressind+1
lda #$05
sta progressind+2
rts
IncProgress
lda #$20 ; display minimal progress indicator
progressind
sta $FFFF ; set at runtime
inc progressind+1
rts
!source "progress.a"
;-------------------------------
; WriteTrack

View File

@ -462,16 +462,7 @@
lda #s_restart
jsr PrintByID
inc .foundsierra
lda VPOS
pha
lda #1
sta VPOS
lda #s_progbar
jsr PrintByID
pla
sta VPOS
jsr $FC22
jsr ResetProgress
jsr RestartProgress
jsr IncProgress
ldx #$FF
txs

36
src/progress.a Normal file
View File

@ -0,0 +1,36 @@
;-------------------------------
; Progress bar functions
;
; ResetProgress - called once when verify/demuffin/crack process starts
; IncProgress - called repeatedly during process (visibly increments progress bar)
; RestartProgress - called from certain patchers (Sierra) or when writing from RAM disk
; (visibly clears progress bar and exits via ResetProgress)
;-------------------------------
!zone {
RestartProgress
lda VPOS
pha
lda #1
sta VPOS
lda #s_progbar
jsr PrintByID
pla
sta VPOS
jsr $FC22
; note: execution falls through here
ResetProgress
lda #$82 ; reset progress indicator
sta progressind+1
lda #$05
sta progressind+2
rts
IncProgress
lda #$20 ; display minimal progress indicator
progressind
sta $FFFF ; set at runtime
inc progressind+1
rts
}

View File

@ -234,7 +234,7 @@ StringTable
; can be set directly before calling PrintByID.
;
.header
!text "Passport by 4am 2017-11-07",$00
!text "Passport by 4am 2017-11-08",$00
.mainmenu
!text "________________________________________",$8D,$8D,$8D,$8D,$8D,$8D,$8D
!text " "