2017-11-08 13:18:34 -05:00
|
|
|
;-------------------------------
|
|
|
|
; Progress bar functions
|
|
|
|
;
|
2021-04-18 00:49:26 -04:00
|
|
|
; ShowInitialProgressScreen - called once when a verify or crack process starts
|
|
|
|
; ResetProgress - called once when a verify or crack process starts
|
2017-11-08 13:18:34 -05:00
|
|
|
; 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)
|
|
|
|
;-------------------------------
|
2021-04-18 00:49:26 -04:00
|
|
|
ShowInitialProgressScreen
|
|
|
|
jsr ClearScreen
|
|
|
|
jsr PrintByID
|
2021-06-12 22:07:26 -04:00
|
|
|
!byte s_header
|
2021-04-18 00:49:26 -04:00
|
|
|
jsr PrintByID
|
2021-06-12 22:07:26 -04:00
|
|
|
!byte s_progbar
|
2021-04-18 00:49:26 -04:00
|
|
|
lda VPOS
|
|
|
|
sta TEXTTOP
|
|
|
|
bne ResetProgress ; always branches
|
|
|
|
|
2017-11-08 13:18:34 -05:00
|
|
|
RestartProgress
|
|
|
|
lda VPOS
|
|
|
|
pha
|
|
|
|
lda #1
|
|
|
|
sta VPOS
|
|
|
|
jsr PrintByID
|
2021-06-12 22:07:26 -04:00
|
|
|
!byte s_progbar
|
2017-11-08 13:18:34 -05:00
|
|
|
pla
|
|
|
|
sta VPOS
|
|
|
|
jsr $FC22
|
2021-04-18 00:12:05 -04:00
|
|
|
; /!\ execution falls through here
|
2017-11-08 13:18:34 -05:00
|
|
|
|
|
|
|
ResetProgress
|
2021-04-18 00:49:26 -04:00
|
|
|
lda #$82 ; reset progress indicator
|
2017-11-08 13:18:34 -05:00
|
|
|
sta progressind+1
|
|
|
|
lda #$05
|
|
|
|
sta progressind+2
|
2021-07-03 19:13:55 -04:00
|
|
|
lda gMode
|
|
|
|
ror
|
|
|
|
bcc +
|
|
|
|
jmp thinking
|
2017-11-08 13:18:34 -05:00
|
|
|
|
|
|
|
IncProgress
|
2021-07-03 19:13:55 -04:00
|
|
|
lda gMode
|
|
|
|
ror
|
|
|
|
bcs ++
|
2021-04-18 00:49:26 -04:00
|
|
|
lda #$20 ; display minimal progress indicator
|
2017-11-08 13:18:34 -05:00
|
|
|
progressind
|
2021-04-18 00:49:26 -04:00
|
|
|
sta $FFFF ; SMC
|
2017-11-08 13:18:34 -05:00
|
|
|
inc progressind+1
|
2021-07-03 19:13:55 -04:00
|
|
|
+ rts
|
|
|
|
++ jmp print_thinking_frame
|