📄 sched.asm
字号:
; ***************************************************************************
; * Project : Electronic Dictionary *
; * Date : 2003.9 *
; * File Name : Sched.Asm *
; ***************************************************************************
Tkeypress:
Lda <Keyno
Cmp #Leftkey
Beq Alarmleftfun
Lda #>Editkeypress-1
Pha
Lda #<Editkeypress-1
Pha
Lda #>Cardbank
Pha
Lda #<Cardbank
Jmp Longgo
Alarmleftfun:
Lda <Gamestate
Cmp #Editschn
Bne Alarmleftfun_0 ;;For Find State
Lda <Buffcurlocath
Cmp #>Inputbuff
Bne Alarmleftfun_0
;;Lda <Buffcurlocat
;;Cmp #46
;;Bne Alarmleftfun_0
;;Lda #3
;;Sta Schesetitem
Ldy <Schselectno
Lda Typeheadlentab,Y
Cmp <Buffcurlocat
Bne Alarmleftfun_0
Dec Schesetitem
Lexitscanf
Stz <Tempcount
Jsr Ljsr
Dw Remarkbank
Dw Shownamecard-1
Jmp Selectstate
Alarmleftfun_0:
Lda #>Editleftkey-1
Pha
Lda #<Editleftkey-1
Pha
Lda #>Remarkbank
Pha
Lda #<Remarkbank
Jmp Longgo
;;====================================================
;;[D]---------------------------------[D]
;;Schedule State Constant(Gamestate)
Schseccodeinn Equ 0 ;9
Insertaskschn Equ 1 ;10
Selectschtypen Equ 2 ;11
Editschn Equ 3 ;12
Saveornotschn Equ 4 ;13
Scanschmenun Equ 5 ;14
Deletschn_Yn Equ 6 ;15
Scanschcontenn Equ 7 ;16
Findschn Equ 8 ;17
;;-------------Statetable-------------
Schfuncttab:
;;Dw Initscnsche-1 ;;初始化进入提醒
Dw Schseccodein-1 ;;1.提醒密码输入状态
Dw Insertasksch-1 ;;2.询问添加提醒状态
Dw Selectschtype-1 ;;3.选择提醒类型状态
Dw Editsch-1 ;;4.编辑提醒状态
Dw Saveornotsch-1 ;;5.询问提醒保存状态
Dw Scanschmenu-1 ;;6.浏览提醒目录状态
Dw Deletschn_Y-1 ;;7.询问删除提醒状态
Dw Scanschconten-1 ;;8.浏览提醒内容状态
Dw Findsch-1 ;;9.查询提醒状态(任意字)
;-------------Helptable-----------------
Schhelptab:
Db Gamepwhelp-Helptable ;;1.提醒密码输入状态
Db Nullhelp-Helptable ;;2.询问添加提醒状态
Db 0 ;;3.选择提醒类型状态
Db Cardedithelp-Helptable ;;4.编辑提醒状态
Db Nullhelp-Helptable ;;5.询问提醒保存状态
Db 0 ;;6.浏览提醒目录状态
Db Nullhelp-Helptable ;;7.询问删除提醒状态
Db 0 ;;8.浏览提醒内容状态
Db Nullhelp-Helptable ;;9.查询提醒状态(任意字)
;-------------Help Return Table---------
Schhelprettab:
Dw Initscnsche-1 ;;1.提醒密码输入状态
Dw 0 ;;2.询问添加提醒状态(Null)
Dw Initinsertkeyp_0-1 ;;3.选择提醒类型状态
Dw Edithelpretentry-1 ;;4.编辑提醒状态
Dw 0 ;;5.询问提醒保存状态(Null)
Dw Dspschmenuentry-1 ;;6.浏览提醒目录状态
Dw 0 ;;7.询问删除提醒状态(Null)
Dw Scanschmenuenterp-1 ;;8.浏览提醒内容状态
Dw 0 ;;9.查询提醒状态(任意字)(Null)
;----------Set Schedule Help Program-------
Schhelpprc:
Ldy <Gamestate
Lda Schhelptab,Y
Sta <Helpoffset
;---------------------
Cpy #3
Beq ?Edithelpbug
Cpy #2
Beq ?Selectrelathelpbug
Cpy #5
Beq ?Scanmenuhelpbug
Cpy #7
Bne ?Unhelpbug
Lda #>Scanconthelp
Sta Helptextph
Lda #<Scanconthelp
Bra ?Com000
?Selectrelathelpbug:
Lda #>Selectrelathelp
Sta Helptextph
Lda #<Selectrelathelp
Bra ?Com000
?Edithelpbug:
Lda #>Schededithelp
Sta Helptextph
Lda #<Schededithelp
Bra ?Com000
?Scanmenuhelpbug:
Lda #>Scanmenuhelp
Sta Helptextph
Lda #<Scanmenuhelp
?Com000:
Sta Helptextpl
Lda #Ds0Help
Sta <Helpoffset
?Unhelpbug:
;---------------------
Tya
Asl
Tay
Lda Schhelprettab+1,Y
Sta Helprtprc+1
Lda Schhelprettab,Y
Sta Helprtprc
Rts
;;[Tp]------------------------------[Tp]
;; 行程提醒 Keydown事件处理程序
;;[Tp]------------------------------[Tp]
Schallstatekeydown:
Lda <Gamestate
Asl
Tay
Lda Schfuncttab+1,Y
Pha
Lda Schfuncttab,Y
Pha
Rts
;;[St]------------------------------------[St]
;; 1.提醒密码输入状态
;;[St]------------------------------------[St]
Schseccodein:
Lda <Keyno ;; Load Key Number To A.
Cmp #80H
Bcs Exitupdate_0 ;; Skip If Noise Bounce.
Cmp #Esckey
Bne Schseccodein_1 ;; Skip If Not "Escape" Key.
Rettomenu:
Lda #Card_Bakmode ;; Back To Main Menu.
Sta <Modesave
Lda #Menumode
Sta <Mode ; Enter Menu Select Mode
Lda #80H
Sta <Eflag
Jmp Exitnoupdate
Schseccodein_1: Cmp #Enterkey
Beq Chkseccode ;; Skip If "Enter" Key.
Schseccodein_0: Lda <Keyno
Cmp #Leftkey
Beq Backward ;; Skip If "Left" Key.
Cmp #Delkey
Beq Backward ;; Skip If "Left" Key.
Ldx <Sccounter ;; Load Secret Code Counter To X.
Cpx #8
Bcs Exitupdate_0
Lda <Keyno ;; Load Key Number To A.
Sta <Secretcode0,X ;; Save Key Number As Secret Code.
Lda #'*'
Sta Textbuffor+46,X ;; Display "*" On Textbuffor.
Inc <Sccounter
Exitupdate_0: Jmp Exitwithupdate
;;--<< Check Secret Code >>--
Chkseccode:
Ldx #7
Chkseccode00:
Lda Inputmemacard,X
Cmp <Secretcode0,X
Bne Chkseccode0
Dex
Bpl Chkseccode00
Jmp Initscnsche1 ;;Seccode Pass
Chkseccode0:
Ldx #7
Chkseccode1: Lda Datasecretcode,X
Cmp <Secretcode0,X
Bne Errorcode ;; Skip If Datasecretcode <> Secretcode.
Dex
Bpl Chkseccode1
Jmp Initscnsche1 ;;Seccode Pass
Errorcode:
Lcls
Lsetcur 0,2
Lprint Schintmsg3 ;; Print "密码输入错误" On Screen.
jsr CALL_LUpdateScreen
Jsr Ljsr ;;Delay
Dw Cardbank
Dw Delaytimer-1
Jmp Initscnsche
;;--<< Backward To Delete 1 Secret Code >>--
Backward:
Lda <Sccounter
Beq Backward1 ;; Skip If No Secret Code.
Ldx <Sccounter ;; Load Secret Code Counter To X.
Dex
Lda #'_' ;; Blank Screen.
Sta Textbuffor+46,X
Lda #0Ffh ;; Blank Register.
Sta <Secretcode0,X
Stx <Sccounter ;; Secret Code Counter -= 1.
Backward1: Jmp Exitwithupdate
;;[St]---------------------------------[St]
;; 2.询问添加提醒状态
;;[St]---------------------------------[St]
Insertasksch:
Lda <Keyno
Cmp #Esckey
Bne Initinsertkeyp
Jmp Rettomenu ;; Back To Main Menu.
Initinsertkeyp:
Stz <Schselectno
;;Stz <Schselectnobak
Jsr Copyinitschtoinput
Initinsertkeyp_0:
Lda <Schselectno
Sta <Schselectnobak
Lda #Selectschtypen
Sta <Gamestate
Jsr Schhelpprc
Jsr Initschselectmenu
Exitnoupdate: Lmainu
;;[St]---------------------------------[St]
;; 3.选择提醒类型状态
;;[St]---------------------------------[St]
Selectschtype:
Ldy #0
Selectstate_0:
Lda Schselectstatekeytab,Y
Bmi Noselectrightkey
Cmp <Keyno
Beq Findselectstatetkey
Iny
Bra Selectstate_0
Findselectstatetkey:
Tya
Asl
Tay
Lda Schselectstatekeyptab+1,Y
Pha
Lda Schselectstatekeyptab,Y
Pha
Rts
Schselectstatekeytab:
Db Upkey,Downkey,Leftkey,Rightkey,Enterkey,Esckey,Nullkey
Schselectstatekeyptab:
Dw Schselectupp-1,Schselectdownp-1,Schselectleftp-1
Dw Schselectrightp-1,Schselectenterp-1,Schselectescp-1
Noselectrightkey:
Jmp Exitnoupdate
;;-----Up------
Schselectupp:
Ldy <Schselectno
Beq Schselectupp_E ;;Noselectrightkey
Cpy #1
Beq Schselectupp_B
Cpy #2
Beq Schselectupp_D
Cpy #3
Beq Schselectupp_A
Schselectupp_C:
Lda #2
Bra Schselectupp_End
Schselectupp_A:
Lda #1
Bra Schselectupp_End
Schselectupp_B:
Lda #4
Bra Schselectupp_End
Schselectupp_D:
Lda #0
Bra Schselectupp_End
Schselectupp_E:
Lda #3
Schselectupp_End:
Sta <Schselectno
Todrawgraph: Jsr Clsschyuanxin
Jsr Drawyuanxin
Bra Noselectrightkey
;;------Down------
Schselectdownp:
Ldy <Schselectno
Cpy #3
Beq Schselectdownp_E ;;Noselectrightkey
Cpy #0
Beq Schselectdownp_A
Cpy #1
Beq Schselectdownp_D
Cpy #2
Beq Schselectdownp_B
Schselectdownp_C:
Lda #1
Bra Schselectupp_End
Schselectdownp_A:
Lda #2
Bra Schselectupp_End
Schselectdownp_B:
Lda #4
Bra Schselectupp_End
Schselectdownp_D:
Lda #3
Bra Schselectupp_End
Schselectdownp_E:
Lda #0
Bra Schselectupp_End
;;-----Left------
Schselectleftp:
Ldy <Schselectno
Beq Schselectleftp1 ;;Noselectrightkey
Dec <Schselectno
Bra Todrawgraph
Schselectleftp1:
Lda #4
Sta <Schselectno
Bra Todrawgraph
;;------Right------
Schselectrightp:
Ldy <Schselectno
Cpy #4
Beq Schselectrightp1 ;Noselectrightkey
Inc <Schselectno
Bra Todrawgraph
Schselectrightp1:
Lda #0
Sta <Schselectno
Bra Todrawgraph
;;------Enter----
Schselectenterp:
Jsr Dealwithinputbuff
Jsr Settimevalue
Lda <Schselectno
Sta <Schselectnobak
Edithelpretentry:
Lda #Editschn
Sta <Gamestate
Jsr Schhelpprc
Lsetscreen 14
Lprint Inputbuff
Stz Schesetitem ;;Initial Schedule Set Item=Year.
Jmp Selectstate
;;------Esc------
Schselectescp:
Jmp Initscnsche1
;;[St]---------------------------------[St]
;; 4.编辑提醒状态
;;[St]---------------------------------[St]
Editsch:
Ldx #0
Editschkeydown: Lda Editschkeydowntab,X
Bmi Editschkeydownend
Cmp <Keyno
Beq Editschrightkey
Inx
Bra Editschkeydown
Editschrightkey:
Txa
Asl
Tax
Lda Editschkeydownptab+1,X
Pha
Lda Editschkeydownptab,X
Pha
Rts
Editschkeydowntab:
Db Upkey,Downkey,Leftkey,Rightkey,Enterkey,Esckey,Nullkey
Editschkeydownptab:
;;Dw Scheeditupkeyp-1 ;; Up Key Process Routine.
;;Dw Scheeditdownp-1 ;; Down Key Process Routine.
Dw Changetimeent-1 ;; "Up" Key Process Routine.
Dw Changetimeent-1 ;; "Down" Key Process Routine.
Dw Scheeditleftp-1 ;; "Left" Key Process Routine.
Dw Scheeditright-1 ;; "Right" Key Process Routine.
Dw Scheeditenterp-1 ;; "Enter" Key Process Routine.
Dw Scheeditescp-1 ;; "Escape" Key Process Routine.
;;-----------------------------------
Editschkeydownend:
Jmp Exitnoupdate
;;-------Up------
;;Scheeditupkeyp: Jmp Changetimeent ;;Schetimeinc
;;------Down-----
;;Scheeditdownp: Jmp Changetimeent ;;Schetimedec
;;-----Left------
Scheeditleftp: Jmp Schesetleftitem
;;-----Right-----
Scheeditright: Jmp Schesetrightitem
;;-----Enter-----
Scheeditenterp: Jmp Scheenter
;;------Esc------
Scheeditescp:
Lexitscanf
Lcursoroff
;;Jmp Initinsertkeyp
Jmp Initinsertkeyp_0
;;[St]---------------------------------[St]
;; 5.询问提醒保存状态
;;[St]---------------------------------[St]
Saveornotsch:
;;[St]---------------------------------[St]
;; 6.浏览提醒目录状态
;;[St]---------------------------------[St]
Scanschmenu:
; Shoud Be Modify Here!!!!!!!!!
Ldy #0Ffh
Scanschmenu_0: Iny
Lda Scanschmenukeytab,Y
Bmi Scanschmenu_1
Cmp <Keyno
Bne Scanschmenu_0
Tya
Asl
Tay
Lda Scanschmenukeyptab+1,Y
Pha
Lda Scanschmenukeyptab,Y
Pha
Rts
Scanschmenukeytab:
Db Upkey,Downkey,Pgup,Pgdown,Enterkey
Db Esckey,Delkey,Insertkey,Findkey,Nullkey
Scanschmenukeyptab:
Dw Scanschmenuupp-1,Scanschmenudownp-1
Dw Scanschmenupgupp-1,Scanschmenupgdownp-1
Dw Scanschmenuenterp-1
Dw Scanschmenuescp-1,Scanschmenudeletp-1,Scanschmenuinsertp-1
Dw Scanschmenufindp-1
Scanschmenu_1:
Jmp Exitnoupdate
;;---Menuup---
Scanschmenuupp:
Lda #>Viewnameup-1
Pha
Lda #<Viewnameup-1
Pha
Lda #>Remarkbank
Pha
Lda #<Remarkbank
Jmp Longgo
;;--Menudown--
Scanschmenudownp:
Lda #>Viewnamedown-1
Pha
Lda #<Viewnamedown-1
Pha
Lda #>Remarkbank
Pha
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -