📄 main.asm
字号:
bne endsym ;; Fix input mode.
lda <ScanFF
bbr6 <ScanFF,e2d5
and #10001100b ;; Remain fix flag.
ora #10100000b
e2d3:
jsr MyScanFU ;; Set to 数字 input mode.
jmp call_input_lmain
e2d5: ora #01000000b ;; Set to 大写。
bra e2d3
;;[P]-----------------------------------------------[P]
;; '数字'->'符号'切换
;;[P]-----------------------------------------------[P]
;;Dg2Ch: lda <ScanFF
;; and #00001100b
;; bne endsym ;; Fix input mode.
;; lda <ScanFF
;; and #10001100b ;; Remain fix flag.
;; ora #10000000b
;; jsr MyScanFU ;; Set to chinese input mode.
;; jmp PrcOK
Dg2Ch:
lda <ScanFF
and #00001100b
bne endsym ;; Fix input mode.
lda <ScanFF
and #10001100b ;; Remain fix flag.
;;ora #10000000b
ora #10110000b ;;2-4-11 15:42
jsr MyScanFU ;; Set to chinese input mode.
jmp call_input_lmain
;;[P]-----------------------------------------------[P]
;; 中文输入法切换
;; 拼音 -> 五笔 -> 总笔划 -> 英文。
;;[P]-----------------------------------------------[P]
ExIme:
;; lda #0 ;;
;; sta Icon2 ;;2001-6-28 10:51
loff_lcd_icon lcd_icon2_0
loff_lcd_icon lcd_icon2_1
lda <IME
ina
exi5: sta <IME
cmp #MaxIME+1 ;;yiadd2-6-29 11:43
bcc exi8
stz <IME ;; Preset to "拼音输入法"。
lda <ScanFF
and #00001100b
beq Ch2En
exi8: lda <ScanFF
and #10001100b ;; Remain fix flag.
ora #10000000b
jsr MyScanFU ;; Set to chinese input mode.
jmp call_input_lmain
;;[P]-----------------------------------------------[P]
;; 中->英切换
;;[P]-----------------------------------------------[P]
Ch2En: jsr ClrInputArea ;; Clear chinese input screen.
lda #10010000b
jsr MyScanFU
PrcOK:
eece:
jmp call_input_lmain
;;[P]-----------------------------------------------[P]
;; Back space process.
;;[P]-----------------------------------------------[P]
BSPrc1:
smb6 <EFlag
lda <ScanFState
eor #00001000b
sta <ScanFState
lda <CursorSize
bbr3 <ScanFState,ChangeCursor
and #80h
bra ChangeCursor_0
ChangeCursor:
lda #3
bbr7 <CursorSize,ChangeCursor_0
lda #81h
ChangeCursor_0:
sta <CursorSize
jmp call_input_lmain
BSPrc:
jsr ChkInBuf ;; Check input buffor.
bne bsp2
jmp Dci9
bsp2: ldy #7
bsp3: lda (<IND),y
cmp #' '
bne bsp5
dey
bpl bsp3
bra bdp8
bsp5:
lda <INDL ;;
clc ;;
adc #201 ;;
sta <INSL ;;2001-4-17 21:13
lda <INDH ;;
adc #0
sta <INSH ;;
lda #' '
sta (<IND),y
lda #0ffh ;;
sta (<INS),y ;;2001-4-17 21:13
bdp8: jmp call_input_lmain
;;[P]-----------------------------------------------[P]
;; 'ESC' key process for mode 0.
;;[P]-----------------------------------------------[P]
ESC0Prc:
jsr ChkInBuf ;; Check input buffor.
beq EndScanF
jsr MyInitScanF ;; Initial ScanF process.
jmp call_input_lmain
;;[P]-----------------------------------------------[P]
;; 'ESC' key process for mode 1.
;;[P]-----------------------------------------------[P]
ESC1Prc:
jsr MyInitScanF ;; Initial ScanF process.
jmp call_input_lmain
;;[P]-----------------------------------------------[P]
;; 'Down' Key process for english input mode.
;;[P]-----------------------------------------------[P]
EngDnKPrc:
bbs2 <ScanFF,EndScanF1 ;; Branch if fix. english input mode.
jmp Dci9 ;; Null process if not "fix. english input mode".
;;[P]-----------------------------------------------[P]
;; 'Enter' key process.
;;[P]-----------------------------------------------[P]
etprctab:
dw RomPrc-1 ;; 拼音输入处理。
dw IME5Prc-1 ;; 五笔型输入处理。
dw StrPrc-1 ;; 总笔划输入处理。
EnterPrc:
jsr SetChinInBuf ;; Set chinese input buffor location.
bbs2 <ScanFF,EndScanF ;; Branch if Englisg/digit input mode.
jsr ChkInBuf ;; Check input buffor.
beq EndScanF
lda <IME
asl
tax
lda etprctab+1,x
pha
lda etprctab,x
pha
rts
EndScanF:
EndScanF1:
ldx #3
EndScanF2:
jsr MyExitScanF ;; Exit ScanF mode.
jmp main33_Bug
;;[P]-----------------------------------------------[P]
;; 五笔型输入法
;; StrInx
;; +-+-+-+-+-+-+-+-+
;; | 2 1 0 |
;; +-+-+-+-+-+-+-+-+
;;
;;[P]-----------------------------------------------[P]
IME5Prc:
jsr SetChinInBuf ;; Set chinese input buffor location.
stz <StrInxL
stz <StrInxH
ldy #3
ime5p1: ldx #5
ime5p2: asl <StrInxL
rol <StrInxH
dex
bne ime5p2
lda (<IND),y
cmp #' '
beq ime5p3
sec
sbc #'a'-1
ora <StrInxL
sta <StrInxL
ime5p3: dey
bne ime5p1
lda <DRRh
pha
lda <DRRl
pha
lda #>IME5Bank0 ;; Switch to 五笔输入法 Bank。
sta <DRRh
lda #<IME5Bank0 ;; Switch to 五笔输入法 Bank。
sta <DRRl
ldy #0
lda (<IND),y ;; Get 第一个 char.
pha
tay
sec
sbc #'a'
cpy #'j'
bcc ime5p4
ina ;; Next bank.
ime5p4: asl ;; *=2.
tax ;; x = ((char 1) -'a' ) * 2.
lda IME5Inx,x ;; Start of table.
sta <INS
lda IME5Inx+1,x
sta <INS+1
lda IME5Inx+2,x ;; End of table.
sta <IND
lda IME5Inx+3,x
sta <IND+1
pla ;; Get 第一个 char.
ldx #<IME5Bank0
cmp #'j'
bcc ime5p5 ;; Branch if under 'd'.
ldx #<IME5Bank1 ;; Over 'd' ! Then next bank.
ime5p5:
stx <DRRl
lda #>IME5Bank1
sta <drrh
jsr ClrInputArea ;; Clear chinese input screen..
ime5p6: ldy #1
lda <StrInx+1
cmp (INS),y
bne ime5p7
dey ;; Index to low order.
lda <StrInx
sbc (INS),y
beq ime5p8 ;; All match.
ime5p7: clc
lda #4 ;; Next word.
adc <INS
sta <INS
lda #0
adc <INS+1
sta <INS+1
lda <INS+1 ;; INS >= IND ?
cmp <IND+1
bcc ime5p6
bne ime5err ;; INS >= IND.
lda <INS
cmp <IND
bcc ime5p6 ;; INS < IND : Next table.
bra ime5err ;; INS >= IND.
;; Now (INS) = StrInx !
ime5p8: ldy #4
lda <StrInx
cmp (INS),y
bne ime5p9
lda <StrInx+1
iny
cmp (INS),y
bne ime5p9
;; 重码。
jsr SINDChrInLoc ;; Set IND to Char input loction.
lda <IND
sta PhonStr ;;
lda <IND+1
sta PhonStr+1 ;;
stz PhonNo ;; Numbers of phonetic word.
ldx #0ffh
ldy #2-1
ime5p83:
iny
inx
lda (INS),y ;; Get low byte.
pha ;; Store low byte.
iny
lda (INS),y ;; Get high byte.
phx ;; X <-> Y.
phy
plx
ply
iny
sta (<IND),y ;; Store high byte.
dey ;; Index to low location.
pla ;; Load low byte.
sta (<IND),y
iny ;; Index to high location.
phx ;; X <-> Y.
phy
plx
ply
inc PhonNo
iny
lda <StrInx
cmp (INS),y
bne ime5p85
lda <StrInx+1
iny
cmp (INS),y
beq ime5p83
ime5p85:
stz PhonLoc
jmp Pccb
;; 单码。
ime5p9: ldy #2
lda (INS),y
tax
iny
lda (INS),y
tay
pla
sta <DRRl ;; Restore DRR.(Data bank).
pla
sta <DRRh ;; Restore DRR.(Data bank).
jmp Md1NkPOK
ime5err:
jmp PhonErr
;;[P]-----------------------------------------------[P]
;; 汉音输入处理。
;;
;; INS StrInx
;; +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
;; | 5 4 3 2 1 0 |
;; +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
;;
;;[P]-----------------------------------------------[P]
RomPrc:
;;计算编码.
jsr SetChinInBuf ;; Set chinese input buffor location.
stz <StrInxL
stz <StrInxH
stz <INSL
stz <INSH
ldy #0
rp0: lda (<IND),y
cmp #' '
beq rp5
rp1: ldx #5
rp2: lda <StrInxL
asl
sta <StrInxL
lda <StrInxH
rol
sta <StrInxH
lda <INSL
rol
sta <INSL
lda <INSH
rol
sta <INSH
dex
bne rp2
lda (<IND),y
sec
sbc #'a'-1
ora <StrInxL
sta <StrInxL
rp4: iny
cpy #6
bcc rp0
;;-----------------------------------------------------
;; 汉音输入索引表找出。
;;-----------------------------------------------------
rp5:
lda <DRRh
pha
lda <DRRl
pha
lda <INS ;; INS -> IND.
sta <IND
lda <INS+1
sta <IND+1
lda #>RomBank ;; Switch to "汉音" data bank.
sta <DRRh
lda #<RomBank ;; Switch to "汉音" data bank.
sta <DRRl
lda #>RomIndex
sta <INSH
lda #<RomIndex
sta <INSL
rp6: ldy #3
lda (<INS),y
bmi RomErr ;; Branch if end of table.
cmp <INDH
beq rp7
bcs RomErr ;; Branch if no match.
bra rp8
rp7: dey
lda (<INS),y
cmp <INDL
bne rp8
dey
lda (<INS),y
cmp <StrInxH
bne rp8
dey
lda (<INS),y
cmp <StrInxL
bne rp8
ldy #4
lda (<INS),y
sta PhonStr
iny
lda (<INS),y
sta PhonStr+1
sec ;; Calculation numbers of phonetic word.
ldy #10
lda (<INS),y
bra Pcc9
rp8: clc
lda <INSL
adc #6
sta <INSL
bcc rp6
inc <INSH
bra rp6
RomErr: jmp PhonErr
Pcc9: sbc PhonStr
sta PhonNo
stz PhonLoc
Pcca:
jsr ShowPhonWord ;; Show phonetic word.
Pccb:
smb0 <ScanFF
rmb1 <ScanFF ;; Set to select mode.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -