File-Manager/MOD0/CURSOR.ASM
2025-04-05 01:58:39 +10:00

67 lines
1.3 KiB
NASM
Executable File
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

;-----------------------------------------------------------
; Šãàá®à ®¡ê¥ªâ  "Input Line" ¨ ä㭪樨 "Command Line"
;-----------------------------------------------------------
INS_CUR_ZG: EQU #9B ; 19h
CURSOR_ZG: EQU #5B ; 1Ah
NORM_ZG: EQU #1B
;
CursorPos:
dw 1E00h ; Y/X ¯®§¨æ¨ï ªãàá®à  (íªà ­. ª®®à¤.)
;
;
PrnILCr:db 3Eh ; ld a,..
Timer: db 1 ; ¯ ã§  ¬¨£ ­¨ï
dec a
call z,PutILCr
ld (Timer),a
ret
PutILCr:db 3Eh ; ld a,..
Flag: db 0 ; ä« £ ªãàá®à  00-­¥â/01-¥áâì
cpl
ld (Flag),a
PILCurs:ld de,(CursorPos) ; Y/X ¯®§¨æ¨ï ªãàá®à 
ld (CursPos1+1),de
xor a
ld c,0B4h ; ¯®«ãç¨âì ᨬ¢®«
rst 08h
ld bc,NORM_ZG*256 + #B5 ; b=§­ ª®£¥­., á=ᨬ¢®« ­  íªà ­
ld a,(Flag)
or a
jr z,curs__
ld b,CURSOR_ZG ; ç¥àâ 
ld a,(D0642) ; ä« £¨ ª« ¢ë
bit 1,a ; ¡¨â Ins
jr nz,$+4
ld b,INS_CUR_ZG ; ¡«®ª
curs__: xor a ; ­®¬¥à ®ª­ 
rst 08h
ld a,1
ld (CurILFl),a ; a=1
ld a,11
ret
; ‚몫îç¨âì ªãàá®à
ResILCr:db 3Eh ; ld a,..
CurILFl:db 0 ; ä« £ ªãàá®à  00-¢ëª«/01-¢ª«
or a
ret z
ld a,-1
ld (Flag),a
inc a
ld (CurILFl),a
ld a,11
ld (Timer),a
CursPos1:
ld de,0 ; Y/X ¯®«®¦.
bit 7,e
ret nz
ld c,0B4h ; ¯®«ãç¨âì ᨬ¢®«
xor a
rst 08h
xor a
ld bc,NORM_ZG*256 + #B5 ; ᨬ¢®« ­  íªà ­
rst 08h
ret