Re: A86: Memory Lock
[Prev][Next][Index][Thread]
Re: A86: Memory Lock
Dux Gregis wrote:
> The [sqrt]KEY program is called (under the right conditons) after the
> _getkey (or possibly _getky in certain calc states) is called and before
> the key press is checked. This is a model of how to create and use
> [sqrt]KEY. I haven't tested it though, so proceed with cation.
>
> ;To create the program:
>
> ld hl,op_info
> rst 20 ;[sqrt]KEY -> OP1
> ld hl, code_end - code
> call $474f ;creates program
> set 6,(iy+24) ;enables program
> ret
>
> op_info:
> .db $12, $4,$10
> .db "KEY",0
>
> ;Here's what some possible [sqrt]KEY code could look like:
> ;(this is intended to override the enter keypress in the delete state)
>
> code:
> call $479f ;special call
> ld a,($d625) ;don't ask me
> bit 0,(iy+$20)
> jr nz,skip_key ;skip if flag not set
> push af ;push getkey
> ld a,($c1b4) ;load calc state
> cp $23 ;check if in delete state
> jr nz,skip_key
;Change this to skip_key2; I missed a pop af
> pop af ;pop getkey
> cp $06 ;check for enter press (might be $09
> instead?)
> jr nz,skip_key
> xor a ;0 out the getkey
> skip_key:
> cp a ;can't hurt
> ret
;And add:skip_key2:
pop af
jr skip_key
> code_end:
References: