📄 pager 原代碼.txt
字号:
mbbs auto_en,entry_auto2
lda #.HIGH.auto_off_scr
entry_auto2:
sta string_headh
jsr disp_str
smb7 dsp_buf8
smb7 dsp_buf9
stz shift
jsr lcd_dr
jmp main
;;********entry adj auto on/off *****
auto_onff_chk:
lda shift
beq chk_auto_flag
bra shift_auto
chk_auto_flag:
mbbs auto_en,show_auto_on
jmp esc_func
show_auto_on:
smb7 shift
lda #auto_on_h
sta mp1
stz mp2
show_auto:
jsr show_adj_auto
bra shift_auto1
shift_auto:
jsr clr_flash_bit
inc shift
lda shift
and #7fh
cmp #04
bne shift_auto1
stz shift
smb7 shift ;in order into adj auto on/off time
jsr change_auto
shift_auto1:
lda shift
and #7fh
cmp #3
beq ck_auto_24h
shift_auto3:
tax
lda auto_flh_tab,x
sta tempa
and #7fh
tax
auto_next:
lda lcd_left,x
ora #10000000b
sta lcd_left,x
bbr7 tempa,shift_auto2
rmb7 tempa
inx
bra auto_next
shift_auto2:
smb0 flash_c
jsr lcd_dr
jmp main
auto_flh_tab:
db 85h,08h,09h,0ah
ck_auto_24h:
mbbr f_24hr,shift_auto3 ;; check 12hr or 24hr
stz shift ;;if 24hr then clear shift
smb7 shift
jsr change_auto
bra shift_auto1
;;;***********************************
;; change auto on/off
change_auto:
stz mp2
lda mp1
cmp #auto_on_h
beq change_show_off
lda #auto_on_h
change_auto1
sta mp1
jsr show_adj_auto
rts
change_show_off:
lda #auto_off_h
bra change_auto1
;;********* show adjust auto **********
show_adj_auto:
jsr clr_dspbuf
stz mp2
lda mp1
cmp #auto_on_h
bne fill_auto_off
lda #FONT_N
sta dsp_buf3
bra show_adj_auto1
fill_auto_off:
lda #FONT_F
sta dsp_buf3
sta dsp_buf4
show_adj_auto1:
lda #FONT_O
sta dsp_buf2
mbbr f_24hr,show_auto_12h
show_auto_hr
lda (mp1)
bin_bcd
show_auto_hr1
cpy #0
bne dsp_auto_hspace
ldy #space
dsp_auto_hspace:
sty dsp_buf5
sta dsp_buf6
lda #dot
sta dsp_buf7
inc mp1
lda (mp1) ;show alm min
bin_bcd
sty dsp_buf8
sta dsp_buf9
dec mp1
rts
show_auto_12h:
lda (mp1)
cmp #12
bcc show_auto_am
lda #FONT_P
sta dsp_buf10
lda (mp1)
cmp #13
bcs show_auto_pm12
bra show_auto_hr
show_auto_pm12:
sec
sbc #12
bin_bcd
bra show_auto_hr1
show_auto_am:
lda #FONT_A
sta dsp_buf10
lda (mp1)
cmp #0
bne show_auto_am1
lda #12
show_auto_am1:
bin_bcd
bra show_auto_hr1
;;********************************
;;entry adjust alarm function
;;********************************
entry_alarm:
mbbs adjust,shift_alarm
msmb adjust
flh_alm_off
alm_icon_on
jsr clr_dspbuf
lda #01
sta dsp_buf
lda #alm_h1
sta mp1 ;;low byte
stz mp2 ;;high byte
stz shift
entry_alarm1:
jsr show_adj_alm
bra shift_alarm1
shift_alarm:
jsr clr_flash_bit
inc shift
lda shift
cmp #6
bne shift_alarm1
stz shift
shift_alarm1:
lda shift
cmp #5
beq ck_alm_24h
shift_alarm3:
tax
lda alm_flh_tab,x
sta tempa
and #01111111b ;mask next flash bit
tax
; asl A ;shift bit7 to carry
alarm_next:
lda lcd_left,x
ora #10000000b
sta lcd_left,x
bbr7 tempa,shift_alarm2 ;check continus next flash
rmb7 tempa
inx
bra alarm_next
shift_alarm2:
smb0 flash_c
jsr lcd_dr
jmp main
alm_flh_tab: ;;low nibble is lcd buffer pos
db 00h,82h,85h,08h,09h,0ah
ck_alm_24h:
mbbr f_24hr,shift_alarm3
lda #0
stz shift
bra shift_alarm3
;;********************************
;;show adjust alarm
;;*********************************
show_adj_alm:
lda (mp1)
sta tempa
lda #dash
bbr7 tempa,$+5
lda #FONT_O
sta dsp_buf2
lda #dash
bbr7 tempa,$+5
lda #FONT_N
sta dsp_buf3
lda #7fh ;mask on/off bit
and tempa
sta tempa
mbbr f_24hr,show_alm_12h
show_alm_hr
bin_bcd tempa
show_alm_hr1
cpy #0
bne dsp_alm_hspace
ldy #space
dsp_alm_hspace:
sty dsp_buf5
sta dsp_buf6
lda #dot
sta dsp_buf7
inc mp1
lda (mp1) ;show alm min
bin_bcd
sty dsp_buf8
sta dsp_buf9
dec mp1
rts
show_alm_12h:
lda tempa
cmp #12
bcc show_alm_am
lda #FONT_P
sta dsp_buf10
lda tempa
cmp #13
bcs show_alm_pm12
bra show_alm_hr
show_alm_pm12:
sec
sbc #12
bin_bcd
bra show_alm_hr1
show_alm_am:
lda #FONT_A
sta dsp_buf10
lda tempa
cmp #00
bne show_alm_am1
lda #12
show_alm_am1:
bin_bcd
bra show_alm_hr1
;;********************************
;;entry adjust tone function
;;********************************
entry_tone:
mbbs adjust,entry_tone1
msmb adjust
jsr clr_icon_buf
tone_icon_on
entry_tone2:
jsr play_music
jmp show_tone_scr
entry_tone1:
jmp esc_func
entry_time:
mbbs adjust,shift_time
msmb adjust
stz shift
entry_time1:
jsr show_watch_c
rmb7 dsp_buf+2 ;don't flash dot of time
lda #01
mbbr f_24hr,$+5
lda #02
sta dsp_buf8
lda #02
mbbr f_24hr,$+5
lda #04
sta dsp_buf9
lda #FONT_H
sta dsp_buf10
lda #FONT_R
sta dsp_buf11
jsr clr_icon_buf
time_icon_on
bra shift_time1
;;**********************************
;;shift adj time postion
;;***********************************
shift_time:
jsr clr_flash_bit
inc shift
lda shift
cmp #5
bne shift_time1
stz shift
shift_time1:
lda shift
cmp #03
beq ck_f_24h
shift_time3:
tax
lda time_flh_tab,x
sta tempa
and #01111111b ;mask next flash bit
tax
asl A ;shift bit7 to carry
time_next:
lda lcd_left,x
ora #10000000b
sta lcd_left,x
bbr7 tempa,shift_time2 ;check continus next flash
rmb7 tempa
inx
bra time_next
shift_time2:
smb0 flash_c
jsr lcd_dr
jmp main
time_flh_tab: ;;low nibble is lcd buffer pos
db 80h,03,04h,05h,88h
ck_f_24h:
mbbr f_24hr,shift_time3
inc A
inc shift
bra shift_time3
;;**********************************
;;entry date function
;;**********************************
entry_date:
mbbs adjust,shift_date
msmb adjust ;set to adjust mode
stz shift
jsr show_adj_date
bra shift_date1
shift_date:
jsr clr_flash_bit
inc shift
shift_date1:
lda shift
cmp #3
bne shift_date3
stz shift
lda #0
shift_date3:
tax
lda date_flh_tab,x
sta tempa
and #01111111b ;mask next flash bit
tax
asl A ;shift bit7 to carry
date_next:
lda lcd_left,x
ora #10000000b
sta lcd_left,x
bbr7 tempa,shift_time2 ;check continus next flash
rmb7 tempa
inx
bra date_next
shift_date2:
smb0 flash_c
jsr lcd_dr
jmp main
date_flh_tab: ;;low nibble is lcd buffer pos
db 82h,85h,88h
;;************************************
;;DISPLAY A STRING
;;=====================================
;; X: STRING START
;; Y: START POSITION OF LCD
;;*************************************
disp_str:
ldy #0
disp_str1:
lda (string_headl)
cmp #0ffh
beq disp_str_end
sta lcd_left,y
inc_addr string_headh,string_headl
iny
bra disp_str1
disp_str_end:
rts
;;================================
;;adjust alert mode
;;================================
adj_alert:
mbbs tone_mode,alert_motor
mbbs motor_mode,alert_mute
mbbs mute_mode,alert_tone
alert_motor:
msmb motor_mode
mrmb mute_mode
mrmb tone_mode
jmp entry_alert1
alert_tone:
mrmb motor_mode
mrmb mute_mode
msmb tone_mode
jmp entry_alert1
alert_mute:
motor_off
disable int_tempo
mrmb motor_mode
msmb mute_mode
mrmb tone_mode
jmp entry_alert1
adj_off:
;;*******************************
;;adj auto function
;;*******************************
adj_auto:
stz mp2
lda shift
beq adj_auto_onff
adj_auto1:
asl A
tax
jmp (adj_auto_table,x)
adj_auto_table:
dw adj_auto_hr
dw adj_auto_min10
dw adj_auto_min1
dw adj_auto_ap
adj_auto_hr:
lda (mp1)
mbbr f_24hr,adj_auto_hr2
inc A
sta (mp1)
cmp #24d
beq adj_auto_hr1
jmp show_auto
adj_auto_hr1:
lda #0
sta (mp1)
jmp show_auto
;;check 12hr for hour
adj_auto_hr2:
inc A
cmp #12
beq adj_auto_hr1
cmp #24
beq adj_auto_hr3
sta (mp1)
jmp show_auto
adj_auto_hr3
lda #12d
sta (mp1)
jmp show_auto
adj_auto_min10:
inc mp1
lda (mp1)
sta tempa
jsr inc_min_10
sta (mp1)
dec mp1
jmp show_auto
adj_auto_min1:
inc mp1
lda (mp1)
jsr inc_min_one
sta (mp1)
dec mp1
jmp show_auto
adj_auto_ap:
lda (mp1)
cmp #12
bcc adj_auto_ap1
sec
sbc #12
sta (mp1)
jmp show_auto
;;less than 12
adj_auto_ap1:
clc
lda (mp1)
adc #12
sta (mp1)
jmp show_auto
adj_auto_onff:
mbbs auto_en,adj_auto_onff1
msmb auto_en
jmp entry_auto3
adj_auto_onff1:
mrmb auto_en
jmp entry_auto3
;;================================
;;adjust alarm mode
;;================================
adj_alarm:
lda shift
cmp #06
beq adj_alm_24hr
adj_alarm1:
asl A
tax
jmp (adj_alm_table,x)
adj_alm_table:
dw adj_alm_num
dw adj_onff
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -